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AAsB,GAAG,GACrD,WAAW,IAAI,CAAC,KAAK,EACrB,IAAI,CAAC,sBAAsB;QAErC,OACE,OAAO,WAAW,IAAI;QAGxB,OAAO,IAAI,CAAA,GAAA,yCAAS,EAAE,iBAAiB,OAAO,GAAG,GAAG,MAAM,OAAO,YAAY,EAAE;IACjF;AACF;AAEA,SAAS,8BACP,UAA+B,EAC/B,SAAqC;IAErC,MAAM,SAAoB,EAAE;IAC5B,KAAK,MAAM,QAAQ,WACjB,IAAI,UAAU,OACZ,OAAO,IAAI,CAAC;IAGhB,OAAO;AACT","sources":["packages/react-stately/src/layout/ListLayout.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 {\n Collection,\n DropTarget,\n DropTargetDelegate,\n ItemDropTarget,\n Key,\n Node,\n Orientation\n} from '@react-types/shared';\nimport {getChildNodes} from '../collections/getChildNodes';\nimport {InvalidationContext} from '../virtualizer/types';\nimport {Layout} from '../virtualizer/Layout';\nimport {LayoutInfo} from '../virtualizer/LayoutInfo';\nimport {Rect} from '../virtualizer/Rect';\nimport {Size} from '../virtualizer/Size';\n\nexport interface ListLayoutOptions {\n /**\n * The primary orientation of the items. Usually this is the direction that the collection\n * scrolls.\n *\n * @default 'vertical'\n */\n orientation?: Orientation;\n /**\n * The fixed size of a row in px with respect to the applied orientation.\n *\n * @default 48\n */\n rowSize?: number;\n /**\n * The estimated size of a row in px with respect to the applied orientation, when row sizes are\n * variable.\n */\n estimatedRowSize?: number;\n /**\n * The fixed size of a section header in px with respect to the applied orientation.\n *\n * @default 48\n */\n headingSize?: number;\n /**\n * The estimated size of a section header in px with respect to the applied orientation, when\n * heading sizes are variable.\n */\n estimatedHeadingSize?: number;\n /**\n * The fixed size of a loader element in px with respect to the applied orientation. This loader\n * is specifically for \"load more\" elements rendered when loading more rows at the root level or\n * inside nested row/sections.\n *\n * @default 48\n */\n loaderSize?: number;\n /**\n * The thickness of the drop indicator.\n *\n * @default 2\n */\n dropIndicatorThickness?: number;\n /**\n * The gap between items.\n *\n * @default 0\n */\n gap?: number;\n /**\n * The padding around the list.\n *\n * @default 0\n */\n padding?: number;\n /**\n * The fixed height of a row in px.\n *\n * @deprecated Use `rowSize` instead.\n * @default 48\n */\n rowHeight?: number;\n /**\n * The estimated height of a row, when row heights are variable.\n *\n * @deprecated Use `estimatedRowSize` instead.\n */\n estimatedRowHeight?: number;\n /**\n * The fixed height of a section header in px.\n *\n * @deprecated Use `headingSize` instead.\n * @default 48\n */\n headingHeight?: number;\n /**\n * The estimated height of a section header, when the height is variable.\n *\n * @deprecated Use `estimatedHeadingSize` instead.\n */\n estimatedHeadingHeight?: number;\n /**\n * The fixed height of a loader element in px. This loader is specifically for \"load more\"\n * elements rendered when loading more rows at the root level or inside nested row/sections.\n *\n * @deprecated Use `loaderSize` instead.\n * @default 48\n */\n loaderHeight?: number;\n}\n\n// A wrapper around LayoutInfo that supports hierarchy\nexport interface LayoutNode {\n node?: Node<unknown>;\n layoutInfo: LayoutInfo;\n children?: LayoutNode[];\n validRect: Rect;\n index?: number;\n}\n\nconst DEFAULT_HEIGHT = 48;\n\n/**\n * ListLayout is a virtualizer Layout implementation\n * that arranges its items in a stack along its applied orientation.\n * It supports both fixed and variable size items.\n */\nexport class ListLayout<T, O extends ListLayoutOptions = ListLayoutOptions>\n extends Layout<Node<T>, O>\n implements DropTargetDelegate\n{\n protected rowSize: number | null;\n protected orientation: Orientation;\n protected estimatedRowSize: number | null;\n protected headingSize: number | null;\n protected estimatedHeadingSize: number | null;\n protected loaderSize: number | null;\n protected dropIndicatorThickness: number;\n protected gap: number;\n protected padding: number;\n protected layoutNodes: Map<Key, LayoutNode>;\n protected contentSize: Size;\n protected lastCollection: Collection<Node<T>> | null;\n protected rootNodes: LayoutNode[];\n private invalidateEverything: boolean;\n /** The rectangle containing currently valid layout infos. */\n protected validRect: Rect;\n /** The rectangle of requested layout infos so far. */\n protected requestedRect: Rect;\n\n /**\n * Creates a new ListLayout with options. See the list of properties below for a description\n * of the options that can be provided.\n */\n constructor(options: ListLayoutOptions = {}) {\n super();\n this.rowSize = options?.rowSize ?? options?.rowHeight ?? null;\n this.orientation = options.orientation ?? 'vertical';\n this.estimatedRowSize = options?.estimatedRowSize ?? options?.estimatedRowHeight ?? null;\n this.headingSize = options?.headingSize ?? options?.headingHeight ?? null;\n this.estimatedHeadingSize =\n options?.estimatedHeadingSize ?? options?.estimatedHeadingHeight ?? null;\n this.loaderSize = options?.loaderSize ?? options?.loaderHeight ?? null;\n this.dropIndicatorThickness = options.dropIndicatorThickness || 2;\n this.gap = options.gap || 0;\n this.padding = options.padding || 0;\n this.layoutNodes = new Map();\n this.rootNodes = [];\n this.lastCollection = null;\n this.invalidateEverything = false;\n this.validRect = new Rect();\n this.requestedRect = new Rect();\n this.contentSize = new Size();\n }\n\n // Backward compatibility for subclassing.\n protected get collection(): Collection<Node<T>> {\n return this.virtualizer!.collection;\n }\n\n /** @deprecated Use `rowSize` instead. */\n protected get rowHeight(): number | null {\n return this.rowSize;\n }\n\n /** @deprecated Use `estimatedRowSize` instead. */\n protected get estimatedRowHeight(): number | null {\n return this.estimatedRowSize;\n }\n\n /** @deprecated Use `headingSize` instead. */\n protected get headingHeight(): number | null {\n return this.headingSize;\n }\n /** @deprecated Use `estimatedHeadingSize` instead. */\n protected get estimatedHeadingHeight(): number | null {\n return this.estimatedHeadingSize;\n }\n\n /** @deprecated Use `loaderSize` instead. */\n protected get loaderHeight(): number | null {\n return this.loaderSize;\n }\n\n getLayoutInfo(key: Key): LayoutInfo | null {\n this.ensureLayoutInfo(key);\n return this.layoutNodes.get(key)?.layoutInfo || null;\n }\n\n getVisibleLayoutInfos(rect: Rect): LayoutInfo[] {\n let offsetProperty = this.orientation === 'horizontal' ? 'x' : 'y';\n let heightProperty = this.orientation === 'horizontal' ? 'width' : 'height';\n\n // Adjust rect to keep number of visible rows consistent.\n // (only if height > 1 or width > 1 for getDropTargetFromPoint)\n if (rect[heightProperty] > 1) {\n let rowHeight = (this.rowSize ?? this.estimatedRowSize ?? DEFAULT_HEIGHT) + this.gap;\n // Clone only before mutating\n rect = rect.copy();\n let offset = Math.floor(rect[offsetProperty] / rowHeight) * rowHeight;\n let height = rect[heightProperty] + rect[offsetProperty] - offset;\n rect[offsetProperty] = offset;\n rect[heightProperty] = Math.ceil(height / rowHeight) * rowHeight;\n }\n\n // If layout hasn't yet been done for the requested rect, union the\n // new rect with the existing valid rect, and recompute.\n this.layoutIfNeeded(rect);\n\n let res: LayoutInfo[] = [];\n\n let addNodes = (nodes: LayoutNode[]) => {\n for (let node of nodes) {\n if (this.isVisible(node, rect)) {\n res.push(node.layoutInfo);\n\n if (node.children) {\n addNodes(node.children);\n }\n }\n }\n };\n\n addNodes(this.rootNodes);\n return res;\n }\n\n protected layoutIfNeeded(rect: Rect): void {\n if (!this.lastCollection) {\n return;\n }\n\n if (!this.requestedRect.containsRect(rect)) {\n this.requestedRect = this.requestedRect.union(rect);\n this.rootNodes = this.buildCollection();\n }\n\n // Ensure all of the persisted keys are available.\n for (let key of this.virtualizer!.persistedKeys) {\n if (this.ensureLayoutInfo(key)) {\n return;\n }\n }\n }\n\n private ensureLayoutInfo(key: Key) {\n // If the layout info wasn't found, it might be outside the bounds of the area that we've\n // computed layout for so far. This can happen when accessing a random key, e.g pressing Home/End.\n // Compute the full layout and try again.\n if (\n !this.layoutNodes.has(key) &&\n this.requestedRect.area < this.contentSize.area &&\n this.lastCollection\n ) {\n this.requestedRect = new Rect(0, 0, Infinity, Infinity);\n this.rootNodes = this.buildCollection();\n this.requestedRect = new Rect(0, 0, this.contentSize.width, this.contentSize.height);\n return true;\n }\n\n return false;\n }\n\n protected isVisible(node: LayoutNode, rect: Rect): boolean {\n return (\n node.layoutInfo.rect.intersects(rect) ||\n node.layoutInfo.isSticky ||\n node.layoutInfo.type === 'header' ||\n node.layoutInfo.type === 'loader' ||\n this.virtualizer!.isPersistedKey(node.layoutInfo.key)\n );\n }\n\n protected shouldInvalidateEverything(invalidationContext: InvalidationContext<O>): boolean {\n // Invalidate cache if the size of the collection changed.\n // In this case, we need to recalculate the entire layout.\n // Also invalidate if fixed sizes/gaps change.\n let options = invalidationContext.layoutOptions;\n return (\n invalidationContext.sizeChanged ||\n this.rowSize !== (options?.rowSize ?? options?.rowHeight ?? this.rowSize) ||\n this.orientation !== (options?.orientation ?? this.orientation) ||\n this.headingSize !== (options?.headingSize ?? options?.headingHeight ?? this.headingSize) ||\n this.loaderSize !== (options?.loaderSize ?? options?.loaderHeight ?? this.loaderSize) ||\n this.gap !== (options?.gap ?? this.gap) ||\n this.padding !== (options?.padding ?? this.padding)\n );\n }\n\n shouldInvalidateLayoutOptions(newOptions: O, oldOptions: O): boolean {\n return (\n (newOptions?.rowSize ?? newOptions?.rowHeight) !==\n (oldOptions?.rowSize ?? oldOptions?.rowHeight) ||\n newOptions.orientation !== oldOptions.orientation ||\n (newOptions?.estimatedRowSize ?? newOptions?.estimatedRowHeight) !==\n (oldOptions?.estimatedRowSize ?? oldOptions?.estimatedRowHeight) ||\n (newOptions?.headingSize ?? newOptions?.headingHeight) !==\n (oldOptions?.headingSize ?? oldOptions?.headingHeight) ||\n (newOptions?.estimatedHeadingSize ?? newOptions?.estimatedHeadingHeight) !==\n (oldOptions?.estimatedHeadingSize ?? oldOptions?.estimatedHeadingHeight) ||\n (newOptions?.loaderSize ?? newOptions?.loaderHeight) !==\n (oldOptions?.loaderSize ?? oldOptions?.loaderHeight) ||\n newOptions.dropIndicatorThickness !== oldOptions.dropIndicatorThickness ||\n newOptions.gap !== oldOptions.gap ||\n newOptions.padding !== oldOptions.padding\n );\n }\n\n update(invalidationContext: InvalidationContext<O>): void {\n let collection = this.virtualizer!.collection;\n\n // Reset valid rect if we will have to invalidate everything.\n // Otherwise we can reuse cached layout infos outside the current visible rect.\n this.invalidateEverything = this.shouldInvalidateEverything(invalidationContext);\n if (this.invalidateEverything) {\n this.requestedRect = this.virtualizer!.visibleRect.copy();\n this.layoutNodes.clear();\n }\n\n let options = invalidationContext.layoutOptions;\n this.rowSize = options?.rowSize ?? options?.rowHeight ?? this.rowSize;\n this.orientation = options?.orientation ?? this.orientation;\n this.estimatedRowSize =\n options?.estimatedRowSize ?? options?.estimatedRowHeight ?? this.estimatedRowSize;\n this.headingSize = options?.headingSize ?? options?.headingHeight ?? this.headingSize;\n this.estimatedHeadingSize =\n options?.estimatedHeadingSize ?? options?.estimatedHeadingHeight ?? this.estimatedHeadingSize;\n this.loaderSize = options?.loaderSize ?? options?.loaderHeight ?? this.loaderSize;\n this.dropIndicatorThickness = options?.dropIndicatorThickness ?? this.dropIndicatorThickness;\n this.gap = options?.gap ?? this.gap;\n this.padding = options?.padding ?? this.padding;\n\n this.rootNodes = this.buildCollection();\n\n // Remove deleted layout nodes\n if (this.lastCollection && collection !== this.lastCollection) {\n for (let key of this.lastCollection.getKeys()) {\n if (!collection.getItem(key)) {\n let layoutNode = this.layoutNodes.get(key);\n if (layoutNode) {\n this.layoutNodes.delete(key);\n }\n }\n }\n }\n\n this.lastCollection = collection;\n this.invalidateEverything = false;\n this.validRect = this.requestedRect.copy();\n }\n\n protected buildCollection(offset: number = this.padding): LayoutNode[] {\n let collection = this.virtualizer!.collection;\n let offsetProperty = this.orientation === 'horizontal' ? 'x' : 'y';\n let maxOffsetProperty = this.orientation === 'horizontal' ? 'maxX' : 'maxY';\n\n // filter out content nodes since we don't want them to affect the height\n // Tree specific for now, if we add content nodes to other collection items, we might need to reconsider this\n let collectionNodes = toArray(collection, node => node.type !== 'content');\n let loaderNodes = collectionNodes.filter(node => node.type === 'loader');\n let nodes: LayoutNode[] = [];\n let isEmptyOrLoading = collection?.size === 0;\n if (isEmptyOrLoading) {\n offset = 0;\n }\n\n for (let node of collectionNodes) {\n let rowHeight = (this.rowSize ?? this.estimatedRowSize ?? DEFAULT_HEIGHT) + this.gap;\n // Skip rows before the valid rectangle unless they are already cached.\n if (\n node.type === 'item' &&\n offset + rowHeight < this.requestedRect[offsetProperty] &&\n !this.isValid(node, offset)\n ) {\n offset += rowHeight;\n continue;\n }\n\n let layoutNode =\n this.orientation === 'horizontal'\n ? this.buildChild(node, offset, this.padding, null)\n : this.buildChild(node, this.padding, offset, null);\n offset = layoutNode.layoutInfo.rect[maxOffsetProperty] + this.gap;\n nodes.push(layoutNode);\n if (node.type === 'loader') {\n let index = loaderNodes.indexOf(node);\n loaderNodes.splice(index, 1);\n }\n\n // Build each loader that exists in the collection that is outside the visible rect so that they are persisted\n // at the proper estimated location. If the node.type is \"section\" then we don't do this shortcut since we have to\n // build the sections to see how tall they are.\n if (\n (node.type === 'item' || node.type === 'loader') &&\n offset > this.requestedRect[maxOffsetProperty]\n ) {\n let lastProcessedIndex = collectionNodes.indexOf(node);\n for (let loaderNode of loaderNodes) {\n let loaderNodeIndex = collectionNodes.indexOf(loaderNode);\n // Subtract by an additional 1 since we've already added the current item's height to y\n offset += (loaderNodeIndex - lastProcessedIndex - 1) * rowHeight;\n let loader =\n this.orientation === 'horizontal'\n ? this.buildChild(loaderNode, offset, this.padding, null)\n : this.buildChild(loaderNode, this.padding, offset, null);\n nodes.push(loader);\n offset = loader.layoutInfo.rect[maxOffsetProperty];\n lastProcessedIndex = loaderNodeIndex;\n }\n\n // Account for the rest of the items after the last loader spinner, subtract by 1 since we've processed the current node's height already\n offset += (collectionNodes.length - lastProcessedIndex - 1) * rowHeight;\n break;\n }\n }\n\n offset = Math.max(offset - this.gap, 0);\n offset += isEmptyOrLoading ? 0 : this.padding;\n this.contentSize =\n this.orientation === 'horizontal'\n ? new Size(offset, this.virtualizer!.size.height)\n : new Size(this.virtualizer!.size.width, offset);\n return nodes;\n }\n\n protected isValid(node: Node<T>, offset: number): boolean {\n let cached = this.layoutNodes.get(node.key);\n let offsetProperty = this.orientation === 'horizontal' ? 'x' : 'y';\n return (\n !this.invalidateEverything &&\n !!cached &&\n cached.node === node &&\n offset === cached.layoutInfo.rect[offsetProperty] &&\n cached.layoutInfo.rect.intersects(this.validRect) &&\n cached.validRect.containsRect(cached.layoutInfo.rect.intersection(this.requestedRect))\n );\n }\n\n protected buildChild(node: Node<T>, x: number, y: number, parentKey: Key | null): LayoutNode {\n if (this.isValid(node, this.orientation === 'horizontal' ? x : y)) {\n return this.layoutNodes.get(node.key)!;\n }\n\n let layoutNode = this.buildNode(node, x, y);\n\n layoutNode.layoutInfo.parentKey = parentKey ?? null;\n layoutNode.layoutInfo.allowOverflow = true;\n this.layoutNodes.set(node.key, layoutNode);\n return layoutNode;\n }\n\n protected buildNode(node: Node<T>, x: number, y: number): LayoutNode {\n switch (node.type) {\n case 'section':\n return this.buildSection(node, x, y);\n case 'item':\n return this.buildItem(node, x, y);\n case 'header':\n return this.buildSectionHeader(node, x, y);\n case 'loader':\n return this.buildLoader(node, x, y);\n case 'separator':\n return this.buildItem(node, x, y);\n default:\n throw new Error('Unsupported node type: ' + node.type);\n }\n }\n\n protected buildLoader(node: Node<T>, x: number, y: number): LayoutNode {\n let rect = new Rect(x, y, this.padding, 0);\n let layoutInfo = new LayoutInfo(node.type, node.key, rect);\n\n // Note that if the user provides isLoading to their sentinel during a case where they only want to render the emptyState, this will reserve\n // room for the loader alongside rendering the emptyState\n if (this.orientation === 'horizontal') {\n rect.height = this.virtualizer!.contentSize.height - this.padding - y;\n rect.width = node.props.isLoading\n ? (this.loaderSize ?? this.rowSize ?? this.estimatedRowSize ?? DEFAULT_HEIGHT)\n : 0;\n } else {\n rect.width = this.virtualizer!.contentSize.width - this.padding - x;\n rect.height = node.props.isLoading\n ? (this.loaderSize ?? this.rowSize ?? this.estimatedRowSize ?? DEFAULT_HEIGHT)\n : 0;\n }\n\n return {\n layoutInfo,\n validRect: rect.intersection(this.requestedRect)\n };\n }\n\n protected buildSection(node: Node<T>, x: number, y: number): LayoutNode {\n let collection = this.virtualizer!.collection;\n let width = this.virtualizer!.size.width - this.padding - x;\n let height = this.virtualizer!.size.height - this.padding - y;\n let rect =\n this.orientation === 'horizontal' ? new Rect(x, y, 0, height) : new Rect(x, y, width, 0);\n let layoutInfo = new LayoutInfo(node.type, node.key, rect);\n\n let offset = this.orientation === 'horizontal' ? x : y;\n let offsetProperty = this.orientation === 'horizontal' ? 'x' : 'y';\n let maxOffsetProperty = this.orientation === 'horizontal' ? 'maxX' : 'maxY';\n let heightProperty = this.orientation === 'horizontal' ? 'width' : 'height';\n\n let skipped = 0;\n let children: LayoutNode[] = [];\n for (let child of getChildNodes(node, collection)) {\n // skip if it is a content node, Tree specific for now, if we add content nodes to other collection items, we might need to reconsider this\n if (child.type === 'content') {\n continue;\n }\n\n let rowHeight = (this.rowSize ?? this.estimatedRowSize ?? DEFAULT_HEIGHT) + this.gap;\n\n // Skip rows before the valid rectangle unless they are already cached.\n if (offset + rowHeight < this.requestedRect[offsetProperty] && !this.isValid(node, offset)) {\n offset += rowHeight;\n skipped++;\n continue;\n }\n\n let layoutNode =\n this.orientation === 'horizontal'\n ? this.buildChild(child, offset, y, layoutInfo.key)\n : this.buildChild(child, x, offset, layoutInfo.key);\n offset = layoutNode.layoutInfo.rect[maxOffsetProperty] + this.gap;\n children.push(layoutNode);\n\n if (offset > this.requestedRect[maxOffsetProperty]) {\n // Estimate the remaining height for rows that we don't need to layout right now.\n offset +=\n ([...getChildNodes(node, collection)].length - (children.length + skipped)) * rowHeight;\n break;\n }\n }\n\n offset -= this.gap;\n rect[heightProperty] = offset - (this.orientation === 'horizontal' ? x : y);\n\n return {\n layoutInfo,\n children,\n validRect: layoutInfo.rect.intersection(this.requestedRect),\n node\n };\n }\n\n protected buildSectionHeader(node: Node<T>, x: number, y: number): LayoutNode {\n let widthProperty = this.orientation === 'horizontal' ? 'height' : 'width';\n let heightProperty = this.orientation === 'horizontal' ? 'width' : 'height';\n let width =\n this.virtualizer!.size[widthProperty] -\n this.padding -\n (this.orientation === 'horizontal' ? y : x);\n let rectHeight = this.headingSize;\n let isEstimated = false;\n\n // If no explicit height is available, use an estimated height.\n if (rectHeight == null) {\n // If a previous version of this layout info exists, reuse its height.\n // Mark as estimated if the size of the overall virtualizer changed,\n // or the content of the item changed.\n let previousLayoutNode = this.layoutNodes.get(node.key);\n let previousLayoutInfo = previousLayoutNode?.layoutInfo;\n if (previousLayoutInfo) {\n let curNode = this.virtualizer!.collection.getItem(node.key);\n let lastNode = this.lastCollection ? this.lastCollection.getItem(node.key) : null;\n rectHeight = previousLayoutNode!.layoutInfo.rect[heightProperty];\n isEstimated =\n width !== previousLayoutInfo.rect[widthProperty] ||\n curNode !== lastNode ||\n previousLayoutInfo.estimatedSize;\n } else {\n rectHeight = node.rendered ? this.estimatedHeadingSize : 0;\n isEstimated = true;\n }\n }\n\n if (rectHeight == null) {\n rectHeight = DEFAULT_HEIGHT;\n }\n\n let headerRect =\n this.orientation === 'horizontal'\n ? new Rect(x, y, rectHeight, width - y)\n : new Rect(x, y, width - x, rectHeight);\n let header = new LayoutInfo('header', node.key, headerRect);\n header.estimatedSize = isEstimated;\n return {\n layoutInfo: header,\n children: [],\n validRect: header.rect.intersection(this.requestedRect),\n node\n };\n }\n\n protected buildItem(node: Node<T>, x: number, y: number): LayoutNode {\n let widthProperty = this.orientation === 'horizontal' ? 'height' : 'width';\n let heightProperty = this.orientation === 'horizontal' ? 'width' : 'height';\n\n let width =\n this.virtualizer!.size[widthProperty] -\n this.padding -\n (this.orientation === 'horizontal' ? y : x);\n let rectHeight = this.rowSize;\n let isEstimated = false;\n\n // If no explicit height is available, use an estimated height.\n if (rectHeight == null) {\n // If a previous version of this layout info exists, reuse its height.\n // Mark as estimated if the size of the overall virtualizer changed,\n // or the content of the item changed.\n let previousLayoutNode = this.layoutNodes.get(node.key);\n if (previousLayoutNode) {\n rectHeight = previousLayoutNode.layoutInfo.rect[heightProperty];\n isEstimated =\n width !== previousLayoutNode.layoutInfo.rect[widthProperty] ||\n node !== previousLayoutNode.node ||\n previousLayoutNode.layoutInfo.estimatedSize;\n } else {\n rectHeight = this.estimatedRowSize;\n isEstimated = true;\n }\n }\n\n if (rectHeight == null) {\n rectHeight = DEFAULT_HEIGHT;\n }\n\n let rect =\n this.orientation === 'horizontal'\n ? new Rect(x, y, rectHeight, width)\n : new Rect(x, y, width, rectHeight);\n let layoutInfo = new LayoutInfo(node.type, node.key, rect);\n layoutInfo.estimatedSize = isEstimated;\n return {\n layoutInfo,\n children: [],\n validRect: layoutInfo.rect.intersection(this.requestedRect),\n node\n };\n }\n\n updateItemSize(key: Key, size: Size): boolean {\n let layoutNode = this.layoutNodes.get(key);\n // If no layoutInfo, item has been deleted/removed.\n if (!layoutNode) {\n return false;\n }\n\n let collection = this.virtualizer!.collection;\n let layoutInfo = layoutNode.layoutInfo;\n let offsetProperty = this.orientation === 'horizontal' ? 'x' : 'y';\n let heightProperty = this.orientation === 'horizontal' ? 'width' : 'height';\n layoutInfo.estimatedSize = false;\n if (layoutInfo.rect[heightProperty] !== size[heightProperty]) {\n // Copy layout info rather than mutating so that later caches are invalidated.\n let newLayoutInfo = layoutInfo.copy();\n newLayoutInfo.rect[heightProperty] = size[heightProperty];\n layoutNode.layoutInfo = newLayoutInfo;\n\n // Items after this layoutInfo will need to be repositioned to account for the new height.\n // Adjust the validRect so that only items above remain valid.\n this.validRect[heightProperty] = Math.min(\n this.validRect[heightProperty],\n layoutInfo.rect[offsetProperty] - this.validRect[offsetProperty]\n );\n\n // The requestedRect also needs to be adjusted to account for the height difference.\n if (layoutNode.node?.type === 'item') {\n this.requestedRect[heightProperty] +=\n newLayoutInfo.rect[heightProperty] - layoutInfo.rect[heightProperty];\n }\n\n // Invalidate layout for this layout node and all parents\n this.updateLayoutNode(key, layoutInfo, newLayoutInfo);\n\n let node = layoutInfo.parentKey != null ? collection.getItem(layoutInfo.parentKey) : null;\n while (node) {\n this.updateLayoutNode(node.key, layoutInfo, newLayoutInfo);\n node = node.parentKey != null ? collection.getItem(node.parentKey) : null;\n }\n\n return true;\n }\n\n return false;\n }\n\n private updateLayoutNode(key: Key, oldLayoutInfo: LayoutInfo, newLayoutInfo: LayoutInfo) {\n let n = this.layoutNodes.get(key);\n if (n) {\n // Invalidate by intersecting the validRect of this node with the overall validRect.\n n.validRect = n.validRect.intersection(this.validRect);\n\n // Replace layout info in LayoutNode\n if (n.layoutInfo === oldLayoutInfo) {\n n.layoutInfo = newLayoutInfo;\n }\n }\n }\n\n getContentSize(): Size {\n return this.contentSize;\n }\n\n getDropTargetFromPoint(\n x: number,\n y: number,\n isValidDropTarget: (target: DropTarget) => boolean\n ): DropTarget | null {\n x += this.virtualizer!.visibleRect.x;\n y += this.virtualizer!.visibleRect.y;\n\n // Find the closest item within on either side of the point using the gap width.\n let searchRect = new Rect(x, Math.max(0, y - this.gap), 1, Math.max(1, this.gap * 2));\n let candidates = this.getVisibleLayoutInfos(searchRect);\n let key: Key | null = null;\n let minDistance = Infinity;\n for (let candidate of candidates) {\n // Ignore items outside the search rect, e.g. persisted keys.\n if (!candidate.rect.intersects(searchRect)) {\n continue;\n }\n\n let yDist = Math.abs(candidate.rect.y - y);\n let maxYDist = Math.abs(candidate.rect.maxY - y);\n let dist = Math.min(yDist, maxYDist);\n if (dist < minDistance) {\n minDistance = dist;\n key = candidate.key;\n }\n }\n\n if (key == null || this.virtualizer!.collection.size === 0) {\n return {type: 'root'};\n }\n\n let layoutInfo = this.getLayoutInfo(key);\n if (!layoutInfo) {\n return null;\n }\n\n let rect = layoutInfo.rect;\n let target: DropTarget = {\n type: 'item',\n key: layoutInfo.key,\n dropPosition: 'on'\n };\n\n // If dropping on the item isn't accepted, try the target before or after depending on the y position.\n // Otherwise, if dropping on the item is accepted, still try the before/after positions if within 10px\n // of the top or bottom of the item.\n if (!isValidDropTarget(target)) {\n if (y <= rect.y + rect.height / 2 && isValidDropTarget({...target, dropPosition: 'before'})) {\n target.dropPosition = 'before';\n } else if (isValidDropTarget({...target, dropPosition: 'after'})) {\n target.dropPosition = 'after';\n }\n } else if (y <= rect.y + 10 && isValidDropTarget({...target, dropPosition: 'before'})) {\n target.dropPosition = 'before';\n } else if (y >= rect.maxY - 10 && isValidDropTarget({...target, dropPosition: 'after'})) {\n target.dropPosition = 'after';\n }\n\n return target;\n }\n\n getDropTargetLayoutInfo(target: ItemDropTarget): LayoutInfo {\n let layoutInfo = this.getLayoutInfo(target.key)!;\n let rect: Rect;\n if (target.dropPosition === 'before') {\n rect =\n this.orientation === 'horizontal'\n ? new Rect(\n Math.max(0, layoutInfo.rect.x - this.dropIndicatorThickness / 2),\n layoutInfo.rect.y,\n this.dropIndicatorThickness,\n layoutInfo.rect.height\n )\n : new Rect(\n layoutInfo.rect.x,\n Math.max(0, layoutInfo.rect.y - this.dropIndicatorThickness / 2),\n layoutInfo.rect.width,\n this.dropIndicatorThickness\n );\n } else if (target.dropPosition === 'after') {\n // Render after last visible descendant of the drop target.\n let targetNode = this.collection.getItem(target.key);\n if (targetNode) {\n let targetLevel = targetNode.level ?? 0;\n let currentKey = this.collection.getKeyAfter(target.key);\n\n while (currentKey != null) {\n let node = this.collection.getItem(currentKey);\n if (!node || node.level <= targetLevel) {\n break;\n }\n\n layoutInfo = this.getLayoutInfo(currentKey) || layoutInfo;\n currentKey = this.collection.getKeyAfter(currentKey);\n }\n }\n rect =\n this.orientation === 'horizontal'\n ? new Rect(\n layoutInfo.rect.maxX - this.dropIndicatorThickness / 2,\n layoutInfo.rect.y,\n this.dropIndicatorThickness,\n layoutInfo.rect.height\n )\n : new Rect(\n layoutInfo.rect.x,\n layoutInfo.rect.maxY - this.dropIndicatorThickness / 2,\n layoutInfo.rect.width,\n this.dropIndicatorThickness\n );\n } else {\n rect = layoutInfo.rect;\n }\n\n return new LayoutInfo('dropIndicator', target.key + ':' + target.dropPosition, rect);\n }\n}\n\nfunction toArray<T>(\n collection: Collection<Node<T>>,\n predicate: (node: Node<T>) => boolean\n): Node<T>[] {\n const result: Node<T>[] = [];\n for (const node of collection) {\n if (predicate(node)) {\n result.push(node);\n }\n }\n return result;\n}\n"],"names":[],"version":3,"file":"ListLayout.mjs.map"}