react-virtuoso 2.2.6 → 2.2.9-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (140) hide show
  1. package/dist/Grid.d.ts +34 -30
  2. package/dist/List.d.ts +276 -206
  3. package/dist/__examples.cc6a8f9f.js +171814 -0
  4. package/dist/__examples.cc6a8f9f.js.map +1 -0
  5. package/dist/__examples.html +27 -0
  6. package/dist/__examples.js +392 -0
  7. package/dist/__examples.js.map +1 -0
  8. package/dist/align-to-bottom.7fcd2087.js +401 -0
  9. package/dist/align-to-bottom.7fcd2087.js.map +1 -0
  10. package/dist/alignToBottomSystem.d.ts +25 -21
  11. package/dist/at-bottom-detection.a5d019c3.js +447 -0
  12. package/dist/at-bottom-detection.a5d019c3.js.map +1 -0
  13. package/dist/auto-prepend-items.bd7e9b90.js +468 -0
  14. package/dist/auto-prepend-items.bd7e9b90.js.map +1 -0
  15. package/dist/benchmark.66d31485.js +366 -0
  16. package/dist/benchmark.66d31485.js.map +1 -0
  17. package/dist/chat.d4f93b8b.js +570 -0
  18. package/dist/chat.d4f93b8b.js.map +1 -0
  19. package/dist/components.d.ts +12 -6
  20. package/dist/context.a45abc98.js +379 -0
  21. package/dist/context.a45abc98.js.map +1 -0
  22. package/dist/contextSystem.d.ts +4 -0
  23. package/dist/custom-components.5aeaa7ef.js +407 -0
  24. package/dist/custom-components.5aeaa7ef.js.map +1 -0
  25. package/dist/custom-scroller.b0240d14.js +385 -0
  26. package/dist/custom-scroller.b0240d14.js.map +1 -0
  27. package/dist/data.26707046.js +391 -0
  28. package/dist/data.26707046.js.map +1 -0
  29. package/dist/decrease-items.e2211e50.js +385 -0
  30. package/dist/decrease-items.e2211e50.js.map +1 -0
  31. package/dist/default-item-height.b77ada36.js +360 -0
  32. package/dist/default-item-height.b77ada36.js.map +1 -0
  33. package/dist/domIOSystem.d.ts +1 -4
  34. package/dist/empty-placeholder.00607a6e.js +390 -0
  35. package/dist/empty-placeholder.00607a6e.js.map +1 -0
  36. package/dist/end-reached.8531e5b1.js +404 -0
  37. package/dist/end-reached.8531e5b1.js.map +1 -0
  38. package/dist/endless-scrolling.bc4101f0.js +410 -0
  39. package/dist/endless-scrolling.bc4101f0.js.map +1 -0
  40. package/dist/expandable-cards.5439f51b.js +427 -0
  41. package/dist/expandable-cards.5439f51b.js.map +1 -0
  42. package/dist/follow-output.4e36fca8.js +430 -0
  43. package/dist/follow-output.4e36fca8.js.map +1 -0
  44. package/dist/followOutputSystem.d.ts +38 -12
  45. package/dist/grid-optimize-rendering.b49e36f5.js +452 -0
  46. package/dist/grid-optimize-rendering.b49e36f5.js.map +1 -0
  47. package/dist/grid-scroll-seek-placeholder.b2862006.js +415 -0
  48. package/dist/grid-scroll-seek-placeholder.b2862006.js.map +1 -0
  49. package/dist/grid.d5d77b6a.js +449 -0
  50. package/dist/grid.d5d77b6a.js.map +1 -0
  51. package/dist/gridSystem.d.ts +25 -19
  52. package/dist/grouped-endless-scrolling.24985a0f.js +506 -0
  53. package/dist/grouped-endless-scrolling.24985a0f.js.map +1 -0
  54. package/dist/grouped-load-more.bce8f6e4.js +505 -0
  55. package/dist/grouped-load-more.bce8f6e4.js.map +1 -0
  56. package/dist/grouped-topmost-item.34960f5e.js +366 -0
  57. package/dist/grouped-topmost-item.34960f5e.js.map +1 -0
  58. package/dist/grouped.a2908632.js +365 -0
  59. package/dist/grouped.a2908632.js.map +1 -0
  60. package/dist/groupedListSystem.d.ts +2 -2
  61. package/dist/header-footer.49733d45.js +376 -0
  62. package/dist/header-footer.49733d45.js.map +1 -0
  63. package/dist/hello.54765c26.js +360 -0
  64. package/dist/hello.54765c26.js.map +1 -0
  65. package/dist/hooks/useChangedChildSizes.d.ts +1 -1
  66. package/dist/hooks/useScrollTop.d.ts +1 -1
  67. package/dist/index.js +1 -1
  68. package/dist/index.js.map +1 -1
  69. package/dist/index.m.js +1 -1
  70. package/dist/index.m.js.map +1 -1
  71. package/dist/initial-from-zero.22ad1626.js +400 -0
  72. package/dist/initial-from-zero.22ad1626.js.map +1 -0
  73. package/dist/initial-scroll-top.90db1920.js +361 -0
  74. package/dist/initial-scroll-top.90db1920.js.map +1 -0
  75. package/dist/initial-topmost-item-default-height.43a95247.js +362 -0
  76. package/dist/initial-topmost-item-default-height.43a95247.js.map +1 -0
  77. package/dist/initial-topmost-item.61c0e169.js +363 -0
  78. package/dist/initial-topmost-item.61c0e169.js.map +1 -0
  79. package/dist/initialItemCountSystem.d.ts +21 -17
  80. package/dist/initialScrollTopSystem.d.ts +25 -21
  81. package/dist/initialTopMostItemIndexSystem.d.ts +4 -4
  82. package/dist/interfaces.d.ts +11 -5
  83. package/dist/listStateSystem.d.ts +19 -16
  84. package/dist/listSystem.d.ts +256 -193
  85. package/dist/long-last-item.b56ff89c.js +361 -0
  86. package/dist/long-last-item.b56ff89c.js.map +1 -0
  87. package/dist/prepend-items.f2bda34b.js +393 -0
  88. package/dist/prepend-items.f2bda34b.js.map +1 -0
  89. package/dist/prepend-last-tall-item.168a9e65.js +380 -0
  90. package/dist/prepend-last-tall-item.168a9e65.js.map +1 -0
  91. package/dist/react-beautiful-dnd-window-scroller.0a227511.js +485 -0
  92. package/dist/react-beautiful-dnd-window-scroller.0a227511.js.map +1 -0
  93. package/dist/react-beautiful-dnd.817e9251.js +482 -0
  94. package/dist/react-beautiful-dnd.817e9251.js.map +1 -0
  95. package/dist/rerender.ddd61b7c.js +400 -0
  96. package/dist/rerender.ddd61b7c.js.map +1 -0
  97. package/dist/resize-loop.309b1dac.js +388 -0
  98. package/dist/resize-loop.309b1dac.js.map +1 -0
  99. package/dist/resizing-items.c09b5e1b.js +394 -0
  100. package/dist/resizing-items.c09b5e1b.js.map +1 -0
  101. package/dist/scroll-into-view.39b77fe9.js +408 -0
  102. package/dist/scroll-into-view.39b77fe9.js.map +1 -0
  103. package/dist/scroll-seek-placeholder.69fb85c6.js +384 -0
  104. package/dist/scroll-seek-placeholder.69fb85c6.js.map +1 -0
  105. package/dist/scroll-to-index.e72249cf.js +417 -0
  106. package/dist/scroll-to-index.e72249cf.js.map +1 -0
  107. package/dist/scrollIntoViewSystem.d.ts +25 -21
  108. package/dist/scrollSeekSystem.d.ts +9 -7
  109. package/dist/scrollToIndexSystem.d.ts +2 -2
  110. package/dist/sizeRangeSystem.d.ts +3 -3
  111. package/dist/ssr.8f31b042.js +359 -0
  112. package/dist/ssr.8f31b042.js.map +1 -0
  113. package/dist/start-reached.2990ece7.js +424 -0
  114. package/dist/start-reached.2990ece7.js.map +1 -0
  115. package/dist/stateFlagsSystem.d.ts +9 -5
  116. package/dist/tall-item-reverse-scrolling.58bcd140.js +363 -0
  117. package/dist/tall-item-reverse-scrolling.58bcd140.js.map +1 -0
  118. package/dist/test-case-446.dce9595c.js +428 -0
  119. package/dist/test-case-446.dce9595c.js.map +1 -0
  120. package/dist/test-case-460.6d75ad1f.js +451 -0
  121. package/dist/test-case-460.6d75ad1f.js.map +1 -0
  122. package/dist/test-case-463.525f34ba.js +375 -0
  123. package/dist/test-case-463.525f34ba.js.map +1 -0
  124. package/dist/toggle-display-grouped.4f4ae058.js +389 -0
  125. package/dist/toggle-display-grouped.4f4ae058.js.map +1 -0
  126. package/dist/toggle.7047c23e.js +447 -0
  127. package/dist/toggle.7047c23e.js.map +1 -0
  128. package/dist/top-items.f724bf61.js +358 -0
  129. package/dist/top-items.f724bf61.js.map +1 -0
  130. package/dist/topItemCountSystem.d.ts +21 -17
  131. package/dist/totalListHeightSystem.d.ts +23 -19
  132. package/dist/upward-scroll.d49e0815.js +362 -0
  133. package/dist/upward-scroll.d49e0815.js.map +1 -0
  134. package/dist/upwardScrollFixSystem.d.ts +31 -25
  135. package/dist/window-grid.b22094fd.js +439 -0
  136. package/dist/window-grid.b22094fd.js.map +1 -0
  137. package/dist/window-scroller.a979c6d6.js +368 -0
  138. package/dist/window-scroller.a979c6d6.js.map +1 -0
  139. package/dist/windowScrollerSystem.d.ts +2 -2
  140. package/package.json +1 -1
