New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@virtuoso.dev/message-list

Package Overview
Dependencies
Maintainers
0
Versions
66
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@virtuoso.dev/message-list - npm Package Compare versions

Comparing version 1.8.1 to 1.8.2

7

CHANGELOG.md

@@ -0,1 +1,8 @@

## [1.8.2](https://github.com/virtuoso-dev/message-list/compare/v1.8.1...v1.8.2) (2024-07-09)
### Bug Fixes
* precise completion of smooth scroll ([7694d8d](https://github.com/virtuoso-dev/message-list/commit/7694d8df35ad85bb54d703b8cad76e215c7b8cd5))
## [1.8.1](https://github.com/virtuoso-dev/message-list/compare/v1.8.0...v1.8.1) (2024-07-08)

@@ -2,0 +9,0 @@

490

dist/index.js
import { jsxs as Jt, jsx as y, Fragment as io } from "react/jsx-runtime";
import h from "react";
import { Cell as c, Signal as x, throttleTime as ve, map as f, mapTo as W, debounceTime as re, filter as d, scan as J, withLatestFrom as S, delayWithMicrotask as Ct, onNext as Xt, Action as ro, useRealm as Ot, useCellValue as V, Realm as lo, RealmContext as co, useCellValues as uo } from "@mdxeditor/gurx";
import { Cell as c, Signal as x, throttleTime as ve, map as f, mapTo as W, debounceTime as ce, filter as d, scan as Q, withLatestFrom as S, delayWithMicrotask as Ot, onNext as Xt, Action as ro, useRealm as Ct, useCellValue as V, Realm as lo, RealmContext as co, useCellValues as uo } from "@mdxeditor/gurx";
function be(e, t) {

@@ -31,6 +31,6 @@ const n = c(e, (o) => {

const [i, r] = en(o);
return Xe(w(e, { k: i, l: tn(o), v: r }));
return Xe(E(e, { k: i, l: tn(o), v: r }));
}
} else
return t < n ? Xe(w(e, { l: kt(o, t) })) : Xe(w(e, { r: kt(s, t) }));
return t < n ? Xe(E(e, { l: kt(o, t) })) : Xe(E(e, { r: kt(s, t) }));
}

@@ -49,3 +49,3 @@ function ge(e, t, n = "k") {

function _(e, t, n) {
return k(e) ? Qt(t, n, 1) : t === e.k ? w(e, { k: t, v: n }) : t < e.k ? Kt(w(e, { l: _(e.l, t, n) })) : Kt(w(e, { r: _(e.r, t, n) }));
return k(e) ? Qt(t, n, 1) : t === e.k ? E(e, { k: t, v: n }) : t < e.k ? Kt(E(e, { l: _(e.l, t, n) })) : Kt(E(e, { r: _(e.r, t, n) }));
}

@@ -80,5 +80,5 @@ function It(e, t, n) {

function tn(e) {
return k(e.r) ? e.l : Xe(w(e, { r: tn(e.r) }));
return k(e.r) ? e.l : Xe(E(e, { r: tn(e.r) }));
}
function w(e, t) {
function E(e, t) {
return Qt(t.k ?? e.k, t.v ?? e.v, t.lvl ?? e.lvl, t.l ?? e.l, t.r ?? e.r);

@@ -98,8 +98,8 @@ }

if (bt(t))
return rn(w(e, { lvl: o - 1 }));
return rn(E(e, { lvl: o - 1 }));
if (!k(t) && !k(t.r))
return w(t.r, {
l: w(t, { r: t.r.l }),
return E(t.r, {
l: E(t, { r: t.r.l }),
lvl: o,
r: w(e, {
r: E(e, {
l: t.r.r,

@@ -112,7 +112,7 @@ lvl: o - 1

if (bt(e))
return St(w(e, { lvl: o - 1 }));
return St(E(e, { lvl: o - 1 }));
if (!k(n) && !k(n.l)) {
const s = n.l, i = bt(s) ? n.lvl - 1 : n.lvl;
return w(s, {
l: w(e, {
return E(s, {
l: E(e, {
lvl: o - 1,

@@ -122,3 +122,3 @@ r: s.l

lvl: s.lvl + 1,
r: St(w(n, { l: s.r, lvl: i }))
r: St(E(n, { l: s.r, lvl: i }))
});

@@ -155,7 +155,7 @@ } else

const { r: t, lvl: n } = e;
return !k(t) && !k(t.r) && t.lvl === n && t.r.lvl === n ? w(t, { l: w(e, { r: t.l }), lvl: n + 1 }) : e;
return !k(t) && !k(t.r) && t.lvl === n && t.r.lvl === n ? E(t, { l: E(e, { r: t.l }), lvl: n + 1 }) : e;
}
function rn(e) {
const { l: t } = e;
return !k(t) && t.lvl === e.lvl ? w(t, { r: w(e, { l: t.r }) }) : e;
return !k(t) && t.lvl === e.lvl ? E(t, { r: E(e, { l: t.r }) }) : e;
}

@@ -178,4 +178,4 @@ function ho(e) {

let u = !1, a = !1;
for (const { start: p, end: b, value: m } of l)
u ? (r >= p || s === m) && (e = kt(e, p)) : (a = m !== s, u = !0), b > r && r >= p && m !== s && (e = _(e, r + 1, m));
for (const { start: p, end: v, value: m } of l)
u ? (r >= p || s === m) && (e = kt(e, p)) : (a = m !== s, u = !0), v > r && r >= p && m !== s && (e = _(e, r + 1, m));
a && (e = _(e, i, s));

@@ -302,5 +302,5 @@ }

}), Ve = c(!1, (e) => {
e.link(e.pipe(T, jt(1), W(!0)), Ve), e.link(e.pipe(T, jt(1), W(!1), re(100)), Ve);
e.link(e.pipe(T, jt(1), W(!0)), Ve), e.link(e.pipe(T, jt(1), W(!1), ce(100)), Ve);
}), yt = c(!1, (e) => {
e.link(e.pipe(Q, W(!0)), yt), e.link(e.pipe(Q, W(!1), re(200)), yt);
e.link(e.pipe(te, W(!0)), yt), e.link(e.pipe(te, W(!1), ce(200)), yt);
}), gn = c(!1), Qe = c(

@@ -311,5 +311,5 @@ null,

e.pipe(
e.combine(j, T, U, xn, hn, pt, X),
e.combine(j, T, U, xn, hn, pt, ee),
d(([, , , , , , t]) => !k(t)),
J((t, [n, o, s, i, r]) => {
Q((t, [n, o, s, i, r]) => {
const u = o + s - n > -r, a = {

@@ -322,7 +322,7 @@ viewportWidth: i,

if (u) {
let b, m;
return o > t.state.scrollTop ? (b = "SCROLLED_DOWN", m = t.state.scrollTop - o) : (b = n === s ? "LIST_TOO_SHORT" : "SIZE_DECREASED", m = t.state.scrollTop - o || t.scrollTopDelta), {
let v, m;
return o > t.state.scrollTop ? (v = "SCROLLED_DOWN", m = t.state.scrollTop - o) : (v = n === s ? "LIST_TOO_SHORT" : "SIZE_DECREASED", m = t.state.scrollTop - o || t.scrollTopDelta), {
atBottom: !0,
state: a,
atBottomBecause: b,
atBottomBecause: v,
scrollTopDelta: m

@@ -346,3 +346,3 @@ };

// filter(([, inProgress]) => !inProgress),
J(
Q(
({ prev: t }, n) => {

@@ -364,3 +364,3 @@ const o = !!(t && n && t.atBottom && !n.atBottom && n.notAtBottomBecause === "SIZE_INCREASED");

S(Qe),
J(
Q(
(t, [n, o]) => {

@@ -374,3 +374,3 @@ let s = 0;

(t) => {
t.delta && e.pub(Q, t.delta);
t.delta && e.pub(te, t.delta);
}

@@ -384,3 +384,3 @@ );

e.combine(T, j, U),
J(
Q(
(t, [n, o, s]) => {

@@ -420,3 +420,3 @@ if (un(t.scrollHeight, o))

T,
J(
Q(
(t, n) => e.getValue(yt) ? { direction: t.direction, prevScrollTop: n } : { direction: n < t.prevScrollTop ? pn : mt, prevScrollTop: n },

@@ -428,3 +428,3 @@ { direction: mt, prevScrollTop: 0 }

Tt
), e.link(e.pipe(T, re(100), W(To)), Tt);
), e.link(e.pipe(T, ce(100), W(To)), Tt);
}), Ut = c(0, (e) => {

@@ -437,3 +437,3 @@ e.link(e.pipe(Ve, d(an), W(0)), Ut), e.link(

d(([, t]) => !!t),
J(([, t], [n]) => [t, n], [0, 0]),
Q(([, t], [n]) => [t, n], [0, 0]),
f(([t, n]) => n - t)

@@ -471,14 +471,14 @@ ),

}) {
const { align: a, behavior: p, offset: b, index: m } = Vt(e, s - 1);
function $() {
const Y = ge(t, m)[1];
if (Y === void 0)
const { align: a, behavior: p, offset: v, index: m } = Vt(e, s - 1);
function w() {
const B = ge(t, m)[1];
if (B === void 0)
throw new Error(`Item at index ${m} not found`);
return Y;
return B;
}
i -= l + u;
let I = xt(m, n) + r - l;
a === "end" ? I = I - i + $() : a === "center" && (I = I - i / 2 + $() / 2), b && (I += b);
let v = 0;
return a === "start" && (v = Math.max(0, Math.min(I - (o - i)))), I = Math.max(0, I), { top: I, behavior: p, align: a, forceBottomSpace: v };
a === "end" ? I = I - i + w() : a === "center" && (I = I - i / 2 + w() / 2), v && (I += v);
let b = 0;
return a === "start" && (b = Math.max(0, Math.min(I - (o - i)))), I = Math.max(0, I), { top: I, behavior: p, align: a, forceBottomSpace: b };
}

@@ -506,4 +506,4 @@ const Me = c(null), Mo = c(!1), et = c(!0), $t = x((e) => {

let { align: i, behavior: r, offset: l, index: u } = Vt(t, n - 1);
const a = typeof t != "number" ? t.done : void 0, [p, b] = cn(u, o);
return p < -s.listOffset ? ((typeof t == "number" || t.align === void 0) && (i = "start-no-overflow"), { index: u, align: i, behavior: r, offset: l, done: a }) : p + b > -s.listOffset + s.visibleListHeight ? ((typeof t == "number" || t.align === void 0) && (i = "end"), { index: u, align: i, behavior: r, offset: l, done: a }) : null;
const a = typeof t != "number" ? t.done : void 0, [p, v] = cn(u, o);
return p < -s.listOffset ? ((typeof t == "number" || t.align === void 0) && (i = "start-no-overflow"), { index: u, align: i, behavior: r, offset: l, done: a }) : p + v > -s.listOffset + s.visibleListHeight ? ((typeof t == "number" || t.align === void 0) && (i = "end"), { index: u, align: i, behavior: r, offset: l, done: a }) : null;
}),

@@ -513,9 +513,9 @@ d((t) => t !== null)

// @ts-expect-error contra variance
Z
X
);
}), Z = x((e) => {
}), X = x((e) => {
const t = e.pipe(
Z,
X,
S(
X,
ee,
ye,

@@ -550,5 +550,5 @@ me,

);
e.link(Z, Me), e.link(t, Te), e.link(
e.link(X, Me), e.link(t, Te), e.link(
e.pipe(
Z,
X,
d((n) => typeof n != "number" && n.index === "LAST"),

@@ -560,4 +560,4 @@ W(!0)

e.pipe(
X,
re(0),
ee,
ce(0),
S(et, Me),

@@ -567,3 +567,3 @@ d(([, n, o]) => !n && o !== null),

),
Z
X
), e.sub(e.pipe(Ne, ve(20)), () => {

@@ -579,6 +579,6 @@ const n = e.getValue(Me);

// wait for the list to render with the specified scrollOffset, so that enough space is available to scroll by
Ct(),
Ot(),
d((n) => n !== 0)
),
Q
te
), e.link(

@@ -601,9 +601,9 @@ e.pipe(

const t = e.pipe(
e.combine(We, X),
e.combine(We, ee),
S(Ae),
d(([[n, o], s]) => n !== null && !k(o) && s !== null),
re(10),
ce(10),
f(([[n]]) => n)
);
e.link(e.pipe(t, Ct()), Z), e.link(
e.link(e.pipe(t, Ot()), X), e.link(
e.pipe(

@@ -614,3 +614,3 @@ t,

// unset the location after the scroll completes
re(10)
ce(10)
),

@@ -625,7 +625,7 @@ Ae

de(e).forEach(({ k: r, v: l }) => {
var p, b;
var p, v;
for (; n.length && n[0] < r; )
n.shift(), o++;
const u = Math.max(0, r - o), a = ((p = s.at(-1)) == null ? void 0 : p.k) ?? -1;
u === a ? (((b = s.at(-2)) == null ? void 0 : b.v) ?? -1) === l ? s.pop() : s[s.length - 1].v = l : s.push({ k: u, v: l });
u === a ? (((v = s.at(-2)) == null ? void 0 : v.v) ?? -1) === l ? s.pop() : s[s.length - 1].v = l : s.push({ k: u, v: l });
});

@@ -650,4 +650,4 @@ let i = $e();

}
const Co = [], De = {
items: Co,
const Oo = [], De = {
items: Oo,
listBottom: 0,

@@ -666,7 +666,7 @@ listTop: 0,

$n,
X,
ee,
ye,
me,
we,
O,
C,
ot,

@@ -686,3 +686,3 @@ We,

}),
J(
Q(
(t, [

@@ -698,7 +698,7 @@ n,

p,
b,
v,
m,
$,
w,
I,
v
b
]) => {

@@ -712,6 +712,6 @@ var Ge;

}
let Y = 0;
b !== null && n === 0 && (Y = vn({
let B = 0;
v !== null && n === 0 && (B = vn({
totalHeight: l,
location: b,
location: v,
sizeTree: s,

@@ -722,35 +722,35 @@ offsetTree: i,

headerHeight: e.getValue(at),
stickyHeaderHeight: $,
stickyHeaderHeight: w,
stickyFooterHeight: I
}).top ?? 0);
const B = Math.min(
Math.max(n + Y + a - v - m, 0),
const Y = Math.min(
Math.max(n + B + a - b - m, 0),
l - o
), ce = B + o;
if (t.offsetTree === i && t.totalCount === r && t.data === u && B >= t.listTop && ce <= t.listBottom)
), q = Y + o;
if (t.offsetTree === i && t.totalCount === r && t.data === u && Y >= t.listTop && q <= t.listBottom)
return t;
const ue = [], q = r - 1, P = 0, L = Io(i, B, ce, P);
const G = [], Z = r - 1, P = 0, L = Io(i, Y, q, P);
let R = 0, Ue = 0, qe = !1;
for (const N of L) {
const {
value: { offset: ke, height: te }
value: { offset: ke, height: oe }
} = N;
let G = N.start;
R = ke, ke < B && (G += Math.floor((B - ke) / te), R += (G - N.start) * te), G < P && (R += (P - G) * te, G = P);
const Le = Math.min(N.end, q);
for (let ne = G; ne <= Le && !(R >= ce); ne++) {
let J = N.start;
R = ke, ke < Y && (J += Math.floor((Y - ke) / oe), R += (J - N.start) * oe), J < P && (R += (P - J) * oe, J = P);
const Le = Math.min(N.end, Z);
for (let se = J; se <= Le && !(R >= q); se++) {
const ht = {
data: u == null ? void 0 : u[ne],
prevData: (u == null ? void 0 : u[ne - 1]) ?? null,
nextData: (u == null ? void 0 : u[ne + 1]) ?? null,
height: te,
index: ne,
data: u == null ? void 0 : u[se],
prevData: (u == null ? void 0 : u[se - 1]) ?? null,
nextData: (u == null ? void 0 : u[se + 1]) ?? null,
height: oe,
index: se,
offset: R,
type: "flat"
};
qe || (qe = !0, Ue = R), ue.push(ht), R += te;
qe || (qe = !0, Ue = R), G.push(ht), R += oe;
}
}
const E = l - R, ee = ((Ge = ue[0]) == null ? void 0 : Ge.offset) || 0;
return { items: ue, listBottom: R, listTop: Ue, offsetTree: i, paddingBottom: E, paddingTop: ee, totalCount: r, data: u };
const $ = l - R, ne = ((Ge = G[0]) == null ? void 0 : Ge.offset) || 0;
return { items: G, listBottom: R, listTop: Ue, offsetTree: i, paddingBottom: $, paddingTop: ne, totalCount: r, data: u };
},

@@ -770,3 +770,3 @@ De

})
)), K = c(!1), Ce = c(!1), tt = x((e) => {
)), K = c(!1), Oe = c(!1), tt = x((e) => {
e.link(

@@ -777,3 +777,3 @@ e.pipe(

d(([, , t]) => !t),
J(
Q(
([, t, n, o], [{ items: s, totalCount: i, listBottom: r, paddingBottom: l }, u]) => {

@@ -795,3 +795,3 @@ const a = r + l;

}), e.sub(
e.pipe(e.combine(T, F, he, Ce)),
e.pipe(e.combine(T, F, he, Oe)),
([t, n, o, s]) => {

@@ -812,3 +812,3 @@ o || s || (n > 0 && t < n ? (e.pub(K, !0), e.pub(Te, { top: 0, behavior: "instant" }), setTimeout(() => {

e.pipe(
e.combine(Ve, F, K, he, Ce),
e.combine(Ve, F, K, he, Oe),
d(

@@ -821,7 +821,7 @@ ([t, n, o, s, i]) => !t && n !== 0 && !o && !s && !i

e.pub(K, !0), t < 0 ? requestAnimationFrame(() => {
e.pub(Q, -t), e.pub(F, 0), requestAnimationFrame(() => {
e.pub(te, -t), e.pub(F, 0), requestAnimationFrame(() => {
e.pub(K, !1);
});
}) : requestAnimationFrame(() => {
e.pub(Q, -t), e.pub(F, 0), requestAnimationFrame(() => {
e.pub(te, -t), e.pub(F, 0), requestAnimationFrame(() => {
e.pub(K, !1);

@@ -831,7 +831,7 @@ });

}
)) : e.link(tt, Q);
}), me = c(0), _e = c(null), O = c(null, (e) => {
)) : e.link(tt, te);
}), me = c(0), _e = c(null), C = c(null, (e) => {
e.link(
e.pipe(
O,
C,
d((t) => t !== null),

@@ -842,6 +842,6 @@ f((t) => t.length)

);
}), Re = c(null), se = x((e) => {
}), Re = c(null), re = x((e) => {
e.link(
e.pipe(
se,
re,
S(Be),

@@ -851,6 +851,6 @@ f(([n, o]) => -(o * n.length))

F
), e.link(e.pipe(se, W(!0)), Ce), e.link(e.pipe(se, Ct()), Re);
), e.link(e.pipe(re, W(!0)), Oe), e.link(e.pipe(re, Ot()), Re);
function t(n, o) {
e.pubIn({
[Q]: n,
[te]: n,
[st]: n

@@ -862,3 +862,3 @@ }), o ? requestAnimationFrame(() => {

[Re]: null,
[Ce]: !1
[Oe]: !1
});

@@ -869,3 +869,3 @@ }) : e.pubIn({

[Re]: null,
[Ce]: !1
[Oe]: !1
});

@@ -889,4 +889,4 @@ }

e.pipe(
se,
Oo(2),
re,
Co(2),
S(ye, Re),

@@ -899,6 +899,6 @@ d(([, , n]) => n !== null),

}
), e.changeWith(O, se, (n, o) => n ? [...o, ...n] : o.slice()), e.link(
), e.changeWith(C, re, (n, o) => n ? [...o, ...n] : o.slice()), e.link(
e.pipe(
se,
S(X, Be),
re,
S(ee, Be),
f(([n, o, s]) => {

@@ -925,3 +925,3 @@ const i = n.length, r = s;

ut,
S(je, Wt, _e, X),
S(je, Wt, _e, ee),
d(([, , , , o]) => !k(o)),

@@ -981,10 +981,10 @@ f(([{ data: o, scrollToBottom: s }, i, r, l]) => {

d((o) => o !== null),
re(20)
ce(20)
),
Z
X
);
}), lt = x((e) => {
e.changeWith(O, lt, (t, n) => t ? [...t, ...n.data] : n.data.slice()), e.link(lt, ut);
e.changeWith(C, lt, (t, n) => t ? [...t, ...n.data] : n.data.slice()), e.link(lt, ut);
}), nt = x((e) => {
e.changeWith(O, nt, (t, n) => t ? [...t.slice(0, n.offset), ...n.data, ...t.slice(n.offset)] : n.data.slice()), e.changeWith(le, nt, ([t], n) => {
e.changeWith(C, nt, (t, n) => t ? [...t.slice(0, n.offset), ...n.data, ...t.slice(n.offset)] : n.data.slice()), e.changeWith(ue, nt, ([t], n) => {
const s = ge(t, n.offset, "k")[0], i = n.data.length;

@@ -994,7 +994,7 @@ return [ao(t, s, 1 / 0, (l, u) => [l + i, u]), s];

}), Et = x((e) => {
e.changeWith(O, Et, (t, { offset: n, count: o }) => t ? t.slice(0, n).concat(t.slice(n + o)) : []), e.changeWith(le, Et, ([t], { offset: n, count: o }) => [po(t, n, o), n]);
}), Oe = x((e) => {
e.changeWith(C, Et, (t, { offset: n, count: o }) => t ? t.slice(0, n).concat(t.slice(n + o)) : []), e.changeWith(ue, Et, ([t], { offset: n, count: o }) => [po(t, n, o), n]);
}), Ce = x((e) => {
e.link(
e.pipe(
Oe,
Ce,
d(({ purgeItemSizes: t }) => !!t),

@@ -1004,12 +1004,12 @@ f(({ initialLocation: t }) => t)

We
), e.changeWith(Ee, Oe, (t, { purgeItemSizes: n }) => n ? De : t), e.sub(e.pipe(Oe, ve(0)), ({ data: t, purgeItemSizes: n, initialLocation: o }) => {
), e.changeWith(Ee, Ce, (t, { purgeItemSizes: n }) => n ? De : t), e.sub(e.pipe(Ce, ve(0)), ({ data: t, purgeItemSizes: n, initialLocation: o }) => {
e.pubIn({
[O]: t.slice(),
...n ? { [le]: ct } : o ? { [Z]: o } : {}
[C]: t.slice(),
...n ? { [ue]: ct } : o ? { [X]: o } : {}
});
});
}), qt = x((e) => {
e.changeWith(O, qt, (t, n) => t ? t.slice(n) : []), e.changeWith(le, qt, ([t], n) => [de(t).reduce((s, { k: i, v: r }) => _(s, Math.max(0, i - n), r), $e()), 0]);
e.changeWith(C, qt, (t, n) => t ? t.slice(n) : []), e.changeWith(ue, qt, ([t], n) => [de(t).reduce((s, { k: i, v: r }) => _(s, Math.max(0, i - n), r), $e()), 0]);
}), Gt = x((e) => {
e.changeWith(O, Gt, (t, n) => t ? t.slice(0, t.length - n) : []), e.link(
e.changeWith(C, Gt, (t, n) => t ? t.slice(0, t.length - n) : []), e.link(
e.pipe(

@@ -1031,3 +1031,3 @@ Gt,

mn,
S(O),
S(C),
f(([n, o]) => {

@@ -1042,5 +1042,5 @@ if (!o)

);
e.changeWith(O, t, (n, o) => n ? n.filter((s, i) => !o.includes(i)) : []), e.changeWith(le, t, ([n], o) => [Do(n, o), 0]);
e.changeWith(C, t, (n, o) => n ? n.filter((s, i) => !o.includes(i)) : []), e.changeWith(ue, t, ([n], o) => [Do(n, o), 0]);
}), wt = x((e) => {
e.changeWith(O, wt, (t, { mapper: n }) => t ? t.map(n) : []), e.link(
e.changeWith(C, wt, (t, { mapper: n }) => t ? t.map(n) : []), e.link(
e.pipe(

@@ -1053,6 +1053,6 @@ wt,

),
Z
X
);
});
function Oo(e = 1) {
function Co(e = 1) {
return (t, n) => {

@@ -1075,3 +1075,3 @@ const o = n.signalInstance();

c(NaN);
const he = c(!1), le = c(ct, (e) => {
const he = c(!1), ue = c(ct, (e) => {
e.link(

@@ -1081,14 +1081,14 @@ e.pipe(

d((t) => t.length > 0),
S(X),
S(ee),
f(([t, n]) => vo(n, [t, []]))
),
le
ue
);
}), X = c(ct[0], (e) => {
}), ee = c(ct[0], (e) => {
e.link(
e.pipe(
le,
ue,
f(([t]) => t)
),
X
ee
);

@@ -1098,3 +1098,3 @@ }), kn = c(ct[1], (e) => {

e.pipe(
le,
ue,
f(([, t]) => t)

@@ -1107,5 +1107,5 @@ ),

e.pipe(
X,
ee,
S(kn),
J(([t], [n, o]) => So(t, [n, o]), xe)
Q(([t], [n, o]) => So(t, [n, o]), xe)
),

@@ -1229,11 +1229,11 @@ He

p,
b
v
]) => {
const m = e.getValue(hn), $ = r - n - o, I = -t + s, v = l === 0 ? $ + Math.min(0, I) - i : -l;
const m = e.getValue(hn), w = r - n - o, I = -t + s, b = l === 0 ? w + Math.min(0, I) - i : -l;
return {
scrollHeight: $,
scrollHeight: w,
listOffset: I,
visibleListHeight: i,
bottomOffset: v,
isAtBottom: b || v <= m
bottomOffset: b,
isAtBottom: v || b <= m
};

@@ -1247,3 +1247,3 @@ }

T,
re(0),
ce(0),
S(je),

@@ -1255,6 +1255,6 @@ d(([, t]) => t.scrollHeight > 0),

);
}), Q = x(), F = c(0), st = c(0), Mt = c(0), wn = c(""), Ft = x(), Ln = ({ index: e }) => /* @__PURE__ */ Jt("div", { children: [
}), te = x(), F = c(0), st = c(0), Mt = c(0), wn = c(""), Ft = x(), Ln = ({ index: e }) => /* @__PURE__ */ Jt("div", { children: [
"Item ",
e
] }), Rn = ({ index: e }) => e, Dt = c(Ln), Mn = c(Rn), Dn = c(null), An = c(null), Cn = c(null), On = c(null), Hn = c(null), Vn = c("div"), Bo = {
] }), Rn = ({ index: e }) => e, Dt = c(Ln), Mn = c(Rn), Dn = c(null), An = c(null), On = c(null), Cn = c(null), Hn = c(null), Vn = c("div"), Bo = {
position: "sticky",

@@ -1284,3 +1284,3 @@ top: 0,

d(([, t]) => t === "bottom-smooth"),
J(
Q(
(t, [n]) => [t[1], n],

@@ -1318,6 +1318,6 @@ [0, 0]

const l = n, u = o, a = s, p = i;
o = C(
o = C(
o = C(
o = C(
o = O(
o = O(
o = O(
o = O(
o = A(

@@ -1516,5 +1516,5 @@ o = A(

),
s = C(
s = O(
s,
i = C(i, n = C(n, o, s, i, e[r + 0], 6, -198630844), o, s, e[r + 7], 10, 1126891415),
i = O(i, n = O(n, o, s, i, e[r + 0], 6, -198630844), o, s, e[r + 7], 10, 1126891415),
n,

@@ -1532,5 +1532,5 @@ o,

),
s = C(
s = O(
s,
i = C(i, n = C(n, o, s, i, e[r + 12], 6, 1700485571), o, s, e[r + 3], 10, -1894986606),
i = O(i, n = O(n, o, s, i, e[r + 12], 6, 1700485571), o, s, e[r + 3], 10, -1894986606),
n,

@@ -1548,5 +1548,5 @@ o,

),
s = C(
s = O(
s,
i = C(i, n = C(n, o, s, i, e[r + 8], 6, 1873313359), o, s, e[r + 15], 10, -30611744),
i = O(i, n = O(n, o, s, i, e[r + 8], 6, 1873313359), o, s, e[r + 15], 10, -30611744),
n,

@@ -1564,5 +1564,5 @@ o,

),
s = C(
s = O(
s,
i = C(i, n = C(n, o, s, i, e[r + 4], 6, -145523070), o, s, e[r + 11], 10, -1120210379),
i = O(i, n = O(n, o, s, i, e[r + 4], 6, -145523070), o, s, e[r + 11], 10, -1120210379),
n,

@@ -1579,3 +1579,3 @@ o,

-343485551
), n = ie(n, l), o = ie(o, u), s = ie(s, a), i = ie(i, p);
), n = le(n, l), o = le(o, u), s = le(s, a), i = le(i, p);
}

@@ -1585,3 +1585,3 @@ return [n, o, s, i];

function ft(e, t, n, o, s, i) {
return ie(Uo(ie(ie(t, e), ie(o, i)), s), n);
return le(Uo(le(le(t, e), le(o, i)), s), n);
}

@@ -1597,6 +1597,6 @@ function M(e, t, n, o, s, i, r) {

}
function C(e, t, n, o, s, i, r) {
function O(e, t, n, o, s, i, r) {
return ft(n ^ (t | ~o), e, t, s, i, r);
}
function ie(e, t) {
function le(e, t) {
const n = (65535 & e) + (65535 & t);

@@ -1666,3 +1666,3 @@ return (e >> 16) + (t >> 16) + (n >> 16) << 16 | 65535 & n;

now: /* @__PURE__ */ new Date(),
packageTimestamp: 1720423940030
packageTimestamp: 1720508920212
});

@@ -1674,3 +1674,3 @@ return /* @__PURE__ */ y(Un.Provider, { value: n, children: t });

function ls(e, t, n) {
const o = Ot(), s = h.useRef(null), i = h.useRef(null);
const o = Ct(), s = h.useRef(null), i = h.useRef(null);
function r() {

@@ -1683,14 +1683,14 @@ s.current && (cancelAnimationFrame(s.current), s.current = null, i.current = null);

const l = h.useCallback(
(a, p, b) => {
var v;
(a, p, v) => {
var B;
s.current && r();
const m = ((v = e.current) == null ? void 0 : v.scrollTop) ?? 0;
const m = ((B = e.current) == null ? void 0 : B.scrollTop) ?? 0;
i.current = m < a ? "down" : "up";
let $ = 0;
function I() {
var B;
const Y = m + (a - m) * p($);
(B = e.current) == null || B.scrollTo({ top: Y, behavior: "instant" }), $ += 1 / b, $ < 1 ? s.current = requestAnimationFrame(I) : (s.current = null, i.current = null);
let w = 0, I = 0;
function b() {
var q, G;
const Y = m + (a - m) * p(w);
(q = e.current) == null || q.scrollTo({ top: Y, behavior: "instant" }), w += 1 / v, I += 1, I < v ? s.current = requestAnimationFrame(b) : ((G = e.current) == null || G.scrollTo({ top: a, behavior: "instant" }), s.current = null, i.current = null);
}
I();
b();
},

@@ -1701,5 +1701,5 @@ [e]

(a) => {
var p, b, m, $;
var p, v, m, w;
if (a.top === ((p = e.current) == null ? void 0 : p.scrollTop)) {
o.pub(Ne, (b = e.current) == null ? void 0 : b.scrollTop);
o.pub(Ne, (v = e.current) == null ? void 0 : v.scrollTop);
return;

@@ -1712,4 +1712,4 @@ }

else {
const { easing: I, animationFrameCount: v } = a.behavior((($ = e.current) == null ? void 0 : $.scrollTop) ?? 0, a.top ?? 0);
l(a.top ?? 0, I, v);
const { easing: I, animationFrameCount: b } = a.behavior(((w = e.current) == null ? void 0 : w.scrollTop) ?? 0, a.top ?? 0);
l(a.top ?? 0, I, b);
}

@@ -1724,3 +1724,3 @@ },

prepend: (t) => {
e.pub(se, t);
e.pub(re, t);
},

@@ -1734,3 +1734,3 @@ append: (t, n) => {

replace: (t, n) => {
e.pub(Oe, {
e.pub(Ce, {
...n,

@@ -1749,4 +1749,4 @@ data: t

},
findIndex: (t) => e.getValue(O).findIndex(t),
find: (t) => e.getValue(O).find(t),
findIndex: (t) => e.getValue(C).findIndex(t),
find: (t) => e.getValue(C).find(t),
insert: function(t, n, o) {

@@ -1768,7 +1768,7 @@ e.pub(nt, {

},
get: () => e.getValue(O).slice(),
get: () => e.getValue(C).slice(),
getCurrentlyRendered: () => e.getValue(rt)
},
scrollToItem: (t) => {
e.pub(Z, t);
e.pub(X, t);
},

@@ -1833,15 +1833,15 @@ scrollIntoView: (t) => {

Footer: p = null,
StickyFooter: b = null,
StickyFooter: v = null,
EmptyPlaceholder: m = null,
HeaderWrapper: $ = Wn,
HeaderWrapper: w = Wn,
StickyHeaderWrapper: I = Fn,
FooterWrapper: v = _n,
StickyFooterWrapper: Y = Bn,
ScrollElement: B = "div",
...ce
}, ue) => {
const q = h.useMemo(() => {
FooterWrapper: b = _n,
StickyFooterWrapper: B = Bn,
ScrollElement: Y = "div",
...q
}, G) => {
const Z = h.useMemo(() => {
const L = new lo();
return L.register(Ee), L.register(Pe), L.register(tt), L.register(Qe), L.register(lt), L.register(se), L.register(Oe), L.pubIn({
[O]: e.slice(),
return L.register(Ee), L.register(Pe), L.register(tt), L.register(Qe), L.register(lt), L.register(re), L.register(Ce), L.pubIn({
[C]: e.slice(),
[_e]: n,

@@ -1852,19 +1852,19 @@ [Mn]: t,

[Dn]: u,
[Cn]: p,
[On]: p,
[An]: a,
[On]: b,
[Cn]: v,
[Hn]: m,
[Vn]: B,
[Yn]: Y,
[Vn]: Y,
[Yn]: B,
[Nn]: I,
[zn]: v,
[Pn]: $,
[zn]: b,
[Pn]: w,
[At]: s
}), L.singletonSub(Rt, i), L.singletonSub(rt, r), L;
}, []);
h.useImperativeHandle(ue, () => qn(q), [q]), h.useEffect(() => {
q.pubIn({
h.useImperativeHandle(G, () => qn(Z), [Z]), h.useEffect(() => {
Z.pubIn({
[_e]: n,
[Dt]: l
}), q.singletonSub(Rt, i), q.singletonSub(rt, r);
}), Z.singletonSub(Rt, i), Z.singletonSub(rt, r);
});

@@ -1890,3 +1890,3 @@ const P = h.useContext(Un);

}
) : /* @__PURE__ */ y(co.Provider, { value: q, children: /* @__PURE__ */ y(as, { ...ce }) });
) : /* @__PURE__ */ y(co.Provider, { value: Z, children: /* @__PURE__ */ y(as, { ...q }) });
}

@@ -1896,3 +1896,3 @@ );

const as = ({ style: e, ...t }) => {
const n = Ot(), o = h.useContext(rs), [
const n = Ct(), o = h.useContext(rs), [
s,

@@ -1905,5 +1905,5 @@ i,

p,
b,
v,
m,
$,
w,
I

@@ -1915,4 +1915,4 @@ ] = uo(

Nn,
On,
Cn,
On,
zn,

@@ -1923,3 +1923,3 @@ Yn,

Vn
), [v] = h.useState(() => {
), [b] = h.useState(() => {
if (typeof ResizeObserver > "u")

@@ -1929,3 +1929,3 @@ throw new Error("ResizeObserver not found. Please ensure that you have a polyfill installed.");

var Bt, Pt, Nt, zt;
const Ie = g.length, oe = [];
const Ie = g.length, ie = [];
let H = {};

@@ -1938,3 +1938,3 @@ for (let gt = 0; gt < Ie; gt++) {

[Ye]: pe.contentRect.height,
[j]: (Bt = E.current) == null ? void 0 : Bt.scrollHeight
[j]: (Bt = $.current) == null ? void 0 : Bt.scrollHeight
};

@@ -1946,20 +1946,20 @@ continue;

[ze]: pe.contentRect.height,
[j]: (Pt = E.current) == null ? void 0 : Pt.scrollHeight
[j]: (Pt = $.current) == null ? void 0 : Pt.scrollHeight
};
continue;
} else if (z === B.current) {
} else if (z === Y.current) {
H = {
...H,
[_t]: pe.contentRect.height,
[j]: (Nt = E.current) == null ? void 0 : Nt.scrollHeight
[j]: (Nt = $.current) == null ? void 0 : Nt.scrollHeight
};
continue;
} else if (z === ue.current) {
} else if (z === G.current) {
H = {
...H,
[Ke]: pe.contentRect.height,
[j]: (zt = E.current) == null ? void 0 : zt.scrollHeight
[j]: (zt = $.current) == null ? void 0 : zt.scrollHeight
};
continue;
} else if (z === E.current) {
} else if (z === $.current) {
H = {

@@ -1973,6 +1973,6 @@ ...H,

continue;
} else if (z === ee.current) {
E.current && (H = {
} else if (z === ne.current) {
$.current && (H = {
...H,
[j]: E.current.scrollHeight
[j]: $.current.scrollHeight
});

@@ -1986,11 +1986,11 @@ continue;

continue;
const Yt = oe[oe.length - 1];
oe.length === 0 || Yt.size !== vt || Yt.endIndex !== dt - 1 ? oe.push({ endIndex: dt, size: vt, startIndex: dt }) : oe[oe.length - 1].endIndex++;
const Yt = ie[ie.length - 1];
ie.length === 0 || Yt.size !== vt || Yt.endIndex !== dt - 1 ? ie.push({ endIndex: dt, size: vt, startIndex: dt }) : ie[ie.length - 1].endIndex++;
}
oe.length > 0 && (H = {
ie.length > 0 && (H = {
...H,
[Fe]: oe
[Fe]: ie
}), n.pubIn(H);
});
}), [Y, B] = Je(v), [ce, ue] = Je(v), [q, P] = Je(v), [L, R] = Je(v), Ue = h.useCallback(
}), [B, Y] = Je(b), [q, G] = Je(b), [Z, P] = Je(b), [L, R] = Je(b), Ue = h.useCallback(
(g) => {

@@ -2007,19 +2007,19 @@ if (o) {

}
v.observe(g);
b.observe(g);
},
[v, n, o]
[b, n, o]
), qe = h.useCallback(
(g) => {
v.unobserve(g);
b.unobserve(g);
},
[v]
), E = h.useRef(null), ee = h.useRef(null), Ge = h.useCallback(
[b]
), $ = h.useRef(null), ne = h.useRef(null), Ge = h.useCallback(
(g) => {
g ? (ee.current = g, v.observe(g, { box: "border-box" })) : ee.current && (v.unobserve(ee.current), ee.current = null);
g ? (ne.current = g, b.observe(g, { box: "border-box" })) : ne.current && (b.unobserve(ne.current), ne.current = null);
},
[v]
), N = h.useRef(null), ke = ls(E, ee, N), te = h.useCallback((g) => {
E.current && (E.current.scrollTop += g);
}, []), G = h.useCallback(() => {
const g = E.current;
[b]
), N = h.useRef(null), ke = ls($, ne, N), oe = h.useCallback((g) => {
$.current && ($.current.scrollTop += g);
}, []), J = h.useCallback(() => {
const g = $.current;
if (g !== null) {

@@ -2037,13 +2037,13 @@ if (N.current !== null) {

[n]
), ne = h.useCallback(
), se = h.useCallback(
(g) => {
g ? (n.pub(Lt, g), E.current = g, g.addEventListener("scroll", G), g.addEventListener("wheel", Le), o && n.pubIn({
g ? (n.pub(Lt, g), $.current = g, g.addEventListener("scroll", J), g.addEventListener("wheel", Le), o && n.pubIn({
[U]: o.viewportHeight,
[j]: o.viewportHeight,
[T]: 0
}), v.observe(g, { box: "border-box" })) : E.current && (E.current.removeEventListener("scroll", G), E.current.removeEventListener("wheel", Le), n.pub(Lt, null), v.unobserve(E.current), E.current = null);
}), b.observe(g, { box: "border-box" })) : $.current && ($.current.removeEventListener("scroll", J), $.current.removeEventListener("wheel", Le), n.pub(Lt, null), b.unobserve($.current), $.current = null);
},
[v, n, G, Le, o]
[b, n, J, Le, o]
), { items: ht } = V(Ee);
h.useLayoutEffect(() => n.sub(Te, ke), [ke, n]), h.useLayoutEffect(() => n.sub(Q, te), [te, n]);
h.useLayoutEffect(() => n.sub(Te, ke), [ke, n]), h.useLayoutEffect(() => n.sub(te, oe), [oe, n]);
const Gn = V(F), Zn = V(st), Jn = V(K), Xn = V(Mt), Qn = V(pt), eo = V(wn), ae = V(_e), to = V(Mn), no = V(me), oo = V(we);

@@ -2054,3 +2054,3 @@ return /* @__PURE__ */ y(io, { children: /* @__PURE__ */ Jt(

...t,
ref: ne,
ref: se,
"data-testid": "virtuoso-scroller",

@@ -2065,3 +2065,3 @@ style: {

i && /* @__PURE__ */ y(l, { ref: L, style: Ze, children: /* @__PURE__ */ y(i, { context: ae }) }),
s && /* @__PURE__ */ y(r, { ref: q, style: Ze, children: /* @__PURE__ */ y(s, { context: ae }) }),
s && /* @__PURE__ */ y(r, { ref: Z, style: Ze, children: /* @__PURE__ */ y(s, { context: ae }) }),
no > 0 ? /* @__PURE__ */ y(

@@ -2093,5 +2093,5 @@ "div",

}
) : $ ? /* @__PURE__ */ y($, { context: ae }) : null,
u && /* @__PURE__ */ y(p, { ref: Y, style: Ze, children: /* @__PURE__ */ y(u, { context: ae }) }),
a && /* @__PURE__ */ y(b, { ref: ce, style: Ze, children: /* @__PURE__ */ y(a, { context: ae }) })
) : w ? /* @__PURE__ */ y(w, { context: ae }) : null,
u && /* @__PURE__ */ y(p, { ref: B, style: Ze, children: /* @__PURE__ */ y(u, { context: ae }) }),
a && /* @__PURE__ */ y(v, { ref: q, style: Ze, children: /* @__PURE__ */ y(a, { context: ae }) })
]

@@ -2108,3 +2108,3 @@ }

function vs() {
const e = Ot();
const e = Ct();
return h.useMemo(() => qn(e), [e]);

@@ -2111,0 +2111,0 @@ }

@@ -23,3 +23,3 @@ {

},
"version": "1.8.1",
"version": "1.8.2",
"type": "module",

@@ -26,0 +26,0 @@ "module": "dist/index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc