@candidstartup/react-virtual-scroll 0.1.2 → 0.3.0

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.
package/README.md CHANGED
@@ -1,3 +1,8 @@
1
+ [![NPM Type Definitions](https://img.shields.io/npm/types/@candidstartup/react-virtual-scroll)](https://www.npmjs.com/package/@candidstartup/react-virtual-scroll)
2
+ [![NPM Version](https://img.shields.io/npm/v/@candidstartup/react-virtual-scroll)](https://www.npmjs.com/package/@candidstartup/react-virtual-scroll)
3
+ [![NPM bundle size](https://img.shields.io/bundlephobia/minzip/@candidstartup/react-virtual-scroll)](https://www.npmjs.com/package/@candidstartup/react-virtual-scroll)
4
+ [![Build Status](https://github.com/TheCandidStartup/infinisheet/actions/workflows/build.yml/badge.svg?event=push)](https://github.com/TheCandidStartup/infinisheet/actions/workflows/build.yml)
5
+
1
6
  # @candidstartup/react-virtual-scroll
2
7
 
3
8
  React virtual scrolling components for lists and grids following the same philosophy as [react-window](https://github.com/bvaughn/react-window). Written in TypeScript using modern React. Scalable to trillions of rows and columns.
@@ -18,23 +23,22 @@ Most of the logic is implemented by custom hooks that are used by both `VirtualL
18
23
  import { VirtualList, useVariableSizeItemOffsetMapping } from '@candidstartup/react-virtual-scroll';
19
24
 
20
25
  const mapping = useVariableSizeItemOffsetMapping(30, [50]);
26
+ const list = React.createRef();
21
27
 
22
- const Row = ({ index, isScrolling, style }) => (
23
- <div className={ index == 0 ? "header" : ( isScrolling ? "cellScroll" : "cell") } style={style}>
24
- { (index == 0) ? "Header" : "Item " + index }
25
- </div>
26
- );
28
+ ...
27
29
 
28
30
  <VirtualList
31
+ ref={list}
29
32
  height={240}
30
33
  itemCount={1000000000000}
31
34
  itemOffsetMapping={mapping}
32
- useIsScrolling={true}
33
35
  width={600}>
34
36
  {Row}
35
37
  </VirtualList>
36
38
  ```
37
39
 
40
+ Check out the [full sample](https://github.com/TheCandidStartup/infinisheet/tree/main/packages/react-virtual-scroll/sandboxes/trillion-row-list) or [try it out on CodeSandbox](https://codesandbox.io/p/sandbox/github/TheCandidStartup/infinisheet/main/packages/react-virtual-scroll/sandboxes/trillion-row-list?file=%2Findex.js)
41
+
38
42
  ## VirtualGrid Example
39
43
 
40
44
  ```jsx
@@ -42,13 +46,12 @@ import { VirtualList, useVariableSizeItemOffsetMapping, useFixedSizeItemOffsetMa
42
46
 
43
47
  const rowMapping = useVariableSizeItemOffsetMapping(30, [50]);
44
48
  const columnMapping = useFixedSizeItemOffsetMapping(280);
49
+ const grid = React.createRef();
45
50
 
46
- const Cell = ({ rowIndex, columnIndex, style }) => (
47
- <div className={ rowIndex == 0 ? "header" : "cell" } style={style}>
48
- { (rowIndex == 0) ? `${columnIndex}` : `${rowIndex}:${columnIndex}` }
49
- </div>
51
+ ...
50
52
 
51
53
  <VirtualGrid
54
+ ref={grid}
52
55
  height={240}
53
56
  rowCount={1000000000000}
54
57
  rowOffsetMapping={rowMapping}
@@ -59,6 +62,8 @@ const Cell = ({ rowIndex, columnIndex, style }) => (
59
62
  </VirtualGrid>
60
63
  ```
61
64
 
65
+ Check out the [full sample](https://github.com/TheCandidStartup/infinisheet/tree/main/packages/react-virtual-scroll/sandboxes/trillion-square-grid) or [try it out on CodeSandbox](https://codesandbox.io/p/sandbox/github/TheCandidStartup/infinisheet/main/packages/react-virtual-scroll/sandboxes/trillion-square-grid?file=%2Findex.js)
66
+
62
67
  # More
63
68
 
64
- Want to know more? Check out my [blog](https://www.thecandidstartup.org/topics/frontend.html)
69
+ Want to know more? Check out my [blog](https://www.thecandidstartup.org/topics/react-virtual-scroll.html)
package/dist/index.d.ts CHANGED
@@ -10,6 +10,8 @@ interface VirtualBaseProps {
10
10
  width: number;
11
11
  itemData?: any;
12
12
  useIsScrolling?: boolean;
13
+ maxCssSize?: number;
14
+ minNumPages?: number;
13
15
  }
14
16
  interface ItemOffsetMapping {
15
17
  itemSize(itemIndex: number): number;
@@ -17,6 +19,14 @@ interface ItemOffsetMapping {
17
19
  offsetToItem(offset: number): [itemIndex: number, startOffset: number];
18
20
  }
19
21
 
22
+ type ScrollDirection = "forward" | "backward";
23
+ interface ScrollState {
24
+ scrollOffset: number;
25
+ renderOffset: number;
26
+ page: number;
27
+ scrollDirection: ScrollDirection;
28
+ }
29
+
20
30
  interface VirtualGridItemProps extends VirtualBaseItemProps {
21
31
  rowIndex: number;
22
32
  columnIndex: number;
@@ -29,6 +39,7 @@ interface VirtualGridProps extends VirtualBaseProps {
29
39
  columnCount: number;
30
40
  columnOffsetMapping: ItemOffsetMapping;
31
41
  itemKey?: (rowIndex: number, columnIndex: number, data: any) => any;
42
+ onScroll?: (rowOffset: number, columnOffset: number, newRowScrollState: ScrollState, newColumnScrollState: ScrollState) => void;
32
43
  }
33
44
  interface VirtualGridProxy {
34
45
  scrollTo(rowOffset: number, columnOffset: number): void;
@@ -36,6 +47,7 @@ interface VirtualGridProxy {
36
47
  }
37
48
  declare const VirtualGrid: React.ForwardRefExoticComponent<VirtualGridProps & React.RefAttributes<VirtualGridProxy>>;
38
49
 
50
+ type ScrollLayout = "horizontal" | "vertical";
39
51
  interface VirtualListItemProps extends VirtualBaseItemProps {
40
52
  index: number;
41
53
  }
@@ -45,6 +57,8 @@ interface VirtualListProps extends VirtualBaseProps {
45
57
  itemCount: number;
46
58
  itemOffsetMapping: ItemOffsetMapping;
47
59
  itemKey?: (index: number, data: any) => any;
60
+ layout?: ScrollLayout;
61
+ onScroll?: (offset: number, newScrollState: ScrollState) => void;
48
62
  }
49
63
  interface VirtualListProxy {
50
64
  scrollTo(offset: number): void;
@@ -71,4 +85,4 @@ declare class VariableSizeItemOffsetMapping implements ItemOffsetMapping {
71
85
  }
72
86
  declare function useVariableSizeItemOffsetMapping(defaultItemSize: number, sizes?: number[]): VariableSizeItemOffsetMapping;
73
87
 
74
- export { VirtualGrid, type VirtualGridItemProps, type VirtualGridProps, type VirtualGridProxy, VirtualList, type VirtualListItemProps, type VirtualListProps, type VirtualListProxy, useFixedSizeItemOffsetMapping, useVariableSizeItemOffsetMapping };
88
+ export { type ScrollLayout, type ScrollState, VirtualGrid, type VirtualGridItemProps, type VirtualGridProps, type VirtualGridProxy, VirtualList, type VirtualListItemProps, type VirtualListProps, type VirtualListProxy, useFixedSizeItemOffsetMapping, useVariableSizeItemOffsetMapping };
package/dist/index.js CHANGED
@@ -36,17 +36,17 @@ function getRangeToRender(itemCount, itemOffsetMapping, clientExtent, scrollOffs
36
36
  // I prefer simplicity of same behavior across all browsers.
37
37
  const MAX_SUPPORTED_CSS_SIZE = 6000000;
38
38
  const MIN_NUMBER_PAGES = 100;
39
- function useVirtualScroll(totalSize) {
39
+ function useVirtualScroll(totalSize, maxCssSize = MAX_SUPPORTED_CSS_SIZE, minNumberPages = MIN_NUMBER_PAGES) {
40
40
  let renderSize = 0, pageSize = 0, numPages = 0;
41
- if (totalSize < MAX_SUPPORTED_CSS_SIZE) {
41
+ if (totalSize < maxCssSize) {
42
42
  // No paging needed
43
43
  renderSize = pageSize = totalSize;
44
44
  numPages = 1;
45
45
  }
46
46
  else {
47
47
  // Break into pages
48
- renderSize = MAX_SUPPORTED_CSS_SIZE;
49
- pageSize = renderSize / MIN_NUMBER_PAGES;
48
+ renderSize = maxCssSize;
49
+ pageSize = renderSize / minNumberPages;
50
50
  numPages = Math.floor(totalSize / pageSize);
51
51
  }
52
52
  function pageToRenderOffset(page) {
@@ -66,7 +66,7 @@ function useVirtualScroll(totalSize) {
66
66
  function onScroll(clientExtent, scrollExtent, scrollOffset) {
67
67
  if (scrollState.scrollOffset == scrollOffset) {
68
68
  // No need to change state if scroll position unchanged
69
- return scrollOffset;
69
+ return [scrollOffset, scrollState];
70
70
  }
71
71
  // Prevent Safari's elastic scrolling from causing visual shaking when scrolling past bounds.
72
72
  let newOffset = Math.max(0, Math.min(scrollOffset, scrollExtent - clientExtent));
@@ -102,8 +102,9 @@ function useVirtualScroll(totalSize) {
102
102
  }
103
103
  newRenderOffset = pageToRenderOffset(newPage);
104
104
  }
105
- setScrollState({ scrollOffset: newOffset, renderOffset: newRenderOffset, page: newPage, scrollDirection: newScrollDirection });
106
- return retScrollOffset;
105
+ const newScrollState = { scrollOffset: newOffset, renderOffset: newRenderOffset, page: newPage, scrollDirection: newScrollDirection };
106
+ setScrollState(newScrollState);
107
+ return [retScrollOffset, newScrollState];
107
108
  }
108
109
  function doScrollTo(offset, clientExtent) {
109
110
  const safeOffset = Math.min(totalSize - clientExtent, Math.max(offset, 0));
@@ -208,13 +209,13 @@ function useIsScrolling(element = window) {
208
209
  const defaultItemKey$1 = (rowIndex, columnIndex, _data) => `${rowIndex}:${columnIndex}`;
209
210
  // Using a named function rather than => so that the name shows up in React Developer Tools
210
211
  const VirtualGrid = React.forwardRef(function VirtualGrid(props, ref) {
211
- const { width, height, rowCount, rowOffsetMapping, columnCount, columnOffsetMapping, children, itemData = undefined, itemKey = defaultItemKey$1, useIsScrolling: useIsScrolling$1 = false } = props;
212
+ const { width, height, rowCount, rowOffsetMapping, columnCount, columnOffsetMapping, children, itemData = undefined, itemKey = defaultItemKey$1, onScroll: onScrollCallback, useIsScrolling: useIsScrolling$1 = false } = props;
212
213
  // Total size is same as offset to item one off the end
213
214
  const totalRowSize = rowOffsetMapping.itemOffset(rowCount);
214
215
  const totalColumnSize = columnOffsetMapping.itemOffset(columnCount);
215
216
  const outerRef = React.useRef(null);
216
- const { scrollOffset: scrollRowOffset, renderOffset: renderRowOffset, renderSize: renderRowSize, onScroll: onScrollRow, doScrollTo: doScrollToRow } = useVirtualScroll(totalRowSize);
217
- const { scrollOffset: scrollColumnOffset, renderOffset: renderColumnOffset, renderSize: renderColumnSize, onScroll: onScrollColumn, doScrollTo: doScrollToColumn } = useVirtualScroll(totalColumnSize);
217
+ const { scrollOffset: scrollRowOffset, renderOffset: renderRowOffset, renderSize: renderRowSize, onScroll: onScrollRow, doScrollTo: doScrollToRow } = useVirtualScroll(totalRowSize, props.maxCssSize, props.minNumPages);
218
+ const { scrollOffset: scrollColumnOffset, renderOffset: renderColumnOffset, renderSize: renderColumnSize, onScroll: onScrollColumn, doScrollTo: doScrollToColumn } = useVirtualScroll(totalColumnSize, props.maxCssSize, props.minNumPages);
218
219
  const isScrolling = useIsScrolling(outerRef);
219
220
  React.useImperativeHandle(ref, () => {
220
221
  return {
@@ -228,13 +229,14 @@ const VirtualGrid = React.forwardRef(function VirtualGrid(props, ref) {
228
229
  this.scrollTo(rowOffsetMapping.itemOffset(rowIndex), columnOffsetMapping.itemOffset(columnIndex));
229
230
  }
230
231
  };
231
- }, [rowOffsetMapping, columnOffsetMapping]);
232
+ }, [rowOffsetMapping, columnOffsetMapping, doScrollToRow, doScrollToColumn]);
232
233
  function onScroll(event) {
233
234
  const { clientWidth, clientHeight, scrollWidth, scrollHeight, scrollLeft, scrollTop } = event.currentTarget;
234
- const newScrollTop = onScrollRow(clientHeight, scrollHeight, scrollTop);
235
- const newScrollLeft = onScrollColumn(clientWidth, scrollWidth, scrollLeft);
235
+ const [newScrollTop, newRowScrollState] = onScrollRow(clientHeight, scrollHeight, scrollTop);
236
+ const [newScrollLeft, newColumnScrollState] = onScrollColumn(clientWidth, scrollWidth, scrollLeft);
236
237
  if (outerRef.current && (newScrollTop != scrollTop || newScrollLeft != scrollLeft))
237
238
  outerRef.current.scrollTo(newScrollLeft, newScrollTop);
239
+ onScrollCallback?.(newRowScrollState.scrollOffset + newRowScrollState.renderOffset, newColumnScrollState.scrollOffset + newColumnScrollState.renderOffset, newRowScrollState, newColumnScrollState);
238
240
  }
239
241
  const [startRowIndex, startRowOffset, rowSizes] = getRangeToRender(rowCount, rowOffsetMapping, height, scrollRowOffset + renderRowOffset);
240
242
  const [startColumnIndex, startColumnOffset, columnSizes] = getRangeToRender(columnCount, columnOffsetMapping, width, scrollColumnOffset + renderColumnOffset);
@@ -260,32 +262,47 @@ const VirtualGrid = React.forwardRef(function VirtualGrid(props, ref) {
260
262
  const defaultItemKey = (index, _data) => index;
261
263
  // Using a named function rather than => so that the name shows up in React Developer Tools
262
264
  const VirtualList = React.forwardRef(function VirtualList(props, ref) {
263
- const { width, height, itemCount, itemOffsetMapping, children, itemData = undefined, itemKey = defaultItemKey, useIsScrolling: useIsScrolling$1 = false } = props;
265
+ const { width, height, itemCount, itemOffsetMapping, children, itemData = undefined, itemKey = defaultItemKey, layout = 'vertical', onScroll: onScrollCallback, useIsScrolling: useIsScrolling$1 = false } = props;
264
266
  // Total size is same as offset to item one off the end
265
267
  const totalSize = itemOffsetMapping.itemOffset(itemCount);
266
268
  const outerRef = React.useRef(null);
267
- const { scrollOffset, renderOffset, renderSize, onScroll: onScrollExtent, doScrollTo } = useVirtualScroll(totalSize);
269
+ const { scrollOffset, renderOffset, renderSize, onScroll: onScrollExtent, doScrollTo } = useVirtualScroll(totalSize, props.maxCssSize, props.minNumPages);
268
270
  const isScrolling = useIsScrolling(outerRef);
271
+ const isVertical = layout === 'vertical';
269
272
  React.useImperativeHandle(ref, () => {
270
273
  return {
271
274
  scrollTo(offset) {
272
275
  const outer = outerRef.current;
273
276
  /* istanbul ignore else */
274
- if (outer)
275
- outer.scrollTo(0, doScrollTo(offset, outer.clientHeight));
277
+ if (outer) {
278
+ if (isVertical)
279
+ outer.scrollTo(0, doScrollTo(offset, outer.clientHeight));
280
+ else
281
+ outer.scrollTo(doScrollTo(offset, outer.clientWidth), 0);
282
+ }
276
283
  },
277
284
  scrollToItem(index) {
278
285
  this.scrollTo(itemOffsetMapping.itemOffset(index));
279
286
  }
280
287
  };
281
- }, [itemOffsetMapping]);
288
+ }, [itemOffsetMapping, isVertical, doScrollTo]);
282
289
  function onScroll(event) {
283
- const { clientHeight, scrollHeight, scrollTop, scrollLeft } = event.currentTarget;
284
- const newScrollTop = onScrollExtent(clientHeight, scrollHeight, scrollTop);
285
- if (newScrollTop != scrollTop && outerRef.current)
286
- outerRef.current.scrollTo(scrollLeft, newScrollTop);
290
+ if (isVertical) {
291
+ const { clientHeight, scrollHeight, scrollTop, scrollLeft } = event.currentTarget;
292
+ const [newScrollTop, newScrollState] = onScrollExtent(clientHeight, scrollHeight, scrollTop);
293
+ if (newScrollTop != scrollTop && outerRef.current)
294
+ outerRef.current.scrollTo(scrollLeft, newScrollTop);
295
+ onScrollCallback?.(newScrollState.scrollOffset + newScrollState.renderOffset, newScrollState);
296
+ }
297
+ else {
298
+ const { clientWidth, scrollWidth, scrollTop, scrollLeft } = event.currentTarget;
299
+ const [newScrollLeft, newScrollState] = onScrollExtent(clientWidth, scrollWidth, scrollLeft);
300
+ if (newScrollLeft != scrollLeft && outerRef.current)
301
+ outerRef.current.scrollTo(newScrollLeft, scrollTop);
302
+ onScrollCallback?.(newScrollState.scrollOffset + newScrollState.renderOffset, newScrollState);
303
+ }
287
304
  }
288
- const [startIndex, startOffset, sizes] = getRangeToRender(itemCount, itemOffsetMapping, height, scrollOffset + renderOffset);
305
+ const [startIndex, startOffset, sizes] = getRangeToRender(itemCount, itemOffsetMapping, isVertical ? height : width, scrollOffset + renderOffset);
289
306
  // We can decide the JSX child type at runtime as long as we use a variable that uses the same capitalized
290
307
  // naming convention as components do.
291
308
  const ChildVar = children;
@@ -294,10 +311,16 @@ const VirtualList = React.forwardRef(function VirtualList(props, ref) {
294
311
  // returns the result of the final statement which makes the iteration a little clumsier.
295
312
  let nextOffset = startOffset - renderOffset;
296
313
  let index, offset;
297
- return (jsx("div", { onScroll: onScroll, ref: outerRef, style: { position: "relative", height, width, overflow: "auto", willChange: "transform" }, children: jsx("div", { style: { height: renderSize, width: "100%" }, children: sizes.map((size, arrayIndex) => (offset = nextOffset,
314
+ return (jsx("div", { onScroll: onScroll, ref: outerRef, style: { position: "relative", height, width, overflow: "auto", willChange: "transform" }, children: jsx("div", { style: { height: isVertical ? renderSize : "100%", width: isVertical ? "100%" : renderSize }, children: sizes.map((size, arrayIndex) => (offset = nextOffset,
298
315
  nextOffset += size,
299
316
  index = startIndex + arrayIndex,
300
- jsx(ChildVar, { data: itemData, index: index, isScrolling: useIsScrolling$1 ? isScrolling : undefined, style: { position: "absolute", top: offset, height: size, width: "100%" } }, itemKey(index, itemData)))) }) }));
317
+ jsx(ChildVar, { data: itemData, index: index, isScrolling: useIsScrolling$1 ? isScrolling : undefined, style: {
318
+ position: "absolute",
319
+ top: isVertical ? offset : undefined,
320
+ left: isVertical ? undefined : offset,
321
+ height: isVertical ? size : "100%",
322
+ width: isVertical ? "100%" : size,
323
+ } }, itemKey(index, itemData)))) }) }));
301
324
  });
302
325
 
303
326
  class FixedSizeItemOffsetMapping {
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../src/VirtualBase.ts","../src/useVirtualScroll.ts","../src/useEventListener.ts","../src/useAnimationTimeout.ts","../src/useIsScrolling.ts","../src/VirtualGrid.tsx","../src/VirtualList.tsx","../src/useFixedSizeItemOffsetMapping.ts","../src/useVariableSizeItemOffsetMapping.ts"],"sourcesContent":["\nexport interface VirtualBaseItemProps {\n data: any,\n isScrolling?: boolean,\n style: Object,\n};\n\nexport interface VirtualBaseProps {\n height: number,\n width: number,\n itemData?: any,\n useIsScrolling?: boolean,\n};\n\nexport interface ItemOffsetMapping {\n itemSize(itemIndex: number): number;\n itemOffset(itemIndex: number): number;\n offsetToItem(offset: number): [itemIndex: number, startOffset: number];\n};\n\nexport type ScrollEvent = React.SyntheticEvent<HTMLDivElement>;\n\ntype RangeToRender = [\n startIndex: number,\n startOffset: number,\n sizes: number[]\n];\n\nexport function getRangeToRender(itemCount: number, itemOffsetMapping: ItemOffsetMapping, clientExtent: number, scrollOffset: number): RangeToRender {\n if (itemCount == 0) {\n return [0, 0, []];\n }\n\n var [itemIndex, startOffset] = itemOffsetMapping.offsetToItem(scrollOffset);\n itemIndex = Math.max(0, Math.min(itemCount - 1, itemIndex));\n var endOffset = scrollOffset + clientExtent;\n\n const overscanBackward = 1;\n const overscanForward = 1;\n\n for (let step = 0; step < overscanBackward && itemIndex > 0; step ++) {\n itemIndex --;\n startOffset -= itemOffsetMapping.itemSize(itemIndex);\n }\n\n const startIndex = itemIndex;\n var offset = startOffset;\n const sizes: number[] = [];\n\n while (offset < endOffset && itemIndex < itemCount) {\n const size = itemOffsetMapping.itemSize(itemIndex);\n sizes.push(size);\n offset += size;\n itemIndex ++;\n }\n\n for (let step = 0; step < overscanForward && itemIndex < itemCount; step ++) {\n const size = itemOffsetMapping.itemSize(itemIndex);\n sizes.push(size);\n itemIndex ++;\n }\n\n return [startIndex, startOffset, sizes];\n}\n","import { useState } from \"react\";\n\nexport type ScrollLayout = \"horizontal\" | \"vertical\";\nexport type ScrollDirection = \"forward\" | \"backward\";\nexport interface ScrollState { \n scrollOffset: number, \n renderOffset: number,\n page: number, \n scrollDirection: ScrollDirection, \n};\n\nexport interface VirtualScroll extends ScrollState {\n renderSize: number;\n\n // Returns updated scrollOffset. Caller should update scroll bar position if different from value passed in. \n onScroll(clientExtent: number, scrollExtent: number, scrollOffset: number): number;\n\n // Scroll to offset in logical space returning offset to update scroll bar position to\n doScrollTo(offset: number, clientExtent: number): number;\n};\n\n// Max size that is safe across all browsers (Firefox is the limiting factor)\n// SlickGrid tries to dynamically determine limit on other browsers (Chrome will do 30M) but\n// I prefer simplicity of same behavior across all browsers.\nconst MAX_SUPPORTED_CSS_SIZE = 6000000;\nconst MIN_NUMBER_PAGES = 100;\n\nexport function useVirtualScroll(totalSize: number): VirtualScroll {\n let renderSize=0, pageSize=0, numPages=0;\n if (totalSize < MAX_SUPPORTED_CSS_SIZE) {\n // No paging needed\n renderSize = pageSize = totalSize;\n numPages = 1;\n } else {\n // Break into pages\n renderSize = MAX_SUPPORTED_CSS_SIZE;\n pageSize = renderSize / MIN_NUMBER_PAGES;\n numPages = Math.floor(totalSize / pageSize);\n }\n\n function pageToRenderOffset(page: number): number {\n if (page <= 0)\n return 0;\n\n if (page >= numPages-1)\n return totalSize - renderSize;\n\n return Math.round((page-1) * (totalSize - renderSize) / (numPages - 3));\n }\n\n const initValue: ScrollState = { \n scrollOffset: 0, \n renderOffset: 0,\n page: 0,\n scrollDirection: \"forward\",\n };\n const [scrollState, setScrollState] = useState(initValue);\n\n function onScroll(clientExtent: number, scrollExtent: number, scrollOffset: number) {\n if (scrollState.scrollOffset == scrollOffset) {\n // No need to change state if scroll position unchanged\n return scrollOffset;\n }\n\n // Prevent Safari's elastic scrolling from causing visual shaking when scrolling past bounds.\n let newOffset = Math.max(0, Math.min(scrollOffset, scrollExtent - clientExtent));\n const newScrollDirection = scrollState.scrollOffset <= newOffset ? 'forward' : 'backward';\n\n // Switch pages if needed\n let newPage, newRenderOffset;\n let retScrollOffset = scrollOffset;\n const scrollDist = Math.abs(newOffset - scrollState.scrollOffset);\n if (scrollDist < clientExtent) {\n // Scrolling part of visible window, don't want to skip items, so can't scale up movement\n // If we cross page boundary we need to reset scroll bar position back to where it should be at start of page\n newPage = Math.min(numPages - 1, Math.floor((scrollOffset + scrollState.renderOffset) / pageSize));\n newRenderOffset = pageToRenderOffset(newPage);\n if (newPage != scrollState.page) {\n // Be very intentional about when we ask caller to reset scroll bar\n // Don't want to trigger event loops\n newOffset = scrollOffset + scrollState.renderOffset - newRenderOffset;\n retScrollOffset = newOffset;\n }\n } else {\n // Large scale scrolling, choosing page from a rolodex\n // First and last page are mapped 1:1 between grid and container\n if (newOffset < pageSize) {\n newPage = 0;\n } else if (newOffset >= renderSize - pageSize) {\n newPage = numPages - 1;\n } else {\n const scaleFactor = (totalSize - pageSize*2) / (renderSize - pageSize*2);\n newPage = Math.min(numPages - 3, Math.floor((newOffset - pageSize) * scaleFactor / pageSize)) + 1;\n }\n newRenderOffset = pageToRenderOffset(newPage);\n }\n\n setScrollState({ scrollOffset: newOffset, renderOffset: newRenderOffset, page: newPage, scrollDirection: newScrollDirection });\n return retScrollOffset;\n }\n\n function doScrollTo(offset: number, clientExtent: number) {\n const safeOffset = Math.min(totalSize - clientExtent, Math.max(offset, 0));\n const scrollDirection = (scrollState.scrollOffset + scrollState.renderOffset) <= safeOffset ? 'forward' : 'backward';\n const page = Math.min(numPages - 1, Math.floor(safeOffset / pageSize));\n const renderOffset = pageToRenderOffset(page);\n const scrollOffset = safeOffset - renderOffset;\n\n setScrollState({ scrollOffset, renderOffset, page, scrollDirection });\n return scrollOffset;\n }\n\n return {...scrollState, renderSize, onScroll, doScrollTo} as const;\n}\n\nexport default useVirtualScroll;\n","// Based on https://github.com/realwugang/use-event-listener\n// and https://github.com/donavon/use-event-listener/blob/develop/src/index.js\n\nimport { useRef, useEffect, RefObject, createRef } from 'react';\n\ninterface Options {\n capture?: boolean\n once?: boolean\n passive?: boolean\n};\n\ntype Listener = Window | Document | HTMLElement;\n\nfunction isListener(element: Listener | RefObject<HTMLElement>): element is Listener {\n return (element as Listener).addEventListener !== undefined;\n}\n\nexport function useEventListener (eventName: string, \n handler: (event: Event) => void, \n element: Listener | RefObject<HTMLElement> | null = window, \n options: Options = {}) {\n const savedHandler = useRef<any>();\n const { capture, passive, once } = options;\n\n useEffect(() => {\n savedHandler.current = handler\n }, [handler])\n\n useEffect(() => {\n if (!element)\n return;\n\n const el = isListener(element) ? element : element.current;\n if (!el)\n return;\n\n const eventListener = (event: Event) => savedHandler.current(event);\n const opts = { capture, passive, once };\n el.addEventListener(eventName, eventListener, opts);\n return () => {\n el.removeEventListener(eventName, eventListener, opts);\n };\n }, [eventName, element, capture, passive, once]);\n}\n\nexport default useEventListener;\n\n// In-source testing for private helper functions\nif (import.meta.vitest) {\n const { it, expect } = import.meta.vitest\n it('isListener', () => {\n expect(isListener(window)).toBe(true)\n expect(isListener(document)).toBe(true)\n expect(isListener(document.createElement(\"div\"))).toBe(true)\n expect(isListener(createRef())).toBe(false)\n })\n}","// Based on https://overreacted.io/making-setinterval-declarative-with-react-hooks/\n// and https://www.joshwcomeau.com/snippets/react-hooks/use-timeout/\n// and https://github.com/bvaughn/react-window/blob/master/src/timer.js\n//\n// Equivalent functionality to a useTimeout hook but based on requestAnimationFrame instead of setTimeout. Use\n// when making frequent requests for short duration timeouts where browser may throttle setTimeout.\nimport { useEffect, useRef } from 'react';\n\ntype Callback = () => void;\n\nexport function useAnimationTimeout(callback: Callback, delay: number | null, key?: unknown) {\n const requestRef = useRef<number>();\n const savedCallback = useRef<Callback>(callback);\n\n // Remember the latest callback\n useEffect(() => {\n savedCallback.current = callback;\n }, [callback]);\n \n const start = performance.now();\n \n useEffect(() => {\n function tick() {\n requestRef.current = undefined;\n if (delay === null)\n return;\n\n if (performance.now() - start >= delay) {\n savedCallback.current();\n } else {\n requestRef.current = requestAnimationFrame(tick);\n }\n }\n\n tick();\n\n return () => {\n if (typeof requestRef.current === 'number') {\n cancelAnimationFrame(requestRef.current);\n requestRef.current = undefined;\n }\n }\n }, [delay, key]);\n}\n\nexport default useAnimationTimeout;","import { useState, RefObject } from \"react\";\nimport { useEventListener } from './useEventListener';\nimport { useAnimationTimeout } from './useAnimationTimeout';\n\nconst DEBOUNCE_INTERVAL = 150;\nconst FALLBACK_INTERVAL = 500;\n\nexport function useIsScrolling(element: Window | HTMLElement | RefObject<HTMLElement> | null = window): boolean {\n const [scrollCount, setScrollCount] = useState(0);\n\n // scrollend implementations in both Chrome and Firefox are buggy with missing scrollend events\n // in some circumstances (using keyboard to scroll past end in Chrome, intermittently when using mouse wheel in Firefox)\n // Use a timeout even when scrollend is supported to handle missing events. In this case we use a longer interval as\n // don't want it to be over sensitive. \n const supportsScrollEnd = ('onscrollend' in window);\n const delay = supportsScrollEnd ? FALLBACK_INTERVAL : DEBOUNCE_INTERVAL;\n\n useEventListener(\"scroll\", () => setScrollCount(c => c + 1), element);\n useEventListener(\"scrollend\", () => setScrollCount(0), supportsScrollEnd ? element : null);\n useAnimationTimeout(() => setScrollCount(0), (scrollCount == 0) ? null : delay, scrollCount);\n\n return scrollCount > 0;\n}\n\nexport default useIsScrolling;","import React from \"react\";\nimport { Fragment } from \"react\";\nimport { ItemOffsetMapping, getRangeToRender, VirtualBaseItemProps, VirtualBaseProps, ScrollEvent } from './VirtualBase';\nimport { useVirtualScroll } from './useVirtualScroll';\nimport { useIsScrolling as useIsScrollingHook} from './useIsScrolling';\n\nexport interface VirtualGridItemProps extends VirtualBaseItemProps {\n rowIndex: number,\n columnIndex: number,\n};\n\ntype VirtualGridItem = React.ComponentType<VirtualGridItemProps>;\n\nexport interface VirtualGridProps extends VirtualBaseProps {\n children: VirtualGridItem,\n rowCount: number,\n rowOffsetMapping: ItemOffsetMapping,\n columnCount: number,\n columnOffsetMapping: ItemOffsetMapping,\n itemKey?: (rowIndex: number, columnIndex: number, data: any) => any,\n};\n\nexport interface VirtualGridProxy {\n scrollTo(rowOffset: number, columnOffset: number): void;\n scrollToItem(rowIndex: number, columnIndex: number): void;\n};\n\nconst defaultItemKey = (rowIndex: number, columnIndex: number, _data: any) => `${rowIndex}:${columnIndex}`;\n\n// Using a named function rather than => so that the name shows up in React Developer Tools\nexport const VirtualGrid = React.forwardRef<VirtualGridProxy, VirtualGridProps>(function VirtualGrid(props, ref) {\n const { width, height, rowCount, rowOffsetMapping, columnCount, columnOffsetMapping, children, \n itemData = undefined, itemKey = defaultItemKey, useIsScrolling = false } = props;\n\n // Total size is same as offset to item one off the end\n const totalRowSize = rowOffsetMapping.itemOffset(rowCount);\n const totalColumnSize = columnOffsetMapping.itemOffset(columnCount);\n\n const outerRef = React.useRef<HTMLDivElement>(null);\n const { scrollOffset: scrollRowOffset, renderOffset: renderRowOffset, renderSize: renderRowSize,\n onScroll: onScrollRow, doScrollTo: doScrollToRow } = useVirtualScroll(totalRowSize);\n const { scrollOffset: scrollColumnOffset, renderOffset: renderColumnOffset, renderSize: renderColumnSize,\n onScroll: onScrollColumn, doScrollTo: doScrollToColumn} = useVirtualScroll(totalColumnSize);\n const isScrolling = useIsScrollingHook(outerRef); \n\n React.useImperativeHandle(ref, () => {\n return {\n scrollTo(rowOffset: number, columnOffset: number): void {\n const outer = outerRef.current;\n /* istanbul ignore else */\n if (outer)\n outer.scrollTo(doScrollToColumn(columnOffset, outer.clientWidth), doScrollToRow(rowOffset, outer.clientHeight));\n },\n\n scrollToItem(rowIndex: number, columnIndex: number): void {\n this.scrollTo(rowOffsetMapping.itemOffset(rowIndex), columnOffsetMapping.itemOffset(columnIndex));\n }\n }\n }, [ rowOffsetMapping, columnOffsetMapping ]);\n\n\n function onScroll(event: ScrollEvent) {\n const { clientWidth, clientHeight, scrollWidth, scrollHeight, scrollLeft, scrollTop } = event.currentTarget;\n const newScrollTop = onScrollRow(clientHeight, scrollHeight, scrollTop);\n const newScrollLeft = onScrollColumn(clientWidth, scrollWidth, scrollLeft);\n if (outerRef.current && (newScrollTop != scrollTop || newScrollLeft != scrollLeft ))\n outerRef.current.scrollTo(newScrollLeft, newScrollTop);\n }\n\n const [startRowIndex, startRowOffset, rowSizes] = \n getRangeToRender(rowCount, rowOffsetMapping, height, scrollRowOffset + renderRowOffset);\n const [startColumnIndex, startColumnOffset, columnSizes] = \n getRangeToRender(columnCount, columnOffsetMapping, width, scrollColumnOffset + renderColumnOffset);\n\n // We can decide the JSX child type at runtime as long as we use a variable that uses the same capitalized\n // naming convention as components do. \n const ChildVar = children;\n\n // Being far too clever. Implementing a complex iteration in JSX in a map expression by abusing the comma operator. \n // You can't declare local variables in an expression so they need to be hoisted out of the JSX. The comma operator\n // returns the result of the final statement which makes the iteration a little clumsier.\n let nextRowOffset = startRowOffset - renderRowOffset;\n let rowIndex=0, rowOffset=0;\n let nextColumnOffset=0, columnIndex=0, columnOffset=0;\n\n return (\n <div onScroll={onScroll} ref={outerRef} style={{ position: \"relative\", height, width, overflow: \"auto\", willChange: \"transform\" }}>\n <div style={{ height: renderRowSize, width: renderColumnSize }}>\n {rowSizes.map((rowSize, rowArrayIndex) => (\n rowOffset = nextRowOffset,\n nextRowOffset += rowSize,\n rowIndex = startRowIndex + rowArrayIndex,\n nextColumnOffset = startColumnOffset - renderColumnOffset,\n <Fragment key={itemKey(rowIndex, 0, itemData)}>\n {columnSizes.map((columnSize, columnArrayIndex) => (\n columnOffset = nextColumnOffset,\n nextColumnOffset += columnSize,\n columnIndex = startColumnIndex + columnArrayIndex,\n <ChildVar data={itemData} key={itemKey(rowIndex, columnIndex, itemData)}\n rowIndex={rowIndex} columnIndex={columnIndex}\n isScrolling={useIsScrolling ? isScrolling : undefined}\n style={{ position: \"absolute\", top: rowOffset, height: rowSize, left: columnOffset, width: columnSize }}/>\n ))}\n </Fragment>\n ))}\n </div>\n </div>\n );\n});\n\nexport default VirtualGrid;\n","import React from \"react\";\nimport { ItemOffsetMapping, getRangeToRender, VirtualBaseItemProps, VirtualBaseProps, ScrollEvent } from './VirtualBase';\nimport { useVirtualScroll } from './useVirtualScroll';\nimport { useIsScrolling as useIsScrollingHook} from './useIsScrolling';\n\nexport interface VirtualListItemProps extends VirtualBaseItemProps {\n index: number,\n};\n\ntype VirtualListItem = React.ComponentType<VirtualListItemProps>;\n\nexport interface VirtualListProps extends VirtualBaseProps {\n children: VirtualListItem,\n itemCount: number,\n itemOffsetMapping: ItemOffsetMapping,\n itemKey?: (index: number, data: any) => any,\n};\n\nexport interface VirtualListProxy {\n scrollTo(offset: number): void;\n scrollToItem(index: number): void;\n};\n\nconst defaultItemKey = (index: number, _data: any) => index;\n\n// Using a named function rather than => so that the name shows up in React Developer Tools\nexport const VirtualList = React.forwardRef<VirtualListProxy, VirtualListProps>(function VirtualList(props, ref) {\n const { width, height, itemCount, itemOffsetMapping, children, \n itemData = undefined, itemKey = defaultItemKey, useIsScrolling = false } = props;\n\n // Total size is same as offset to item one off the end\n const totalSize = itemOffsetMapping.itemOffset(itemCount);\n\n const outerRef = React.useRef<HTMLDivElement>(null);\n const { scrollOffset, renderOffset, renderSize, onScroll: onScrollExtent, doScrollTo } = useVirtualScroll(totalSize);\n const isScrolling = useIsScrollingHook(outerRef); \n\n React.useImperativeHandle(ref, () => {\n return {\n scrollTo(offset: number): void {\n const outer = outerRef.current;\n /* istanbul ignore else */\n if (outer)\n outer.scrollTo(0, doScrollTo(offset, outer.clientHeight));\n },\n\n scrollToItem(index: number): void {\n this.scrollTo(itemOffsetMapping.itemOffset(index));\n }\n }\n }, [ itemOffsetMapping ]);\n\n function onScroll(event: ScrollEvent) {\n const { clientHeight, scrollHeight, scrollTop, scrollLeft } = event.currentTarget;\n const newScrollTop = onScrollExtent(clientHeight, scrollHeight, scrollTop);\n if (newScrollTop != scrollTop && outerRef.current)\n outerRef.current.scrollTo(scrollLeft, newScrollTop);\n }\n\n const [startIndex, startOffset, sizes] = getRangeToRender(itemCount, itemOffsetMapping, height, scrollOffset+renderOffset);\n\n // We can decide the JSX child type at runtime as long as we use a variable that uses the same capitalized\n // naming convention as components do. \n const ChildVar = children;\n\n // Being far too clever. Implementing a complex iteration in JSX in a map expression by abusing the comma operator. \n // You can't declare local variables in an expression so they need to be hoisted out of the JSX. The comma operator\n // returns the result of the final statement which makes the iteration a little clumsier.\n let nextOffset = startOffset - renderOffset;\n let index, offset;\n\n return (\n <div onScroll={onScroll} ref={outerRef} style={{ position: \"relative\", height, width, overflow: \"auto\", willChange: \"transform\" }}>\n <div style={{ height: renderSize, width: \"100%\" }}>\n {sizes.map((size, arrayIndex) => (\n offset = nextOffset,\n nextOffset += size,\n index = startIndex + arrayIndex,\n <ChildVar data={itemData} key={itemKey(index, itemData)} index={index}\n isScrolling={useIsScrolling ? isScrolling : undefined}\n style={{ position: \"absolute\", top: offset, height: size, width: \"100%\" }}/>\n ))}\n </div>\n </div>\n );\n});\n\nexport default VirtualList;\n","import { ItemOffsetMapping } from './VirtualBase';\n\nclass FixedSizeItemOffsetMapping implements ItemOffsetMapping {\n constructor (itemSize: number) {\n this.fixedItemSize = itemSize;\n }\n\n itemSize(_itemIndex: number): number {\n return this.fixedItemSize;\n }\n\n itemOffset(itemIndex: number): number {\n return itemIndex * this.fixedItemSize;\n }\n\n offsetToItem(offset: number): [itemIndex: number, startOffset: number] {\n const itemIndex = Math.floor(offset / this.fixedItemSize);\n const startOffset = itemIndex * this.fixedItemSize;\n\n return [itemIndex, startOffset];\n }\n\n fixedItemSize: number;\n};\n\nexport function useFixedSizeItemOffsetMapping(itemSize: number) {\n return new FixedSizeItemOffsetMapping(itemSize);\n};\n\nexport default useFixedSizeItemOffsetMapping;\n","import { ItemOffsetMapping } from './VirtualBase';\n\nclass VariableSizeItemOffsetMapping implements ItemOffsetMapping {\n constructor (defaultItemSize: number, sizes: number[]) {\n this.defaultItemSize = defaultItemSize;\n this.sizes = sizes;\n }\n\n itemSize(itemIndex: number): number {\n return (itemIndex < this.sizes.length) ? this.sizes[itemIndex] : this.defaultItemSize;\n }\n\n itemOffset(itemIndex: number): number {\n var offset = 0;\n let length = this.sizes.length;\n if (itemIndex > length) {\n const numDefaultSize = itemIndex - length;\n offset = numDefaultSize * this.defaultItemSize;\n } else {\n length = itemIndex;\n }\n \n for (let i = 0; i < length; i ++)\n {\n offset += this.sizes[i];\n }\n\n return offset;\n }\n\n offsetToItem(offset: number): [itemIndex: number, startOffset: number] {\n var startOffset = 0;\n const length = this.sizes.length;\n for (let i = 0; i < length; i ++) {\n const size = this.sizes[i];\n if (startOffset + size > offset) {\n return [i, startOffset];\n }\n startOffset += size;\n }\n\n const itemIndex = Math.floor((offset - startOffset) / this.defaultItemSize);\n startOffset += itemIndex * this.defaultItemSize;\n\n return [itemIndex+length, startOffset];\n }\n\n defaultItemSize: number;\n sizes: number[];\n};\n\nexport function useVariableSizeItemOffsetMapping(defaultItemSize: number, sizes?: number[]) {\n return new VariableSizeItemOffsetMapping(defaultItemSize, sizes || []);\n};\n\nexport default useVariableSizeItemOffsetMapping;"],"names":["defaultItemKey","useIsScrolling","useIsScrollingHook","_jsx"],"mappings":";;;AA4BM,SAAU,gBAAgB,CAAC,SAAiB,EAAE,iBAAoC,EAAE,YAAoB,EAAE,YAAoB,EAAA;AAClI,IAAA,IAAI,SAAS,IAAI,CAAC,EAAE;AAClB,QAAA,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;KACnB;AAED,IAAA,IAAI,CAAC,SAAS,EAAE,WAAW,CAAC,GAAG,iBAAiB,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;AAC5E,IAAA,SAAS,GAAG,I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AAI,CAAC;SACrB;AAED,QAAA,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,GAAG,WAAW,IAAI,IAAI,CAAC,eAAe,CAAC,CAAC;AAC5E,QAAA,WAAW,IAAI,SAAS,GAAG,IAAI,CAAC,eAAe,CAAC;AAEhD,QAAA,OAAO,CAAC,SAAS,GAAC,MAAM,EAAE,WAAW,CAAC,CAAC;KACxC;AAIF,CAAA;AAEe,SAAA,gCAAgC,CAAC,eAAuB,EAAE,KAAgB,EAAA;IACxF,OAAO,IAAI,6BAA6B,CAAC,eAAe,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC;AACzE;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../src/VirtualBase.ts","../src/useVirtualScroll.ts","../src/useEventListener.ts","../src/useAnimationTimeout.ts","../src/useIsScrolling.ts","../src/VirtualGrid.tsx","../src/VirtualList.tsx","../src/useFixedSizeItemOffsetMapping.ts","../src/useVariableSizeItemOffsetMapping.ts"],"sourcesContent":["\nexport interface VirtualBaseItemProps {\n data: any,\n isScrolling?: boolean,\n style: Object,\n};\n\nexport interface VirtualBaseProps {\n height: number,\n width: number,\n itemData?: any,\n useIsScrolling?: boolean,\n maxCssSize?: number,\n minNumPages?: number\n};\n\nexport interface ItemOffsetMapping {\n itemSize(itemIndex: number): number;\n itemOffset(itemIndex: number): number;\n offsetToItem(offset: number): [itemIndex: number, startOffset: number];\n};\n\nexport type ScrollEvent = React.SyntheticEvent<HTMLDivElement>;\n\ntype RangeToRender = [\n startIndex: number,\n startOffset: number,\n sizes: number[]\n];\n\nexport function getRangeToRender(itemCount: number, itemOffsetMapping: ItemOffsetMapping, clientExtent: number, scrollOffset: number): RangeToRender {\n if (itemCount == 0) {\n return [0, 0, []];\n }\n\n var [itemIndex, startOffset] = itemOffsetMapping.offsetToItem(scrollOffset);\n itemIndex = Math.max(0, Math.min(itemCount - 1, itemIndex));\n var endOffset = scrollOffset + clientExtent;\n\n const overscanBackward = 1;\n const overscanForward = 1;\n\n for (let step = 0; step < overscanBackward && itemIndex > 0; step ++) {\n itemIndex --;\n startOffset -= itemOffsetMapping.itemSize(itemIndex);\n }\n\n const startIndex = itemIndex;\n var offset = startOffset;\n const sizes: number[] = [];\n\n while (offset < endOffset && itemIndex < itemCount) {\n const size = itemOffsetMapping.itemSize(itemIndex);\n sizes.push(size);\n offset += size;\n itemIndex ++;\n }\n\n for (let step = 0; step < overscanForward && itemIndex < itemCount; step ++) {\n const size = itemOffsetMapping.itemSize(itemIndex);\n sizes.push(size);\n itemIndex ++;\n }\n\n return [startIndex, startOffset, sizes];\n}\n","import { useState } from \"react\";\n\nexport type ScrollDirection = \"forward\" | \"backward\";\nexport interface ScrollState { \n scrollOffset: number, \n renderOffset: number,\n page: number, \n scrollDirection: ScrollDirection, \n};\n\nexport interface VirtualScroll extends ScrollState {\n renderSize: number;\n\n // Returns updated scrollOffset. Caller should update scroll bar position if different from value passed in. \n onScroll(clientExtent: number, scrollExtent: number, scrollOffset: number): [number, ScrollState];\n\n // Scroll to offset in logical space returning offset to update scroll bar position to\n doScrollTo(offset: number, clientExtent: number): number;\n};\n\n// Max size that is safe across all browsers (Firefox is the limiting factor)\n// SlickGrid tries to dynamically determine limit on other browsers (Chrome will do 30M) but\n// I prefer simplicity of same behavior across all browsers.\nconst MAX_SUPPORTED_CSS_SIZE = 6000000;\nconst MIN_NUMBER_PAGES = 100;\n\nexport function useVirtualScroll(totalSize: number, maxCssSize = MAX_SUPPORTED_CSS_SIZE, minNumberPages = MIN_NUMBER_PAGES): VirtualScroll {\n let renderSize=0, pageSize=0, numPages=0;\n if (totalSize < maxCssSize) {\n // No paging needed\n renderSize = pageSize = totalSize;\n numPages = 1;\n } else {\n // Break into pages\n renderSize = maxCssSize;\n pageSize = renderSize / minNumberPages;\n numPages = Math.floor(totalSize / pageSize);\n }\n\n function pageToRenderOffset(page: number): number {\n if (page <= 0)\n return 0;\n\n if (page >= numPages-1)\n return totalSize - renderSize;\n\n return Math.round((page-1) * (totalSize - renderSize) / (numPages - 3));\n }\n\n const initValue: ScrollState = { \n scrollOffset: 0, \n renderOffset: 0,\n page: 0,\n scrollDirection: \"forward\",\n };\n const [scrollState, setScrollState] = useState(initValue);\n\n function onScroll(clientExtent: number, scrollExtent: number, scrollOffset: number): [number, ScrollState] {\n if (scrollState.scrollOffset == scrollOffset) {\n // No need to change state if scroll position unchanged\n return [scrollOffset, scrollState];\n }\n\n // Prevent Safari's elastic scrolling from causing visual shaking when scrolling past bounds.\n let newOffset = Math.max(0, Math.min(scrollOffset, scrollExtent - clientExtent));\n const newScrollDirection = scrollState.scrollOffset <= newOffset ? 'forward' : 'backward';\n\n // Switch pages if needed\n let newPage, newRenderOffset;\n let retScrollOffset = scrollOffset;\n const scrollDist = Math.abs(newOffset - scrollState.scrollOffset);\n if (scrollDist < clientExtent) {\n // Scrolling part of visible window, don't want to skip items, so can't scale up movement\n // If we cross page boundary we need to reset scroll bar position back to where it should be at start of page\n newPage = Math.min(numPages - 1, Math.floor((scrollOffset + scrollState.renderOffset) / pageSize));\n newRenderOffset = pageToRenderOffset(newPage);\n if (newPage != scrollState.page) {\n // Be very intentional about when we ask caller to reset scroll bar\n // Don't want to trigger event loops\n newOffset = scrollOffset + scrollState.renderOffset - newRenderOffset;\n retScrollOffset = newOffset;\n }\n } else {\n // Large scale scrolling, choosing page from a rolodex\n // First and last page are mapped 1:1 between grid and container\n if (newOffset < pageSize) {\n newPage = 0;\n } else if (newOffset >= renderSize - pageSize) {\n newPage = numPages - 1;\n } else {\n const scaleFactor = (totalSize - pageSize*2) / (renderSize - pageSize*2);\n newPage = Math.min(numPages - 3, Math.floor((newOffset - pageSize) * scaleFactor / pageSize)) + 1;\n }\n newRenderOffset = pageToRenderOffset(newPage);\n }\n\n const newScrollState: ScrollState = \n { scrollOffset: newOffset, renderOffset: newRenderOffset, page: newPage, scrollDirection: newScrollDirection };\n setScrollState(newScrollState);\n return [retScrollOffset, newScrollState];\n }\n\n function doScrollTo(offset: number, clientExtent: number) {\n const safeOffset = Math.min(totalSize - clientExtent, Math.max(offset, 0));\n const scrollDirection = (scrollState.scrollOffset + scrollState.renderOffset) <= safeOffset ? 'forward' : 'backward';\n const page = Math.min(numPages - 1, Math.floor(safeOffset / pageSize));\n const renderOffset = pageToRenderOffset(page);\n const scrollOffset = safeOffset - renderOffset;\n\n setScrollState({ scrollOffset, renderOffset, page, scrollDirection });\n return scrollOffset;\n }\n\n return {...scrollState, renderSize, onScroll, doScrollTo} as const;\n}\n\nexport default useVirtualScroll;\n","// Based on https://github.com/realwugang/use-event-listener\n// and https://github.com/donavon/use-event-listener/blob/develop/src/index.js\n\nimport { useRef, useEffect, RefObject, createRef } from 'react';\n\ninterface Options {\n capture?: boolean\n once?: boolean\n passive?: boolean\n};\n\ntype Listener = Window | Document | HTMLElement;\n\nfunction isListener(element: Listener | RefObject<HTMLElement>): element is Listener {\n return (element as Listener).addEventListener !== undefined;\n}\n\nexport function useEventListener (eventName: string, \n handler: (event: Event) => void, \n element: Listener | RefObject<HTMLElement> | null = window, \n options: Options = {}) {\n const savedHandler = useRef<any>();\n const { capture, passive, once } = options;\n\n useEffect(() => {\n savedHandler.current = handler\n }, [handler])\n\n useEffect(() => {\n if (!element)\n return;\n\n const el = isListener(element) ? element : element.current;\n if (!el)\n return;\n\n const eventListener = (event: Event) => savedHandler.current(event);\n const opts = { capture, passive, once };\n el.addEventListener(eventName, eventListener, opts);\n return () => {\n el.removeEventListener(eventName, eventListener, opts);\n };\n }, [eventName, element, capture, passive, once]);\n}\n\nexport default useEventListener;\n\n// In-source testing for private helper functions\nif (import.meta.vitest) {\n const { it, expect } = import.meta.vitest\n it('isListener', () => {\n expect(isListener(window)).toBe(true)\n expect(isListener(document)).toBe(true)\n expect(isListener(document.createElement(\"div\"))).toBe(true)\n expect(isListener(createRef())).toBe(false)\n })\n}","// Based on https://overreacted.io/making-setinterval-declarative-with-react-hooks/\n// and https://www.joshwcomeau.com/snippets/react-hooks/use-timeout/\n// and https://github.com/bvaughn/react-window/blob/master/src/timer.js\n//\n// Equivalent functionality to a useTimeout hook but based on requestAnimationFrame instead of setTimeout. Use\n// when making frequent requests for short duration timeouts where browser may throttle setTimeout.\nimport { useEffect, useRef } from 'react';\n\ntype Callback = () => void;\n\nexport function useAnimationTimeout(callback: Callback, delay: number | null, key?: unknown) {\n const requestRef = useRef<number>();\n const savedCallback = useRef<Callback>(callback);\n\n // Remember the latest callback\n useEffect(() => {\n savedCallback.current = callback;\n }, [callback]);\n \n const start = performance.now();\n \n useEffect(() => {\n function tick() {\n requestRef.current = undefined;\n if (delay === null)\n return;\n\n if (performance.now() - start >= delay) {\n savedCallback.current();\n } else {\n requestRef.current = requestAnimationFrame(tick);\n }\n }\n\n tick();\n\n return () => {\n if (typeof requestRef.current === 'number') {\n cancelAnimationFrame(requestRef.current);\n requestRef.current = undefined;\n }\n }\n }, [delay, key]);\n}\n\nexport default useAnimationTimeout;","import { useState, RefObject } from \"react\";\nimport { useEventListener } from './useEventListener';\nimport { useAnimationTimeout } from './useAnimationTimeout';\n\nconst DEBOUNCE_INTERVAL = 150;\nconst FALLBACK_INTERVAL = 500;\n\nexport function useIsScrolling(element: Window | HTMLElement | RefObject<HTMLElement> | null = window): boolean {\n const [scrollCount, setScrollCount] = useState(0);\n\n // scrollend implementations in both Chrome and Firefox are buggy with missing scrollend events\n // in some circumstances (using keyboard to scroll past end in Chrome, intermittently when using mouse wheel in Firefox)\n // Use a timeout even when scrollend is supported to handle missing events. In this case we use a longer interval as\n // don't want it to be over sensitive. \n const supportsScrollEnd = ('onscrollend' in window);\n const delay = supportsScrollEnd ? FALLBACK_INTERVAL : DEBOUNCE_INTERVAL;\n\n useEventListener(\"scroll\", () => setScrollCount(c => c + 1), element);\n useEventListener(\"scrollend\", () => setScrollCount(0), supportsScrollEnd ? element : null);\n useAnimationTimeout(() => setScrollCount(0), (scrollCount == 0) ? null : delay, scrollCount);\n\n return scrollCount > 0;\n}\n\nexport default useIsScrolling;","import React from \"react\";\nimport { Fragment } from \"react\";\nimport { ItemOffsetMapping, getRangeToRender, VirtualBaseItemProps, VirtualBaseProps, ScrollEvent } from './VirtualBase';\nimport { useVirtualScroll, ScrollState } from './useVirtualScroll';\nexport type { ScrollState } from './useVirtualScroll';\nimport { useIsScrolling as useIsScrollingHook} from './useIsScrolling';\n\nexport interface VirtualGridItemProps extends VirtualBaseItemProps {\n rowIndex: number,\n columnIndex: number,\n};\n\ntype VirtualGridItem = React.ComponentType<VirtualGridItemProps>;\n\nexport interface VirtualGridProps extends VirtualBaseProps {\n children: VirtualGridItem,\n rowCount: number,\n rowOffsetMapping: ItemOffsetMapping,\n columnCount: number,\n columnOffsetMapping: ItemOffsetMapping,\n itemKey?: (rowIndex: number, columnIndex: number, data: any) => any,\n onScroll?: (rowOffset: number, columnOffset: number, newRowScrollState: ScrollState, newColumnScrollState: ScrollState) => void;\n};\n\nexport interface VirtualGridProxy {\n scrollTo(rowOffset: number, columnOffset: number): void;\n scrollToItem(rowIndex: number, columnIndex: number): void;\n};\n\nconst defaultItemKey = (rowIndex: number, columnIndex: number, _data: any) => `${rowIndex}:${columnIndex}`;\n\n// Using a named function rather than => so that the name shows up in React Developer Tools\nexport const VirtualGrid = React.forwardRef<VirtualGridProxy, VirtualGridProps>(function VirtualGrid(props, ref) {\n const { width, height, rowCount, rowOffsetMapping, columnCount, columnOffsetMapping, children, \n itemData = undefined, itemKey = defaultItemKey, onScroll: onScrollCallback, useIsScrolling = false } = props;\n\n // Total size is same as offset to item one off the end\n const totalRowSize = rowOffsetMapping.itemOffset(rowCount);\n const totalColumnSize = columnOffsetMapping.itemOffset(columnCount);\n\n const outerRef = React.useRef<HTMLDivElement>(null);\n const { scrollOffset: scrollRowOffset, renderOffset: renderRowOffset, renderSize: renderRowSize,\n onScroll: onScrollRow, doScrollTo: doScrollToRow } = useVirtualScroll(totalRowSize, props.maxCssSize, props.minNumPages);\n const { scrollOffset: scrollColumnOffset, renderOffset: renderColumnOffset, renderSize: renderColumnSize,\n onScroll: onScrollColumn, doScrollTo: doScrollToColumn} = useVirtualScroll(totalColumnSize, props.maxCssSize, props.minNumPages);\n const isScrolling = useIsScrollingHook(outerRef); \n\n React.useImperativeHandle(ref, () => {\n return {\n scrollTo(rowOffset: number, columnOffset: number): void {\n const outer = outerRef.current;\n /* istanbul ignore else */\n if (outer)\n outer.scrollTo(doScrollToColumn(columnOffset, outer.clientWidth), doScrollToRow(rowOffset, outer.clientHeight));\n },\n\n scrollToItem(rowIndex: number, columnIndex: number): void {\n this.scrollTo(rowOffsetMapping.itemOffset(rowIndex), columnOffsetMapping.itemOffset(columnIndex));\n }\n }\n }, [ rowOffsetMapping, columnOffsetMapping, doScrollToRow, doScrollToColumn ]);\n\n\n function onScroll(event: ScrollEvent) {\n const { clientWidth, clientHeight, scrollWidth, scrollHeight, scrollLeft, scrollTop } = event.currentTarget;\n const [newScrollTop, newRowScrollState] = onScrollRow(clientHeight, scrollHeight, scrollTop);\n const [newScrollLeft, newColumnScrollState] = onScrollColumn(clientWidth, scrollWidth, scrollLeft);\n if (outerRef.current && (newScrollTop != scrollTop || newScrollLeft != scrollLeft ))\n outerRef.current.scrollTo(newScrollLeft, newScrollTop);\n onScrollCallback?.(newRowScrollState.scrollOffset+newRowScrollState.renderOffset, \n newColumnScrollState.scrollOffset+newColumnScrollState.renderOffset, newRowScrollState, newColumnScrollState);\n }\n\n const [startRowIndex, startRowOffset, rowSizes] = \n getRangeToRender(rowCount, rowOffsetMapping, height, scrollRowOffset + renderRowOffset);\n const [startColumnIndex, startColumnOffset, columnSizes] = \n getRangeToRender(columnCount, columnOffsetMapping, width, scrollColumnOffset + renderColumnOffset);\n\n // We can decide the JSX child type at runtime as long as we use a variable that uses the same capitalized\n // naming convention as components do. \n const ChildVar = children;\n\n // Being far too clever. Implementing a complex iteration in JSX in a map expression by abusing the comma operator. \n // You can't declare local variables in an expression so they need to be hoisted out of the JSX. The comma operator\n // returns the result of the final statement which makes the iteration a little clumsier.\n let nextRowOffset = startRowOffset - renderRowOffset;\n let rowIndex=0, rowOffset=0;\n let nextColumnOffset=0, columnIndex=0, columnOffset=0;\n\n return (\n <div onScroll={onScroll} ref={outerRef} style={{ position: \"relative\", height, width, overflow: \"auto\", willChange: \"transform\" }}>\n <div style={{ height: renderRowSize, width: renderColumnSize }}>\n {rowSizes.map((rowSize, rowArrayIndex) => (\n rowOffset = nextRowOffset,\n nextRowOffset += rowSize,\n rowIndex = startRowIndex + rowArrayIndex,\n nextColumnOffset = startColumnOffset - renderColumnOffset,\n <Fragment key={itemKey(rowIndex, 0, itemData)}>\n {columnSizes.map((columnSize, columnArrayIndex) => (\n columnOffset = nextColumnOffset,\n nextColumnOffset += columnSize,\n columnIndex = startColumnIndex + columnArrayIndex,\n <ChildVar data={itemData} key={itemKey(rowIndex, columnIndex, itemData)}\n rowIndex={rowIndex} columnIndex={columnIndex}\n isScrolling={useIsScrolling ? isScrolling : undefined}\n style={{ position: \"absolute\", top: rowOffset, height: rowSize, left: columnOffset, width: columnSize }}/>\n ))}\n </Fragment>\n ))}\n </div>\n </div>\n );\n});\n\nexport default VirtualGrid;\n","import React from \"react\";\nimport { ItemOffsetMapping, getRangeToRender, VirtualBaseItemProps, VirtualBaseProps, ScrollEvent } from './VirtualBase';\nimport { useVirtualScroll, ScrollState } from './useVirtualScroll';\nexport type { ScrollState } from './useVirtualScroll';\nimport { useIsScrolling as useIsScrollingHook} from './useIsScrolling';\n\nexport type ScrollLayout = \"horizontal\" | \"vertical\";\n\nexport interface VirtualListItemProps extends VirtualBaseItemProps {\n index: number,\n};\n\ntype VirtualListItem = React.ComponentType<VirtualListItemProps>;\n\nexport interface VirtualListProps extends VirtualBaseProps {\n children: VirtualListItem,\n itemCount: number,\n itemOffsetMapping: ItemOffsetMapping,\n itemKey?: (index: number, data: any) => any,\n layout?: ScrollLayout,\n onScroll?: (offset: number, newScrollState: ScrollState) => void;\n};\n\nexport interface VirtualListProxy {\n scrollTo(offset: number): void;\n scrollToItem(index: number): void;\n};\n\nconst defaultItemKey = (index: number, _data: any) => index;\n\n// Using a named function rather than => so that the name shows up in React Developer Tools\nexport const VirtualList = React.forwardRef<VirtualListProxy, VirtualListProps>(function VirtualList(props, ref) {\n const { width, height, itemCount, itemOffsetMapping, children, \n itemData = undefined, itemKey = defaultItemKey, layout = 'vertical', onScroll: onScrollCallback, useIsScrolling = false } = props;\n\n // Total size is same as offset to item one off the end\n const totalSize = itemOffsetMapping.itemOffset(itemCount);\n\n const outerRef = React.useRef<HTMLDivElement>(null);\n const { scrollOffset, renderOffset, renderSize, onScroll: onScrollExtent, doScrollTo } = \n useVirtualScroll(totalSize, props.maxCssSize, props.minNumPages);\n const isScrolling = useIsScrollingHook(outerRef); \n const isVertical = layout === 'vertical';\n\n React.useImperativeHandle(ref, () => {\n return {\n scrollTo(offset: number): void {\n const outer = outerRef.current;\n /* istanbul ignore else */\n if (outer) {\n if (isVertical)\n outer.scrollTo(0, doScrollTo(offset, outer.clientHeight));\n else\n outer.scrollTo(doScrollTo(offset, outer.clientWidth), 0);\n }\n },\n\n scrollToItem(index: number): void {\n this.scrollTo(itemOffsetMapping.itemOffset(index));\n }\n }\n }, [ itemOffsetMapping, isVertical, doScrollTo ]);\n\n function onScroll(event: ScrollEvent) {\n if (isVertical) {\n const { clientHeight, scrollHeight, scrollTop, scrollLeft } = event.currentTarget;\n const [newScrollTop, newScrollState] = onScrollExtent(clientHeight, scrollHeight, scrollTop);\n if (newScrollTop != scrollTop && outerRef.current)\n outerRef.current.scrollTo(scrollLeft, newScrollTop);\n onScrollCallback?.(newScrollState.scrollOffset+newScrollState.renderOffset, newScrollState);\n } else {\n const { clientWidth, scrollWidth, scrollTop, scrollLeft } = event.currentTarget;\n const [newScrollLeft, newScrollState] = onScrollExtent(clientWidth, scrollWidth, scrollLeft);\n if (newScrollLeft != scrollLeft && outerRef.current)\n outerRef.current.scrollTo(newScrollLeft, scrollTop);\n onScrollCallback?.(newScrollState.scrollOffset+newScrollState.renderOffset, newScrollState);\n }\n }\n\n const [startIndex, startOffset, sizes] = getRangeToRender(itemCount, itemOffsetMapping, \n isVertical ? height : width, scrollOffset+renderOffset);\n\n // We can decide the JSX child type at runtime as long as we use a variable that uses the same capitalized\n // naming convention as components do. \n const ChildVar = children;\n\n // Being far too clever. Implementing a complex iteration in JSX in a map expression by abusing the comma operator. \n // You can't declare local variables in an expression so they need to be hoisted out of the JSX. The comma operator\n // returns the result of the final statement which makes the iteration a little clumsier.\n let nextOffset = startOffset - renderOffset;\n let index, offset;\n\n return (\n <div onScroll={onScroll} ref={outerRef} style={{ position: \"relative\", height, width, overflow: \"auto\", willChange: \"transform\" }}>\n <div style={{ height: isVertical ? renderSize : \"100%\", width: isVertical ? \"100%\" : renderSize }}>\n {sizes.map((size, arrayIndex) => (\n offset = nextOffset,\n nextOffset += size,\n index = startIndex + arrayIndex,\n <ChildVar data={itemData} key={itemKey(index, itemData)} index={index}\n isScrolling={useIsScrolling ? isScrolling : undefined}\n style={{ \n position: \"absolute\", \n top: isVertical ? offset : undefined, \n left: isVertical ? undefined : offset,\n height: isVertical ? size : \"100%\", \n width: isVertical ? \"100%\" : size, \n }}/>\n ))}\n </div>\n </div>\n );\n});\n\nexport default VirtualList;\n","import { ItemOffsetMapping } from './VirtualBase';\n\nclass FixedSizeItemOffsetMapping implements ItemOffsetMapping {\n constructor (itemSize: number) {\n this.fixedItemSize = itemSize;\n }\n\n itemSize(_itemIndex: number): number {\n return this.fixedItemSize;\n }\n\n itemOffset(itemIndex: number): number {\n return itemIndex * this.fixedItemSize;\n }\n\n offsetToItem(offset: number): [itemIndex: number, startOffset: number] {\n const itemIndex = Math.floor(offset / this.fixedItemSize);\n const startOffset = itemIndex * this.fixedItemSize;\n\n return [itemIndex, startOffset];\n }\n\n fixedItemSize: number;\n};\n\nexport function useFixedSizeItemOffsetMapping(itemSize: number) {\n return new FixedSizeItemOffsetMapping(itemSize);\n};\n\nexport default useFixedSizeItemOffsetMapping;\n","import { ItemOffsetMapping } from './VirtualBase';\n\nclass VariableSizeItemOffsetMapping implements ItemOffsetMapping {\n constructor (defaultItemSize: number, sizes: number[]) {\n this.defaultItemSize = defaultItemSize;\n this.sizes = sizes;\n }\n\n itemSize(itemIndex: number): number {\n return (itemIndex < this.sizes.length) ? this.sizes[itemIndex] : this.defaultItemSize;\n }\n\n itemOffset(itemIndex: number): number {\n var offset = 0;\n let length = this.sizes.length;\n if (itemIndex > length) {\n const numDefaultSize = itemIndex - length;\n offset = numDefaultSize * this.defaultItemSize;\n } else {\n length = itemIndex;\n }\n \n for (let i = 0; i < length; i ++)\n {\n offset += this.sizes[i];\n }\n\n return offset;\n }\n\n offsetToItem(offset: number): [itemIndex: number, startOffset: number] {\n var startOffset = 0;\n const length = this.sizes.length;\n for (let i = 0; i < length; i ++) {\n const size = this.sizes[i];\n if (startOffset + size > offset) {\n return [i, startOffset];\n }\n startOffset += size;\n }\n\n const itemIndex = Math.floor((offset - startOffset) / this.defaultItemSize);\n startOffset += itemIndex * this.defaultItemSize;\n\n return [itemIndex+length, startOffset];\n }\n\n defaultItemSize: number;\n sizes: number[];\n};\n\nexport function useVariableSizeItemOffsetMapping(defaultItemSize: number, sizes?: number[]) {\n return new VariableSizeItemOffsetMapping(defaultItemSize, sizes || []);\n};\n\nexport default useVariableSizeItemOffsetMapping;"],"names":["defaultItemKey","useIsScrolling","useIsScrollingHook","_jsx"],"mappings":";;;AA8BM,SAAU,gBAAgB,CAAC,SAAiB,EAAE,iBAAoC,EAAE,YAAoB,EAAE,YAAoB,EAAA;AAClI,IAAA,IAAI,SAAS,IAAI,CAAC,EAAE;AAClB,QAAA,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;KACnB;AAED,IAAA,IAAI,CAAC,SAAS,EAAE,WAAW,CAAC,GAAG,iBAAiB,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;AAC5E,IAAA,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,SA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C;AACpB,QAAA,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;AACjC,QAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAG,EAAE;YAChC,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAC3B,YAAA,IAAI,WAAW,GAAG,IAAI,GAAG,MAAM,EAAE;AAC/B,gBAAA,OAAO,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC;aACzB;YACD,WAAW,IAAI,IAAI,CAAC;SACrB;AAED,QAAA,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,GAAG,WAAW,IAAI,IAAI,CAAC,eAAe,CAAC,CAAC;AAC5E,QAAA,WAAW,IAAI,SAAS,GAAG,IAAI,CAAC,eAAe,CAAC;AAEhD,QAAA,OAAO,CAAC,SAAS,GAAC,MAAM,EAAE,WAAW,CAAC,CAAC;KACxC;AAIF,CAAA;AAEe,SAAA,gCAAgC,CAAC,eAAuB,EAAE,KAAgB,EAAA;IACxF,OAAO,IAAI,6BAA6B,CAAC,eAAe,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC;AACzE;;;;"}
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@candidstartup/react-virtual-scroll",
3
3
  "private": false,
4
- "version": "0.1.2",
4
+ "version": "0.3.0",
5
5
  "description": "Modern React components for lists and grids that scale to trillions of rows and columns",
6
6
  "author": "Tim Wiegand <tim.wiegand@thecandidstartup.org>",
7
7
  "license": "BSD-3-Clause",
8
8
  "repository": {
9
9
  "type": "git",
10
- "url": "https://github.com/TheCandidStartup/infinisheet.git",
10
+ "url": "git+https://github.com/TheCandidStartup/infinisheet.git",
11
11
  "directory": "packages/react-virtual-scroll"
12
12
  },
13
13
  "bugs": "https://github.com/TheCandidStartup/infinisheet/issues",
@@ -55,6 +55,5 @@
55
55
  },
56
56
  "peerDependencies": {
57
57
  "react": "^18.2.0"
58
- },
59
- "gitHead": "6da532a5d4365d69dfafb2dffa0dc4b82a89064b"
58
+ }
60
59
  }
package/LICENSE DELETED
@@ -1,29 +0,0 @@
1
- BSD 3-Clause License
2
-
3
- Copyright (c) 2022, Tim Wiegand
4
- All rights reserved.
5
-
6
- Redistribution and use in source and binary forms, with or without
7
- modification, are permitted provided that the following conditions are met:
8
-
9
- 1. Redistributions of source code must retain the above copyright notice, this
10
- list of conditions and the following disclaimer.
11
-
12
- 2. Redistributions in binary form must reproduce the above copyright notice,
13
- this list of conditions and the following disclaimer in the documentation
14
- and/or other materials provided with the distribution.
15
-
16
- 3. Neither the name of the copyright holder nor the names of its
17
- contributors may be used to endorse or promote products derived from
18
- this software without specific prior written permission.
19
-
20
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.