@legendapp/list 2.1.0-beta.0 → 2.1.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +78 -0
- package/animated.d.mts +2 -2
- package/animated.d.ts +2 -2
- package/index.d.mts +34 -15
- package/index.d.ts +34 -15
- package/index.js +1072 -815
- package/index.mjs +1010 -753
- package/package.json +6 -3
- package/reanimated.d.mts +5 -4
- package/reanimated.d.ts +5 -4
- package/reanimated.js +24 -6
- package/reanimated.mjs +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,81 @@
|
|
|
1
|
+
## 2.0.13
|
|
2
|
+
- Feat: Allow returning undefined in getFixedItemSize to fall back to estimated size
|
|
3
|
+
- Fix: scrollToIndex viewOffset was being subtracted twice, causing incorrect scroll positioning
|
|
4
|
+
- Fix: Initial container allocation was not applying maintainVisibleContentPosition calculations
|
|
5
|
+
- Fix: updateItemSize was providing full data array to getEstimatedItemSize and getFixedItemSize instead of individual item
|
|
6
|
+
|
|
7
|
+
## 2.0.12
|
|
8
|
+
- Fix: Scroll velocity calculation was sometimes incorrect when item sizes were very different from estimate
|
|
9
|
+
- Fix: onScroll while scrolling was updating positions without maintainVisibleContentPosition calculations, which was breaking scroll position maintenance
|
|
10
|
+
|
|
11
|
+
## 2.0.11
|
|
12
|
+
- Fix: Missing React import in a file
|
|
13
|
+
|
|
14
|
+
## 2.0.10
|
|
15
|
+
- Feat: Add onStickyHeaderChange callback for sticky headers
|
|
16
|
+
- Fix: Items with a falsy value like 0 were not rendering
|
|
17
|
+
- Fix: Column positions sometimes not calculating correctly
|
|
18
|
+
- Perf: updateItemsPositions was not breaking early sometimes
|
|
19
|
+
- Perf: Changed idCache to be an array instead of a Map for better performance
|
|
20
|
+
- Perf: Speed up container reuse lookups
|
|
21
|
+
|
|
22
|
+
## 2.0.9
|
|
23
|
+
- Fix: Improve initialScrollIndex accuracy and reliability
|
|
24
|
+
|
|
25
|
+
## 2.0.8
|
|
26
|
+
- Fix: Data changing sometimes left blank spaces because it was ignoring scroll
|
|
27
|
+
- Fix: Toggling between empty and non-empty causing maintainVisibleContentPosition issues
|
|
28
|
+
|
|
29
|
+
## 2.0.7
|
|
30
|
+
- Fix: Layout not working on react-native-macos because of transform instead of position
|
|
31
|
+
|
|
32
|
+
## 2.0.6
|
|
33
|
+
- Fix: updateItemPositions edge case with items multiple screen heights long was breaking the loop too early
|
|
34
|
+
|
|
35
|
+
## 2.0.5
|
|
36
|
+
- Perf: Change updateAllPositions to constrain processing to the scroll range
|
|
37
|
+
- Fix: Crash when using snapTo in some environments
|
|
38
|
+
- Perf: Change Separator to use useIsLastItem which should reduce the number of times it runs
|
|
39
|
+
|
|
40
|
+
## 2.0.4
|
|
41
|
+
- Fix: Possible crash if refScroller is undefined
|
|
42
|
+
|
|
43
|
+
## 2.0.3
|
|
44
|
+
- Feat: Set activeStickyIndex for usage in getState()
|
|
45
|
+
- Revert changes from 2.0.1 and 2.0.2 which were buggy in an edge case
|
|
46
|
+
|
|
47
|
+
## 2.0.2
|
|
48
|
+
- Fix: Performance improvement in 2.0.1 caused a bug in an edge case
|
|
49
|
+
|
|
50
|
+
## 2.0.1
|
|
51
|
+
- Perf: Improve performance in very long lists (bad release)
|
|
52
|
+
|
|
53
|
+
## 2.0.0
|
|
54
|
+
Major version release with significant performance improvements and architectural changes:
|
|
55
|
+
- Feat: Complete rewrite of virtualization algorithm for better performance
|
|
56
|
+
- Feat: Add sticky headers support via stickyIndices prop
|
|
57
|
+
- Feat: Add snapToIndices prop for snap-to behavior
|
|
58
|
+
- Feat: Add getItemType prop for better item type handling
|
|
59
|
+
- Feat: Add getFixedItemSize prop for items with known fixed sizes
|
|
60
|
+
- Feat: Add itemsAreEqual prop to reduce re-rendering when data changes
|
|
61
|
+
- Feat: Expose positions in getState()
|
|
62
|
+
- Feat: Add enableAverages prop to control average size calculations
|
|
63
|
+
- Feat: Add viewOffset option to scrollToEnd
|
|
64
|
+
- Feat: Improve maintainScrollAtEnd with more granular options
|
|
65
|
+
- Feat: Add ref function to enable/disable scroll processing
|
|
66
|
+
- Feat: Support lazy rendering directly in LegendList component
|
|
67
|
+
- Perf: Optimize container positioning using transform instead of absolute positioning
|
|
68
|
+
- Perf: Improve scroll buffering algorithm with directional bias
|
|
69
|
+
- Perf: Enable batched updates for better rendering performance
|
|
70
|
+
- Perf: Optimize container allocation and reuse algorithms
|
|
71
|
+
- Perf: Improve average item size calculations
|
|
72
|
+
- Fix: Improve maintainVisibleContentPosition reliability
|
|
73
|
+
- Fix: Better handling of data changes and scroll position maintenance
|
|
74
|
+
- Fix: Improve initial scroll positioning accuracy
|
|
75
|
+
- Fix: Better handling of padding changes
|
|
76
|
+
- Fix: Resolve various edge cases with container recycling
|
|
77
|
+
- Fix: Improve viewability calculations
|
|
78
|
+
|
|
1
79
|
## 1.1.4
|
|
2
80
|
- Feat: Add sizes to getState()
|
|
3
81
|
|
package/animated.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import * as React$1 from 'react';
|
|
2
1
|
import * as _legendapp_list from '@legendapp/list';
|
|
2
|
+
import * as React from 'react';
|
|
3
3
|
import { Animated } from 'react-native';
|
|
4
4
|
|
|
5
|
-
declare const AnimatedLegendList: Animated.AnimatedComponent<(<T>(props: _legendapp_list.LegendListProps<T> & React
|
|
5
|
+
declare const AnimatedLegendList: Animated.AnimatedComponent<(<T>(props: _legendapp_list.LegendListProps<T> & React.RefAttributes<_legendapp_list.LegendListRef>) => React.ReactNode) & {
|
|
6
6
|
displayName?: string;
|
|
7
7
|
}>;
|
|
8
8
|
|
package/animated.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import * as React$1 from 'react';
|
|
2
1
|
import * as _legendapp_list from '@legendapp/list';
|
|
2
|
+
import * as React from 'react';
|
|
3
3
|
import { Animated } from 'react-native';
|
|
4
4
|
|
|
5
|
-
declare const AnimatedLegendList: Animated.AnimatedComponent<(<T>(props: _legendapp_list.LegendListProps<T> & React
|
|
5
|
+
declare const AnimatedLegendList: Animated.AnimatedComponent<(<T>(props: _legendapp_list.LegendListProps<T> & React.RefAttributes<_legendapp_list.LegendListRef>) => React.ReactNode) & {
|
|
6
6
|
displayName?: string;
|
|
7
7
|
}>;
|
|
8
8
|
|
package/index.d.mts
CHANGED
|
@@ -5,7 +5,7 @@ import Animated$1 from 'react-native-reanimated';
|
|
|
5
5
|
|
|
6
6
|
type AnimatedValue = number;
|
|
7
7
|
|
|
8
|
-
type ListenerType = "numContainers" | "numContainersPooled" | `containerItemKey${number}` | `containerItemData${number}` | `containerPosition${number}` | `containerColumn${number}` | `containerSticky${number}` | `containerStickyOffset${number}` | "containersDidLayout" | "extraData" | "numColumns" | "lastItemKeys" | "totalSize" | "alignItemsPaddingTop" | "stylePaddingTop" | "scrollAdjust" | "scrollAdjustUserOffset" | "headerSize" | "footerSize" | "maintainVisibleContentPosition" | "debugRawScroll" | "debugComputedScroll" | "otherAxisSize" | "snapToOffsets" | "scrollSize" | "
|
|
8
|
+
type ListenerType = "numContainers" | "numContainersPooled" | `containerItemKey${number}` | `containerItemData${number}` | `containerPosition${number}` | `containerColumn${number}` | `containerSticky${number}` | `containerStickyOffset${number}` | "containersDidLayout" | "extraData" | "numColumns" | "lastItemKeys" | "totalSize" | "alignItemsPaddingTop" | "lastPositionUpdate" | "stylePaddingTop" | "scrollAdjust" | "scrollAdjustUserOffset" | "scrollAdjustPending" | "scrollingTo" | "headerSize" | "footerSize" | "maintainVisibleContentPosition" | "debugRawScroll" | "debugComputedScroll" | "otherAxisSize" | "snapToOffsets" | "scrollSize" | "activeStickyIndex";
|
|
9
9
|
interface StateContext {
|
|
10
10
|
internalState: InternalState | undefined;
|
|
11
11
|
listeners: Map<ListenerType, Set<(value: any) => void>>;
|
|
@@ -28,6 +28,7 @@ interface StateContext {
|
|
|
28
28
|
|
|
29
29
|
declare class ScrollAdjustHandler {
|
|
30
30
|
private appliedAdjust;
|
|
31
|
+
private pendingAdjust;
|
|
31
32
|
private context;
|
|
32
33
|
private mounted;
|
|
33
34
|
constructor(ctx: StateContext);
|
|
@@ -211,6 +212,13 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
|
|
|
211
212
|
* @default 0.5
|
|
212
213
|
*/
|
|
213
214
|
onStartReachedThreshold?: number | null | undefined;
|
|
215
|
+
/**
|
|
216
|
+
* Called when the sticky header changes.
|
|
217
|
+
*/
|
|
218
|
+
onStickyHeaderChange?: (info: {
|
|
219
|
+
index: number;
|
|
220
|
+
item: any;
|
|
221
|
+
}) => void;
|
|
214
222
|
/**
|
|
215
223
|
* Called when the viewability of items changes.
|
|
216
224
|
*/
|
|
@@ -270,7 +278,7 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
|
|
|
270
278
|
*/
|
|
271
279
|
stickyIndices?: number[];
|
|
272
280
|
getItemType?: (item: ItemT, index: number) => TItemType;
|
|
273
|
-
getFixedItemSize?: (index: number, item: ItemT, type: TItemType) => number;
|
|
281
|
+
getFixedItemSize?: (index: number, item: ItemT, type: TItemType) => number | undefined;
|
|
274
282
|
itemsAreEqual?: (itemPrevious: ItemT, item: ItemT, index: number, data: readonly ItemT[]) => boolean;
|
|
275
283
|
}
|
|
276
284
|
type LegendListPropsBase<ItemT, TScrollView extends ComponentProps<typeof ScrollView> | ComponentProps<typeof Animated.ScrollView> | ComponentProps<typeof Animated$1.ScrollView>, TItemType extends string | undefined = string | undefined> = BaseScrollViewProps<TScrollView> & LegendListSpecificProps<ItemT, TItemType> & (DataModeProps<ItemT, TItemType> | ChildrenModeProps);
|
|
@@ -285,6 +293,20 @@ interface ColumnWrapperStyle {
|
|
|
285
293
|
columnGap?: number;
|
|
286
294
|
}
|
|
287
295
|
type LegendListProps<ItemT = any> = LegendListPropsBase<ItemT, ComponentProps<typeof ScrollView>>;
|
|
296
|
+
interface ThresholdSnapshot {
|
|
297
|
+
scrollPosition: number;
|
|
298
|
+
contentSize?: number;
|
|
299
|
+
dataLength?: number;
|
|
300
|
+
atThreshold: boolean;
|
|
301
|
+
}
|
|
302
|
+
interface ScrollTarget {
|
|
303
|
+
offset: number;
|
|
304
|
+
index?: number;
|
|
305
|
+
viewOffset?: number;
|
|
306
|
+
viewPosition?: number;
|
|
307
|
+
animated?: boolean;
|
|
308
|
+
isInitialScroll?: boolean;
|
|
309
|
+
}
|
|
288
310
|
interface InternalState {
|
|
289
311
|
positions: Map<string, number>;
|
|
290
312
|
columns: Map<string, number>;
|
|
@@ -318,14 +340,15 @@ interface InternalState {
|
|
|
318
340
|
timeoutSizeMessage: any;
|
|
319
341
|
nativeMarginTop: number;
|
|
320
342
|
indexByKey: Map<string, number>;
|
|
321
|
-
idCache:
|
|
343
|
+
idCache: string[];
|
|
322
344
|
viewabilityConfigCallbackPairs: ViewabilityConfigCallbackPairs<any> | undefined;
|
|
323
345
|
scrollHistory: Array<{
|
|
324
346
|
scroll: number;
|
|
325
347
|
time: number;
|
|
326
348
|
}>;
|
|
327
|
-
|
|
328
|
-
|
|
349
|
+
lastScrollAdjustForHistory?: number;
|
|
350
|
+
startReachedSnapshot: ThresholdSnapshot | undefined;
|
|
351
|
+
endReachedSnapshot: ThresholdSnapshot | undefined;
|
|
329
352
|
scrollForNextCalculateItemsInView: {
|
|
330
353
|
top: number;
|
|
331
354
|
bottom: number;
|
|
@@ -334,19 +357,14 @@ interface InternalState {
|
|
|
334
357
|
minIndexSizeChanged: number | undefined;
|
|
335
358
|
queuedInitialLayout?: boolean | undefined;
|
|
336
359
|
queuedCalculateItemsInView: number | undefined;
|
|
360
|
+
dataChangeNeedsScrollUpdate: boolean;
|
|
337
361
|
lastBatchingAction: number;
|
|
338
362
|
ignoreScrollFromMVCP?: {
|
|
339
363
|
lt?: number;
|
|
340
364
|
gt?: number;
|
|
341
365
|
};
|
|
366
|
+
ignoreScrollFromMVCPIgnored?: boolean;
|
|
342
367
|
ignoreScrollFromMVCPTimeout?: any;
|
|
343
|
-
scrollingTo?: {
|
|
344
|
-
offset: number;
|
|
345
|
-
index?: number;
|
|
346
|
-
viewOffset?: number;
|
|
347
|
-
viewPosition?: number;
|
|
348
|
-
animated?: boolean;
|
|
349
|
-
} | undefined;
|
|
350
368
|
needsOtherAxisSize?: boolean;
|
|
351
369
|
averageSizes: Record<string, {
|
|
352
370
|
num: number;
|
|
@@ -361,7 +379,6 @@ interface InternalState {
|
|
|
361
379
|
stickyContainers: Map<number, number>;
|
|
362
380
|
stickyContainerPool: Set<number>;
|
|
363
381
|
scrollProcessingEnabled: boolean;
|
|
364
|
-
onScrollRafScheduled?: boolean;
|
|
365
382
|
props: {
|
|
366
383
|
alignItemsAtEnd: boolean;
|
|
367
384
|
data: readonly any[];
|
|
@@ -381,6 +398,7 @@ interface InternalState {
|
|
|
381
398
|
onScroll: LegendListProps["onScroll"];
|
|
382
399
|
onStartReached: LegendListProps["onStartReached"];
|
|
383
400
|
onStartReachedThreshold: number | null | undefined;
|
|
401
|
+
onStickyHeaderChange: LegendListProps["onStickyHeaderChange"];
|
|
384
402
|
recycleItems: boolean;
|
|
385
403
|
suggestEstimatedItemSize: boolean;
|
|
386
404
|
stylePaddingBottom: number | undefined;
|
|
@@ -412,6 +430,7 @@ interface LegendListRenderItemProps<ItemT, TItemType extends string | number | u
|
|
|
412
430
|
extraData: any;
|
|
413
431
|
}
|
|
414
432
|
type ScrollState = {
|
|
433
|
+
activeStickyIndex: number | undefined;
|
|
415
434
|
contentLength: number;
|
|
416
435
|
data: readonly any[];
|
|
417
436
|
end: number;
|
|
@@ -542,7 +561,7 @@ interface ViewAmountToken<ItemT = any> extends ViewToken<ItemT> {
|
|
|
542
561
|
percentOfScroller: number;
|
|
543
562
|
scrollSize: number;
|
|
544
563
|
}
|
|
545
|
-
interface ViewabilityConfigCallbackPair<ItemT> {
|
|
564
|
+
interface ViewabilityConfigCallbackPair<ItemT = any> {
|
|
546
565
|
viewabilityConfig: ViewabilityConfig;
|
|
547
566
|
onViewableItemsChanged?: OnViewableItemsChanged<ItemT>;
|
|
548
567
|
}
|
|
@@ -623,4 +642,4 @@ declare function useListScrollSize(): {
|
|
|
623
642
|
};
|
|
624
643
|
declare function useSyncLayout(): () => void;
|
|
625
644
|
|
|
626
|
-
export { type ColumnWrapperStyle, type GetRenderedItem, type GetRenderedItemResult, type InternalState, LegendList, type LegendListProps, type LegendListPropsBase, type LegendListRecyclingState, type LegendListRef, type LegendListRenderItemProps, type MaintainScrollAtEndOptions, type OnViewableItemsChanged, type ScrollIndexWithOffset, type ScrollIndexWithOffsetPosition, type ScrollState, type TypedForwardRef, type TypedMemo, type ViewAmountToken, type ViewToken, type ViewabilityAmountCallback, type ViewabilityCallback, type ViewabilityConfig, type ViewabilityConfigCallbackPair, type ViewabilityConfigCallbackPairs, type ViewableRange, typedForwardRef, typedMemo, useIsLastItem, useListScrollSize, useRecyclingEffect, useRecyclingState, useSyncLayout, useViewability, useViewabilityAmount };
|
|
645
|
+
export { type ColumnWrapperStyle, type GetRenderedItem, type GetRenderedItemResult, type InternalState, LegendList, type LegendListProps, type LegendListPropsBase, type LegendListRecyclingState, type LegendListRef, type LegendListRenderItemProps, type MaintainScrollAtEndOptions, type OnViewableItemsChanged, type ScrollIndexWithOffset, type ScrollIndexWithOffsetPosition, type ScrollState, type ScrollTarget, type ThresholdSnapshot, type TypedForwardRef, type TypedMemo, type ViewAmountToken, type ViewToken, type ViewabilityAmountCallback, type ViewabilityCallback, type ViewabilityConfig, type ViewabilityConfigCallbackPair, type ViewabilityConfigCallbackPairs, type ViewableRange, typedForwardRef, typedMemo, useIsLastItem, useListScrollSize, useRecyclingEffect, useRecyclingState, useSyncLayout, useViewability, useViewabilityAmount };
|
package/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import Animated$1 from 'react-native-reanimated';
|
|
|
5
5
|
|
|
6
6
|
type AnimatedValue = number;
|
|
7
7
|
|
|
8
|
-
type ListenerType = "numContainers" | "numContainersPooled" | `containerItemKey${number}` | `containerItemData${number}` | `containerPosition${number}` | `containerColumn${number}` | `containerSticky${number}` | `containerStickyOffset${number}` | "containersDidLayout" | "extraData" | "numColumns" | "lastItemKeys" | "totalSize" | "alignItemsPaddingTop" | "stylePaddingTop" | "scrollAdjust" | "scrollAdjustUserOffset" | "headerSize" | "footerSize" | "maintainVisibleContentPosition" | "debugRawScroll" | "debugComputedScroll" | "otherAxisSize" | "snapToOffsets" | "scrollSize" | "
|
|
8
|
+
type ListenerType = "numContainers" | "numContainersPooled" | `containerItemKey${number}` | `containerItemData${number}` | `containerPosition${number}` | `containerColumn${number}` | `containerSticky${number}` | `containerStickyOffset${number}` | "containersDidLayout" | "extraData" | "numColumns" | "lastItemKeys" | "totalSize" | "alignItemsPaddingTop" | "lastPositionUpdate" | "stylePaddingTop" | "scrollAdjust" | "scrollAdjustUserOffset" | "scrollAdjustPending" | "scrollingTo" | "headerSize" | "footerSize" | "maintainVisibleContentPosition" | "debugRawScroll" | "debugComputedScroll" | "otherAxisSize" | "snapToOffsets" | "scrollSize" | "activeStickyIndex";
|
|
9
9
|
interface StateContext {
|
|
10
10
|
internalState: InternalState | undefined;
|
|
11
11
|
listeners: Map<ListenerType, Set<(value: any) => void>>;
|
|
@@ -28,6 +28,7 @@ interface StateContext {
|
|
|
28
28
|
|
|
29
29
|
declare class ScrollAdjustHandler {
|
|
30
30
|
private appliedAdjust;
|
|
31
|
+
private pendingAdjust;
|
|
31
32
|
private context;
|
|
32
33
|
private mounted;
|
|
33
34
|
constructor(ctx: StateContext);
|
|
@@ -211,6 +212,13 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
|
|
|
211
212
|
* @default 0.5
|
|
212
213
|
*/
|
|
213
214
|
onStartReachedThreshold?: number | null | undefined;
|
|
215
|
+
/**
|
|
216
|
+
* Called when the sticky header changes.
|
|
217
|
+
*/
|
|
218
|
+
onStickyHeaderChange?: (info: {
|
|
219
|
+
index: number;
|
|
220
|
+
item: any;
|
|
221
|
+
}) => void;
|
|
214
222
|
/**
|
|
215
223
|
* Called when the viewability of items changes.
|
|
216
224
|
*/
|
|
@@ -270,7 +278,7 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
|
|
|
270
278
|
*/
|
|
271
279
|
stickyIndices?: number[];
|
|
272
280
|
getItemType?: (item: ItemT, index: number) => TItemType;
|
|
273
|
-
getFixedItemSize?: (index: number, item: ItemT, type: TItemType) => number;
|
|
281
|
+
getFixedItemSize?: (index: number, item: ItemT, type: TItemType) => number | undefined;
|
|
274
282
|
itemsAreEqual?: (itemPrevious: ItemT, item: ItemT, index: number, data: readonly ItemT[]) => boolean;
|
|
275
283
|
}
|
|
276
284
|
type LegendListPropsBase<ItemT, TScrollView extends ComponentProps<typeof ScrollView> | ComponentProps<typeof Animated.ScrollView> | ComponentProps<typeof Animated$1.ScrollView>, TItemType extends string | undefined = string | undefined> = BaseScrollViewProps<TScrollView> & LegendListSpecificProps<ItemT, TItemType> & (DataModeProps<ItemT, TItemType> | ChildrenModeProps);
|
|
@@ -285,6 +293,20 @@ interface ColumnWrapperStyle {
|
|
|
285
293
|
columnGap?: number;
|
|
286
294
|
}
|
|
287
295
|
type LegendListProps<ItemT = any> = LegendListPropsBase<ItemT, ComponentProps<typeof ScrollView>>;
|
|
296
|
+
interface ThresholdSnapshot {
|
|
297
|
+
scrollPosition: number;
|
|
298
|
+
contentSize?: number;
|
|
299
|
+
dataLength?: number;
|
|
300
|
+
atThreshold: boolean;
|
|
301
|
+
}
|
|
302
|
+
interface ScrollTarget {
|
|
303
|
+
offset: number;
|
|
304
|
+
index?: number;
|
|
305
|
+
viewOffset?: number;
|
|
306
|
+
viewPosition?: number;
|
|
307
|
+
animated?: boolean;
|
|
308
|
+
isInitialScroll?: boolean;
|
|
309
|
+
}
|
|
288
310
|
interface InternalState {
|
|
289
311
|
positions: Map<string, number>;
|
|
290
312
|
columns: Map<string, number>;
|
|
@@ -318,14 +340,15 @@ interface InternalState {
|
|
|
318
340
|
timeoutSizeMessage: any;
|
|
319
341
|
nativeMarginTop: number;
|
|
320
342
|
indexByKey: Map<string, number>;
|
|
321
|
-
idCache:
|
|
343
|
+
idCache: string[];
|
|
322
344
|
viewabilityConfigCallbackPairs: ViewabilityConfigCallbackPairs<any> | undefined;
|
|
323
345
|
scrollHistory: Array<{
|
|
324
346
|
scroll: number;
|
|
325
347
|
time: number;
|
|
326
348
|
}>;
|
|
327
|
-
|
|
328
|
-
|
|
349
|
+
lastScrollAdjustForHistory?: number;
|
|
350
|
+
startReachedSnapshot: ThresholdSnapshot | undefined;
|
|
351
|
+
endReachedSnapshot: ThresholdSnapshot | undefined;
|
|
329
352
|
scrollForNextCalculateItemsInView: {
|
|
330
353
|
top: number;
|
|
331
354
|
bottom: number;
|
|
@@ -334,19 +357,14 @@ interface InternalState {
|
|
|
334
357
|
minIndexSizeChanged: number | undefined;
|
|
335
358
|
queuedInitialLayout?: boolean | undefined;
|
|
336
359
|
queuedCalculateItemsInView: number | undefined;
|
|
360
|
+
dataChangeNeedsScrollUpdate: boolean;
|
|
337
361
|
lastBatchingAction: number;
|
|
338
362
|
ignoreScrollFromMVCP?: {
|
|
339
363
|
lt?: number;
|
|
340
364
|
gt?: number;
|
|
341
365
|
};
|
|
366
|
+
ignoreScrollFromMVCPIgnored?: boolean;
|
|
342
367
|
ignoreScrollFromMVCPTimeout?: any;
|
|
343
|
-
scrollingTo?: {
|
|
344
|
-
offset: number;
|
|
345
|
-
index?: number;
|
|
346
|
-
viewOffset?: number;
|
|
347
|
-
viewPosition?: number;
|
|
348
|
-
animated?: boolean;
|
|
349
|
-
} | undefined;
|
|
350
368
|
needsOtherAxisSize?: boolean;
|
|
351
369
|
averageSizes: Record<string, {
|
|
352
370
|
num: number;
|
|
@@ -361,7 +379,6 @@ interface InternalState {
|
|
|
361
379
|
stickyContainers: Map<number, number>;
|
|
362
380
|
stickyContainerPool: Set<number>;
|
|
363
381
|
scrollProcessingEnabled: boolean;
|
|
364
|
-
onScrollRafScheduled?: boolean;
|
|
365
382
|
props: {
|
|
366
383
|
alignItemsAtEnd: boolean;
|
|
367
384
|
data: readonly any[];
|
|
@@ -381,6 +398,7 @@ interface InternalState {
|
|
|
381
398
|
onScroll: LegendListProps["onScroll"];
|
|
382
399
|
onStartReached: LegendListProps["onStartReached"];
|
|
383
400
|
onStartReachedThreshold: number | null | undefined;
|
|
401
|
+
onStickyHeaderChange: LegendListProps["onStickyHeaderChange"];
|
|
384
402
|
recycleItems: boolean;
|
|
385
403
|
suggestEstimatedItemSize: boolean;
|
|
386
404
|
stylePaddingBottom: number | undefined;
|
|
@@ -412,6 +430,7 @@ interface LegendListRenderItemProps<ItemT, TItemType extends string | number | u
|
|
|
412
430
|
extraData: any;
|
|
413
431
|
}
|
|
414
432
|
type ScrollState = {
|
|
433
|
+
activeStickyIndex: number | undefined;
|
|
415
434
|
contentLength: number;
|
|
416
435
|
data: readonly any[];
|
|
417
436
|
end: number;
|
|
@@ -542,7 +561,7 @@ interface ViewAmountToken<ItemT = any> extends ViewToken<ItemT> {
|
|
|
542
561
|
percentOfScroller: number;
|
|
543
562
|
scrollSize: number;
|
|
544
563
|
}
|
|
545
|
-
interface ViewabilityConfigCallbackPair<ItemT> {
|
|
564
|
+
interface ViewabilityConfigCallbackPair<ItemT = any> {
|
|
546
565
|
viewabilityConfig: ViewabilityConfig;
|
|
547
566
|
onViewableItemsChanged?: OnViewableItemsChanged<ItemT>;
|
|
548
567
|
}
|
|
@@ -623,4 +642,4 @@ declare function useListScrollSize(): {
|
|
|
623
642
|
};
|
|
624
643
|
declare function useSyncLayout(): () => void;
|
|
625
644
|
|
|
626
|
-
export { type ColumnWrapperStyle, type GetRenderedItem, type GetRenderedItemResult, type InternalState, LegendList, type LegendListProps, type LegendListPropsBase, type LegendListRecyclingState, type LegendListRef, type LegendListRenderItemProps, type MaintainScrollAtEndOptions, type OnViewableItemsChanged, type ScrollIndexWithOffset, type ScrollIndexWithOffsetPosition, type ScrollState, type TypedForwardRef, type TypedMemo, type ViewAmountToken, type ViewToken, type ViewabilityAmountCallback, type ViewabilityCallback, type ViewabilityConfig, type ViewabilityConfigCallbackPair, type ViewabilityConfigCallbackPairs, type ViewableRange, typedForwardRef, typedMemo, useIsLastItem, useListScrollSize, useRecyclingEffect, useRecyclingState, useSyncLayout, useViewability, useViewabilityAmount };
|
|
645
|
+
export { type ColumnWrapperStyle, type GetRenderedItem, type GetRenderedItemResult, type InternalState, LegendList, type LegendListProps, type LegendListPropsBase, type LegendListRecyclingState, type LegendListRef, type LegendListRenderItemProps, type MaintainScrollAtEndOptions, type OnViewableItemsChanged, type ScrollIndexWithOffset, type ScrollIndexWithOffsetPosition, type ScrollState, type ScrollTarget, type ThresholdSnapshot, type TypedForwardRef, type TypedMemo, type ViewAmountToken, type ViewToken, type ViewabilityAmountCallback, type ViewabilityCallback, type ViewabilityConfig, type ViewabilityConfigCallbackPair, type ViewabilityConfigCallbackPairs, type ViewableRange, typedForwardRef, typedMemo, useIsLastItem, useListScrollSize, useRecyclingEffect, useRecyclingState, useSyncLayout, useViewability, useViewabilityAmount };
|