@react-stately/virtualizer 3.6.9-nightly.4555 → 3.6.9-nightly.4560

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 (66) hide show
  1. package/dist/Layout.main.js +75 -0
  2. package/dist/Layout.main.js.map +1 -0
  3. package/dist/Layout.mjs +70 -0
  4. package/dist/Layout.module.js +70 -0
  5. package/dist/Layout.module.js.map +1 -0
  6. package/dist/LayoutInfo.main.js +51 -0
  7. package/dist/LayoutInfo.main.js.map +1 -0
  8. package/dist/LayoutInfo.mjs +46 -0
  9. package/dist/LayoutInfo.module.js +46 -0
  10. package/dist/LayoutInfo.module.js.map +1 -0
  11. package/dist/OverscanManager.main.js +87 -0
  12. package/dist/OverscanManager.main.js.map +1 -0
  13. package/dist/OverscanManager.mjs +82 -0
  14. package/dist/OverscanManager.module.js +82 -0
  15. package/dist/OverscanManager.module.js.map +1 -0
  16. package/dist/Point.main.js +40 -0
  17. package/dist/Point.main.js.map +1 -0
  18. package/dist/Point.mjs +35 -0
  19. package/dist/Point.module.js +35 -0
  20. package/dist/Point.module.js.map +1 -0
  21. package/dist/Rect.main.js +130 -0
  22. package/dist/Rect.main.js.map +1 -0
  23. package/dist/Rect.mjs +125 -0
  24. package/dist/Rect.module.js +125 -0
  25. package/dist/Rect.module.js.map +1 -0
  26. package/dist/ReusableView.main.js +33 -0
  27. package/dist/ReusableView.main.js.map +1 -0
  28. package/dist/ReusableView.mjs +28 -0
  29. package/dist/ReusableView.module.js +28 -0
  30. package/dist/ReusableView.module.js.map +1 -0
  31. package/dist/Size.main.js +40 -0
  32. package/dist/Size.main.js.map +1 -0
  33. package/dist/Size.mjs +35 -0
  34. package/dist/Size.module.js +35 -0
  35. package/dist/Size.module.js.map +1 -0
  36. package/dist/Transaction.main.js +32 -0
  37. package/dist/Transaction.main.js.map +1 -0
  38. package/dist/Transaction.mjs +27 -0
  39. package/dist/Transaction.module.js +27 -0
  40. package/dist/Transaction.module.js.map +1 -0
  41. package/dist/Virtualizer.main.js +813 -0
  42. package/dist/Virtualizer.main.js.map +1 -0
  43. package/dist/Virtualizer.mjs +808 -0
  44. package/dist/Virtualizer.module.js +808 -0
  45. package/dist/Virtualizer.module.js.map +1 -0
  46. package/dist/import.mjs +7 -1399
  47. package/dist/main.js +14 -1406
  48. package/dist/main.js.map +1 -1
  49. package/dist/module.js +7 -1399
  50. package/dist/module.js.map +1 -1
  51. package/dist/tween.main.js +67 -0
  52. package/dist/tween.main.js.map +1 -0
  53. package/dist/tween.mjs +61 -0
  54. package/dist/tween.module.js +61 -0
  55. package/dist/tween.module.js.map +1 -0
  56. package/dist/useVirtualizerState.main.js +96 -0
  57. package/dist/useVirtualizerState.main.js.map +1 -0
  58. package/dist/useVirtualizerState.mjs +91 -0
  59. package/dist/useVirtualizerState.module.js +91 -0
  60. package/dist/useVirtualizerState.module.js.map +1 -0
  61. package/dist/utils.main.js +53 -0
  62. package/dist/utils.main.js.map +1 -0
  63. package/dist/utils.mjs +46 -0
  64. package/dist/utils.module.js +46 -0
  65. package/dist/utils.module.js.map +1 -0
  66. package/package.json +4 -4
