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
2
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.4.1 to 1.5.0

7

CHANGELOG.md

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

# [1.5.0](https://github.com/virtuoso-dev/message-list/compare/v1.4.1...v1.5.0) (2024-05-03)
### Features
* scrollToItem done callback ([5a646d7](https://github.com/virtuoso-dev/message-list/commit/5a646d7bcc73dd1abb1fbe1b4e2ad8f7b48a8cea))
## [1.4.1](https://github.com/virtuoso-dev/message-list/compare/v1.4.0...v1.4.1) (2024-05-02)

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

4

dist/index.d.ts

@@ -121,2 +121,6 @@ /// <reference types="react" />

offset?: number;
/**
* A callback that's invoked when the scroll is complete.
*/
done?: () => void;
}

@@ -123,0 +127,0 @@

155

dist/index.js

@@ -31,6 +31,6 @@ import { jsxs as Tt, jsx as b, Fragment as In } from "react/jsx-runtime";

const [i, r] = Mt(o);
return Re(I(e, { k: i, l: Lt(o), v: r }));
return Ae(I(e, { k: i, l: Lt(o), v: r }));
}
} else
return t < n ? Re(I(e, { l: Je(o, t) })) : Re(I(e, { r: Je(s, t) }));
return t < n ? Ae(I(e, { l: Je(o, t) })) : Ae(I(e, { r: Je(s, t) }));
}