@@ -0,0 +1,430 @@
1
+ // modules are defined as an array
2
+ // [ module function, map of requires ]
3
+ //
4
+ // map of requires is short require name -> numeric require
5
+ //
6
+ // anything defined in a previous bundle is accessed via the
7
+ // orig method which is the require for previous bundles
8
+ parcelRequire = (function (modules, cache, entry, globalName) {
9
+ // Save the require from previous bundle to this closure if any
10
+ var previousRequire = typeof parcelRequire === 'function' && parcelRequire;
11
+ var nodeRequire = typeof require === 'function' && require;
12
+
13
+ function newRequire(name, jumped) {
14
+ if (!cache[name]) {
15
+ if (!modules[name]) {
16
+ // if we cannot find the module within our internal map or
17
+ // cache jump to the current global require ie. the last bundle
18
+ // that was added to the page.
19
+ var currentRequire = typeof parcelRequire === 'function' && parcelRequire;
20
+ if (!jumped && currentRequire) {
21
+ return currentRequire(name, true);
22
+ }
23
+
24
+ // If there are other bundles on this page the require from the
25
+ // previous one is saved to 'previousRequire'. Repeat this as
26
+ // many times as there are bundles until the module is found or
27
+ // we exhaust the require chain.
28
+ if (previousRequire) {
29
+ return previousRequire(name, true);
30
+ }
31
+
32
+ // Try the node require function if it exists.
33
+ if (nodeRequire && typeof name === 'string') {
34
+ return nodeRequire(name);
35
+ }
36
+
37
+ var err = new Error('Cannot find module \'' + name + '\'');
38
+ err.code = 'MODULE_NOT_FOUND';
39
+ throw err;
40
+ }
41
+
42
+ localRequire.resolve = resolve;
43
+ localRequire.cache = {};
44
+
45
+ var module = cache[name] = new newRequire.Module(name);
46
+
47
+ modules[name][0].call(module.exports, localRequire, module, module.exports, this);
48
+ }
49
+
50
+ return cache[name].exports;
51
+
52
+ function localRequire(x){
53
+ return newRequire(localRequire.resolve(x));
54
+ }
55
+
56
+ function resolve(x){
57
+ return modules[name][1][x] || x;
58
+ }
59
+ }
60
+
61
+ function Module(moduleName) {
62
+ this.id = moduleName;
63
+ this.bundle = newRequire;
64
+ this.exports = {};
65
+ }
66
+
67
+ newRequire.isParcelRequire = true;
68
+ newRequire.Module = Module;
69
+ newRequire.modules = modules;
70
+ newRequire.cache = cache;
71
+ newRequire.parent = previousRequire;
72
+ newRequire.register = function (id, exports) {
73
+ modules[id] = [function (require, module) {
74
+ module.exports = exports;
75
+ }, {}];
76
+ };
77
+
78
+ var error;
79
+ for (var i = 0; i < entry.length; i++) {
80
+ try {
81
+ newRequire(entry[i]);
82
+ } catch (e) {
83
+ // Save first error but execute all entries
84
+ if (!error) {
85
+ error = e;
86
+ }
87
+ }
88
+ }
89
+
90
+ if (entry.length) {
91
+ // Expose entry point to Node, AMD or browser globals
92
+ // Based on https://github.com/ForbesLindesay/umd/blob/master/template.js
93
+ var mainExports = newRequire(entry[entry.length - 1]);
94
+
95
+ // CommonJS
96
+ if (typeof exports === "object" && typeof module !== "undefined") {
97
+ module.exports = mainExports;
98
+
99
+ // RequireJS
100
+ } else if (typeof define === "function" && define.amd) {
101
+ define(function () {
102
+ return mainExports;
103
+ });
104
+
105
+ // <script>
106
+ } else if (globalName) {
107
+ this[globalName] = mainExports;
108
+ }
109
+ }
110
+
111
+ // Override the current require with this new one
112
+ parcelRequire = newRequire;
113
+
114
+ if (error) {
115
+ // throw error from earlier, _after updating parcelRequire_
116
+ throw error;
117
+ }
118
+
119
+ return newRequire;
120
+ })({"follow-output.tsx":[function(require,module,exports) {
121
+ "use strict";
122
+
123
+ Object.defineProperty(exports, "__esModule", {
124
+ value: true
125
+ });
126
+ exports.default = App;
127
+
128
+ var React = _interopRequireWildcard(require("react"));
129
+
130
+ var _src = require("../src");
131
+
132
+ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
133
+
134
+ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
135
+
136
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
137
+
138
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
139
+
140
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
141
+
142
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
143
+
144
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
145
+
146
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
147
+
148
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
149
+
150
+ function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
151
+
152
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
153
+
154
+ function App() {
155
+ var _useState = (0, React.useState)(100),
156
+ _useState2 = _slicedToArray(_useState, 2),
157
+ count = _useState2[0],
158
+ setCount = _useState2[1];
159
+
160
+ var appendInterval = (0, React.useRef)();
161
+
162
+ var _useState3 = (0, React.useState)(300),
163
+ _useState4 = _slicedToArray(_useState3, 2),
164
+ listHeight = _useState4[0],
165
+ setListHeight = _useState4[1];
166
+
167
+ var _useState5 = (0, React.useState)({}),
168
+ _useState6 = _slicedToArray(_useState5, 2),
169
+ itemHeights = _useState6[0],
170
+ setItemHeights = _useState6[1];
171
+
172
+ var itemContent = (0, React.useCallback)(function (index) {
173
+ var _itemHeights$index;
174
+
175
+ var height = (_itemHeights$index = itemHeights[index]) !== null && _itemHeights$index !== void 0 ? _itemHeights$index : index % 2 ? 30 : 40;
176
+ return React.createElement("div", {
177
+ style: {
178
+ height: height,
179
+ background: 'white'
180
+ }
181
+ }, "Item ", index, React.createElement("button", {
182
+ onClick: function onClick() {
183
+ setItemHeights(function (heights) {
184
+ return _objectSpread(_objectSpread({}, heights), {}, _defineProperty({}, index, 160));
185
+ });
186
+ }
187
+ }, "*"));
188
+ }, [itemHeights, setItemHeights]);
189
+ return React.createElement(React.Fragment, null, React.createElement("div", null, React.createElement("button", {
190
+ onClick: function onClick() {
191
+ return setCount(function (count) {
192
+ return count + 4;
193
+ });
194
+ }
195
+ }, "Append Items"), " |", ' ', React.createElement("button", {
196
+ onClick: function onClick() {
197
+ return setListHeight(function (height) {
198
+ return height + 40;
199
+ });
200
+ }
201
+ }, "Increase container"), " |", ' ', React.createElement("button", {
202
+ onClick: function onClick() {
203
+ return setListHeight(function (height) {
204
+ return height - 40;
205
+ });
206
+ }
207
+ }, "Decrease container")), React.createElement(_src.Virtuoso, {
208
+ totalCount: count,
209
+ initialTopMostItemIndex: 99,
210
+ followOutput: 'smooth',
211
+ itemContent: itemContent,
212
+ style: {
213
+ height: listHeight
214
+ },
215
+ atBottomStateChange: function atBottomStateChange(atBottom) {
216
+ clearInterval(appendInterval.current);
217
+
218
+ if (atBottom) {
219
+ appendInterval.current = setInterval(function () {// setCount((count) => count + 3)
220
+ }, 100);
221
+ }
222
+ }
223
+ }));
224
+ }
225
+ },{"react":"../node_modules/react/index.js","../src":"../src/index.tsx"}],"../node_modules/parcel-bundler/src/builtins/hmr-runtime.js":[function(require,module,exports) {
226
+ var global = arguments[3];
227
+ var OVERLAY_ID = '__parcel__error__overlay__';
228
+ var OldModule = module.bundle.Module;
229
+
230
+ function Module(moduleName) {
231
+ OldModule.call(this, moduleName);
232
+ this.hot = {
233
+ data: module.bundle.hotData,
234
+ _acceptCallbacks: [],
235
+ _disposeCallbacks: [],
236
+ accept: function (fn) {
237
+ this._acceptCallbacks.push(fn || function () {});
238
+ },
239
+ dispose: function (fn) {
240
+ this._disposeCallbacks.push(fn);
241
+ }
242
+ };
243
+ module.bundle.hotData = null;
244
+ }
245
+
246
+ module.bundle.Module = Module;
247
+ var checkedAssets, assetsToAccept;
248
+ var parent = module.bundle.parent;
249
+
250
+ if ((!parent || !parent.isParcelRequire) && typeof WebSocket !== 'undefined') {
251
+ var hostname = "" || location.hostname;
252
+ var protocol = location.protocol === 'https:' ? 'wss' : 'ws';
253
+ var ws = new WebSocket(protocol + '://' + hostname + ':' + "65171" + '/');
254
+
255
+ ws.onmessage = function (event) {
256
+ checkedAssets = {};
257
+ assetsToAccept = [];
258
+ var data = JSON.parse(event.data);
259
+
260
+ if (data.type === 'update') {
261
+ var handled = false;
262
+ data.assets.forEach(function (asset) {
263
+ if (!asset.isNew) {
264
+ var didAccept = hmrAcceptCheck(global.parcelRequire, asset.id);
265
+
266
+ if (didAccept) {
267
+ handled = true;
268
+ }
269
+ }
270
+ }); // Enable HMR for CSS by default.
271
+
272
+ handled = handled || data.assets.every(function (asset) {
273
+ return asset.type === 'css' && asset.generated.js;
274
+ });
275
+
276
+ if (handled) {
277
+ console.clear();
278
+ data.assets.forEach(function (asset) {
279
+ hmrApply(global.parcelRequire, asset);
280
+ });
281
+ assetsToAccept.forEach(function (v) {
282
+ hmrAcceptRun(v[0], v[1]);
283
+ });
284
+ } else if (location.reload) {
285
+ // `location` global exists in a web worker context but lacks `.reload()` function.
286
+ location.reload();
287
+ }
288
+ }
289
+
290
+ if (data.type === 'reload') {
291
+ ws.close();
292
+
293
+ ws.onclose = function () {
294
+ location.reload();
295
+ };
296
+ }
297
+
298
+ if (data.type === 'error-resolved') {
299
+ console.log('[parcel] ✨ Error resolved');
300
+ removeErrorOverlay();
301
+ }
302
+
303
+ if (data.type === 'error') {
304
+ console.error('[parcel] 🚨 ' + data.error.message + '\n' + data.error.stack);
305
+ removeErrorOverlay();
306
+ var overlay = createErrorOverlay(data);
307
+ document.body.appendChild(overlay);
308
+ }
309
+ };
310
+ }
311
+
312
+ function removeErrorOverlay() {
313
+ var overlay = document.getElementById(OVERLAY_ID);
314
+
315
+ if (overlay) {
316
+ overlay.remove();
317
+ }
318
+ }
319
+
320
+ function createErrorOverlay(data) {
321
+ var overlay = document.createElement('div');
322
+ overlay.id = OVERLAY_ID; // html encode message and stack trace
323
+
324
+ var message = document.createElement('div');
325
+ var stackTrace = document.createElement('pre');
326
+ message.innerText = data.error.message;
327
+ stackTrace.innerText = data.error.stack;
328
+ overlay.innerHTML = '<div style="background: black; font-size: 16px; color: white; position: fixed; height: 100%; width: 100%; top: 0px; left: 0px; padding: 30px; opacity: 0.85; font-family: Menlo, Consolas, monospace; z-index: 9999;">' + '<span style="background: red; padding: 2px 4px; border-radius: 2px;">ERROR</span>' + '<span style="top: 2px; margin-left: 5px; position: relative;">🚨</span>' + '<div style="font-size: 18px; font-weight: bold; margin-top: 20px;">' + message.innerHTML + '</div>' + '<pre>' + stackTrace.innerHTML + '</pre>' + '</div>';
329
+ return overlay;
330
+ }
331
+
332
+ function getParents(bundle, id) {
333
+ var modules = bundle.modules;
334
+
335
+ if (!modules) {
336
+ return [];
337
+ }
338
+
339
+ var parents = [];
340
+ var k, d, dep;
341
+
342
+ for (k in modules) {
343
+ for (d in modules[k][1]) {
344
+ dep = modules[k][1][d];
345
+
346
+ if (dep === id || Array.isArray(dep) && dep[dep.length - 1] === id) {
347
+ parents.push(k);
348
+ }
349
+ }
350
+ }
351
+
352
+ if (bundle.parent) {
353
+ parents = parents.concat(getParents(bundle.parent, id));
354
+ }
355
+
356
+ return parents;
357
+ }
358
+
359
+ function hmrApply(bundle, asset) {
360
+ var modules = bundle.modules;
361
+
362
+ if (!modules) {
363
+ return;
364
+ }
365
+
366
+ if (modules[asset.id] || !bundle.parent) {
367
+ var fn = new Function('require', 'module', 'exports', asset.generated.js);
368
+ asset.isNew = !modules[asset.id];
369
+ modules[asset.id] = [fn, asset.deps];
370
+ } else if (bundle.parent) {
371
+ hmrApply(bundle.parent, asset);
372
+ }
373
+ }
374
+
375
+ function hmrAcceptCheck(bundle, id) {
376
+ var modules = bundle.modules;
377
+
378
+ if (!modules) {
379
+ return;
380
+ }
381
+
382
+ if (!modules[id] && bundle.parent) {
383
+ return hmrAcceptCheck(bundle.parent, id);
384
+ }
385
+
386
+ if (checkedAssets[id]) {
387
+ return;
388
+ }
389
+
390
+ checkedAssets[id] = true;
391
+ var cached = bundle.cache[id];
392
+ assetsToAccept.push([bundle, id]);
393
+
394
+ if (cached && cached.hot && cached.hot._acceptCallbacks.length) {
395
+ return true;
396
+ }
397
+
398
+ return getParents(global.parcelRequire, id).some(function (id) {
399
+ return hmrAcceptCheck(global.parcelRequire, id);
400
+ });
401
+ }
402
+
403
+ function hmrAcceptRun(bundle, id) {
404
+ var cached = bundle.cache[id];
405
+ bundle.hotData = {};
406
+
407
+ if (cached) {
408
+ cached.hot.data = bundle.hotData;
409
+ }
410
+
411
+ if (cached && cached.hot && cached.hot._disposeCallbacks.length) {
412
+ cached.hot._disposeCallbacks.forEach(function (cb) {
413
+ cb(bundle.hotData);
414
+ });
415
+ }
416
+
417
+ delete bundle.cache[id];
418
+ bundle(id);
419
+ cached = bundle.cache[id];
420
+
421
+ if (cached && cached.hot && cached.hot._acceptCallbacks.length) {
422
+ cached.hot._acceptCallbacks.forEach(function (cb) {
423
+ cb();
424
+ });
425
+
426
+ return true;
427
+ }
428
+ }
429
+ },{}]},{},["../node_modules/parcel-bundler/src/builtins/hmr-runtime.js"], null)
430
+ //# sourceMappingURL=/follow-output.4e36fca8.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["follow-output.tsx"],"names":[],"mappings":";;;;;;;AAAA;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;AAEc,SAAU,GAAV,GAAa;AAAA,kBACC,oBAAS,GAAT,CADD;AAAA;AAAA,MAClB,KADkB;AAAA,MACX,QADW;;AAEzB,MAAM,cAAc,GAAG,mBAAvB;;AAFyB,mBAGW,oBAAS,GAAT,CAHX;AAAA;AAAA,MAGlB,UAHkB;AAAA,MAGN,aAHM;;AAAA,mBAIa,oBAAiC,EAAjC,CAJb;AAAA;AAAA,MAIlB,WAJkB;AAAA,MAIL,cAJK;;AAKzB,MAAM,WAAW,GAAG,uBAClB,UAAC,KAAD,EAAkB;AAAA;;AAChB,QAAM,MAAM,yBAAG,WAAW,CAAC,KAAD,CAAd,mEAA0B,KAAK,GAAG,CAAR,GAAY,EAAZ,GAAiB,EAAvD;AACA,WACE,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA;AAAK,MAAA,KAAK,EAAE;AAAE,QAAA,MAAM,EAAN,MAAF;AAAU,QAAA,UAAU,EAAE;AAAtB;AAAZ,KAAA,SAAA,EACQ,KADR,EAEE,KAAA,CAAA,aAAA,CAAA,QAAA,EAAA;AACE,MAAA,OAAO,EAAE,mBAAK;AACZ,QAAA,cAAc,CAAC,UAAC,OAAD,EAAY;AACzB,iDACK,OADL,2BAEG,KAFH,EAEW,GAFX;AAID,SALa,CAAd;AAMD;AARH,KAAA,EAQG,GARH,CAFF,CADF;AAiBD,GApBiB,EAqBlB,CAAC,WAAD,EAAc,cAAd,CArBkB,CAApB;AAwBA,SACE,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA,EACE,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,IAAA,EACE,KAAA,CAAA,aAAA,CAAA,QAAA,EAAA;AAAQ,IAAA,OAAO,EAAE;AAAA,aAAM,QAAQ,CAAC,UAAC,KAAD;AAAA,eAAW,KAAK,GAAG,CAAnB;AAAA,OAAD,CAAd;AAAA;AAAjB,GAAA,EAAqD,cAArD,CADF,MAAA,EACiF,GADjF,EAEE,KAAA,CAAA,aAAA,CAAA,QAAA,EAAA;AAAQ,IAAA,OAAO,EAAE;AAAA,aAAM,aAAa,CAAC,UAAC,MAAD;AAAA,eAAY,MAAM,GAAG,EAArB;AAAA,OAAD,CAAnB;AAAA;AAAjB,GAAA,EAA6D,oBAA7D,CAFF,MAAA,EAE+F,GAF/F,EAGE,KAAA,CAAA,aAAA,CAAA,QAAA,EAAA;AAAQ,IAAA,OAAO,EAAE;AAAA,aAAM,aAAa,CAAC,UAAC,MAAD;AAAA,eAAY,MAAM,GAAG,EAArB;AAAA,OAAD,CAAnB;AAAA;AAAjB,GAAA,EAA6D,oBAA7D,CAHF,CADF,EAME,KAAA,CAAA,aAAA,CAAC,aAAD,EAAS;AACP,IAAA,UAAU,EAAE,KADL;AAEP,IAAA,uBAAuB,EAAE,EAFlB;AAGP,IAAA,YAAY,EAAE,QAHP;AAIP,IAAA,WAAW,EAAE,WAJN;AAKP,IAAA,KAAK,EAAE;AAAE,MAAA,MAAM,EAAE;AAAV,KALA;AAMP,IAAA,mBAAmB,EAAE,6BAAC,QAAD,EAAa;AAChC,MAAA,aAAa,CAAC,cAAc,CAAC,OAAhB,CAAb;;AACA,UAAI,QAAJ,EAAc;AACZ,QAAA,cAAc,CAAC,OAAf,GAAyB,WAAW,CAAC,YAAK,CACxC;AACD,SAFmC,EAEjC,GAFiC,CAApC;AAGD;AACF;AAbM,GAAT,CANF,CADF;AAwBD","file":"follow-output.4e36fca8.js","sourceRoot":"../e2e","sourcesContent":["import * as React from 'react'\nimport { useState, useRef, useCallback } from 'react'\nimport { Virtuoso } from '../src'\n\nexport default function App() {\n const [count, setCount] = useState(100)\n const appendInterval = useRef<NodeJS.Timeout>()\n const [listHeight, setListHeight] = useState(300)\n const [itemHeights, setItemHeights] = useState<Record<number, number>>({})\n const itemContent = useCallback(\n (index: number) => {\n const height = itemHeights[index] ?? (index % 2 ? 30 : 40)\n return (\n <div style={{ height, background: 'white' }}>\n Item {index}\n <button\n onClick={() => {\n setItemHeights((heights) => {\n return {\n ...heights,\n [index]: 160,\n }\n })\n }}\n >\n *\n </button>\n </div>\n )\n },\n [itemHeights, setItemHeights]\n )\n\n return (\n <>\n <div>\n <button onClick={() => setCount((count) => count + 4)}>Append Items</button> |{' '}\n <button onClick={() => setListHeight((height) => height + 40)}>Increase container</button> |{' '}\n <button onClick={() => setListHeight((height) => height - 40)}>Decrease container</button>\n </div>\n <Virtuoso\n totalCount={count}\n initialTopMostItemIndex={99}\n followOutput={'smooth'}\n itemContent={itemContent}\n style={{ height: listHeight }}\n atBottomStateChange={(atBottom) => {\n clearInterval(appendInterval.current!)\n if (atBottom) {\n appendInterval.current = setInterval(() => {\n // setCount((count) => count + 3)\n }, 100)\n }\n }}\n />\n </>\n )\n}\n"]}
@@ -26,22 +26,22 @@ export declare const followOutputSystem: u.SystemSpec<[u.SystemSpec<[u.SystemSpe
26
26
  viewportHeight: u.Stream<number>;
27
27
  headerHeight: u.StatefulStream<number>;
28
28
  footerHeight: u.StatefulStream<number>;
29
+ scrollHeight: u.Stream<number>;
29
30
  smoothScrollTargetReached: u.Stream<true>;
30
31
  scrollTo: u.Stream<ScrollToOptions>;
31
32
  scrollBy: u.Stream<ScrollToOptions>;
32
- scrollDirection: u.StatefulStream<import("./domIOSystem").ScrollDirection>;
33
33
  statefulScrollTop: u.StatefulStream<number>;
34
34
  deviation: u.StatefulStream<number>;
35
35
  scrollingInProgress: u.StatefulStream<boolean>;
36
- }>], ([{ scrollTop, viewportHeight, headerHeight, footerHeight }]: [{
36
+ }>], ([{ scrollTop, viewportHeight, headerHeight, footerHeight, scrollHeight }]: [{
37
37
  scrollTop: u.Stream<number>;
38
38
  viewportHeight: u.Stream<number>;
39
39
  headerHeight: u.StatefulStream<number>;
40
40
  footerHeight: u.StatefulStream<number>;
41
+ scrollHeight: u.Stream<number>;
41
42
  smoothScrollTargetReached: u.Stream<true>;
42
43
  scrollTo: u.Stream<ScrollToOptions>;
43
44
  scrollBy: u.Stream<ScrollToOptions>;
44
- scrollDirection: u.StatefulStream<import("./domIOSystem").ScrollDirection>;
45
45
  statefulScrollTop: u.StatefulStream<number>;
46
46
  deviation: u.StatefulStream<number>;
47
47
  scrollingInProgress: u.StatefulStream<boolean>;
@@ -52,7 +52,8 @@ export declare const followOutputSystem: u.SystemSpec<[u.SystemSpec<[u.SystemSpe
52
52
  atBottomState: u.Stream<import("./stateFlagsSystem").AtBottomState>;
53
53
  atTopStateChange: u.Stream<boolean>;
54
54
  atBottomStateChange: u.Stream<boolean>;
55
- listStateListener: u.Stream<import("./stateFlagsSystem").ListBottomInfo>;
55
+ scrollDirection: u.StatefulStream<import("./stateFlagsSystem").ScrollDirection>;
56
+ atBottomThreshold: u.StatefulStream<number>;
56
57
  }>, u.SystemSpec<[u.SystemSpec<[u.SystemSpec<never[], () => {
57
58
  log: u.StatefulStream<import("./loggerSystem").Log>;
58
59
  logLevel: u.StatefulStream<LogLevel>;
@@ -78,10 +79,10 @@ export declare const followOutputSystem: u.SystemSpec<[u.SystemSpec<[u.SystemSpe
78
79
  viewportHeight: u.Stream<number>;
79
80
  headerHeight: u.StatefulStream<number>;
80
81
  footerHeight: u.StatefulStream<number>;
82
+ scrollHeight: u.Stream<number>;
81
83
  smoothScrollTargetReached: u.Stream<true>;
82
84
  scrollTo: u.Stream<ScrollToOptions>;
83
85
  scrollBy: u.Stream<ScrollToOptions>;
84
- scrollDirection: u.StatefulStream<import("./domIOSystem").ScrollDirection>;
85
86
  statefulScrollTop: u.StatefulStream<number>;
86
87
  deviation: u.StatefulStream<number>;
87
88
  scrollingInProgress: u.StatefulStream<boolean>;
@@ -107,10 +108,10 @@ export declare const followOutputSystem: u.SystemSpec<[u.SystemSpec<[u.SystemSpe
107
108
  viewportHeight: u.Stream<number>;
108
109
  headerHeight: u.StatefulStream<number>;
109
110
  footerHeight: u.StatefulStream<number>;
111
+ scrollHeight: u.Stream<number>;
110
112
  smoothScrollTargetReached: u.Stream<true>;
111
113
  scrollTo: u.Stream<ScrollToOptions>;
112
114
  scrollBy: u.Stream<ScrollToOptions>;
113
- scrollDirection: u.StatefulStream<import("./domIOSystem").ScrollDirection>;
114
115
  statefulScrollTop: u.StatefulStream<number>;
115
116
  deviation: u.StatefulStream<number>;
116
117
  scrollingInProgress: u.StatefulStream<boolean>;
@@ -145,10 +146,10 @@ export declare const followOutputSystem: u.SystemSpec<[u.SystemSpec<[u.SystemSpe
145
146
  viewportHeight: u.Stream<number>;
146
147
  headerHeight: u.StatefulStream<number>;
147
148
  footerHeight: u.StatefulStream<number>;
149
+ scrollHeight: u.Stream<number>;
148
150
  smoothScrollTargetReached: u.Stream<true>;
149
151
  scrollTo: u.Stream<ScrollToOptions>;
150
152
  scrollBy: u.Stream<ScrollToOptions>;
151
- scrollDirection: u.StatefulStream<import("./domIOSystem").ScrollDirection>;
152
153
  statefulScrollTop: u.StatefulStream<number>;
153
154
  deviation: u.StatefulStream<number>;
154
155
  scrollingInProgress: u.StatefulStream<boolean>;
@@ -177,10 +178,10 @@ export declare const followOutputSystem: u.SystemSpec<[u.SystemSpec<[u.SystemSpe
177
178
  viewportHeight: u.Stream<number>;
178
179
  headerHeight: u.StatefulStream<number>;
179
180
  footerHeight: u.StatefulStream<number>;
181
+ scrollHeight: u.Stream<number>;
180
182
  smoothScrollTargetReached: u.Stream<true>;
181
183
  scrollTo: u.Stream<ScrollToOptions>;
182
184
  scrollBy: u.Stream<ScrollToOptions>;
183
- scrollDirection: u.StatefulStream<import("./domIOSystem").ScrollDirection>;
184
185
  statefulScrollTop: u.StatefulStream<number>;
185
186
  deviation: u.StatefulStream<number>;
186
187
  scrollingInProgress: u.StatefulStream<boolean>;
@@ -206,10 +207,10 @@ export declare const followOutputSystem: u.SystemSpec<[u.SystemSpec<[u.SystemSpe
206
207
  viewportHeight: u.Stream<number>;
207
208
  headerHeight: u.StatefulStream<number>;
208
209
  footerHeight: u.StatefulStream<number>;
210
+ scrollHeight: u.Stream<number>;
209
211
  smoothScrollTargetReached: u.Stream<true>;
210
212
  scrollTo: u.Stream<ScrollToOptions>;
211
213
  scrollBy: u.Stream<ScrollToOptions>;
212
- scrollDirection: u.StatefulStream<import("./domIOSystem").ScrollDirection>;
213
214
  statefulScrollTop: u.StatefulStream<number>;
214
215
  deviation: u.StatefulStream<number>;
215
216
  scrollingInProgress: u.StatefulStream<boolean>;
@@ -247,10 +248,10 @@ export declare const followOutputSystem: u.SystemSpec<[u.SystemSpec<[u.SystemSpe
247
248
  viewportHeight: u.Stream<number>;
248
249
  headerHeight: u.StatefulStream<number>;
249
250
  footerHeight: u.StatefulStream<number>;
251
+ scrollHeight: u.Stream<number>;
250
252
  smoothScrollTargetReached: u.Stream<true>;
251
253
  scrollTo: u.Stream<ScrollToOptions>;
252
254
  scrollBy: u.Stream<ScrollToOptions>;
253
- scrollDirection: u.StatefulStream<import("./domIOSystem").ScrollDirection>;
254
255
  statefulScrollTop: u.StatefulStream<number>;
255
256
  deviation: u.StatefulStream<number>;
256
257
  scrollingInProgress: u.StatefulStream<boolean>;
@@ -275,7 +276,19 @@ export declare const followOutputSystem: u.SystemSpec<[u.SystemSpec<[u.SystemSpe
275
276
  }>, u.SystemSpec<never[], () => {
276
277
  log: u.StatefulStream<import("./loggerSystem").Log>;
277
278
  logLevel: u.StatefulStream<LogLevel>;
278
- }>], ([{ totalCount, listRefresh }, { isAtBottom, atBottomState }, { scrollToIndex }, { scrolledToInitialItem }, { propsReady, didMount }, { log },]: [{
279
+ }>, u.SystemSpec<never[], () => {
280
+ scrollTop: u.Stream<number>;
281
+ viewportHeight: u.Stream<number>;
282
+ headerHeight: u.StatefulStream<number>;
283
+ footerHeight: u.StatefulStream<number>;
284
+ scrollHeight: u.Stream<number>;
285
+ smoothScrollTargetReached: u.Stream<true>;
286
+ scrollTo: u.Stream<ScrollToOptions>;
287
+ scrollBy: u.Stream<ScrollToOptions>;
288
+ statefulScrollTop: u.StatefulStream<number>;
289
+ deviation: u.StatefulStream<number>;
290
+ scrollingInProgress: u.StatefulStream<boolean>;
291
+ }>], ([{ totalCount, listRefresh }, { isAtBottom, atBottomState }, { scrollToIndex }, { scrolledToInitialItem }, { propsReady, didMount }, { log }, { scrollingInProgress },]: [{
279
292
  data: u.StatefulStream<import("./sizeSystem").Data>;
280
293
  totalCount: u.Stream<number>;
281
294
  sizeRanges: u.Stream<import("./sizeSystem").SizeRange[]>;
@@ -296,7 +309,8 @@ export declare const followOutputSystem: u.SystemSpec<[u.SystemSpec<[u.SystemSpe
296
309
  atBottomState: u.Stream<import("./stateFlagsSystem").AtBottomState>;
297
310
  atTopStateChange: u.Stream<boolean>;
298
311
  atBottomStateChange: u.Stream<boolean>;
299
- listStateListener: u.Stream<import("./stateFlagsSystem").ListBottomInfo>;
312
+ scrollDirection: u.StatefulStream<import("./stateFlagsSystem").ScrollDirection>;
313
+ atBottomThreshold: u.StatefulStream<number>;
300
314
  }, {
301
315
  scrollToIndex: u.Stream<import("./scrollToIndexSystem").IndexLocation>;
302
316
  topListHeight: u.StatefulStream<number>;
@@ -309,6 +323,18 @@ export declare const followOutputSystem: u.SystemSpec<[u.SystemSpec<[u.SystemSpe
309
323
  }, {
310
324
  log: u.StatefulStream<import("./loggerSystem").Log>;
311
325
  logLevel: u.StatefulStream<LogLevel>;
326
+ }, {
327
+ scrollTop: u.Stream<number>;
328
+ viewportHeight: u.Stream<number>;
329
+ headerHeight: u.StatefulStream<number>;
330
+ footerHeight: u.StatefulStream<number>;
331
+ scrollHeight: u.Stream<number>;
332
+ smoothScrollTargetReached: u.Stream<true>;
333
+ scrollTo: u.Stream<ScrollToOptions>;
334
+ scrollBy: u.Stream<ScrollToOptions>;
335
+ statefulScrollTop: u.StatefulStream<number>;
336
+ deviation: u.StatefulStream<number>;
337
+ scrollingInProgress: u.StatefulStream<boolean>;
312
338
  }]) => {
313
339
  followOutput: u.StatefulStream<FollowOutput>;
314
340
  }>;