@ng-native/components 0.26.1 → 0.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/src/main/java/dev/ngnative/components/ContextMenuPopup.kt +61 -19
- package/android/src/main/java/dev/ngnative/components/MenusModule.kt +22 -0
- package/android/src/main/java/dev/ngnative/components/Shortcut.kt +13 -4
- package/dist/context-menu.d.ts +14 -6
- package/dist/context-menu.js +30 -28
- package/dist/context-menu.js.map +1 -1
- package/dist/drag-and-drop.d.ts +4 -4
- package/dist/drag-and-drop.js +6 -6
- package/dist/drag-and-drop.js.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/menu.d.ts +7 -4
- package/dist/menu.js +10 -4
- package/dist/menu.js.map +1 -1
- package/dist/modal.d.ts +12 -8
- package/dist/modal.js +8 -8
- package/dist/modal.js.map +1 -1
- package/dist/native-button.d.ts +13 -3
- package/dist/native-button.js +12 -5
- package/dist/native-button.js.map +1 -1
- package/dist/press-menu.d.ts +39 -0
- package/dist/press-menu.js +76 -0
- package/dist/press-menu.js.map +1 -0
- package/dist/pressable.d.ts +3 -0
- package/dist/pressable.js +6 -1
- package/dist/pressable.js.map +1 -1
- package/dist/reanimated.js +27 -3
- package/dist/reanimated.js.map +1 -1
- package/dist/safe-area-provider.js +9 -7
- package/dist/safe-area-provider.js.map +1 -1
- package/dist/settled-updates.d.ts +55 -0
- package/dist/settled-updates.js +77 -0
- package/dist/settled-updates.js.map +1 -0
- package/dist/sidebar-item.d.ts +19 -4
- package/dist/sidebar-item.js +33 -6
- package/dist/sidebar-item.js.map +1 -1
- package/dist/sidebar-section.js +3 -2
- package/dist/sidebar-section.js.map +1 -1
- package/dist/stand-ins/reanimated.d.ts +5 -0
- package/dist/stand-ins/reanimated.js +7 -0
- package/dist/stand-ins/reanimated.js.map +1 -1
- package/dist/sticky-rows.d.ts +120 -25
- package/dist/sticky-rows.js +265 -65
- package/dist/sticky-rows.js.map +1 -1
- package/dist/svg-icon.d.ts +9 -0
- package/dist/svg-icon.js +37 -0
- package/dist/svg-icon.js.map +1 -0
- package/dist/virtual-list-sticky-level.d.ts +39 -0
- package/dist/virtual-list-sticky-level.js +82 -0
- package/dist/virtual-list-sticky-level.js.map +1 -0
- package/dist/virtual-list-sticky.d.ts +19 -0
- package/dist/virtual-list-sticky.js +13 -0
- package/dist/virtual-list-sticky.js.map +1 -0
- package/dist/virtual-list.d.ts +6 -2
- package/dist/virtual-list.js +60 -43
- package/dist/virtual-list.js.map +1 -1
- package/dist/worklet-style.d.ts +11 -0
- package/dist/worklet-style.js +15 -1
- package/dist/worklet-style.js.map +1 -1
- package/dist/worklets.d.ts +5 -1
- package/dist/worklets.js.map +1 -1
- package/dist/written-props.js +1 -0
- package/dist/written-props.js.map +1 -1
- package/package.json +3 -3
package/dist/virtual-list.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"virtual-list.js","sourceRoot":"","sources":["../src/virtual-list.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,UAAU,EACV,SAAS,EACT,UAAU,EACV,WAAW,EACX,gBAAgB,EAChB,gBAAgB,EAChB,QAAQ,EACR,YAAY,EACZ,MAAM,EACN,MAAM,EACN,KAAK,EACL,YAAY,EACZ,MAAM,EACN,MAAM,EACN,SAAS,EACT,SAAS,GACV,MAAM,eAAe,CAAC;AACvB,OAAO,EAIL,cAAc,GACf,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAkC,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1F,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE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IAEhE;QACE,MAAM,CAAC,GAAG,EAAE;YACV,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;YACvB,IAAI,IAAI,CAAC,MAAM;gBAAE,SAAS,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,IAAI,CAAC,MAAO,CAAC,CAAC,CAAC;QAC1E,CAAC,CAAC,CAAC;IACL,CAAC;IAES,QAAQ,CAChB,KAA6E;QAE7E,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,WAAW,EAAE,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC;QACvD,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,EAAE,KAAK,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;IAC9D,CAAC;uGAlBU,cAAc;2FAAd,cAAc;;2FAAd,cAAc;kBAT1B,SAAS;mBAAC;oBACT,QAAQ,EAAE,kBAAkB;oBAC5B,IAAI,EAAE;wBACJ,SAAS,EAAE,aAAa;wBACxB,8CAA8C;wBAC9C,oBAAoB,EAAE,4BAA4B;wBAClD,UAAU,EAAE,kBAAkB;qBAC/B;iBACF","sourcesContent":["import {\n Component,\n DestroyRef,\n Directive,\n ElementRef,\n TemplateRef,\n afterEveryRender,\n booleanAttribute,\n computed,\n contentChild,\n effect,\n inject,\n input,\n linkedSignal,\n output,\n signal,\n untracked,\n viewChild,\n} from '@angular/core';\nimport {\n type HostNode,\n type NativeSyntheticEvent,\n type StaticTransform,\n nativePlatform,\n} from '@ng-native/fabric';\nimport { HeightIndex } from './height-index.ts';\nimport { type KeyboardShouldPersistTaps, dismissKeyboardOnTap } from './keyboard-taps.ts';\nimport { RefreshControl } from './refresh-control.ts';\nimport { StickyRows } from './sticky-rows.ts';\nimport { TemplateSlot } from './template-slot.ts';\nimport { ZeroSizeWarning, checksZeroSize, written } from './zero-size-warning.ts';\nimport { View } from './view.ts';\nimport { VIRTUAL_LIST_LAYOUT } from './virtual-list-layout.ts';\nimport { ScrollViewProps } from './scroll-view-props.ts';\nimport { numberOr } from './transforms.ts';\n\n/** One rendered row: the item, its index, and a stable style object for its slot. */\nexport interface VirtualRow<T> {\n readonly index: number;\n /**\n * A key that a row keeps while its item stays in the window, and that passes to a row arriving\n * once it has left. `track row.slot` recycles rows: the view of a row scrolling out is reused for\n * the one scrolling in, with only its bindings updated, rather than one destroyed and one created\n * each time. A slot follows its item, not its position, so an insert above the window moves no\n * row to another item.\n */\n readonly slot: number;\n /**\n * The item's identity, from `keyExtractor`, or the item itself without one. `track row.key`\n * gives each item a view of its own for as long as it is in the window and never recycles one,\n * which is what a row holding state of its own, or animating, needs.\n */\n readonly key: unknown;\n readonly item: T;\n readonly style: Record<string, unknown>;\n /**\n * A slot kept rendered but hidden, still bound to the last item it showed, so the next row of\n * its type to arrive reuses its views instead of building them. Always last in the window.\n */\n readonly parked?: true;\n}\n\n/**\n * Space around the rows, inside the scrolling content: one number for every side, or a side each,\n * as FlatList's `contentContainerStyle` padding.\n */\nexport type VirtualListPadding =\n | number\n | {\n readonly top?: number;\n readonly right?: number;\n readonly bottom?: number;\n readonly left?: number;\n };\n\n/** The padding on each side, in points. */\ninterface Edges {\n readonly top: number;\n readonly right: number;\n readonly bottom: number;\n readonly left: number;\n}\n\n/** A row height: one for every row, or one per item. */\nexport type VirtualItemHeight<T> = number | ((item: T, index: number) => number);\n\n/**\n * Keep what is on screen where it is when rows are added or removed before it, as\n * `ScrollView`'s `maintainVisibleContentPosition` does in React Native.\n */\nexport interface VirtualListVisiblePosition {\n /** Rows before this index are never what the position is held by. Defaults to 0. */\n readonly minIndexForVisible?: number;\n /**\n * Within this many points of the start, show what arrived instead of holding position: a feed\n * at its top scrolls to the new posts, a chat at its newest message follows the next one.\n */\n readonly autoscrollToTopThreshold?: number;\n}\n\n/** What a separator template is given: the rows either side of it, as FlatList's `leadingItem`. */\nexport interface VirtualListSeparatorContext<T> {\n readonly $implicit: T;\n readonly leadingItem: T;\n readonly trailingItem: T;\n readonly leadingIndex: number;\n}\n\n/**\n * Marks the template drawn between two rows: `<ng-template virtualListSeparator let-leading>`.\n * FlatList's `ItemSeparatorComponent`.\n */\n@Directive({ selector: 'ng-template[virtualListSeparator]' })\nexport class VirtualListSeparator<T = unknown> {\n readonly template = inject<TemplateRef<VirtualListSeparatorContext<T>>>(TemplateRef);\n\n static ngTemplateContextGuard<T>(\n _directive: VirtualListSeparator<T>,\n context: unknown,\n ): context is VirtualListSeparatorContext<T> {\n return true;\n }\n}\n\n/** One separator the list is drawing: its slot, and what its template is told. */\ninterface Gap<T> {\n readonly index: number;\n readonly style: Record<string, unknown>;\n readonly context: VirtualListSeparatorContext<T>;\n}\n\n/**\n * A parked slot: out of the flow, out of sight and out of reach, with its view kept to be used\n * again. Not `display: none`, which is an element with no view. A screen reader passes over a\n * view with no opacity, and `VirtualListRow` says so outright where a row uses it. Moved off the\n * list as well, since `pointer-events: none` is CSS's: something inside a row with a\n * `pointer-events` of its own would still take a touch where the row was left.\n */\nconst PARKED: Record<string, unknown> = Object.freeze({\n position: 'absolute',\n opacity: 0,\n pointerEvents: 'none',\n transform: 'translateX(-100000px)',\n});\n\n/** How many hidden slots of each row type are kept ready for reuse. */\nconst PARK_LIMIT = 6;\n\n/** The style of a row that sizes itself and needs nothing else: in flow, where it falls. */\nconst IN_FLOW: Record<string, unknown> = Object.freeze({});\n\n/** Points of drift below which a held position is left alone, as UIKit rounds to half-points. */\nconst HOLD_TOLERANCE = 0.5;\n/**\n * How long the JS thread has to be free of window changes before the window grows another\n * viewport: FlatList's `updateCellsBatchingPeriod`.\n */\nconst FILL_BATCH_MS = 50;\n/** How long without a scroll event counts as the scroll having stopped. */\nconst PAUSE_MS = 200;\n\n/** The row a held position is held by: its key, and how far into it the viewport starts. */\ninterface Anchor<T> {\n readonly key: unknown;\n readonly within: number;\n /** The items the anchor was taken against, to look for a successor in if its row goes. */\n readonly items: readonly T[];\n readonly index: number;\n}\n\n/**\n * Items in columns: the line each item is on, and the first item of each line. A sticky row takes\n * a line to itself, so lines are not every `columns` items once there is one.\n */\ninterface Lines {\n readonly of: Int32Array;\n readonly starts: readonly number[];\n}\n\n/** What the window is built from: the visible row and the edges of what is rendered. */\ninterface Span {\n readonly first: number;\n readonly last: number;\n}\n\n/**\n * Windowed list: a native scroll view whose content is sized to the full list, with only the\n * visible slice rendered. Commits as `RCTScrollView`.\n *\n * RN's FlatList, SectionList and VirtualizedList are a large React component tree, and none of\n * it is reachable. This is the small equivalent. Angular's own `@for` does the rendering, so\n * tracking, reuse and destruction all behave normally, and the loop stays in the caller's\n * template:\n *\n * ```html\n * <virtual-list #list [items]=\"rows()\" [itemHeight]=\"44\" (endReached)=\"loadMore()\">\n * <text listHeader>Header</text>\n * @for (row of list.window(); track row.slot) {\n * <view [virtualListRow]=\"row\"><text>{{ row.item.label }}</text></view>\n * }\n * <text listFooter>Footer</text>\n * </virtual-list>\n * ```\n *\n * With `itemHeight`, every row's size is known up front and each is absolutely positioned at its\n * offset. Without it, rows size themselves, as a feed's posts and a chat's messages do: the window\n * is laid out in normal flow after a spacer standing in for the rows above it, so native places\n * every row correctly in the frame it first appears, and each row's layout tells the list its\n * height for sizing what is not rendered. Until a row has been measured it counts as\n * `estimatedItemHeight`. Measurements are kept by `keyExtractor`, so they follow their item across\n * inserts, removals and moves. `virtualListRow` on each row's view applies its style and reports\n * its layout; `[style]=\"row.style\"` still works for fixed heights, which need no measuring.\n *\n * Content marked `listHeader` and `listFooter` renders above and below the rows in normal flow,\n * as FlatList's header and footer components do. A `<refresh-control>` projects like any child.\n *\n * `<ng-template virtualListSeparator let-leading let-trailing=\"trailingItem\">` is drawn between\n * each pair of rows and not after the last, as FlatList's `ItemSeparatorComponent` is. It is drawn\n * inside the leading row's slot, at its trailing edge, so `itemHeight` includes it the way\n * `getItemLayout`'s `length` includes it in RN; a measured row has it drawn over its trailing edge\n * once its height is known. The slot it sits in lets touches through to the row underneath.\n *\n * `horizontal` swaps the axis: rows are placed by `left` and sized by `width`, and the offset is\n * read from `contentOffset.x`. `inverted` is a scale of -1 on the list and on each row, which is\n * how FlatList does it too - the list scrolls from the bottom and each row is flipped back the\n * right way up. The first item is the one at the bottom, so a chat passes its messages newest\n * first.\n *\n * `stickyIndices` pins a row to the leading edge while the rows under it scroll past, which is\n * FlatList's `stickyHeaderIndices` counted without the header. `stickyHeader` pins the\n * `listHeader` content the same way, FlatList's index 0 when it has a `ListHeaderComponent`, and\n * the first sticky row pushes it off as RN's sticky headers push each other. Neither is native:\n * RN's `ScrollView.js` translates a sticky child against the scroll offset in JavaScript, and a\n * row here follows the offset the same way while it is the current one - by its `top` when\n * absolutely positioned, by a transform when in flow.\n *\n * What is on screen stays on screen when a measured row above it turns out taller or shorter than\n * its estimate: the offset is corrected by the difference. `maintainVisibleContentPosition` does\n * the same for rows inserted or removed above it, which a feed receiving new posts and a chat\n * loading older messages above the ones being read both need.\n *\n * ponytail: viewability is `itemVisiblePercentThreshold` only: `minimumViewTime` and\n * `waitForInteraction` are timing policy on top of the same measurement, and nothing has needed\n * them. A separator is not told `highlighted`, which RN drives from the row's press state. A\n * sticky header follows the scroll a commit behind native, where RN's is on the native driver. A\n * held position is restored by a `scrollTo` after the commit, not in the mount as native\n * `maintainVisibleContentPosition` is, so a correction made mid-fling lands where the last scroll\n * event said the list was.\n */\n@Component({\n selector: 'virtual-list',\n exportAs: 'virtualList',\n imports: [TemplateSlot, View],\n // One content view holds the header, the rows and the footer, as ScrollView.js's content\n // container does: Android's ScrollView takes one child and throws on a second. It is never\n // collapsed, or Fabric would flatten it away and hand the scroll view all three again.\n // See ScrollView: the canvas carries only a height, so Fabric would flatten it away and drags\n // over the gaps between rows would not scroll. Separators come after the rows so they draw over\n // the slot they share. The spacer is there only when rows are in flow.\n // A refresh control comes first, as the scroll view's own child; see ScrollView.\n template: `\n <ng-content select=\"refresh-control\" />\n <view [style]=\"content()\" collapsable=\"false\">\n <view [style]=\"headerStyle()\" (layout)=\"onHeaderLayout($event)\"\n ><ng-content select=\"[listHeader]\"\n /></view>\n <view #rows [style]=\"canvas()\" collapsable=\"false\">\n @if (measuring()) {\n <view [style]=\"spacer()\"></view>\n }\n <ng-content />\n @if (separator(); as separator) {\n @for (gap of gaps(); track gap.index) {\n <view [style]=\"gap.style\"\n ><ng-container\n [templateSlot]=\"separator.template\"\n [templateSlotContext]=\"gap.context\"\n /></view>\n }\n }\n </view>\n <view [style]=\"footerStyle()\"><ng-content select=\"[listFooter]\" /></view>\n </view>\n `,\n host: {\n // ScrollView.js's `baseHorizontal`: a column would stack the header, canvas and footer, and\n // the canvas, holding only absolutely positioned rows, would have no height to give them. A\n // top-level prop, as on <scroll-view>, so the caller's own [style] still applies over it.\n '[flexDirection]': \"horizontal() ? 'row' : 'column'\",\n '[horizontal]': 'horizontal()',\n '[nestedScrollEnabled]': 'nestedScroll()',\n // A prop rather than `[style.transform]`: Angular stringifies a style binding, and a\n // transform is a list of objects. The engine flattens style into props anyway, so this is\n // where it would have ended up.\n '[transform]': 'flip()',\n '[scrollEventThrottle]': 'scrollEventThrottle()',\n '(scrollBeginDrag)': 'onDragBegin()',\n '(momentumScrollEnd)': 'onScrollEnd()',\n '(layout)': 'onLayout($event)',\n '(contentSizeChange)': 'onContentSize($event)',\n },\n})\nexport class VirtualList<T> extends ScrollViewProps {\n readonly items = input.required<readonly T[]>();\n /**\n * A fixed height, or a function for variable ones, when every row's size is known up front. The\n * function form builds a cumulative offset table and binary-searches it, which is what section\n * lists need: a header row and an item row are different heights, so uniform maths cannot place\n * them. Leave it unset for rows that size themselves.\n */\n readonly itemHeight = input<VirtualItemHeight<T>>();\n /**\n * What a row that sizes itself counts as until it has been measured. The closer it is, the more\n * honest the scroll bar is and the less a jump to an unmeasured row has to correct.\n */\n readonly estimatedItemHeight = input<VirtualItemHeight<T>>(50);\n /**\n * Space around the rows, inside the scrolling content. The leading side comes before the first\n * row and the trailing side after the last; the sides across the axis inset every row. The\n * header and footer sit outside it, as FlatList's do outside `contentContainerStyle`.\n */\n readonly contentPadding = input<VirtualListPadding>(0);\n /** Space between one row and the next, along the axis: not before the first or after the last. */\n readonly rowGap = input(0, { transform: numberOr(0) });\n /**\n * An item's identity, as FlatList's `keyExtractor`: what a measured height, a slot and a held\n * position follow across an insert. Without it an item is its own key, which is enough for items\n * that are replaced, not copied, when they change.\n */\n readonly keyExtractor = input<(item: T, index: number) => unknown>();\n /**\n * What kind of row an item is, when rows of different kinds share the list: a text post and a\n * photo post, a message and a date divider. A slot is only ever recycled into a row of the same\n * type, so its views are reused rather than torn down for another kind's, as UIKit's reuse\n * identifiers and FlashList's `getItemType` do.\n */\n readonly itemType = input<(item: T, index: number) => unknown>();\n /** Keep what is on screen still when rows are inserted or removed before it. */\n readonly maintainVisibleContentPosition = input<VirtualListVisiblePosition>();\n /** Rows rendered beyond each edge of the viewport, to cover fling gaps. */\n readonly overscan = input(4, { transform: numberOr(4) });\n /**\n * How many viewports of rows the list fills, as FlatList's `windowSize`: the one on screen and\n * up to `windowSize - 1` more around it. While the JS thread is\n * idle the window grows a viewport at a time, ahead of the scroll direction first, so a fling\n * lands on rows already drawn. About two-thirds of the extra viewports go ahead of the scroll and\n * the rest behind. `1` fills no extra viewports, though a fast scroll still renders ahead of\n * itself unless `velocityLead` is `0`.\n */\n readonly windowSize = input(5, { transform: numberOr(5) });\n /**\n * How far past the viewport a scroll renders in the direction it is going, in milliseconds of\n * its speed, up to three viewports: the rows the list will reach by the time a window change has\n * been through JavaScript and back to native. `0` renders only the visible rows, the overscan\n * and the fill.\n */\n readonly velocityLead = input(500, { transform: numberOr(500) });\n /** How close to the end, in viewport heights, `(endReached)` fires. RN's default is 2. */\n readonly endReachedThreshold = input(2, { transform: numberOr(2) });\n\n /** Lay the rows out along x instead of y, and scroll that way. */\n readonly horizontal = input(false, { transform: booleanAttribute });\n /** Start at the end and scroll backwards, with every row flipped back the right way up. */\n readonly inverted = input(false, { transform: booleanAttribute });\n /**\n * Rows that pin to the leading edge while the ones under them scroll past. Ascending; a row is\n * pinned from the moment it would leave until the next sticky row pushes it off.\n */\n readonly stickyIndices = input<readonly number[]>([]);\n /** Pin the `listHeader` content to the leading edge until the first sticky row pushes it off. */\n readonly stickyHeader = input(false, { transform: booleanAttribute });\n /** What a tap in the list does while a text input has the keyboard up. See `ScrollView`. */\n readonly keyboardShouldPersistTaps = input<KeyboardShouldPersistTaps>('never');\n /** How much of a row must be on screen to count as viewable. RN's default is 0, meaning any. */\n readonly itemVisiblePercentThreshold = input(0, { transform: numberOr(0) });\n\n /**\n * The scroll position is within `endReachedThreshold` of the end: once per item count, and again\n * after the list has scrolled away from the end and come back.\n */\n readonly endReached = output<{ distanceFromEnd: number }>();\n\n /** Which rows are on screen, and what changed since last time. */\n readonly viewableItemsChanged = output<{\n viewable: readonly VirtualRow<T>[];\n entered: readonly number[];\n left: readonly number[];\n }>();\n\n private readonly viewport = signal(0);\n private readonly headerHeight = signal(0);\n /** What native reported the content measures along the axis, once it has. */\n private contentSize = 0;\n /** The rows' own extent when native reported that, so a report for other rows is not used. */\n private contentSizeFor = -1;\n /** The item count `endReached` last fired for, cleared once the list is away from the end. */\n private endReachedFor = -1;\n\n /** Slot styles are cached so a scroll does not hand Fabric new prop objects for stable rows. */\n private readonly slots = new Map<number, Record<string, unknown>>();\n /** A separator's slot style, per row slot style, so it is as stable as the row's own. */\n private readonly gapStyles = new WeakMap<object, Record<string, unknown>>();\n /** The same for a measured row's separator, by key, while its place and size stay put. */\n private readonly measuredGaps = new Map<unknown, Record<string, unknown>>();\n\n protected readonly separator = contentChild<VirtualListSeparator<T>>(VirtualListSeparator);\n private readonly refreshControl = contentChild(RefreshControl);\n\n /** See ScrollView: inside Android's swipe layout the list must see a drag first. */\n protected readonly nestedScroll = computed(() =>\n nativePlatform() === 'android' && this.refreshControl() ? true : undefined,\n );\n\n /** Viewports filled past the overscan, before and after the visible rows in index order. */\n private readonly fill = signal({ before: 0, after: 0 });\n /** The way the visible row last moved: 1 toward the end of the list, -1 toward the start. */\n private readonly direction = signal(1);\n /** The fill, cut to what `windowSize` allows ahead of the scroll and behind it. */\n private readonly reach = computed(() => {\n const { before, after } = this.fill();\n const { ahead, behind } = this.fillCaps();\n const forward = this.direction() > 0;\n return {\n before: Math.min(before, forward ? behind : ahead),\n after: Math.min(after, forward ? ahead : behind),\n };\n });\n private fillTimer: ReturnType<typeof setTimeout> | undefined;\n private readonly canvasView = viewChild.required('rows', { read: ElementRef });\n\n /** The sticky rows and header: see `StickyRows`. */\n private readonly sticky = new StickyRows(this.engine, this.node, {\n indices: this.stickyIndices,\n header: this.stickyHeader,\n headerHeight: this.headerHeight,\n horizontal: () => this.horizontal(),\n measuring: () => this.measuring(),\n topOf: (index) => this.topOf(index),\n heightOf: (index) => this.heightOf(index),\n slotStyle: (index) => this.slotStyle(index),\n flowSpacing: () => this.flowSpacing(),\n flip: () => this.flip(),\n flipText: () => this.flipText(),\n });\n\n /** Rows size themselves and are laid out in flow, rather than placed at a known offset. */\n readonly measuring = computed(() => this.itemHeight() === undefined);\n\n /** The padding on each side. */\n private readonly edges = computed<Edges>(() => {\n const padding = this.contentPadding();\n if (typeof padding === 'number') {\n return { top: padding, right: padding, bottom: padding, left: padding };\n }\n const { top = 0, right = 0, bottom = 0, left = 0 } = padding ?? {};\n return { top, right, bottom, left };\n });\n\n /** The padding before the first row, along the axis. */\n private readonly lead = computed(() =>\n this.horizontal() ? this.edges().left : this.edges().top,\n );\n\n /** The rows' insets across the axis, as the props that place an absolutely positioned row. */\n private readonly across = computed((): Record<string, number> => {\n const { top, right, bottom, left } = this.edges();\n return this.horizontal() ? { top, bottom } : { left, right };\n });\n\n /** How items are laid out across the width, when a directive on the list says: see the token. */\n private readonly columnLayout = inject(VIRTUAL_LIST_LAYOUT, { self: true, optional: true });\n\n /**\n * Items to a line. Only for a vertical list whose rows have known heights: a line's height\n * would otherwise wait on every item in it measuring, and FlatList's `numColumns` is vertical\n * only too. The directive says so in development.\n */\n private readonly columns = computed(() => {\n const columns = this.columnLayout?.columns() ?? 1;\n return this.measuring() || this.horizontal() ? 1 : columns;\n });\n\n /** Which line each item is on, when there is more than one to a line. */\n private readonly lines = computed<Lines | null>(() => {\n const columns = this.columns();\n if (columns === 1) return null;\n const count = this.items().length;\n const sticky = this.sticky.next();\n const of = new Int32Array(count);\n const starts: number[] = [];\n let column = columns;\n for (let i = 0; i < count; i++) {\n const alone = sticky.has(i);\n if (alone || column === columns) {\n starts.push(i);\n column = 0;\n }\n of[i] = starts.length - 1;\n column = alone ? columns : column + 1;\n }\n return { of, starts };\n });\n\n /** The props across each column, built once per change of columns, gap or padding. */\n private readonly columnAcross = computed(() => {\n const layout = this.columnLayout;\n if (!layout || !this.lines()) return [];\n const { left, right } = this.edges();\n return Array.from({ length: this.columns() }, (_, column) =>\n layout.across(column, left, right),\n );\n });\n\n /** An item's insets across the axis: its column's, or the whole width's. */\n private acrossOf(index: number): Record<string, unknown> {\n const lines = this.lines();\n if (!lines || this.sticky.next().has(index)) return this.across();\n return this.columnAcross()[index - lines.starts[lines.of[index]!]!]!;\n }\n\n /** The line an item is on: the item itself, when each has a line to itself. */\n private lineOf(index: number): number {\n const lines = this.lines();\n // An index past the items, a sticky one given for rows not there yet, is past the last line.\n return lines ? (lines.of[index] ?? lines.starts.length) : index;\n }\n\n /** Whether a row is on the list's last line, which no separator comes after. */\n private onLastLine(index: number): boolean {\n const lines = this.lines();\n return lines ? lines.of[index] === lines.starts.length - 1 : index >= this.items().length - 1;\n }\n\n /** The first item on a line, or the item count for a line past the last. */\n private lineStart(line: number): number {\n const lines = this.lines();\n if (!lines) return Math.min(line, this.items().length);\n return line < lines.starts.length ? lines.starts[line]! : this.items().length;\n }\n\n /** Heights native has reported, by key. */\n private readonly measured = new Map<unknown, number>();\n /** Bumped when a measurement changes, which is what re-sizes the list. */\n private readonly measuredVersion = signal(0);\n\n /** Each item's key, or null when items are their own. */\n private readonly keys = computed<readonly unknown[] | null>(() => {\n const extract = this.keyExtractor();\n return extract ? this.items().map(extract) : null;\n });\n\n private keyAt(index: number): unknown {\n return this.keys()?.[index] ?? this.items()[index];\n }\n\n /**\n * Each row's size and where it starts, for variable heights; uniform rows need no index at all.\n * Built once per change of items. A measurement changes it in place and bumps\n * `measuredVersion`, which is what everything that reads it depends on, so a row laying out\n * costs a walk of the tree rather than a rebuild of every offset.\n */\n private readonly table = computed<HeightIndex | null>(() => {\n const height = this.itemHeight();\n const lines = this.lines();\n if (typeof height === 'number' && !lines) return null;\n\n // Each row's entry is its size and the gap after it, so where a row starts counts the gaps\n // before it without a second table.\n const gap = this.rowGap();\n const items = this.items();\n if (lines) {\n // An entry a line, as tall as the tallest item on it.\n const sizes = new Float64Array(lines.starts.length);\n for (let i = 0; i < items.length; i++) {\n const size = (typeof height === 'function' ? height(items[i]!, i) : height!) + gap;\n const line = lines.of[i]!;\n sizes[line] = Math.max(sizes[line]!, size);\n }\n return new HeightIndex(sizes);\n }\n const sizes = new Float64Array(items.length);\n if (typeof height === 'function') {\n for (let i = 0; i < items.length; i++) sizes[i] = height(items[i]!, i) + gap;\n return new HeightIndex(sizes);\n }\n const estimate = this.estimatedItemHeight();\n const keys = this.keys();\n for (let i = 0; i < items.length; i++) {\n const size =\n this.measured.get(keys ? keys[i] : items[i]) ??\n (typeof estimate === 'number' ? estimate : estimate(items[i]!, i));\n sizes[i] = size + gap;\n }\n return new HeightIndex(sizes);\n });\n\n /** Where each key is, so a measurement finds its row without a search. */\n private readonly indexOfKey = computed(() => {\n if (!this.measuring()) return null;\n const map = new Map<unknown, number>();\n (this.keys() ?? this.items()).forEach((key, index) => map.set(key, index));\n return map;\n });\n\n /** The index, with a dependency on its measurements for whoever is reading it. */\n private layout(): HeightIndex | null {\n const table = this.table();\n if (table) this.measuredVersion();\n return table;\n }\n\n /**\n * The list's own total extent along its axis: the padding at both ends, the rows, and a gap\n * between each two of them.\n */\n private readonly extent = computed(() => {\n const table = this.layout();\n const count = this.items().length;\n const rows = table ? table.total : count * this.stride();\n const { top, right, bottom, left } = this.edges();\n const padding = this.horizontal() ? left + right : top + bottom;\n return padding + (count ? rows - this.rowGap() : 0);\n });\n\n /** A fixed-height row and the gap after it. */\n private stride(): number {\n return (this.itemHeight() as number) + this.rowGap();\n }\n\n /** ScrollView.js's `contentContainerHorizontal`: the header, rows and footer side by side. */\n protected readonly content = computed(() =>\n this.horizontal() ? { flexDirection: 'row' } : undefined,\n );\n\n protected readonly canvas = computed(() =>\n this.horizontal() ? { width: this.extent(), flexDirection: 'row' } : { height: this.extent() },\n );\n\n /**\n * `scaleY: -1` on the list, and the same on every row.\n *\n * The list ends up scrolled from the far end with its rows in reverse, and the second flip puts\n * each row's own content back the right way up. It is what `FlatList` does, and it is why an\n * inverted list needs no reversed maths: the first item is at offset 0, which is the bottom.\n */\n protected readonly flip = computed<StaticTransform[] | undefined>(() => {\n if (!this.inverted()) return undefined;\n const scale: StaticTransform = this.horizontal() ? { scaleX: -1 } : { scaleY: -1 };\n return [scale];\n });\n\n /**\n * The flip as a style's transform: CSS text, which the engine turns into the list native reads.\n * A style binding validates its values as the DOM's, and warns on a list in development.\n */\n private readonly flipText = computed(() => {\n if (!this.inverted()) return undefined;\n return this.horizontal() ? 'scaleX(-1)' : 'scaleY(-1)';\n });\n\n /**\n * What places a row in flow: the gap after it and the padding across the axis, as margins, since\n * native lays the row out. Empty when there are none, so a plain list commits no margins.\n */\n private readonly flowSpacing = computed<Record<string, unknown>>(() => {\n const gap = this.rowGap();\n const { top, right, bottom, left } = this.edges();\n const spacing: Record<string, number> = this.horizontal()\n ? { marginRight: gap, marginTop: top, marginBottom: bottom }\n : { marginBottom: gap, marginLeft: left, marginRight: right };\n return Object.fromEntries(Object.entries(spacing).filter(([, value]) => value !== 0));\n });\n\n /** A row in flow, flipped back when the list is inverted. One object, so rows never re-clone. */\n private readonly flowStyle = computed(() => {\n const flip = this.flipText();\n const spacing = this.flowSpacing();\n if (!flip && Object.keys(spacing).length === 0) return IN_FLOW;\n return flip ? { ...spacing, transform: flip } : spacing;\n });\n\n /** Top of a row: the leading padding, and every row and gap before it. In columns, its line's. */\n private topOf(index: number): number {\n const table = this.layout();\n return this.lead() + (table ? table.topOf(this.lineOf(index)) : index * this.stride());\n }\n\n /** A row's own size, without the gap after it. In columns, its line's. */\n private heightOf(index: number): number {\n const table = this.layout();\n if (!table) return this.itemHeight() as number;\n return table.heightOf(this.lineOf(index)) - this.rowGap();\n }\n\n /** First row whose bottom, or the gap after it, is past `y`. In columns, the first on its line. */\n private indexAt(y: number): number {\n const table = this.layout();\n const along = y - this.lead();\n if (!table) return Math.max(0, Math.floor(along / this.stride()));\n const at = table.indexAt(along);\n return this.lines() ? this.lineStart(at) : at;\n }\n\n // --- holding position -------------------------------------------------------------------\n\n /** The row the viewport's leading edge is in, taken at each scroll. */\n private anchor: Anchor<T> | null = null;\n /** The last offset seen. A field rather than a signal: reading it renders nothing. */\n private lastOffset = 0;\n /**\n * A correction to make once the commit that needs it is on its way to native: an offset in the\n * rows' own space, after the header, or the very start of the list.\n */\n private pendingScroll: { offset: number; animated: boolean } | 'start' | null = null;\n\n /** What moves the rows: which items, and where each one is. */\n private readonly placement = computed(() => ({\n items: this.items(),\n table: this.table(),\n version: this.measuredVersion(),\n }));\n\n /**\n * The first *visible* row, not the first rendered one, and not the raw scroll offset. A fling\n * produces a scroll event per frame, and setting a signal on each one costs a change-detection\n * pass even when the visible rows are identical. Deriving the index in the handler means most\n * scroll events change nothing and cost nothing.\n *\n * Linked to the rows' placement, because that is when the row on screen can move without the\n * user scrolling: an insert above it, or a row above it measuring differently from its estimate.\n * The index follows the anchored row there, and the offset follows it too.\n */\n private readonly visible = linkedSignal<\n { items: readonly T[]; table: HeightIndex | null; version: number },\n number\n >({\n source: this.placement,\n computation: (placement) => this.reanchor(placement.items),\n });\n\n /** Take the anchor at a row, keeping the viewport where it is. */\n private anchorAt(at: number, offset: number): void {\n const items = this.items();\n if (!items.length) {\n this.anchor = null;\n return;\n }\n const index = Math.min(at, items.length - 1);\n this.anchor = { key: this.keyAt(index), within: offset - this.topOf(index), items, index };\n }\n\n /**\n * Where the row on screen went when the rows moved under it, and the offset that keeps it where\n * the user left it. An insert or a removal is only held when the caller asked for it; a row\n * above measuring differently always is, since nothing the user did moved anything.\n */\n private reanchor(items: readonly T[]): number {\n const anchor = this.anchor;\n // Empty for a moment, as a filter typed through leaves it: the offset is kept for what comes.\n if (!items.length) return 0;\n if (!anchor) return this.atOffset();\n\n const index = this.heldIndex(anchor, items);\n if (index === 'start') return this.showStart();\n if (index < 0) return this.atOffset();\n // No further than the content lets native scroll, past the footer and the inset after it:\n // Android stops a scroll there and iOS would show blank space past it, and the window must be\n // built for where it is. Not cut at the start, where an inset before the rows, or a bounce,\n // puts native above zero.\n const header = this.headerHeight();\n const want = this.topOf(index) + anchor.within;\n const held = Math.min(want, this.reachable(header + want) - header);\n if (Math.abs(held - this.lastOffset) > HOLD_TOLERANCE) {\n this.pendingScroll = { offset: held, animated: false };\n this.lastOffset = held;\n }\n // The window is built from the row the held offset lands in, which is not the anchored one\n // when that row came out shorter than the way into it: a new column count can move an item\n // off a line made tall by another item, onto a short one.\n // In a single column the anchored row is kept, so a row scrolled to stays held there.\n const top = this.lines() ? Math.max(0, Math.min(this.indexAt(held), items.length - 1)) : index;\n if (top === index) {\n this.anchor = { ...anchor, items, index };\n return index;\n }\n this.anchorAt(top, held);\n return top;\n }\n\n /**\n * The row under the offset native is still at, in rows that have just replaced the old ones, as\n * a filter replaces them. Native keeps its offset whatever the items became, so the window is\n * worked out from that, not from the old row's index, which in the new rows sits somewhere else.\n * When the new rows end before that offset, the list is scrolled back to their end: native\n * would otherwise stay scrolled past it, showing nothing until the next drag.\n */\n private atOffset(): number {\n const end = Math.max(0, this.extent() - this.viewport());\n if (this.viewport() > 0 && this.lastOffset > end + HOLD_TOLERANCE) {\n this.pendingScroll = { offset: end, animated: false };\n this.lastOffset = end;\n }\n const index = Math.max(0, Math.min(this.indexAt(this.lastOffset), this.items().length - 1));\n this.anchorAt(index, this.lastOffset);\n return index;\n }\n\n /**\n * The index to hold the viewport at, -1 to let it move, or the start of the list when an\n * insert lands within the autoscroll threshold of it.\n */\n private heldIndex(anchor: Anchor<T>, items: readonly T[]): number | 'start' {\n if (items === anchor.items) return anchor.index;\n const hold = this.maintainVisibleContentPosition();\n if (!hold) return -1;\n const threshold = hold.autoscrollToTopThreshold;\n if (threshold !== undefined && this.lastOffset <= threshold) return 'start';\n const index = this.successorOf(anchor, items);\n return index < (hold.minIndexForVisible ?? 0) ? -1 : index;\n }\n\n /** Scroll to what arrived at the start, rather than holding the viewport past it. */\n private showStart(): number {\n this.anchorAt(0, 0);\n if (this.lastOffset !== 0) this.pendingScroll = 'start';\n this.lastOffset = 0;\n return 0;\n }\n\n /**\n * The anchored row's new index, or the first row after it that survived when it did not. Only\n * the rows that were rendered are searched for a successor: past those the viewport has moved\n * on, and holding it by something off screen would be holding it by nothing the user saw.\n */\n private successorOf(anchor: Anchor<T>, items: readonly T[]): number {\n const keys = this.keys() ?? items;\n const index = keys.indexOf(anchor.key);\n if (index !== -1) return index;\n const extract = this.keyExtractor();\n const was = anchor.items;\n const limit = Math.min(was.length, anchor.index + this.overscan() * 4 + 1);\n for (let i = anchor.index + 1; i < limit; i++) {\n const successor = keys.indexOf(extract ? extract(was[i]!, i) : was[i]);\n if (successor !== -1) return successor;\n }\n return -1;\n }\n\n /** Make a queued correction, after the commit that moved the rows has gone to native. */\n private flushScroll(): void {\n const pending = this.pendingScroll;\n if (!pending) return;\n this.pendingScroll = null;\n if (pending === 'start') this.scrollToOffset({ offset: 0, animated: true });\n else this.scrollToOffset({ offset: this.headerHeight() + pending.offset, animated: false });\n }\n\n /** In development, a list with rows that stays at zero size; see `ZeroSizeWarning`. */\n private readonly zeroSize = checksZeroSize()\n ? new ZeroSizeWarning(\n () => written(this.node),\n () => !!this.horizontal(),\n )\n : null;\n\n constructor() {\n super();\n afterEveryRender(() => {\n this.flushScroll();\n if (this.sticky.native) this.driveStickyRows();\n this.recheckItems();\n });\n // Not a host `(scroll)` listener: Angular marks every view above one dirty on each event, so a\n // fling would check the whole screen every frame. What a scroll changes is in signals, which\n // schedule the views that read them.\n const stopScroll = this.engine.setEventListener(this.node, 'topScroll', (event) =>\n this.onScroll(event as NativeSyntheticEvent<{ contentOffset?: { x?: number; y?: number } }>),\n );\n const stop = dismissKeyboardOnTap(this.engine, this.node, () =>\n this.keyboardShouldPersistTaps(),\n );\n inject(DestroyRef).onDestroy(() => {\n stopScroll();\n stop();\n this.sticky.destroy();\n clearTimeout(this.fillTimer);\n clearTimeout(this.speedTimer);\n this.zeroSize?.stop();\n });\n if (this.zeroSize) this.checkZeroSize(this.zeroSize);\n effect(() => this.scheduleFill());\n }\n\n /** The items the end and viewability were last checked against after a render. */\n private checkedItems: readonly T[] | null = null;\n /** And the table placing them, which a new column count makes again for the same items. */\n private checkedTable: HeightIndex | null = null;\n\n /**\n * New items can bring the end within reach or change what is on screen with no scroll: a list\n * shorter than its viewport, a page appended while at the end, a filter. Checked once the rows\n * they make are rendered, and only when they changed, so any other render costs a comparison.\n */\n private recheckItems(): void {\n const items = this.items();\n const table = this.table();\n if (items === this.checkedItems && table === this.checkedTable) return;\n this.checkedItems = items;\n this.checkedTable = table;\n this.checkEnd(this.headerHeight() + this.lastOffset);\n this.announceViewable(this.lastOffset);\n }\n\n /** Whether the viewport has been laid out yet, so a zero in it is a measurement. */\n private viewportMeasured = false;\n\n /**\n * In development, rows that arrive in a list already measured at zero, or go from one, with no\n * new layout to say so: an update to `items` alone does not lay the viewport out again.\n */\n private checkZeroSize(warning: ZeroSizeWarning): void {\n effect(() => {\n const hasRows = this.items().length > 0;\n if (this.viewportMeasured) warning.laidOut(untracked(this.viewport), hasRows);\n });\n }\n\n // --- the window ---------------------------------------------------------------------------\n\n /** The rows to render, and the edges of the run they sit in. */\n private readonly span = computed<Span | null>(() => {\n const items = this.items();\n const viewport = this.viewport();\n const overscan = this.overscan();\n if (!items.length) return null;\n\n // Counted in lines, which are rows unless items are in columns.\n const line = this.lineOf(Math.min(this.visible(), items.length - 1));\n const visible = this.lineStart(line);\n // In viewports, so nothing before the first layout.\n const fill = this.reach();\n // Before the first layout we have no viewport, so render a screen's worth optimistically\n // rather than nothing: an empty first frame is worse than a few extra rows.\n const overscanned = this.lineStart(Math.max(0, line - overscan));\n const budget = viewport > 0 ? viewport : this.heightOf(overscanned) * overscan * 2;\n /*\n * Measured from the top of the first *visible* row, not the first rendered one.\n *\n * Anchoring it at `first` - which is already backed off by the overscan - spent the budget\n * on rows above the viewport, so the window ran out that far before the bottom of the\n * screen. The trailing `+ overscan` hid it whenever every row was the same height, because\n * then the rows added below happened to be worth exactly the rows wasted above. With mixed\n * heights they are not, and the list clips short of its own bottom.\n */\n // Within three viewports of the viewport as it is now, which may have shrunk since.\n const reach = 3 * Math.max(0, viewport);\n const ahead = this.velocityLead() ? Math.max(-reach, Math.min(reach, this.ahead())) : 0;\n const top = this.topOf(visible);\n const first = Math.max(\n 0,\n Math.min(overscanned, this.indexAt(top - fill.before * viewport - Math.max(0, -ahead))),\n );\n\n let last = visible;\n while (last < items.length && this.topOf(last) < top + budget) last++;\n /*\n * The viewport starts anywhere inside the visible row, so it can end up to that row's size\n * past `top + budget`. The overscan below covers that for a row no taller than the rows after\n * it; a taller one, a photo over its comments, needs the rows down to there as well. Taken\n * from the scroll offset instead, the window would change on every scroll event rather than\n * when the visible row does.\n */\n let end = last < items.length ? this.lineStart(this.lineOf(last) + overscan) : items.length;\n const deepest =\n top +\n this.heightOf(visible) +\n this.rowGap() +\n budget +\n fill.after * viewport +\n Math.max(0, ahead);\n while (end < items.length && this.topOf(end) < deepest) end++;\n return { first, last: end };\n });\n\n readonly window = computed<VirtualRow<T>[]>(() => {\n const span = this.span();\n if (!span) return [];\n const rows = this.rowsFor(this.items(), span.first, span.last);\n this.trimParked();\n for (const pool of this.parked.values()) rows.push(...pool);\n // The cache exists for rows that stay in the window between scrolls; anything that has left\n // it is rebuilt if it comes back, so the map stays the size of the window, not of the list.\n for (const index of this.slots.keys()) {\n if (index < span.first || index >= span.last) this.slots.delete(index);\n }\n return rows;\n });\n\n /**\n * What stands in for the rows above the window when rows are in flow: their total extent, less\n * a pinned row's, which is rendered in flow ahead of the window.\n */\n protected readonly spacer = computed(() => {\n const span = this.span();\n let lead = span ? this.topOf(span.first) : 0;\n const pinned = this.sticky.pinned();\n if (span && pinned !== null && pinned < span.first) {\n lead = this.sticky.native ? this.topOf(pinned) : lead - this.heightOf(pinned) - this.rowGap();\n }\n return this.horizontal() ? { width: Math.max(0, lead) } : { height: Math.max(0, lead) };\n });\n\n /** The rows from `first` up to `last`, and the pinned row above them if there is one. */\n private rowsFor(items: readonly T[], first: number, last: number): VirtualRow<T>[] {\n const rows: VirtualRow<T>[] = [];\n const pinned = this.sticky.pinned();\n const pinnedAbove = pinned !== null && pinned < first;\n this.releaseRecycled(first, last, pinnedAbove ? pinned : null);\n // The pinned row is on screen even when its own place in the list is not, which is the whole\n // point of it, so it is rendered whether or not the window reaches that far.\n if (pinnedAbove) {\n const key = this.keyAt(pinned);\n rows.push(\n this.hold({\n index: pinned,\n slot: this.recycledSlot(key, items[pinned]!, pinned),\n key,\n item: items[pinned]!,\n style: this.sticky.native\n ? this.sticky.style(pinned)\n : this.measuring()\n ? this.sticky.flowStyle(this.topOf(first) - this.heightOf(pinned) - this.rowGap())\n : this.slotStyle(pinned, this.sticky.offset()),\n }),\n );\n }\n for (let index = first; index < last; index++) {\n const key = this.keyAt(index);\n rows.push(\n this.hold({\n index,\n slot: this.recycledSlot(key, items[index]!, index),\n key,\n item: items[index]!,\n style: this.styleFor(index, index === pinned),\n }),\n );\n }\n if (pinnedAbove && this.sticky.native && this.measuring()) this.leadWindow(rows, pinned, first);\n return rows;\n }\n\n /**\n * A pinned row native moves stays at its own place, so the rows between it and the window are\n * made up before the window rather than after the row: new props on a view native is moving\n * put its transform back for a frame.\n */\n private leadWindow(rows: VirtualRow<T>[], pinned: number, first: number): void {\n const lead = rows[1];\n // The pinned row's own gap already follows it in flow.\n const between = this.topOf(first) - this.topOf(pinned) - this.heightOf(pinned) - this.rowGap();\n if (!lead || between <= 0) return;\n const margin = this.horizontal() ? 'marginLeft' : 'marginTop';\n rows[1] = this.hold({ ...lead, style: { ...lead.style, [margin]: between } });\n }\n\n private styleFor(index: number, pinned: boolean): Record<string, unknown> {\n if (this.sticky.native && this.sticky.next().has(index)) return this.sticky.style(index);\n if (this.measuring()) {\n return pinned ? this.sticky.flowStyle(this.topOf(index)) : this.flowStyle();\n }\n return pinned ? this.slotStyle(index, this.sticky.offset()) : this.slotStyle(index);\n }\n\n /**\n * Hand each rendered sticky row's view to native to move. The rows' views are the canvas's\n * element children in window order, after the spacer, which is how `@for` over `window()`\n * leaves them.\n */\n private driveStickyRows(): void {\n const views = () =>\n (this.canvasView().nativeElement as HostNode).childList\n .filter((child) => child.nodeKind === 'element')\n .slice(this.measuring() ? 1 : 0);\n this.sticky.drive(() => this.window(), views);\n }\n\n /** Which recycling slot each rendered item holds, by key: its type, and the row it last drew. */\n private readonly recycled = new Map<\n unknown,\n { slot: number; type: unknown; row: VirtualRow<T> | null }\n >();\n /** Slots that have left the window and are kept hidden, by the type of row that held them. */\n private readonly parked = new Map<unknown, VirtualRow<T>[]>();\n private nextSlot = 0;\n\n /** Note the row a slot is drawing, for parking it once it leaves. */\n private hold(row: VirtualRow<T>): VirtualRow<T> {\n const held = this.recycled.get(row.key);\n if (held) held.row = row;\n return row;\n }\n\n /**\n * Park the slots of the items that have left the window, for the items arriving.\n *\n * Parked rather than freed: a slot missing from the window is destroyed by `@for`, so a slot is\n * only reused if a row of its type arrives in the same pass as it left. Kept rendered and\n * hidden, it waits for the next row of its type however many passes later, which is what a\n * reuse queue of cells does in UIKit.\n */\n private releaseRecycled(first: number, last: number, pinned: number | null): void {\n const keep = new Set<unknown>();\n for (let index = first; index < last; index++) keep.add(this.keyAt(index));\n if (pinned !== null) keep.add(this.keyAt(pinned));\n for (const [key, held] of this.recycled) {\n if (keep.has(key)) continue;\n this.recycled.delete(key);\n let pool = this.parked.get(held.type);\n if (!pool) this.parked.set(held.type, (pool = []));\n pool.push({ ...(held.row ?? this.placeholder(key, held.slot)), parked: true, style: PARKED });\n }\n }\n\n /**\n * Keep a few hidden slots of each type once this pass has taken what it needs, dropping the\n * oldest: `@for` destroys the views of a slot that leaves the window for good.\n */\n private trimParked(): void {\n for (const pool of this.parked.values()) {\n if (pool.length > PARK_LIMIT) pool.splice(0, pool.length - PARK_LIMIT);\n }\n }\n\n /** A parked row for a slot that never drew, which only a slot taken and left in one pass is. */\n private placeholder(key: unknown, slot: number): VirtualRow<T> {\n return { index: -1, slot, key, item: this.items()[0]!, style: PARKED };\n }\n\n private recycledSlot(key: unknown, item: T, index: number): number {\n // A sticky row is a type of its own: native keeps the translate it moved one by, and a plain\n // row taking its slot commits no transform to put it back. A row that stops or starts being\n // sticky takes a new slot for the same reason.\n const sticky = this.sticky.next().has(index);\n const held = this.recycled.get(key);\n if (held && this.sticky.isType(held.type) === sticky) return held.slot;\n const type = this.sticky.recyclingType(index, this.itemType()?.(item, index));\n const slot = this.unpark(key, type) ?? this.parked.get(type)?.pop()?.slot ?? this.nextSlot++;\n this.recycled.set(key, { slot, type, row: null });\n return slot;\n }\n\n /**\n * Take an item's own parked row out as it comes back: its slot if it is of the type the item now\n * is, and gone either way, or the window would hold its key twice.\n */\n private unpark(key: unknown, type: unknown): number | undefined {\n for (const [kind, pool] of this.parked) {\n const at = pool.findIndex((row) => row.key === key);\n if (at < 0) continue;\n const [row] = pool.splice(at, 1);\n return kind === type ? row!.slot : undefined;\n }\n return undefined;\n }\n\n /**\n * A row laid itself out; what `virtualListRow` calls. Only a row that sizes itself is measured,\n * and a height that has not changed changes nothing.\n */\n measureRow(row: VirtualRow<T>, layout: { width?: number; height?: number } | undefined): void {\n if (!this.measuring() || !layout || row.parked) return;\n const size = this.horizontal() ? layout.width : layout.height;\n if (size === undefined || this.measured.get(row.key) === size) return;\n this.measured.set(row.key, size);\n this.forgetDeparted();\n const index = this.indexOfKey()?.get(row.key);\n if (index === undefined) return;\n this.table()?.set(index, size + this.rowGap());\n this.measuredVersion.update((version) => version + 1);\n }\n\n /**\n * A row handed a view native has laid out before. Native reports a layout only when a view's\n * frame differs from the last one it reported, so an item that lands where the view already was,\n * at the same size, is never measured; the view's last size is its own until native says\n * otherwise.\n */\n adoptRow(row: VirtualRow<T>, layout: { width?: number; height?: number }): void {\n if (!this.measured.has(row.key)) this.measureRow(row, layout);\n }\n\n /** Drop the measurements of items long gone, so churn cannot grow the map without bound. */\n private forgetDeparted(): void {\n const items = this.items();\n if (this.measured.size <= items.length * 2 + 64) return;\n const current = new Set(this.keys() ?? items);\n for (const key of this.measured.keys()) if (!current.has(key)) this.measured.delete(key);\n }\n\n /** A separator for every rendered row but the list's last, in its leading row's slot. */\n protected readonly gaps = computed<Gap<T>[]>(() => {\n if (!this.separator()) return [];\n const items = this.items();\n const gaps: Gap<T>[] = [];\n for (const row of this.window()) {\n if (row.parked || this.onLastLine(row.index)) continue;\n const style = this.measuring() ? this.measuredGapStyle(row) : this.gapStyle(row);\n if (!style) continue;\n // What follows it along the list: the next line's first item, not the one beside it.\n const trailingItem = items[this.lineStart(this.lineOf(row.index) + 1)]!;\n gaps.push({\n index: row.index,\n style,\n context: {\n $implicit: row.item,\n leadingItem: row.item,\n trailingItem,\n leadingIndex: row.index,\n },\n });\n }\n return gaps;\n });\n\n /** The row's own slot, laid out to put the separator at its trailing edge. */\n private gapStyle(row: VirtualRow<T>): Record<string, unknown> {\n let style = this.gapStyles.get(row.style);\n if (!style) {\n style = {\n ...row.style,\n flexDirection: this.horizontal() ? 'row' : 'column',\n justifyContent: 'flex-end',\n pointerEvents: 'box-none',\n };\n this.gapStyles.set(row.style, style);\n }\n return style;\n }\n\n /**\n * A measured row's slot, over the row itself: nothing until its height is known, since drawing\n * it at the estimate would put a line through the middle of a row that turns out taller.\n */\n private measuredGapStyle(row: VirtualRow<T>): Record<string, unknown> | null {\n if (!this.measured.has(row.key)) return null;\n const start = this.topOf(row.index);\n const size = this.heightOf(row.index);\n const horizontal = this.horizontal();\n const flip = this.flipText();\n const across = this.across();\n const cached = this.measuredGaps.get(row.key);\n const placed = horizontal\n ? { ...across, left: start, width: size, transform: flip }\n : { ...across, top: start, height: size, transform: flip };\n if (cached && holds(cached, placed)) return cached;\n const style: Record<string, unknown> = horizontal\n ? { position: 'absolute', ...across, left: start, width: size, flexDirection: 'row' }\n : { position: 'absolute', ...across, top: start, height: size };\n style['justifyContent'] = 'flex-end';\n style['pointerEvents'] = 'box-none';\n if (flip) style['transform'] = flip;\n this.measuredGaps.set(row.key, style);\n if (this.measuredGaps.size > 256) this.measuredGaps.clear();\n return style;\n }\n\n /** The header, pinned with the rows when `stickyHeader` says so: see `StickyRows`. */\n protected readonly headerStyle = this.sticky.headerStyle;\n\n /**\n * The footer, flipped back like every row when the list is inverted, as FlatList inverts its\n * header and footer cells too; otherwise both read upside down.\n */\n protected readonly footerStyle = computed(() => {\n const flip = this.flipText();\n return flip ? { transform: flip } : undefined;\n });\n\n /** Which rows are on screen far enough to count, by the caller's threshold. */\n private viewableAt(offset: number): number[] {\n const viewport = this.viewport();\n if (!viewport) return [];\n\n const threshold = this.itemVisiblePercentThreshold() / 100;\n const rows: number[] = [];\n for (const row of this.window()) {\n if (row.parked) continue;\n const start = this.topOf(row.index);\n const size = this.heightOf(row.index);\n const shown = Math.min(start + size, offset + viewport) - Math.max(start, offset);\n if (shown > 0 && shown >= size * threshold) rows.push(row.index);\n }\n return rows;\n }\n\n /** The last set announced, so the output fires on a change rather than on every frame. */\n private announced: number[] = [];\n /** The items the last set was announced from: new items are a change even at the same indices. */\n private announcedFrom: readonly T[] | null = null;\n\n /**\n * Announce a change in what is on screen.\n *\n * Deliberately not a `computed` over a signal offset. A fling produces a scroll event per\n * frame, and writing a signal on each one costs a change-detection pass whether or not anything\n * moved into view; comparing here costs an array walk over the window and emits only when the\n * set really changed.\n */\n private announceViewable(offset: number): void {\n const viewable = this.viewableAt(offset);\n const entered = viewable.filter((index) => !this.announced.includes(index));\n const left = this.announced.filter((index) => !viewable.includes(index));\n const items = this.items();\n const same = items === this.announcedFrom || viewable.length === 0;\n if (entered.length === 0 && left.length === 0 && same) return;\n\n this.announced = viewable;\n this.announcedFrom = items;\n this.viewableItemsChanged.emit({\n viewable: viewable.map((index) => {\n const key = this.keyAt(index);\n return {\n index,\n // What is viewable is in the window, so it holds a slot already.\n slot: this.recycled.get(key)?.slot ?? -1,\n key,\n item: items[index]!,\n style: this.styleFor(index, false),\n };\n }),\n entered,\n left,\n });\n }\n\n /**\n * Scroll so that a row is at the start of the viewport, less `viewOffset`. The window moves\n * there at once, and the row is held there while the rows around it are measured.\n */\n scrollToIndex(options: { index: number; animated?: boolean; viewOffset?: number }): void {\n const items = this.items();\n if (!items.length) return;\n const index = Math.max(0, Math.min(options.index, items.length - 1));\n const within = -(options.viewOffset ?? 0);\n const offset = this.topOf(index) + within;\n this.lastOffset = offset;\n this.anchor = { key: this.keyAt(index), within, items, index };\n this.jumpTo(index);\n // The start of its line, which is what a scroll event there gives, so the fill keeps its way.\n this.moveTo(this.lineStart(this.lineOf(index)));\n this.scrollToOffset({ offset: this.headerHeight() + offset, animated: options.animated });\n }\n\n /** Scroll to an offset along the list's own axis: x when it is horizontal, y otherwise. */\n scrollToOffset(options: { offset: number; animated?: boolean }): void {\n const { offset, animated = true } = options;\n this.jumpTo(this.indexAt(offset - this.headerHeight()));\n const [x, y] = this.horizontal() ? [offset, 0] : [0, offset];\n this.sticky.jumping(this.reachable(offset), animated);\n this.engine.dispatchCommand(this.node, 'scrollTo', [x, y, animated]);\n }\n\n scrollToEnd(options: { animated?: boolean } = {}): void {\n this.sticky.jumping(this.reachable(Infinity), options.animated ?? true);\n this.jumpTo(this.items().length - 1);\n this.engine.dispatchCommand(this.node, 'scrollToEnd', [options.animated ?? true]);\n }\n\n private slotStyle(index: number, pinnedAt?: number): Record<string, unknown> {\n const start = pinnedAt ?? this.topOf(index);\n const size = this.heightOf(index);\n const horizontal = this.horizontal();\n const key = horizontal ? 'left' : 'top';\n const extent = horizontal ? 'width' : 'height';\n\n const flip = this.flipText();\n const across = this.acrossOf(index);\n\n let style = this.slots.get(index);\n // The flip is part of the comparison because turning the list over changes every row, and a\n // cached slot would otherwise keep the orientation it was built with.\n const placed = { ...across, [extent]: size, [key]: start, transform: flip };\n const stale = !style || pinnedAt !== undefined || !holds(style, placed);\n\n if (stale) {\n style = horizontal\n ? { position: 'absolute', ...across, left: start, width: size }\n : { position: 'absolute', ...across, top: start, height: size };\n // A pinned row draws over the ones sliding under it; the transform is the row's half of\n // the inversion.\n if (pinnedAt !== undefined) style['zIndex'] = 1;\n if (flip) style['transform'] = flip;\n this.slots.set(index, style);\n return style;\n }\n return style!;\n }\n\n protected onScroll(\n event: NativeSyntheticEvent<{ contentOffset?: { x?: number; y?: number }; timestamp?: number }>,\n ): void {\n const contentOffset = event.nativeEvent?.contentOffset;\n const along = (this.horizontal() ? contentOffset?.x : contentOffset?.y) ?? 0;\n const content = along - this.headerHeight();\n\n // The first *visible* row, not the first rendered one. The overscan is applied where the\n // window is built, so that both edges can be measured from the same place.\n // Not clamped to the items: an input set in the same task as this event has not reached the\n // list yet, and the window clamps when it renders.\n this.trackSpeed(content, event.nativeEvent?.timestamp);\n const visible = this.indexAt(content);\n if (visible !== this.visible()) this.moveTo(visible);\n this.lastOffset = content;\n this.anchorAt(visible, content);\n this.sticky.scrolled(content, along);\n this.checkEnd(along);\n this.announceViewable(content);\n }\n\n /**\n * Points the window reaches past the viewport for the scroll's speed, positive toward the end,\n * in steps of a quarter viewport: written only when it moves a step, so a fling costs a pass\n * for it every few frames rather than on every scroll event.\n */\n private readonly ahead = signal(0);\n /** The speed's lead before rounding to a step, eased from one event to the next. */\n private eased = 0;\n /** The offset of the last scroll event, and when it arrived. */\n private lastScroll = { offset: 0, at: -Infinity };\n /** Lets go of the reach once scroll events stop, which is all a scroll that stops sends. */\n private speedTimer: ReturnType<typeof setTimeout> | undefined;\n\n /**\n * Follow the scroll's speed, from each scroll event's offset and the time native sent it, in\n * milliseconds, which iOS and Android both give. Not the time it reached JavaScript: a thread\n * that fell behind gets a fling's events in a burst, which would read as no time at all between\n * them. Where native gives no time, as on the web, the time it arrived.\n */\n private trackSpeed(offset: number, sent: number | undefined): void {\n const ms = this.velocityLead();\n const now = typeof sent === 'number' && Number.isFinite(sent) ? sent : performance.now();\n const elapsed = now - this.lastScroll.at;\n const moved = offset - this.lastScroll.offset;\n this.lastScroll = { offset, at: now };\n const viewport = this.viewport();\n // A pause, or the first event of a scroll, starts the speed over.\n if (!ms || !viewport || elapsed <= 0 || elapsed > PAUSE_MS) {\n this.eased = 0;\n } else {\n const reach = 3 * viewport;\n const clamp = (value: number) => Math.max(-reach, Math.min(reach, value));\n // Halfway to the new speed, so one late event does not throw the window around.\n this.eased = clamp((this.eased + clamp((moved / elapsed) * ms)) / 2);\n }\n const step = viewport / 4;\n const ahead = step ? Math.round(this.eased / step) * step : 0;\n this.ahead.set(ahead);\n clearTimeout(this.speedTimer);\n if (ahead) this.speedTimer = setTimeout(() => this.stopSpeed(), PAUSE_MS);\n }\n\n /** Start the speed over: a pause, or a jump, which is no fling. */\n private stopSpeed(): void {\n clearTimeout(this.speedTimer);\n this.lastScroll = { offset: 0, at: -Infinity };\n this.eased = 0;\n this.ahead.set(0);\n }\n\n /** The most viewports rendered ahead of the scroll direction and behind it. */\n private fillCaps(): { ahead: number; behind: number } {\n const extra = Math.max(0, Math.floor(this.windowSize()) - 1);\n const behind = Math.floor(extra / 3);\n return { ahead: extra - behind, behind };\n }\n\n /** Move the window to a new visible row. */\n private moveTo(visible: number): void {\n this.turn(Math.sign(visible - this.visible()));\n this.visible.set(visible);\n }\n\n /**\n * Start the fill over before a scroll the list is told to make lands past the rendered rows, so\n * it renders one viewport there, not the whole filled window, in a single pass. A scroll the\n * user makes keeps it: one past the rendered rows is a fling outrunning them, which is what the\n * fill is for.\n */\n private jumpTo(index: number): void {\n const span = this.span();\n if (span && (index < span.first || index >= span.last)) this.fill.set({ before: 0, after: 0 });\n // Nor is the scroll that reports it a fling: its speed starts over from where it lands.\n this.stopSpeed();\n }\n\n /**\n * Follow a change of scroll direction: the rows filled behind are now ahead, and those ahead are\n * kept only up to what is kept behind.\n */\n private turn(direction: number): void {\n if (!direction || direction === this.direction()) return;\n this.direction.set(direction);\n this.fill.set(this.reach());\n }\n\n /** The side the window grows on next, ahead of the scroll first, or null once both are full. */\n private nextFill(reach: { before: number; after: number }): 'before' | 'after' | null {\n const { ahead, behind } = this.fillCaps();\n const [front, back] =\n this.direction() > 0 ? (['after', 'before'] as const) : (['before', 'after'] as const);\n return reach[front] < ahead ? front : reach[back] < behind ? back : null;\n }\n\n /**\n * Grow the window by a viewport once the JS thread has been free for a batch period, ahead of\n * the scroll first. Every window change restarts the wait, so a fling is never slowed by it.\n */\n private scheduleFill(): void {\n clearTimeout(this.fillTimer);\n const reach = this.reach();\n // Keep a cut made by a lower windowSize, so raising it again fills a batch at a time.\n const fill = untracked(this.fill);\n if (fill.before !== reach.before || fill.after !== reach.after) this.fill.set(reach);\n if (!this.span() || this.viewport() <= 0) return;\n const side = this.nextFill(reach);\n if (!side) return;\n this.fillTimer = setTimeout(\n () => this.fill.set({ ...reach, [side]: reach[side] + 1 }),\n FILL_BATCH_MS,\n );\n }\n\n protected onLayout(\n event: NativeSyntheticEvent<{ layout?: { width?: number; height?: number } }>,\n ): void {\n const layout = event.nativeEvent?.layout;\n this.viewport.set((this.horizontal() ? layout?.width : layout?.height) ?? 0);\n this.viewportMeasured = true;\n this.zeroSize?.laidOut(this.viewport(), this.items().length > 0);\n this.checkEnd(this.headerHeight() + this.lastOffset);\n this.announceViewable(this.lastOffset);\n }\n\n /** The header's extent along the axis, which every row sits after. */\n protected onHeaderLayout(\n event: NativeSyntheticEvent<{ layout?: { width?: number; height?: number } }>,\n ): void {\n const layout = event.nativeEvent?.layout;\n const height = (this.horizontal() ? layout?.width : layout?.height) ?? 0;\n if (height === this.headerHeight()) return;\n this.headerHeight.set(height);\n this.holdPastHeader();\n }\n\n /**\n * The header grew or shrank - a typing indicator in a chat's, a banner in a feed's - and every\n * row moved with it. Held like an insert when the caller asked for that and the viewport is\n * past the header, among the rows; at the start the user is looking at the header, and it is\n * left to push the rows along. Made at once rather than after a render, because a layout arrives\n * outside change detection and nothing else may be about to render.\n */\n private holdPastHeader(): void {\n const hold = this.maintainVisibleContentPosition();\n if (!hold || this.lastOffset <= (hold.autoscrollToTopThreshold ?? 0)) return;\n this.scrollToOffset({ offset: this.headerHeight() + this.lastOffset, animated: false });\n }\n\n protected onContentSize(event: NativeSyntheticEvent<{ width?: number; height?: number }>): void {\n const size = event.nativeEvent;\n this.contentSize = (this.horizontal() ? size?.width : size?.height) ?? 0;\n this.contentSizeFor = this.headerHeight() + this.extent();\n this.checkEnd(this.headerHeight() + this.lastOffset);\n }\n\n /** The scroll view's content along the axis, header and all. */\n private contentExtent(): number {\n // Native's size is for the rows it last laid out; until it reports for these, their own extent.\n const own = this.headerHeight() + this.extent();\n return this.contentSizeFor === own ? this.contentSize : own;\n }\n\n /** The user took the scroll over: native's own events move the rows from here. */\n protected onDragBegin(): void {\n this.sticky.dragged();\n }\n\n /** A scroll came to rest: see `StickyRows.rested`. */\n protected onScrollEnd(): void {\n this.sticky.rested();\n }\n\n /**\n * How far toward `offset` the content lets native scroll. Android stops a scroll at its end and\n * says nothing of it; iOS goes past, and its scroll end event says where it came to rest.\n */\n private reachable(offset: number): number {\n const viewport = this.viewport();\n const total = this.contentExtent();\n // Past the content by the inset after it, where the scroll view lets it go.\n const inset = this.contentInset();\n const after = (this.horizontal() ? inset?.right : inset?.bottom) ?? 0;\n const end = viewport > 0 ? Math.max(0, total - viewport + after) : total;\n return Math.min(Math.max(0, offset), end);\n }\n\n private checkEnd(y: number): void {\n const count = this.items().length;\n const viewport = this.viewport();\n if (!count || !viewport) return;\n const distanceFromEnd = this.contentExtent() - (y + viewport);\n // Away from the end again re-arms it, as React Native does, so a load that failed is retried\n // the next time the user comes back down.\n if (distanceFromEnd > this.endReachedThreshold() * viewport) {\n this.endReachedFor = -1;\n return;\n }\n if (this.endReachedFor === count) return;\n this.endReachedFor = count;\n this.endReached.emit({ distanceFromEnd });\n }\n}\n\n/** Whether a cached slot style already has every one of these props. */\nfunction holds(style: Record<string, unknown>, props: Record<string, unknown>): boolean {\n return Object.entries(props).every(([prop, value]) => style[prop] === value);\n}\n\n/**\n * Put on each row's view: `<view [virtualListRow]=\"row\">`. Applies the row's style, and reports\n * the row's layout to the list, which is how a list of rows that size themselves learns how tall\n * each one is.\n */\n@Directive({\n selector: '[virtualListRow]',\n host: {\n '[style]': 'row().style',\n // A parked row is not read out: see `PARKED`.\n '[attr.aria-hidden]': 'row().parked ? true : null',\n '(layout)': 'onLayout($event)',\n },\n})\nexport class VirtualListRow<T = unknown> {\n readonly row = input.required<VirtualRow<T>>({ alias: 'virtualListRow' });\n private readonly list = inject<VirtualList<T>>(VirtualList);\n /** The last layout native reported for this view, whichever item it held. */\n private layout: { width?: number; height?: number } | undefined;\n\n constructor() {\n effect(() => {\n const row = this.row();\n if (this.layout) untracked(() => this.list.adoptRow(row, this.layout!));\n });\n }\n\n protected onLayout(\n event: NativeSyntheticEvent<{ layout?: { width?: number; height?: number } }>,\n ): void {\n this.layout = event.nativeEvent?.layout ?? this.layout;\n this.list.measureRow(this.row(), event.nativeEvent?.layout);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"virtual-list.js","sourceRoot":"","sources":["../src/virtual-list.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,UAAU,EACV,SAAS,EACT,UAAU,EACV,WAAW,EACX,gBAAgB,EAChB,gBAAgB,EAChB,QAAQ,EACR,YAAY,EACZ,MAAM,EACN,MAAM,EACN,KAAK,EACL,YAAY,EACZ,MAAM,EACN,MAAM,EACN,SAAS,EACT,SAAS,GACV,MAAM,eAAe,CAAC;AACvB,OAAO,EAIL,cAAc,GACf,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EA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,GAAG,EAAE,IAAI,CAAC,MAAO,CAAC,CAAC,CAAC;QAC1E,CAAC,CAAC,CAAC;IACL,CAAC;IAES,QAAQ,CAChB,KAA6E;QAE7E,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,WAAW,EAAE,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC;QACvD,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,EAAE,KAAK,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;IAC9D,CAAC;uGAlBU,cAAc;2FAAd,cAAc;;2FAAd,cAAc;kBAT1B,SAAS;mBAAC;oBACT,QAAQ,EAAE,kBAAkB;oBAC5B,IAAI,EAAE;wBACJ,SAAS,EAAE,aAAa;wBACxB,8CAA8C;wBAC9C,oBAAoB,EAAE,4BAA4B;wBAClD,UAAU,EAAE,kBAAkB;qBAC/B;iBACF","sourcesContent":["import {\n Component,\n DestroyRef,\n Directive,\n ElementRef,\n TemplateRef,\n afterEveryRender,\n booleanAttribute,\n computed,\n contentChild,\n effect,\n inject,\n input,\n linkedSignal,\n output,\n signal,\n untracked,\n viewChild,\n} from '@angular/core';\nimport {\n type HostNode,\n type NativeSyntheticEvent,\n type StaticTransform,\n nativePlatform,\n} from '@ng-native/fabric';\nimport { HeightIndex } from './height-index.ts';\nimport { type KeyboardShouldPersistTaps, dismissKeyboardOnTap } from './keyboard-taps.ts';\nimport { RefreshControl } from './refresh-control.ts';\nimport { StickyRows } from './sticky-rows.ts';\nimport { TemplateSlot } from './template-slot.ts';\nimport { ZeroSizeWarning, checksZeroSize, written } from './zero-size-warning.ts';\nimport { View } from './view.ts';\nimport { VIRTUAL_LIST_LAYOUT } from './virtual-list-layout.ts';\nimport { VIRTUAL_LIST_STICKY } from './virtual-list-sticky.ts';\nimport { ScrollViewProps } from './scroll-view-props.ts';\nimport { numberOr } from './transforms.ts';\n\n/** One rendered row: the item, its index, and a stable style object for its slot. */\nexport interface VirtualRow<T> {\n readonly index: number;\n /**\n * A key that a row keeps while its item stays in the window, and that passes to a row arriving\n * once it has left. `track row.slot` recycles rows: the view of a row scrolling out is reused for\n * the one scrolling in, with only its bindings updated, rather than one destroyed and one created\n * each time. A slot follows its item, not its position, so an insert above the window moves no\n * row to another item.\n */\n readonly slot: number;\n /**\n * The item's identity, from `keyExtractor`, or the item itself without one. `track row.key`\n * gives each item a view of its own for as long as it is in the window and never recycles one,\n * which is what a row holding state of its own, or animating, needs.\n */\n readonly key: unknown;\n readonly item: T;\n readonly style: Record<string, unknown>;\n /**\n * A slot kept rendered but hidden, still bound to the last item it showed, so the next row of\n * its type to arrive reuses its views instead of building them. Always last in the window.\n */\n readonly parked?: true;\n}\n\n/**\n * Space around the rows, inside the scrolling content: one number for every side, or a side each,\n * as FlatList's `contentContainerStyle` padding.\n */\nexport type VirtualListPadding =\n | number\n | {\n readonly top?: number;\n readonly right?: number;\n readonly bottom?: number;\n readonly left?: number;\n };\n\n/** The padding on each side, in points. */\ninterface Edges {\n readonly top: number;\n readonly right: number;\n readonly bottom: number;\n readonly left: number;\n}\n\n/** A row height: one for every row, or one per item. */\nexport type VirtualItemHeight<T> = number | ((item: T, index: number) => number);\n\n/**\n * Keep what is on screen where it is when rows are added or removed before it, as\n * `ScrollView`'s `maintainVisibleContentPosition` does in React Native.\n */\nexport interface VirtualListVisiblePosition {\n /** Rows before this index are never what the position is held by. Defaults to 0. */\n readonly minIndexForVisible?: number;\n /**\n * Within this many points of the start, show what arrived instead of holding position: a feed\n * at its top scrolls to the new posts, a chat at its newest message follows the next one.\n */\n readonly autoscrollToTopThreshold?: number;\n}\n\n/** What a separator template is given: the rows either side of it, as FlatList's `leadingItem`. */\nexport interface VirtualListSeparatorContext<T> {\n readonly $implicit: T;\n readonly leadingItem: T;\n readonly trailingItem: T;\n readonly leadingIndex: number;\n}\n\n/**\n * Marks the template drawn between two rows: `<ng-template virtualListSeparator let-leading>`.\n * FlatList's `ItemSeparatorComponent`.\n */\n@Directive({ selector: 'ng-template[virtualListSeparator]' })\nexport class VirtualListSeparator<T = unknown> {\n readonly template = inject<TemplateRef<VirtualListSeparatorContext<T>>>(TemplateRef);\n\n static ngTemplateContextGuard<T>(\n _directive: VirtualListSeparator<T>,\n context: unknown,\n ): context is VirtualListSeparatorContext<T> {\n return true;\n }\n}\n\n/** One separator the list is drawing: its slot, and what its template is told. */\ninterface Gap<T> {\n readonly index: number;\n readonly style: Record<string, unknown>;\n readonly context: VirtualListSeparatorContext<T>;\n}\n\n/**\n * A parked slot: out of the flow, out of sight and out of reach, with its view kept to be used\n * again. Not `display: none`, which is an element with no view. A screen reader passes over a\n * view with no opacity, and `VirtualListRow` says so outright where a row uses it. Moved off the\n * list as well, since `pointer-events: none` is CSS's: something inside a row with a\n * `pointer-events` of its own would still take a touch where the row was left.\n */\nconst PARKED: Record<string, unknown> = Object.freeze({\n position: 'absolute',\n opacity: 0,\n pointerEvents: 'none',\n transform: 'translateX(-100000px)',\n});\n\n/** How many hidden slots of each row type are kept ready for reuse. */\nconst PARK_LIMIT = 6;\n\n/** The style of a row that sizes itself and needs nothing else: in flow, where it falls. */\nconst IN_FLOW: Record<string, unknown> = Object.freeze({});\n\n/** Points of drift below which a held position is left alone, as UIKit rounds to half-points. */\nconst HOLD_TOLERANCE = 0.5;\n/**\n * How long the JS thread has to be free of window changes before the window grows another\n * viewport: FlatList's `updateCellsBatchingPeriod`.\n */\nconst FILL_BATCH_MS = 50;\n/** How long without a scroll event counts as the scroll having stopped. */\nconst PAUSE_MS = 200;\n\n/** The row a held position is held by: its key, and how far into it the viewport starts. */\ninterface Anchor<T> {\n readonly key: unknown;\n readonly within: number;\n /** The items the anchor was taken against, to look for a successor in if its row goes. */\n readonly items: readonly T[];\n readonly index: number;\n}\n\n/**\n * Items in columns: the line each item is on, and the first item of each line. A sticky row takes\n * a line to itself, so lines are not every `columns` items once there is one.\n */\ninterface Lines {\n readonly of: Int32Array;\n readonly starts: readonly number[];\n}\n\n/** What the window is built from: the visible row and the edges of what is rendered. */\ninterface Span {\n readonly first: number;\n readonly last: number;\n}\n\n/**\n * Windowed list: a native scroll view whose content is sized to the full list, with only the\n * visible slice rendered. Commits as `RCTScrollView`.\n *\n * RN's FlatList, SectionList and VirtualizedList are a large React component tree, and none of\n * it is reachable. This is the small equivalent. Angular's own `@for` does the rendering, so\n * tracking, reuse and destruction all behave normally, and the loop stays in the caller's\n * template:\n *\n * ```html\n * <virtual-list #list [items]=\"rows()\" [itemHeight]=\"44\" (endReached)=\"loadMore()\">\n * <text listHeader>Header</text>\n * @for (row of list.window(); track row.slot) {\n * <view [virtualListRow]=\"row\"><text>{{ row.item.label }}</text></view>\n * }\n * <text listFooter>Footer</text>\n * </virtual-list>\n * ```\n *\n * With `itemHeight`, every row's size is known up front and each is absolutely positioned at its\n * offset. Without it, rows size themselves, as a feed's posts and a chat's messages do: the window\n * is laid out in normal flow after a spacer standing in for the rows above it, so native places\n * every row correctly in the frame it first appears, and each row's layout tells the list its\n * height for sizing what is not rendered. Until a row has been measured it counts as\n * `estimatedItemHeight`. Measurements are kept by `keyExtractor`, so they follow their item across\n * inserts, removals and moves. `virtualListRow` on each row's view applies its style and reports\n * its layout; `[style]=\"row.style\"` still works for fixed heights, which need no measuring.\n *\n * Content marked `listHeader` and `listFooter` renders above and below the rows in normal flow,\n * as FlatList's header and footer components do. A `<refresh-control>` projects like any child.\n *\n * `<ng-template virtualListSeparator let-leading let-trailing=\"trailingItem\">` is drawn between\n * each pair of rows and not after the last, as FlatList's `ItemSeparatorComponent` is. It is drawn\n * inside the leading row's slot, at its trailing edge, so `itemHeight` includes it the way\n * `getItemLayout`'s `length` includes it in RN; a measured row has it drawn over its trailing edge\n * once its height is known. The slot it sits in lets touches through to the row underneath.\n *\n * `horizontal` swaps the axis: rows are placed by `left` and sized by `width`, and the offset is\n * read from `contentOffset.x`. `inverted` is a scale of -1 on the list and on each row, which is\n * how FlatList does it too - the list scrolls from the bottom and each row is flipped back the\n * right way up. The first item is the one at the bottom, so a chat passes its messages newest\n * first.\n *\n * `stickyIndices` pins a row to the leading edge while the rows under it scroll past, which is\n * FlatList's `stickyHeaderIndices` counted without the header. `stickyHeader` pins the\n * `listHeader` content the same way, FlatList's index 0 when it has a `ListHeaderComponent`, and\n * the first sticky row pushes it off as RN's sticky headers push each other. Neither is native:\n * RN's `ScrollView.js` translates a sticky child against the scroll offset in JavaScript, and a\n * row here follows the offset the same way while it is the current one - by its `top` when\n * absolutely positioned, by a transform when in flow. `[virtualListStickyLevel]` on the list pins\n * rows at more than one level, each under the rows of the levels further out.\n *\n * What is on screen stays on screen when a measured row above it turns out taller or shorter than\n * its estimate: the offset is corrected by the difference. `maintainVisibleContentPosition` does\n * the same for rows inserted or removed above it, which a feed receiving new posts and a chat\n * loading older messages above the ones being read both need.\n *\n * ponytail: viewability is `itemVisiblePercentThreshold` only: `minimumViewTime` and\n * `waitForInteraction` are timing policy on top of the same measurement, and nothing has needed\n * them. A separator is not told `highlighted`, which RN drives from the row's press state. A\n * sticky header follows the scroll a commit behind native, where RN's is on the native driver. A\n * held position is restored by a `scrollTo` after the commit, not in the mount as native\n * `maintainVisibleContentPosition` is, so a correction made mid-fling lands where the last scroll\n * event said the list was.\n */\n@Component({\n selector: 'virtual-list',\n exportAs: 'virtualList',\n imports: [TemplateSlot, View],\n // One content view holds the header, the rows and the footer, as ScrollView.js's content\n // container does: Android's ScrollView takes one child and throws on a second. It is never\n // collapsed, or Fabric would flatten it away and hand the scroll view all three again.\n // See ScrollView: the canvas carries only a height, so Fabric would flatten it away and drags\n // over the gaps between rows would not scroll. Separators come after the rows so they draw over\n // the slot they share. The spacer is there only when rows are in flow.\n // A refresh control comes first, as the scroll view's own child; see ScrollView.\n template: `\n <ng-content select=\"refresh-control\" />\n <view [style]=\"content()\" collapsable=\"false\">\n <view #header [style]=\"headerStyle()\" (layout)=\"onHeaderLayout($event)\"\n ><ng-content select=\"[listHeader]\"\n /></view>\n <view #rows [style]=\"canvas()\" collapsable=\"false\">\n @if (measuring()) {\n <view [style]=\"spacer()\"></view>\n }\n <ng-content />\n @if (separator(); as separator) {\n @for (gap of gaps(); track gap.index) {\n <view [style]=\"gap.style\"\n ><ng-container\n [templateSlot]=\"separator.template\"\n [templateSlotContext]=\"gap.context\"\n /></view>\n }\n }\n </view>\n <view [style]=\"footerStyle()\"><ng-content select=\"[listFooter]\" /></view>\n </view>\n `,\n host: {\n // ScrollView.js's `baseHorizontal`: a column would stack the header, canvas and footer, and\n // the canvas, holding only absolutely positioned rows, would have no height to give them. A\n // top-level prop, as on <scroll-view>, so the caller's own [style] still applies over it.\n '[flexDirection]': \"horizontal() ? 'row' : 'column'\",\n '[horizontal]': 'horizontal()',\n '[nestedScrollEnabled]': 'nestedScroll()',\n // A prop rather than `[style.transform]`: Angular stringifies a style binding, and a\n // transform is a list of objects. The engine flattens style into props anyway, so this is\n // where it would have ended up.\n '[transform]': 'flip()',\n '[scrollEventThrottle]': 'scrollEventThrottle()',\n '(scrollBeginDrag)': 'onDragBegin()',\n '(momentumScrollEnd)': 'onScrollEnd()',\n '(layout)': 'onLayout($event)',\n '(contentSizeChange)': 'onContentSize($event)',\n },\n})\nexport class VirtualList<T> extends ScrollViewProps {\n readonly items = input.required<readonly T[]>();\n /**\n * A fixed height, or a function for variable ones, when every row's size is known up front. The\n * function form builds a cumulative offset table and binary-searches it, which is what section\n * lists need: a header row and an item row are different heights, so uniform maths cannot place\n * them. Leave it unset for rows that size themselves.\n */\n readonly itemHeight = input<VirtualItemHeight<T>>();\n /**\n * What a row that sizes itself counts as until it has been measured. The closer it is, the more\n * honest the scroll bar is and the less a jump to an unmeasured row has to correct.\n */\n readonly estimatedItemHeight = input<VirtualItemHeight<T>>(50);\n /**\n * Space around the rows, inside the scrolling content. The leading side comes before the first\n * row and the trailing side after the last; the sides across the axis inset every row. The\n * header and footer sit outside it, as FlatList's do outside `contentContainerStyle`.\n */\n readonly contentPadding = input<VirtualListPadding>(0);\n /** Space between one row and the next, along the axis: not before the first or after the last. */\n readonly rowGap = input(0, { transform: numberOr(0) });\n /**\n * An item's identity, as FlatList's `keyExtractor`: what a measured height, a slot and a held\n * position follow across an insert. Without it an item is its own key, which is enough for items\n * that are replaced, not copied, when they change.\n */\n readonly keyExtractor = input<(item: T, index: number) => unknown>();\n /**\n * What kind of row an item is, when rows of different kinds share the list: a text post and a\n * photo post, a message and a date divider. A slot is only ever recycled into a row of the same\n * type, so its views are reused rather than torn down for another kind's, as UIKit's reuse\n * identifiers and FlashList's `getItemType` do.\n */\n readonly itemType = input<(item: T, index: number) => unknown>();\n /** Keep what is on screen still when rows are inserted or removed before it. */\n readonly maintainVisibleContentPosition = input<VirtualListVisiblePosition>();\n /** Rows rendered beyond each edge of the viewport, to cover fling gaps. */\n readonly overscan = input(4, { transform: numberOr(4) });\n /**\n * How many viewports of rows the list fills, as FlatList's `windowSize`: the one on screen and\n * up to `windowSize - 1` more around it. While the JS thread is\n * idle the window grows a viewport at a time, ahead of the scroll direction first, so a fling\n * lands on rows already drawn. About two-thirds of the extra viewports go ahead of the scroll and\n * the rest behind. `1` fills no extra viewports, though a fast scroll still renders ahead of\n * itself unless `velocityLead` is `0`.\n */\n readonly windowSize = input(5, { transform: numberOr(5) });\n /**\n * How far past the viewport a scroll renders in the direction it is going, in milliseconds of\n * its speed, up to three viewports: the rows the list will reach by the time a window change has\n * been through JavaScript and back to native. `0` renders only the visible rows, the overscan\n * and the fill.\n */\n readonly velocityLead = input(500, { transform: numberOr(500) });\n /** How close to the end, in viewport heights, `(endReached)` fires. RN's default is 2. */\n readonly endReachedThreshold = input(2, { transform: numberOr(2) });\n\n /** Lay the rows out along x instead of y, and scroll that way. */\n readonly horizontal = input(false, { transform: booleanAttribute });\n /** Start at the end and scroll backwards, with every row flipped back the right way up. */\n readonly inverted = input(false, { transform: booleanAttribute });\n /**\n * Rows that pin to the leading edge while the ones under them scroll past. Ascending; a row is\n * pinned from the moment it would leave until the next sticky row pushes it off.\n */\n readonly stickyIndices = input<readonly number[]>([]);\n /** Pin the `listHeader` content to the leading edge until the first sticky row pushes it off. */\n readonly stickyHeader = input(false, { transform: booleanAttribute });\n /** What a tap in the list does while a text input has the keyboard up. See `ScrollView`. */\n readonly keyboardShouldPersistTaps = input<KeyboardShouldPersistTaps>('never');\n /** How much of a row must be on screen to count as viewable. RN's default is 0, meaning any. */\n readonly itemVisiblePercentThreshold = input(0, { transform: numberOr(0) });\n\n /**\n * The scroll position is within `endReachedThreshold` of the end: once per item count, and again\n * after the list has scrolled away from the end and come back.\n */\n readonly endReached = output<{ distanceFromEnd: number }>();\n\n /** Which rows are on screen, and what changed since last time. */\n readonly viewableItemsChanged = output<{\n viewable: readonly VirtualRow<T>[];\n entered: readonly number[];\n left: readonly number[];\n }>();\n\n private readonly viewport = signal(0);\n private readonly headerHeight = signal(0);\n /** What native reported the content measures along the axis, once it has. */\n private contentSize = 0;\n /** The rows' own extent when native reported that, so a report for other rows is not used. */\n private contentSizeFor = -1;\n /** The item count `endReached` last fired for, cleared once the list is away from the end. */\n private endReachedFor = -1;\n\n /** Slot styles are cached so a scroll does not hand Fabric new prop objects for stable rows. */\n private readonly slots = new Map<number, Record<string, unknown>>();\n /** A separator's slot style, per row slot style, so it is as stable as the row's own. */\n private readonly gapStyles = new WeakMap<object, Record<string, unknown>>();\n /** The same for a measured row's separator, by key, while its place and size stay put. */\n private readonly measuredGaps = new Map<unknown, Record<string, unknown>>();\n\n protected readonly separator = contentChild<VirtualListSeparator<T>>(VirtualListSeparator);\n private readonly refreshControl = contentChild(RefreshControl);\n\n /** See ScrollView: inside Android's swipe layout the list must see a drag first. */\n protected readonly nestedScroll = computed(() =>\n nativePlatform() === 'android' && this.refreshControl() ? true : undefined,\n );\n\n /** Viewports filled past the overscan, before and after the visible rows in index order. */\n private readonly fill = signal({ before: 0, after: 0 });\n /** The way the visible row last moved: 1 toward the end of the list, -1 toward the start. */\n private readonly direction = signal(1);\n /** The fill, cut to what `windowSize` allows ahead of the scroll and behind it. */\n private readonly reach = computed(() => {\n const { before, after } = this.fill();\n const { ahead, behind } = this.fillCaps();\n const forward = this.direction() > 0;\n return {\n before: Math.min(before, forward ? behind : ahead),\n after: Math.min(after, forward ? ahead : behind),\n };\n });\n private fillTimer: ReturnType<typeof setTimeout> | undefined;\n private readonly canvasView = viewChild.required('rows', { read: ElementRef });\n private readonly headerView = viewChild.required('header', { read: ElementRef });\n\n /** The sticky rows and header: see `StickyRows`. */\n private readonly sticky = new StickyRows(this.engine, this.node, {\n indices: this.stickyIndices,\n levels: inject(VIRTUAL_LIST_STICKY, { self: true, optional: true }),\n items: this.items,\n header: this.stickyHeader,\n headerHeight: this.headerHeight,\n horizontal: () => this.horizontal(),\n measuring: () => this.measuring(),\n topOf: (index) => this.topOf(index),\n heightOf: (index) => this.heightOf(index),\n slotStyle: (index) => this.slotStyle(index),\n flowSpacing: () => this.flowSpacing(),\n flip: () => this.flip(),\n flipText: () => this.flipText(),\n });\n\n /** Rows size themselves and are laid out in flow, rather than placed at a known offset. */\n readonly measuring = computed(() => this.itemHeight() === undefined);\n\n /** The padding on each side. */\n private readonly edges = computed<Edges>(() => {\n const padding = this.contentPadding();\n if (typeof padding === 'number') {\n return { top: padding, right: padding, bottom: padding, left: padding };\n }\n const { top = 0, right = 0, bottom = 0, left = 0 } = padding ?? {};\n return { top, right, bottom, left };\n });\n\n /** The padding before the first row, along the axis. */\n private readonly lead = computed(() =>\n this.horizontal() ? this.edges().left : this.edges().top,\n );\n\n /** The rows' insets across the axis, as the props that place an absolutely positioned row. */\n private readonly across = computed((): Record<string, number> => {\n const { top, right, bottom, left } = this.edges();\n return this.horizontal() ? { top, bottom } : { left, right };\n });\n\n /** How items are laid out across the width, when a directive on the list says: see the token. */\n private readonly columnLayout = inject(VIRTUAL_LIST_LAYOUT, { self: true, optional: true });\n\n /**\n * Items to a line. Only for a vertical list whose rows have known heights: a line's height\n * would otherwise wait on every item in it measuring, and FlatList's `numColumns` is vertical\n * only too. The directive says so in development.\n */\n private readonly columns = computed(() => {\n const columns = this.columnLayout?.columns() ?? 1;\n return this.measuring() || this.horizontal() ? 1 : columns;\n });\n\n /** Which line each item is on, when there is more than one to a line. */\n private readonly lines = computed<Lines | null>(() => {\n const columns = this.columns();\n if (columns === 1) return null;\n const count = this.items().length;\n const sticky = this.sticky.rows();\n const of = new Int32Array(count);\n const starts: number[] = [];\n let column = columns;\n for (let i = 0; i < count; i++) {\n const alone = sticky.has(i);\n if (alone || column === columns) {\n starts.push(i);\n column = 0;\n }\n of[i] = starts.length - 1;\n column = alone ? columns : column + 1;\n }\n return { of, starts };\n });\n\n /** The props across each column, built once per change of columns, gap or padding. */\n private readonly columnAcross = computed(() => {\n const layout = this.columnLayout;\n if (!layout || !this.lines()) return [];\n const { left, right } = this.edges();\n return Array.from({ length: this.columns() }, (_, column) =>\n layout.across(column, left, right),\n );\n });\n\n /** An item's insets across the axis: its column's, or the whole width's. */\n private acrossOf(index: number): Record<string, unknown> {\n const lines = this.lines();\n if (!lines || this.sticky.rows().has(index)) return this.across();\n return this.columnAcross()[index - lines.starts[lines.of[index]!]!]!;\n }\n\n /** The line an item is on: the item itself, when each has a line to itself. */\n private lineOf(index: number): number {\n const lines = this.lines();\n // An index past the items, a sticky one given for rows not there yet, is past the last line.\n return lines ? (lines.of[index] ?? lines.starts.length) : index;\n }\n\n /** Whether a row is on the list's last line, which no separator comes after. */\n private onLastLine(index: number): boolean {\n const lines = this.lines();\n return lines ? lines.of[index] === lines.starts.length - 1 : index >= this.items().length - 1;\n }\n\n /** The first item on a line, or the item count for a line past the last. */\n private lineStart(line: number): number {\n const lines = this.lines();\n if (!lines) return Math.min(line, this.items().length);\n return line < lines.starts.length ? lines.starts[line]! : this.items().length;\n }\n\n /** Heights native has reported, by key. */\n private readonly measured = new Map<unknown, number>();\n /** Bumped when a measurement changes, which is what re-sizes the list. */\n private readonly measuredVersion = signal(0);\n\n /** Each item's key, or null when items are their own. */\n private readonly keys = computed<readonly unknown[] | null>(() => {\n const extract = this.keyExtractor();\n return extract ? this.items().map(extract) : null;\n });\n\n private keyAt(index: number): unknown {\n return this.keys()?.[index] ?? this.items()[index];\n }\n\n /**\n * Each row's size and where it starts, for variable heights; uniform rows need no index at all.\n * Built once per change of items. A measurement changes it in place and bumps\n * `measuredVersion`, which is what everything that reads it depends on, so a row laying out\n * costs a walk of the tree rather than a rebuild of every offset.\n */\n private readonly table = computed<HeightIndex | null>(() => {\n const height = this.itemHeight();\n const lines = this.lines();\n if (typeof height === 'number' && !lines) return null;\n\n // Each row's entry is its size and the gap after it, so where a row starts counts the gaps\n // before it without a second table.\n const gap = this.rowGap();\n const items = this.items();\n if (lines) {\n // An entry a line, as tall as the tallest item on it.\n const sizes = new Float64Array(lines.starts.length);\n for (let i = 0; i < items.length; i++) {\n const size = (typeof height === 'function' ? height(items[i]!, i) : height!) + gap;\n const line = lines.of[i]!;\n sizes[line] = Math.max(sizes[line]!, size);\n }\n return new HeightIndex(sizes);\n }\n const sizes = new Float64Array(items.length);\n if (typeof height === 'function') {\n for (let i = 0; i < items.length; i++) sizes[i] = height(items[i]!, i) + gap;\n return new HeightIndex(sizes);\n }\n const estimate = this.estimatedItemHeight();\n const keys = this.keys();\n for (let i = 0; i < items.length; i++) {\n const size =\n this.measured.get(keys ? keys[i] : items[i]) ??\n (typeof estimate === 'number' ? estimate : estimate(items[i]!, i));\n sizes[i] = size + gap;\n }\n return new HeightIndex(sizes);\n });\n\n /** Where each key is, so a measurement finds its row without a search. */\n private readonly indexOfKey = computed(() => {\n if (!this.measuring()) return null;\n const map = new Map<unknown, number>();\n (this.keys() ?? this.items()).forEach((key, index) => map.set(key, index));\n return map;\n });\n\n /** The index, with a dependency on its measurements for whoever is reading it. */\n private layout(): HeightIndex | null {\n const table = this.table();\n if (table) this.measuredVersion();\n return table;\n }\n\n /**\n * The list's own total extent along its axis: the padding at both ends, the rows, and a gap\n * between each two of them.\n */\n private readonly extent = computed(() => {\n const table = this.layout();\n const count = this.items().length;\n const rows = table ? table.total : count * this.stride();\n const { top, right, bottom, left } = this.edges();\n const padding = this.horizontal() ? left + right : top + bottom;\n return padding + (count ? rows - this.rowGap() : 0);\n });\n\n /** A fixed-height row and the gap after it. */\n private stride(): number {\n return (this.itemHeight() as number) + this.rowGap();\n }\n\n /** ScrollView.js's `contentContainerHorizontal`: the header, rows and footer side by side. */\n protected readonly content = computed(() =>\n this.horizontal() ? { flexDirection: 'row' } : undefined,\n );\n\n protected readonly canvas = computed(() =>\n this.horizontal() ? { width: this.extent(), flexDirection: 'row' } : { height: this.extent() },\n );\n\n /**\n * `scaleY: -1` on the list, and the same on every row.\n *\n * The list ends up scrolled from the far end with its rows in reverse, and the second flip puts\n * each row's own content back the right way up. It is what `FlatList` does, and it is why an\n * inverted list needs no reversed maths: the first item is at offset 0, which is the bottom.\n */\n protected readonly flip = computed<StaticTransform[] | undefined>(() => {\n if (!this.inverted()) return undefined;\n const scale: StaticTransform = this.horizontal() ? { scaleX: -1 } : { scaleY: -1 };\n return [scale];\n });\n\n /**\n * The flip as a style's transform: CSS text, which the engine turns into the list native reads.\n * A style binding validates its values as the DOM's, and warns on a list in development.\n */\n private readonly flipText = computed(() => {\n if (!this.inverted()) return undefined;\n return this.horizontal() ? 'scaleX(-1)' : 'scaleY(-1)';\n });\n\n /**\n * What places a row in flow: the gap after it and the padding across the axis, as margins, since\n * native lays the row out. Empty when there are none, so a plain list commits no margins.\n */\n private readonly flowSpacing = computed<Record<string, unknown>>(() => {\n const gap = this.rowGap();\n const { top, right, bottom, left } = this.edges();\n const spacing: Record<string, number> = this.horizontal()\n ? { marginRight: gap, marginTop: top, marginBottom: bottom }\n : { marginBottom: gap, marginLeft: left, marginRight: right };\n return Object.fromEntries(Object.entries(spacing).filter(([, value]) => value !== 0));\n });\n\n /** A row in flow, flipped back when the list is inverted. One object, so rows never re-clone. */\n private readonly flowStyle = computed(() => {\n const flip = this.flipText();\n const spacing = this.flowSpacing();\n if (!flip && Object.keys(spacing).length === 0) return IN_FLOW;\n return flip ? { ...spacing, transform: flip } : spacing;\n });\n\n /** Top of a row: the leading padding, and every row and gap before it. In columns, its line's. */\n private topOf(index: number): number {\n const table = this.layout();\n return this.lead() + (table ? table.topOf(this.lineOf(index)) : index * this.stride());\n }\n\n /** A row's own size, without the gap after it. In columns, its line's. */\n private heightOf(index: number): number {\n const table = this.layout();\n if (!table) return this.itemHeight() as number;\n return table.heightOf(this.lineOf(index)) - this.rowGap();\n }\n\n /** First row whose bottom, or the gap after it, is past `y`. In columns, the first on its line. */\n private indexAt(y: number): number {\n const table = this.layout();\n const along = y - this.lead();\n if (!table) return Math.max(0, Math.floor(along / this.stride()));\n const at = table.indexAt(along);\n return this.lines() ? this.lineStart(at) : at;\n }\n\n // --- holding position -------------------------------------------------------------------\n\n /** The row the viewport's leading edge is in, taken at each scroll. */\n private anchor: Anchor<T> | null = null;\n /** The last offset seen. A field rather than a signal: reading it renders nothing. */\n private lastOffset = 0;\n /**\n * A correction to make once the commit that needs it is on its way to native: an offset in the\n * rows' own space, after the header, or the very start of the list.\n */\n private pendingScroll: { offset: number; animated: boolean } | 'start' | null = null;\n\n /** What moves the rows: which items, and where each one is. */\n private readonly placement = computed(() => ({\n items: this.items(),\n table: this.table(),\n version: this.measuredVersion(),\n }));\n\n /**\n * The first *visible* row, not the first rendered one, and not the raw scroll offset. A fling\n * produces a scroll event per frame, and setting a signal on each one costs a change-detection\n * pass even when the visible rows are identical. Deriving the index in the handler means most\n * scroll events change nothing and cost nothing.\n *\n * Linked to the rows' placement, because that is when the row on screen can move without the\n * user scrolling: an insert above it, or a row above it measuring differently from its estimate.\n * The index follows the anchored row there, and the offset follows it too.\n */\n private readonly visible = linkedSignal<\n { items: readonly T[]; table: HeightIndex | null; version: number },\n number\n >({\n source: this.placement,\n computation: (placement) => this.reanchor(placement.items),\n });\n\n /** Take the anchor at a row, keeping the viewport where it is. */\n private anchorAt(at: number, offset: number): void {\n const items = this.items();\n if (!items.length) {\n this.anchor = null;\n return;\n }\n const index = Math.min(at, items.length - 1);\n this.anchor = { key: this.keyAt(index), within: offset - this.topOf(index), items, index };\n }\n\n /**\n * Where the row on screen went when the rows moved under it, and the offset that keeps it where\n * the user left it. An insert or a removal is only held when the caller asked for it; a row\n * above measuring differently always is, since nothing the user did moved anything.\n */\n private reanchor(items: readonly T[]): number {\n const anchor = this.anchor;\n // Empty for a moment, as a filter typed through leaves it: the offset is kept for what comes.\n if (!items.length) return 0;\n if (!anchor) return this.atOffset();\n\n const index = this.heldIndex(anchor, items);\n if (index === 'start') return this.showStart();\n if (index < 0) return this.atOffset();\n // No further than the content lets native scroll, past the footer and the inset after it:\n // Android stops a scroll there and iOS would show blank space past it, and the window must be\n // built for where it is. Not cut at the start, where an inset before the rows, or a bounce,\n // puts native above zero.\n const header = this.headerHeight();\n const want = this.topOf(index) + anchor.within;\n const held = Math.min(want, this.reachable(header + want) - header);\n if (Math.abs(held - this.lastOffset) > HOLD_TOLERANCE) {\n this.pendingScroll = { offset: held, animated: false };\n this.lastOffset = held;\n }\n // The window is built from the row the held offset lands in, which is not the anchored one\n // when that row came out shorter than the way into it: a new column count can move an item\n // off a line made tall by another item, onto a short one.\n // In a single column the anchored row is kept, so a row scrolled to stays held there.\n const top = this.lines() ? Math.max(0, Math.min(this.indexAt(held), items.length - 1)) : index;\n if (top === index) {\n this.anchor = { ...anchor, items, index };\n return index;\n }\n this.anchorAt(top, held);\n return top;\n }\n\n /**\n * The row under the offset native is still at, in rows that have just replaced the old ones, as\n * a filter replaces them. Native keeps its offset whatever the items became, so the window is\n * worked out from that, not from the old row's index, which in the new rows sits somewhere else.\n * When the new rows end before that offset, the list is scrolled back to their end: native\n * would otherwise stay scrolled past it, showing nothing until the next drag.\n */\n private atOffset(): number {\n const end = Math.max(0, this.extent() - this.viewport());\n if (this.viewport() > 0 && this.lastOffset > end + HOLD_TOLERANCE) {\n this.pendingScroll = { offset: end, animated: false };\n this.lastOffset = end;\n }\n const index = Math.max(0, Math.min(this.indexAt(this.lastOffset), this.items().length - 1));\n this.anchorAt(index, this.lastOffset);\n return index;\n }\n\n /**\n * The index to hold the viewport at, -1 to let it move, or the start of the list when an\n * insert lands within the autoscroll threshold of it.\n */\n private heldIndex(anchor: Anchor<T>, items: readonly T[]): number | 'start' {\n if (items === anchor.items) return anchor.index;\n const hold = this.maintainVisibleContentPosition();\n if (!hold) return -1;\n const threshold = hold.autoscrollToTopThreshold;\n if (threshold !== undefined && this.lastOffset <= threshold) return 'start';\n const index = this.successorOf(anchor, items);\n return index < (hold.minIndexForVisible ?? 0) ? -1 : index;\n }\n\n /** Scroll to what arrived at the start, rather than holding the viewport past it. */\n private showStart(): number {\n this.anchorAt(0, 0);\n if (this.lastOffset !== 0) this.pendingScroll = 'start';\n this.lastOffset = 0;\n return 0;\n }\n\n /**\n * The anchored row's new index, or the first row after it that survived when it did not. Only\n * the rows that were rendered are searched for a successor: past those the viewport has moved\n * on, and holding it by something off screen would be holding it by nothing the user saw.\n */\n private successorOf(anchor: Anchor<T>, items: readonly T[]): number {\n const keys = this.keys() ?? items;\n const index = keys.indexOf(anchor.key);\n if (index !== -1) return index;\n const extract = this.keyExtractor();\n const was = anchor.items;\n const limit = Math.min(was.length, anchor.index + this.overscan() * 4 + 1);\n for (let i = anchor.index + 1; i < limit; i++) {\n const successor = keys.indexOf(extract ? extract(was[i]!, i) : was[i]);\n if (successor !== -1) return successor;\n }\n return -1;\n }\n\n /** Make a queued correction, after the commit that moved the rows has gone to native. */\n private flushScroll(): void {\n const pending = this.pendingScroll;\n if (!pending) return;\n this.pendingScroll = null;\n if (pending === 'start') this.scrollToOffset({ offset: 0, animated: true });\n else this.scrollToOffset({ offset: this.headerHeight() + pending.offset, animated: false });\n }\n\n /** In development, a list with rows that stays at zero size; see `ZeroSizeWarning`. */\n private readonly zeroSize = checksZeroSize()\n ? new ZeroSizeWarning(\n () => written(this.node),\n () => !!this.horizontal(),\n )\n : null;\n\n constructor() {\n super();\n afterEveryRender(() => {\n this.flushScroll();\n if (this.sticky.native) this.driveStickyRows();\n this.recheckItems();\n });\n // Not a host `(scroll)` listener: Angular marks every view above one dirty on each event, so a\n // fling would check the whole screen every frame. What a scroll changes is in signals, which\n // schedule the views that read them.\n const stopScroll = this.engine.setEventListener(this.node, 'topScroll', (event) =>\n this.onScroll(event as NativeSyntheticEvent<{ contentOffset?: { x?: number; y?: number } }>),\n );\n const stop = dismissKeyboardOnTap(this.engine, this.node, () =>\n this.keyboardShouldPersistTaps(),\n );\n inject(DestroyRef).onDestroy(() => {\n stopScroll();\n stop();\n this.sticky.destroy();\n clearTimeout(this.fillTimer);\n clearTimeout(this.speedTimer);\n this.zeroSize?.stop();\n });\n if (this.zeroSize) this.checkZeroSize(this.zeroSize);\n effect(() => this.scheduleFill());\n }\n\n /** The items the end and viewability were last checked against after a render. */\n private checkedItems: readonly T[] | null = null;\n /** And the table placing them, which a new column count makes again for the same items. */\n private checkedTable: HeightIndex | null = null;\n\n /**\n * New items can bring the end within reach or change what is on screen with no scroll: a list\n * shorter than its viewport, a page appended while at the end, a filter. Checked once the rows\n * they make are rendered, and only when they changed, so any other render costs a comparison.\n */\n private recheckItems(): void {\n const items = this.items();\n const table = this.table();\n if (items === this.checkedItems && table === this.checkedTable) return;\n this.checkedItems = items;\n this.checkedTable = table;\n this.checkEnd(this.headerHeight() + this.lastOffset);\n this.announceViewable(this.lastOffset);\n }\n\n /** Whether the viewport has been laid out yet, so a zero in it is a measurement. */\n private viewportMeasured = false;\n\n /**\n * In development, rows that arrive in a list already measured at zero, or go from one, with no\n * new layout to say so: an update to `items` alone does not lay the viewport out again.\n */\n private checkZeroSize(warning: ZeroSizeWarning): void {\n effect(() => {\n const hasRows = this.items().length > 0;\n if (this.viewportMeasured) warning.laidOut(untracked(this.viewport), hasRows);\n });\n }\n\n // --- the window ---------------------------------------------------------------------------\n\n /** The rows to render, and the edges of the run they sit in. */\n private readonly span = computed<Span | null>(() => {\n const items = this.items();\n const viewport = this.viewport();\n const overscan = this.overscan();\n if (!items.length) return null;\n\n // Counted in lines, which are rows unless items are in columns.\n const line = this.lineOf(Math.min(this.visible(), items.length - 1));\n const visible = this.lineStart(line);\n // In viewports, so nothing before the first layout.\n const fill = this.reach();\n // Before the first layout we have no viewport, so render a screen's worth optimistically\n // rather than nothing: an empty first frame is worse than a few extra rows.\n const overscanned = this.lineStart(Math.max(0, line - overscan));\n const budget = viewport > 0 ? viewport : this.heightOf(overscanned) * overscan * 2;\n /*\n * Measured from the top of the first *visible* row, not the first rendered one.\n *\n * Anchoring it at `first` - which is already backed off by the overscan - spent the budget\n * on rows above the viewport, so the window ran out that far before the bottom of the\n * screen. The trailing `+ overscan` hid it whenever every row was the same height, because\n * then the rows added below happened to be worth exactly the rows wasted above. With mixed\n * heights they are not, and the list clips short of its own bottom.\n */\n // Within three viewports of the viewport as it is now, which may have shrunk since.\n const reach = 3 * Math.max(0, viewport);\n const ahead = this.velocityLead() ? Math.max(-reach, Math.min(reach, this.ahead())) : 0;\n const top = this.topOf(visible);\n const first = Math.max(\n 0,\n Math.min(overscanned, this.indexAt(top - fill.before * viewport - Math.max(0, -ahead))),\n );\n\n let last = visible;\n while (last < items.length && this.topOf(last) < top + budget) last++;\n /*\n * The viewport starts anywhere inside the visible row, so it can end up to that row's size\n * past `top + budget`. The overscan below covers that for a row no taller than the rows after\n * it; a taller one, a photo over its comments, needs the rows down to there as well. Taken\n * from the scroll offset instead, the window would change on every scroll event rather than\n * when the visible row does.\n */\n let end = last < items.length ? this.lineStart(this.lineOf(last) + overscan) : items.length;\n const deepest =\n top +\n this.heightOf(visible) +\n this.rowGap() +\n budget +\n fill.after * viewport +\n Math.max(0, ahead);\n while (end < items.length && this.topOf(end) < deepest) end++;\n return { first, last: end };\n });\n\n readonly window = computed<VirtualRow<T>[]>(() => {\n const span = this.span();\n if (!span) return [];\n const rows = this.rowsFor(this.items(), span.first, span.last);\n this.trimParked();\n for (const pool of this.parked.values()) rows.push(...pool);\n // The cache exists for rows that stay in the window between scrolls; anything that has left\n // it is rebuilt if it comes back, so the map stays the size of the window, not of the list.\n for (const index of this.slots.keys()) {\n if (index < span.first || index >= span.last) this.slots.delete(index);\n }\n return rows;\n });\n\n /**\n * What stands in for the rows above the window when rows are in flow: their total extent, less\n * a pinned row's, which is rendered in flow ahead of the window.\n */\n protected readonly spacer = computed(() => {\n const span = this.span();\n let lead = span ? this.topOf(span.first) : 0;\n const [pinned] = this.sticky.pinned();\n if (span && pinned !== undefined && pinned < span.first) {\n lead = this.sticky.native ? this.topOf(pinned) : lead - this.heightOf(pinned) - this.rowGap();\n }\n return this.horizontal() ? { width: Math.max(0, lead) } : { height: Math.max(0, lead) };\n });\n\n /** The rows from `first` up to `last`, and the pinned rows above them if there are any. */\n private rowsFor(items: readonly T[], first: number, last: number): VirtualRow<T>[] {\n const rows: VirtualRow<T>[] = [];\n const pinned = this.sticky.pinned();\n const above = pinned.filter((index) => index < first);\n this.releaseRecycled(first, last, above);\n // A pinned row is on screen even when its own place in the list is not, which is the whole\n // point of it, so it is rendered whether or not the window reaches that far.\n for (const index of above) {\n const key = this.keyAt(index);\n rows.push(\n this.hold({\n index,\n slot: this.recycledSlot(key, items[index]!, index),\n key,\n item: items[index]!,\n style: this.sticky.native\n ? this.sticky.style(index)\n : this.measuring()\n ? this.sticky.flowStyle(\n index,\n this.topOf(first) - this.heightOf(index) - this.rowGap(),\n )\n : this.sticky.slotStyle(index),\n }),\n );\n }\n for (let index = first; index < last; index++) {\n const key = this.keyAt(index);\n rows.push(\n this.hold({\n index,\n slot: this.recycledSlot(key, items[index]!, index),\n key,\n item: items[index]!,\n style: this.styleFor(index, pinned.includes(index)),\n }),\n );\n }\n // Rows in flow pin one at a time, so the one above the window is the only one.\n const [lead] = above;\n if (lead !== undefined && this.sticky.native && this.measuring()) {\n this.leadWindow(rows, lead, first);\n }\n return rows;\n }\n\n /**\n * A pinned row native moves stays at its own place, so the rows between it and the window are\n * made up before the window rather than after the row: new props on a view native is moving\n * put its transform back for a frame.\n */\n private leadWindow(rows: VirtualRow<T>[], pinned: number, first: number): void {\n const lead = rows[1];\n // The pinned row's own gap already follows it in flow.\n const between = this.topOf(first) - this.topOf(pinned) - this.heightOf(pinned) - this.rowGap();\n if (!lead || between <= 0) return;\n const margin = this.horizontal() ? 'marginLeft' : 'marginTop';\n rows[1] = this.hold({ ...lead, style: { ...lead.style, [margin]: between } });\n }\n\n private styleFor(index: number, pinned: boolean): Record<string, unknown> {\n if (this.sticky.native && this.sticky.rows().has(index)) return this.sticky.style(index);\n if (this.measuring()) {\n return pinned ? this.sticky.flowStyle(index, this.topOf(index)) : this.flowStyle();\n }\n return pinned ? this.sticky.slotStyle(index) : this.slotStyle(index);\n }\n\n /**\n * Hand each rendered sticky row's view to native to move. The rows' views are the canvas's\n * element children in window order, after the spacer, which is how `@for` over `window()`\n * leaves them.\n */\n private driveStickyRows(): void {\n const views = () =>\n (this.canvasView().nativeElement as HostNode).childList\n .filter((child) => child.nodeKind === 'element')\n .slice(this.measuring() ? 1 : 0);\n this.sticky.drive(\n () => this.window(),\n views,\n () => this.headerView().nativeElement as HostNode,\n );\n }\n\n /** Which recycling slot each rendered item holds, by key: its type, and the row it last drew. */\n private readonly recycled = new Map<\n unknown,\n { slot: number; type: unknown; row: VirtualRow<T> | null }\n >();\n /** Slots that have left the window and are kept hidden, by the type of row that held them. */\n private readonly parked = new Map<unknown, VirtualRow<T>[]>();\n private nextSlot = 0;\n\n /** Note the row a slot is drawing, for parking it once it leaves. */\n private hold(row: VirtualRow<T>): VirtualRow<T> {\n const held = this.recycled.get(row.key);\n if (held) held.row = row;\n return row;\n }\n\n /**\n * Park the slots of the items that have left the window, for the items arriving.\n *\n * Parked rather than freed: a slot missing from the window is destroyed by `@for`, so a slot is\n * only reused if a row of its type arrives in the same pass as it left. Kept rendered and\n * hidden, it waits for the next row of its type however many passes later, which is what a\n * reuse queue of cells does in UIKit.\n */\n private releaseRecycled(first: number, last: number, pinned: readonly number[]): void {\n const keep = new Set<unknown>();\n for (let index = first; index < last; index++) keep.add(this.keyAt(index));\n for (const index of pinned) keep.add(this.keyAt(index));\n for (const [key, held] of this.recycled) {\n if (keep.has(key)) continue;\n this.recycled.delete(key);\n let pool = this.parked.get(held.type);\n if (!pool) this.parked.set(held.type, (pool = []));\n pool.push({ ...(held.row ?? this.placeholder(key, held.slot)), parked: true, style: PARKED });\n }\n }\n\n /**\n * Keep a few hidden slots of each type once this pass has taken what it needs, dropping the\n * oldest: `@for` destroys the views of a slot that leaves the window for good.\n */\n private trimParked(): void {\n for (const pool of this.parked.values()) {\n if (pool.length > PARK_LIMIT) pool.splice(0, pool.length - PARK_LIMIT);\n }\n }\n\n /** A parked row for a slot that never drew, which only a slot taken and left in one pass is. */\n private placeholder(key: unknown, slot: number): VirtualRow<T> {\n return { index: -1, slot, key, item: this.items()[0]!, style: PARKED };\n }\n\n private recycledSlot(key: unknown, item: T, index: number): number {\n // A sticky row is a type of its own: native keeps the translate it moved one by, and a plain\n // row taking its slot commits no transform to put it back. A row that stops or starts being\n // sticky takes a new slot for the same reason.\n const sticky = this.sticky.rows().has(index);\n const held = this.recycled.get(key);\n if (held && this.sticky.isType(held.type) === sticky) return held.slot;\n const type = this.sticky.recyclingType(index, this.itemType()?.(item, index));\n const slot = this.unpark(key, type) ?? this.parked.get(type)?.pop()?.slot ?? this.nextSlot++;\n this.recycled.set(key, { slot, type, row: null });\n return slot;\n }\n\n /**\n * Take an item's own parked row out as it comes back: its slot if it is of the type the item now\n * is, and gone either way, or the window would hold its key twice.\n */\n private unpark(key: unknown, type: unknown): number | undefined {\n for (const [kind, pool] of this.parked) {\n const at = pool.findIndex((row) => row.key === key);\n if (at < 0) continue;\n const [row] = pool.splice(at, 1);\n return kind === type ? row!.slot : undefined;\n }\n return undefined;\n }\n\n /**\n * A row laid itself out; what `virtualListRow` calls. Only a row that sizes itself is measured,\n * and a height that has not changed changes nothing.\n */\n measureRow(row: VirtualRow<T>, layout: { width?: number; height?: number } | undefined): void {\n if (!this.measuring() || !layout || row.parked) return;\n const size = this.horizontal() ? layout.width : layout.height;\n if (size === undefined || this.measured.get(row.key) === size) return;\n this.measured.set(row.key, size);\n this.forgetDeparted();\n const index = this.indexOfKey()?.get(row.key);\n if (index === undefined) return;\n this.table()?.set(index, size + this.rowGap());\n this.measuredVersion.update((version) => version + 1);\n }\n\n /**\n * A row handed a view native has laid out before. Native reports a layout only when a view's\n * frame differs from the last one it reported, so an item that lands where the view already was,\n * at the same size, is never measured; the view's last size is its own until native says\n * otherwise.\n */\n adoptRow(row: VirtualRow<T>, layout: { width?: number; height?: number }): void {\n if (!this.measured.has(row.key)) this.measureRow(row, layout);\n }\n\n /** Drop the measurements of items long gone, so churn cannot grow the map without bound. */\n private forgetDeparted(): void {\n const items = this.items();\n if (this.measured.size <= items.length * 2 + 64) return;\n const current = new Set(this.keys() ?? items);\n for (const key of this.measured.keys()) if (!current.has(key)) this.measured.delete(key);\n }\n\n /** A separator for every rendered row but the list's last, in its leading row's slot. */\n protected readonly gaps = computed<Gap<T>[]>(() => {\n if (!this.separator()) return [];\n const items = this.items();\n const gaps: Gap<T>[] = [];\n for (const row of this.window()) {\n if (row.parked || this.onLastLine(row.index)) continue;\n const style = this.measuring() ? this.measuredGapStyle(row) : this.gapStyle(row);\n if (!style) continue;\n // What follows it along the list: the next line's first item, not the one beside it.\n const trailingItem = items[this.lineStart(this.lineOf(row.index) + 1)]!;\n gaps.push({\n index: row.index,\n style,\n context: {\n $implicit: row.item,\n leadingItem: row.item,\n trailingItem,\n leadingIndex: row.index,\n },\n });\n }\n return gaps;\n });\n\n /** The row's own slot, laid out to put the separator at its trailing edge. */\n private gapStyle(row: VirtualRow<T>): Record<string, unknown> {\n let style = this.gapStyles.get(row.style);\n if (!style) {\n style = {\n ...row.style,\n flexDirection: this.horizontal() ? 'row' : 'column',\n justifyContent: 'flex-end',\n pointerEvents: 'box-none',\n };\n this.gapStyles.set(row.style, style);\n }\n return style;\n }\n\n /**\n * A measured row's slot, over the row itself: nothing until its height is known, since drawing\n * it at the estimate would put a line through the middle of a row that turns out taller.\n */\n private measuredGapStyle(row: VirtualRow<T>): Record<string, unknown> | null {\n if (!this.measured.has(row.key)) return null;\n const start = this.topOf(row.index);\n const size = this.heightOf(row.index);\n const horizontal = this.horizontal();\n const flip = this.flipText();\n const across = this.across();\n const cached = this.measuredGaps.get(row.key);\n const placed = horizontal\n ? { ...across, left: start, width: size, transform: flip }\n : { ...across, top: start, height: size, transform: flip };\n if (cached && holds(cached, placed)) return cached;\n const style: Record<string, unknown> = horizontal\n ? { position: 'absolute', ...across, left: start, width: size, flexDirection: 'row' }\n : { position: 'absolute', ...across, top: start, height: size };\n style['justifyContent'] = 'flex-end';\n style['pointerEvents'] = 'box-none';\n if (flip) style['transform'] = flip;\n this.measuredGaps.set(row.key, style);\n if (this.measuredGaps.size > 256) this.measuredGaps.clear();\n return style;\n }\n\n /** The header, pinned with the rows when `stickyHeader` says so: see `StickyRows`. */\n protected readonly headerStyle = this.sticky.headerStyle;\n\n /**\n * The footer, flipped back like every row when the list is inverted, as FlatList inverts its\n * header and footer cells too; otherwise both read upside down.\n */\n protected readonly footerStyle = computed(() => {\n const flip = this.flipText();\n return flip ? { transform: flip } : undefined;\n });\n\n /** Which rows are on screen far enough to count, by the caller's threshold. */\n private viewableAt(offset: number): number[] {\n const viewport = this.viewport();\n if (!viewport) return [];\n\n const threshold = this.itemVisiblePercentThreshold() / 100;\n const rows: number[] = [];\n for (const row of this.window()) {\n if (row.parked) continue;\n const start = this.topOf(row.index);\n const size = this.heightOf(row.index);\n const shown = Math.min(start + size, offset + viewport) - Math.max(start, offset);\n if (shown > 0 && shown >= size * threshold) rows.push(row.index);\n }\n return rows;\n }\n\n /** The last set announced, so the output fires on a change rather than on every frame. */\n private announced: number[] = [];\n /** The items the last set was announced from: new items are a change even at the same indices. */\n private announcedFrom: readonly T[] | null = null;\n\n /**\n * Announce a change in what is on screen.\n *\n * Deliberately not a `computed` over a signal offset. A fling produces a scroll event per\n * frame, and writing a signal on each one costs a change-detection pass whether or not anything\n * moved into view; comparing here costs an array walk over the window and emits only when the\n * set really changed.\n */\n private announceViewable(offset: number): void {\n const viewable = this.viewableAt(offset);\n const entered = viewable.filter((index) => !this.announced.includes(index));\n const left = this.announced.filter((index) => !viewable.includes(index));\n const items = this.items();\n const same = items === this.announcedFrom || viewable.length === 0;\n if (entered.length === 0 && left.length === 0 && same) return;\n\n this.announced = viewable;\n this.announcedFrom = items;\n this.viewableItemsChanged.emit({\n viewable: viewable.map((index) => {\n const key = this.keyAt(index);\n return {\n index,\n // What is viewable is in the window, so it holds a slot already.\n slot: this.recycled.get(key)?.slot ?? -1,\n key,\n item: items[index]!,\n style: this.styleFor(index, false),\n };\n }),\n entered,\n left,\n });\n }\n\n /**\n * Scroll so that a row is at the start of the viewport, less `viewOffset`. The window moves\n * there at once, and the row is held there while the rows around it are measured.\n */\n scrollToIndex(options: { index: number; animated?: boolean; viewOffset?: number }): void {\n const items = this.items();\n if (!items.length) return;\n const index = Math.max(0, Math.min(options.index, items.length - 1));\n const within = -(options.viewOffset ?? 0);\n const offset = this.topOf(index) + within;\n this.lastOffset = offset;\n this.anchor = { key: this.keyAt(index), within, items, index };\n this.jumpTo(index);\n // The start of its line, which is what a scroll event there gives, so the fill keeps its way.\n this.moveTo(this.lineStart(this.lineOf(index)));\n this.scrollToOffset({ offset: this.headerHeight() + offset, animated: options.animated });\n }\n\n /** Scroll to an offset along the list's own axis: x when it is horizontal, y otherwise. */\n scrollToOffset(options: { offset: number; animated?: boolean }): void {\n const { offset, animated = true } = options;\n this.jumpTo(this.indexAt(offset - this.headerHeight()));\n const [x, y] = this.horizontal() ? [offset, 0] : [0, offset];\n this.sticky.jumping(this.reachable(offset), animated);\n this.engine.dispatchCommand(this.node, 'scrollTo', [x, y, animated]);\n }\n\n scrollToEnd(options: { animated?: boolean } = {}): void {\n this.sticky.jumping(this.reachable(Infinity), options.animated ?? true);\n this.jumpTo(this.items().length - 1);\n this.engine.dispatchCommand(this.node, 'scrollToEnd', [options.animated ?? true]);\n }\n\n private slotStyle(index: number): Record<string, unknown> {\n const start = this.topOf(index);\n const size = this.heightOf(index);\n const horizontal = this.horizontal();\n const key = horizontal ? 'left' : 'top';\n const extent = horizontal ? 'width' : 'height';\n\n const flip = this.flipText();\n const across = this.acrossOf(index);\n\n let style = this.slots.get(index);\n // The flip is part of the comparison because turning the list over changes every row, and a\n // cached slot would otherwise keep the orientation it was built with.\n const placed = { ...across, [extent]: size, [key]: start, transform: flip };\n const stale = !style || !holds(style, placed);\n\n if (stale) {\n style = horizontal\n ? { position: 'absolute', ...across, left: start, width: size }\n : { position: 'absolute', ...across, top: start, height: size };\n // The transform is the row's half of the inversion.\n if (flip) style['transform'] = flip;\n this.slots.set(index, style);\n return style;\n }\n return style!;\n }\n\n protected onScroll(\n event: NativeSyntheticEvent<{ contentOffset?: { x?: number; y?: number }; timestamp?: number }>,\n ): void {\n const contentOffset = event.nativeEvent?.contentOffset;\n const along = (this.horizontal() ? contentOffset?.x : contentOffset?.y) ?? 0;\n const content = along - this.headerHeight();\n\n // The first *visible* row, not the first rendered one. The overscan is applied where the\n // window is built, so that both edges can be measured from the same place.\n // Not clamped to the items: an input set in the same task as this event has not reached the\n // list yet, and the window clamps when it renders.\n this.trackSpeed(content, event.nativeEvent?.timestamp);\n this.follow(content);\n this.sticky.scrolled(along);\n this.checkEnd(along);\n this.announceViewable(content);\n }\n\n /** Take the viewport's leading edge, in the rows' own space, as where the list is. */\n private follow(content: number): void {\n const visible = this.indexAt(content);\n if (visible !== this.visible()) this.moveTo(visible);\n this.lastOffset = content;\n this.anchorAt(visible, content);\n }\n\n /**\n * Points the window reaches past the viewport for the scroll's speed, positive toward the end,\n * in steps of a quarter viewport: written only when it moves a step, so a fling costs a pass\n * for it every few frames rather than on every scroll event.\n */\n private readonly ahead = signal(0);\n /** The speed's lead before rounding to a step, eased from one event to the next. */\n private eased = 0;\n /** The offset of the last scroll event, and when it arrived. */\n private lastScroll = { offset: 0, at: -Infinity };\n /** Lets go of the reach once scroll events stop, which is all a scroll that stops sends. */\n private speedTimer: ReturnType<typeof setTimeout> | undefined;\n\n /**\n * Follow the scroll's speed, from each scroll event's offset and the time native sent it, in\n * milliseconds, which iOS and Android both give. Not the time it reached JavaScript: a thread\n * that fell behind gets a fling's events in a burst, which would read as no time at all between\n * them. Where native gives no time, as on the web, the time it arrived.\n */\n private trackSpeed(offset: number, sent: number | undefined): void {\n const ms = this.velocityLead();\n const now = typeof sent === 'number' && Number.isFinite(sent) ? sent : performance.now();\n const elapsed = now - this.lastScroll.at;\n const moved = offset - this.lastScroll.offset;\n this.lastScroll = { offset, at: now };\n const viewport = this.viewport();\n // A pause, or the first event of a scroll, starts the speed over.\n if (!ms || !viewport || elapsed <= 0 || elapsed > PAUSE_MS) {\n this.eased = 0;\n } else {\n const reach = 3 * viewport;\n const clamp = (value: number) => Math.max(-reach, Math.min(reach, value));\n // Halfway to the new speed, so one late event does not throw the window around.\n this.eased = clamp((this.eased + clamp((moved / elapsed) * ms)) / 2);\n }\n const step = viewport / 4;\n const ahead = step ? Math.round(this.eased / step) * step : 0;\n this.ahead.set(ahead);\n clearTimeout(this.speedTimer);\n if (ahead) this.speedTimer = setTimeout(() => this.stopSpeed(), PAUSE_MS);\n }\n\n /** Start the speed over: a pause, or a jump, which is no fling. */\n private stopSpeed(): void {\n clearTimeout(this.speedTimer);\n this.lastScroll = { offset: 0, at: -Infinity };\n this.eased = 0;\n this.ahead.set(0);\n }\n\n /** The most viewports rendered ahead of the scroll direction and behind it. */\n private fillCaps(): { ahead: number; behind: number } {\n const extra = Math.max(0, Math.floor(this.windowSize()) - 1);\n const behind = Math.floor(extra / 3);\n return { ahead: extra - behind, behind };\n }\n\n /** Move the window to a new visible row. */\n private moveTo(visible: number): void {\n this.turn(Math.sign(visible - this.visible()));\n this.visible.set(visible);\n }\n\n /**\n * Start the fill over before a scroll the list is told to make lands past the rendered rows, so\n * it renders one viewport there, not the whole filled window, in a single pass. A scroll the\n * user makes keeps it: one past the rendered rows is a fling outrunning them, which is what the\n * fill is for.\n */\n private jumpTo(index: number): void {\n const span = this.span();\n if (span && (index < span.first || index >= span.last)) this.fill.set({ before: 0, after: 0 });\n // Nor is the scroll that reports it a fling: its speed starts over from where it lands.\n this.stopSpeed();\n }\n\n /**\n * Follow a change of scroll direction: the rows filled behind are now ahead, and those ahead are\n * kept only up to what is kept behind.\n */\n private turn(direction: number): void {\n if (!direction || direction === this.direction()) return;\n this.direction.set(direction);\n this.fill.set(this.reach());\n }\n\n /** The side the window grows on next, ahead of the scroll first, or null once both are full. */\n private nextFill(reach: { before: number; after: number }): 'before' | 'after' | null {\n const { ahead, behind } = this.fillCaps();\n const [front, back] =\n this.direction() > 0 ? (['after', 'before'] as const) : (['before', 'after'] as const);\n return reach[front] < ahead ? front : reach[back] < behind ? back : null;\n }\n\n /**\n * Grow the window by a viewport once the JS thread has been free for a batch period, ahead of\n * the scroll first. Every window change restarts the wait, so a fling is never slowed by it.\n */\n private scheduleFill(): void {\n clearTimeout(this.fillTimer);\n const reach = this.reach();\n // Keep a cut made by a lower windowSize, so raising it again fills a batch at a time.\n const fill = untracked(this.fill);\n if (fill.before !== reach.before || fill.after !== reach.after) this.fill.set(reach);\n if (!this.span() || this.viewport() <= 0) return;\n const side = this.nextFill(reach);\n if (!side) return;\n this.fillTimer = setTimeout(\n () => this.fill.set({ ...reach, [side]: reach[side] + 1 }),\n FILL_BATCH_MS,\n );\n }\n\n protected onLayout(\n event: NativeSyntheticEvent<{ layout?: { width?: number; height?: number } }>,\n ): void {\n const layout = event.nativeEvent?.layout;\n this.viewport.set((this.horizontal() ? layout?.width : layout?.height) ?? 0);\n this.viewportMeasured = true;\n this.zeroSize?.laidOut(this.viewport(), this.items().length > 0);\n this.checkEnd(this.headerHeight() + this.lastOffset);\n this.announceViewable(this.lastOffset);\n }\n\n /** The header's extent along the axis, which every row sits after. */\n protected onHeaderLayout(\n event: NativeSyntheticEvent<{ layout?: { width?: number; height?: number } }>,\n ): void {\n const layout = event.nativeEvent?.layout;\n const height = (this.horizontal() ? layout?.width : layout?.height) ?? 0;\n if (height === this.headerHeight()) return;\n const along = this.headerHeight() + this.lastOffset;\n this.headerHeight.set(height);\n if (this.holdPastHeader()) return;\n // Native keeps its offset and sends no scroll event, so the rows moved under the viewport by\n // the difference: the window, the end and what is viewable are taken again from there.\n this.follow(along - height);\n this.checkEnd(along);\n this.announceViewable(along - height);\n }\n\n /**\n * The header grew or shrank - a typing indicator in a chat's, a banner in a feed's - and every\n * row moved with it. Held like an insert when the caller asked for that and the viewport is\n * past the header, among the rows; at the start the user is looking at the header, and it is\n * left to push the rows along. Made at once rather than after a render, because a layout arrives\n * outside change detection and nothing else may be about to render.\n */\n private holdPastHeader(): boolean {\n const hold = this.maintainVisibleContentPosition();\n if (!hold || this.lastOffset <= (hold.autoscrollToTopThreshold ?? 0)) return false;\n this.scrollToOffset({ offset: this.headerHeight() + this.lastOffset, animated: false });\n return true;\n }\n\n protected onContentSize(event: NativeSyntheticEvent<{ width?: number; height?: number }>): void {\n const size = event.nativeEvent;\n this.contentSize = (this.horizontal() ? size?.width : size?.height) ?? 0;\n this.contentSizeFor = this.headerHeight() + this.extent();\n this.checkEnd(this.headerHeight() + this.lastOffset);\n }\n\n /** The scroll view's content along the axis, header and all. */\n private contentExtent(): number {\n // Native's size is for the rows it last laid out; until it reports for these, their own extent.\n const own = this.headerHeight() + this.extent();\n return this.contentSizeFor === own ? this.contentSize : own;\n }\n\n /** The user took the scroll over: native's own events move the rows from here. */\n protected onDragBegin(): void {\n this.sticky.dragged();\n }\n\n /** A scroll came to rest: see `StickyRows.rested`. */\n protected onScrollEnd(): void {\n this.sticky.rested();\n }\n\n /**\n * How far toward `offset` the content lets native scroll. Android stops a scroll at its end and\n * says nothing of it; iOS goes past, and its scroll end event says where it came to rest.\n */\n private reachable(offset: number): number {\n const viewport = this.viewport();\n const total = this.contentExtent();\n // Past the content by the inset after it, where the scroll view lets it go.\n const inset = this.contentInset();\n const after = (this.horizontal() ? inset?.right : inset?.bottom) ?? 0;\n const end = viewport > 0 ? Math.max(0, total - viewport + after) : total;\n return Math.min(Math.max(0, offset), end);\n }\n\n private checkEnd(y: number): void {\n const count = this.items().length;\n const viewport = this.viewport();\n if (!count || !viewport) return;\n const distanceFromEnd = this.contentExtent() - (y + viewport);\n // Away from the end again re-arms it, as React Native does, so a load that failed is retried\n // the next time the user comes back down.\n if (distanceFromEnd > this.endReachedThreshold() * viewport) {\n this.endReachedFor = -1;\n return;\n }\n if (this.endReachedFor === count) return;\n this.endReachedFor = count;\n this.endReached.emit({ distanceFromEnd });\n }\n}\n\n/** Whether a cached slot style already has every one of these props. */\nfunction holds(style: Record<string, unknown>, props: Record<string, unknown>): boolean {\n return Object.entries(props).every(([prop, value]) => style[prop] === value);\n}\n\n/**\n * Put on each row's view: `<view [virtualListRow]=\"row\">`. Applies the row's style, and reports\n * the row's layout to the list, which is how a list of rows that size themselves learns how tall\n * each one is.\n */\n@Directive({\n selector: '[virtualListRow]',\n host: {\n '[style]': 'row().style',\n // A parked row is not read out: see `PARKED`.\n '[attr.aria-hidden]': 'row().parked ? true : null',\n '(layout)': 'onLayout($event)',\n },\n})\nexport class VirtualListRow<T = unknown> {\n readonly row = input.required<VirtualRow<T>>({ alias: 'virtualListRow' });\n private readonly list = inject<VirtualList<T>>(VirtualList);\n /** The last layout native reported for this view, whichever item it held. */\n private layout: { width?: number; height?: number } | undefined;\n\n constructor() {\n effect(() => {\n const row = this.row();\n if (this.layout) untracked(() => this.list.adoptRow(row, this.layout!));\n });\n }\n\n protected onLayout(\n event: NativeSyntheticEvent<{ layout?: { width?: number; height?: number } }>,\n ): void {\n this.layout = event.nativeEvent?.layout ?? this.layout;\n this.list.measureRow(this.row(), event.nativeEvent?.layout);\n }\n}\n"]}
|