@@ -65,3 +65,3 @@ function re(e, t, n = "k") {

function Lt(e) {
return v(e.r) ? e.l : Re(I(e, { r: Lt(e.r) }));
return v(e.r) ? e.l : Ae(I(e, { r: Lt(e.r) }));
}

@@ -71,3 +71,3 @@ function I(e, t) {

}
function je(e) {
function qe(e) {
return v(e) || e.lvl > e.r.lvl;

@@ -78,3 +78,3 @@ }

}
function Re(e) {
function Ae(e) {
const { l: t, r: n, lvl: o } = e;

@@ -84,3 +84,3 @@ if (n.lvl >= o - 1 && t.lvl >= o - 1)

if (o > n.lvl + 1) {
if (je(t))
if (qe(t))
return Rt(I(e, { lvl: o - 1 }));

@@ -98,6 +98,6 @@ if (!v(t) && !v(t.r))

} else {
if (je(e))
if (qe(e))
return Qe(I(e, { lvl: o - 1 }));
if (!v(n) && !v(n.l)) {
const s = n.l, i = je(s) ? n.lvl - 1 : n.lvl;
const s = n.l, i = qe(s) ? n.lvl - 1 : n.lvl;
return I(s, {

@@ -177,3 +177,3 @@ l: I(e, {

}
function Be(e, t, n, o = 0) {
function Oe(e, t, n, o = 0) {
let s = e.length - 1;

@@ -197,6 +197,6 @@ for (; o <= s; ) {

function At(e, t, n) {
return e[Be(e, t, n)];
return e[Oe(e, t, n)];
}
function wn(e, t, n, o) {
const s = Be(e, t, o), i = Be(e, n, o, s);
const s = Oe(e, t, o), i = Oe(e, n, o, s);
return e.slice(s, i + 1);

@@ -220,3 +220,3 @@ }

if (n !== 0) {
r = Be(e, n - 1, ft), i = e[r].offset;
r = Oe(e, n - 1, ft), i = e[r].offset;
const c = re(t, n - 1);

@@ -290,4 +290,4 @@ o = c[0], s = c[1], e.length && e[r].height === re(t, n)[1] && (r -= 1), e = e.slice(0, r + 1);

}
const qe = l(null), On = l(!1), Ue = l(!0), q = $((e) => {
e.link(q, qe), e.link(
const De = l(null), On = l(!1), Ue = l(!0), q = $((e) => {
e.link(q, De), e.link(
e.pipe(

@@ -334,3 +334,3 @@ q,

he(),
S(Ue, qe),
S(Ue, De),
m(([, t, n]) => !t && n !== null),

@@ -340,5 +340,6 @@ a(([, , t]) => t)

q
), e.sub(e.pipe(Fe, oe(20)), () => {
e.pubIn({
[qe]: null,
), e.sub(e.pipe(_e, oe(20)), () => {
const t = e.getValue(De);
t !== null && typeof t != "number" && t.done !== void 0 && t.done(), e.pubIn({
[De]: null,
[Ue]: !0

@@ -348,3 +349,3 @@ });

e.pipe(
He,
Be,
// wait for the list to render with the specified scrollOffset, so that enough space is available to scroll by

@@ -358,19 +359,19 @@ he(),

e.pipe(
He,
Be,
Ze(y),
a(() => 0)
),
He
Be
);
}), Oe = l(null), Ve = l(null, (e) => {
}), Ve = l(null), We = l(null, (e) => {
e.link(
e.pipe(
Ve,
We,
m((n) => n !== null),
bt()
),
Oe
Ve
);
const t = e.pipe(
e.combine(Ve, P),
e.combine(We, P),
m(([n, o]) => n !== null && !v(o)),

@@ -390,3 +391,3 @@ bt(),

),
Oe
Ve
);

@@ -423,3 +424,3 @@ });

}
const Fn = [], De = {
const Fn = [], Re = {
items: Fn,

@@ -433,3 +434,3 @@ listBottom: 0,

data: null
}, ke = l(De, (e) => {
}, ke = l(Re, (e) => {
e.link(

@@ -445,5 +446,5 @@ e.pipe(

W,
He,
Be,
We,
Ve,
Oe,
Te,

@@ -479,6 +480,6 @@ $e,

if ((c == null ? void 0 : c.length) === 0)
return De;
return Re;
if (v(s)) {
let K = 0;
return h !== null && (K = Ot(h, r - 1).index), { ...De, items: Wn(K, c), offsetTree: i, totalCount: r, data: c };
return h !== null && (K = Ot(h, r - 1).index), { ...Re, items: Wn(K, c), offsetTree: i, totalCount: r, data: c };
}

@@ -503,5 +504,5 @@ let B = 0;

return t;
const O = [], N = r - 1, D = 0, Ne = An(i, Y, J, D);
const O = [], N = r - 1, D = 0, ze = An(i, Y, J, D);
let F = 0, Me = 0, Le = !1;
for (const K of Ne) {
for (const K of ze) {
const {

@@ -512,5 +513,5 @@ value: { offset: d, height: te }

F = d, d < Y && (j += Math.floor((Y - d) / te), F += (j - K.start) * te), j < D && (F += (D - j) * te, j = D);
const Ye = Math.min(K.end, N);
for (let X = j; X <= Ye && !(F >= J); X++) {
const Ke = {
const Ke = Math.min(K.end, N);
for (let X = j; X <= Ke && !(F >= J); X++) {
const je = {
data: c == null ? void 0 : c[X],

@@ -524,9 +525,9 @@ prevData: (c == null ? void 0 : c[X - 1]) ?? null,

};
Le || (Le = !0, Me = F), O.push(Ke), F += te;
Le || (Le = !0, Me = F), O.push(je), F += te;
}
}
const z = u - F, ze = ((we = O[0]) == null ? void 0 : we.offset) || 0;
return { items: O, listBottom: F, listTop: Me, offsetTree: i, paddingBottom: z, paddingTop: ze, totalCount: r, data: c };
const z = u - F, Ye = ((we = O[0]) == null ? void 0 : we.offset) || 0;
return { items: O, listBottom: F, listTop: Me, offsetTree: i, paddingBottom: z, paddingTop: Ye, totalCount: r, data: c };
},
De
Re
)

@@ -580,3 +581,3 @@ ),

e.link(e.pipe(G, C(!0)), et), e.link(e.pipe(G, C(!1), me(200)), et);
}), _t = l(!1), Ae = l(
}), _t = l(!1), Ce = l(
null,

@@ -586,3 +587,3 @@ (e) => {

e.pipe(
e.combine(xe, y, Z, Ut, Kn, _e, P),
e.combine(xe, y, Z, Ut, Kn, Pe, P),
m(([, , , , , , t]) => !v(t)),

@@ -613,6 +614,6 @@ _((t, [n, o, s, i, r]) => {

),
Ae
Ce
), e.link(
e.pipe(
Ae,
Ce,
oe(10),

@@ -637,3 +638,3 @@ // withLatestFrom(scrollToInProgress$),

Z,
S(Ae),
S(Ce),
_(

@@ -712,3 +713,3 @@ (t, [n, o]) => {

);
}), R = l(!1), Ce = $((e) => {
}), R = l(!1), He = $((e) => {
e.link(

@@ -732,4 +733,4 @@ e.pipe(

),
Ce
), Ht() ? (e.sub(e.pipe(Ce, S(A, y)), ([t, n]) => {
He
), Ht() ? (e.sub(e.pipe(He, S(A, y)), ([t, n]) => {
e.pub(A, n - t);

@@ -767,3 +768,3 @@ }), e.sub(e.pipe(e.combine(y, A, ee)), ([t, n, o]) => {

e.pipe(
Ce,
He,
a((t) => ({ top: t, behavior: "auto" }))

@@ -773,3 +774,3 @@ ),

);
}), ue = l(0), We = l(null), W = l(null, (e) => {
}), ue = l(0), Fe = l(null), W = l(null, (e) => {
e.link(

@@ -838,3 +839,3 @@ e.pipe(

Nt,
S(mt, st, We, P),
S(mt, st, Fe, P),
m(([, , , , t]) => !v(t)),

@@ -1003,5 +1004,5 @@ a(([{ data: t, scrollToBottom: n }, o, s, i]) => {

);
}), Se = $(), st = l(!1), Fe = $((e) => {
e.link(e.pipe(Fe, C(!1)), Se);
}), y = l(0), Z = l(0), Ut = l(0), xe = l(0), Un = y, He = l(0), $e = l(0), Te = l(0), Ee = l(0), gt = l(0), it = l(null), dt = se(0, (e) => e.pipe(
}), Se = $(), st = l(!1), _e = $((e) => {
e.link(e.pipe(_e, C(!1)), Se);
}), y = l(0), Z = l(0), Ut = l(0), xe = l(0), Un = y, Be = l(0), $e = l(0), Te = l(0), Ee = l(0), gt = l(0), it = l(null), dt = se(0, (e) => e.pipe(
e.combine($e, Te),

@@ -1024,3 +1025,3 @@ a(([t, n]) => t + n)

a(([t, n, o]) => t - n - o)
)), _e = l(0), Gt = l(0, (e) => {
)), Pe = l(0), Gt = l(0, (e) => {
e.link(

@@ -1031,3 +1032,3 @@ e.pipe(

),
_e
Pe
);

@@ -1065,5 +1066,5 @@ }), ce = $((e) => {

xe,
_e,
Pe,
ee,
Oe,
Ve,
R

@@ -1101,3 +1102,3 @@ ),

const w = g.scrollHeight - g.clientHeight;
Ct(g.scrollTop, Math.min(w, n.current)) && (n.current = null, o.pub(st, !1), o.pub(Fe, g.scrollTop));
Ct(g.scrollTop, Math.min(w, n.current)) && (n.current = null, o.pub(st, !1), o.pub(_e, g.scrollTop));
}

@@ -1131,3 +1132,3 @@ e(g, p);

if (p.top === ((g = t.current) == null ? void 0 : g.scrollTop)) {
o.pub(Fe, (w = t.current) == null ? void 0 : w.scrollTop);
o.pub(_e, (w = t.current) == null ? void 0 : w.scrollTop);
return;

@@ -1477,16 +1478,16 @@ }

}
function Pe(e, t, n, o, s, i) {
function Ne(e, t, n, o, s, i) {
return Q(lo(Q(Q(t, e), Q(o, i)), s), n);
}
function T(e, t, n, o, s, i, r) {
return Pe(t & n | ~t & o, e, t, s, i, r);
return Ne(t & n | ~t & o, e, t, s, i, r);
}
function E(e, t, n, o, s, i, r) {
return Pe(t & o | n & ~o, e, t, s, i, r);
return Ne(t & o | n & ~o, e, t, s, i, r);
}
function M(e, t, n, o, s, i, r) {
return Pe(t ^ n ^ o, e, t, s, i, r);
return Ne(t ^ n ^ o, e, t, s, i, r);
}
function L(e, t, n, o, s, i, r) {
return Pe(n ^ (t | ~o), e, t, s, i, r);
return Ne(n ^ (t | ~o), e, t, s, i, r);
}

@@ -1558,3 +1559,3 @@ function Q(e, t) {

now: /* @__PURE__ */ new Date(),
packageTimestamp: 1714630276458
packageTimestamp: 1714748510815
});

@@ -1628,7 +1629,7 @@ return /* @__PURE__ */ b(mn.Provider, { value: n, children: t });

const D = new Sn();
return D.register(ke), D.register(Se), D.register(Ce), D.register(Ae), D.pubIn({
return D.register(ke), D.register(Se), D.register(He), D.register(Ce), D.pubIn({
[W]: e.slice(),
[We]: n,
[Fe]: n,
[Qt]: t,
[Ve]: o,
[We]: o,
[ct]: r,

@@ -1650,3 +1651,3 @@ [en]: u,

O.pubIn({
[We]: n,
[Fe]: n,
[ct]: r

@@ -1701,3 +1702,3 @@ }), O.singletonSub(rt, i);

(d, te) => {
const j = d.querySelector('[data-role="virtuoso-list"]'), Ye = d.querySelector('[data-role="virtuoso-header"]'), X = d.querySelector('[data-role="virtuoso-sticky-header"]'), Ke = d.querySelector('[data-role="virtuoso-footer"]'), kn = d.querySelector('[data-role="virtuoso-sticky-footer"]'), yn = j && te === "resize" ? Qn(j.children) : [];
const j = d.querySelector('[data-role="virtuoso-list"]'), Ke = d.querySelector('[data-role="virtuoso-header"]'), X = d.querySelector('[data-role="virtuoso-sticky-header"]'), je = d.querySelector('[data-role="virtuoso-footer"]'), kn = d.querySelector('[data-role="virtuoso-sticky-footer"]'), yn = j && te === "resize" ? Qn(j.children) : [];
n.pubIn({

@@ -1709,5 +1710,5 @@ [ye]: yn,

[Ut]: d.clientWidth,
[Te]: pe(Ye),
[Te]: pe(Ke),
[$e]: pe(X),
[gt]: pe(Ke),
[gt]: pe(je),
[Ee]: pe(kn)

@@ -1722,3 +1723,3 @@ });

}, [N, H, x, p]), k.useLayoutEffect(() => n.sub(ce, O), [O, n]), k.useLayoutEffect(() => n.sub(G, J), [J, n]);
const D = V(A), Ne = V(R), F = V(lt), Me = V(_e), Le = V(Zt), z = V(We), ze = V(Qt), we = V(ue), K = V(ae);
const D = V(A), ze = V(R), F = V(lt), Me = V(Pe), Le = V(Zt), z = V(Fe), Ye = V(Qt), we = V(ue), K = V(ae);
return /* @__PURE__ */ b(In, { children: /* @__PURE__ */ Tt(

@@ -1731,3 +1732,3 @@ w,

style: {
overflowY: Ne ? "hidden" : "scroll",
overflowY: ze ? "hidden" : "scroll",
boxSizing: "border-box",

@@ -1769,3 +1770,3 @@ ...e

},
ze({ index: d.index, data: d.data, context: z })
Ye({ index: d.index, data: d.data, context: z })
))

@@ -1772,0 +1773,0 @@ }

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

},
"version": "1.4.1",
"version": "1.5.0",
"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