@difizen/libro-virtualized 0.1.2

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 (132) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +0 -0
  3. package/es/auto-sizer/auto-sizer.d.ts +56 -0
  4. package/es/auto-sizer/auto-sizer.d.ts.map +1 -0
  5. package/es/auto-sizer/auto-sizer.js +157 -0
  6. package/es/auto-sizer/index.d.ts +3 -0
  7. package/es/auto-sizer/index.d.ts.map +1 -0
  8. package/es/auto-sizer/index.js +2 -0
  9. package/es/cell-measurer/cell-measurer-cache.d.ts +52 -0
  10. package/es/cell-measurer/cell-measurer-cache.d.ts.map +1 -0
  11. package/es/cell-measurer/cell-measurer-cache.js +176 -0
  12. package/es/cell-measurer/cell-measurer.d.ts +39 -0
  13. package/es/cell-measurer/cell-measurer.d.ts.map +1 -0
  14. package/es/cell-measurer/cell-measurer.js +154 -0
  15. package/es/cell-measurer/index.d.ts +5 -0
  16. package/es/cell-measurer/index.d.ts.map +1 -0
  17. package/es/cell-measurer/index.js +4 -0
  18. package/es/cell-measurer/types.d.ts +9 -0
  19. package/es/cell-measurer/types.d.ts.map +1 -0
  20. package/es/cell-measurer/types.js +0 -0
  21. package/es/grid/accessibility-overscanIndices-getter.d.ts +11 -0
  22. package/es/grid/accessibility-overscanIndices-getter.d.ts.map +1 -0
  23. package/es/grid/accessibility-overscanIndices-getter.js +33 -0
  24. package/es/grid/default-cell-range-renderer.d.ts +10 -0
  25. package/es/grid/default-cell-range-renderer.d.ts.map +1 -0
  26. package/es/grid/default-cell-range-renderer.js +135 -0
  27. package/es/grid/default-overscanIndices-getter.d.ts +11 -0
  28. package/es/grid/default-overscanIndices-getter.d.ts.map +1 -0
  29. package/es/grid/default-overscanIndices-getter.js +28 -0
  30. package/es/grid/grid.d.ts +359 -0
  31. package/es/grid/grid.d.ts.map +1 -0
  32. package/es/grid/grid.js +1287 -0
  33. package/es/grid/index.d.ts +6 -0
  34. package/es/grid/index.d.ts.map +1 -0
  35. package/es/grid/index.js +4 -0
  36. package/es/grid/types.d.ts +87 -0
  37. package/es/grid/types.d.ts.map +1 -0
  38. package/es/grid/types.js +1 -0
  39. package/es/grid/utils/calculate-size-and-position-data-and-update-scroll-offset.d.ts +17 -0
  40. package/es/grid/utils/calculate-size-and-position-data-and-update-scroll-offset.d.ts.map +1 -0
  41. package/es/grid/utils/calculate-size-and-position-data-and-update-scroll-offset.js +25 -0
  42. package/es/grid/utils/cell-size-and-position-manager-row.d.ts +97 -0
  43. package/es/grid/utils/cell-size-and-position-manager-row.d.ts.map +1 -0
  44. package/es/grid/utils/cell-size-and-position-manager-row.js +297 -0
  45. package/es/grid/utils/cell-size-and-position-manager.d.ts +85 -0
  46. package/es/grid/utils/cell-size-and-position-manager.d.ts.map +1 -0
  47. package/es/grid/utils/cell-size-and-position-manager.js +268 -0
  48. package/es/grid/utils/max-element-size.d.ts +2 -0
  49. package/es/grid/utils/max-element-size.d.ts.map +1 -0
  50. package/es/grid/utils/max-element-size.js +17 -0
  51. package/es/grid/utils/scaling-cell-size-and-position-manager-row.d.ts +78 -0
  52. package/es/grid/utils/scaling-cell-size-and-position-manager-row.d.ts.map +1 -0
  53. package/es/grid/utils/scaling-cell-size-and-position-manager-row.js +187 -0
  54. package/es/grid/utils/scaling-cell-size-and-position-manager.d.ts +70 -0
  55. package/es/grid/utils/scaling-cell-size-and-position-manager.d.ts.map +1 -0
  56. package/es/grid/utils/scaling-cell-size-and-position-manager.js +187 -0
  57. package/es/grid/utils/update-scroll-index-helper.d.ts +24 -0
  58. package/es/grid/utils/update-scroll-index-helper.d.ts.map +1 -0
  59. package/es/grid/utils/update-scroll-index-helper.js +40 -0
  60. package/es/index.d.ts +5 -0
  61. package/es/index.d.ts.map +1 -0
  62. package/es/index.js +4 -0
  63. package/es/list/index.d.ts +3 -0
  64. package/es/list/index.d.ts.map +1 -0
  65. package/es/list/index.js +1 -0
  66. package/es/list/list.d.ts +109 -0
  67. package/es/list/list.d.ts.map +1 -0
  68. package/es/list/list.js +261 -0
  69. package/es/list/types.d.ts +22 -0
  70. package/es/list/types.d.ts.map +1 -0
  71. package/es/list/types.js +1 -0
  72. package/es/utils/animation-frame.d.ts +7 -0
  73. package/es/utils/animation-frame.d.ts.map +1 -0
  74. package/es/utils/animation-frame.js +20 -0
  75. package/es/utils/create-callback-memoizer.d.ts +5 -0
  76. package/es/utils/create-callback-memoizer.d.ts.map +1 -0
  77. package/es/utils/create-callback-memoizer.js +25 -0
  78. package/es/utils/get-updated-offset-for-index.d.ts +14 -0
  79. package/es/utils/get-updated-offset-for-index.d.ts.map +1 -0
  80. package/es/utils/get-updated-offset-for-index.js +32 -0
  81. package/es/utils/init-cell-metadata.d.ts +13 -0
  82. package/es/utils/init-cell-metadata.d.ts.map +1 -0
  83. package/es/utils/init-cell-metadata.js +32 -0
  84. package/es/utils/request-animation-timeout.d.ts +12 -0
  85. package/es/utils/request-animation-timeout.d.ts.map +1 -0
  86. package/es/utils/request-animation-timeout.js +33 -0
  87. package/es/utils/test-helper.d.ts +5 -0
  88. package/es/utils/test-helper.d.ts.map +1 -0
  89. package/es/utils/test-helper.js +31 -0
  90. package/es/vendor/binary-search-bounds.d.ts +22 -0
  91. package/es/vendor/binary-search-bounds.d.ts.map +1 -0
  92. package/es/vendor/binary-search-bounds.js +198 -0
  93. package/es/vendor/detect-element-resize.d.ts +16 -0
  94. package/es/vendor/detect-element-resize.d.ts.map +1 -0
  95. package/es/vendor/detect-element-resize.js +184 -0
  96. package/es/vendor/interval-tree.d.ts +10 -0
  97. package/es/vendor/interval-tree.d.ts.map +1 -0
  98. package/es/vendor/interval-tree.js +359 -0
  99. package/package.json +59 -0
  100. package/src/auto-sizer/auto-sizer.tsx +187 -0
  101. package/src/auto-sizer/index.ts +4 -0
  102. package/src/cell-measurer/cell-measurer-cache.ts +220 -0
  103. package/src/cell-measurer/cell-measurer.ts +151 -0
  104. package/src/cell-measurer/index.ts +5 -0
  105. package/src/cell-measurer/types.ts +8 -0
  106. package/src/grid/accessibility-overscanIndices-getter.ts +38 -0
  107. package/src/grid/default-cell-range-renderer.ts +166 -0
  108. package/src/grid/default-overscanIndices-getter.ts +32 -0
  109. package/src/grid/grid.tsx +1672 -0
  110. package/src/grid/index.ts +14 -0
  111. package/src/grid/types.ts +112 -0
  112. package/src/grid/utils/calculate-size-and-position-data-and-update-scroll-offset.ts +62 -0
  113. package/src/grid/utils/cell-size-and-position-manager-row.ts +365 -0
  114. package/src/grid/utils/cell-size-and-position-manager.ts +309 -0
  115. package/src/grid/utils/max-element-size.ts +18 -0
  116. package/src/grid/utils/scaling-cell-size-and-position-manager-row.ts +206 -0
  117. package/src/grid/utils/scaling-cell-size-and-position-manager.ts +198 -0
  118. package/src/grid/utils/update-scroll-index-helper.ts +96 -0
  119. package/src/index.spec.ts +10 -0
  120. package/src/index.ts +4 -0
  121. package/src/list/index.ts +2 -0
  122. package/src/list/list.tsx +292 -0
  123. package/src/list/types.ts +25 -0
  124. package/src/utils/animation-frame.ts +38 -0
  125. package/src/utils/create-callback-memoizer.ts +32 -0
  126. package/src/utils/get-updated-offset-for-index.ts +33 -0
  127. package/src/utils/init-cell-metadata.ts +32 -0
  128. package/src/utils/request-animation-timeout.ts +44 -0
  129. package/src/utils/test-helper.ts +20 -0
  130. package/src/vendor/binary-search-bounds.ts +203 -0
  131. package/src/vendor/detect-element-resize.ts +241 -0
  132. package/src/vendor/interval-tree.ts +406 -0
@@ -0,0 +1,22 @@
1
+ import type * as React from 'react';
2
+ export type RowRendererParams = {
3
+ index: number;
4
+ isScrolling: boolean;
5
+ isVisible: boolean;
6
+ key: string;
7
+ parent: Record<any, any>;
8
+ style: Record<any, any>;
9
+ };
10
+ export type RowRenderer = (params: RowRendererParams) => React.ReactNode;
11
+ export type RenderedRows = {
12
+ overscanStartIndex: number;
13
+ overscanStopIndex: number;
14
+ startIndex: number;
15
+ stopIndex: number;
16
+ };
17
+ export type Scroll = {
18
+ clientHeight: number;
19
+ scrollHeight: number;
20
+ scrollTop: number;
21
+ };
22
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/list/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAEpC,MAAM,MAAM,iBAAiB,GAAG;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,OAAO,CAAC;IACrB,SAAS,EAAE,OAAO,CAAC;IACnB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IACzB,KAAK,EAAE,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,CAAC,MAAM,EAAE,iBAAiB,KAAK,KAAK,CAAC,SAAS,CAAC;AAEzE,MAAM,MAAM,YAAY,GAAG;IACzB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,MAAM,GAAG;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,7 @@
1
+ type Callback = (timestamp: number) => void;
2
+ type CancelAnimationFrame = (requestId: number) => void;
3
+ type RequestAnimationFrame = (callback: Callback) => number;
4
+ export declare const raf: RequestAnimationFrame;
5
+ export declare const caf: CancelAnimationFrame;
6
+ export {};
7
+ //# sourceMappingURL=animation-frame.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"animation-frame.d.ts","sourceRoot":"","sources":["../../src/utils/animation-frame.ts"],"names":[],"mappings":"AAAA,KAAK,QAAQ,GAAG,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;AAC5C,KAAK,oBAAoB,GAAG,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;AACxD,KAAK,qBAAqB,GAAG,CAAC,QAAQ,EAAE,QAAQ,KAAK,MAAM,CAAC;AAkC5D,eAAO,MAAM,GAAG,EAAE,qBAA+B,CAAC;AAClD,eAAO,MAAM,GAAG,EAAE,oBAA6B,CAAC"}
@@ -0,0 +1,20 @@
1
+ // Properly handle server-side rendering.
2
+ var win;
3
+ if (typeof window !== 'undefined') {
4
+ win = window;
5
+ } else if (typeof self !== 'undefined') {
6
+ win = self;
7
+ } else {
8
+ win = {};
9
+ }
10
+
11
+ // requestAnimationFrame() shim by Paul Irish
12
+ // http://paulirish.com/2011/requestanimationframe-for-smart-animating/
13
+ var request = win.requestAnimationFrame || win.webkitRequestAnimationFrame || win.mozRequestAnimationFrame || win.oRequestAnimationFrame || win.msRequestAnimationFrame || function (callback) {
14
+ return win.setTimeout(callback, 1000 / 60);
15
+ };
16
+ var cancel = win.cancelAnimationFrame || win.webkitCancelAnimationFrame || win.mozCancelAnimationFrame || win.oCancelAnimationFrame || win.msCancelAnimationFrame || function (id) {
17
+ win.clearTimeout(id);
18
+ };
19
+ export var raf = request;
20
+ export var caf = cancel;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Helper utility that updates the specified callback whenever any of the specified indices have changed.
3
+ */
4
+ export default function createCallbackMemoizer(requireAllKeys?: boolean): ({ callback, indices }: any) => void;
5
+ //# sourceMappingURL=create-callback-memoizer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-callback-memoizer.d.ts","sourceRoot":"","sources":["../../src/utils/create-callback-memoizer.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAAC,cAAc,UAAO,2BAGnC,GAAG,UAyBnC"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Helper utility that updates the specified callback whenever any of the specified indices have changed.
3
+ */
4
+ export default function createCallbackMemoizer() {
5
+ var requireAllKeys = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
6
+ var cachedIndices = {};
7
+ return function (_ref) {
8
+ var callback = _ref.callback,
9
+ indices = _ref.indices;
10
+ var keys = Object.keys(indices);
11
+ var allInitialized = !requireAllKeys || keys.every(function (key) {
12
+ var value = indices[key];
13
+ return Array.isArray(value) ? value.length > 0 : value >= 0;
14
+ });
15
+ var indexChanged = keys.length !== Object.keys(cachedIndices).length || keys.some(function (key) {
16
+ var cachedValue = cachedIndices[key];
17
+ var value = indices[key];
18
+ return Array.isArray(value) ? cachedValue.join(',') !== value.join(',') : cachedValue !== value;
19
+ });
20
+ cachedIndices = indices;
21
+ if (allInitialized && indexChanged) {
22
+ callback(indices);
23
+ }
24
+ };
25
+ }
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Determines a new offset that ensures a certain cell is visible, given the current offset.
3
+ * If the cell is already visible then the current offset will be returned.
4
+ * If the current offset is too great or small, it will be adjusted just enough to ensure the specified index is visible.
5
+ *
6
+ * @param align Desired alignment within container; one of "auto" (default), "start", or "end"
7
+ * @param cellOffset Offset (x or y) position for cell
8
+ * @param cellSize Size (width or height) of cell
9
+ * @param containerSize Total size (width or height) of the container
10
+ * @param currentOffset Container's current (x or y) offset
11
+ * @return Offset to use to ensure the specified cell is visible
12
+ */
13
+ export default function getUpdatedOffsetForIndex({ align, cellOffset, cellSize, containerSize, currentOffset, }: any): any;
14
+ //# sourceMappingURL=get-updated-offset-for-index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-updated-offset-for-index.d.ts","sourceRoot":"","sources":["../../src/utils/get-updated-offset-for-index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,OAAO,UAAU,wBAAwB,CAAC,EAC/C,KAAc,EACd,UAAU,EACV,QAAQ,EACR,aAAa,EACb,aAAa,GACd,EAAE,GAAG,OAcL"}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Determines a new offset that ensures a certain cell is visible, given the current offset.
3
+ * If the cell is already visible then the current offset will be returned.
4
+ * If the current offset is too great or small, it will be adjusted just enough to ensure the specified index is visible.
5
+ *
6
+ * @param align Desired alignment within container; one of "auto" (default), "start", or "end"
7
+ * @param cellOffset Offset (x or y) position for cell
8
+ * @param cellSize Size (width or height) of cell
9
+ * @param containerSize Total size (width or height) of the container
10
+ * @param currentOffset Container's current (x or y) offset
11
+ * @return Offset to use to ensure the specified cell is visible
12
+ */
13
+ export default function getUpdatedOffsetForIndex(_ref) {
14
+ var _ref$align = _ref.align,
15
+ align = _ref$align === void 0 ? 'auto' : _ref$align,
16
+ cellOffset = _ref.cellOffset,
17
+ cellSize = _ref.cellSize,
18
+ containerSize = _ref.containerSize,
19
+ currentOffset = _ref.currentOffset;
20
+ var maxOffset = cellOffset;
21
+ var minOffset = maxOffset - containerSize + cellSize;
22
+ switch (align) {
23
+ case 'start':
24
+ return maxOffset;
25
+ case 'end':
26
+ return minOffset;
27
+ case 'center':
28
+ return maxOffset - (containerSize - cellSize) / 2;
29
+ default:
30
+ return Math.max(minOffset, Math.min(maxOffset, currentOffset));
31
+ }
32
+ }
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Initializes metadata for an axis and its cells.
3
+ * This data is used to determine which cells are visible given a container size and scroll position.
4
+ *
5
+ * @param cellCount Total number of cells.
6
+ * @param size Either a fixed size or a function that returns the size for a given given an index.
7
+ * @return Object mapping cell index to cell metadata (size, offset)
8
+ */
9
+ export default function initCellMetadata({ cellCount, size }: any): {
10
+ size: any;
11
+ offset: number;
12
+ }[];
13
+ //# sourceMappingURL=init-cell-metadata.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"init-cell-metadata.d.ts","sourceRoot":"","sources":["../../src/utils/init-cell-metadata.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,GAAG;;;IAuBhE"}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Initializes metadata for an axis and its cells.
3
+ * This data is used to determine which cells are visible given a container size and scroll position.
4
+ *
5
+ * @param cellCount Total number of cells.
6
+ * @param size Either a fixed size or a function that returns the size for a given given an index.
7
+ * @return Object mapping cell index to cell metadata (size, offset)
8
+ */
9
+ export default function initCellMetadata(_ref) {
10
+ var cellCount = _ref.cellCount,
11
+ size = _ref.size;
12
+ var sizeGetter = typeof size === 'function' ? size : function () {
13
+ return size;
14
+ };
15
+ var cellMetadata = [];
16
+ var offset = 0;
17
+ for (var i = 0; i < cellCount; i++) {
18
+ // eslint-disable-next-line @typescript-eslint/no-shadow
19
+ var _size = sizeGetter({
20
+ index: i
21
+ });
22
+ if (_size === null || isNaN(_size)) {
23
+ throw Error("Invalid size returned for cell ".concat(i, " of value ").concat(_size));
24
+ }
25
+ cellMetadata[i] = {
26
+ size: _size,
27
+ offset: offset
28
+ };
29
+ offset += _size;
30
+ }
31
+ return cellMetadata;
32
+ }
@@ -0,0 +1,12 @@
1
+ export type AnimationTimeoutId = {
2
+ id: number;
3
+ };
4
+ export declare const cancelAnimationTimeout: (frame: AnimationTimeoutId) => void;
5
+ /**
6
+ * Recursively calls requestAnimationFrame until a specified delay has been met or exceeded.
7
+ * When the delay time has been reached the function you're timing out will be called.
8
+ *
9
+ * Credit: Joe Lambert (https://gist.github.com/joelambert/1002116#file-requesttimeout-js)
10
+ */
11
+ export declare const requestAnimationTimeout: (callback: () => any, delay: number) => AnimationTimeoutId;
12
+ //# sourceMappingURL=request-animation-timeout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"request-animation-timeout.d.ts","sourceRoot":"","sources":["../../src/utils/request-animation-timeout.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,kBAAkB,GAAG;IAC/B,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAEF,eAAO,MAAM,sBAAsB,UAAW,kBAAkB,SAAkB,CAAC;AAEnF;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,aACxB,MAAM,GAAG,SACZ,MAAM,KACZ,kBA0BF,CAAC"}
@@ -0,0 +1,33 @@
1
+ import { caf, raf } from "./animation-frame.js";
2
+ export var cancelAnimationTimeout = function cancelAnimationTimeout(frame) {
3
+ return caf(frame.id);
4
+ };
5
+
6
+ /**
7
+ * Recursively calls requestAnimationFrame until a specified delay has been met or exceeded.
8
+ * When the delay time has been reached the function you're timing out will be called.
9
+ *
10
+ * Credit: Joe Lambert (https://gist.github.com/joelambert/1002116#file-requesttimeout-js)
11
+ */
12
+ export var requestAnimationTimeout = function requestAnimationTimeout(callback, delay) {
13
+ var start;
14
+ // wait for end of processing current event handler, because event handler may be long
15
+ Promise.resolve().then(function () {
16
+ start = Date.now();
17
+ return;
18
+ }).catch(function (e) {
19
+ //
20
+ });
21
+ var timeout = function timeout() {
22
+ if (Date.now() - start >= delay) {
23
+ callback();
24
+ } else {
25
+ // eslint-disable-next-line @typescript-eslint/no-use-before-define
26
+ frame.id = raf(timeout);
27
+ }
28
+ };
29
+ var frame = {
30
+ id: raf(timeout)
31
+ };
32
+ return frame;
33
+ };
@@ -0,0 +1,5 @@
1
+ export declare function getCellMetadata(): {
2
+ size: any;
3
+ offset: number;
4
+ }[];
5
+ //# sourceMappingURL=test-helper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-helper.d.ts","sourceRoot":"","sources":["../../src/utils/test-helper.ts"],"names":[],"mappings":"AAGA,wBAAgB,eAAe;;;IAgB9B"}
@@ -0,0 +1,31 @@
1
+ import initCellMetadata from "./init-cell-metadata.js";
2
+
3
+ // Default cell sizes and offsets for use in below tests
4
+ export function getCellMetadata() {
5
+ var cellSizes = [10,
6
+ // 0: 0..0 (min)
7
+ 20,
8
+ // 1: 0..10
9
+ 15,
10
+ // 2: 0..30
11
+ 10,
12
+ // 3: 5..45
13
+ 15,
14
+ // 4: 20..55
15
+ 30,
16
+ // 5: 50..70
17
+ 20,
18
+ // 6: 70..100
19
+ 10,
20
+ // 7: 80..110
21
+ 30 // 8: 110..110 (max)
22
+ ];
23
+
24
+ return initCellMetadata({
25
+ cellCount: cellSizes.length,
26
+ size: function size(_ref) {
27
+ var index = _ref.index;
28
+ return cellSizes[index];
29
+ }
30
+ });
31
+ }
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Binary Search Bounds
3
+ * https://github.com/mikolalysenko/binary-search-bounds
4
+ * Mikola Lysenko
5
+ *
6
+ * Inlined because of Content Security Policy issue caused by the use of `new Function(...)` syntax.
7
+ * Issue reported here: https://github.com/mikolalysenko/binary-search-bounds/issues/5
8
+ **/
9
+ declare function dispatchBsearchGE(a: any, y: any, c: any, l: any, h: any): any;
10
+ declare function dispatchBsearchGT(a: any, y: any, c: any, l: any, h: any): any;
11
+ declare function dispatchBsearchLT(a: any, y: any, c: any, l: any, h: any): number;
12
+ declare function dispatchBsearchLE(a: any, y: any, c: any, l: any, h: any): number;
13
+ declare function dispatchBsearchEQ(a: any, y: any, c: any, l: any, h: any): number;
14
+ declare const _default: {
15
+ ge: typeof dispatchBsearchGE;
16
+ gt: typeof dispatchBsearchGT;
17
+ lt: typeof dispatchBsearchLT;
18
+ le: typeof dispatchBsearchLE;
19
+ eq: typeof dispatchBsearchEQ;
20
+ };
21
+ export default _default;
22
+ //# sourceMappingURL=binary-search-bounds.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"binary-search-bounds.d.ts","sourceRoot":"","sources":["../../src/vendor/binary-search-bounds.ts"],"names":[],"mappings":"AAIA;;;;;;;IAOI;AA8BJ,iBAAS,iBAAiB,CAAC,CAAC,KAAA,EAAE,CAAC,KAAA,EAAE,CAAC,KAAA,EAAE,CAAC,KAAA,EAAE,CAAC,KAAA,OAMvC;AA8BD,iBAAS,iBAAiB,CAAC,CAAC,KAAA,EAAE,CAAC,KAAA,EAAE,CAAC,KAAA,EAAE,CAAC,KAAA,EAAE,CAAC,KAAA,OAMvC;AA8BD,iBAAS,iBAAiB,CAAC,CAAC,KAAA,EAAE,CAAC,KAAA,EAAE,CAAC,KAAA,EAAE,CAAC,KAAA,EAAE,CAAC,KAAA,UAMvC;AA8BD,iBAAS,iBAAiB,CAAC,CAAC,KAAA,EAAE,CAAC,KAAA,EAAE,CAAC,KAAA,EAAE,CAAC,KAAA,EAAE,CAAC,KAAA,UAMvC;AAiCD,iBAAS,iBAAiB,CAAC,CAAC,KAAA,EAAE,CAAC,KAAA,EAAE,CAAC,KAAA,EAAE,CAAC,KAAA,EAAE,CAAC,KAAA,UAMvC;;;;;;;;AAED,wBAME"}
@@ -0,0 +1,198 @@
1
+ /* eslint-disable @typescript-eslint/ban-ts-comment */
2
+ /* eslint-disable @typescript-eslint/no-unused-expressions */
3
+ /* eslint-disable no-param-reassign */
4
+ // @ts-nocheck
5
+ /**
6
+ * Binary Search Bounds
7
+ * https://github.com/mikolalysenko/binary-search-bounds
8
+ * Mikola Lysenko
9
+ *
10
+ * Inlined because of Content Security Policy issue caused by the use of `new Function(...)` syntax.
11
+ * Issue reported here: https://github.com/mikolalysenko/binary-search-bounds/issues/5
12
+ **/
13
+
14
+ function _GEA(a, l, h, y) {
15
+ var i = h + 1;
16
+ while (l <= h) {
17
+ var m = l + h >>> 1,
18
+ x = a[m];
19
+ if (x >= y) {
20
+ i = m;
21
+ h = m - 1;
22
+ } else {
23
+ l = m + 1;
24
+ }
25
+ }
26
+ return i;
27
+ }
28
+ function _GEP(a, l, h, y, c) {
29
+ var i = h + 1;
30
+ while (l <= h) {
31
+ var m = l + h >>> 1,
32
+ x = a[m];
33
+ if (c(x, y) >= 0) {
34
+ i = m;
35
+ h = m - 1;
36
+ } else {
37
+ l = m + 1;
38
+ }
39
+ }
40
+ return i;
41
+ }
42
+ function dispatchBsearchGE(a, y, c, l, h) {
43
+ if (typeof c === 'function') {
44
+ return _GEP(a, l === void 0 ? 0 : l | 0, h === void 0 ? a.length - 1 : h | 0, y, c);
45
+ } else {
46
+ return _GEA(a, c === void 0 ? 0 : c | 0, l === void 0 ? a.length - 1 : l | 0, y);
47
+ }
48
+ }
49
+ function _GTA(a, l, h, y) {
50
+ var i = h + 1;
51
+ while (l <= h) {
52
+ var m = l + h >>> 1,
53
+ x = a[m];
54
+ if (x > y) {
55
+ i = m;
56
+ h = m - 1;
57
+ } else {
58
+ l = m + 1;
59
+ }
60
+ }
61
+ return i;
62
+ }
63
+ function _GTP(a, l, h, y, c) {
64
+ var i = h + 1;
65
+ while (l <= h) {
66
+ var m = l + h >>> 1,
67
+ x = a[m];
68
+ if (c(x, y) > 0) {
69
+ i = m;
70
+ h = m - 1;
71
+ } else {
72
+ l = m + 1;
73
+ }
74
+ }
75
+ return i;
76
+ }
77
+ function dispatchBsearchGT(a, y, c, l, h) {
78
+ if (typeof c === 'function') {
79
+ return _GTP(a, l === void 0 ? 0 : l | 0, h === void 0 ? a.length - 1 : h | 0, y, c);
80
+ } else {
81
+ return _GTA(a, c === void 0 ? 0 : c | 0, l === void 0 ? a.length - 1 : l | 0, y);
82
+ }
83
+ }
84
+ function _LTA(a, l, h, y) {
85
+ var i = l - 1;
86
+ while (l <= h) {
87
+ var m = l + h >>> 1,
88
+ x = a[m];
89
+ if (x < y) {
90
+ i = m;
91
+ l = m + 1;
92
+ } else {
93
+ h = m - 1;
94
+ }
95
+ }
96
+ return i;
97
+ }
98
+ function _LTP(a, l, h, y, c) {
99
+ var i = l - 1;
100
+ while (l <= h) {
101
+ var m = l + h >>> 1,
102
+ x = a[m];
103
+ if (c(x, y) < 0) {
104
+ i = m;
105
+ l = m + 1;
106
+ } else {
107
+ h = m - 1;
108
+ }
109
+ }
110
+ return i;
111
+ }
112
+ function dispatchBsearchLT(a, y, c, l, h) {
113
+ if (typeof c === 'function') {
114
+ return _LTP(a, l === void 0 ? 0 : l | 0, h === void 0 ? a.length - 1 : h | 0, y, c);
115
+ } else {
116
+ return _LTA(a, c === void 0 ? 0 : c | 0, l === void 0 ? a.length - 1 : l | 0, y);
117
+ }
118
+ }
119
+ function _LEA(a, l, h, y) {
120
+ var i = l - 1;
121
+ while (l <= h) {
122
+ var m = l + h >>> 1,
123
+ x = a[m];
124
+ if (x <= y) {
125
+ i = m;
126
+ l = m + 1;
127
+ } else {
128
+ h = m - 1;
129
+ }
130
+ }
131
+ return i;
132
+ }
133
+ function _LEP(a, l, h, y, c) {
134
+ var i = l - 1;
135
+ while (l <= h) {
136
+ var m = l + h >>> 1,
137
+ x = a[m];
138
+ if (c(x, y) <= 0) {
139
+ i = m;
140
+ l = m + 1;
141
+ } else {
142
+ h = m - 1;
143
+ }
144
+ }
145
+ return i;
146
+ }
147
+ function dispatchBsearchLE(a, y, c, l, h) {
148
+ if (typeof c === 'function') {
149
+ return _LEP(a, l === void 0 ? 0 : l | 0, h === void 0 ? a.length - 1 : h | 0, y, c);
150
+ } else {
151
+ return _LEA(a, c === void 0 ? 0 : c | 0, l === void 0 ? a.length - 1 : l | 0, y);
152
+ }
153
+ }
154
+ function _EQA(a, l, h, y) {
155
+ l - 1;
156
+ while (l <= h) {
157
+ var m = l + h >>> 1,
158
+ x = a[m];
159
+ if (x === y) {
160
+ return m;
161
+ } else if (x <= y) {
162
+ l = m + 1;
163
+ } else {
164
+ h = m - 1;
165
+ }
166
+ }
167
+ return -1;
168
+ }
169
+ function _EQP(a, l, h, y, c) {
170
+ l - 1;
171
+ while (l <= h) {
172
+ var m = l + h >>> 1,
173
+ x = a[m];
174
+ var p = c(x, y);
175
+ if (p === 0) {
176
+ return m;
177
+ } else if (p <= 0) {
178
+ l = m + 1;
179
+ } else {
180
+ h = m - 1;
181
+ }
182
+ }
183
+ return -1;
184
+ }
185
+ function dispatchBsearchEQ(a, y, c, l, h) {
186
+ if (typeof c === 'function') {
187
+ return _EQP(a, l === void 0 ? 0 : l | 0, h === void 0 ? a.length - 1 : h | 0, y, c);
188
+ } else {
189
+ return _EQA(a, c === void 0 ? 0 : c | 0, l === void 0 ? a.length - 1 : l | 0, y);
190
+ }
191
+ }
192
+ export default {
193
+ ge: dispatchBsearchGE,
194
+ gt: dispatchBsearchGT,
195
+ lt: dispatchBsearchLT,
196
+ le: dispatchBsearchLE,
197
+ eq: dispatchBsearchEQ
198
+ };
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Detect Element Resize.
3
+ * https://github.com/sdecima/javascript-detect-element-resize
4
+ * Sebastian Decima
5
+ *
6
+ * Forked from version 0.5.3; includes the following modifications:
7
+ * 1) Guard against unsafe 'window' and 'document' references (to support SSR).
8
+ * 2) Defer initialization code via a top-level function wrapper (to support SSR).
9
+ * 3) Avoid unnecessary reflows by not measuring size for scroll events bubbling from children.
10
+ * 4) Add nonce for style element.
11
+ **/
12
+ export default function createDetectElementResize(nonce: any): {
13
+ addResizeListener: (element: any, fn: any) => void;
14
+ removeResizeListener: (element: any, fn: any) => void;
15
+ };
16
+ //# sourceMappingURL=detect-element-resize.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"detect-element-resize.d.ts","sourceRoot":"","sources":["../../src/vendor/detect-element-resize.ts"],"names":[],"mappings":"AAOA;;;;;;;;;;IAUI;AAEJ,MAAM,CAAC,OAAO,UAAU,yBAAyB,CAAC,KAAK,KAAA;;;EA6NtD"}