@virtuoso.dev/message-list
Advanced tools
Comparing version 1.9.0-alpha.2 to 1.9.0-alpha.3
@@ -0,1 +1,8 @@ | ||
# [1.9.0-alpha.3](https://github.com/virtuoso-dev/message-list/compare/v1.9.0-alpha.2...v1.9.0-alpha.3) (2024-07-26) | ||
### Bug Fixes | ||
* prevent strict mode from flickering ([bd9e86c](https://github.com/virtuoso-dev/message-list/commit/bd9e86c54793160ce67ef3664a7c6feff21450cb)) | ||
# [1.9.0-alpha.2](https://github.com/virtuoso-dev/message-list/compare/v1.9.0-alpha.1...v1.9.0-alpha.2) (2024-07-18) | ||
@@ -2,0 +9,0 @@ |
@@ -1,6 +0,6 @@ | ||
import { jsxs as nn, jsx as S, Fragment as fo } from "react/jsx-runtime"; | ||
import { jsxs as nn, jsx as y, Fragment as fo } from "react/jsx-runtime"; | ||
import d from "react"; | ||
import { Cell as c, Signal as y, throttleTime as fe, map as p, mapTo as F, debounceTime as pe, filter as g, scan as ee, withLatestFrom as m, delayWithMicrotask as ze, onNext as on, Action as sn, useRealm as _t, useCellValue as V, Realm as ho, RealmContext as go, useCellValues as vo } from "@mdxeditor/gurx"; | ||
function Se(e, t) { | ||
const n = c(e, (o) => { | ||
import { Cell as u, Signal as S, throttleTime as fe, map as p, mapTo as F, debounceTime as pe, filter as g, scan as ee, withLatestFrom as m, delayWithMicrotask as ze, onNext as on, Action as sn, useRealm as _t, useCellValue as V, Realm as ho, RealmContext as go, useCellValues as vo } from "@mdxeditor/gurx"; | ||
function ye(e, t) { | ||
const n = u(e, (o) => { | ||
o.link(t(o), n); | ||
@@ -31,3 +31,3 @@ }); | ||
const [i, r] = ln(o); | ||
return rt(L(e, { k: i, l: cn(o), v: r })); | ||
return rt(L(e, { k: i, l: un(o), v: r })); | ||
} | ||
@@ -78,4 +78,4 @@ } else | ||
} | ||
function cn(e) { | ||
return k(e.r) ? e.l : rt(L(e, { r: cn(e.r) })); | ||
function un(e) { | ||
return k(e.r) ? e.l : rt(L(e, { r: un(e.r) })); | ||
} | ||
@@ -128,3 +128,3 @@ function L(e, t) { | ||
} | ||
function un(e, t, n) { | ||
function cn(e, t, n) { | ||
if (k(e)) | ||
@@ -142,4 +142,4 @@ return []; | ||
for (let r = 1; r < n; r++) { | ||
const { index: l, value: u } = t(e[r]); | ||
i.push({ end: l - 1, start: o, value: s }), o = l, s = u; | ||
const { index: l, value: c } = t(e[r]); | ||
i.push({ end: l - 1, start: o, value: s }), o = l, s = c; | ||
} | ||
@@ -171,8 +171,8 @@ return i.push({ end: 1 / 0, start: o, value: s }), i; | ||
} | ||
const l = un(e, i - 1, r + 1); | ||
const l = cn(e, i - 1, r + 1); | ||
if (l.some(ko(o))) | ||
continue; | ||
let u = !1, a = !1; | ||
let c = !1, a = !1; | ||
for (const { start: f, end: v, value: I } of l) | ||
u ? (r >= f || s === I) && (e = wt(e, f)) : (a = I !== s, u = !0), v > r && r >= f && I !== s && (e = W(e, r + 1, I)); | ||
c ? (r >= f || s === I) && (e = wt(e, f)) : (a = I !== s, c = !0), v > r && r >= f && I !== s && (e = W(e, r + 1, I)); | ||
a && (e = W(e, i, s)); | ||
@@ -183,3 +183,3 @@ } | ||
const gt = [Ce(), 0]; | ||
function yo(e, [t, n]) { | ||
function So(e, [t, n]) { | ||
if (n.length > 0 && k(e) && t.length === 2) { | ||
@@ -215,3 +215,3 @@ const o = t[0].size, s = t[1].size; | ||
} | ||
function So(e, t, n, o) { | ||
function yo(e, t, n, o) { | ||
const s = ft(e, t, o), i = ft(e, n, o, s); | ||
@@ -230,3 +230,3 @@ return e.slice(s, i + 1); | ||
function Eo(e, t, n, o = 0) { | ||
return o > 0 && (t = Math.max(t, hn(e, o, Pt).offset)), t = Math.max(0, t), an(So(e, t, n, To), $o); | ||
return o > 0 && (t = Math.max(t, hn(e, o, Pt).offset)), t = Math.max(0, t), an(yo(e, t, n, To), $o); | ||
} | ||
@@ -238,9 +238,9 @@ const Ae = [[], 0, 0, 0]; | ||
r = ft(e, n - 1, Pt), i = e[r].offset; | ||
const u = ke(t, n - 1); | ||
o = u[0], s = u[1], e.length && e[r].height === ke(t, n)[1] && (r -= 1), e = e.slice(0, r + 1); | ||
const c = ke(t, n - 1); | ||
o = c[0], s = c[1], e.length && e[r].height === ke(t, n)[1] && (r -= 1), e = e.slice(0, r + 1); | ||
} else | ||
e = []; | ||
for (const { start: l, value: u } of un(t, n, 1 / 0)) { | ||
for (const { start: l, value: c } of cn(t, n, 1 / 0)) { | ||
const a = (l - o) * s + i; | ||
e.push({ height: u, index: l, offset: a }), o = l, i = a, s = u; | ||
e.push({ height: c, index: l, offset: a }), o = l, i = a, s = c; | ||
} | ||
@@ -289,8 +289,8 @@ return [e, s, i, o]; | ||
} | ||
c(!1); | ||
const mn = c(!0); | ||
y(); | ||
const ve = c(!1), Do = y((e) => { | ||
u(!1); | ||
const mn = u(!0); | ||
S(); | ||
const ve = u(!1), Do = S((e) => { | ||
e.link(e.pipe(mn, fe(50)), Do); | ||
}), In = c(Co), Ho = c(Oo, (e) => { | ||
}), In = u(Co), Ho = u(Oo, (e) => { | ||
e.link( | ||
@@ -303,7 +303,7 @@ e.pipe( | ||
); | ||
}), Ye = c(!1, (e) => { | ||
}), Ye = u(!1, (e) => { | ||
e.link(e.pipe(T, Jt(1), F(!0)), Ye), e.link(e.pipe(T, Jt(1), F(!1), pe(100)), Ye); | ||
}), Mt = c(!1, (e) => { | ||
}), Mt = u(!1, (e) => { | ||
e.link(e.pipe(te, F(!0)), Mt), e.link(e.pipe(te, F(!1), pe(200)), Mt); | ||
}), kn = c(!1), lt = c( | ||
}), kn = u(!1), lt = u( | ||
null, | ||
@@ -316,3 +316,3 @@ (e) => { | ||
ee((t, [n, o, s, i, r]) => { | ||
const u = o + s - n > -r, a = { | ||
const c = o + s - n > -r, a = { | ||
viewportWidth: i, | ||
@@ -323,3 +323,3 @@ viewportHeight: s, | ||
}; | ||
if (u) { | ||
if (c) { | ||
let v, I; | ||
@@ -379,3 +379,3 @@ return o > t.state.scrollTop ? (v = "SCROLLED_DOWN", I = t.state.scrollTop - o) : (v = n === s ? "LIST_TOO_SHORT" : "SIZE_DECREASED", I = t.state.scrollTop - o || t.scrollTopDelta), { | ||
(e, t) => e ? e.atBottom === (t == null ? void 0 : t.atBottom) : !1 | ||
), xn = c(0, (e) => { | ||
), xn = u(0, (e) => { | ||
e.link( | ||
@@ -415,3 +415,3 @@ e.pipe( | ||
); | ||
}), At = c($t, (e) => { | ||
}), At = u($t, (e) => { | ||
e.link( | ||
@@ -428,3 +428,3 @@ e.pipe( | ||
), e.link(e.pipe(T, pe(100), F(Mo)), At); | ||
}), Xt = c(0, (e) => { | ||
}), Xt = u(0, (e) => { | ||
e.link(e.pipe(Ye, g(vn), F(0)), Xt), e.link( | ||
@@ -458,3 +458,3 @@ e.pipe( | ||
} | ||
function yn({ | ||
function Sn({ | ||
location: e, | ||
@@ -468,3 +468,3 @@ sizeTree: t, | ||
stickyHeaderHeight: l, | ||
stickyFooterHeight: u | ||
stickyFooterHeight: c | ||
}) { | ||
@@ -478,3 +478,3 @@ const { align: a, behavior: f, offset: v, index: I } = Nt(e, s - 1); | ||
} | ||
i -= l + u; | ||
i -= l + c; | ||
let x = Le(I, n) + r - l; | ||
@@ -485,3 +485,3 @@ a === "end" ? x = x - i + R() : a === "center" && (x = x - i / 2 + R() / 2), v && (x += v); | ||
} | ||
const We = c(null), Bo = c(!1), ct = c(!0), Ot = y((e) => { | ||
const We = u(null), Bo = u(!1), ut = u(!0), Ot = S((e) => { | ||
e.link( | ||
@@ -492,3 +492,3 @@ e.pipe( | ||
), | ||
ct | ||
ut | ||
), e.link( | ||
@@ -501,11 +501,11 @@ e.pipe( | ||
); | ||
}), Sn = y((e) => { | ||
}), yn = S((e) => { | ||
e.link( | ||
e.pipe( | ||
Sn, | ||
yn, | ||
m(Te, ie, Xe), | ||
p(([t, n, o, s]) => { | ||
let { align: i, behavior: r, offset: l, index: u } = Nt(t, n - 1); | ||
const a = typeof t != "number" ? t.done : void 0, [f, v] = dn(u, o); | ||
return f < -s.listOffset ? ((typeof t == "number" || t.align === void 0) && (i = "start-no-overflow"), { index: u, align: i, behavior: r, offset: l, done: a }) : f + 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; | ||
let { align: i, behavior: r, offset: l, index: c } = Nt(t, n - 1); | ||
const a = typeof t != "number" ? t.done : void 0, [f, v] = dn(c, o); | ||
return f < -s.listOffset ? ((typeof t == "number" || t.align === void 0) && (i = "start-no-overflow"), { index: c, align: i, behavior: r, offset: l, done: a }) : f + v > -s.listOffset + s.visibleListHeight ? ((typeof t == "number" || t.align === void 0) && (i = "end"), { index: c, align: i, behavior: r, offset: l, done: a }) : null; | ||
}), | ||
@@ -517,3 +517,3 @@ g((t) => t !== null) | ||
); | ||
}), Q = y((e) => { | ||
}), Q = S((e) => { | ||
const t = e.pipe( | ||
@@ -532,5 +532,5 @@ Q, | ||
p( | ||
([n, o, s, i, r, l, u, a, f]) => { | ||
([n, o, s, i, r, l, c, a, f]) => { | ||
try { | ||
return yn({ | ||
return Sn({ | ||
location: n, | ||
@@ -543,3 +543,3 @@ totalHeight: f, | ||
headerHeight: l, | ||
stickyHeaderHeight: u, | ||
stickyHeaderHeight: c, | ||
stickyFooterHeight: a | ||
@@ -561,7 +561,7 @@ }); | ||
ve | ||
), e.link(e.pipe(t, F(!1)), ct), e.link(e.pipe(t, F(!1)), Bo), e.link( | ||
), e.link(e.pipe(t, F(!1)), ut), e.link(e.pipe(t, F(!1)), Bo), e.link( | ||
e.pipe( | ||
ne, | ||
pe(0), | ||
m(ct, We), | ||
m(ut, We), | ||
g(([, n, o]) => !n && o !== null), | ||
@@ -575,3 +575,3 @@ p(([, , n]) => n) | ||
[We]: null, | ||
[ct]: !0 | ||
[ut]: !0 | ||
}); | ||
@@ -594,3 +594,3 @@ }), e.link( | ||
); | ||
}), Pe = c(null), Ue = c(null, (e) => { | ||
}), Pe = u(null), Ue = u(null, (e) => { | ||
e.link( | ||
@@ -629,4 +629,4 @@ e.pipe( | ||
n.shift(), o++; | ||
const u = Math.max(0, r - o), a = ((f = s.at(-1)) == null ? void 0 : f.k) ?? -1; | ||
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 }); | ||
const c = Math.max(0, r - o), a = ((f = s.at(-1)) == null ? void 0 : f.k) ?? -1; | ||
c === a ? (((v = s.at(-2)) == null ? void 0 : v.v) ?? -1) === l ? s.pop() : s[s.length - 1].v = l : s.push({ k: c, v: l }); | ||
}); | ||
@@ -660,3 +660,3 @@ let i = Ce(); | ||
data: null | ||
}, De = c(_e, (e) => { | ||
}, De = u(_e, (e) => { | ||
e.link( | ||
@@ -694,3 +694,3 @@ e.pipe( | ||
l, | ||
u, | ||
c, | ||
a, | ||
@@ -705,10 +705,10 @@ f, | ||
var tt; | ||
if ((u == null ? void 0 : u.length) === 0) | ||
if ((c == null ? void 0 : c.length) === 0) | ||
return _e; | ||
if (k(s)) { | ||
let z = 0; | ||
return f !== null && (z = Nt(f, r - 1).index), { ..._e, items: Vo(z, u), offsetTree: i, totalCount: r, data: u }; | ||
return f !== null && (z = Nt(f, r - 1).index), { ..._e, items: Vo(z, c), offsetTree: i, totalCount: r, data: c }; | ||
} | ||
let P = 0; | ||
v !== null && n === 0 && (P = yn({ | ||
v !== null && n === 0 && (P = Sn({ | ||
totalHeight: l, | ||
@@ -728,3 +728,3 @@ location: v, | ||
), G = U + o; | ||
if (t.offsetTree === i && t.totalCount === r && t.data === u && U >= t.listTop && G <= t.listBottom) | ||
if (t.offsetTree === i && t.totalCount === r && t.data === c && U >= t.listTop && G <= t.listBottom) | ||
return t; | ||
@@ -742,5 +742,5 @@ const Z = [], J = r - 1, N = 0, M = Eo(i, U, G, N); | ||
const kt = { | ||
data: u == null ? void 0 : u[le], | ||
prevData: (u == null ? void 0 : u[le - 1]) ?? null, | ||
nextData: (u == null ? void 0 : u[le + 1]) ?? null, | ||
data: c == null ? void 0 : c[le], | ||
prevData: (c == null ? void 0 : c[le - 1]) ?? null, | ||
nextData: (c == null ? void 0 : c[le + 1]) ?? null, | ||
height: re, | ||
@@ -755,3 +755,3 @@ index: le, | ||
const E = l - A, oe = ((tt = Z[0]) == null ? void 0 : tt.offset) || 0; | ||
return { items: Z, listBottom: A, listTop: Qe, offsetTree: i, paddingBottom: E, paddingTop: oe, totalCount: r, data: u }; | ||
return { items: Z, listBottom: A, listTop: Qe, offsetTree: i, paddingBottom: E, paddingTop: oe, totalCount: r, data: c }; | ||
}, | ||
@@ -763,6 +763,6 @@ _e | ||
); | ||
}), ht = Se([], (e) => e.pipe( | ||
}), ht = ye([], (e) => e.pipe( | ||
e.combine(De, T), | ||
p(([t]) => t.items.slice().map((o) => o.data)) | ||
)), K = c(!1), be = c(!1), ut = y((e) => { | ||
)), K = u(!1), be = u(!1), ct = S((e) => { | ||
e.link( | ||
@@ -774,6 +774,6 @@ e.pipe( | ||
ee( | ||
([, t, n, o], [{ items: s, totalCount: i, listBottom: r, paddingBottom: l }, u]) => { | ||
([, t, n, o], [{ items: s, totalCount: i, listBottom: r, paddingBottom: l }, c]) => { | ||
const a = r + l; | ||
let f = 0; | ||
return n === i && t.length > 0 && s.length > 0 && (f = a - o, f !== 0 && (f += u)), [f, s, i, a]; | ||
return n === i && t.length > 0 && s.length > 0 && (f = a - o, f !== 0 && (f += c)), [f, s, i, a]; | ||
}, | ||
@@ -787,4 +787,4 @@ [0, [], 0, 0] | ||
), | ||
ut | ||
), Lo() ? (e.sub(e.pipe(ut, m(B, T)), ([t, n]) => { | ||
ct | ||
), Lo() ? (e.sub(e.pipe(ct, m(B, T)), ([t, n]) => { | ||
e.pub(B, n - t); | ||
@@ -825,4 +825,4 @@ }), e.sub( | ||
} | ||
)) : e.link(ut, te); | ||
}), Te = c(0), Ke = c(null), $ = c(null, (e) => { | ||
)) : e.link(ct, te); | ||
}), Te = u(0), Ke = u(null), $ = u(null, (e) => { | ||
e.link( | ||
@@ -836,11 +836,11 @@ e.pipe( | ||
); | ||
}), Ve = c(null), ue = y((e) => { | ||
}), Ve = u(null), ce = S((e) => { | ||
e.link( | ||
e.pipe( | ||
ue, | ||
m(ye), | ||
ce, | ||
m(Se), | ||
p(([n, o]) => -(o * n.length)) | ||
), | ||
B | ||
), e.link(e.pipe(ue, F(!0)), be), e.link(e.pipe(ue, ze()), Ve); | ||
), e.link(e.pipe(ce, F(!0)), be), e.link(e.pipe(ce, ze()), Ve); | ||
function t(n, o) { | ||
@@ -880,3 +880,3 @@ e.pubIn({ | ||
e.pipe( | ||
ue, | ||
ce, | ||
$n(2), | ||
@@ -890,11 +890,11 @@ m(ie, Ve), | ||
} | ||
), e.changeWith($, ue, (n, o) => n ? [...o, ...n] : o.slice()), e.link( | ||
), e.changeWith($, ce, (n, o) => n ? [...o, ...n] : o.slice()), e.link( | ||
e.pipe( | ||
ue, | ||
m(ne, ye), | ||
ce, | ||
m(ne, Se), | ||
p(([n, o, s]) => { | ||
const i = n.length, r = s; | ||
return xe(o).reduce( | ||
(u, { k: a, v: f }) => ({ | ||
ranges: [...u.ranges, { startIndex: u.prevIndex, endIndex: a + i - 1, size: u.prevSize }], | ||
(c, { k: a, v: f }) => ({ | ||
ranges: [...c.ranges, { startIndex: c.prevIndex, endIndex: a + i - 1, size: c.prevSize }], | ||
prevIndex: a + i, | ||
@@ -913,3 +913,3 @@ prevSize: f | ||
); | ||
}), vt = y((e) => { | ||
}), vt = S((e) => { | ||
const t = e.pipe( | ||
@@ -922,3 +922,3 @@ vt, | ||
return null; | ||
let u = "auto"; | ||
let c = "auto"; | ||
const a = i.isAtBottom; | ||
@@ -933,9 +933,9 @@ if (typeof s == "function") { | ||
return { index: f, align: "end", behavior: "auto" }; | ||
u = f; | ||
c = f; | ||
} else { | ||
if (!a) | ||
return null; | ||
u = s; | ||
c = s; | ||
} | ||
return u === !0 && (u = "auto"), { index: "LAST", align: "end", behavior: u }; | ||
return c === !0 && (c = "auto"), { index: "LAST", align: "end", behavior: c }; | ||
}) | ||
@@ -978,12 +978,12 @@ ); | ||
); | ||
}), dt = y((e) => { | ||
}), dt = S((e) => { | ||
e.changeWith($, dt, (t, n) => t ? [...t, ...n.data] : n.data.slice()), e.link(dt, vt); | ||
}), at = y((e) => { | ||
}), at = S((e) => { | ||
e.changeWith($, at, (t, n) => t ? [...t.slice(0, n.offset), ...n.data, ...t.slice(n.offset)] : n.data.slice()), e.changeWith(he, at, ([t], n) => { | ||
const s = ke(t, n.offset, "k")[0], i = n.data.length; | ||
return [bo(t, s, 1 / 0, (l, u) => [l + i, u]), s]; | ||
return [bo(t, s, 1 / 0, (l, c) => [l + i, c]), s]; | ||
}), e.link(at, vt); | ||
}), Ct = y((e) => { | ||
}), Ct = S((e) => { | ||
e.changeWith($, Ct, (t, { offset: n, count: o }) => t ? t.slice(0, n).concat(t.slice(n + o)) : []), e.changeWith(he, Ct, ([t], { offset: n, count: o }) => [mo(t, n, o), n]); | ||
}), we = y((e) => { | ||
}), we = S((e) => { | ||
e.link( | ||
@@ -1000,3 +1000,3 @@ e.pipe( | ||
g(({ purgeItemSizes: t }) => !t), | ||
m(ye), | ||
m(Se), | ||
g(([, t]) => t > 0), | ||
@@ -1020,3 +1020,3 @@ p(([{ data: t }, n]) => [ | ||
), e.sub(e.pipe(we, fe(0)), ({ data: t, purgeItemSizes: n, initialLocation: o }) => { | ||
n || requestAnimationFrame(() => { | ||
requestAnimationFrame(() => { | ||
e.pub(Kt); | ||
@@ -1028,9 +1028,9 @@ }), e.pubIn({ | ||
}); | ||
}), Qt = y((e) => { | ||
}), Qt = S((e) => { | ||
e.changeWith($, Qt, (t, n) => t ? t.slice(n) : []), e.changeWith(he, Qt, ([t], n) => [xe(t).reduce((s, { k: i, v: r }) => W(s, Math.max(0, i - n), r), Ce()), 0]); | ||
}), en = y((e) => { | ||
}), en = S((e) => { | ||
e.changeWith($, en, (t, n) => t ? t.slice(0, t.length - n) : []), e.link( | ||
e.pipe( | ||
en, | ||
m(Te, ye), | ||
m(Te, Se), | ||
p(([, t, n]) => [ | ||
@@ -1046,3 +1046,3 @@ { | ||
); | ||
}), Tn = y((e) => { | ||
}), Tn = S((e) => { | ||
const t = e.pipe( | ||
@@ -1061,3 +1061,3 @@ Tn, | ||
e.changeWith($, t, (n, o) => n ? n.filter((s, i) => !o.includes(i)) : []), e.changeWith(he, t, ([n], o) => [Fo(n, o), 0]); | ||
}), Dt = y((e) => { | ||
}), Dt = S((e) => { | ||
e.changeWith($, Dt, (t, { mapper: n }) => t ? t.map(n) : []), e.link( | ||
@@ -1073,7 +1073,7 @@ e.pipe( | ||
); | ||
}), ot = c(null), Et = c(0), ce = y((e) => { | ||
}), ot = u(null), Et = u(0), ue = S((e) => { | ||
e.link( | ||
e.pipe( | ||
ce, | ||
m(ye, $), | ||
ue, | ||
m(Se, $), | ||
p(([{ data: n, anchorCb: o }, s, i]) => { | ||
@@ -1089,3 +1089,3 @@ if (i === null) | ||
e.pipe( | ||
ce, | ||
ue, | ||
m($, ie), | ||
@@ -1100,3 +1100,3 @@ p(([{ anchorCb: n }, o, s]) => { | ||
Et | ||
), e.link(e.pipe(ce, F(!0)), be), e.link(e.pipe(ce, ze()), ot); | ||
), e.link(e.pipe(ue, F(!0)), be), e.link(e.pipe(ue, ze()), ot); | ||
function t(n, o) { | ||
@@ -1135,3 +1135,3 @@ e.pubIn({ | ||
e.pipe( | ||
ce, | ||
ue, | ||
$n(2), | ||
@@ -1150,3 +1150,3 @@ m(ie, ot, $, Et), | ||
} | ||
), e.changeWith($, e.pipe(ce, ze()), (n, { data: o }) => o.slice()), e.sub(e.pipe(ce, fe(0)), () => { | ||
), e.changeWith($, e.pipe(ue, ze()), (n, { data: o }) => o.slice()), e.sub(e.pipe(ue, fe(0)), () => { | ||
requestAnimationFrame(() => { | ||
@@ -1169,9 +1169,9 @@ e.pub(Kt); | ||
} | ||
const me = y(); | ||
c([]); | ||
c([]); | ||
c(0); | ||
c(null); | ||
c(NaN); | ||
const Ie = c(!1), he = c(gt, (e) => { | ||
const me = S(); | ||
u([]); | ||
u([]); | ||
u(0); | ||
u(null); | ||
u(NaN); | ||
const Ie = u(!1), he = u(gt, (e) => { | ||
e.link( | ||
@@ -1182,7 +1182,7 @@ e.pipe( | ||
m(ne), | ||
p(([t, n]) => yo(n, [t, []])) | ||
p(([t, n]) => So(n, [t, []])) | ||
), | ||
he | ||
); | ||
}), ne = c(gt[0], (e) => { | ||
}), ne = u(gt[0], (e) => { | ||
e.link( | ||
@@ -1195,3 +1195,3 @@ e.pipe( | ||
); | ||
}), En = c(gt[1], (e) => { | ||
}), En = u(gt[1], (e) => { | ||
e.link( | ||
@@ -1204,3 +1204,3 @@ e.pipe( | ||
); | ||
}), ye = c(Ae[1]), ie = c(Ae[0]), Ne = c(Ae, (e) => { | ||
}), Se = u(Ae[1]), ie = u(Ae[0]), Ne = u(Ae, (e) => { | ||
e.link( | ||
@@ -1218,3 +1218,3 @@ e.pipe( | ||
), | ||
ye | ||
Se | ||
), e.link( | ||
@@ -1227,3 +1227,3 @@ e.pipe( | ||
); | ||
}), wn = c(Ae[2], (e) => { | ||
}), wn = u(Ae[2], (e) => { | ||
e.link( | ||
@@ -1236,3 +1236,3 @@ e.pipe( | ||
); | ||
}), Ln = c(Ae[3], (e) => { | ||
}), Ln = u(Ae[3], (e) => { | ||
e.link( | ||
@@ -1245,6 +1245,6 @@ e.pipe( | ||
); | ||
}), He = c(0, (e) => { | ||
}), He = u(0, (e) => { | ||
e.link( | ||
e.pipe( | ||
e.combine(Te, Ln, wn, ye), | ||
e.combine(Te, Ln, wn, Se), | ||
p(([t, n, o, s]) => o + (t - n) * s) | ||
@@ -1254,23 +1254,24 @@ ), | ||
); | ||
}), je = y(), zt = c(!1), qe = y((e) => { | ||
}), je = S(), zt = u(!1), qe = S((e) => { | ||
e.link(e.pipe(qe, F(!1)), je); | ||
}, !1), T = c(0), q = c(0), Rn = c(0), j = c(0), _o = T, pt = c(0), Ge = c(0), Ze = c(0), Je = c(0), Yt = c(0), Ht = c(null), Mn = sn(), Po = Ro, No = 50, bt = Se(0, (e) => e.pipe( | ||
}, !1), T = u(0), q = u(0), Rn = u(0), j = u(0), _o = T, pt = u(0), Ge = u(0), Ze = u(0), Je = u(0), Yt = u(0), Ht = u(null), Mn = sn(), Po = Ro, No = 50, bt = ye(0, (e) => e.pipe( | ||
e.combine(Ge, Ze), | ||
p(([t, n]) => t + n) | ||
)), An = Se(0, (e) => e.pipe( | ||
)), An = ye(0, (e) => e.pipe( | ||
e.combine(Je, Yt), | ||
p(([t, n]) => t + n) | ||
)), zo = Se(0, (e) => e.pipe( | ||
)), zo = ye(0, (e) => e.pipe( | ||
e.combine(Ge, Ze, T), | ||
p(([t, n, o]) => t + Math.max(n - o, 0)) | ||
)), Yo = Se(0, (e) => e.pipe( | ||
)), Yo = ye(0, (e) => e.pipe( | ||
e.combine(Je, Yt, T, q, j), | ||
p(([t, n, o, s, i]) => { | ||
o = Math.min(o, i - s); | ||
const r = Math.max(n - (i - (o + s)), 0); | ||
return t + r; | ||
}) | ||
)), On = Se(0, (e) => e.pipe( | ||
)), On = ye(0, (e) => e.pipe( | ||
e.combine(q, zo, Yo), | ||
p(([t, n, o]) => t - n - o) | ||
)), mt = c(0), Cn = c(0, (e) => { | ||
)), mt = u(0), Cn = u(0, (e) => { | ||
e.link( | ||
@@ -1283,3 +1284,3 @@ e.pipe( | ||
); | ||
}), Oe = y((e) => { | ||
}), Oe = S((e) => { | ||
e.link( | ||
@@ -1300,3 +1301,3 @@ e.pipe( | ||
); | ||
}), Xe = Se( | ||
}), Xe = ye( | ||
{ | ||
@@ -1333,3 +1334,3 @@ listOffset: 0, | ||
l, | ||
u, | ||
c, | ||
a, | ||
@@ -1350,3 +1351,3 @@ f, | ||
) | ||
), Bt = y((e) => { | ||
), Bt = S((e) => { | ||
e.link( | ||
@@ -1362,6 +1363,6 @@ e.pipe( | ||
); | ||
}), te = y(), B = c(0), Re = c(0), Ft = c(0), Dn = c(""), Ut = y(), Kt = sn(), Hn = ({ index: e }) => /* @__PURE__ */ nn("div", { children: [ | ||
}), te = S(), B = u(0), Re = u(0), Ft = u(0), Dn = u(""), Ut = S(), Kt = sn(), Hn = ({ index: e }) => /* @__PURE__ */ nn("div", { children: [ | ||
"Item ", | ||
e | ||
] }), Bn = ({ index: e }) => e, Vt = c(Hn), Fn = c(Bn), Vn = c(null), Wn = c(null), _n = c(null), Pn = c(null), Nn = c(null), zn = c("div"), Uo = { | ||
] }), Bn = ({ index: e }) => e, Vt = u(Hn), Fn = u(Bn), Vn = u(null), Wn = u(null), _n = u(null), Pn = u(null), Nn = u(null), zn = u("div"), Uo = { | ||
position: "sticky", | ||
@@ -1375,7 +1376,7 @@ top: 0, | ||
bottom: 0 | ||
}, Yn = d.forwardRef((e, t) => /* @__PURE__ */ S("div", { style: { zIndex: 1 }, ...e, ref: t })), Un = d.forwardRef((e, t) => /* @__PURE__ */ S("div", { ...e, ref: t })), Kn = d.forwardRef( | ||
({ style: e, ...t }, n) => /* @__PURE__ */ S("div", { ...t, style: { ...Uo, ...e }, ref: n }) | ||
}, Yn = d.forwardRef((e, t) => /* @__PURE__ */ y("div", { style: { zIndex: 1 }, ...e, ref: t })), Un = d.forwardRef((e, t) => /* @__PURE__ */ y("div", { ...e, ref: t })), Kn = d.forwardRef( | ||
({ style: e, ...t }, n) => /* @__PURE__ */ y("div", { ...t, style: { ...Uo, ...e }, ref: n }) | ||
), jn = d.forwardRef( | ||
({ style: e, ...t }, n) => /* @__PURE__ */ S("div", { ...t, style: { ...Ko, ...e }, ref: n }) | ||
), qn = c(Yn), Gn = c(Kn), Zn = c(Un), Jn = c(jn), Wt = c("top", (e) => { | ||
({ style: e, ...t }, n) => /* @__PURE__ */ y("div", { ...t, style: { ...Ko, ...e }, ref: n }) | ||
), qn = u(Yn), Gn = u(Kn), Zn = u(Un), Jn = u(jn), Wt = u("top", (e) => { | ||
e.link( | ||
@@ -1424,3 +1425,3 @@ e.pipe( | ||
for (var n = 1732584193, o = -271733879, s = -1732584194, i = 271733878, r = 0; r < e.length; r += 16) { | ||
const l = n, u = o, a = s, f = i; | ||
const l = n, c = o, a = s, f = i; | ||
o = H( | ||
@@ -1682,3 +1683,3 @@ o = H( | ||
-343485551 | ||
), n = ae(n, l), o = ae(o, u), s = ae(s, a), i = ae(i, f); | ||
), n = ae(n, l), o = ae(o, c), s = ae(s, a), i = ae(i, f); | ||
} | ||
@@ -1742,5 +1743,5 @@ return [n, o, s, i]; | ||
watermarkMessage: "You have installed a version of `@virtuoso.dev/message-list` that is newer than the period of your license key. Either downgrade to a supported version, or purchase a new license from https://virtuoso.dev/pricing/" | ||
}, rs = Qn, ls = /^(?:127\.0\.0\.1|localhost|0\.0\.0\.0)$/, cs = ["virtuoso.dev", "csb.app", "codesandbox.io"]; | ||
function us({ licenseKey: e, now: t, hostname: n, packageTimestamp: o }) { | ||
const s = n.match(ls), i = cs.some((r) => n.endsWith(r)); | ||
}, rs = Qn, ls = /^(?:127\.0\.0\.1|localhost|0\.0\.0\.0)$/, us = ["virtuoso.dev", "csb.app", "codesandbox.io"]; | ||
function cs({ licenseKey: e, now: t, hostname: n, packageTimestamp: o }) { | ||
const s = n.match(ls), i = us.some((r) => n.endsWith(r)); | ||
if (e) { | ||
@@ -1764,9 +1765,9 @@ const r = Qo(e); | ||
}) => { | ||
const n = us({ | ||
const n = cs({ | ||
licenseKey: e, | ||
hostname: typeof window < "u" ? window.location.hostname : "localhost", | ||
now: /* @__PURE__ */ new Date(), | ||
packageTimestamp: 1721314616112 | ||
packageTimestamp: 1721984607982 | ||
}); | ||
return /* @__PURE__ */ S(eo.Provider, { value: n, children: t }); | ||
return /* @__PURE__ */ y(eo.Provider, { value: n, children: t }); | ||
}; | ||
@@ -1822,3 +1823,3 @@ as.displayName = Math.random().toString(36).slice(2, 8); | ||
prepend: (t) => { | ||
e.pub(ue, t); | ||
e.pub(ce, t); | ||
}, | ||
@@ -1867,3 +1868,3 @@ append: (t, n) => { | ||
updateWithAnchor(t, n) { | ||
e.pub(ce, { data: t, anchorCb: n }); | ||
e.pub(ue, { data: t, anchorCb: n }); | ||
} | ||
@@ -1875,3 +1876,3 @@ }, | ||
scrollIntoView: (t) => { | ||
e.pub(Sn, t); | ||
e.pub(yn, t); | ||
}, | ||
@@ -1894,3 +1895,3 @@ scrollerElement: () => e.getValue(Ht), | ||
); | ||
return /* @__PURE__ */ S( | ||
return /* @__PURE__ */ y( | ||
"div", | ||
@@ -1907,3 +1908,3 @@ { | ||
}, | ||
children: /* @__PURE__ */ S(t, { index: e.index, prevData: e.prevData, nextData: e.nextData, data: e.data, context: s }) | ||
children: /* @__PURE__ */ y(t, { index: e.index, prevData: e.prevData, nextData: e.nextData, data: e.data, context: s }) | ||
} | ||
@@ -1932,3 +1933,3 @@ ); | ||
ItemContent: l = Hn, | ||
Header: u = null, | ||
Header: c = null, | ||
StickyHeader: a = null, | ||
@@ -1947,3 +1948,3 @@ Footer: f = null, | ||
const M = new ho(); | ||
return M.register(De), M.register(je), M.register(ut), M.register(lt), M.register(dt), M.register(ue), M.register(we), M.pubIn({ | ||
return M.register(De), M.register(je), M.register(ct), M.register(lt), M.register(dt), M.register(ce), M.register(we), M.pubIn({ | ||
[$]: e.slice(), | ||
@@ -1954,3 +1955,3 @@ [Ke]: n, | ||
[Vt]: l, | ||
[Vn]: u, | ||
[Vn]: c, | ||
[_n]: f, | ||
@@ -1984,3 +1985,3 @@ [Wn]: a, | ||
}; | ||
}, []), typeof window < "u" && N.watermarkMessage ? /* @__PURE__ */ S( | ||
}, []), typeof window < "u" && N.watermarkMessage ? /* @__PURE__ */ y( | ||
"div", | ||
@@ -1994,3 +1995,3 @@ { | ||
} | ||
) : /* @__PURE__ */ S(go.Provider, { value: J, children: /* @__PURE__ */ S(gs, { ...G }) }); | ||
) : /* @__PURE__ */ y(go.Provider, { value: J, children: /* @__PURE__ */ y(gs, { ...G }) }); | ||
} | ||
@@ -2005,3 +2006,3 @@ ); | ||
l, | ||
u, | ||
c, | ||
a, | ||
@@ -2080,7 +2081,7 @@ f, | ||
continue; | ||
const yt = parseInt(Y.dataset.index), po = parseFloat(Y.dataset.knownSize ?? ""), St = ge.contentRect.height; | ||
if (St === po) | ||
const St = parseInt(Y.dataset.index), po = parseFloat(Y.dataset.knownSize ?? ""), yt = ge.contentRect.height; | ||
if (yt === po) | ||
continue; | ||
const Gt = _[_.length - 1]; | ||
_.length === 0 || Gt.size !== St || Gt.endIndex !== yt - 1 ? _.push({ endIndex: yt, size: St, startIndex: yt }) : _[_.length - 1].endIndex++; | ||
_.length === 0 || Gt.size !== yt || Gt.endIndex !== St - 1 ? _.push({ endIndex: St, size: yt, startIndex: St }) : _[_.length - 1].endIndex++; | ||
} | ||
@@ -2159,4 +2160,4 @@ _.length > 0 && (w = { | ||
d.useLayoutEffect(() => n.sub(Kt, jt), [jt, n]); | ||
const no = V(B), oo = V(Re), so = V(K), io = V(Ft), ro = V(mt), lo = V(Dn), de = V(Ke), co = V(Fn), uo = V(Te), ao = V(He); | ||
return /* @__PURE__ */ S(fo, { children: /* @__PURE__ */ nn( | ||
const no = V(B), oo = V(Re), so = V(K), io = V(Ft), ro = V(mt), lo = V(Dn), de = V(Ke), uo = V(Fn), co = V(Te), ao = V(He); | ||
return /* @__PURE__ */ y(fo, { children: /* @__PURE__ */ nn( | ||
x, | ||
@@ -2174,5 +2175,5 @@ { | ||
children: [ | ||
i && /* @__PURE__ */ S(l, { ref: M, style: st, children: /* @__PURE__ */ S(i, { context: de }) }), | ||
s && /* @__PURE__ */ S(r, { ref: J, style: st, children: /* @__PURE__ */ S(s, { context: de }) }), | ||
uo > 0 ? /* @__PURE__ */ S( | ||
i && /* @__PURE__ */ y(l, { ref: M, style: st, children: /* @__PURE__ */ y(i, { context: de }) }), | ||
s && /* @__PURE__ */ y(r, { ref: J, style: st, children: /* @__PURE__ */ y(s, { context: de }) }), | ||
co > 0 ? /* @__PURE__ */ y( | ||
"div", | ||
@@ -2192,3 +2193,3 @@ { | ||
}, | ||
children: kt.map((h) => /* @__PURE__ */ S( | ||
children: kt.map((h) => /* @__PURE__ */ y( | ||
hs, | ||
@@ -2201,8 +2202,8 @@ { | ||
}, | ||
co({ index: h.index, data: h.data, context: de }) | ||
uo({ index: h.index, data: h.data, context: de }) | ||
)) | ||
} | ||
) : R ? /* @__PURE__ */ S(R, { context: de }) : null, | ||
u && /* @__PURE__ */ S(f, { ref: P, style: st, children: /* @__PURE__ */ S(u, { context: de }) }), | ||
a && /* @__PURE__ */ S(v, { ref: G, style: st, children: /* @__PURE__ */ S(a, { context: de }) }) | ||
) : R ? /* @__PURE__ */ y(R, { context: de }) : null, | ||
c && /* @__PURE__ */ y(f, { ref: P, style: st, children: /* @__PURE__ */ y(c, { context: de }) }), | ||
a && /* @__PURE__ */ y(v, { ref: G, style: st, children: /* @__PURE__ */ y(a, { context: de }) }) | ||
] | ||
@@ -2209,0 +2210,0 @@ } |
@@ -23,3 +23,3 @@ { | ||
}, | ||
"version": "1.9.0-alpha.2", | ||
"version": "1.9.0-alpha.3", | ||
"type": "module", | ||
@@ -26,0 +26,0 @@ "module": "dist/index.js", |
99231
2593
2565