@@ -1 +1 @@
1
- {"mappings":";;;AAAA;;;;;;;;;;ACAA;;;;;;;;;;CAUC,GAwBM,MAAe;IAIpB;;;;;GAKC,GACD,iBAAiB,OAAa,EAAE,OAAa,EAAW;QACtD,+CAA+C;QAC/C,OAAO,QAAQ,KAAK,KAAK,QAAQ,KAAK,IAC/B,QAAQ,MAAM,KAAK,QAAQ,MAAM;IAC1C;IAEA;;;;;GAKC,GACD,SAAS,mBAAgD,EAAE,CAAC;IAqB5D;;;;GAIC,GACD,mDAAmD;IACnD,qDAAqD;IACrD,mBAAmB;IACnB,mBAAmB;IACnB,MAAM;IAEN,aAAa;IACb,oBAAoB;IACpB,kBAAkB;IAClB,OAAO;IACP,IAAI;IAEJ;;;;GAIC,GACD,mDAAmD;IACnD,iBAAiB;IACjB,IAAI;IAEJ;;;;;;GAMC,GACD,qBAAqB,U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5B,GAAG;QAAC;KAAY;IAChB,IAAI,iBAAiB,CAAA,GAAA,kBAAU,EAAE;QAC/B,YAAY,cAAc;QAC1B,aAAa;IACf,GAAG;QAAC;KAAY;IAChB,IAAI,eAAe,CAAA,GAAA,kBAAU,EAAE;QAC7B,YAAY,YAAY;QACxB,aAAa;IACf,GAAG;QAAC;KAAY;IAEhB,IAAI,QAAQ,CAAA,GAAA,cAAM,EAAE,IAAO,CAAA;yBACzB;0BACA;4BACA;yBACA;yBACA;yBACA;4BACA;0BACA;QACF,CAAA,GAAI;QACF;QACA;QACA;QACA;QACA;QACA;QACA;QACA;KACD;IAED,OAAO;AACT;;","sources":["packages/@react-stately/virtualizer/src/index.ts","packages/@react-stately/virtualizer/src/Layout.ts","packages/@react-stately/virtualizer/src/LayoutInfo.ts","packages/@react-stately/virtualizer/src/Point.ts","packages/@react-stately/virtualizer/src/Rect.ts","packages/@react-stately/virtualizer/src/Size.ts","packages/@react-stately/virtualizer/src/ReusableView.ts","packages/@react-stately/virtualizer/src/useVirtualizerState.ts","packages/@react-stately/virtualizer/src/Virtualizer.ts","packages/@react-stately/virtualizer/src/tween.ts","packages/@react-stately/virtualizer/src/utils.ts","packages/@react-stately/virtualizer/src/OverscanManager.ts","packages/@react-stately/virtualizer/src/Transaction.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport type {InvalidationContext} from './types';\nexport type {VirtualizerState} from './useVirtualizerState';\nexport type {RectCorner} from './Rect';\n\nexport {Layout} from './Layout';\nexport {LayoutInfo} from './LayoutInfo';\nexport {Point} from './Point';\nexport {Rect} from './Rect';\nexport {Size} from './Size';\nexport {ReusableView} from './ReusableView';\nexport {useVirtualizerState} from './useVirtualizerState';\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {InvalidationContext} from './types';\nimport {Key} from '@react-types/shared';\nimport {LayoutInfo} from './LayoutInfo';\n// import {Point} from './Point';\nimport {Rect} from './Rect';\nimport {Size} from './Size';\nimport {Virtualizer} from './Virtualizer';\n// import { DragTarget, DropTarget } from '@react-types/shared';\n\n/**\n * [CollectionView]{@link CollectionView} supports arbitrary layout objects, which compute what views are visible, and how\n * to position and style them. However, layouts do not create the views themselves directly. Instead,\n * layouts produce lightweight {@link LayoutInfo} objects which describe various properties of a view,\n * such as its position and size. The {@link CollectionView} is then responsible for creating the actual\n * views as needed, based on this layout information.\n *\n * Every layout extends from the {@link Layout} abstract base class. Layouts must implement a minimum of the\n * two methods listed below. All other methods can be optionally overridden to implement custom behavior.\n *\n * @see {@link getVisibleLayoutInfos}\n * @see {@link getLayoutInfo}\n */\nexport abstract class Layout<T extends object> {\n /** The CollectionView the layout is currently attached to. */\n virtualizer: Virtualizer<T, any, any>;\n\n /**\n * Returns whether the layout should invalidate in response to\n * visible rectangle changes. By default, it only invalidates\n * when the collection view's size changes. Return true always\n * to make the layout invalidate while scrolling (e.g. sticky headers).\n */\n shouldInvalidate(newRect: Rect, oldRect: Rect): boolean {\n // By default, invalidate when the size changes\n return newRect.width !== oldRect.width\n || newRect.height !== oldRect.height;\n }\n\n /**\n * This method allows the layout to perform any pre-computation\n * it needs to in order to prepare {@link LayoutInfo}s for retrieval.\n * Called by the collection view before {@link getVisibleLayoutInfos}\n * or {@link getLayoutInfo} are called.\n */\n validate(invalidationContext: InvalidationContext<T, any>) {} // eslint-disable-line @typescript-eslint/no-unused-vars\n\n /**\n * Returns an array of {@link LayoutInfo} objects which are inside the given rectangle.\n * Should be implemented by subclasses.\n * @param rect The rectangle that should contain the returned LayoutInfo objects.\n */\n abstract getVisibleLayoutInfos(rect: Rect): LayoutInfo[];\n\n /**\n * Returns a {@link LayoutInfo} for the given key.\n * Should be implemented by subclasses.\n * @param key The key of the LayoutInfo to retrieve.\n */\n abstract getLayoutInfo(key: Key): LayoutInfo;\n\n /**\n * Returns size of the content. By default, it returns collectionView's size.\n */\n abstract getContentSize(): Size;\n\n /**\n * Returns a {@link DragTarget} describing a view at the given point to be dragged.\n * Return `null` to cancel the drag. The default implementation returns the view at the given point.\n * @param point The point at which the drag occurred.\n */\n // getDragTarget(point: Point): DragTarget | null {\n // let target = this.virtualizer.keyAtPoint(point);\n // if (!target) {\n // return null;\n // }\n\n // return {\n // type: 'item',\n // key: target\n // };\n // }\n\n /**\n * Returns a {@link DragTarget} object describing where a drop should occur. Return `null`\n * to reject the drop. The dropped items will be inserted before the resulting target.\n * @param point The point at which the drop occurred.\n */\n // getDropTarget(point: Point): DropTarget | null {\n // return null;\n // }\n\n /**\n * Returns the starting attributes for an animated insertion.\n * The view is animated from this {@link LayoutInfo} to the one returned by {@link getLayoutInfo}.\n * The default implementation just returns its input.\n *\n * @param layoutInfo The proposed LayoutInfo for this view.\n */\n getInitialLayoutInfo(layoutInfo: LayoutInfo): LayoutInfo {\n return layoutInfo;\n }\n\n /**\n * Returns the ending attributes for an animated removal.\n * The view is animated from the {@link LayoutInfo} returned by {@link getLayoutInfo}\n * to the one returned by this method. The default implementation returns its input.\n *\n * @param layoutInfo The original LayoutInfo for this view.\n */\n getFinalLayoutInfo(layoutInfo: LayoutInfo): LayoutInfo {\n return layoutInfo;\n }\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {Key} from '@react-types/shared';\nimport {Rect} from './Rect';\n\n/**\n * Instances of this lightweight class are created by {@link Layout} subclasses\n * to represent each view in the {@link CollectionView}. LayoutInfo objects describe\n * various properties of a view, such as its position and size, and style information.\n * The collection view uses this information when creating actual views to display.\n */\nexport class LayoutInfo {\n /**\n * A string representing the view type. Should be `'item'` for item views.\n * Other types are used by supplementary views.\n */\n type: string;\n\n /**\n * A unique key for this view. For item views, it should match the content key.\n */\n key: Key;\n\n /**\n * The key for a parent layout info, if any.\n */\n parentKey: Key | null;\n\n /**\n * The rectangle describing the size and position of this view.\n */\n rect: Rect;\n\n /**\n * Whether the size is estimated. `false` by default.\n */\n estimatedSize: boolean;\n\n /**\n * Whether the layout info sticks to the viewport when scrolling.\n */\n isSticky: boolean;\n\n /**\n * The view's opacity. 1 by default.\n */\n opacity: number;\n\n /**\n * A CSS transform string to apply to the view. `null` by default.\n */\n transform: string | null;\n\n /**\n * The z-index of the view. 0 by default.\n */\n zIndex: number;\n\n /**\n * Whether the layout info allows its contents to overflow its container.\n * @default false\n */\n allowOverflow: boolean;\n\n /**\n * @param type A string representing the view type. Should be `'item'` for item views.\n Other types are used by supplementary views.\n * @param key The unique key for this view.\n * @param rect The rectangle describing the size and position of this view.\n */\n constructor(type: string, key: Key, rect: Rect) {\n this.type = type;\n this.key = key;\n this.parentKey = null;\n this.rect = rect;\n this.estimatedSize = false;\n this.isSticky = false;\n this.opacity = 1;\n this.transform = null;\n this.zIndex = 0;\n this.allowOverflow = false;\n }\n\n /**\n * Returns a copy of the LayoutInfo.\n */\n copy(): LayoutInfo {\n let res = new LayoutInfo(this.type, this.key, this.rect.copy());\n res.estimatedSize = this.estimatedSize;\n res.opacity = this.opacity;\n res.transform = this.transform;\n res.parentKey = this.parentKey;\n res.isSticky = this.isSticky;\n res.zIndex = this.zIndex;\n res.allowOverflow = this.allowOverflow;\n return res;\n }\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport class Point {\n /** The x-coordinate of the point. */\n x: number;\n\n /** The y-coordinate of the point. */\n y: number;\n\n constructor(x = 0, y = 0) {\n this.x = x;\n this.y = y;\n }\n\n /**\n * Returns a copy of this point.\n */\n copy(): Point {\n return new Point(this.x, this.y);\n }\n\n /**\n * Checks if two points are equal.\n */\n equals(point: Point): boolean {\n return this.x === point.x && this.y === point.y;\n }\n\n /**\n * Returns true if this point is the origin.\n */\n isOrigin(): boolean {\n return this.x === 0 && this.y === 0;\n }\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {Point} from './Point';\nimport {Size} from './Size';\n\nexport type RectCorner = 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight';\n\n/**\n * Represents a rectangle.\n */\nexport class Rect {\n /** The x-coordinate of the rectangle. */\n x: number;\n\n /** The y-coordinate of the rectangle. */\n y: number;\n\n /** The width of the rectangle. */\n width: number;\n\n /** The height of the rectangle. */\n height: number;\n\n constructor(x = 0, y = 0, width = 0, height = 0) {\n this.x = x;\n this.y = y;\n this.width = width;\n this.height = height;\n }\n\n /**\n * The maximum x-coordinate in the rectangle.\n */\n get maxX(): number {\n return this.x + this.width;\n }\n\n /**\n * The maximum y-coordinate in the rectangle.\n */\n get maxY(): number {\n return this.y + this.height;\n }\n\n /**\n * The area of the rectangle.\n */\n get area(): number {\n return this.width * this.height;\n }\n\n /**\n * The top left corner of the rectangle.\n */\n get topLeft(): Point {\n return new Point(this.x, this.y);\n }\n\n /**\n * The top right corner of the rectangle.\n */\n get topRight(): Point {\n return new Point(this.maxX, this.y);\n }\n\n /**\n * The bottom left corner of the rectangle.\n */\n get bottomLeft(): Point {\n return new Point(this.x, this.maxY);\n }\n\n /**\n * The bottom right corner of the rectangle.\n */\n get bottomRight(): Point {\n return new Point(this.maxX, this.maxY);\n }\n\n /**\n * Returns whether this rectangle intersects another rectangle.\n * @param rect - The rectangle to check.\n */\n intersects(rect: Rect): boolean {\n return this.x <= rect.x + rect.width\n && rect.x <= this.x + this.width\n && this.y <= rect.y + rect.height\n && rect.y <= this.y + this.height;\n }\n\n /**\n * Returns whether this rectangle fully contains another rectangle.\n * @param rect - The rectangle to check.\n */\n containsRect(rect: Rect): boolean {\n return this.x <= rect.x\n && this.y <= rect.y\n && this.maxX >= rect.maxX\n && this.maxY >= rect.maxY;\n }\n\n /**\n * Returns whether the rectangle contains the given point.\n * @param point - The point to check.\n */\n containsPoint(point: Point): boolean {\n return this.x <= point.x\n && this.y <= point.y\n && this.maxX >= point.x\n && this.maxY >= point.y;\n }\n\n /**\n * Returns the first corner of this rectangle (from top to bottom, left to right)\n * that is contained in the given rectangle, or null of the rectangles do not intersect.\n * @param rect - The rectangle to check.\n */\n getCornerInRect(rect: Rect): RectCorner | null {\n for (let key of ['topLeft', 'topRight', 'bottomLeft', 'bottomRight']) {\n if (rect.containsPoint(this[key])) {\n return key as RectCorner;\n }\n }\n\n return null;\n }\n\n equals(rect: Rect) {\n return rect.x === this.x\n && rect.y === this.y\n && rect.width === this.width\n && rect.height === this.height;\n }\n\n pointEquals(point: Point | Rect) {\n return this.x === point.x\n && this.y === point.y;\n }\n\n sizeEquals(size: Size | Rect) {\n return this.width === size.width\n && this.height === size.height;\n }\n\n /**\n * Returns the union of this Rect and another.\n */\n union(other: Rect) {\n let x = Math.min(this.x, other.x);\n let y = Math.min(this.y, other.y);\n let width = Math.max(this.maxX, other.maxX) - x;\n let height = Math.max(this.maxY, other.maxY) - y;\n return new Rect(x, y, width, height);\n }\n\n /**\n * Returns the intersection of this Rect with another.\n * If the rectangles do not intersect, an all zero Rect is returned.\n */\n intersection(other: Rect): Rect {\n if (!this.intersects(other)) {\n return new Rect(0, 0, 0, 0);\n }\n\n let x = Math.max(this.x, other.x);\n let y = Math.max(this.y, other.y);\n return new Rect(\n x,\n y,\n Math.min(this.maxX, other.maxX) - x,\n Math.min(this.maxY, other.maxY) - y\n );\n }\n\n /**\n * Returns a copy of this rectangle.\n */\n copy(): Rect {\n return new Rect(this.x, this.y, this.width, this.height);\n }\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport class Size {\n width: number;\n height: number;\n\n constructor(width = 0, height = 0) {\n this.width = width;\n this.height = height;\n }\n\n /**\n * Returns a copy of this size.\n */\n copy(): Size {\n return new Size(this.width, this.height);\n }\n\n /**\n * Returns whether this size is equal to another one.\n */\n equals(other: Size): boolean {\n return this.width === other.width\n && this.height === other.height;\n }\n\n /**\n * The total area of the Size.\n */\n get area() {\n return this.width * this.height;\n }\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {Key} from '@react-types/shared';\nimport {LayoutInfo} from './LayoutInfo';\nimport {Virtualizer} from './Virtualizer';\n\nlet KEY = 0;\n\n/**\n * [CollectionView]{@link CollectionView} creates instances of the [ReusableView]{@link ReusableView} class to\n * represent views currently being displayed. ReusableViews manage a DOM node, handle\n * applying {@link LayoutInfo} objects to the view, and render content\n * as needed. Subclasses must implement the {@link render} method at a\n * minimum. Other methods can be overridden to customize behavior.\n */\nexport class ReusableView<T extends object, V> {\n /** The CollectionVirtualizer this view is a part of. */\n virtualizer: Virtualizer<T, V, unknown>;\n\n /** The LayoutInfo this view is currently representing. */\n layoutInfo: LayoutInfo | null;\n\n /** The content currently being displayed by this view, set by the collection view. */\n content: T;\n\n rendered: V;\n\n viewType: string;\n key: Key;\n\n constructor(virtualizer: Virtualizer<T, V, unknown>) {\n this.virtualizer = virtualizer;\n this.key = ++KEY;\n }\n\n /**\n * Prepares the view for reuse. Called just before the view is removed from the DOM.\n */\n prepareForReuse() {\n this.content = null;\n this.rendered = null;\n this.layoutInfo = null;\n }\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {Collection, Key} from '@react-types/shared';\nimport {Layout} from './Layout';\nimport {Rect} from './Rect';\nimport {ReusableView} from './ReusableView';\nimport {Size} from './Size';\nimport {useCallback, useEffect, useMemo, useState} from 'react';\nimport {useLayoutEffect} from '@react-aria/utils';\nimport {Virtualizer} from './Virtualizer';\n\ninterface VirtualizerProps<T extends object, V, W> {\n renderView(type: string, content: T): V,\n renderWrapper(\n parent: ReusableView<T, V> | null,\n reusableView: ReusableView<T, V>,\n children: ReusableView<T, V>[],\n renderChildren: (views: ReusableView<T, V>[]) => W[]\n ): W,\n layout: Layout<T>,\n collection: Collection<T>,\n onVisibleRectChange(rect: Rect): void,\n getScrollAnchor?(rect: Rect): Key,\n transitionDuration?: number\n}\n\nexport interface VirtualizerState<T extends object, V, W> {\n visibleViews: W[],\n setVisibleRect: (rect: Rect) => void,\n contentSize: Size,\n isAnimating: boolean,\n virtualizer: Virtualizer<T, V, W>,\n isScrolling: boolean,\n startScrolling: () => void,\n endScrolling: () => void\n}\n\nexport function useVirtualizerState<T extends object, V, W>(opts: VirtualizerProps<T, V, W>): VirtualizerState<T, V, W> {\n let [visibleViews, setVisibleViews] = useState<W[]>([]);\n let [contentSize, setContentSize] = useState(new Size());\n let [isAnimating, setAnimating] = useState(false);\n let [isScrolling, setScrolling] = useState(false);\n let virtualizer = useMemo(() => new Virtualizer<T, V, W>(), []);\n\n virtualizer.delegate = {\n setVisibleViews,\n setVisibleRect(rect) {\n virtualizer.visibleRect = rect;\n opts.onVisibleRectChange(rect);\n },\n setContentSize,\n renderView: opts.renderView,\n renderWrapper: opts.renderWrapper,\n beginAnimations: () => setAnimating(true),\n endAnimations: () => setAnimating(false),\n getScrollAnchor: opts.getScrollAnchor\n };\n\n virtualizer.layout = opts.layout;\n virtualizer.collection = opts.collection;\n virtualizer.transitionDuration = opts.transitionDuration;\n\n useLayoutEffect(() => {\n virtualizer.afterRender();\n });\n\n // eslint-disable-next-line arrow-body-style\n useEffect(() => {\n return () => virtualizer.willUnmount();\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n let setVisibleRect = useCallback((rect) => {\n virtualizer.visibleRect = rect;\n }, [virtualizer]);\n let startScrolling = useCallback(() => {\n virtualizer.startScrolling();\n setScrolling(true);\n }, [virtualizer]);\n let endScrolling = useCallback(() => {\n virtualizer.endScrolling();\n setScrolling(false);\n }, [virtualizer]);\n\n let state = useMemo(() => ({\n virtualizer,\n visibleViews,\n setVisibleRect,\n contentSize,\n isAnimating,\n isScrolling,\n startScrolling,\n endScrolling\n }), [\n virtualizer,\n visibleViews,\n setVisibleRect,\n contentSize,\n isAnimating,\n isScrolling,\n startScrolling,\n endScrolling\n ]);\n\n return state;\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {CancelablePromise, easeOut, tween} from './tween';\nimport {Collection, Key} from '@react-types/shared';\nimport {concatIterators, difference, isSetEqual} from './utils';\nimport {\n InvalidationContext,\n ScrollAnchor,\n ScrollToItemOptions,\n VirtualizerDelegate,\n VirtualizerOptions\n} from './types';\nimport {Layout} from './Layout';\nimport {LayoutInfo} from './LayoutInfo';\nimport {OverscanManager} from './OverscanManager';\nimport {Point} from './Point';\nimport {Rect} from './Rect';\nimport {ReusableView} from './ReusableView';\nimport {Size} from './Size';\nimport {Transaction} from './Transaction';\n\n/**\n * The CollectionView class renders a scrollable collection of data using customizable layouts,\n * and manages animated updates to the data over time. It supports very large collections by\n * only rendering visible views to the DOM, reusing them as you scroll. Collection views can\n * present any type of view, including non-item views such as section headers and footers.\n * Optionally, the {@link EditableCollectionView} subclass can be used to enable user interaction\n * with the collection, including drag and drop, multiple selection, and keyboard interacton.\n *\n * Collection views get their data from a {@link DataSource} object that you provide. Items are\n * grouped into sections by the data source, and the collection view calls its methods to retrieve\n * the data. When data changes, the data source emits change events, and the collection view\n * updates as appropriate, optionally with an animated transition. There is one built-in data source\n * implementation, {@link ArrayDataSource}, which renders content from a 2d array.\n *\n * Collection views use {@link Layout} objects to compute what views should be visible, and how\n * to position and style them. This means that collection views can have their items arranged in\n * a stack, a grid, a circle, or any other layout you can think of. The layout can be changed\n * dynamically at runtime as well, optionally with an animated transition between the layouts.\n *\n * Layouts produce information on what views should appear in the collection view, but do not create\n * the views themselves directly. It is the responsibility of the {@link CollectionViewDelegate} object\n * to create instances of {@link ReusableView} subclasses which render the items into DOM nodes.\n * The delegate determines what type of view to display for each item, and creates instances of\n * views as needed by the collection view. Those views are then reused by the collection view as\n * the user scrolls through the content.\n */\nexport class Virtualizer<T extends object, V, W> {\n /**\n * The collection view delegate. The delegate is used by the collection view\n * to create and configure views.\n */\n delegate: VirtualizerDelegate<T, V, W>;\n\n /** The duration of animated layout changes, in milliseconds. Default is 500ms. */\n transitionDuration: number;\n\n /**\n * Whether to enable scroll anchoring. This will attempt to restore the scroll position\n * after layout changes outside the viewport. Default is off.\n */\n anchorScrollPosition: boolean;\n\n /** Whether to anchor the scroll position when at the top of the content. Default is off. */\n anchorScrollPositionAtTop: boolean;\n\n /**\n * Whether to overscan the visible area to pre-render items slightly outside and\n * improve performance. Default is on.\n */\n shouldOverscan: boolean;\n\n private _collection: Collection<T>;\n private _layout: Layout<T>;\n private _contentSize: Size;\n private _visibleRect: Rect;\n private _visibleLayoutInfos: Map<Key, LayoutInfo>;\n private _reusableViews: {[type: string]: ReusableView<T, V>[]};\n private _visibleViews: Map<Key, ReusableView<T, V>>;\n private _renderedContent: WeakMap<T, V>;\n private _children: Set<ReusableView<T, V>>;\n private _invalidationContext: InvalidationContext<T, V> | null;\n private _overscanManager: OverscanManager;\n private _persistedKeys: Set<Key>;\n private _relayoutRaf: number | null;\n private _scrollAnimation: CancelablePromise<void> | null;\n private _isScrolling: boolean;\n private _sizeUpdateQueue: Map<Key, Size>;\n private _animatedContentOffset: Point;\n private _transaction: Transaction<T, V> | null;\n private _nextTransaction: Transaction<T, V> | null;\n private _transactionQueue: Transaction<T, V>[];\n\n constructor(options: VirtualizerOptions<T, V, W> = {}) {\n this._contentSize = new Size;\n this._visibleRect = new Rect;\n\n this._reusableViews = {};\n this._visibleLayoutInfos = new Map();\n this._visibleViews = new Map();\n this._renderedContent = new WeakMap();\n this._children = new Set();\n this._invalidationContext = null;\n this._overscanManager = new OverscanManager();\n this._persistedKeys = new Set();\n\n this._scrollAnimation = null;\n this._isScrolling = false;\n this._sizeUpdateQueue = new Map();\n this._animatedContentOffset = new Point(0, 0);\n\n this._transaction = null;\n this._nextTransaction = null;\n this._transactionQueue = [];\n\n // Set options from passed object if given\n this.transitionDuration = options.transitionDuration ?? 500;\n this.anchorScrollPosition = options.anchorScrollPosition || false;\n this.anchorScrollPositionAtTop = options.anchorScrollPositionAtTop || false;\n this.shouldOverscan = options.shouldOverscan !== false;\n for (let key of ['delegate', 'size', 'layout', 'collection']) {\n if (options[key]) {\n this[key] = options[key];\n }\n }\n }\n\n _setContentSize(size: Size) {\n this._contentSize = size;\n this.delegate.setContentSize(size);\n }\n\n _setContentOffset(offset: Point) {\n let rect = new Rect(offset.x, offset.y, this._visibleRect.width, this._visibleRect.height);\n this.delegate.setVisibleRect(rect);\n }\n\n /**\n * Get the size of the scrollable content.\n */\n get contentSize(): Size {\n return this._contentSize;\n }\n\n /**\n * Get the collection view's currently visible rectangle.\n */\n get visibleRect(): Rect {\n return this._visibleRect;\n }\n\n /**\n * Set the collection view's currently visible rectangle.\n */\n set visibleRect(rect: Rect) {\n this._setVisibleRect(rect);\n }\n\n _setVisibleRect(rect: Rect, forceUpdate = false) {\n let current = this._visibleRect;\n\n // Ignore if the rects are equal\n if (rect.equals(current)) {\n return;\n }\n\n if (this.shouldOverscan) {\n this._overscanManager.setVisibleRect(rect);\n }\n\n let shouldInvalidate = this.layout && this.layout.shouldInvalidate(rect, this._visibleRect);\n\n this._resetAnimatedContentOffset();\n this._visibleRect = rect;\n\n if (shouldInvalidate) {\n // We are already in a layout effect when this method is called, so relayoutNow is appropriate.\n this.relayoutNow({\n offsetChanged: !rect.pointEquals(current),\n sizeChanged: !rect.sizeEquals(current)\n });\n } else {\n this.updateSubviews(forceUpdate);\n }\n }\n\n get collection(): Collection<T> {\n return this._collection;\n }\n\n set collection(data: Collection<T>) {\n this._setData(data);\n }\n\n private _setData(data: Collection<T>) {\n if (data === this._collection) {\n return;\n }\n\n if (this._collection) {\n this._runTransaction(() => {\n this._collection = data;\n }, this.transitionDuration > 0);\n } else {\n this._collection = data;\n this.reloadData();\n }\n }\n\n /**\n * Reloads the data from the data source and relayouts the collection view.\n * Does not animate any changes. Equivalent to re-assigning the same data source\n * to the collection view.\n */\n reloadData() {\n this.relayout({\n contentChanged: true\n });\n }\n\n /**\n * Returns the item with the given key.\n */\n getItem(key: Key) {\n return this._collection ? this._collection.getItem(key) : null;\n }\n\n /** The set of persisted keys are always present in the DOM, even if not currently in view. */\n get persistedKeys(): Set<Key> {\n return this._persistedKeys;\n }\n\n /** The set of persisted keys are always present in the DOM, even if not currently in view. */\n set persistedKeys(persistedKeys: Set<Key>) {\n if (!isSetEqual(persistedKeys, this._persistedKeys)) {\n this._persistedKeys = persistedKeys;\n this.updateSubviews();\n }\n }\n\n /** Returns whether the given key, or an ancestor, is persisted. */\n isPersistedKey(key: Key) {\n // Quick check if the key is directly in the set of persisted keys.\n if (this._persistedKeys.has(key)) {\n return true;\n }\n\n // If not, check if the key is an ancestor of any of the persisted keys.\n for (let k of this._persistedKeys) {\n while (k != null) {\n let layoutInfo = this.layout.getLayoutInfo(k);\n if (!layoutInfo) {\n break;\n }\n\n k = layoutInfo.parentKey;\n\n if (k === key) {\n return true;\n }\n }\n }\n\n return false;\n }\n\n /**\n * Get the collection view's layout.\n */\n get layout(): Layout<T> {\n return this._layout;\n }\n\n /**\n * Set the collection view's layout.\n */\n set layout(layout: Layout<T>) {\n this.setLayout(layout);\n }\n\n /**\n * Sets the collection view's layout, optionally with an animated transition\n * from the current layout to the new layout.\n * @param layout The layout to switch to.\n * @param animated Whether to animate the layout change.\n */\n setLayout(layout: Layout<T>, animated = false) {\n if (layout === this._layout) {\n return;\n }\n\n let applyLayout = () => {\n if (this._layout) {\n // @ts-ignore\n this._layout.virtualizer = null;\n }\n\n layout.virtualizer = this;\n this._layout = layout;\n };\n\n if (animated) {\n // Animated layout transitions are really simple, thanks to our transaction support.\n // We just set the layout inside a transaction action, which runs after the initial\n // layout infos for the animation are retrieved from the previous layout. Then, the\n // final layout infos are retrieved from the new layout, and animations occur.\n this._runTransaction(applyLayout);\n } else {\n applyLayout();\n this.relayout();\n }\n }\n\n private _getReuseType(layoutInfo: LayoutInfo, content: T | null) {\n if (layoutInfo.type === 'item' && content) {\n let type = this.delegate.getType ? this.delegate.getType(content) : 'item';\n let reuseType = type === 'item' ? 'item' : layoutInfo.type + '_' + type;\n return {type, reuseType};\n }\n\n return {\n type: layoutInfo.type,\n reuseType: layoutInfo.type\n };\n }\n\n getReusableView(layoutInfo: LayoutInfo): ReusableView<T, V> {\n let content = this.getItem(layoutInfo.key);\n let {reuseType} = this._getReuseType(layoutInfo, content);\n\n if (!this._reusableViews[reuseType]) {\n this._reusableViews[reuseType] = [];\n }\n\n let reusable = this._reusableViews[reuseType];\n let view = reusable.length > 0\n ? reusable.pop()\n : new ReusableView<T, V>(this);\n\n view.viewType = reuseType;\n\n if (!this._animatedContentOffset.isOrigin()) {\n layoutInfo = layoutInfo.copy();\n layoutInfo.rect.x += this._animatedContentOffset.x;\n layoutInfo.rect.y += this._animatedContentOffset.y;\n }\n\n view.layoutInfo = layoutInfo;\n\n this._renderView(view);\n return view;\n }\n\n private _renderView(reusableView: ReusableView<T, V>) {\n let {type, key} = reusableView.layoutInfo;\n reusableView.content = this.getItem(key);\n reusableView.rendered = this._renderContent(type, reusableView.content);\n }\n\n private _renderContent(type: string, content: T) {\n let cached = this._renderedContent.get(content);\n if (cached != null) {\n return cached;\n }\n\n let rendered = this.delegate.renderView(type, content);\n if (content) {\n this._renderedContent.set(content, rendered);\n }\n return rendered;\n }\n\n /**\n * Returns an array of all currently visible views, including both\n * item views and supplementary views.\n */\n get visibleViews(): ReusableView<T, V>[] {\n return Array.from(this._visibleViews.values());\n }\n\n /**\n * Gets the visible view for the given type and key. Returns null if\n * the view is not currently visible.\n *\n * @param key The key of the view to retrieve.\n */\n getView(key: Key): ReusableView<T, V> | null {\n return this._visibleViews.get(key) || null;\n }\n\n /**\n * Returns an array of visible views matching the given type.\n * @param type The view type to find.\n */\n getViewsOfType(type: string): ReusableView<T, V>[] {\n return this.visibleViews.filter(v => v.layoutInfo && v.layoutInfo.type === type);\n }\n\n /**\n * Returns the key for the given view. Returns null\n * if the view is not currently visible.\n */\n keyForView(view: ReusableView<T, V>): Key | null {\n if (view && view.layoutInfo) {\n return view.layoutInfo.key;\n }\n\n return null;\n }\n\n /**\n * Returns the key for the item view currently at the given point.\n */\n keyAtPoint(point: Point): Key | null {\n let rect = new Rect(point.x, point.y, 1, 1);\n let layoutInfos = this.layout.getVisibleLayoutInfos(rect);\n\n // Layout may return multiple layout infos in the case of\n // persisted keys, so find the first one that actually intersects.\n for (let layoutInfo of layoutInfos) {\n if (layoutInfo.rect.intersects(rect)) {\n return layoutInfo.key;\n }\n }\n\n return null;\n }\n\n /**\n * Cleanup for when the Virtualizer will be unmounted.\n */\n willUnmount() {\n cancelAnimationFrame(this._relayoutRaf);\n }\n\n /**\n * Triggers a layout invalidation, and updates the visible subviews.\n */\n relayout(context: InvalidationContext<T, V> = {}) {\n // Ignore relayouts while animating the scroll position\n if (this._scrollAnimation || typeof requestAnimationFrame === 'undefined') {\n return;\n }\n\n // If we already scheduled a relayout, extend the invalidation\n // context so we coalesce multiple relayouts in the same frame.\n if (this._invalidationContext) {\n Object.assign(this._invalidationContext, context);\n return;\n }\n\n this._invalidationContext = context;\n }\n\n /**\n * Performs a relayout immediately. Prefer {@link relayout} over this method\n * where possible, since it coalesces multiple layout passes in the same tick.\n */\n relayoutNow(context: InvalidationContext<T, V> = this._invalidationContext || {}) {\n // Cancel the scheduled relayout, since we're doing it now.\n if (this._relayoutRaf) {\n cancelAnimationFrame(this._relayoutRaf);\n this._relayoutRaf = null;\n // Update the provided context with the current invalidationContext since we are cancelling\n // a scheduled relayoutNow call that has this._invalidationContext set as its default context arg (relayoutNow() in relayout)\n context = {...this._invalidationContext, ...context};\n }\n\n // Reset the invalidation context\n this._invalidationContext = null;\n\n // Do nothing if we don't have a layout or content, or we are\n // in the middle of an animated scroll transition.\n if (!this.layout || !this._collection || this._scrollAnimation) {\n return;\n }\n\n let scrollAnchor = this._getScrollAnchor();\n\n // Trigger the beforeLayout hook, if provided\n if (typeof context.beforeLayout === 'function') {\n context.beforeLayout();\n }\n\n // Validate the layout\n this.layout.validate(context);\n this._setContentSize(this.layout.getContentSize());\n\n // Trigger the afterLayout hook, if provided\n if (typeof context.afterLayout === 'function') {\n context.afterLayout();\n }\n\n // Adjust scroll position based on scroll anchor, and constrain.\n // If the content changed, scroll to the top.\n let visibleRect = this.getVisibleRect();\n let restoredScrollAnchor = this._restoreScrollAnchor(scrollAnchor, context);\n let contentOffsetX = context.contentChanged ? 0 : restoredScrollAnchor.x;\n let contentOffsetY = context.contentChanged ? 0 : restoredScrollAnchor.y;\n contentOffsetX = Math.max(0, Math.min(this.contentSize.width - visibleRect.width, contentOffsetX));\n contentOffsetY = Math.max(0, Math.min(this.contentSize.height - visibleRect.height, contentOffsetY));\n\n let hasLayoutUpdates = false;\n if (contentOffsetX !== visibleRect.x || contentOffsetY !== visibleRect.y) {\n // If this is an animated relayout, we do not immediately scroll because it would be jittery.\n // Save the difference between the current and new content offsets, and apply it to the\n // individual content items instead. At the end of the animation, we'll reset and set the\n // scroll offset for real. This ensures jitter-free animation since we don't need to sync\n // the scroll animation and the content animation.\n if (context.animated || !this._animatedContentOffset.isOrigin()) {\n this._animatedContentOffset.x += visibleRect.x - contentOffsetX;\n this._animatedContentOffset.y += visibleRect.y - contentOffsetY;\n hasLayoutUpdates = this.updateSubviews(context.contentChanged);\n } else {\n this._setContentOffset(new Point(contentOffsetX, contentOffsetY));\n }\n } else {\n hasLayoutUpdates = this.updateSubviews(context.contentChanged);\n }\n\n // Apply layout infos, unless this is coming from an animated transaction\n if (!(context.transaction && context.animated)) {\n this._applyLayoutInfos();\n }\n\n // Wait for animations, and apply the afterAnimation hook, if provided\n if (context.animated && hasLayoutUpdates) {\n this._enableTransitions();\n\n let done = () => {\n this._disableTransitions();\n\n // Reset scroll position after animations (see above comment).\n if (!this._animatedContentOffset.isOrigin()) {\n // Get the content offset to scroll to, taking _animatedContentOffset into account.\n let {x, y} = this.getVisibleRect();\n this._resetAnimatedContentOffset();\n this._setContentOffset(new Point(x, y));\n }\n\n if (typeof context.afterAnimation === 'function') {\n context.afterAnimation();\n }\n };\n\n // Sometimes the animation takes slightly longer than expected.\n setTimeout(done, this.transitionDuration + 100);\n return;\n } else if (typeof context.afterAnimation === 'function') {\n context.afterAnimation();\n }\n }\n\n /**\n * Corrects DOM order of visible views to match item order of collection.\n */\n private _correctItemOrder() {\n // Defer until after scrolling and animated transactions are complete\n if (this._isScrolling || this._transaction) {\n return;\n }\n\n for (let key of this._visibleLayoutInfos.keys()) {\n let view = this._visibleViews.get(key);\n this._children.delete(view);\n this._children.add(view);\n }\n }\n\n private _enableTransitions() {\n this.delegate.beginAnimations();\n }\n\n private _disableTransitions() {\n this.delegate.endAnimations();\n }\n\n private _getScrollAnchor(): ScrollAnchor | null {\n if (!this.anchorScrollPosition) {\n return null;\n }\n\n let visibleRect = this.getVisibleRect();\n\n // Ask the delegate to provide a scroll anchor, if possible\n if (this.delegate.getScrollAnchor) {\n let key = this.delegate.getScrollAnchor(visibleRect);\n if (key != null) {\n let layoutInfo = this.layout.getLayoutInfo(key);\n let corner = layoutInfo.rect.getCornerInRect(visibleRect);\n if (corner) {\n let key = layoutInfo.key;\n let offset = layoutInfo.rect[corner].y - visibleRect.y;\n return {key, layoutInfo, corner, offset};\n }\n }\n }\n\n // No need to anchor the scroll position if it is at the top\n if (visibleRect.y === 0 && !this.anchorScrollPositionAtTop) {\n return null;\n }\n\n // Find a view with a visible corner that has the smallest distance to the top of the collection view\n let cornerAnchor: ScrollAnchor | null = null;\n\n for (let [key, view] of this._visibleViews) {\n let layoutInfo = view.layoutInfo;\n if (layoutInfo && layoutInfo.rect.area > 0) {\n let corner = layoutInfo.rect.getCornerInRect(visibleRect);\n\n if (corner) {\n let offset = layoutInfo.rect[corner].y - visibleRect.y;\n if (!cornerAnchor || (offset < cornerAnchor.offset)) {\n cornerAnchor = {key, layoutInfo, corner, offset};\n }\n }\n }\n }\n\n return cornerAnchor;\n }\n\n private _restoreScrollAnchor(scrollAnchor: ScrollAnchor | null, context: InvalidationContext<T, V>) {\n let contentOffset = this.getVisibleRect();\n\n if (scrollAnchor) {\n let finalAnchor = context.transaction?.animated\n ? context.transaction.finalMap.get(scrollAnchor.key)\n : this.layout.getLayoutInfo(scrollAnchor.layoutInfo.key);\n\n if (finalAnchor) {\n let adjustment = (finalAnchor.rect[scrollAnchor.corner].y - contentOffset.y) - scrollAnchor.offset;\n contentOffset.y += adjustment;\n }\n }\n\n return contentOffset;\n }\n\n getVisibleRect(): Rect {\n let v = this.visibleRect;\n let x = v.x - this._animatedContentOffset.x;\n let y = v.y - this._animatedContentOffset.y;\n return new Rect(x, y, v.width, v.height);\n }\n\n getVisibleLayoutInfos() {\n let isTestEnv = process.env.NODE_ENV === 'test' && !process.env.VIRT_ON;\n\n let isClientWidthMocked = Object.getOwnPropertyNames(window.HTMLElement.prototype).includes('clientWidth');\n let isClientHeightMocked = Object.getOwnPropertyNames(window.HTMLElement.prototype).includes('clientHeight');\n\n let rect;\n if (isTestEnv && !(isClientWidthMocked && isClientHeightMocked)) {\n rect = this._getContentRect();\n } else {\n rect = this.shouldOverscan ? this._overscanManager.getOverscannedRect() : this.getVisibleRect();\n }\n\n this._visibleLayoutInfos = this._getLayoutInfoMap(rect);\n return this._visibleLayoutInfos;\n }\n\n private _getLayoutInfoMap(rect: Rect, copy = false) {\n let layoutInfos = this.layout.getVisibleLayoutInfos(rect);\n let map = new Map;\n\n for (let layoutInfo of layoutInfos) {\n if (copy) {\n layoutInfo = layoutInfo.copy();\n }\n\n map.set(layoutInfo.key, layoutInfo);\n }\n\n return map;\n }\n\n updateSubviews(forceUpdate = false) {\n if (!this._collection) {\n return;\n }\n\n let visibleLayoutInfos = this.getVisibleLayoutInfos();\n let currentlyVisible = this._visibleViews;\n let toAdd, toRemove, toUpdate;\n\n // If this is a force update, remove and re-add all views.\n // Otherwise, find and update the diff.\n if (forceUpdate) {\n toAdd = visibleLayoutInfos;\n toRemove = currentlyVisible;\n toUpdate = new Set();\n } else {\n ({toAdd, toRemove, toUpdate} = difference(currentlyVisible, visibleLayoutInfos));\n\n for (let key of toUpdate) {\n let view = currentlyVisible.get(key);\n if (!view || !view.layoutInfo) {\n continue;\n }\n\n let item = this.getItem(visibleLayoutInfos.get(key).key);\n if (view.content === item) {\n toUpdate.delete(key);\n } else {\n // If the view type changes, delete and recreate the view instead of updating\n let {reuseType} = this._getReuseType(view.layoutInfo, item);\n if (view.viewType !== reuseType) {\n toUpdate.delete(key);\n toAdd.add(key);\n toRemove.add(key);\n }\n }\n }\n\n // We are done if the sets are equal\n if (toAdd.size === 0 && toRemove.size === 0 && toUpdate.size === 0) {\n if (this._transaction) {\n this._applyLayoutInfos();\n }\n\n return;\n }\n }\n\n // Track views that should be removed. They are not removed from\n // the DOM immediately, since we may reuse and need to re-insert\n // them back into the DOM anyway.\n let removed = new Set<ReusableView<T, V>>();\n\n for (let key of toRemove.keys()) {\n let view = this._visibleViews.get(key);\n if (view) {\n removed.add(view);\n this._visibleViews.delete(key);\n\n // If we are in the middle of a transaction, wait until the end\n // of the animations to remove the views from the DOM. Also means\n // we can't reuse those views immediately.\n if (this._transaction) {\n this._transaction.toRemove.set(key, view);\n } else {\n this.reuseView(view);\n }\n }\n }\n\n for (let key of toAdd.keys()) {\n let layoutInfo = visibleLayoutInfos.get(key);\n let view: ReusableView<T, V> | void;\n\n // If we're in a transaction, and a layout change happens\n // during the animations such that a view that was going\n // to be removed is now not, we don't create a new view\n // since the old one is still in the DOM, marked as toRemove.\n if (this._transaction) {\n // if transaction, get initial layout attributes for the animation\n if (this._transaction.initialLayoutInfo.has(key)) {\n layoutInfo = this._transaction.initialLayoutInfo.get(key);\n }\n\n view = this._transaction.toRemove.get(key);\n if (view) {\n this._transaction.toRemove.delete(key);\n this._applyLayoutInfo(view, layoutInfo);\n }\n }\n\n if (!view) {\n // Create or reuse a view for this row\n view = this.getReusableView(layoutInfo);\n\n // Add the view to the DOM if needed\n if (!removed.has(view)) {\n this._children.add(view);\n }\n }\n\n this._visibleViews.set(key, view);\n removed.delete(view);\n }\n\n for (let key of toUpdate) {\n let view = currentlyVisible.get(key) as ReusableView<T, V>;\n this._renderedContent.delete(key);\n this._renderView(view);\n }\n\n // Remove the remaining rows to delete from the DOM\n if (!this._transaction) {\n this.removeViews(removed);\n }\n\n this._correctItemOrder();\n this._flushVisibleViews();\n\n let hasLayoutUpdates = this._transaction && (toAdd.size > 0 || toRemove.size > 0 || this._hasLayoutUpdates());\n if (hasLayoutUpdates) {\n requestAnimationFrame(() => {\n // If we're in a transaction, apply animations to visible views\n // and \"to be removed\" views, which animate off screen.\n if (this._transaction) {\n requestAnimationFrame(() => this._applyLayoutInfos());\n }\n });\n }\n\n return hasLayoutUpdates;\n }\n\n afterRender() {\n if (this._transactionQueue.length > 0) {\n this._processTransactionQueue();\n } else if (this._invalidationContext) {\n this.relayoutNow();\n }\n\n if (this.shouldOverscan) {\n this._overscanManager.collectMetrics();\n }\n }\n\n private _flushVisibleViews() {\n // CollectionVirtualizer deals with a flattened set of LayoutInfos, but they can represent hierarchy\n // by referencing a parentKey. Just before rendering the visible views, we rebuild this hierarchy\n // by creating a mapping of views by parent key and recursively calling the delegate's renderWrapper\n // method to build the final tree.\n let viewsByParentKey = new Map([[null, []]]);\n for (let view of this._children) {\n if (view.layoutInfo?.parentKey != null && !viewsByParentKey.has(view.layoutInfo.parentKey)) {\n viewsByParentKey.set(view.layoutInfo.parentKey, []);\n }\n\n viewsByParentKey.get(view.layoutInfo?.parentKey)?.push(view);\n if (!viewsByParentKey.has(view.layoutInfo?.key)) {\n viewsByParentKey.set(view.layoutInfo?.key, []);\n }\n }\n\n let buildTree = (parent: ReusableView<T, V>, views: ReusableView<T, V>[]): W[] => views.map(view => {\n let children = viewsByParentKey.get(view.layoutInfo.key);\n return this.delegate.renderWrapper(\n parent,\n view,\n children,\n (childViews) => buildTree(view, childViews)\n );\n });\n\n let children = buildTree(null, viewsByParentKey.get(null));\n this.delegate.setVisibleViews(children);\n }\n\n private _applyLayoutInfo(view: ReusableView<T, V>, layoutInfo: LayoutInfo) {\n if (view.layoutInfo === layoutInfo) {\n return false;\n }\n\n view.layoutInfo = layoutInfo;\n return true;\n }\n\n private _applyLayoutInfos() {\n let updated = false;\n\n // Apply layout infos to visible views\n for (let view of this._visibleViews.values()) {\n let cur = view.layoutInfo;\n if (cur?.key != null) {\n let layoutInfo = this.layout.getLayoutInfo(cur.key);\n if (this._applyLayoutInfo(view, layoutInfo)) {\n updated = true;\n }\n }\n }\n\n // Apply final layout infos for views that will be removed\n if (this._transaction) {\n for (let view of this._transaction.toRemove.values()) {\n let cur = view.layoutInfo;\n if (cur?.key != null) {\n let layoutInfo = this.layout.getLayoutInfo(cur.key);\n if (this._applyLayoutInfo(view, layoutInfo)) {\n updated = true;\n }\n }\n }\n\n for (let view of this._transaction.removed.values()) {\n let cur = view.layoutInfo;\n let layoutInfo = this._transaction.finalLayoutInfo.get(cur.key) || cur;\n layoutInfo = this.layout.getFinalLayoutInfo(layoutInfo.copy());\n if (this._applyLayoutInfo(view, layoutInfo)) {\n updated = true;\n }\n }\n }\n\n if (updated) {\n this._flushVisibleViews();\n }\n }\n\n private _hasLayoutUpdates() {\n if (!this._transaction) {\n return false;\n }\n\n for (let view of this._visibleViews.values()) {\n let cur = view.layoutInfo;\n if (!cur) {\n return true;\n }\n\n let layoutInfo = this.layout.getLayoutInfo(cur.key);\n if (\n // Uses equals rather than pointEquals so that width/height changes are taken into account\n !cur.rect.equals(layoutInfo.rect) ||\n cur.opacity !== layoutInfo.opacity ||\n cur.transform !== layoutInfo.transform\n ) {\n return true;\n }\n }\n\n return false;\n }\n\n reuseView(view: ReusableView<T, V>) {\n view.prepareForReuse();\n this._reusableViews[view.viewType].push(view);\n }\n\n removeViews(toRemove: Set<ReusableView<T, V>>) {\n for (let view of toRemove) {\n this._children.delete(view);\n }\n }\n\n updateItemSize(key: Key, size: Size) {\n // TODO: we should be able to invalidate a single index path\n // @ts-ignore\n if (!this.layout.updateItemSize) {\n return;\n }\n\n // If the scroll position is currently animating, add the update\n // to a queue to be processed after the animation is complete.\n if (this._scrollAnimation) {\n this._sizeUpdateQueue.set(key, size);\n return;\n }\n\n // @ts-ignore\n let changed = this.layout.updateItemSize(key, size);\n if (changed) {\n this.relayout();\n }\n }\n\n startScrolling() {\n this._isScrolling = true;\n }\n\n endScrolling() {\n this._isScrolling = false;\n this._correctItemOrder();\n this._flushVisibleViews();\n }\n\n private _resetAnimatedContentOffset() {\n // Reset the animated content offset of subviews. See comment in relayoutNow for details.\n if (!this._animatedContentOffset.isOrigin()) {\n this._animatedContentOffset = new Point(0, 0);\n this._applyLayoutInfos();\n }\n }\n\n /**\n * Scrolls the item with the given key into view, optionally with an animation.\n * @param key The key of the item to scroll into view.\n * @param duration The duration of the scroll animation.\n */\n scrollToItem(key: Key, options?: ScrollToItemOptions) {\n // key can be 0, so check if null or undefined\n if (key == null) {\n return;\n }\n\n let layoutInfo = this.layout.getLayoutInfo(key);\n if (!layoutInfo) {\n return;\n }\n\n let {\n duration = 300,\n shouldScrollX = true,\n shouldScrollY = true,\n offsetX = 0,\n offsetY = 0\n } = options;\n\n let x = this.visibleRect.x;\n let y = this.visibleRect.y;\n let minX = layoutInfo.rect.x - offsetX;\n let minY = layoutInfo.rect.y - offsetY;\n let maxX = x + this.visibleRect.width;\n let maxY = y + this.visibleRect.height;\n\n if (shouldScrollX) {\n if (minX <= x || maxX === 0) {\n x = minX;\n } else if (layoutInfo.rect.maxX > maxX) {\n x += layoutInfo.rect.maxX - maxX;\n }\n }\n\n if (shouldScrollY) {\n if (minY <= y || maxY === 0) {\n y = minY;\n } else if (layoutInfo.rect.maxY > maxY) {\n y += layoutInfo.rect.maxY - maxY;\n }\n }\n\n return this.scrollTo(new Point(x, y), duration);\n }\n\n /**\n * Performs an animated scroll to the given offset.\n * @param offset - The offset to scroll to.\n * @param duration The duration of the animation.\n * @returns A promise that resolves when the animation is complete.\n */\n scrollTo(offset: Point, duration: number = 300): Promise<void> {\n // Cancel the current scroll animation\n if (this._scrollAnimation) {\n this._scrollAnimation.cancel();\n this._scrollAnimation = null;\n }\n\n // Set the content offset synchronously if the duration is zero\n if (duration <= 0 || this.visibleRect.pointEquals(offset)) {\n this._setContentOffset(offset);\n return Promise.resolve();\n }\n\n this.startScrolling();\n\n this._scrollAnimation = tween(this.visibleRect, offset, duration, easeOut, offset => {this._setContentOffset(offset);});\n this._scrollAnimation.then(() => {\n this._scrollAnimation = null;\n\n // Process view size updates that occurred during the animation.\n // Only views that are still visible will be actually updated.\n for (let [key, size] of this._sizeUpdateQueue) {\n this.updateItemSize(key, size);\n }\n\n this._sizeUpdateQueue.clear();\n this.relayout();\n this._processTransactionQueue();\n this.endScrolling();\n });\n\n return this._scrollAnimation;\n }\n\n private _runTransaction(action: () => void, animated?: boolean) {\n this._startTransaction();\n if (this._nextTransaction) {\n this._nextTransaction.actions.push(action);\n }\n this._endTransaction(animated);\n }\n\n private _startTransaction() {\n if (!this._nextTransaction) {\n this._nextTransaction = new Transaction;\n }\n\n this._nextTransaction.level++;\n }\n\n private _endTransaction(animated?: boolean) {\n if (!this._nextTransaction) {\n return false;\n }\n\n // Save whether the transaction should be animated.\n if (animated != null) {\n this._nextTransaction.animated = animated;\n }\n\n // If we haven't reached level 0, we are still in a\n // nested transaction. Wait for the parent to end.\n if (--this._nextTransaction.level > 0) {\n return false;\n }\n\n // Do nothing for empty transactions\n if (this._nextTransaction.actions.length === 0) {\n this._nextTransaction = null;\n return false;\n }\n\n // Default animations to true\n if (this._nextTransaction.animated == null) {\n this._nextTransaction.animated = true;\n }\n\n // Enqueue the transaction\n this._transactionQueue.push(this._nextTransaction);\n this._nextTransaction = null;\n\n return true;\n }\n\n private _processTransactionQueue() {\n // If the current transaction is animating, wait until the end\n // to process the next transaction.\n if (this._transaction || this._scrollAnimation) {\n return;\n }\n\n let next = this._transactionQueue.shift();\n if (next) {\n this._performTransaction(next);\n }\n }\n\n private _getContentRect(): Rect {\n return new Rect(0, 0, this.contentSize.width, this.contentSize.height);\n }\n\n private _performTransaction(transaction: Transaction<T, V>) {\n this._transaction = transaction;\n\n this.relayoutNow({\n transaction: transaction,\n animated: transaction.animated,\n\n beforeLayout: () => {\n // Get the initial layout infos for all views before the updates\n // so we can figure out which views to add and remove.\n if (transaction.animated) {\n transaction.initialMap = this._getLayoutInfoMap(this._getContentRect(), true);\n }\n\n // Apply the actions that occurred during this transaction\n for (let action of transaction.actions) {\n action();\n }\n },\n\n afterLayout: () => {\n // Get the final layout infos after the updates\n if (transaction.animated) {\n transaction.finalMap = this._getLayoutInfoMap(this._getContentRect());\n this._setupTransactionAnimations(transaction);\n } else {\n this._transaction = null;\n }\n },\n\n afterAnimation: () => {\n // Remove and reuse views when animations are done\n if (transaction.toRemove.size > 0 || transaction.removed.size > 0) {\n for (let view of concatIterators(transaction.toRemove.values(), transaction.removed.values())) {\n this._children.delete(view);\n this.reuseView(view);\n }\n }\n\n this._transaction = null;\n\n // Ensure DOM order is correct for accessibility after animations are complete\n this._correctItemOrder();\n this._flushVisibleViews();\n\n this._processTransactionQueue();\n }\n });\n }\n\n private _setupTransactionAnimations(transaction: Transaction<T, V>) {\n let {initialMap, finalMap} = transaction;\n\n // Store initial and final layout infos for animations\n for (let [key, layoutInfo] of initialMap) {\n if (finalMap.has(key)) {\n // Store the initial layout info for use during animations.\n transaction.initialLayoutInfo.set(key, layoutInfo);\n } else {\n // This view was removed. Store the layout info for use\n // in Layout#getFinalLayoutInfo during animations.\n transaction.finalLayoutInfo.set(layoutInfo.key, layoutInfo);\n }\n }\n\n // Get initial layout infos for views that were added\n for (let [key, layoutInfo] of finalMap) {\n if (!initialMap.has(key)) {\n let initialLayoutInfo = this.layout.getInitialLayoutInfo(layoutInfo.copy());\n transaction.initialLayoutInfo.set(key, initialLayoutInfo);\n }\n }\n\n // Figure out which views were removed.\n for (let [key, view] of this._visibleViews) {\n // If an item has a width of 0, there is no need to remove it from the _visibleViews.\n // Removing an item with width of 0 can cause a loop where the item gets added, removed,\n // added, removed... etc in a loop.\n if (!finalMap.has(key) && view.layoutInfo.rect.width > 0) {\n transaction.removed.set(key, view);\n this._visibleViews.delete(key);\n\n // In case something weird happened, where we have a view but no\n // initial layout info, use the one attached to the view.\n if (view.layoutInfo) {\n if (!transaction.finalLayoutInfo.has(view.layoutInfo.key)) {\n transaction.finalLayoutInfo.set(view.layoutInfo.key, view.layoutInfo);\n }\n }\n }\n }\n }\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {Point} from './Point';\n\n// use high res timer if available\nlet perf = typeof window !== 'undefined' ? window.performance : null;\n// @ts-ignore\nlet perfNow = perf && (perf.now || perf.webkitNow || perf.msNow || perf.mozNow);\nlet getTime = perfNow ? perfNow.bind(perf) : function () {\n return Date.now ? Date.now() : new Date().getTime();\n};\n\nlet fixTs: boolean;\n\nexport interface CancelablePromise<T> extends Promise<T> {\n cancel(): void\n}\n\nexport function tween(begin, end, duration, ease, fn): CancelablePromise<void> {\n let canceled = false;\n let raf_id: number;\n\n let promise = new Promise(resolve => {\n let start = getTime();\n let diffX = end.x - begin.x;\n let diffY = end.y - begin.y;\n\n raf_id = requestAnimationFrame(function run(t) {\n // if we're using a high res timer, make sure timestamp is not the old epoch-based value.\n // http://updates.html5rocks.com/2012/05/requestAnimationFrame-API-now-with-sub-millisecond-precision\n if (fixTs == null) {\n fixTs = t > 1e12 !== getTime() > 1e12;\n }\n\n if (fixTs) {\n t = getTime();\n }\n\n // check if we're done\n let delta = t - start;\n if (delta > duration) {\n fn(end);\n resolve();\n } else {\n // call frame callback after computing eased time and get the next frame\n let proceed = fn(new Point(\n begin.x + diffX * ease(delta / duration),\n begin.y + diffY * ease(delta / duration)\n ));\n\n if (proceed !== false && !canceled) {\n raf_id = requestAnimationFrame(run);\n }\n }\n });\n }) as CancelablePromise<void>;\n\n promise.cancel = function () {\n canceled = true;\n cancelAnimationFrame(raf_id);\n };\n\n return promise;\n}\n\n// easing functions\nexport function linearEasing(t) {\n return t;\n}\n\nexport function easeOut(t) {\n return Math.sin(t * Math.PI / 2);\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport function keyDiff<T>(a: Map<T, any>, b: Map<T, any>): Set<T> {\n let res = new Set<T>();\n\n for (let key of a.keys()) {\n if (!b.has(key)) {\n res.add(key);\n }\n }\n\n return res;\n}\n\n/**\n * Returns the key difference between two maps. Returns a set of\n * keys to add to and remove from a to make it equal to b.\n * @private\n */\nexport function difference<T>(a: Map<T, any>, b: Map<T, any>) {\n let toRemove = keyDiff(a, b);\n let toAdd = keyDiff(b, a);\n let toUpdate = new Set;\n for (let key of a.keys()) {\n if (b.has(key)) {\n toUpdate.add(key);\n }\n }\n return {toRemove, toAdd, toUpdate};\n}\n\n/**\n * Returns an iterator that yields the items in all of the given iterators.\n * @private\n */\nexport function* concatIterators<T>(...iterators: Iterable<T>[]) {\n for (let iterator of iterators) {\n yield* iterator;\n }\n}\n\n/**\n * Inverts the keys and values of an object.\n * @private\n */\nexport function invert(object) {\n let res = {};\n for (let key in object) {\n res[object[key]] = key;\n }\n\n return res;\n}\n\n/** Returns whether two sets are equal. */\nexport function isSetEqual<T>(a: Set<T>, b: Set<T>): boolean {\n if (a === b) {\n return true;\n }\n\n if (a.size !== b.size) {\n return false;\n }\n\n for (let key of a) {\n if (!b.has(key)) {\n return false;\n }\n }\n\n return true;\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {Point} from './Point';\nimport {Rect} from './Rect';\n\nclass RollingAverage {\n private count: number = 0;\n value: number = 0;\n \n addSample(sample: number) {\n this.count++;\n this.value += (sample - this.value) / this.count;\n }\n}\n\nexport class OverscanManager {\n private startTime = 0;\n private averagePerf = new RollingAverage();\n private averageTime = new RollingAverage();\n private velocity = new Point(5, 5);\n private overscanX = new RollingAverage();\n private overscanY = new RollingAverage();\n private visibleRect = new Rect();\n \n setVisibleRect(rect: Rect) {\n let time = performance.now() - this.startTime;\n if (time < 500) {\n this.averageTime.addSample(time);\n\n if (rect.x !== this.visibleRect.x && time > 0) {\n this.velocity.x = (rect.x - this.visibleRect.x) / time;\n }\n\n if (rect.y !== this.visibleRect.y && time > 0) {\n this.velocity.y = (rect.y - this.visibleRect.y) / time;\n }\n }\n\n this.startTime = performance.now();\n this.visibleRect = rect;\n }\n\n collectMetrics() {\n let time = performance.now() - this.startTime;\n if (time < 500) {\n this.averagePerf.addSample(time);\n }\n\n if (this.visibleRect.height > 0) {\n let o = Math.abs(this.velocity.y * (this.averageTime.value + this.averagePerf.value)); \n this.overscanY.addSample(o);\n }\n\n if (this.visibleRect.width > 0) {\n let o = Math.abs(this.velocity.x * (this.averageTime.value + this.averagePerf.value)); \n this.overscanX.addSample(o);\n }\n }\n\n getOverscannedRect() {\n let overscanned = this.visibleRect.copy();\n\n let overscanY = Math.round(Math.min(this.visibleRect.height * 2, this.overscanY.value) / 100) * 100;\n if (this.velocity.y > 0) {\n overscanned.y -= overscanY * 0.2;\n overscanned.height += overscanY + overscanY * 0.2;\n } else {\n overscanned.y -= overscanY;\n overscanned.height += overscanY + overscanY * 0.2;\n }\n\n let overscanX = Math.round(Math.min(this.visibleRect.width * 2, this.overscanX.value) / 100) * 100;\n if (this.velocity.x > 0) {\n overscanned.x -= overscanX * 0.2;\n overscanned.width += overscanX + overscanX * 0.2;\n } else {\n overscanned.x -= overscanX;\n overscanned.width += overscanX + overscanX * 0.2;\n }\n\n return overscanned;\n }\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {Key} from '@react-types/shared';\nimport {LayoutInfo} from './LayoutInfo';\nimport {ReusableView} from './ReusableView';\n\ntype LayoutInfoMap = Map<Key, LayoutInfo>;\nexport class Transaction<T extends object, V> {\n level = 0;\n actions: (() => void)[] = [];\n animated = true;\n initialMap: LayoutInfoMap = new Map();\n finalMap: LayoutInfoMap = new Map();\n initialLayoutInfo: LayoutInfoMap = new Map();\n finalLayoutInfo: LayoutInfoMap = new Map();\n removed: Map<Key, ReusableView<T, V>> = new Map();\n toRemove: Map<Key, ReusableView<T, V>> = new Map();\n}\n"],"names":[],"version":3,"file":"module.js.map"}
1
+ {"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC","sources":["packages/@react-stately/virtualizer/src/index.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport type {InvalidationContext} from './types';\nexport type {VirtualizerState} from './useVirtualizerState';\nexport type {RectCorner} from './Rect';\n\nexport {Layout} from './Layout';\nexport {LayoutInfo} from './LayoutInfo';\nexport {Point} from './Point';\nexport {Rect} from './Rect';\nexport {Size} from './Size';\nexport {ReusableView} from './ReusableView';\nexport {useVirtualizerState} from './useVirtualizerState';\n"],"names":[],"version":3,"file":"module.js.map"}
@@ -0,0 +1,67 @@
1
+ var $f89f15d7f52bce29$exports = require("./Point.main.js");
2
+
3
+
4
+ function $parcel$export(e, n, v, s) {
5
+ Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
6
+ }
7
+
8
+ $parcel$export(module.exports, "tween", () => $57c5d36217e1f286$export$dc0b63720788090c);
9
+ $parcel$export(module.exports, "easeOut", () => $57c5d36217e1f286$export$57636bb43b1ccbb0);
10
+ /*
11
+ * Copyright 2020 Adobe. All rights reserved.
12
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
13
+ * you may not use this file except in compliance with the License. You may obtain a copy
14
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
15
+ *
16
+ * Unless required by applicable law or agreed to in writing, software distributed under
17
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
18
+ * OF ANY KIND, either express or implied. See the License for the specific language
19
+ * governing permissions and limitations under the License.
20
+ */
21
+ // use high res timer if available
22
+ let $57c5d36217e1f286$var$perf = typeof window !== "undefined" ? window.performance : null;
23
+ // @ts-ignore
24
+ let $57c5d36217e1f286$var$perfNow = $57c5d36217e1f286$var$perf && ($57c5d36217e1f286$var$perf.now || $57c5d36217e1f286$var$perf.webkitNow || $57c5d36217e1f286$var$perf.msNow || $57c5d36217e1f286$var$perf.mozNow);
25
+ let $57c5d36217e1f286$var$getTime = $57c5d36217e1f286$var$perfNow ? $57c5d36217e1f286$var$perfNow.bind($57c5d36217e1f286$var$perf) : function() {
26
+ return Date.now ? Date.now() : new Date().getTime();
27
+ };
28
+ let $57c5d36217e1f286$var$fixTs;
29
+ function $57c5d36217e1f286$export$dc0b63720788090c(begin, end, duration, ease, fn) {
30
+ let canceled = false;
31
+ let raf_id;
32
+ let promise = new Promise((resolve)=>{
33
+ let start = $57c5d36217e1f286$var$getTime();
34
+ let diffX = end.x - begin.x;
35
+ let diffY = end.y - begin.y;
36
+ raf_id = requestAnimationFrame(function run(t) {
37
+ // if we're using a high res timer, make sure timestamp is not the old epoch-based value.
38
+ // http://updates.html5rocks.com/2012/05/requestAnimationFrame-API-now-with-sub-millisecond-precision
39
+ if ($57c5d36217e1f286$var$fixTs == null) $57c5d36217e1f286$var$fixTs = t > 1e12 !== $57c5d36217e1f286$var$getTime() > 1e12;
40
+ if ($57c5d36217e1f286$var$fixTs) t = $57c5d36217e1f286$var$getTime();
41
+ // check if we're done
42
+ let delta = t - start;
43
+ if (delta > duration) {
44
+ fn(end);
45
+ resolve();
46
+ } else {
47
+ // call frame callback after computing eased time and get the next frame
48
+ let proceed = fn(new (0, $f89f15d7f52bce29$exports.Point)(begin.x + diffX * ease(delta / duration), begin.y + diffY * ease(delta / duration)));
49
+ if (proceed !== false && !canceled) raf_id = requestAnimationFrame(run);
50
+ }
51
+ });
52
+ });
53
+ promise.cancel = function() {
54
+ canceled = true;
55
+ cancelAnimationFrame(raf_id);
56
+ };
57
+ return promise;
58
+ }
59
+ function $57c5d36217e1f286$export$77860c106b4a6a2e(t) {
60
+ return t;
61
+ }
62
+ function $57c5d36217e1f286$export$57636bb43b1ccbb0(t) {
63
+ return Math.sin(t * Math.PI / 2);
64
+ }
65
+
66
+
67
+ //# sourceMappingURL=tween.main.js.map
@@ -0,0 +1 @@
1
+ {"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC;AAID,kCAAkC;AAClC,IAAI,6BAAO,OAAO,WAAW,cAAc,OAAO,WAAW,GAAG;AAChE,aAAa;AACb,IAAI,gCAAU,8BAAS,CAAA,2BAAK,GAAG,IAAI,2BAAK,SAAS,IAAI,2BAAK,KAAK,IAAI,2BAAK,MAAM,AAAD;AAC7E,IAAI,gCAAU,gCAAU,8BAAQ,IAAI,CAAC,8BAAQ;IAC3C,OAAO,KAAK,GAAG,GAAG,KAAK,GAAG,KAAK,IAAI,OAAO,OAAO;AACnD;AAEA,IAAI;AAMG,SAAS,0CAAM,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE;IAClD,IAAI,WAAW;IACf,IAAI;IAEJ,IAAI,UAAU,IAAI,QAAQ,CAAA;QACxB,IAAI,QAAQ;QACZ,IAAI,QAAQ,IAAI,CAAC,GAAG,MAAM,CAAC;QAC3B,IAAI,QAAQ,IAAI,CAAC,GAAG,MAAM,CAAC;QAE3B,SAAS,sBAAsB,SAAS,IAAI,CAAC;YAC3C,yFAAyF;YACzF,qGAAqG;YACrG,IAAI,+BAAS,MACX,8BAAQ,IAAI,SAAS,kCAAY;YAGnC,IAAI,6BACF,IAAI;YAGN,sBAAsB;YACtB,IAAI,QAAQ,IAAI;YAChB,IAAI,QAAQ,UAAU;gBACpB,GAAG;gBACH;YACF,OAAO;gBACL,wEAAwE;gBACxE,IAAI,UAAU,GAAG,IAAI,CAAA,GAAA,+BAAI,EACvB,MAAM,CAAC,GAAG,QAAQ,KAAK,QAAQ,WAC/B,MAAM,CAAC,GAAG,QAAQ,KAAK,QAAQ;gBAGjC,IAAI,YAAY,SAAS,CAAC,UACxB,SAAS,sBAAsB;YAEnC;QACF;IACF;IAEA,QAAQ,MAAM,GAAG;QACf,WAAW;QACX,qBAAqB;IACvB;IAEA,OAAO;AACT;AAGO,SAAS,0CAAa,CAAC;IAC5B,OAAO;AACT;AAEO,SAAS,0CAAQ,CAAC;IACvB,OAAO,KAAK,GAAG,CAAC,IAAI,KAAK,EAAE,GAAG;AAChC","sources":["packages/@react-stately/virtualizer/src/tween.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {Point} from './Point';\n\n// use high res timer if available\nlet perf = typeof window !== 'undefined' ? window.performance : null;\n// @ts-ignore\nlet perfNow = perf && (perf.now || perf.webkitNow || perf.msNow || perf.mozNow);\nlet getTime = perfNow ? perfNow.bind(perf) : function () {\n return Date.now ? Date.now() : new Date().getTime();\n};\n\nlet fixTs: boolean;\n\nexport interface CancelablePromise<T> extends Promise<T> {\n cancel(): void\n}\n\nexport function tween(begin, end, duration, ease, fn): CancelablePromise<void> {\n let canceled = false;\n let raf_id: number;\n\n let promise = new Promise(resolve => {\n let start = getTime();\n let diffX = end.x - begin.x;\n let diffY = end.y - begin.y;\n\n raf_id = requestAnimationFrame(function run(t) {\n // if we're using a high res timer, make sure timestamp is not the old epoch-based value.\n // http://updates.html5rocks.com/2012/05/requestAnimationFrame-API-now-with-sub-millisecond-precision\n if (fixTs == null) {\n fixTs = t > 1e12 !== getTime() > 1e12;\n }\n\n if (fixTs) {\n t = getTime();\n }\n\n // check if we're done\n let delta = t - start;\n if (delta > duration) {\n fn(end);\n resolve();\n } else {\n // call frame callback after computing eased time and get the next frame\n let proceed = fn(new Point(\n begin.x + diffX * ease(delta / duration),\n begin.y + diffY * ease(delta / duration)\n ));\n\n if (proceed !== false && !canceled) {\n raf_id = requestAnimationFrame(run);\n }\n }\n });\n }) as CancelablePromise<void>;\n\n promise.cancel = function () {\n canceled = true;\n cancelAnimationFrame(raf_id);\n };\n\n return promise;\n}\n\n// easing functions\nexport function linearEasing(t) {\n return t;\n}\n\nexport function easeOut(t) {\n return Math.sin(t * Math.PI / 2);\n}\n"],"names":[],"version":3,"file":"tween.main.js.map"}
package/dist/tween.mjs ADDED
@@ -0,0 +1,61 @@
1
+ import {Point as $3041db3296945e6e$export$baf26146a414f24a} from "./Point.mjs";
2
+
3
+ /*
4
+ * Copyright 2020 Adobe. All rights reserved.
5
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License. You may obtain a copy
7
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
8
+ *
9
+ * Unless required by applicable law or agreed to in writing, software distributed under
10
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
11
+ * OF ANY KIND, either express or implied. See the License for the specific language
12
+ * governing permissions and limitations under the License.
13
+ */
14
+ // use high res timer if available
15
+ let $3eb131dcf37ad5f8$var$perf = typeof window !== "undefined" ? window.performance : null;
16
+ // @ts-ignore
17
+ let $3eb131dcf37ad5f8$var$perfNow = $3eb131dcf37ad5f8$var$perf && ($3eb131dcf37ad5f8$var$perf.now || $3eb131dcf37ad5f8$var$perf.webkitNow || $3eb131dcf37ad5f8$var$perf.msNow || $3eb131dcf37ad5f8$var$perf.mozNow);
18
+ let $3eb131dcf37ad5f8$var$getTime = $3eb131dcf37ad5f8$var$perfNow ? $3eb131dcf37ad5f8$var$perfNow.bind($3eb131dcf37ad5f8$var$perf) : function() {
19
+ return Date.now ? Date.now() : new Date().getTime();
20
+ };
21
+ let $3eb131dcf37ad5f8$var$fixTs;
22
+ function $3eb131dcf37ad5f8$export$dc0b63720788090c(begin, end, duration, ease, fn) {
23
+ let canceled = false;
24
+ let raf_id;
25
+ let promise = new Promise((resolve)=>{
26
+ let start = $3eb131dcf37ad5f8$var$getTime();
27
+ let diffX = end.x - begin.x;
28
+ let diffY = end.y - begin.y;
29
+ raf_id = requestAnimationFrame(function run(t) {
30
+ // if we're using a high res timer, make sure timestamp is not the old epoch-based value.
31
+ // http://updates.html5rocks.com/2012/05/requestAnimationFrame-API-now-with-sub-millisecond-precision
32
+ if ($3eb131dcf37ad5f8$var$fixTs == null) $3eb131dcf37ad5f8$var$fixTs = t > 1e12 !== $3eb131dcf37ad5f8$var$getTime() > 1e12;
33
+ if ($3eb131dcf37ad5f8$var$fixTs) t = $3eb131dcf37ad5f8$var$getTime();
34
+ // check if we're done
35
+ let delta = t - start;
36
+ if (delta > duration) {
37
+ fn(end);
38
+ resolve();
39
+ } else {
40
+ // call frame callback after computing eased time and get the next frame
41
+ let proceed = fn(new (0, $3041db3296945e6e$export$baf26146a414f24a)(begin.x + diffX * ease(delta / duration), begin.y + diffY * ease(delta / duration)));
42
+ if (proceed !== false && !canceled) raf_id = requestAnimationFrame(run);
43
+ }
44
+ });
45
+ });
46
+ promise.cancel = function() {
47
+ canceled = true;
48
+ cancelAnimationFrame(raf_id);
49
+ };
50
+ return promise;
51
+ }
52
+ function $3eb131dcf37ad5f8$export$77860c106b4a6a2e(t) {
53
+ return t;
54
+ }
55
+ function $3eb131dcf37ad5f8$export$57636bb43b1ccbb0(t) {
56
+ return Math.sin(t * Math.PI / 2);
57
+ }
58
+
59
+
60
+ export {$3eb131dcf37ad5f8$export$dc0b63720788090c as tween, $3eb131dcf37ad5f8$export$77860c106b4a6a2e as linearEasing, $3eb131dcf37ad5f8$export$57636bb43b1ccbb0 as easeOut};
61
+ //# sourceMappingURL=tween.mjs.map
@@ -0,0 +1,61 @@
1
+ import {Point as $3041db3296945e6e$export$baf26146a414f24a} from "./Point.module.js";
2
+
3
+ /*
4
+ * Copyright 2020 Adobe. All rights reserved.
5
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License. You may obtain a copy
7
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
8
+ *
9
+ * Unless required by applicable law or agreed to in writing, software distributed under
10
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
11
+ * OF ANY KIND, either express or implied. See the License for the specific language
12
+ * governing permissions and limitations under the License.
13
+ */
14
+ // use high res timer if available
15
+ let $3eb131dcf37ad5f8$var$perf = typeof window !== "undefined" ? window.performance : null;
16
+ // @ts-ignore
17
+ let $3eb131dcf37ad5f8$var$perfNow = $3eb131dcf37ad5f8$var$perf && ($3eb131dcf37ad5f8$var$perf.now || $3eb131dcf37ad5f8$var$perf.webkitNow || $3eb131dcf37ad5f8$var$perf.msNow || $3eb131dcf37ad5f8$var$perf.mozNow);
18
+ let $3eb131dcf37ad5f8$var$getTime = $3eb131dcf37ad5f8$var$perfNow ? $3eb131dcf37ad5f8$var$perfNow.bind($3eb131dcf37ad5f8$var$perf) : function() {
19
+ return Date.now ? Date.now() : new Date().getTime();
20
+ };
21
+ let $3eb131dcf37ad5f8$var$fixTs;
22
+ function $3eb131dcf37ad5f8$export$dc0b63720788090c(begin, end, duration, ease, fn) {
23
+ let canceled = false;
24
+ let raf_id;
25
+ let promise = new Promise((resolve)=>{
26
+ let start = $3eb131dcf37ad5f8$var$getTime();
27
+ let diffX = end.x - begin.x;
28
+ let diffY = end.y - begin.y;
29
+ raf_id = requestAnimationFrame(function run(t) {
30
+ // if we're using a high res timer, make sure timestamp is not the old epoch-based value.
31
+ // http://updates.html5rocks.com/2012/05/requestAnimationFrame-API-now-with-sub-millisecond-precision
32
+ if ($3eb131dcf37ad5f8$var$fixTs == null) $3eb131dcf37ad5f8$var$fixTs = t > 1e12 !== $3eb131dcf37ad5f8$var$getTime() > 1e12;
33
+ if ($3eb131dcf37ad5f8$var$fixTs) t = $3eb131dcf37ad5f8$var$getTime();
34
+ // check if we're done
35
+ let delta = t - start;
36
+ if (delta > duration) {
37
+ fn(end);
38
+ resolve();
39
+ } else {
40
+ // call frame callback after computing eased time and get the next frame
41
+ let proceed = fn(new (0, $3041db3296945e6e$export$baf26146a414f24a)(begin.x + diffX * ease(delta / duration), begin.y + diffY * ease(delta / duration)));
42
+ if (proceed !== false && !canceled) raf_id = requestAnimationFrame(run);
43
+ }
44
+ });
45
+ });
46
+ promise.cancel = function() {
47
+ canceled = true;
48
+ cancelAnimationFrame(raf_id);
49
+ };
50
+ return promise;
51
+ }
52
+ function $3eb131dcf37ad5f8$export$77860c106b4a6a2e(t) {
53
+ return t;
54
+ }
55
+ function $3eb131dcf37ad5f8$export$57636bb43b1ccbb0(t) {
56
+ return Math.sin(t * Math.PI / 2);
57
+ }
58
+
59
+
60
+ export {$3eb131dcf37ad5f8$export$dc0b63720788090c as tween, $3eb131dcf37ad5f8$export$77860c106b4a6a2e as linearEasing, $3eb131dcf37ad5f8$export$57636bb43b1ccbb0 as easeOut};
61
+ //# sourceMappingURL=tween.module.js.map
@@ -0,0 +1 @@
1
+ {"mappings":";;AAAA;;;;;;;;;;CAUC;AAID,kCAAkC;AAClC,IAAI,6BAAO,OAAO,WAAW,cAAc,OAAO,WAAW,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"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {Point} from './Point';\n\n// use high res timer if available\nlet perf = typeof window !== 'undefined' ? window.performance : null;\n// @ts-ignore\nlet perfNow = perf && (perf.now || perf.webkitNow || perf.msNow || perf.mozNow);\nlet getTime = perfNow ? perfNow.bind(perf) : function () {\n return Date.now ? Date.now() : new Date().getTime();\n};\n\nlet fixTs: boolean;\n\nexport interface CancelablePromise<T> extends Promise<T> {\n cancel(): void\n}\n\nexport function tween(begin, end, duration, ease, fn): CancelablePromise<void> {\n let canceled = false;\n let raf_id: number;\n\n let promise = new Promise(resolve => {\n let start = getTime();\n let diffX = end.x - begin.x;\n let diffY = end.y - begin.y;\n\n raf_id = requestAnimationFrame(function run(t) {\n // if we're using a high res timer, make sure timestamp is not the old epoch-based value.\n // http://updates.html5rocks.com/2012/05/requestAnimationFrame-API-now-with-sub-millisecond-precision\n if (fixTs == null) {\n fixTs = t > 1e12 !== getTime() > 1e12;\n }\n\n if (fixTs) {\n t = getTime();\n }\n\n // check if we're done\n let delta = t - start;\n if (delta > duration) {\n fn(end);\n resolve();\n } else {\n // call frame callback after computing eased time and get the next frame\n let proceed = fn(new Point(\n begin.x + diffX * ease(delta / duration),\n begin.y + diffY * ease(delta / duration)\n ));\n\n if (proceed !== false && !canceled) {\n raf_id = requestAnimationFrame(run);\n }\n }\n });\n }) as CancelablePromise<void>;\n\n promise.cancel = function () {\n canceled = true;\n cancelAnimationFrame(raf_id);\n };\n\n return promise;\n}\n\n// easing functions\nexport function linearEasing(t) {\n return t;\n}\n\nexport function easeOut(t) {\n return Math.sin(t * Math.PI / 2);\n}\n"],"names":[],"version":3,"file":"tween.module.js.map"}
@@ -0,0 +1,96 @@
1
+ var $064492b79924894c$exports = require("./Size.main.js");
2
+ var $e1bc15d49d21df0e$exports = require("./Virtualizer.main.js");
3
+ var $amfZP$react = require("react");
4
+ var $amfZP$reactariautils = require("@react-aria/utils");
5
+
6
+
7
+ function $parcel$export(e, n, v, s) {
8
+ Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
9
+ }
10
+
11
+ $parcel$export(module.exports, "useVirtualizerState", () => $f02ef43b5e8eee9b$export$1505db82fe357e65);
12
+ /*
13
+ * Copyright 2020 Adobe. All rights reserved.
14
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
15
+ * you may not use this file except in compliance with the License. You may obtain a copy
16
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
17
+ *
18
+ * Unless required by applicable law or agreed to in writing, software distributed under
19
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
20
+ * OF ANY KIND, either express or implied. See the License for the specific language
21
+ * governing permissions and limitations under the License.
22
+ */
23
+
24
+
25
+
26
+ function $f02ef43b5e8eee9b$export$1505db82fe357e65(opts) {
27
+ let [visibleViews, setVisibleViews] = (0, $amfZP$react.useState)([]);
28
+ let [contentSize, setContentSize] = (0, $amfZP$react.useState)(new (0, $064492b79924894c$exports.Size)());
29
+ let [isAnimating, setAnimating] = (0, $amfZP$react.useState)(false);
30
+ let [isScrolling, setScrolling] = (0, $amfZP$react.useState)(false);
31
+ let virtualizer = (0, $amfZP$react.useMemo)(()=>new (0, $e1bc15d49d21df0e$exports.Virtualizer)(), []);
32
+ virtualizer.delegate = {
33
+ setVisibleViews: setVisibleViews,
34
+ setVisibleRect (rect) {
35
+ virtualizer.visibleRect = rect;
36
+ opts.onVisibleRectChange(rect);
37
+ },
38
+ setContentSize: setContentSize,
39
+ renderView: opts.renderView,
40
+ renderWrapper: opts.renderWrapper,
41
+ beginAnimations: ()=>setAnimating(true),
42
+ endAnimations: ()=>setAnimating(false),
43
+ getScrollAnchor: opts.getScrollAnchor
44
+ };
45
+ virtualizer.layout = opts.layout;
46
+ virtualizer.collection = opts.collection;
47
+ virtualizer.transitionDuration = opts.transitionDuration;
48
+ (0, $amfZP$reactariautils.useLayoutEffect)(()=>{
49
+ virtualizer.afterRender();
50
+ });
51
+ // eslint-disable-next-line arrow-body-style
52
+ (0, $amfZP$react.useEffect)(()=>{
53
+ return ()=>virtualizer.willUnmount();
54
+ // eslint-disable-next-line react-hooks/exhaustive-deps
55
+ }, []);
56
+ let setVisibleRect = (0, $amfZP$react.useCallback)((rect)=>{
57
+ virtualizer.visibleRect = rect;
58
+ }, [
59
+ virtualizer
60
+ ]);
61
+ let startScrolling = (0, $amfZP$react.useCallback)(()=>{
62
+ virtualizer.startScrolling();
63
+ setScrolling(true);
64
+ }, [
65
+ virtualizer
66
+ ]);
67
+ let endScrolling = (0, $amfZP$react.useCallback)(()=>{
68
+ virtualizer.endScrolling();
69
+ setScrolling(false);
70
+ }, [
71
+ virtualizer
72
+ ]);
73
+ let state = (0, $amfZP$react.useMemo)(()=>({
74
+ virtualizer: virtualizer,
75
+ visibleViews: visibleViews,
76
+ setVisibleRect: setVisibleRect,
77
+ contentSize: contentSize,
78
+ isAnimating: isAnimating,
79
+ isScrolling: isScrolling,
80
+ startScrolling: startScrolling,
81
+ endScrolling: endScrolling
82
+ }), [
83
+ virtualizer,
84
+ visibleViews,
85
+ setVisibleRect,
86
+ contentSize,
87
+ isAnimating,
88
+ isScrolling,
89
+ startScrolling,
90
+ endScrolling
91
+ ]);
92
+ return state;
93
+ }
94
+
95
+
96
+ //# sourceMappingURL=useVirtualizerState.main.js.map
@@ -0,0 +1 @@
1
+ {"mappings":";;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;AAqCM,SAAS,0CAA4C,IAA+B;IACzF,IAAI,CAAC,cAAc,gBAAgB,GAAG,CAAA,GAAA,qBAAO,E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A;0BACA;QACF,CAAA,GAAI;QACF;QACA;QACA;QACA;QACA;QACA;QACA;QACA;KACD;IAED,OAAO;AACT","sources":["packages/@react-stately/virtualizer/src/useVirtualizerState.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {Collection, Key} from '@react-types/shared';\nimport {Layout} from './Layout';\nimport {Rect} from './Rect';\nimport {ReusableView} from './ReusableView';\nimport {Size} from './Size';\nimport {useCallback, useEffect, useMemo, useState} from 'react';\nimport {useLayoutEffect} from '@react-aria/utils';\nimport {Virtualizer} from './Virtualizer';\n\ninterface VirtualizerProps<T extends object, V, W> {\n renderView(type: string, content: T): V,\n renderWrapper(\n parent: ReusableView<T, V> | null,\n reusableView: ReusableView<T, V>,\n children: ReusableView<T, V>[],\n renderChildren: (views: ReusableView<T, V>[]) => W[]\n ): W,\n layout: Layout<T>,\n collection: Collection<T>,\n onVisibleRectChange(rect: Rect): void,\n getScrollAnchor?(rect: Rect): Key,\n transitionDuration?: number\n}\n\nexport interface VirtualizerState<T extends object, V, W> {\n visibleViews: W[],\n setVisibleRect: (rect: Rect) => void,\n contentSize: Size,\n isAnimating: boolean,\n virtualizer: Virtualizer<T, V, W>,\n isScrolling: boolean,\n startScrolling: () => void,\n endScrolling: () => void\n}\n\nexport function useVirtualizerState<T extends object, V, W>(opts: VirtualizerProps<T, V, W>): VirtualizerState<T, V, W> {\n let [visibleViews, setVisibleViews] = useState<W[]>([]);\n let [contentSize, setContentSize] = useState(new Size());\n let [isAnimating, setAnimating] = useState(false);\n let [isScrolling, setScrolling] = useState(false);\n let virtualizer = useMemo(() => new Virtualizer<T, V, W>(), []);\n\n virtualizer.delegate = {\n setVisibleViews,\n setVisibleRect(rect) {\n virtualizer.visibleRect = rect;\n opts.onVisibleRectChange(rect);\n },\n setContentSize,\n renderView: opts.renderView,\n renderWrapper: opts.renderWrapper,\n beginAnimations: () => setAnimating(true),\n endAnimations: () => setAnimating(false),\n getScrollAnchor: opts.getScrollAnchor\n };\n\n virtualizer.layout = opts.layout;\n virtualizer.collection = opts.collection;\n virtualizer.transitionDuration = opts.transitionDuration;\n\n useLayoutEffect(() => {\n virtualizer.afterRender();\n });\n\n // eslint-disable-next-line arrow-body-style\n useEffect(() => {\n return () => virtualizer.willUnmount();\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n let setVisibleRect = useCallback((rect) => {\n virtualizer.visibleRect = rect;\n }, [virtualizer]);\n let startScrolling = useCallback(() => {\n virtualizer.startScrolling();\n setScrolling(true);\n }, [virtualizer]);\n let endScrolling = useCallback(() => {\n virtualizer.endScrolling();\n setScrolling(false);\n }, [virtualizer]);\n\n let state = useMemo(() => ({\n virtualizer,\n visibleViews,\n setVisibleRect,\n contentSize,\n isAnimating,\n isScrolling,\n startScrolling,\n endScrolling\n }), [\n virtualizer,\n visibleViews,\n setVisibleRect,\n contentSize,\n isAnimating,\n isScrolling,\n startScrolling,\n endScrolling\n ]);\n\n return state;\n}\n"],"names":[],"version":3,"file":"useVirtualizerState.main.js.map"}