@legendapp/list 3.0.0-beta.40 → 3.0.0-beta.41
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/README.md +1 -1
- package/animated.d.ts +16 -3
- package/index.d.ts +40 -5
- package/index.js +732 -204
- package/index.mjs +732 -204
- package/index.native.js +782 -288
- package/index.native.mjs +782 -288
- package/package.json +14 -4
- package/react-native.d.ts +38 -5
- package/react-native.js +779 -281
- package/react-native.mjs +779 -281
- package/react-native.web.d.ts +1005 -0
- package/react-native.web.js +5357 -0
- package/react-native.web.mjs +5326 -0
- package/react.d.ts +38 -5
- package/react.js +751 -206
- package/react.mjs +751 -207
- package/reanimated.d.ts +16 -3
- package/section-list.d.ts +16 -3
package/README.md
CHANGED
|
@@ -26,7 +26,7 @@ Beyond standard `FlatList` capabilities:
|
|
|
26
26
|
* `recycleItems`: (boolean) Toggles item component recycling.
|
|
27
27
|
* `true`: Reuses item components for optimal performance. Be cautious if your item components contain local state, as it might be reused unexpectedly.
|
|
28
28
|
* `false` (default): Creates new item components every time. Less performant but safer if items have complex internal state.
|
|
29
|
-
* `maintainScrollAtEnd`:
|
|
29
|
+
* `maintainScrollAtEnd`: Keeps the list pinned to the tail when the user is already near the end (within `maintainScrollAtEndThreshold * screen height`). Pass `true` for all triggers, or `{ animated?: boolean, on?: { dataChange?: boolean, layout?: boolean, itemLayout?: boolean } }`; if `on` is omitted, the object form also enables all triggers.
|
|
30
30
|
* `maintainVisibleContentPosition`: Keeps visible content steady during size/layout changes while scrolling up or when items resize above the viewport (default). Pass `true` or `{ data: true }` to also anchor during data updates; pass `false` to disable; pass `{ size: false }` to opt out of scroll-time stabilization.
|
|
31
31
|
* `alignItemsAtEnd`: (boolean) Useful for chat UIs, content smaller than the View will be aligned to the bottom of the list.
|
|
32
32
|
|
package/animated.d.ts
CHANGED
|
@@ -210,6 +210,7 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
|
|
|
210
210
|
ListHeaderComponentStyle?: StyleProp<ViewStyle> | undefined;
|
|
211
211
|
/**
|
|
212
212
|
* If true, auto-scrolls to end when new items are added.
|
|
213
|
+
* Use an options object to opt into specific triggers and control whether that scroll is animated.
|
|
213
214
|
* @default false
|
|
214
215
|
*/
|
|
215
216
|
maintainScrollAtEnd?: boolean | MaintainScrollAtEndOptions;
|
|
@@ -387,10 +388,22 @@ interface AlwaysRenderConfig {
|
|
|
387
388
|
indices?: number[];
|
|
388
389
|
keys?: string[];
|
|
389
390
|
}
|
|
391
|
+
interface MaintainScrollAtEndOnOptions {
|
|
392
|
+
dataChange?: boolean;
|
|
393
|
+
itemLayout?: boolean;
|
|
394
|
+
layout?: boolean;
|
|
395
|
+
}
|
|
390
396
|
interface MaintainScrollAtEndOptions {
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
397
|
+
/**
|
|
398
|
+
* Whether maintainScrollAtEnd should animate when it scrolls to the end.
|
|
399
|
+
*/
|
|
400
|
+
animated?: boolean;
|
|
401
|
+
/**
|
|
402
|
+
* Which events should keep the list pinned to the end.
|
|
403
|
+
* - If omitted, object values default to all triggers.
|
|
404
|
+
* - If provided, only the keys set to `true` are enabled.
|
|
405
|
+
*/
|
|
406
|
+
on?: MaintainScrollAtEndOnOptions;
|
|
394
407
|
}
|
|
395
408
|
interface ColumnWrapperStyle {
|
|
396
409
|
rowGap?: number;
|
package/index.d.ts
CHANGED
|
@@ -283,6 +283,7 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
|
|
|
283
283
|
ListHeaderComponentStyle?: StyleProp$1<ViewStyle$1> | undefined;
|
|
284
284
|
/**
|
|
285
285
|
* If true, auto-scrolls to end when new items are added.
|
|
286
|
+
* Use an options object to opt into specific triggers and control whether that scroll is animated.
|
|
286
287
|
* @default false
|
|
287
288
|
*/
|
|
288
289
|
maintainScrollAtEnd?: boolean | MaintainScrollAtEndOptions$1;
|
|
@@ -461,10 +462,22 @@ interface AlwaysRenderConfig$1 {
|
|
|
461
462
|
indices?: number[];
|
|
462
463
|
keys?: string[];
|
|
463
464
|
}
|
|
465
|
+
interface MaintainScrollAtEndOnOptions$1 {
|
|
466
|
+
dataChange?: boolean;
|
|
467
|
+
itemLayout?: boolean;
|
|
468
|
+
layout?: boolean;
|
|
469
|
+
}
|
|
464
470
|
interface MaintainScrollAtEndOptions$1 {
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
471
|
+
/**
|
|
472
|
+
* Whether maintainScrollAtEnd should animate when it scrolls to the end.
|
|
473
|
+
*/
|
|
474
|
+
animated?: boolean;
|
|
475
|
+
/**
|
|
476
|
+
* Which events should keep the list pinned to the end.
|
|
477
|
+
* - If omitted, object values default to all triggers.
|
|
478
|
+
* - If provided, only the keys set to `true` are enabled.
|
|
479
|
+
*/
|
|
480
|
+
on?: MaintainScrollAtEndOnOptions$1;
|
|
468
481
|
}
|
|
469
482
|
interface ColumnWrapperStyle$1 {
|
|
470
483
|
rowGap?: number;
|
|
@@ -488,6 +501,7 @@ interface ScrollTarget$1 {
|
|
|
488
501
|
itemSize?: number;
|
|
489
502
|
offset: number;
|
|
490
503
|
precomputedWithViewOffset?: boolean;
|
|
504
|
+
targetOffset?: number;
|
|
491
505
|
viewOffset?: number;
|
|
492
506
|
viewPosition?: number;
|
|
493
507
|
}
|
|
@@ -525,7 +539,18 @@ interface InternalState$1 {
|
|
|
525
539
|
ignoreScrollFromMVCPTimeout?: any;
|
|
526
540
|
indexByKey: Map<string, number>;
|
|
527
541
|
initialAnchor?: InitialScrollAnchor$1;
|
|
542
|
+
initialNativeScrollWatchdog?: {
|
|
543
|
+
startScroll: number;
|
|
544
|
+
targetOffset: number;
|
|
545
|
+
};
|
|
546
|
+
initialScrollLastDidFinish: boolean;
|
|
547
|
+
initialScrollLastTarget: ScrollIndexWithOffsetAndContentOffset$1 | undefined;
|
|
548
|
+
initialScrollLastTargetUsesOffset: boolean;
|
|
549
|
+
initialScrollPreviousDataLength: number;
|
|
550
|
+
initialScrollRetryLastLength: number | undefined;
|
|
551
|
+
initialScrollRetryWindowUntil: number;
|
|
528
552
|
initialScroll: ScrollIndexWithOffsetAndContentOffset$1 | undefined;
|
|
553
|
+
initialScrollUsesOffset: boolean;
|
|
529
554
|
isAtEnd: boolean;
|
|
530
555
|
isAtStart: boolean;
|
|
531
556
|
isEndReached: boolean | null;
|
|
@@ -549,6 +574,14 @@ interface InternalState$1 {
|
|
|
549
574
|
nativeMarginTop: number;
|
|
550
575
|
needsOtherAxisSize?: boolean;
|
|
551
576
|
otherAxisSize?: number;
|
|
577
|
+
pendingNativeMVCPAdjust?: {
|
|
578
|
+
amount: number;
|
|
579
|
+
closestDistanceToClamp: number;
|
|
580
|
+
hasApproachedClamp: boolean;
|
|
581
|
+
manualApplied: number;
|
|
582
|
+
startScroll: number;
|
|
583
|
+
};
|
|
584
|
+
pendingMaintainScrollAtEnd?: boolean;
|
|
552
585
|
pendingTotalSize?: number;
|
|
553
586
|
pendingScrollResolve?: (() => void) | undefined;
|
|
554
587
|
positions: Array<number | undefined>;
|
|
@@ -613,7 +646,7 @@ interface InternalState$1 {
|
|
|
613
646
|
initialContainerPoolRatio: number;
|
|
614
647
|
itemsAreEqual: LegendListPropsInternal["itemsAreEqual"];
|
|
615
648
|
keyExtractor: LegendListPropsInternal["keyExtractor"];
|
|
616
|
-
maintainScrollAtEnd:
|
|
649
|
+
maintainScrollAtEnd: MaintainScrollAtEndNormalized | undefined;
|
|
617
650
|
maintainScrollAtEndThreshold: number | undefined;
|
|
618
651
|
maintainVisibleContentPosition: MaintainVisibleContentPositionNormalized$1;
|
|
619
652
|
numColumns: number;
|
|
@@ -911,6 +944,8 @@ type StickyHeaderConfig = StickyHeaderConfig$1;
|
|
|
911
944
|
/** @deprecated Use `@legendapp/list/react-native` or `@legendapp/list/react` for strict typing */
|
|
912
945
|
type AlwaysRenderConfig = AlwaysRenderConfig$1;
|
|
913
946
|
/** @deprecated Use `@legendapp/list/react-native` or `@legendapp/list/react` for strict typing */
|
|
947
|
+
type MaintainScrollAtEndOnOptions = MaintainScrollAtEndOnOptions$1;
|
|
948
|
+
/** @deprecated Use `@legendapp/list/react-native` or `@legendapp/list/react` for strict typing */
|
|
914
949
|
type MaintainScrollAtEndOptions = MaintainScrollAtEndOptions$1;
|
|
915
950
|
/** @deprecated Use `@legendapp/list/react-native` or `@legendapp/list/react` for strict typing */
|
|
916
951
|
type ColumnWrapperStyle = ColumnWrapperStyle$1;
|
|
@@ -1201,4 +1236,4 @@ declare function useSyncLayout(): () => void;
|
|
|
1201
1236
|
/** @deprecated Use `@legendapp/list/react-native` or `@legendapp/list/react` for strict typing */
|
|
1202
1237
|
declare const LegendList: LegendListComponent;
|
|
1203
1238
|
|
|
1204
|
-
export { type AccessibilityActionEvent, type AccessibilityRole, type AccessibilityState, type AccessibilityValue, type AlwaysRenderConfig, type BaseScrollViewProps, type ColorValue, type ColumnWrapperStyle, type GestureResponderEvent, type GetRenderedItem, type GetRenderedItemResult, type InitialScrollAnchor, type Insets, type InternalState, type LayoutChangeEvent, type LayoutRectangle, LegendList, type LegendListComponent, type LegendListMetrics, type LegendListProps, type LegendListPropsBase, type LegendListRecyclingState, type LegendListRef, type LegendListRenderItemProps, type LegendListScrollerRef, type LegendListState, type LooseAccessibilityActionEvent, type LooseAccessibilityRole, type LooseAccessibilityState, type LooseAccessibilityValue, type LooseColorValue, type LooseGestureResponderEvent, type LoosePointerEvent, type LooseRefreshControlProps, type LooseRole, type LooseScrollViewProps, type MaintainScrollAtEndOptions, type MaintainVisibleContentPositionConfig, type MaintainVisibleContentPositionNormalized, type NativeScrollEvent, type NativeSyntheticEvent, type OnViewableItemsChanged, type PointProp, type PointerEvent, type RefreshControlProps, type Role, type ScrollEventTargetLike, type ScrollIndexWithOffset, type ScrollIndexWithOffsetAndContentOffset, type ScrollIndexWithOffsetPosition, type ScrollTarget, type ScrollViewPropsLoose, type ScrollableNodeLike, type StickyHeaderConfig, type StyleProp, type ThresholdSnapshot, type TypedForwardRef, type TypedMemo, type ViewAmountToken, type ViewStyle, type ViewToken, type ViewabilityAmountCallback, type ViewabilityCallback, type ViewabilityConfig, type ViewabilityConfigCallbackPair, type ViewabilityConfigCallbackPairs, type ViewableRange, typedForwardRef, typedMemo, useIsLastItem, useListScrollSize, useRecyclingEffect, useRecyclingState, useSyncLayout, useViewability, useViewabilityAmount };
|
|
1239
|
+
export { type AccessibilityActionEvent, type AccessibilityRole, type AccessibilityState, type AccessibilityValue, type AlwaysRenderConfig, type BaseScrollViewProps, type ColorValue, type ColumnWrapperStyle, type GestureResponderEvent, type GetRenderedItem, type GetRenderedItemResult, type InitialScrollAnchor, type Insets, type InternalState, type LayoutChangeEvent, type LayoutRectangle, LegendList, type LegendListComponent, type LegendListMetrics, type LegendListProps, type LegendListPropsBase, type LegendListRecyclingState, type LegendListRef, type LegendListRenderItemProps, type LegendListScrollerRef, type LegendListState, type LooseAccessibilityActionEvent, type LooseAccessibilityRole, type LooseAccessibilityState, type LooseAccessibilityValue, type LooseColorValue, type LooseGestureResponderEvent, type LoosePointerEvent, type LooseRefreshControlProps, type LooseRole, type LooseScrollViewProps, type MaintainScrollAtEndOnOptions, type MaintainScrollAtEndOptions, type MaintainVisibleContentPositionConfig, type MaintainVisibleContentPositionNormalized, type NativeScrollEvent, type NativeSyntheticEvent, type OnViewableItemsChanged, type PointProp, type PointerEvent, type RefreshControlProps, type Role, type ScrollEventTargetLike, type ScrollIndexWithOffset, type ScrollIndexWithOffsetAndContentOffset, type ScrollIndexWithOffsetPosition, type ScrollTarget, type ScrollViewPropsLoose, type ScrollableNodeLike, type StickyHeaderConfig, type StyleProp, type ThresholdSnapshot, type TypedForwardRef, type TypedMemo, type ViewAmountToken, type ViewStyle, type ViewToken, type ViewabilityAmountCallback, type ViewabilityCallback, type ViewabilityConfig, type ViewabilityConfigCallbackPair, type ViewabilityConfigCallbackPairs, type ViewableRange, typedForwardRef, typedMemo, useIsLastItem, useListScrollSize, useRecyclingEffect, useRecyclingState, useSyncLayout, useViewability, useViewabilityAmount };
|