Skip to content

Instantly share code, notes, and snippets.

@petyosi
Last active May 17, 2024 11:45
Show Gist options
  • Save petyosi/c7732d0271383c207bdbb88f54c8d1fc to your computer and use it in GitHub Desktop.
Save petyosi/c7732d0271383c207bdbb88f54c8d1fc to your computer and use it in GitHub Desktop.
3a4,92
> var compilerRuntime = { exports: {} };
> var reactCompilerRuntime_production = {};
> /**
> * @license React
> * react-compiler-runtime.production.js
> *
> * Copyright (c) Meta Platforms, Inc. and affiliates.
> *
> * This source code is licensed under the MIT license found in the
> * LICENSE file in the root directory of this source tree.
> */
> var hasRequiredReactCompilerRuntime_production;
> function requireReactCompilerRuntime_production() {
> if (hasRequiredReactCompilerRuntime_production)
> return reactCompilerRuntime_production;
> hasRequiredReactCompilerRuntime_production = 1;
> var ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
> reactCompilerRuntime_production.c = function(size) {
> return ReactSharedInternals.H.useMemoCache(size);
> };
> return reactCompilerRuntime_production;
> }
> var reactCompilerRuntime_development = {};
> /**
> * @license React
> * react-compiler-runtime.development.js
> *
> * Copyright (c) Meta Platforms, Inc. and affiliates.
> *
> * This source code is licensed under the MIT license found in the
> * LICENSE file in the root directory of this source tree.
> */
> var hasRequiredReactCompilerRuntime_development;
> function requireReactCompilerRuntime_development() {
> if (hasRequiredReactCompilerRuntime_development)
> return reactCompilerRuntime_development;
> hasRequiredReactCompilerRuntime_development = 1;
> if (process.env.NODE_ENV !== "production") {
> (function() {
> var React$1 = React;
> var ReactSharedInternals = React$1.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
> function error(format) {
> {
> {
> for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
> args[_key2 - 1] = arguments[_key2];
> }
> printWarning("error", format, args);
> }
> }
> }
> function printWarning(level, format, args) {
> {
> var stack = ReactSharedInternals.getStackAddendum();
> if (stack !== "") {
> format += "%s";
> args = args.concat([stack]);
> }
> var argsWithFormat = args.map(function(item) {
> return String(item);
> });
> argsWithFormat.unshift("Warning: " + format);
> Function.prototype.apply.call(console[level], console, argsWithFormat);
> }
> }
> function resolveDispatcher() {
> var dispatcher = ReactSharedInternals.H;
> {
> if (dispatcher === null) {
> error("Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.");
> }
> }
> return dispatcher;
> }
> function useMemoCache(size) {
> var dispatcher = resolveDispatcher();
> return dispatcher.useMemoCache(size);
> }
> reactCompilerRuntime_development.c = useMemoCache;
> })();
> }
> return reactCompilerRuntime_development;
> }
> if (process.env.NODE_ENV === "production") {
> compilerRuntime.exports = requireReactCompilerRuntime_production();
> } else {
> compilerRuntime.exports = requireReactCompilerRuntime_development();
> }
> var compilerRuntimeExports = compilerRuntime.exports;
287c376,380
< function system(constructor, dependencies = [], { singleton } = { singleton: true }) {
---
> function system(constructor, dependencies = [], {
> singleton
> } = {
> singleton: true
> }) {
298c391,396
< const _init = ({ id: id2, constructor, dependencies, singleton }) => {
---
> const _init = ({
> id: id2,
> constructor,
> dependencies,
> singleton
> }) => {
361,362c459
< return eventNames.reduce(
< (handlers, eventName) => {
---
> return eventNames.reduce((handlers, eventName) => {
365,367c462
< },
< {}
< );
---
> }, {});
370,375c465,501
< const { children, ...props } = propsWithChildren;
< const [system2] = React.useState(() => {
< return tap(init(systemSpec), (system22) => applyPropsToSystem(system22, props));
< });
< const [handlers] = React.useState(curry1to0(buildEventHandlers, system2));
< useIsomorphicLayoutEffect$1(() => {
---
> const $ = compilerRuntimeExports.c(25);
> const t0 = propsWithChildren;
> let props;
> let children;
> if ($[0] !== t0) {
> ({
> children,
> ...props
> } = t0);
> $[0] = t0;
> $[1] = props;
> $[2] = children;
> } else {
> props = $[1];
> children = $[2];
> }
> let t1;
> if ($[3] !== props) {
> t1 = () => tap(init(systemSpec), (system2) => applyPropsToSystem(system2, props));
> $[3] = props;
> $[4] = t1;
> } else {
> t1 = $[4];
> }
> const [system_0] = React.useState(t1);
> let t2;
> if ($[5] !== system_0) {
> t2 = curry1to0(buildEventHandlers, system_0);
> $[5] = system_0;
> $[6] = t2;
> } else {
> t2 = $[6];
> }
> const [handlers] = React.useState(t2);
> let t3;
> if ($[7] !== props || $[8] !== handlers) {
> t3 = () => {
384,388c510,548
< }, [props, handlers, system2]);
< useIsomorphicLayoutEffect$1(() => {
< applyPropsToSystem(system2, props);
< });
< React.useImperativeHandle(ref, always(buildMethods(system2)));
---
> };
> $[7] = props;
> $[8] = handlers;
> $[9] = t3;
> } else {
> t3 = $[9];
> }
> let t4;
> if ($[10] !== props || $[11] !== handlers || $[12] !== system_0) {
> t4 = [props, handlers, system_0];
> $[10] = props;
> $[11] = handlers;
> $[12] = system_0;
> $[13] = t4;
> } else {
> t4 = $[13];
> }
> useIsomorphicLayoutEffect$1(t3, t4);
> let t5;
> if ($[14] !== system_0 || $[15] !== props) {
> t5 = () => {
> applyPropsToSystem(system_0, props);
> };
> $[14] = system_0;
> $[15] = props;
> $[16] = t5;
> } else {
> t5 = $[16];
> }
> useIsomorphicLayoutEffect$1(t5);
> let t6;
> if ($[17] !== system_0) {
> t6 = always(buildMethods(system_0));
> $[17] = system_0;
> $[18] = t6;
> } else {
> t6 = $[18];
> }
> React.useImperativeHandle(ref, t6);
390c550,568
< return /* @__PURE__ */ jsx(Context.Provider, { value: system2, children: Wrapper ? /* @__PURE__ */ jsx(Wrapper, { ...omit([...requiredPropNames, ...optionalPropNames, ...eventNames], props), children }) : children });
---
> let t7;
> if ($[19] !== props || $[20] !== children) {
> t7 = Wrapper ? /* @__PURE__ */ jsx(Wrapper, { ...omit([...requiredPropNames, ...optionalPropNames, ...eventNames], props), children }) : children;
> $[19] = props;
> $[20] = children;
> $[21] = t7;
> } else {
> t7 = $[21];
> }
> let t8;
> if ($[22] !== system_0 || $[23] !== t7) {
> t8 = /* @__PURE__ */ jsx(Context.Provider, { value: system_0, children: t7 });
> $[22] = system_0;
> $[23] = t7;
> $[24] = t8;
> } else {
> t8 = $[24];
> }
> return t8;
392a571
> const $ = compilerRuntimeExports.c(2);
394,395c573,575
< return React.useCallback(
< (arg) => {
---
> let t0;
> if ($[0] !== stream2) {
> t0 = (arg) => {
397,399c577,583
< },
< [stream2]
< );
---
> };
> $[0] = stream2;
> $[1] = t0;
> } else {
> t0 = $[1];
> }
> return t0;
401a586
> const $ = compilerRuntimeExports.c(5);
404,414c589,610
< const cb = React.useCallback(
< (c) => {
< return subscribe(source, c);
< },
< [source]
< );
< return React.useSyncExternalStore(
< cb,
< () => getValue(source),
< () => getValue(source)
< );
---
> let t0;
> if ($[0] !== source) {
> t0 = (c) => subscribe(source, c);
> $[0] = source;
> $[1] = t0;
> } else {
> t0 = $[1];
> }
> const cb = t0;
> let t1;
> let t2;
> if ($[2] !== source) {
> t1 = () => getValue(source);
> t2 = () => getValue(source);
> $[2] = source;
> $[3] = t1;
> $[4] = t2;
> } else {
> t1 = $[3];
> t2 = $[4];
> }
> return React.useSyncExternalStore(cb, t1, t2);
416a613
> const $ = compilerRuntimeExports.c(6);
419,421c616,628
< const [value, setValue] = React.useState(curry1to0(getValue, source));
< useIsomorphicLayoutEffect$1(
< () => subscribe(source, (next) => {
---
> let t0;
> if ($[0] !== source) {
> t0 = curry1to0(getValue, source);
> $[0] = source;
> $[1] = t0;
> } else {
> t0 = $[1];
> }
> const [value, setValue] = React.useState(t0);
> let t1;
> let t2;
> if ($[2] !== source || $[3] !== value) {
> t1 = () => subscribe(source, (next) => {
425,427c632,642
< }),
< [source, value]
< );
---
> });
> t2 = [source, value];
> $[2] = source;
> $[3] = value;
> $[4] = t1;
> $[5] = t2;
> } else {
> t1 = $[4];
> t2 = $[5];
> }
> useIsomorphicLayoutEffect$1(t1, t2);
431a647
> const $ = compilerRuntimeExports.c(4);
434c650,663
< useIsomorphicLayoutEffect$1(() => subscribe(source, callback), [callback, source]);
---
> let t0;
> let t1;
> if ($[0] !== source || $[1] !== callback) {
> t0 = () => subscribe(source, callback);
> t1 = [callback, source];
> $[0] = source;
> $[1] = callback;
> $[2] = t0;
> $[3] = t1;
> } else {
> t0 = $[2];
> t1 = $[3];
> }
> useIsomorphicLayoutEffect$1(t0, t1);
470,471c699
< const loggerSystem = system(
< () => {
---
> const loggerSystem = system(() => {
480,486c708
< console[CONSOLE_METHOD_MAP[level]](
< "%creact-virtuoso: %c%s %o",
< "color: #0253b3; font-weight: bold",
< "color: initial",
< label,
< message
< );
---
> console[CONSOLE_METHOD_MAP[level]]("%creact-virtuoso: %c%s %o", "color: #0253b3; font-weight: bold", "color: initial", label, message);
493,497c715,720
< },
< [],
< { singleton: true }
< );
< function useSizeWithElRef(callback, enabled = true) {
---
> }, [], {
> singleton: true
> });
> function useSizeWithElRef(callback, t0) {
> const $ = compilerRuntimeExports.c(9);
> const enabled = t0 === void 0 ? true : t0;
499c722,724
< let callbackRef = (_el) => {
---
> let t1;
> if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
> t1 = (_el) => {
500a726,730
> $[0] = t1;
> } else {
> t1 = $[0];
> }
> let callbackRef = t1;
502,503c732,735
< const observer = React.useMemo(() => {
< return new ResizeObserver((entries) => {
---
> let t22;
> let t3;
> if ($[1] !== callback) {
> t3 = new ResizeObserver((entries) => {
511,512c743,752
< }, [callback]);
< callbackRef = (elRef) => {
---
> $[1] = callback;
> $[2] = t3;
> } else {
> t3 = $[2];
> }
> t22 = t3;
> const observer = t22;
> let t4;
> if ($[3] !== enabled || $[4] !== observer) {
> t4 = (elRef) => {
522a763,781
> $[3] = enabled;
> $[4] = observer;
> $[5] = t4;
> } else {
> t4 = $[5];
> }
> callbackRef = t4;
> }
> let t2;
> if ($[6] !== ref || $[7] !== callbackRef) {
> t2 = {
> ref,
> callbackRef
> };
> $[6] = ref;
> $[7] = callbackRef;
> $[8] = t2;
> } else {
> t2 = $[8];
524c783
< return { ref, callbackRef };
---
> return t2;
526c785,786
< function useSize(callback, enabled = true) {
---
> function useSize(callback, t0) {
> const enabled = true;
530,531c790
< const memoedCallback = React.useCallback(
< (el) => {
---
> const memoedCallback = React.useCallback((el) => {
550,552c809
< },
< [callback, itemSize, log, gap, customScrollParent, scrollContainerStateCallback]
< );
---
> }, [callback, itemSize, log, gap, customScrollParent, scrollContainerStateCallback]);
570c827,829
< log("Zero-sized element, this should not happen", { child }, LogLevel.ERROR);
---
> log("Zero-sized element, this should not happen", {
> child
> }, LogLevel.ERROR);
577c836,840
< results.push({ startIndex: index, endIndex: index, size });
---
> results.push({
> startIndex: index,
> endIndex: index,
> size
> });
603,604c866
< const handler = React.useCallback(
< (ev) => {
---
> const handler = React.useCallback((ev) => {
632,634c894
< },
< [scrollContainerStateCallback, smoothScrollTargetReached]
< );
---
> }, [scrollContainerStateCallback, smoothScrollTargetReached]);
638,639c898,904
< handler({ target: localRef, suppressFlushSync: true });
< localRef.addEventListener("scroll", handler, { passive: true });
---
> handler({
> target: localRef,
> suppressFlushSync: true
> });
> localRef.addEventListener("scroll", handler, {
> passive: true
> });
646,647c911,912
< const scrollerElement2 = scrollerRef.current;
< if (!scrollerElement2 || "offsetHeight" in scrollerElement2 && scrollerElement2.offsetHeight === 0) {
---
> const scrollerElement_0 = scrollerRef.current;
> if (!scrollerElement_0 || "offsetHeight" in scrollerElement_0 && scrollerElement_0.offsetHeight === 0) {
652,655c917,920
< let scrollHeight;
< let scrollTop;
< if (scrollerElement2 === window) {
< scrollHeight = Math.max(correctItemSize(document.documentElement, "height"), document.documentElement.scrollHeight);
---
> let scrollHeight_0;
> let scrollTop_0;
> if (scrollerElement_0 === window) {
> scrollHeight_0 = Math.max(correctItemSize(document.documentElement, "height"), document.documentElement.scrollHeight);
657c922
< scrollTop = document.documentElement.scrollTop;
---
> scrollTop_0 = document.documentElement.scrollTop;
659,661c924,926
< scrollHeight = scrollerElement2.scrollHeight;
< offsetHeight = correctItemSize(scrollerElement2, "height");
< scrollTop = scrollerElement2.scrollTop;
---
> scrollHeight_0 = scrollerElement_0.scrollHeight;
> offsetHeight = correctItemSize(scrollerElement_0, "height");
> scrollTop_0 = scrollerElement_0.scrollTop;
663c928
< const maxScrollTop = scrollHeight - offsetHeight;
---
> const maxScrollTop = scrollHeight_0 - offsetHeight;
665,666c930,935
< if (approximatelyEqual(offsetHeight, scrollHeight) || location.top === scrollTop) {
< scrollContainerStateCallback({ scrollTop, scrollHeight, viewportHeight: offsetHeight });
---
> if (approximatelyEqual(offsetHeight, scrollHeight_0) || location.top === scrollTop_0) {
> scrollContainerStateCallback({
> scrollTop: scrollTop_0,
> scrollHeight: scrollHeight_0,
> viewportHeight: offsetHeight
> });
685c954
< scrollerElement2.scrollTo(location);
---
> scrollerElement_0.scrollTo(location);
687,688c956,957
< function scrollByCallback(location) {
< scrollerRef.current.scrollBy(location);
---
> function scrollByCallback(location_0) {
> scrollerRef.current.scrollBy(location_0);
690c959,963
< return { scrollerRef, scrollByCallback, scrollToCallback };
---
> return {
> scrollerRef,
> scrollByCallback,
> scrollToCallback
> };
692,693c965
< const domIOSystem = system(
< () => {
---
> const domIOSystem = system(() => {
708,721c980,985
< connect(
< pipe(
< scrollContainerState,
< map(({ scrollTop: scrollTop2 }) => scrollTop2)
< ),
< scrollTop
< );
< connect(
< pipe(
< scrollContainerState,
< map(({ scrollHeight: scrollHeight2 }) => scrollHeight2)
< ),
< scrollHeight
< );
---
> connect(pipe(scrollContainerState, map(({
> scrollTop: scrollTop2
> }) => scrollTop2)), scrollTop);
> connect(pipe(scrollContainerState, map(({
> scrollHeight: scrollHeight2
> }) => scrollHeight2)), scrollHeight);
742,746c1006,1011
< },
< [],
< { singleton: true }
< );
< const NIL_NODE = { lvl: 0 };
---
> }, [], {
> singleton: true
> });
> const NIL_NODE = {
> lvl: 0
> };
748c1013,1019
< return { k, v, lvl, l, r };
---
> return {
> k,
> v,
> lvl,
> l,
> r
> };
759c1030,1034
< const { k, l, r } = node;
---
> const {
> k,
> l,
> r
> } = node;
767c1042,1046
< return adjust(clone(node, { k: lastKey, v: lastValue, l: deleteLast(l) }));
---
> return adjust(clone(node, {
> k: lastKey,
> v: lastValue,
> l: deleteLast(l)
> }));
770c1049,1051
< return adjust(clone(node, { l: remove(l, key) }));
---
> return adjust(clone(node, {
> l: remove(l, key)
> }));
772c1053,1055
< return adjust(clone(node, { r: remove(r, key) }));
---
> return adjust(clone(node, {
> r: remove(r, key)
> }));
809c1092,1095
< return clone(node, { k, v });
---
> return clone(node, {
> k,
> v
> });
811c1097,1099
< return rebalance(clone(node, { l: insert(node.l, k, v) }));
---
> return rebalance(clone(node, {
> l: insert(node.l, k, v)
> }));
813c1101,1103
< return rebalance(clone(node, { r: insert(node.r, k, v) }));
---
> return rebalance(clone(node, {
> r: insert(node.r, k, v)
> }));
820c1110,1115
< const { k, v, l, r } = node;
---
> const {
> k,
> v,
> l,
> r
> } = node;
826c1121,1124
< result.push({ k, v });
---
> result.push({
> k,
> v
> });
837c1135,1138
< return [...walk(node.l), { k: node.k, v: node.v }, ...walk(node.r)];
---
> return [...walk(node.l), {
> k: node.k,
> v: node.v
> }, ...walk(node.r)];
843c1144,1146
< return empty(node.r) ? node.l : adjust(clone(node, { r: deleteLast(node.r) }));
---
> return empty(node.r) ? node.l : adjust(clone(node, {
> r: deleteLast(node.r)
> }));
846,852c1149
< return newAANode(
< args.k !== void 0 ? args.k : node.k,
< args.v !== void 0 ? args.v : node.v,
< args.lvl !== void 0 ? args.lvl : node.lvl,
< args.l !== void 0 ? args.l : node.l,
< args.r !== void 0 ? args.r : node.r
< );
---
> return newAANode(args.k !== void 0 ? args.k : node.k, args.v !== void 0 ? args.v : node.v, args.lvl !== void 0 ? args.lvl : node.lvl, args.l !== void 0 ? args.l : node.l, args.r !== void 0 ? args.r : node.r);
861c1158,1162
< const { l, r, lvl } = node;
---
> const {
> l,
> r,
> lvl
> } = node;
866c1167,1169
< return skew(clone(node, { lvl: lvl - 1 }));
---
> return skew(clone(node, {
> lvl: lvl - 1
> }));
870c1173,1175
< l: clone(l, { r: l.r.l }),
---
> l: clone(l, {
> r: l.r.l
> }),
883c1188,1190
< return split(clone(node, { lvl: lvl - 1 }));
---
> return split(clone(node, {
> lvl: lvl - 1
> }));
893c1200,1203
< r: split(clone(r, { l: rl.r, lvl: rlvl })),
---
> r: split(clone(r, {
> l: rl.r,
> lvl: rlvl
> })),
914c1224,1227
< let { index: start, value } = parser(items[0]);
---
> let {
> index: start,
> value
> } = parser(items[0]);
917,918c1230,1238
< const { index: nextIndex, value: nextValue } = parser(items[i]);
< result.push({ start, end: nextIndex - 1, value });
---
> const {
> index: nextIndex,
> value: nextValue
> } = parser(items[i]);
> result.push({
> start,
> end: nextIndex - 1,
> value
> });
922c1242,1246
< result.push({ start, end: Infinity, value });
---
> result.push({
> start,
> end: Infinity,
> value
> });
926c1250,1256
< return arrayToRanges(nodes, ({ k: index, v: value }) => ({ index, value }));
---
> return arrayToRanges(nodes, ({
> k: index,
> v: value
> }) => ({
> index,
> value
> }));
929,930c1259,1268
< const { r, lvl } = node;
< return !empty(r) && !empty(r.r) && r.lvl === lvl && r.r.lvl === lvl ? clone(r, { l: clone(node, { r: r.l }), lvl: lvl + 1 }) : node;
---
> const {
> r,
> lvl
> } = node;
> return !empty(r) && !empty(r.r) && r.lvl === lvl && r.r.lvl === lvl ? clone(r, {
> l: clone(node, {
> r: r.l
> }),
> lvl: lvl + 1
> }) : node;
933,934c1271,1278
< const { l } = node;
< return !empty(l) && l.lvl === node.lvl ? clone(l, { r: clone(node, { l: l.r }) }) : node;
---
> const {
> l
> } = node;
> return !empty(l) && l.lvl === node.lvl ? clone(l, {
> r: clone(node, {
> l: l.r
> })
> }) : node;
967,968c1311
< const recalcSystem = system(
< () => {
---
> const recalcSystem = system(() => {
970,974c1313,1318
< return { recalcInProgress };
< },
< [],
< { singleton: true }
< );
---
> return {
> recalcInProgress
> };
> }, [], {
> singleton: true
> });
976c1320,1324
< const { size, startIndex, endIndex } = refRange;
---
> const {
> size,
> startIndex,
> endIndex
> } = refRange;
994c1342,1346
< const { size, startIndex, endIndex } = range;
---
> const {
> size,
> startIndex,
> endIndex
> } = range;
1006c1358,1362
< for (const { start: rangeStart, end: rangeEnd, value: rangeValue } of overlappingRanges) {
---
> for (const {
> start: rangeStart,
> end: rangeEnd,
> value: rangeValue
> } of overlappingRanges) {
1038c1394,1396
< function indexComparator({ index: itemIndex }, index) {
---
> function indexComparator({
> index: itemIndex
> }, index) {
1041c1399,1401
< function offsetComparator({ offset: itemOffset }, offset) {
---
> function offsetComparator({
> offset: itemOffset
> }, offset) {
1045c1405,1408
< return { index: point.index, value: point };
---
> return {
> index: point.index,
> value: point
> };
1073c1436,1439
< for (const { start: startIndex2, value } of rangesWithin(sizeTree, syncStart, Infinity)) {
---
> for (const {
> start: startIndex2,
> value
> } of rangesWithin(sizeTree, syncStart, Infinity)) {
1111c1477,1482
< const { offsetTree: newOffsetTree, lastIndex, lastSize, lastOffset } = createOffsetTree(state.offsetTree, syncStart, newSizeTree, gap);
---
> const {
> offsetTree: newOffsetTree,
> lastIndex,
> lastSize,
> lastOffset
> } = createOffsetTree(state.offsetTree, syncStart, newSizeTree, gap);
1128c1499,1503
< const { offset, index: startIndex, size } = findClosestSmallerOrEqual(tree, index, indexComparator);
---
> const {
> offset,
> index: startIndex,
> size
> } = findClosestSmallerOrEqual(tree, index, indexComparator);
1160c1535,1538
< return walk(sizeTree).map(({ k: startIndex, v: size }, index, sizeArray) => {
---
> return walk(sizeTree).map(({
> k: startIndex,
> v: size
> }, index, sizeArray) => {
1163c1541,1545
< return { startIndex, endIndex, size };
---
> return {
> startIndex,
> endIndex,
> size
> };
1170,1171c1552,1556
< const sizeSystem = system(
< ([{ log }, { recalcInProgress }]) => {
---
> const sizeSystem = system(([{
> log
> }, {
> recalcInProgress
> }]) => {
1185,1193c1570,1574
< const sizes = statefulStreamFromEmitter(
< pipe(sizeRanges, withLatestFrom(groupIndices, log, gap), scan(sizeStateReducer, initial), distinctUntilChanged()),
< initial
< );
< const prevGroupIndices = statefulStreamFromEmitter(
< pipe(
< groupIndices,
< distinctUntilChanged(),
< scan((prev, curr) => ({ prev: prev.current, current: curr }), {
---
> const sizes = statefulStreamFromEmitter(pipe(sizeRanges, withLatestFrom(groupIndices, log, gap), scan(sizeStateReducer, initial), distinctUntilChanged()), initial);
> const prevGroupIndices = statefulStreamFromEmitter(pipe(groupIndices, distinctUntilChanged(), scan((prev, curr) => ({
> prev: prev.current,
> current: curr
> }), {
1196,1206c1577,1580
< }),
< map(({ prev }) => prev)
< ),
< []
< );
< connect(
< pipe(
< groupIndices,
< filter((indexes) => indexes.length > 0),
< withLatestFrom(sizes, gap),
< map(([groupIndices2, sizes2, gap2]) => {
---
> }), map(({
> prev
> }) => prev)), []);
> connect(pipe(groupIndices, filter((indexes) => indexes.length > 0), withLatestFrom(sizes, gap), map(([groupIndices2, sizes2, gap2]) => {
1215,1223c1589,1592
< })
< ),
< sizes
< );
< connect(
< pipe(
< totalCount,
< withLatestFrom(sizes),
< filter(([totalCount2, { lastIndex }]) => {
---
> })), sizes);
> connect(pipe(totalCount, withLatestFrom(sizes), filter(([totalCount2, {
> lastIndex
> }]) => {
1225,1228c1594,1598
< }),
< map(([totalCount2, { lastIndex, lastSize }]) => {
< return [
< {
---
> }), map(([totalCount2, {
> lastIndex,
> lastSize
> }]) => {
> return [{
1232,1237c1602,1603
< }
< ];
< })
< ),
< sizeRanges
< );
---
> }];
> })), sizeRanges);
1239,1249c1605,1606
< const trackItemSizes = statefulStreamFromEmitter(
< pipe(
< fixedItemSize,
< map((size) => size === void 0)
< ),
< true
< );
< connect(
< pipe(
< defaultItemSize,
< filter((value) => {
---
> const trackItemSizes = statefulStreamFromEmitter(pipe(fixedItemSize, map((size) => size === void 0)), true);
> connect(pipe(defaultItemSize, filter((value) => {
1251,1261c1608,1615
< }),
< map((size) => [{ startIndex: 0, endIndex: 0, size }])
< ),
< sizeRanges
< );
< const listRefresh = streamFromEmitter(
< pipe(
< sizeRanges,
< withLatestFrom(sizes),
< scan(
< ({ sizes: oldSizes }, [_, newSizes]) => {
---
> }), map((size) => [{
> startIndex: 0,
> endIndex: 0,
> size
> }])), sizeRanges);
> const listRefresh = streamFromEmitter(pipe(sizeRanges, withLatestFrom(sizes), scan(({
> sizes: oldSizes
> }, [_, newSizes]) => {
1266,1284c1620,1635
< },
< { changed: false, sizes: initial }
< ),
< map((value) => value.changed)
< )
< );
< subscribe(
< pipe(
< firstItemIndex,
< scan(
< (prev, next) => {
< return { diff: prev.prev - next, prev: next };
< },
< { diff: 0, prev: 0 }
< ),
< map((val) => val.diff)
< ),
< (offset) => {
< const { groupIndices: groupIndices2 } = getValue(sizes);
---
> }, {
> changed: false,
> sizes: initial
> }), map((value) => value.changed)));
> subscribe(pipe(firstItemIndex, scan((prev, next) => {
> return {
> diff: prev.prev - next,
> prev: next
> };
> }, {
> diff: 0,
> prev: 0
> }), map((val) => val.diff)), (offset) => {
> const {
> groupIndices: groupIndices2
> } = getValue(sizes);
1295,1296c1646
< }
< );
---
> });
1299,1303c1649,1651
< log2(
< "`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",
< { firstItemIndex },
< LogLevel.ERROR
< );
---
> log2("`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value", {
> firstItemIndex
> }, LogLevel.ERROR);
1307,1311c1655
< connect(
< pipe(
< unshiftWith,
< withLatestFrom(sizes),
< map(([unshiftWith2, sizes2]) => {
---
> connect(pipe(unshiftWith, withLatestFrom(sizes), map(([unshiftWith2, sizes2]) => {
1340,1341c1684,1687
< return sizeTreeKV.reduce(
< (acc, { k: index, v: size }) => {
---
> return sizeTreeKV.reduce((acc, {
> k: index,
> v: size
> }) => {
1344,1346c1690
< ranges = [
< ...acc.ranges,
< {
---
> ranges = [...acc.ranges, {
1350,1351c1694
< }
< ];
---
> }];
1358,1359c1701
< },
< {
---
> }, {
1362a1705
> }).ranges;
1364,1367c1707,1710
< ).ranges;
< }
< return walk(sizes2.sizeTree).reduce(
< (acc, { k: index, v: size }) => {
---
> return walk(sizes2.sizeTree).reduce((acc, {
> k: index,
> v: size
> }) => {
1369c1712,1716
< ranges: [...acc.ranges, { startIndex: acc.prevIndex, endIndex: index + unshiftWith2 - 1, size: acc.prevSize }],
---
> ranges: [...acc.ranges, {
> startIndex: acc.prevIndex,
> endIndex: index + unshiftWith2 - 1,
> size: acc.prevSize
> }],
1373,1374c1720
< },
< {
---
> }, {
1378,1388c1724,1728
< }
< ).ranges;
< })
< ),
< sizeRanges
< );
< const shiftWithOffset = streamFromEmitter(
< pipe(
< shiftWith,
< withLatestFrom(sizes, gap),
< map(([shiftWith2, { offsetTree }, gap2]) => {
---
> }).ranges;
> })), sizeRanges);
> const shiftWithOffset = streamFromEmitter(pipe(shiftWith, withLatestFrom(sizes, gap), map(([shiftWith2, {
> offsetTree
> }, gap2]) => {
1391,1398c1731,1732
< })
< )
< );
< connect(
< pipe(
< shiftWith,
< withLatestFrom(sizes, gap),
< map(([shiftWith2, sizes2, gap2]) => {
---
> })));
> connect(pipe(shiftWith, withLatestFrom(sizes, gap), map(([shiftWith2, sizes2, gap2]) => {
1415c1749,1752
< newSizeTree = walk(sizes2.sizeTree).reduce((acc, { k, v }) => {
---
> newSizeTree = walk(sizes2.sizeTree).reduce((acc, {
> k,
> v
> }) => {
1431c1768,1771
< const newSizeTree = walk(sizes2.sizeTree).reduce((acc, { k, v }) => {
---
> const newSizeTree = walk(sizes2.sizeTree).reduce((acc, {
> k,
> v
> }) => {
1440,1443c1780
< })
< ),
< sizes
< );
---
> })), sizes);
1465,1468c1802,1804
< },
< tup(loggerSystem, recalcSystem),
< { singleton: true }
< );
---
> }, tup(loggerSystem, recalcSystem), {
> singleton: true
> });
1471c1807,1809
< const result = typeof location === "number" ? { index: location } : location;
---
> const result = typeof location === "number" ? {
> index: location
> } : location;
1483,1486c1821,1826
< const scrollToIndexSystem = system(
< ([
< { sizes, totalCount, listRefresh, gap },
< {
---
> const scrollToIndexSystem = system(([{
> sizes,
> totalCount,
> listRefresh,
> gap
> }, {
1495,1497c1835,1837
< },
< { log }
< ]) => {
---
> }, {
> log
> }]) => {
1519,1530c1859
< connect(
< pipe(
< scrollToIndex,
< withLatestFrom(sizes, viewportHeight, totalCount, topListHeight, headerHeight, footerHeight, log),
< withLatestFrom(gap, fixedHeaderHeight, fixedFooterHeight),
< map(
< ([
< [location, sizes2, viewportHeight2, totalCount2, topListHeight2, headerHeight2, footerHeight2, log2],
< gap2,
< fixedHeaderHeight2,
< fixedFooterHeight2
< ]) => {
---
> connect(pipe(scrollToIndex, withLatestFrom(sizes, viewportHeight, totalCount, topListHeight, headerHeight, footerHeight, log), withLatestFrom(gap, fixedHeaderHeight, fixedFooterHeight), map(([[location, sizes2, viewportHeight2, totalCount2, topListHeight2, headerHeight2, footerHeight2, log2], gap2, fixedHeaderHeight2, fixedFooterHeight2]) => {
1532c1861,1865
< const { align, behavior, offset } = normalLocation;
---
> const {
> align,
> behavior,
> offset
> } = normalLocation;
1552c1885,1887
< log2("retrying to scroll to", { location }, LogLevel.DEBUG);
---
> log2("retrying to scroll to", {
> location
> }, LogLevel.DEBUG);
1575,1581c1910,1919
< log2("scrolling from index to", { index, top, behavior }, LogLevel.DEBUG);
< return { top, behavior };
< }
< )
< ),
< scrollTo
< );
---
> log2("scrolling from index to", {
> index,
> top,
> behavior
> }, LogLevel.DEBUG);
> return {
> top,
> behavior
> };
> })), scrollTo);
1587,1590c1925,1927
< },
< tup(sizeSystem, domIOSystem, loggerSystem),
< { singleton: true }
< );
---
> }, tup(sizeSystem, domIOSystem, loggerSystem), {
> singleton: true
> });
1618c1955,1962
< const stateFlagsSystem = system(([{ scrollContainerState, scrollTop, viewportHeight, headerHeight, footerHeight, scrollBy }]) => {
---
> const stateFlagsSystem = system(([{
> scrollContainerState,
> scrollTop,
> viewportHeight,
> headerHeight,
> footerHeight,
> scrollBy
> }]) => {
1625,1643c1969,1971
< const isScrolling = statefulStreamFromEmitter(
< pipe(
< merge(pipe(duc(scrollTop), skip(1), mapTo(true)), pipe(duc(scrollTop), skip(1), mapTo(false), debounceTime(100))),
< distinctUntilChanged()
< ),
< false
< );
< const isScrollingBy = statefulStreamFromEmitter(
< pipe(merge(pipe(scrollBy, mapTo(true)), pipe(scrollBy, mapTo(false), debounceTime(200))), distinctUntilChanged()),
< false
< );
< connect(
< pipe(
< combineLatest(duc(scrollTop), duc(atTopThreshold)),
< map(([top, atTopThreshold2]) => top <= atTopThreshold2),
< distinctUntilChanged()
< ),
< isAtTop
< );
---
> const isScrolling = statefulStreamFromEmitter(pipe(merge(pipe(duc(scrollTop), skip(1), mapTo(true)), pipe(duc(scrollTop), skip(1), mapTo(false), debounceTime(100))), distinctUntilChanged()), false);
> const isScrollingBy = statefulStreamFromEmitter(pipe(merge(pipe(scrollBy, mapTo(true)), pipe(scrollBy, mapTo(false), debounceTime(200))), distinctUntilChanged()), false);
> connect(pipe(combineLatest(duc(scrollTop), duc(atTopThreshold)), map(([top, atTopThreshold2]) => top <= atTopThreshold2), distinctUntilChanged()), isAtTop);
1645,1648c1973,1976
< const atBottomState = streamFromEmitter(
< pipe(
< combineLatest(scrollContainerState, duc(viewportHeight), duc(headerHeight), duc(footerHeight), duc(atBottomThreshold)),
< scan((current, [{ scrollTop: scrollTop2, scrollHeight }, viewportHeight2, _headerHeight, _footerHeight, atBottomThreshold2]) => {
---
> const atBottomState = streamFromEmitter(pipe(combineLatest(scrollContainerState, duc(viewportHeight), duc(headerHeight), duc(footerHeight), duc(atBottomThreshold)), scan((current, [{
> scrollTop: scrollTop2,
> scrollHeight
> }, viewportHeight2, _headerHeight, _footerHeight, atBottomThreshold2]) => {
1687,1688c2015
< }, INITIAL_BOTTOM_STATE),
< distinctUntilChanged((prev, next) => {
---
> }, INITIAL_BOTTOM_STATE), distinctUntilChanged((prev, next) => {
1690,1697c2017,2022
< })
< )
< );
< const lastJumpDueToItemResize = statefulStreamFromEmitter(
< pipe(
< scrollContainerState,
< scan(
< (current, { scrollTop: scrollTop2, scrollHeight, viewportHeight: viewportHeight2 }) => {
---
> })));
> const lastJumpDueToItemResize = statefulStreamFromEmitter(pipe(scrollContainerState, scan((current, {
> scrollTop: scrollTop2,
> scrollHeight,
> viewportHeight: viewportHeight2
> }) => {
1723,1737c2048,2054
< },
< { scrollHeight: 0, jump: 0, scrollTop: 0, changed: false }
< ),
< filter((value) => value.changed),
< map((value) => value.jump)
< ),
< 0
< );
< connect(
< pipe(
< atBottomState,
< map((state) => state.atBottom)
< ),
< isAtBottom
< );
---
> }, {
> scrollHeight: 0,
> jump: 0,
> scrollTop: 0,
> changed: false
> }), filter((value) => value.changed), map((value) => value.jump)), 0);
> connect(pipe(atBottomState, map((state) => state.atBottom)), isAtBottom);
1740,1746c2057,2059
< connect(
< pipe(
< scrollContainerState,
< map(({ scrollTop: scrollTop2 }) => scrollTop2),
< distinctUntilChanged(),
< scan(
< (acc, scrollTop2) => {
---
> connect(pipe(scrollContainerState, map(({
> scrollTop: scrollTop2
> }) => scrollTop2), distinctUntilChanged(), scan((acc, scrollTop2) => {
1748c2061,2064
< return { direction: acc.direction, prevScrollTop: scrollTop2 };
---
> return {
> direction: acc.direction,
> prevScrollTop: scrollTop2
> };
1750,1757c2066,2073
< return { direction: scrollTop2 < acc.prevScrollTop ? UP : DOWN, prevScrollTop: scrollTop2 };
< },
< { direction: DOWN, prevScrollTop: 0 }
< ),
< map((value) => value.direction)
< ),
< scrollDirection
< );
---
> return {
> direction: scrollTop2 < acc.prevScrollTop ? UP : DOWN,
> prevScrollTop: scrollTop2
> };
> }, {
> direction: DOWN,
> prevScrollTop: 0
> }), map((value) => value.direction)), scrollDirection);
1760,1761c2076
< connect(
< pipe(
---
> connect(pipe(
1766,1779c2081,2082
< ),
< scrollVelocity
< );
< connect(
< pipe(
< scrollTop,
< throttleTime(100),
< withLatestFrom(isScrolling),
< filter(([_, isScrolling2]) => !!isScrolling2),
< scan(([_, prev], [next]) => [prev, next], [0, 0]),
< map(([prev, next]) => next - prev)
< ),
< scrollVelocity
< );
---
> ), scrollVelocity);
> connect(pipe(scrollTop, throttleTime(100), withLatestFrom(isScrolling), filter(([_, isScrolling2]) => !!isScrolling2), scan(([_, prev], [next]) => [prev, next], [0, 0]), map(([prev, next]) => next - prev)), scrollVelocity);
1794,1795c2097,2099
< const propsReadySystem = system(
< ([{ log }]) => {
---
> const propsReadySystem = system(([{
> log
> }]) => {
1797,1803c2101
< const didMount = streamFromEmitter(
< pipe(
< propsReady,
< filter((ready) => ready),
< distinctUntilChanged()
< )
< );
---
> const didMount = streamFromEmitter(pipe(propsReady, filter((ready) => ready), distinctUntilChanged()));
1807,1811c2105,2111
< return { propsReady, didMount };
< },
< tup(loggerSystem),
< { singleton: true }
< );
---
> return {
> propsReady,
> didMount
> };
> }, tup(loggerSystem), {
> singleton: true
> });
1824,1825c2124,2135
< const initialTopMostItemIndexSystem = system(
< ([{ sizes, listRefresh, defaultItemSize }, { scrollTop }, { scrollToIndex, scrollTargetReached }, { didMount }]) => {
---
> const initialTopMostItemIndexSystem = system(([{
> sizes,
> listRefresh,
> defaultItemSize
> }, {
> scrollTop
> }, {
> scrollToIndex,
> scrollTargetReached
> }, {
> didMount
> }]) => {
1829,1851c2139,2143
< connect(
< pipe(
< didMount,
< withLatestFrom(initialTopMostItemIndex),
< filter(([_, location]) => !!location),
< mapTo(false)
< ),
< scrolledToInitialItem
< );
< connect(
< pipe(
< didMount,
< withLatestFrom(initialTopMostItemIndex),
< filter(([_, location]) => !!location),
< mapTo(false)
< ),
< initialItemFinalLocationReached
< );
< subscribe(
< pipe(
< combineLatest(listRefresh, didMount),
< withLatestFrom(scrolledToInitialItem, sizes, defaultItemSize, initialItemFinalLocationReached),
< filter(([[, didMount2], scrolledToInitialItem2, { sizeTree }, defaultItemSize2, scrollScheduled]) => {
---
> connect(pipe(didMount, withLatestFrom(initialTopMostItemIndex), filter(([_, location]) => !!location), mapTo(false)), scrolledToInitialItem);
> connect(pipe(didMount, withLatestFrom(initialTopMostItemIndex), filter(([_, location]) => !!location), mapTo(false)), initialItemFinalLocationReached);
> subscribe(pipe(combineLatest(listRefresh, didMount), withLatestFrom(scrolledToInitialItem, sizes, defaultItemSize, initialItemFinalLocationReached), filter(([[, didMount2], scrolledToInitialItem2, {
> sizeTree
> }, defaultItemSize2, scrollScheduled]) => {
1853,1856c2145
< }),
< withLatestFrom(initialTopMostItemIndex)
< ),
< ([, initialTopMostItemIndex2]) => {
---
> }), withLatestFrom(initialTopMostItemIndex)), ([, initialTopMostItemIndex2]) => {
1866,1867c2155
< }
< );
---
> });
1873,1876c2161,2163
< },
< tup(sizeSystem, domIOSystem, scrollToIndexSystem, propsReadySystem),
< { singleton: true }
< );
---
> }, tup(sizeSystem, domIOSystem, scrollToIndexSystem, propsReadySystem), {
> singleton: true
> });
1889,1898c2176,2193
< const followOutputSystem = system(
< ([
< { totalCount, listRefresh },
< { isAtBottom, atBottomState },
< { scrollToIndex },
< { scrolledToInitialItem },
< { propsReady, didMount },
< { log },
< { scrollingInProgress }
< ]) => {
---
> const followOutputSystem = system(([{
> totalCount,
> listRefresh
> }, {
> isAtBottom,
> atBottomState
> }, {
> scrollToIndex
> }, {
> scrolledToInitialItem
> }, {
> propsReady,
> didMount
> }, {
> log
> }, {
> scrollingInProgress
> }]) => {
1909,1913c2204
< subscribe(
< pipe(
< combineLatest(pipe(duc(totalCount), skip(1)), didMount),
< withLatestFrom(duc(followOutput), isAtBottom, scrolledToInitialItem, scrollingInProgress),
< map(([[totalCount2, didMount2], followOutput2, isAtBottom2, scrolledToInitialItem2, scrollingInProgress2]) => {
---
> subscribe(pipe(combineLatest(pipe(duc(totalCount), skip(1)), didMount), withLatestFrom(duc(followOutput), isAtBottom, scrolledToInitialItem, scrollingInProgress), map(([[totalCount2, didMount2], followOutput2, isAtBottom2, scrolledToInitialItem2, scrollingInProgress2]) => {
1920,1924c2211,2221
< return { totalCount: totalCount2, shouldFollow, followOutputBehavior };
< }),
< filter(({ shouldFollow }) => shouldFollow)
< ),
< ({ totalCount: totalCount2, followOutputBehavior }) => {
---
> return {
> totalCount: totalCount2,
> shouldFollow,
> followOutputBehavior
> };
> }), filter(({
> shouldFollow
> }) => shouldFollow)), ({
> totalCount: totalCount2,
> followOutputBehavior
> }) => {
1930c2227,2229
< getValue(log)("following output to ", { totalCount: totalCount2 }, LogLevel.DEBUG);
---
> getValue(log)("following output to ", {
> totalCount: totalCount2
> }, LogLevel.DEBUG);
1934,1935c2233
< }
< );
---
> });
1945,1958c2243,2255
< subscribe(
< pipe(
< combineLatest(duc(followOutput), totalCount, propsReady),
< filter(([follow, , ready]) => follow && ready),
< scan(
< ({ value }, [, next]) => {
< return { refreshed: value === next, value: next };
< },
< { refreshed: false, value: 0 }
< ),
< filter(({ refreshed }) => refreshed),
< withLatestFrom(followOutput, totalCount)
< ),
< ([, followOutput2]) => {
---
> subscribe(pipe(combineLatest(duc(followOutput), totalCount, propsReady), filter(([follow, , ready]) => follow && ready), scan(({
> value
> }, [, next]) => {
> return {
> refreshed: value === next,
> value: next
> };
> }, {
> refreshed: false,
> value: 0
> }), filter(({
> refreshed
> }) => refreshed), withLatestFrom(followOutput, totalCount)), ([, followOutput2]) => {
1962,1963c2259
< }
< );
---
> });
1972,1975c2268,2272
< return { followOutput, autoscrollToBottom };
< },
< tup(sizeSystem, stateFlagsSystem, scrollToIndexSystem, initialTopMostItemIndexSystem, propsReadySystem, loggerSystem, domIOSystem)
< );
---
> return {
> followOutput,
> autoscrollToBottom
> };
> }, tup(sizeSystem, stateFlagsSystem, scrollToIndexSystem, initialTopMostItemIndexSystem, propsReadySystem, loggerSystem, domIOSystem));
1977,1978c2274
< return counts.reduce(
< (acc, groupCount) => {
---
> return counts.reduce((acc, groupCount) => {
1982,1983c2278
< },
< {
---
> }, {
1986,1987c2281
< }
< );
---
> });
1989,1990c2283,2290
< const groupedListSystem = system(
< ([{ totalCount, groupIndices, sizes }, { scrollTop, headerHeight }]) => {
---
> const groupedListSystem = system(([{
> totalCount,
> groupIndices,
> sizes
> }, {
> scrollTop,
> headerHeight
> }]) => {
1994,2015c2294,2298
< connect(
< pipe(
< groupIndicesAndCount,
< map((value) => value.totalCount)
< ),
< totalCount
< );
< connect(
< pipe(
< groupIndicesAndCount,
< map((value) => value.groupIndices)
< ),
< groupIndices
< );
< connect(
< pipe(
< combineLatest(scrollTop, sizes, headerHeight),
< filter(([_, sizes2]) => hasGroups(sizes2)),
< map(([scrollTop2, state, headerHeight2]) => findMaxKeyValue(state.groupOffsetTree, Math.max(scrollTop2 - headerHeight2, 0), "v")[0]),
< distinctUntilChanged(),
< map((index) => [index])
< ),
---
> connect(pipe(groupIndicesAndCount, map((value) => value.totalCount)), totalCount);
> connect(pipe(groupIndicesAndCount, map((value) => value.groupIndices)), groupIndices);
> connect(pipe(combineLatest(scrollTop, sizes, headerHeight), filter(([_, sizes2]) => hasGroups(sizes2)), map(([scrollTop2, state, headerHeight2]) => findMaxKeyValue(state.groupOffsetTree, Math.max(scrollTop2 - headerHeight2, 0), "v")[0]), distinctUntilChanged(), map((index) => [index])), topItemsIndexes);
> return {
> groupCounts,
2017,2021c2300,2301
< );
< return { groupCounts, topItemsIndexes };
< },
< tup(sizeSystem, domIOSystem)
< );
---
> };
> }, tup(sizeSystem, domIOSystem));
2045,2046c2325,2331
< const sizeRangeSystem = system(
< ([{ scrollTop, viewportHeight, deviation, headerHeight, fixedHeaderHeight }]) => {
---
> const sizeRangeSystem = system(([{
> scrollTop,
> viewportHeight,
> deviation,
> headerHeight,
> fixedHeaderHeight
> }]) => {
2051,2075c2336
< const visibleRange = statefulStreamFromEmitter(
< pipe(
< combineLatest(
< duc(scrollTop),
< duc(viewportHeight),
< duc(headerHeight),
< duc(listBoundary, tupleComparator),
< duc(overscan),
< duc(topListHeight),
< duc(fixedHeaderHeight),
< duc(deviation),
< duc(increaseViewportBy)
< ),
< map(
< ([
< scrollTop2,
< viewportHeight2,
< headerHeight2,
< [listTop, listBottom],
< overscan2,
< topListHeight2,
< fixedHeaderHeight2,
< deviation2,
< increaseViewportBy2
< ]) => {
---
> const visibleRange = statefulStreamFromEmitter(pipe(combineLatest(duc(scrollTop), duc(viewportHeight), duc(headerHeight), duc(listBoundary, tupleComparator), duc(overscan), duc(topListHeight), duc(fixedHeaderHeight), duc(deviation), duc(increaseViewportBy)), map(([scrollTop2, viewportHeight2, headerHeight2, [listTop, listBottom], overscan2, topListHeight2, fixedHeaderHeight2, deviation2, increaseViewportBy2]) => {
2093,2096c2354
< return [
< Math.max(top - headerHeight2 - getOverscan(overscan2, TOP, direction) - topViewportAddition, 0),
< top - headerVisible - fixedHeaderHeight2 + viewportHeight2 + getOverscan(overscan2, BOTTOM, direction) + bottomViewportAddition
< ];
---
> return [Math.max(top - headerHeight2 - getOverscan(overscan2, TOP, direction) - topViewportAddition, 0), top - headerVisible - fixedHeaderHeight2 + viewportHeight2 + getOverscan(overscan2, BOTTOM, direction) + bottomViewportAddition];
2099,2105c2357
< }
< ),
< filter((value) => value != null),
< distinctUntilChanged(tupleComparator)
< ),
< [0, 0]
< );
---
> }), filter((value) => value != null), distinctUntilChanged(tupleComparator)), [0, 0]);
2115,2118c2367,2369
< },
< tup(domIOSystem),
< { singleton: true }
< );
---
> }, tup(domIOSystem), {
> singleton: true
> });
2123,2126c2374,2383
< return [
< { index: groupIndex, size: 0, offset: 0 },
< { index: itemIndex, size: 0, offset: 0, data: data && data[0] }
< ];
---
> return [{
> index: groupIndex,
> size: 0,
> offset: 0
> }, {
> index: itemIndex,
> size: 0,
> offset: 0,
> data: data && data[0]
> }];
2128c2385,2390
< return [{ index, size: 0, offset: 0, data: data && data[0] }];
---
> return [{
> index,
> size: 0,
> offset: 0,
> data: data && data[0]
> }];
2146c2408,2412
< return items.map((item) => ({ ...item, index: item.index + firstItemIndex, originalIndex: item.index }));
---
> return items.map((item) => ({
> ...item,
> index: item.index + firstItemIndex,
> originalIndex: item.index
> }));
2182c2448,2452
< const { lastSize, lastOffset, lastIndex } = sizes;
---
> const {
> lastSize,
> lastOffset,
> lastIndex
> } = sizes;
2218c2488,2490
< const items = Array.from({ length: adjustedCount }).map((_, index) => ({
---
> const items = Array.from({
> length: adjustedCount
> }).map((_, index) => ({
2226,2236c2498,2517
< const listStateSystem = system(
< ([
< { sizes, totalCount, data, firstItemIndex, gap },
< groupedListSystem2,
< { visibleRange, listBoundary, topListHeight: rangeTopListHeight },
< { scrolledToInitialItem, initialTopMostItemIndex },
< { topListHeight },
< stateFlags,
< { didMount },
< { recalcInProgress }
< ]) => {
---
> const listStateSystem = system(([{
> sizes,
> totalCount,
> data,
> firstItemIndex,
> gap
> }, groupedListSystem2, {
> visibleRange,
> listBoundary,
> topListHeight: rangeTopListHeight
> }, {
> scrolledToInitialItem,
> initialTopMostItemIndex
> }, {
> topListHeight
> }, stateFlags, {
> didMount
> }, {
> recalcInProgress
> }]) => {
2241,2255c2522,2523
< const listState = statefulStreamFromEmitter(
< pipe(
< combineLatest(
< didMount,
< recalcInProgress,
< duc(visibleRange, tupleComparator),
< duc(totalCount),
< duc(sizes),
< duc(initialTopMostItemIndex),
< scrolledToInitialItem,
< duc(topItemsIndexes),
< duc(firstItemIndex),
< duc(gap),
< data
< ),
---
> const listState = statefulStreamFromEmitter(pipe(
> combineLatest(didMount, recalcInProgress, duc(visibleRange, tupleComparator), duc(totalCount), duc(sizes), duc(initialTopMostItemIndex), scrolledToInitialItem, duc(topItemsIndexes), duc(firstItemIndex), duc(gap), data),
2260,2273c2528
< map(
< ([
< ,
< ,
< [startOffset, endOffset],
< totalCount2,
< sizes2,
< initialTopMostItemIndex2,
< scrolledToInitialItem2,
< topItemsIndexes2,
< firstItemIndex2,
< gap2,
< data2
< ]) => {
---
> map(([, , [startOffset, endOffset], totalCount2, sizes2, initialTopMostItemIndex2, scrolledToInitialItem2, topItemsIndexes2, firstItemIndex2, gap2, data2]) => {
2275c2530,2533
< const { sizeTree, offsetTree } = sizesValue;
---
> const {
> sizeTree,
> offsetTree
> } = sizesValue;
2278c2536,2539
< return { ...EMPTY_LIST_STATE, totalCount: totalCount2 };
---
> return {
> ...EMPTY_LIST_STATE,
> totalCount: totalCount2
> };
2282c2543,2546
< return { ...EMPTY_LIST_STATE, totalCount: totalCount2 };
---
> return {
> ...EMPTY_LIST_STATE,
> totalCount: totalCount2
> };
2291,2298c2555
< const state = buildListState(
< probeItemSet(getInitialTopMostItemIndexNumber(initialTopMostItemIndex2, totalCount2), sizesValue, data2),
< [],
< totalCount2,
< gap2,
< sizesValue,
< firstItemIndex2
< );
---
> const state = buildListState(probeItemSet(getInitialTopMostItemIndexNumber(initialTopMostItemIndex2, totalCount2), sizesValue, data2), [], totalCount2, gap2, sizesValue, firstItemIndex2);
2311c2568,2573
< topItems.push({ index: i, size, offset, data: data2 && data2[i] });
---
> topItems.push({
> index: i,
> size,
> offset,
> data: data2 && data2[i]
> });
2345c2607,2612
< result.push({ index: i, size, offset, data: data2 && data2[i] });
---
> result.push({
> index: i,
> size,
> offset,
> data: data2 && data2[i]
> });
2351,2352c2618
< }
< ),
---
> }),
2356,2373c2622,2624
< ),
< EMPTY_LIST_STATE
< );
< connect(
< pipe(
< data,
< filter(isDefined),
< map((data2) => data2 == null ? void 0 : data2.length)
< ),
< totalCount
< );
< connect(
< pipe(
< listState,
< map((value) => value.topListHeight)
< ),
< topListHeight
< );
---
> ), EMPTY_LIST_STATE);
> connect(pipe(data, filter(isDefined), map((data2) => data2 == null ? void 0 : data2.length)), totalCount);
> connect(pipe(listState, map((value) => value.topListHeight)), topListHeight);
2375,2404c2626,2636
< connect(
< pipe(
< listState,
< map((state) => [state.top, state.bottom])
< ),
< listBoundary
< );
< connect(
< pipe(
< listState,
< map((state) => state.items)
< ),
< itemsRendered
< );
< const endReached = streamFromEmitter(
< pipe(
< listState,
< filter(({ items }) => items.length > 0),
< withLatestFrom(totalCount, data),
< filter(([{ items }, totalCount2]) => items[items.length - 1].originalIndex === totalCount2 - 1),
< map(([, totalCount2, data2]) => [totalCount2 - 1, data2]),
< distinctUntilChanged(tupleComparator),
< map(([count]) => count)
< )
< );
< const startReached = streamFromEmitter(
< pipe(
< listState,
< throttleTime(200),
< filter(({ items, topItems }) => {
---
> connect(pipe(listState, map((state) => [state.top, state.bottom])), listBoundary);
> connect(pipe(listState, map((state) => state.items)), itemsRendered);
> const endReached = streamFromEmitter(pipe(listState, filter(({
> items
> }) => items.length > 0), withLatestFrom(totalCount, data), filter(([{
> items
> }, totalCount2]) => items[items.length - 1].originalIndex === totalCount2 - 1), map(([, totalCount2, data2]) => [totalCount2 - 1, data2]), distinctUntilChanged(tupleComparator), map(([count]) => count)));
> const startReached = streamFromEmitter(pipe(listState, throttleTime(200), filter(({
> items,
> topItems
> }) => {
2406,2415c2638,2645
< }),
< map(({ items }) => items[0].index),
< distinctUntilChanged()
< )
< );
< const rangeChanged = streamFromEmitter(
< pipe(
< listState,
< filter(({ items }) => items.length > 0),
< map(({ items }) => {
---
> }), map(({
> items
> }) => items[0].index), distinctUntilChanged()));
> const rangeChanged = streamFromEmitter(pipe(listState, filter(({
> items
> }) => items.length > 0), map(({
> items
> }) => {
2428,2457c2658,2680
< }),
< distinctUntilChanged(rangeComparator)
< )
< );
< return { listState, topItemsIndexes, endReached, startReached, rangeChanged, itemsRendered, initialItemCount, ...stateFlags };
< },
< tup(
< sizeSystem,
< groupedListSystem,
< sizeRangeSystem,
< initialTopMostItemIndexSystem,
< scrollToIndexSystem,
< stateFlagsSystem,
< propsReadySystem,
< recalcSystem
< ),
< { singleton: true }
< );
< const initialItemCountSystem = system(
< ([{ sizes, firstItemIndex, data, gap }, { initialTopMostItemIndex }, { initialItemCount, listState }, { didMount }]) => {
< connect(
< pipe(
< didMount,
< withLatestFrom(initialItemCount),
< filter(([, count]) => count !== 0),
< withLatestFrom(initialTopMostItemIndex, sizes, firstItemIndex, gap, data),
< map(([[, count], initialTopMostItemIndexValue, sizes2, firstItemIndex2, gap2, data2 = []]) => {
< return buildListStateFromItemCount(count, initialTopMostItemIndexValue, sizes2, firstItemIndex2, gap2, data2);
< })
< ),
---
> }), distinctUntilChanged(rangeComparator)));
> return {
> listState,
> topItemsIndexes,
> endReached,
> startReached,
> rangeChanged,
> itemsRendered,
> initialItemCount,
> ...stateFlags
> };
> }, tup(sizeSystem, groupedListSystem, sizeRangeSystem, initialTopMostItemIndexSystem, scrollToIndexSystem, stateFlagsSystem, propsReadySystem, recalcSystem), {
> singleton: true
> });
> const initialItemCountSystem = system(([{
> sizes,
> firstItemIndex,
> data,
> gap
> }, {
> initialTopMostItemIndex
> }, {
> initialItemCount,
2459c2682,2687
< );
---
> }, {
> didMount
> }]) => {
> connect(pipe(didMount, withLatestFrom(initialItemCount), filter(([, count]) => count !== 0), withLatestFrom(initialTopMostItemIndex, sizes, firstItemIndex, gap, data), map(([[, count], initialTopMostItemIndexValue, sizes2, firstItemIndex2, gap2, data2 = []]) => {
> return buildListStateFromItemCount(count, initialTopMostItemIndexValue, sizes2, firstItemIndex2, gap2, data2);
> })), listState);
2461,2466c2689,2694
< },
< tup(sizeSystem, initialTopMostItemIndexSystem, listStateSystem, propsReadySystem),
< { singleton: true }
< );
< const scrollSeekSystem = system(
< ([{ scrollVelocity }]) => {
---
> }, tup(sizeSystem, initialTopMostItemIndexSystem, listStateSystem, propsReadySystem), {
> singleton: true
> });
> const scrollSeekSystem = system(([{
> scrollVelocity
> }]) => {
2470,2476c2698,2702
< connect(
< pipe(
< scrollVelocity,
< withLatestFrom(scrollSeekConfiguration, isSeeking, rangeChanged),
< filter(([_, config]) => !!config),
< map(([speed, config, isSeeking2, range]) => {
< const { exit, enter } = config;
---
> connect(pipe(scrollVelocity, withLatestFrom(scrollSeekConfiguration, isSeeking, rangeChanged), filter(([_, config]) => !!config), map(([speed, config, isSeeking2, range]) => {
> const {
> exit,
> enter
> } = config;
2487,2508c2713,2724
< }),
< distinctUntilChanged()
< ),
< isSeeking
< );
< subscribe(
< pipe(combineLatest(isSeeking, scrollVelocity, rangeChanged), withLatestFrom(scrollSeekConfiguration)),
< ([[isSeeking2, velocity, range], config]) => isSeeking2 && config && config.change && config.change(velocity, range)
< );
< return { isSeeking, scrollSeekConfiguration, scrollVelocity, scrollSeekRangeChanged: rangeChanged };
< },
< tup(stateFlagsSystem),
< { singleton: true }
< );
< const topItemCountSystem = system(([{ topItemsIndexes }]) => {
< const topItemCount = statefulStream(0);
< connect(
< pipe(
< topItemCount,
< filter((length) => length > 0),
< map((length) => Array.from({ length }).map((_, index) => index))
< ),
---
> }), distinctUntilChanged()), isSeeking);
> subscribe(pipe(combineLatest(isSeeking, scrollVelocity, rangeChanged), withLatestFrom(scrollSeekConfiguration)), ([[isSeeking2, velocity, range], config]) => isSeeking2 && config && config.change && config.change(velocity, range));
> return {
> isSeeking,
> scrollSeekConfiguration,
> scrollVelocity,
> scrollSeekRangeChanged: rangeChanged
> };
> }, tup(stateFlagsSystem), {
> singleton: true
> });
> const topItemCountSystem = system(([{
2510,2511c2726,2733
< );
< return { topItemCount };
---
> }]) => {
> const topItemCount = statefulStream(0);
> connect(pipe(topItemCount, filter((length) => length > 0), map((length) => Array.from({
> length
> }).map((_, index) => index))), topItemsIndexes);
> return {
> topItemCount
> };
2513,2514c2735,2742
< const totalListHeightSystem = system(
< ([{ footerHeight, headerHeight, fixedHeaderHeight, fixedFooterHeight }, { listState }]) => {
---
> const totalListHeightSystem = system(([{
> footerHeight,
> headerHeight,
> fixedHeaderHeight,
> fixedFooterHeight
> }, {
> listState
> }]) => {
2516,2519c2744
< const totalListHeight = statefulStreamFromEmitter(
< pipe(
< combineLatest(footerHeight, fixedFooterHeight, headerHeight, fixedHeaderHeight, listState),
< map(([footerHeight2, fixedFooterHeight2, headerHeight2, fixedHeaderHeight2, listState2]) => {
---
> const totalListHeight = statefulStreamFromEmitter(pipe(combineLatest(footerHeight, fixedFooterHeight, headerHeight, fixedHeaderHeight, listState), map(([footerHeight2, fixedFooterHeight2, headerHeight2, fixedHeaderHeight2, listState2]) => {
2521,2524c2746
< })
< ),
< 0
< );
---
> })), 0);
2526,2530c2748,2754
< return { totalListHeight, totalListHeightChanged };
< },
< tup(domIOSystem, listStateSystem),
< { singleton: true }
< );
---
> return {
> totalListHeight,
> totalListHeightChanged
> };
> }, tup(domIOSystem, listStateSystem), {
> singleton: true
> });
2545,2559c2769,2796
< const upwardScrollFixSystem = system(
< ([
< { scrollBy, scrollTop, deviation, scrollingInProgress },
< { isScrolling, isAtBottom, scrollDirection, lastJumpDueToItemResize },
< { listState },
< { beforeUnshiftWith, shiftWithOffset, sizes, gap },
< { log },
< { recalcInProgress }
< ]) => {
< const deviationOffset = streamFromEmitter(
< pipe(
< listState,
< withLatestFrom(lastJumpDueToItemResize),
< scan(
< ([, prevItems, prevTotalCount, prevTotalHeight], [{ items, totalCount, bottom, offsetBottom }, lastJumpDueToItemResize2]) => {
---
> const upwardScrollFixSystem = system(([{
> scrollBy,
> scrollTop,
> deviation,
> scrollingInProgress
> }, {
> isScrolling,
> isAtBottom,
> scrollDirection,
> lastJumpDueToItemResize
> }, {
> listState
> }, {
> beforeUnshiftWith,
> shiftWithOffset,
> sizes,
> gap
> }, {
> log
> }, {
> recalcInProgress
> }]) => {
> const deviationOffset = streamFromEmitter(pipe(listState, withLatestFrom(lastJumpDueToItemResize), scan(([, prevItems, prevTotalCount, prevTotalHeight], [{
> items,
> totalCount,
> bottom,
> offsetBottom
> }, lastJumpDueToItemResize2]) => {
2574,2579c2811
< },
< [0, [], 0, 0]
< ),
< filter(([amount]) => amount !== 0),
< withLatestFrom(scrollTop, scrollDirection, scrollingInProgress, isAtBottom, log, recalcInProgress),
< filter(([, scrollTop2, scrollDirection2, scrollingInProgress2, , , recalcInProgress2]) => {
---
> }, [0, [], 0, 0]), filter(([amount]) => amount !== 0), withLatestFrom(scrollTop, scrollDirection, scrollingInProgress, isAtBottom, log, recalcInProgress), filter(([, scrollTop2, scrollDirection2, scrollingInProgress2, , , recalcInProgress2]) => {
2581,2583c2813,2816
< }),
< map(([[amount], , , , , log2]) => {
< log2("Upward scrolling compensation", { amount }, LogLevel.DEBUG);
---
> }), map(([[amount], , , , , log2]) => {
> log2("Upward scrolling compensation", {
> amount
> }, LogLevel.DEBUG);
2585,2587c2818
< })
< )
< );
---
> })));
2590c2821,2824
< publish(scrollBy, { top: -offset, behavior: "auto" });
---
> publish(scrollBy, {
> top: -offset,
> behavior: "auto"
> });
2594c2828,2831
< publish(scrollBy, { top: -offset, behavior: "auto" });
---
> publish(scrollBy, {
> top: -offset,
> behavior: "auto"
> });
2604,2626c2841,2851
< subscribe(
< pipe(
< combineLatest(statefulStreamFromEmitter(isScrolling, false), deviation, recalcInProgress),
< filter(([is, deviation2, recalc]) => !is && !recalc && deviation2 !== 0),
< map(([_, deviation2]) => deviation2),
< throttleTime(1)
< ),
< scrollByWith
< );
< connect(
< pipe(
< shiftWithOffset,
< map((offset) => {
< return { top: -offset };
< })
< ),
< scrollBy
< );
< subscribe(
< pipe(
< beforeUnshiftWith,
< withLatestFrom(sizes, gap),
< map(([offset, { lastSize: defaultItemSize, groupIndices, sizeTree }, gap2]) => {
---
> subscribe(pipe(combineLatest(statefulStreamFromEmitter(isScrolling, false), deviation, recalcInProgress), filter(([is, deviation2, recalc]) => !is && !recalc && deviation2 !== 0), map(([_, deviation2]) => deviation2), throttleTime(1)), scrollByWith);
> connect(pipe(shiftWithOffset, map((offset) => {
> return {
> top: -offset
> };
> })), scrollBy);
> subscribe(pipe(beforeUnshiftWith, withLatestFrom(sizes, gap), map(([offset, {
> lastSize: defaultItemSize,
> groupIndices,
> sizeTree
> }, gap2]) => {
2651,2653c2876
< })
< ),
< (offset) => {
---
> })), (offset) => {
2656c2879,2881
< publish(scrollBy, { top: offset });
---
> publish(scrollBy, {
> top: offset
> });
2662,2669c2887,2898
< }
< );
< return { deviation };
< },
< tup(domIOSystem, stateFlagsSystem, listStateSystem, sizeSystem, loggerSystem, recalcSystem)
< );
< const initialScrollTopSystem = system(
< ([{ didMount }, { scrollTo }, { listState }]) => {
---
> });
> return {
> deviation
> };
> }, tup(domIOSystem, stateFlagsSystem, listStateSystem, sizeSystem, loggerSystem, recalcSystem));
> const initialScrollTopSystem = system(([{
> didMount
> }, {
> scrollTo
> }, {
> listState
> }]) => {
2671,2685c2900,2903
< subscribe(
< pipe(
< didMount,
< withLatestFrom(initialScrollTop),
< filter(([, offset]) => offset !== 0),
< map(([, offset]) => ({ top: offset }))
< ),
< (location) => {
< handleNext(
< pipe(
< listState,
< skip(1),
< filter((state) => state.items.length > 1)
< ),
< () => {
---
> subscribe(pipe(didMount, withLatestFrom(initialScrollTop), filter(([, offset]) => offset !== 0), map(([, offset]) => ({
> top: offset
> }))), (location) => {
> handleNext(pipe(listState, skip(1), filter((state) => state.items.length > 1)), () => {
2689,2692c2907,2908
< }
< );
< }
< );
---
> });
> });
2696,2701c2912,2919
< },
< tup(propsReadySystem, domIOSystem, listStateSystem),
< { singleton: true }
< );
< const alignToBottomSystem = system(
< ([{ viewportHeight }, { totalListHeight }]) => {
---
> }, tup(propsReadySystem, domIOSystem, listStateSystem), {
> singleton: true
> });
> const alignToBottomSystem = system(([{
> viewportHeight
> }, {
> totalListHeight
> }]) => {
2703,2707c2921
< const paddingTopAddition = statefulStreamFromEmitter(
< pipe(
< combineLatest(alignToBottom, viewportHeight, totalListHeight),
< filter(([enabled]) => enabled),
< map(([, viewportHeight2, totalListHeight2]) => {
---
> const paddingTopAddition = statefulStreamFromEmitter(pipe(combineLatest(alignToBottom, viewportHeight, totalListHeight), filter(([enabled]) => enabled), map(([, viewportHeight2, totalListHeight2]) => {
2709,2720c2923,2934
< }),
< throttleTime(0),
< distinctUntilChanged()
< ),
< 0
< );
< return { alignToBottom, paddingTopAddition };
< },
< tup(domIOSystem, totalListHeightSystem),
< { singleton: true }
< );
< const windowScrollerSystem = system(([{ scrollTo, scrollContainerState }]) => {
---
> }), throttleTime(0), distinctUntilChanged()), 0);
> return {
> alignToBottom,
> paddingTopAddition
> };
> }, tup(domIOSystem, totalListHeightSystem), {
> singleton: true
> });
> const windowScrollerSystem = system(([{
> scrollTo,
> scrollContainerState
> }]) => {
2726,2729c2940,2946
< connect(
< pipe(
< combineLatest(windowScrollContainerState, windowViewportRect),
< map(([{ viewportHeight, scrollTop: windowScrollTop, scrollHeight }, { offsetTop }]) => {
---
> connect(pipe(combineLatest(windowScrollContainerState, windowViewportRect), map(([{
> viewportHeight,
> scrollTop: windowScrollTop,
> scrollHeight
> }, {
> offsetTop
> }]) => {
2735,2743c2952,2955
< })
< ),
< scrollContainerState
< );
< connect(
< pipe(
< scrollTo,
< withLatestFrom(windowViewportRect),
< map(([scrollTo2, { offsetTop }]) => {
---
> })), scrollContainerState);
> connect(pipe(scrollTo, withLatestFrom(windowViewportRect), map(([scrollTo2, {
> offsetTop
> }]) => {
2748,2751c2960
< })
< ),
< windowScrollTo
< );
---
> })), windowScrollTo);
2768c2977,2981
< locationParams: { behavior, align, ...rest }
---
> locationParams: {
> behavior,
> align,
> ...rest
> }
2771c2984,2988
< return { ...rest, behavior, align: align != null ? align : "start" };
---
> return {
> ...rest,
> behavior,
> align: align != null ? align : "start"
> };
2774c2991,2995
< return { ...rest, behavior, align: align != null ? align : "end" };
---
> return {
> ...rest,
> behavior,
> align: align != null ? align : "end"
> };
2778,2783c2999,3012
< const scrollIntoViewSystem = system(
< ([
< { sizes, totalCount, gap },
< { scrollTop, viewportHeight, headerHeight, fixedHeaderHeight, fixedFooterHeight, scrollingInProgress },
< { scrollToIndex }
< ]) => {
---
> const scrollIntoViewSystem = system(([{
> sizes,
> totalCount,
> gap
> }, {
> scrollTop,
> viewportHeight,
> headerHeight,
> fixedHeaderHeight,
> fixedFooterHeight,
> scrollingInProgress
> }, {
> scrollToIndex
> }]) => {
2785,2791c3014,3021
< connect(
< pipe(
< scrollIntoView,
< withLatestFrom(sizes, viewportHeight, totalCount, headerHeight, fixedHeaderHeight, fixedFooterHeight, scrollTop),
< withLatestFrom(gap),
< map(([[viewLocation, sizes2, viewportHeight2, totalCount2, headerHeight2, fixedHeaderHeight2, fixedFooterHeight2, scrollTop2], gap2]) => {
< const { done, behavior, align, calculateViewLocation = defaultCalculateViewLocation, ...rest } = viewLocation;
---
> connect(pipe(scrollIntoView, withLatestFrom(sizes, viewportHeight, totalCount, headerHeight, fixedHeaderHeight, fixedFooterHeight, scrollTop), withLatestFrom(gap), map(([[viewLocation, sizes2, viewportHeight2, totalCount2, headerHeight2, fixedHeaderHeight2, fixedFooterHeight2, scrollTop2], gap2]) => {
> const {
> done,
> behavior,
> align,
> calculateViewLocation = defaultCalculateViewLocation,
> ...rest
> } = viewLocation;
2802c3032,3036
< locationParams: { behavior, align, ...rest }
---
> locationParams: {
> behavior,
> align,
> ...rest
> }
2805,2806c3039
< done && handleNext(
< pipe(
---
> done && handleNext(pipe(
2812,2814c3045
< ),
< done
< );
---
> ), done);
2819,2823c3050
< }),
< filter((value) => value !== null)
< ),
< scrollToIndex
< );
---
> }), filter((value) => value !== null)), scrollToIndex);
2827,2838c3054,3070
< },
< tup(sizeSystem, domIOSystem, scrollToIndexSystem, listStateSystem, loggerSystem),
< { singleton: true }
< );
< const stateLoadSystem = system(
< ([
< { sizes, sizeRanges },
< { scrollTop },
< { initialTopMostItemIndex },
< { didMount },
< { useWindowScroll, windowScrollContainerState, windowViewportRect }
< ]) => {
---
> }, tup(sizeSystem, domIOSystem, scrollToIndexSystem, listStateSystem, loggerSystem), {
> singleton: true
> });
> const stateLoadSystem = system(([{
> sizes,
> sizeRanges
> }, {
> scrollTop
> }, {
> initialTopMostItemIndex
> }, {
> didMount
> }, {
> useWindowScroll,
> windowScrollContainerState,
> windowViewportRect
> }]) => {
2845,2847c3077
< subscribe(
< pipe(getState, withLatestFrom(sizes, scrollTop, useWindowScroll, statefulWindowScrollContainerState, statefulWindowViewportRect)),
< ([callback, sizes2, scrollTop2, useWindowScroll2, windowScrollContainerState2, windowViewportRect2]) => {
---
> subscribe(pipe(getState, withLatestFrom(sizes, scrollTop, useWindowScroll, statefulWindowScrollContainerState, statefulWindowViewportRect)), ([callback, sizes2, scrollTop2, useWindowScroll2, windowScrollContainerState2, windowViewportRect2]) => {
2852,2854c3082,3086
< callback({ ranges, scrollTop: scrollTop2 });
< }
< );
---
> callback({
> ranges,
> scrollTop: scrollTop2
> });
> });
2856,2862c3088
< connect(
< pipe(
< didMount,
< withLatestFrom(restoreStateFrom),
< filter(([, state]) => state !== void 0),
< distinctUntilChanged(),
< map(([, snapshot]) => {
---
> connect(pipe(didMount, withLatestFrom(restoreStateFrom), filter(([, state]) => state !== void 0), distinctUntilChanged(), map(([, snapshot]) => {
2864,2867c3090
< })
< ),
< sizeRanges
< );
---
> })), sizeRanges);
2872,2874c3095
< },
< tup(sizeSystem, domIOSystem, initialTopMostItemIndexSystem, propsReadySystem, windowScrollerSystem)
< );
---
> }, tup(sizeSystem, domIOSystem, initialTopMostItemIndexSystem, propsReadySystem, windowScrollerSystem));
2876c3097,3101
< return { offset: snapshot.scrollTop, index: 0, align: "start" };
---
> return {
> offset: snapshot.scrollTop,
> index: 0,
> align: "start"
> };
2878,2890c3103
< const featureGroup1System = system(
< ([
< sizeRange,
< initialItemCount,
< propsReady,
< scrollSeek,
< totalListHeight,
< initialScrollTopSystem2,
< alignToBottom,
< windowScroller,
< scrollIntoView,
< logger
< ]) => {
---
> const featureGroup1System = system(([sizeRange, initialItemCount, propsReady, scrollSeek, totalListHeight, initialScrollTopSystem2, alignToBottom, windowScroller, scrollIntoView, logger]) => {
2903,2919c3116,3117
< },
< tup(
< sizeRangeSystem,
< initialItemCountSystem,
< propsReadySystem,
< scrollSeekSystem,
< totalListHeightSystem,
< initialScrollTopSystem,
< alignToBottomSystem,
< windowScrollerSystem,
< scrollIntoViewSystem,
< loggerSystem
< )
< );
< const listSystem = system(
< ([
< {
---
> }, tup(sizeRangeSystem, initialItemCountSystem, propsReadySystem, scrollSeekSystem, totalListHeightSystem, initialScrollTopSystem, alignToBottomSystem, windowScrollerSystem, scrollIntoViewSystem, loggerSystem));
> const listSystem = system(([{
2932,2943c3130,3144
< },
< { initialTopMostItemIndex, scrolledToInitialItem, initialItemFinalLocationReached },
< domIO,
< stateLoad,
< followOutput,
< { listState, topItemsIndexes, ...flags },
< { scrollToIndex },
< _,
< { topItemCount },
< { groupCounts },
< featureGroup1
< ]) => {
---
> }, {
> initialTopMostItemIndex,
> scrolledToInitialItem,
> initialItemFinalLocationReached
> }, domIO, stateLoad, followOutput, {
> listState,
> topItemsIndexes,
> ...flags
> }, {
> scrollToIndex
> }, _, {
> topItemCount
> }, {
> groupCounts
> }, featureGroup1]) => {
2945,2951c3146
< connect(
< pipe(
< featureGroup1.windowViewportRect,
< map((value) => value.visibleHeight)
< ),
< domIO.viewportHeight
< );
---
> connect(pipe(featureGroup1.windowViewportRect, map((value) => value.visibleHeight)), domIO.viewportHeight);
2983,2997c3178
< },
< tup(
< sizeSystem,
< initialTopMostItemIndexSystem,
< domIOSystem,
< stateLoadSystem,
< followOutputSystem,
< listStateSystem,
< scrollToIndexSystem,
< upwardScrollFixSystem,
< topItemCountSystem,
< groupedListSystem,
< featureGroup1System
< )
< );
---
> }, tup(sizeSystem, initialTopMostItemIndexSystem, domIOSystem, stateLoadSystem, followOutputSystem, listStateSystem, scrollToIndexSystem, upwardScrollFixSystem, topItemCountSystem, groupedListSystem, featureGroup1System));
3010,3011c3191
< const calculateInfo = React.useCallback(
< (element) => {
---
> const calculateInfo = React.useCallback((element) => {
3033,3036c3213,3217
< },
< [callback, customScrollParent]
< );
< const { callbackRef, ref } = useSizeWithElRef(calculateInfo);
---
> }, [callback, customScrollParent]);
> const {
> callbackRef,
> ref
> } = useSizeWithElRef(calculateInfo);
3076,3083c3257
< return statefulStreamFromEmitter(
< pipe(
< components,
< map((components2) => components2[propName]),
< distinctUntilChanged()
< ),
< defaultValue
< );
---
> return statefulStreamFromEmitter(pipe(components, map((components2) => components2[propName]), distinctUntilChanged()), defaultValue);
3104,3113c3278,3311
< const combinedSystem$2 = /* @__PURE__ */ system(
< ([listSystem2, propsSystem]) => {
< return { ...listSystem2, ...propsSystem };
< },
< tup(listSystem, listComponentPropsSystem)
< );
< const DefaultScrollSeekPlaceholder$1 = ({ height }) => /* @__PURE__ */ jsx("div", { style: { height } });
< const GROUP_STYLE = { position: positionStickyCssValue(), zIndex: 1, overflowAnchor: "none" };
< const ITEM_STYLE$1 = { overflowAnchor: "none" };
< const Items$1 = /* @__PURE__ */ React.memo(function VirtuosoItems({ showTopList = false }) {
---
> const combinedSystem$2 = /* @__PURE__ */ system(([listSystem2, propsSystem]) => {
> return {
> ...listSystem2,
> ...propsSystem
> };
> }, tup(listSystem, listComponentPropsSystem));
> const DefaultScrollSeekPlaceholder$1 = (t0) => {
> const $ = compilerRuntimeExports.c(2);
> const {
> height
> } = t0;
> let t1;
> if ($[0] !== height) {
> t1 = /* @__PURE__ */ jsx("div", { style: {
> height
> } });
> $[0] = height;
> $[1] = t1;
> } else {
> t1 = $[1];
> }
> return t1;
> };
> const GROUP_STYLE = {
> position: positionStickyCssValue(),
> zIndex: 1,
> overflowAnchor: "none"
> };
> const ITEM_STYLE$1 = {
> overflowAnchor: "none"
> };
> const Items$1 = /* @__PURE__ */ React.memo(function VirtuosoItems({
> showTopList = false
> }) {
3128,3136c3326,3328
< const { callbackRef } = useChangedListContentsSizes(
< sizeRanges,
< itemSize,
< trackItemSizes,
< showTopList ? noop : scrollContainerStateCallback,
< log,
< listGap,
< customScrollParent
< );
---
> const {
> callbackRef
> } = useChangedListContentsSizes(sizeRanges, itemSize, trackItemSizes, showTopList ? noop : scrollContainerStateCallback, log, listGap, customScrollParent);
3158c3350,3352
< ...initialItemFinalLocationReached ? {} : { visibility: "hidden" }
---
> ...initialItemFinalLocationReached ? {} : {
> visibility: "hidden"
> }
3163,3170c3357
< return /* @__PURE__ */ jsx(
< ListComponent,
< {
< ...contextPropIfNotDomElement(ListComponent, context),
< ref: callbackRef,
< style: containerStyle,
< "data-testid": showTopList ? "virtuoso-top-item-list" : "virtuoso-item-list",
< children: (showTopList ? listState.topItems : listState.items).map((item) => {
---
> return /* @__PURE__ */ jsx(ListComponent, { ...contextPropIfNotDomElement(ListComponent, context), ref: callbackRef, style: containerStyle, "data-testid": showTopList ? "virtuoso-top-item-list" : "virtuoso-item-list", children: (showTopList ? listState.topItems : listState.items).map((item) => {
3174,3184c3361,3363
< return /* @__PURE__ */ createElement(
< ScrollSeekPlaceholder,
< {
< ...contextPropIfNotDomElement(ScrollSeekPlaceholder, context),
< key,
< index: item.index,
< height: item.size,
< type: item.type || "item",
< ...item.type === "group" ? {} : { groupIndex: item.groupIndex }
< }
< );
---
> return /* @__PURE__ */ createElement(ScrollSeekPlaceholder, { ...contextPropIfNotDomElement(ScrollSeekPlaceholder, context), key, index: item.index, height: item.size, type: item.type || "item", ...item.type === "group" ? {} : {
> groupIndex: item.groupIndex
> } });
3187,3198c3366
< return /* @__PURE__ */ createElement(
< GroupComponent,
< {
< ...contextPropIfNotDomElement(GroupComponent, context),
< key,
< "data-index": index,
< "data-known-size": item.size,
< "data-item-index": item.index,
< style: GROUP_STYLE
< },
< groupContent(item.index, context)
< );
---
> return /* @__PURE__ */ createElement(GroupComponent, { ...contextPropIfNotDomElement(GroupComponent, context), key, "data-index": index, "data-known-size": item.size, "data-item-index": item.index, style: GROUP_STYLE }, groupContent(item.index, context));
3200,3213c3368
< return /* @__PURE__ */ createElement(
< ItemComponent,
< {
< ...contextPropIfNotDomElement(ItemComponent, context),
< ...itemPropIfNotDomElement(ItemComponent, item.data),
< key,
< "data-index": index,
< "data-known-size": item.size,
< "data-item-index": item.index,
< "data-item-group-index": item.groupIndex,
< style: ITEM_STYLE$1
< },
< hasGroups2 ? itemContent(item.index, item.groupIndex, item.data, context) : itemContent(item.index, item.data, context)
< );
---
> return /* @__PURE__ */ createElement(ItemComponent, { ...contextPropIfNotDomElement(ItemComponent, context), ...itemPropIfNotDomElement(ItemComponent, item.data), key, "data-index": index, "data-known-size": item.size, "data-item-index": item.index, "data-item-group-index": item.groupIndex, style: ITEM_STYLE$1 }, hasGroups2 ? itemContent(item.index, item.groupIndex, item.data, context) : itemContent(item.index, item.data, context));
3215,3217c3370
< })
< }
< );
---
> }) });
3231c3384,3387
< ...alignToBottom ? { display: "flex", flexDirection: "column" } : {}
---
> ...alignToBottom ? {
> display: "flex",
> flexDirection: "column"
> } : {}
3243c3399,3401
< return { context };
---
> return {
> context
> };
3246c3404,3406
< return { item: typeof element === "string" ? void 0 : item };
---
> return {
> item: typeof element === "string" ? void 0 : item
> };
3248a3409
> const $ = compilerRuntimeExports.c(7);
3252c3413,3421
< const ref = useSize((el) => headerHeight(correctItemSize(el, "height")));
---
> let t0;
> if ($[0] !== headerHeight) {
> t0 = (el) => headerHeight(correctItemSize(el, "height"));
> $[0] = headerHeight;
> $[1] = t0;
> } else {
> t0 = $[1];
> }
> const ref = useSize(t0);
3254c3423,3434
< return Header2 ? /* @__PURE__ */ jsx(HeaderWrapper, { ref, children: /* @__PURE__ */ jsx(Header2, { ...contextPropIfNotDomElement(Header2, context) }) }) : null;
---
> let t1;
> if ($[2] !== Header2 || $[3] !== context || $[4] !== HeaderWrapper || $[5] !== ref) {
> t1 = Header2 ? /* @__PURE__ */ jsx(HeaderWrapper, { ref, children: /* @__PURE__ */ jsx(Header2, { ...contextPropIfNotDomElement(Header2, context) }) }) : null;
> $[2] = Header2;
> $[3] = context;
> $[4] = HeaderWrapper;
> $[5] = ref;
> $[6] = t1;
> } else {
> t1 = $[6];
> }
> return t1;
3256a3437
> const $ = compilerRuntimeExports.c(7);
3260c3441,3449
< const ref = useSize((el) => footerHeight(correctItemSize(el, "height")));
---
> let t0;
> if ($[0] !== footerHeight) {
> t0 = (el) => footerHeight(correctItemSize(el, "height"));
> $[0] = footerHeight;
> $[1] = t0;
> } else {
> t0 = $[1];
> }
> const ref = useSize(t0);
3262c3451,3462
< return Footer2 ? /* @__PURE__ */ jsx(FooterWrapper, { ref, children: /* @__PURE__ */ jsx(Footer2, { ...contextPropIfNotDomElement(Footer2, context) }) }) : null;
---
> let t1;
> if ($[2] !== Footer2 || $[3] !== context || $[4] !== FooterWrapper || $[5] !== ref) {
> t1 = Footer2 ? /* @__PURE__ */ jsx(FooterWrapper, { ref, children: /* @__PURE__ */ jsx(Footer2, { ...contextPropIfNotDomElement(Footer2, context) }) }) : null;
> $[2] = Footer2;
> $[3] = context;
> $[4] = FooterWrapper;
> $[5] = ref;
> $[6] = t1;
> } else {
> t1 = $[6];
> }
> return t1;
3264,3265c3464,3473
< function buildScroller({ usePublisher: usePublisher2, useEmitter: useEmitter2, useEmitterValue: useEmitterValue2 }) {
< const Scroller2 = React.memo(function VirtuosoScroller({ style, children, ...props }) {
---
> function buildScroller({
> usePublisher: usePublisher2,
> useEmitter: useEmitter2,
> useEmitterValue: useEmitterValue2
> }) {
> const Scroller2 = React.memo(function VirtuosoScroller({
> style,
> children,
> ...props
> }) {
3271,3276c3479,3483
< const { scrollerRef, scrollByCallback, scrollToCallback } = useScrollTop(
< scrollContainerStateCallback,
< smoothScrollTargetReached,
< ScrollerComponent,
< scrollerRefCallback
< );
---
> const {
> scrollerRef,
> scrollByCallback,
> scrollToCallback
> } = useScrollTop(scrollContainerStateCallback, smoothScrollTargetReached, ScrollerComponent, scrollerRefCallback);
3279,3291c3486,3489
< return /* @__PURE__ */ jsx(
< ScrollerComponent,
< {
< ref: scrollerRef,
< style: { ...scrollerStyle, ...style },
< "data-testid": "virtuoso-scroller",
< "data-virtuoso-scroller": true,
< tabIndex: 0,
< ...props,
< ...contextPropIfNotDomElement(ScrollerComponent, context),
< children
< }
< );
---
> return /* @__PURE__ */ jsx(ScrollerComponent, { ref: scrollerRef, style: {
> ...scrollerStyle,
> ...style
> }, "data-testid": "virtuoso-scroller", "data-virtuoso-scroller": true, tabIndex: 0, ...props, ...contextPropIfNotDomElement(ScrollerComponent, context), children });
3295,3296c3493,3502
< function buildWindowScroller({ usePublisher: usePublisher2, useEmitter: useEmitter2, useEmitterValue: useEmitterValue2 }) {
< const Scroller2 = React.memo(function VirtuosoWindowScroller({ style, children, ...props }) {
---
> function buildWindowScroller({
> usePublisher: usePublisher2,
> useEmitter: useEmitter2,
> useEmitterValue: useEmitterValue2
> }) {
> const Scroller2 = React.memo(function VirtuosoWindowScroller({
> style,
> children,
> ...props
> }) {
3304,3310c3510,3514
< const { scrollerRef, scrollByCallback, scrollToCallback } = useScrollTop(
< scrollContainerStateCallback,
< smoothScrollTargetReached,
< ScrollerComponent,
< noop,
< customScrollParent
< );
---
> const {
> scrollerRef,
> scrollByCallback,
> scrollToCallback
> } = useScrollTop(scrollContainerStateCallback, smoothScrollTargetReached, ScrollerComponent, noop, customScrollParent);
3319,3328c3523,3529
< return /* @__PURE__ */ jsx(
< ScrollerComponent,
< {
< style: { position: "relative", ...style, ...totalListHeight !== 0 ? { height: totalListHeight + deviation } : {} },
< "data-virtuoso-scroller": true,
< ...props,
< ...contextPropIfNotDomElement(ScrollerComponent, context),
< children
< }
< );
---
> return /* @__PURE__ */ jsx(ScrollerComponent, { style: {
> position: "relative",
> ...style,
> ...totalListHeight !== 0 ? {
> height: totalListHeight + deviation
> } : {}
> }, "data-virtuoso-scroller": true, ...props, ...contextPropIfNotDomElement(ScrollerComponent, context), children });
3332c3533,3537
< const Viewport$2 = ({ children }) => {
---
> const Viewport$2 = (t0) => {
> const $ = compilerRuntimeExports.c(14);
> const {
> children
> } = t0;
3337,3338c3542,3561
< const viewportRef = useSize(compose(viewportHeight, (el) => correctItemSize(el, "height")));
< React.useEffect(() => {
---
> let t1;
> if ($[0] !== viewportHeight) {
> let t22;
> if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
> t22 = (el) => correctItemSize(el, "height");
> $[2] = t22;
> } else {
> t22 = $[2];
> }
> t1 = compose(viewportHeight, t22);
> $[0] = viewportHeight;
> $[1] = t1;
> } else {
> t1 = $[1];
> }
> const viewportRef = useSize(t1);
> let t2;
> let t3;
> if ($[3] !== ctx || $[4] !== viewportHeight || $[5] !== fixedItemHeight) {
> t2 = () => {
3343,3344c3566,3596
< }, [ctx, viewportHeight, fixedItemHeight]);
< return /* @__PURE__ */ jsx("div", { style: viewportStyle(alignToBottom), ref: viewportRef, "data-viewport-type": "element", children });
---
> };
> t3 = [ctx, viewportHeight, fixedItemHeight];
> $[3] = ctx;
> $[4] = viewportHeight;
> $[5] = fixedItemHeight;
> $[6] = t2;
> $[7] = t3;
> } else {
> t2 = $[6];
> t3 = $[7];
> }
> React.useEffect(t2, t3);
> let t4;
> if ($[8] !== alignToBottom) {
> t4 = viewportStyle(alignToBottom);
> $[8] = alignToBottom;
> $[9] = t4;
> } else {
> t4 = $[9];
> }
> let t5;
> if ($[10] !== t4 || $[11] !== viewportRef || $[12] !== children) {
> t5 = /* @__PURE__ */ jsx("div", { style: t4, ref: viewportRef, "data-viewport-type": "element", children });
> $[10] = t4;
> $[11] = viewportRef;
> $[12] = children;
> $[13] = t5;
> } else {
> t5 = $[13];
> }
> return t5;
3346c3598,3602
< const WindowViewport$2 = ({ children }) => {
---
> const WindowViewport$2 = (t0) => {
> const $ = compilerRuntimeExports.c(11);
> const {
> children
> } = t0;
3353c3609,3612
< React.useEffect(() => {
---
> let t1;
> let t2;
> if ($[0] !== ctx || $[1] !== fixedItemHeight || $[2] !== windowViewportRect) {
> t1 = () => {
3356c3615,3630
< windowViewportRect({ offsetTop: 0, visibleHeight: ctx.viewportHeight, visibleWidth: 100 });
---
> windowViewportRect({
> offsetTop: 0,
> visibleHeight: ctx.viewportHeight,
> visibleWidth: 100
> });
> }
> };
> t2 = [ctx, windowViewportRect, fixedItemHeight];
> $[0] = ctx;
> $[1] = fixedItemHeight;
> $[2] = windowViewportRect;
> $[3] = t1;
> $[4] = t2;
> } else {
> t1 = $[3];
> t2 = $[4];
3358,3359c3632,3651
< }, [ctx, windowViewportRect, fixedItemHeight]);
< return /* @__PURE__ */ jsx("div", { ref: viewportRef, style: viewportStyle(alignToBottom), "data-viewport-type": "window", children });
---
> React.useEffect(t1, t2);
> let t3;
> if ($[5] !== alignToBottom) {
> t3 = viewportStyle(alignToBottom);
> $[5] = alignToBottom;
> $[6] = t3;
> } else {
> t3 = $[6];
> }
> let t4;
> if ($[7] !== viewportRef || $[8] !== t3 || $[9] !== children) {
> t4 = /* @__PURE__ */ jsx("div", { ref: viewportRef, style: t3, "data-viewport-type": "window", children });
> $[7] = viewportRef;
> $[8] = t3;
> $[9] = children;
> $[10] = t4;
> } else {
> t4 = $[10];
> }
> return t4;
3361c3653,3657
< const TopItemListContainer = ({ children }) => {
---
> const TopItemListContainer = (t0) => {
> const $ = compilerRuntimeExports.c(10);
> const {
> children
> } = t0;
3364c3660,3672
< const style = { ...topItemListStyle, marginTop: `${headerHeight}px` };
---
> const t1 = `${headerHeight}px`;
> let t2;
> if ($[0] !== t1) {
> t2 = {
> ...topItemListStyle,
> marginTop: t1
> };
> $[0] = t1;
> $[1] = t2;
> } else {
> t2 = $[1];
> }
> const style = t2;
3366c3674,3694
< return /* @__PURE__ */ jsx(TopItemList, { style, ...contextPropIfNotDomElement(TopItemList, context), children });
---
> let t3;
> if ($[2] !== TopItemList || $[3] !== context) {
> t3 = contextPropIfNotDomElement(TopItemList, context);
> $[2] = TopItemList;
> $[3] = context;
> $[4] = t3;
> } else {
> t3 = $[4];
> }
> let t4;
> if ($[5] !== TopItemList || $[6] !== style || $[7] !== t3 || $[8] !== children) {
> t4 = /* @__PURE__ */ jsx(TopItemList, { style, ...t3, children });
> $[5] = TopItemList;
> $[6] = style;
> $[7] = t3;
> $[8] = children;
> $[9] = t4;
> } else {
> t4 = $[9];
> }
> return t4;
3368a3697
> const $ = compilerRuntimeExports.c(12);
3374,3380c3703,3748
< return /* @__PURE__ */ jsxs(TheScroller, { ...props, children: [
< showTopList && /* @__PURE__ */ jsx(TopItemListContainer, { children: /* @__PURE__ */ jsx(Items$1, { showTopList: true }) }),
< /* @__PURE__ */ jsxs(TheViewport, { children: [
< /* @__PURE__ */ jsx(Header$1, {}),
< /* @__PURE__ */ jsx(Items$1, {}),
< /* @__PURE__ */ jsx(Footer$1, {})
< ] })
---
> let t0;
> if ($[0] !== showTopList) {
> t0 = showTopList && /* @__PURE__ */ jsx(TopItemListContainer, { children: /* @__PURE__ */ jsx(Items$1, { showTopList: true }) });
> $[0] = showTopList;
> $[1] = t0;
> } else {
> t0 = $[1];
> }
> let t1;
> if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
> t1 = /* @__PURE__ */ jsx(Header$1, {});
> $[2] = t1;
> } else {
> t1 = $[2];
> }
> let t2;
> if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
> t2 = /* @__PURE__ */ jsx(Items$1, {});
> $[3] = t2;
> } else {
> t2 = $[3];
> }
> let t3;
> if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
> t3 = /* @__PURE__ */ jsx(Footer$1, {});
> $[4] = t3;
> } else {
> t3 = $[4];
> }
> let t4;
> if ($[5] !== TheViewport) {
> t4 = /* @__PURE__ */ jsxs(TheViewport, { children: [
> t1,
> t2,
> t3
> ] });
> $[5] = TheViewport;
> $[6] = t4;
> } else {
> t4 = $[6];
> }
> let t5;
> if ($[7] !== TheScroller || $[8] !== props || $[9] !== t0 || $[10] !== t4) {
> t5 = /* @__PURE__ */ jsxs(TheScroller, { ...props, children: [
> t0,
> t4
3381a3750,3758
> $[7] = TheScroller;
> $[8] = props;
> $[9] = t0;
> $[10] = t4;
> $[11] = t5;
> } else {
> t5 = $[11];
> }
> return t5;
3388,3390c3765
< } = /* @__PURE__ */ systemToComponent(
< combinedSystem$2,
< {
---
> } = /* @__PURE__ */ systemToComponent(combinedSystem$2, {
3442,3446c3817,3827
< },
< ListRoot
< );
< const Scroller$2 = /* @__PURE__ */ buildScroller({ usePublisher: usePublisher$2, useEmitterValue: useEmitterValue$2, useEmitter: useEmitter$2 });
< const WindowScroller$2 = /* @__PURE__ */ buildWindowScroller({ usePublisher: usePublisher$2, useEmitterValue: useEmitterValue$2, useEmitter: useEmitter$2 });
---
> }, ListRoot);
> const Scroller$2 = /* @__PURE__ */ buildScroller({
> usePublisher: usePublisher$2,
> useEmitterValue: useEmitterValue$2,
> useEmitter: useEmitter$2
> });
> const WindowScroller$2 = /* @__PURE__ */ buildWindowScroller({
> usePublisher: usePublisher$2,
> useEmitterValue: useEmitterValue$2,
> useEmitter: useEmitter$2
> });
3459c3840,3842
< items: [{ index: 0 }],
---
> items: [{
> index: 0
> }],
3467c3850,3856
< const { round, ceil, floor, min, max } = Math;
---
> const {
> round,
> ceil,
> floor,
> min,
> max
> } = Math;
3475c3864,3866
< return Array.from({ length: endIndex - startIndex + 1 }).map((_, i) => {
---
> return Array.from({
> length: endIndex - startIndex + 1
> }).map((_, i) => {
3477c3868,3871
< return { index: i + startIndex, data: dataItem };
---
> return {
> index: i + startIndex,
> data: dataItem
> };
3486,3495c3880,3902
< const gridSystem = /* @__PURE__ */ system(
< ([
< { overscan, visibleRange, listBoundary },
< { scrollTop, viewportHeight, scrollBy, scrollTo, smoothScrollTargetReached, scrollContainerState, footerHeight, headerHeight },
< stateFlags,
< scrollSeek,
< { propsReady, didMount },
< { windowViewportRect, useWindowScroll, customScrollParent, windowScrollContainerState, windowScrollTo },
< log
< ]) => {
---
> const gridSystem = /* @__PURE__ */ system(([{
> overscan,
> visibleRange,
> listBoundary
> }, {
> scrollTop,
> viewportHeight,
> scrollBy,
> scrollTo,
> smoothScrollTargetReached,
> scrollContainerState,
> footerHeight,
> headerHeight
> }, stateFlags, scrollSeek, {
> propsReady,
> didMount
> }, {
> windowViewportRect,
> useWindowScroll,
> customScrollParent,
> windowScrollContainerState,
> windowScrollTo
> }, log]) => {
3499,3500c3906,3913
< const viewportDimensions = statefulStream({ height: 0, width: 0 });
< const itemDimensions = statefulStream({ height: 0, width: 0 });
---
> const viewportDimensions = statefulStream({
> height: 0,
> width: 0
> });
> const itemDimensions = statefulStream({
> height: 0,
> width: 0
> });
3505c3918,3921
< const gap = statefulStream({ row: 0, column: 0 });
---
> const gap = statefulStream({
> row: 0,
> column: 0
> });
3512,3518c3928
< subscribe(
< pipe(
< didMount,
< withLatestFrom(initialTopMostItemIndex),
< filter(([_, location]) => !!location)
< ),
< () => {
---
> subscribe(pipe(didMount, withLatestFrom(initialTopMostItemIndex), filter(([_, location]) => !!location)), () => {
3521,3526c3931,3932
< }
< );
< subscribe(
< pipe(
< combineLatest(didMount, scrolledToInitialItem, itemDimensions, viewportDimensions, initialTopMostItemIndex, scrollScheduled),
< filter(([didMount2, scrolledToInitialItem2, itemDimensions2, viewportDimensions2, , scrollScheduled2]) => {
---
> });
> subscribe(pipe(combineLatest(didMount, scrolledToInitialItem, itemDimensions, viewportDimensions, initialTopMostItemIndex, scrollScheduled), filter(([didMount2, scrolledToInitialItem2, itemDimensions2, viewportDimensions2, , scrollScheduled2]) => {
3528,3530c3934
< })
< ),
< ([, , , , initialTopMostItemIndex2]) => {
---
> })), ([, , , , initialTopMostItemIndex2]) => {
3539,3555c3943,3945
< }
< );
< connect(
< pipe(
< restoreStateFrom,
< filter((value) => value !== void 0 && value !== null && value.scrollTop > 0),
< mapTo(0)
< ),
< initialItemCount
< );
< subscribe(
< pipe(
< didMount,
< withLatestFrom(restoreStateFrom),
< filter(([, snapshot]) => snapshot !== void 0 && snapshot !== null)
< ),
< ([, snapshot]) => {
---
> });
> connect(pipe(restoreStateFrom, filter((value) => value !== void 0 && value !== null && value.scrollTop > 0), mapTo(0)), initialItemCount);
> subscribe(pipe(didMount, withLatestFrom(restoreStateFrom), filter(([, snapshot]) => snapshot !== void 0 && snapshot !== null)), ([, snapshot]) => {
3566,3567c3956,3958
< publish(scrollTo, { top: snapshot.scrollTop });
< }
---
> publish(scrollTo, {
> top: snapshot.scrollTop
> });
3569,3585c3960,3964
< );
< connect(
< pipe(
< viewportDimensions,
< map(({ height }) => height)
< ),
< viewportHeight
< );
< connect(
< pipe(
< combineLatest(
< duc(viewportDimensions, dimensionComparator),
< duc(itemDimensions, dimensionComparator),
< duc(gap, (prev, next) => prev && prev.column === next.column && prev.row === next.row),
< duc(scrollTop)
< ),
< map(([viewport, item, gap2, scrollTop2]) => ({
---
> });
> connect(pipe(viewportDimensions, map(({
> height
> }) => height)), viewportHeight);
> connect(pipe(combineLatest(duc(viewportDimensions, dimensionComparator), duc(itemDimensions, dimensionComparator), duc(gap, (prev, next) => prev && prev.column === next.column && prev.row === next.row), duc(scrollTop)), map(([viewport, item, gap2, scrollTop2]) => ({
3590,3608c3969,3970
< }))
< ),
< stateChanged
< );
< connect(
< pipe(
< combineLatest(
< duc(totalCount),
< visibleRange,
< duc(gap, gapComparator),
< duc(itemDimensions, dimensionComparator),
< duc(viewportDimensions, dimensionComparator),
< duc(data),
< duc(initialItemCount),
< duc(stateRestoreInProgress),
< duc(scrolledToInitialItem),
< duc(initialTopMostItemIndex)
< ),
< filter(([, , , , , , , stateRestoreInProgress2]) => {
---
> }))), stateChanged);
> connect(pipe(combineLatest(duc(totalCount), visibleRange, duc(gap, gapComparator), duc(itemDimensions, dimensionComparator), duc(viewportDimensions, dimensionComparator), duc(data), duc(initialItemCount), duc(stateRestoreInProgress), duc(scrolledToInitialItem), duc(initialTopMostItemIndex)), filter(([, , , , , , , stateRestoreInProgress2]) => {
3610,3626c3972,3983
< }),
< map(
< ([
< totalCount2,
< [startOffset, endOffset],
< gap2,
< item,
< viewport,
< data2,
< initialItemCount2,
< ,
< scrolledToInitialItem2,
< initialTopMostItemIndex2
< ]) => {
< const { row: rowGap, column: columnGap } = gap2;
< const { height: itemHeight, width: itemWidth } = item;
< const { width: viewportWidth } = viewport;
---
> }), map(([totalCount2, [startOffset, endOffset], gap2, item, viewport, data2, initialItemCount2, , scrolledToInitialItem2, initialTopMostItemIndex2]) => {
> const {
> row: rowGap,
> column: columnGap
> } = gap2;
> const {
> height: itemHeight,
> width: itemWidth
> } = item;
> const {
> width: viewportWidth
> } = viewport;
3651c4008,4011
< const { top, bottom } = gridLayout(viewport, gap2, item, items);
---
> const {
> top,
> bottom
> } = gridLayout(viewport, gap2, item, items);
3655,3672c4015,4028
< return { items, offsetTop: top, offsetBottom, top, bottom, itemHeight, itemWidth };
< }
< )
< ),
< gridState
< );
< connect(
< pipe(
< data,
< filter((data2) => data2 !== null),
< map((data2) => data2.length)
< ),
< totalCount
< );
< connect(
< pipe(
< combineLatest(viewportDimensions, itemDimensions, gridState, gap),
< filter(([viewportDimensions2, itemDimensions2, { items }]) => {
---
> return {
> items,
> offsetTop: top,
> offsetBottom,
> top,
> bottom,
> itemHeight,
> itemWidth
> };
> })), gridState);
> connect(pipe(data, filter((data2) => data2 !== null), map((data2) => data2.length)), totalCount);
> connect(pipe(combineLatest(viewportDimensions, itemDimensions, gridState, gap), filter(([viewportDimensions2, itemDimensions2, {
> items
> }]) => {
3674,3676c4030,4036
< }),
< map(([viewportDimensions2, itemDimensions2, { items }, gap2]) => {
< const { top, bottom } = gridLayout(viewportDimensions2, gap2, itemDimensions2, items);
---
> }), map(([viewportDimensions2, itemDimensions2, {
> items
> }, gap2]) => {
> const {
> top,
> bottom
> } = gridLayout(viewportDimensions2, gap2, itemDimensions2, items);
3678,3682c4038
< }),
< distinctUntilChanged(tupleComparator)
< ),
< listBoundary
< );
---
> }), distinctUntilChanged(tupleComparator)), listBoundary);
3684,3688c4040
< connect(
< pipe(
< scrollTop,
< withLatestFrom(hasScrolled),
< map(([scrollTop2, hasScrolled2]) => {
---
> connect(pipe(scrollTop, withLatestFrom(hasScrolled), map(([scrollTop2, hasScrolled2]) => {
3690,3705c4042,4048
< })
< ),
< hasScrolled
< );
< const endReached = streamFromEmitter(
< pipe(
< duc(gridState),
< filter(({ items }) => items.length > 0),
< withLatestFrom(totalCount, hasScrolled),
< filter(([{ items }, totalCount2, hasScrolled2]) => hasScrolled2 && items[items.length - 1].index === totalCount2 - 1),
< map(([, totalCount2]) => totalCount2 - 1),
< distinctUntilChanged()
< )
< );
< const startReached = streamFromEmitter(
< pipe(
---
> })), hasScrolled);
> const endReached = streamFromEmitter(pipe(duc(gridState), filter(({
> items
> }) => items.length > 0), withLatestFrom(totalCount, hasScrolled), filter(([{
> items
> }, totalCount2, hasScrolled2]) => hasScrolled2 && items[items.length - 1].index === totalCount2 - 1), map(([, totalCount2]) => totalCount2 - 1), distinctUntilChanged()));
> const startReached = streamFromEmitter(pipe(
3707c4050,4052
< filter(({ items }) => {
---
> filter(({
> items
> }) => {
3713,3720c4058,4063
< )
< );
< const rangeChanged = streamFromEmitter(
< pipe(
< duc(gridState),
< withLatestFrom(stateRestoreInProgress),
< filter(([{ items }, stateRestoreInProgress2]) => items.length > 0 && !stateRestoreInProgress2),
< map(([{ items }]) => {
---
> ));
> const rangeChanged = streamFromEmitter(pipe(duc(gridState), withLatestFrom(stateRestoreInProgress), filter(([{
> items
> }, stateRestoreInProgress2]) => items.length > 0 && !stateRestoreInProgress2), map(([{
> items
> }]) => {
3725,3729c4068
< }),
< distinctUntilChanged(rangeComparator),
< throttleTime(0)
< )
< );
---
> }), distinctUntilChanged(rangeComparator), throttleTime(0)));
3731,3735c4070
< connect(
< pipe(
< scrollToIndex,
< withLatestFrom(viewportDimensions, itemDimensions, totalCount, gap),
< map(([location, viewportDimensions2, itemDimensions2, totalCount2, gap2]) => {
---
> connect(pipe(scrollToIndex, withLatestFrom(viewportDimensions, itemDimensions, totalCount, gap), map(([location, viewportDimensions2, itemDimensions2, totalCount2, gap2]) => {
3737c4072,4076
< const { align, behavior, offset } = normalLocation;
---
> const {
> align,
> behavior,
> offset
> } = normalLocation;
3752,3760c4091,4096
< return { top, behavior };
< })
< ),
< scrollTo
< );
< const totalListHeight = statefulStreamFromEmitter(
< pipe(
< gridState,
< map((gridState2) => {
---
> return {
> top,
> behavior
> };
> })), scrollTo);
> const totalListHeight = statefulStreamFromEmitter(pipe(gridState, map((gridState2) => {
3762,3772c4098,4102
< })
< ),
< 0
< );
< connect(
< pipe(
< windowViewportRect,
< map((viewportInfo) => ({ width: viewportInfo.visibleWidth, height: viewportInfo.visibleHeight }))
< ),
< viewportDimensions
< );
---
> })), 0);
> connect(pipe(windowViewportRect, map((viewportInfo) => ({
> width: viewportInfo.visibleWidth,
> height: viewportInfo.visibleHeight
> }))), viewportDimensions);
3812,3814c4142
< },
< tup(sizeRangeSystem, domIOSystem, stateFlagsSystem, scrollSeekSystem, propsReadySystem, windowScrollerSystem, loggerSystem)
< );
---
> }, tup(sizeRangeSystem, domIOSystem, stateFlagsSystem, scrollSeekSystem, propsReadySystem, windowScrollerSystem, loggerSystem));
3816c4144,4146
< const { height: itemHeight } = item;
---
> const {
> height: itemHeight
> } = item;
3818c4148,4151
< return { top: 0, bottom: 0 };
---
> return {
> top: 0,
> bottom: 0
> };
3822c4155,4158
< return { top, bottom };
---
> return {
> top,
> bottom
> };
3843,3850c4179
< return statefulStreamFromEmitter(
< pipe(
< components,
< map((components2) => components2[propName]),
< distinctUntilChanged()
< ),
< defaultValue
< );
---
> return statefulStreamFromEmitter(pipe(components, map((components2) => components2[propName]), distinctUntilChanged()), defaultValue);
3869,3874c4198,4203
< const combinedSystem$1 = /* @__PURE__ */ system(
< ([gridSystem2, gridComponentPropsSystem2]) => {
< return { ...gridSystem2, ...gridComponentPropsSystem2 };
< },
< tup(gridSystem, gridComponentPropsSystem)
< );
---
> const combinedSystem$1 = /* @__PURE__ */ system(([gridSystem2, gridComponentPropsSystem2]) => {
> return {
> ...gridSystem2,
> ...gridComponentPropsSystem2
> };
> }, tup(gridSystem, gridComponentPropsSystem));
3896,3897c4225,4232
< const { width, height } = firstItem.getBoundingClientRect();
< itemDimensions({ width, height });
---
> const {
> width,
> height
> } = firstItem.getBoundingClientRect();
> itemDimensions({
> width,
> height
> });
3907,3914c4242,4245
< return /* @__PURE__ */ jsx(
< ListComponent,
< {
< ref: listRef,
< className: listClassName,
< style: { paddingTop: gridState.offsetTop, paddingBottom: gridState.offsetBottom },
< "data-testid": "virtuoso-item-list",
< children: gridState.items.map((item) => {
---
> return /* @__PURE__ */ jsx(ListComponent, { ref: listRef, className: listClassName, style: {
> paddingTop: gridState.offsetTop,
> paddingBottom: gridState.offsetBottom
> }, "data-testid": "virtuoso-item-list", children: gridState.items.map((item) => {
3917,3926c4248
< return /* @__PURE__ */ jsx(
< ScrollSeekPlaceholder,
< {
< ...contextPropIfNotDomElement(ScrollSeekPlaceholder, context),
< index: item.index,
< height: gridState.itemHeight,
< width: gridState.itemWidth
< },
< key
< );
---
> return /* @__PURE__ */ jsx(ScrollSeekPlaceholder, { ...contextPropIfNotDomElement(ScrollSeekPlaceholder, context), index: item.index, height: gridState.itemHeight, width: gridState.itemWidth }, key);
3928,3937c4250
< return /* @__PURE__ */ createElement(
< ItemComponent,
< {
< ...contextPropIfNotDomElement(ItemComponent, context),
< className: itemClassName,
< "data-index": item.index,
< key
< },
< itemContent(item.index, item.data, context)
< );
---
> return /* @__PURE__ */ createElement(ItemComponent, { ...contextPropIfNotDomElement(ItemComponent, context), className: itemClassName, "data-index": item.index, key }, itemContent(item.index, item.data, context));
3939,3941c4252
< })
< }
< );
---
> }) });
3943a4255
> const $ = compilerRuntimeExports.c(7);
3947c4259,4267
< const ref = useSize((el) => headerHeight(correctItemSize(el, "height")));
---
> let t0;
> if ($[0] !== headerHeight) {
> t0 = (el) => headerHeight(correctItemSize(el, "height"));
> $[0] = headerHeight;
> $[1] = t0;
> } else {
> t0 = $[1];
> }
> const ref = useSize(t0);
3949c4269,4280
< return Header2 ? /* @__PURE__ */ jsx(HeaderFooterWrapper, { ref, children: /* @__PURE__ */ jsx(Header2, { ...contextPropIfNotDomElement(Header2, context) }) }) : null;
---
> let t1;
> if ($[2] !== Header2 || $[3] !== context || $[4] !== HeaderFooterWrapper || $[5] !== ref) {
> t1 = Header2 ? /* @__PURE__ */ jsx(HeaderFooterWrapper, { ref, children: /* @__PURE__ */ jsx(Header2, { ...contextPropIfNotDomElement(Header2, context) }) }) : null;
> $[2] = Header2;
> $[3] = context;
> $[4] = HeaderFooterWrapper;
> $[5] = ref;
> $[6] = t1;
> } else {
> t1 = $[6];
> }
> return t1;
3951a4283
> const $ = compilerRuntimeExports.c(7);
3955c4287,4295
< const ref = useSize((el) => footerHeight(correctItemSize(el, "height")));
---
> let t0;
> if ($[0] !== footerHeight) {
> t0 = (el) => footerHeight(correctItemSize(el, "height"));
> $[0] = footerHeight;
> $[1] = t0;
> } else {
> t0 = $[1];
> }
> const ref = useSize(t0);
3957c4297,4308
< return Footer2 ? /* @__PURE__ */ jsx(HeaderFooterWrapper, { ref, children: /* @__PURE__ */ jsx(Footer2, { ...contextPropIfNotDomElement(Footer2, context) }) }) : null;
---
> let t1;
> if ($[2] !== Footer2 || $[3] !== context || $[4] !== HeaderFooterWrapper || $[5] !== ref) {
> t1 = Footer2 ? /* @__PURE__ */ jsx(HeaderFooterWrapper, { ref, children: /* @__PURE__ */ jsx(Footer2, { ...contextPropIfNotDomElement(Footer2, context) }) }) : null;
> $[2] = Footer2;
> $[3] = context;
> $[4] = HeaderFooterWrapper;
> $[5] = ref;
> $[6] = t1;
> } else {
> t1 = $[6];
> }
> return t1;
3959c4310,4314
< const Viewport$1 = ({ children }) => {
---
> const Viewport$1 = (t0) => {
> const $ = compilerRuntimeExports.c(11);
> const {
> children
> } = t0;
3963c4318,4320
< const viewportRef = useSize((el) => {
---
> let t1;
> if ($[0] !== viewportDimensions) {
> t1 = (el) => {
3965,3966c4322,4332
< });
< React.useEffect(() => {
---
> };
> $[0] = viewportDimensions;
> $[1] = t1;
> } else {
> t1 = $[1];
> }
> const viewportRef = useSize(t1);
> let t2;
> let t3;
> if ($[2] !== ctx || $[3] !== viewportDimensions || $[4] !== itemDimensions) {
> t2 = () => {
3968,3969c4334,4360
< viewportDimensions({ height: ctx.viewportHeight, width: ctx.viewportWidth });
< itemDimensions({ height: ctx.itemHeight, width: ctx.itemWidth });
---
> viewportDimensions({
> height: ctx.viewportHeight,
> width: ctx.viewportWidth
> });
> itemDimensions({
> height: ctx.itemHeight,
> width: ctx.itemWidth
> });
> }
> };
> t3 = [ctx, viewportDimensions, itemDimensions];
> $[2] = ctx;
> $[3] = viewportDimensions;
> $[4] = itemDimensions;
> $[5] = t2;
> $[6] = t3;
> } else {
> t2 = $[5];
> t3 = $[6];
> }
> React.useEffect(t2, t3);
> let t4;
> if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
> t4 = viewportStyle(false);
> $[7] = t4;
> } else {
> t4 = $[7];
3971,3972c4362,4371
< }, [ctx, viewportDimensions, itemDimensions]);
< return /* @__PURE__ */ jsx("div", { style: viewportStyle(false), ref: viewportRef, children });
---
> let t5;
> if ($[8] !== viewportRef || $[9] !== children) {
> t5 = /* @__PURE__ */ jsx("div", { style: t4, ref: viewportRef, children });
> $[8] = viewportRef;
> $[9] = children;
> $[10] = t5;
> } else {
> t5 = $[10];
> }
> return t5;
3974c4373,4377
< const WindowViewport$1 = ({ children }) => {
---
> const WindowViewport$1 = (t0) => {
> const $ = compilerRuntimeExports.c(9);
> const {
> children
> } = t0;
3980c4383,4386
< React.useEffect(() => {
---
> let t1;
> let t2;
> if ($[0] !== ctx || $[1] !== itemDimensions || $[2] !== windowViewportRect) {
> t1 = () => {
3982,3983c4388,4407
< itemDimensions({ height: ctx.itemHeight, width: ctx.itemWidth });
< windowViewportRect({ offsetTop: 0, visibleHeight: ctx.viewportHeight, visibleWidth: ctx.viewportWidth });
---
> itemDimensions({
> height: ctx.itemHeight,
> width: ctx.itemWidth
> });
> windowViewportRect({
> offsetTop: 0,
> visibleHeight: ctx.viewportHeight,
> visibleWidth: ctx.viewportWidth
> });
> }
> };
> t2 = [ctx, windowViewportRect, itemDimensions];
> $[0] = ctx;
> $[1] = itemDimensions;
> $[2] = windowViewportRect;
> $[3] = t1;
> $[4] = t2;
> } else {
> t1 = $[3];
> t2 = $[4];
3985,3986c4409,4426
< }, [ctx, windowViewportRect, itemDimensions]);
< return /* @__PURE__ */ jsx("div", { ref: viewportRef, style: viewportStyle(false), children });
---
> React.useEffect(t1, t2);
> let t3;
> if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
> t3 = viewportStyle(false);
> $[5] = t3;
> } else {
> t3 = $[5];
> }
> let t4;
> if ($[6] !== viewportRef || $[7] !== children) {
> t4 = /* @__PURE__ */ jsx("div", { ref: viewportRef, style: t3, children });
> $[6] = viewportRef;
> $[7] = children;
> $[8] = t4;
> } else {
> t4 = $[8];
> }
> return t4;
3988c4428,4439
< const GridRoot = /* @__PURE__ */ React.memo(function GridRoot2({ ...props }) {
---
> const GridRoot = /* @__PURE__ */ React.memo(function GridRoot2(t0) {
> const $ = compilerRuntimeExports.c(11);
> let props;
> if ($[0] !== t0) {
> ({
> ...props
> } = t0);
> $[0] = t0;
> $[1] = props;
> } else {
> props = $[1];
> }
3993,3997c4444,4487
< return /* @__PURE__ */ jsx(TheScroller, { ...props, children: /* @__PURE__ */ jsxs(TheViewport, { children: [
< /* @__PURE__ */ jsx(Header, {}),
< /* @__PURE__ */ jsx(GridItems, {}),
< /* @__PURE__ */ jsx(Footer, {})
< ] }) });
---
> let t1;
> if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
> t1 = /* @__PURE__ */ jsx(Header, {});
> $[2] = t1;
> } else {
> t1 = $[2];
> }
> let t2;
> if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
> t2 = /* @__PURE__ */ jsx(GridItems, {});
> $[3] = t2;
> } else {
> t2 = $[3];
> }
> let t3;
> if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
> t3 = /* @__PURE__ */ jsx(Footer, {});
> $[4] = t3;
> } else {
> t3 = $[4];
> }
> let t4;
> if ($[5] !== TheViewport) {
> t4 = /* @__PURE__ */ jsxs(TheViewport, { children: [
> t1,
> t2,
> t3
> ] });
> $[5] = TheViewport;
> $[6] = t4;
> } else {
> t4 = $[6];
> }
> let t5;
> if ($[7] !== TheScroller || $[8] !== props || $[9] !== t4) {
> t5 = /* @__PURE__ */ jsx(TheScroller, { ...props, children: t4 });
> $[7] = TheScroller;
> $[8] = props;
> $[9] = t4;
> $[10] = t5;
> } else {
> t5 = $[10];
> }
> return t5;
4004,4006c4494
< } = /* @__PURE__ */ systemToComponent(
< combinedSystem$1,
< {
---
> } = /* @__PURE__ */ systemToComponent(combinedSystem$1, {
4041,4045c4529,4539
< },
< GridRoot
< );
< const Scroller$1 = /* @__PURE__ */ buildScroller({ usePublisher: usePublisher$1, useEmitterValue: useEmitterValue$1, useEmitter: useEmitter$1 });
< const WindowScroller$1 = /* @__PURE__ */ buildWindowScroller({ usePublisher: usePublisher$1, useEmitterValue: useEmitterValue$1, useEmitter: useEmitter$1 });
---
> }, GridRoot);
> const Scroller$1 = /* @__PURE__ */ buildScroller({
> usePublisher: usePublisher$1,
> useEmitterValue: useEmitterValue$1,
> useEmitter: useEmitter$1
> });
> const WindowScroller$1 = /* @__PURE__ */ buildWindowScroller({
> usePublisher: usePublisher$1,
> useEmitterValue: useEmitterValue$1,
> useEmitter: useEmitter$1
> });
4068,4075c4562
< return statefulStreamFromEmitter(
< pipe(
< components,
< map((components2) => components2[propName]),
< distinctUntilChanged()
< ),
< defaultValue
< );
---
> return statefulStreamFromEmitter(pipe(components, map((components2) => components2[propName]), distinctUntilChanged()), defaultValue);
4096,4104c4583,4627
< const combinedSystem = /* @__PURE__ */ system(
< ([listSystem2, propsSystem]) => {
< return { ...listSystem2, ...propsSystem };
< },
< tup(listSystem, tableComponentPropsSystem)
< );
< const DefaultScrollSeekPlaceholder = ({ height }) => /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("td", { style: { height } }) });
< const DefaultFillerRow = ({ height }) => /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("td", { style: { height, padding: 0, border: 0 } }) });
< const ITEM_STYLE = { overflowAnchor: "none" };
---
> const combinedSystem = /* @__PURE__ */ system(([listSystem2, propsSystem]) => {
> return {
> ...listSystem2,
> ...propsSystem
> };
> }, tup(listSystem, tableComponentPropsSystem));
> const DefaultScrollSeekPlaceholder = (t0) => {
> const $ = compilerRuntimeExports.c(2);
> const {
> height
> } = t0;
> let t1;
> if ($[0] !== height) {
> t1 = /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("td", { style: {
> height
> } }) });
> $[0] = height;
> $[1] = t1;
> } else {
> t1 = $[1];
> }
> return t1;
> };
> const DefaultFillerRow = (t0) => {
> const $ = compilerRuntimeExports.c(2);
> const {
> height
> } = t0;
> let t1;
> if ($[0] !== height) {
> t1 = /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("td", { style: {
> height,
> padding: 0,
> border: 0
> } }) });
> $[0] = height;
> $[1] = t1;
> } else {
> t1 = $[1];
> }
> return t1;
> };
> const ITEM_STYLE = {
> overflowAnchor: "none"
> };
4117,4125c4640,4643
< const { callbackRef, ref } = useChangedListContentsSizes(
< sizeRanges,
< itemSize,
< trackItemSizes,
< scrollContainerStateCallback,
< log,
< void 0,
< customScrollParent
< );
---
> const {
> callbackRef,
> ref
> } = useChangedListContentsSizes(sizeRanges, itemSize, trackItemSizes, scrollContainerStateCallback, log, void 0, customScrollParent);
4155,4162c4673
< return /* @__PURE__ */ createElement(
< ScrollSeekPlaceholder,
< {
< ...contextPropIfNotDomElement(ScrollSeekPlaceholder, context),
< key,
< index: item.index,
< height: item.size,
< type: item.type || "item"
---
> return /* @__PURE__ */ createElement(ScrollSeekPlaceholder, { ...contextPropIfNotDomElement(ScrollSeekPlaceholder, context), key, index: item.index, height: item.size, type: item.type || "item" });
4164,4178c4675
< );
< }
< return /* @__PURE__ */ createElement(
< TableRowComponent,
< {
< ...contextPropIfNotDomElement(TableRowComponent, context),
< ...itemPropIfNotDomElement(TableRowComponent, item.data),
< key,
< "data-index": index,
< "data-known-size": item.size,
< "data-item-index": item.index,
< style: ITEM_STYLE
< },
< itemContent(item.index, item.data, context)
< );
---
> return /* @__PURE__ */ createElement(TableRowComponent, { ...contextPropIfNotDomElement(TableRowComponent, context), ...itemPropIfNotDomElement(TableRowComponent, item.data), key, "data-index": index, "data-known-size": item.size, "data-item-index": item.index, style: ITEM_STYLE }, itemContent(item.index, item.data, context));
4182c4679,4683
< const Viewport = ({ children }) => {
---
> const Viewport = (t0) => {
> const $ = compilerRuntimeExports.c(12);
> const {
> children
> } = t0;
4186,4187c4687,4706
< const viewportRef = useSize(compose(viewportHeight, (el) => correctItemSize(el, "height")));
< React.useEffect(() => {
---
> let t1;
> if ($[0] !== viewportHeight) {
> let t22;
> if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
> t22 = (el) => correctItemSize(el, "height");
> $[2] = t22;
> } else {
> t22 = $[2];
> }
> t1 = compose(viewportHeight, t22);
> $[0] = viewportHeight;
> $[1] = t1;
> } else {
> t1 = $[1];
> }
> const viewportRef = useSize(t1);
> let t2;
> let t3;
> if ($[3] !== ctx || $[4] !== viewportHeight || $[5] !== fixedItemHeight) {
> t2 = () => {
4192,4193c4711,4739
< }, [ctx, viewportHeight, fixedItemHeight]);
< return /* @__PURE__ */ jsx("div", { style: viewportStyle(false), ref: viewportRef, "data-viewport-type": "element", children });
---
> };
> t3 = [ctx, viewportHeight, fixedItemHeight];
> $[3] = ctx;
> $[4] = viewportHeight;
> $[5] = fixedItemHeight;
> $[6] = t2;
> $[7] = t3;
> } else {
> t2 = $[6];
> t3 = $[7];
> }
> React.useEffect(t2, t3);
> let t4;
> if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
> t4 = viewportStyle(false);
> $[8] = t4;
> } else {
> t4 = $[8];
> }
> let t5;
> if ($[9] !== viewportRef || $[10] !== children) {
> t5 = /* @__PURE__ */ jsx("div", { style: t4, ref: viewportRef, "data-viewport-type": "element", children });
> $[9] = viewportRef;
> $[10] = children;
> $[11] = t5;
> } else {
> t5 = $[11];
> }
> return t5;
4195c4741,4745
< const WindowViewport = ({ children }) => {
---
> const WindowViewport = (t0) => {
> const $ = compilerRuntimeExports.c(9);
> const {
> children
> } = t0;
4201c4751,4754
< React.useEffect(() => {
---
> let t1;
> let t2;
> if ($[0] !== ctx || $[1] !== fixedItemHeight || $[2] !== windowViewportRect) {
> t1 = () => {
4204c4757,4761
< windowViewportRect({ offsetTop: 0, visibleHeight: ctx.viewportHeight, visibleWidth: 100 });
---
> windowViewportRect({
> offsetTop: 0,
> visibleHeight: ctx.viewportHeight,
> visibleWidth: 100
> });
4206,4207c4763,4791
< }, [ctx, windowViewportRect, fixedItemHeight]);
< return /* @__PURE__ */ jsx("div", { ref: viewportRef, style: viewportStyle(false), "data-viewport-type": "window", children });
---
> };
> t2 = [ctx, windowViewportRect, fixedItemHeight];
> $[0] = ctx;
> $[1] = fixedItemHeight;
> $[2] = windowViewportRect;
> $[3] = t1;
> $[4] = t2;
> } else {
> t1 = $[3];
> t2 = $[4];
> }
> React.useEffect(t1, t2);
> let t3;
> if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
> t3 = viewportStyle(false);
> $[5] = t3;
> } else {
> t3 = $[5];
> }
> let t4;
> if ($[6] !== viewportRef || $[7] !== children) {
> t4 = /* @__PURE__ */ jsx("div", { ref: viewportRef, style: t3, "data-viewport-type": "window", children });
> $[6] = viewportRef;
> $[7] = children;
> $[8] = t4;
> } else {
> t4 = $[8];
> }
> return t4;
4218c4802
< const tfootRef = useSize(compose(fixedFooterHeight, (el) => correctItemSize(el, "height")));
---
> const tfootRef = useSize(compose(fixedFooterHeight, (el_0) => correctItemSize(el_0, "height")));
4224,4244c4808,4821
< const theHead = fixedHeaderContent ? /* @__PURE__ */ jsx(
< TheTHead,
< {
< style: { zIndex: 2, position: "sticky", top: 0 },
< ref: theadRef,
< ...contextPropIfNotDomElement(TheTHead, context),
< children: fixedHeaderContent()
< },
< "TableHead"
< ) : null;
< const theFoot = fixedFooterContent ? /* @__PURE__ */ jsx(
< TheTFoot,
< {
< style: { zIndex: 1, position: "sticky", bottom: 0 },
< ref: tfootRef,
< ...contextPropIfNotDomElement(TheTFoot, context),
< children: fixedFooterContent()
< },
< "TableFoot"
< ) : null;
< return /* @__PURE__ */ jsx(TheScroller, { ...props, children: /* @__PURE__ */ jsx(TheViewport, { children: /* @__PURE__ */ jsx(TheTable, { style: { borderSpacing: 0, overflowAnchor: "none" }, ...contextPropIfNotDomElement(TheTable, context), children: [theHead, /* @__PURE__ */ jsx(Items, {}, "TableBody"), theFoot] }) }) });
---
> const theHead = fixedHeaderContent ? /* @__PURE__ */ jsx(TheTHead, { style: {
> zIndex: 2,
> position: "sticky",
> top: 0
> }, ref: theadRef, ...contextPropIfNotDomElement(TheTHead, context), children: fixedHeaderContent() }, "TableHead") : null;
> const theFoot = fixedFooterContent ? /* @__PURE__ */ jsx(TheTFoot, { style: {
> zIndex: 1,
> position: "sticky",
> bottom: 0
> }, ref: tfootRef, ...contextPropIfNotDomElement(TheTFoot, context), children: fixedFooterContent() }, "TableFoot") : null;
> return /* @__PURE__ */ jsx(TheScroller, { ...props, children: /* @__PURE__ */ jsx(TheViewport, { children: /* @__PURE__ */ jsx(TheTable, { style: {
> borderSpacing: 0,
> overflowAnchor: "none"
> }, ...contextPropIfNotDomElement(TheTable, context), children: [theHead, /* @__PURE__ */ jsx(Items, {}, "TableBody"), theFoot] }) }) });
4251,4253c4828
< } = /* @__PURE__ */ systemToComponent(
< combinedSystem,
< {
---
> } = /* @__PURE__ */ systemToComponent(combinedSystem, {
4304,4308c4879,4889
< },
< TableRoot
< );
< const Scroller = /* @__PURE__ */ buildScroller({ usePublisher, useEmitterValue, useEmitter });
< const WindowScroller = /* @__PURE__ */ buildWindowScroller({ usePublisher, useEmitterValue, useEmitter });
---
> }, TableRoot);
> const Scroller = /* @__PURE__ */ buildScroller({
> usePublisher,
> useEmitterValue,
> useEmitter
> });
> const WindowScroller = /* @__PURE__ */ buildWindowScroller({
> usePublisher,
> useEmitterValue,
> useEmitter
> });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment