@legendapp/list 3.3.1 → 3.3.3

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 CHANGED
@@ -1,3 +1,19 @@
1
+ ## 3.3.3
2
+
3
+ - Fix: Row measurements are applied together in a batch, so item positions don't sometimes move after rendering.
4
+ - Fix: `onStartReached` and `onEndReached` no longer bounce between opposite edges during the same scroll gesture after data changes, MVCP adjustments, or residual scroll events.
5
+ - Fix: Prepending items with `maintainVisibleContentPosition` was sometimes flashing the wrong items for one frame
6
+ - Fix: SectionList sticky headers follow their current positions after section data changes. #445
7
+ - Fix: `LegendList` can now be wrapped with `Animated.createAnimatedComponent`.
8
+ - Fix: Horizontal web lists keep their calculated content width, so item containers do not shrink when the content is wider than the viewport.
9
+ - Perf: Lists reuse inactive containers across item types before creating more, preventing the container pool from growing for every previously seen item type.
10
+ - Perf: Reanimated lists skip scroll-offset tracking when neither shared scroll values nor sticky headers need it.
11
+
12
+ ## 3.3.2
13
+
14
+ - Perf: Recycled rows update their current item without changing the container context, so recycling hooks avoid extra rerenders during scroll.
15
+ - Perf: Internal signal hooks recreate subscriptions less often
16
+
1
17
  ## 3.3.1
2
18
 
3
19
  - Perf: Animated `scrollToIndex` and `scrollToOffset` calls now mount the destination rows before native scrolling starts, so long programmatic jumps are less likely to show blank space at the target.
package/animated.d.ts CHANGED
@@ -8,12 +8,13 @@ interface MaintainVisibleContentPositionNormalized<ItemT = any> {
8
8
  shouldRestorePosition?: (item: ItemT, index: number, data: readonly ItemT[]) => boolean;
9
9
  }
10
10
 
11
- type ListenerType = "activeStickyIndex" | "alignItemsAtEndPadding" | "anchoredEndSpaceSize" | "debugComputedScroll" | "debugRawScroll" | "extraData" | "footerSize" | "headerSize" | "lastItemKeys" | "lastPositionUpdate" | "maintainVisibleContentPosition" | "numColumns" | "numContainers" | "numContainersPooled" | "otherAxisSize" | "readyToRender" | "scrollAdjust" | "scrollAdjustPending" | "scrollAdjustUserOffset" | "scrollSize" | "snapToOffsets" | "stylePaddingTop" | "totalSize" | "isAtEnd" | "isAtStart" | "isNearEnd" | "isNearStart" | "isWithinMaintainScrollAtEndThreshold" | "adaptiveRender" | `containerColumn${number}` | `containerSpan${number}` | `containerItemData${number}` | `containerItemKey${number}` | `containerPosition${number}` | `containerSticky${number}`;
11
+ type ListenerType = "activeStickyIndex" | "alignItemsAtEndPadding" | "anchoredEndSpaceSize" | "containerLayoutEpoch" | "debugComputedScroll" | "debugRawScroll" | "extraData" | "footerSize" | "headerSize" | "lastItemKeys" | "lastPositionUpdate" | "maintainVisibleContentPosition" | "numColumns" | "numContainers" | "numContainersPooled" | "otherAxisSize" | "readyToRender" | "scrollAdjust" | "scrollAdjustPending" | "scrollAdjustUserOffset" | "scrollSize" | "snapToOffsets" | "stylePaddingTop" | "totalSize" | "isAtEnd" | "isAtStart" | "isNearEnd" | "isNearStart" | "isWithinMaintainScrollAtEndThreshold" | "adaptiveRender" | `containerColumn${number}` | `containerSpan${number}` | `containerItemData${number}` | `containerItemIndex${number}` | `containerItemKey${number}` | `containerPosition${number}` | `containerSticky${number}`;
12
12
  type LegendListListenerType = Extract<ListenerType, "activeStickyIndex" | "anchoredEndSpaceSize" | "footerSize" | "headerSize" | "isAtEnd" | "isAtStart" | "isNearEnd" | "isNearStart" | "isWithinMaintainScrollAtEndThreshold" | "adaptiveRender" | "lastItemKeys" | "lastPositionUpdate" | "numContainers" | "numContainersPooled" | "otherAxisSize" | "readyToRender" | "snapToOffsets" | "totalSize">;
13
13
  type ListenerTypeValueMap = {
14
14
  activeStickyIndex: number;
15
15
  alignItemsAtEndPadding: number;
16
16
  anchoredEndSpaceSize: number;
17
+ containerLayoutEpoch: number;
17
18
  animatedScrollY: any;
18
19
  debugComputedScroll: number;
19
20
  debugRawScroll: number;
@@ -48,6 +49,8 @@ type ListenerTypeValueMap = {
48
49
  [K in ListenerType as K extends `containerItemKey${number}` ? K : never]: string;
49
50
  } & {
50
51
  [K in ListenerType as K extends `containerItemData${number}` ? K : never]: any;
52
+ } & {
53
+ [K in ListenerType as K extends `containerItemIndex${number}` ? K : never]: number;
51
54
  } & {
52
55
  [K in ListenerType as K extends `containerPosition${number}` ? K : never]: number;
53
56
  } & {
@@ -560,6 +563,10 @@ type LegendListRef$1 = {
560
563
  * Returns the native ScrollView component reference.
561
564
  */
562
565
  getNativeScrollRef(): any;
566
+ /**
567
+ * Returns the underlying animatable scroll component reference.
568
+ */
569
+ getAnimatableRef(): any;
563
570
  /**
564
571
  * Returns the scroll responder instance for handling scroll events.
565
572
  */
@@ -719,7 +726,8 @@ type LegendListPropsOverrides<ItemT, TItemType extends string | undefined> = Omi
719
726
  ListFooterComponentStyle?: StyleProp$1<ViewStyle$1> | undefined;
720
727
  };
721
728
  type LegendListProps<ItemT = any, TItemType extends string | undefined = string | undefined> = LegendListPropsOverrides<ItemT, TItemType>;
722
- type LegendListRef = Omit<LegendListRef$1, "getNativeScrollRef" | "getScrollResponder" | "reportContentInset"> & {
729
+ type LegendListRef = Omit<LegendListRef$1, "getAnimatableRef" | "getNativeScrollRef" | "getScrollResponder" | "reportContentInset"> & {
730
+ getAnimatableRef(): React.ElementRef<typeof ScrollViewComponent>;
723
731
  getNativeScrollRef(): React.ElementRef<typeof ScrollViewComponent>;
724
732
  getScrollResponder(): ScrollResponderMixin;
725
733
  reportContentInset(inset?: Partial<Insets$1> | null): void;
@@ -9,12 +9,13 @@ interface MaintainVisibleContentPositionNormalized<ItemT = any> {
9
9
  shouldRestorePosition?: (item: ItemT, index: number, data: readonly ItemT[]) => boolean;
10
10
  }
11
11
 
12
- type ListenerType = "activeStickyIndex" | "alignItemsAtEndPadding" | "anchoredEndSpaceSize" | "debugComputedScroll" | "debugRawScroll" | "extraData" | "footerSize" | "headerSize" | "lastItemKeys" | "lastPositionUpdate" | "maintainVisibleContentPosition" | "numColumns" | "numContainers" | "numContainersPooled" | "otherAxisSize" | "readyToRender" | "scrollAdjust" | "scrollAdjustPending" | "scrollAdjustUserOffset" | "scrollSize" | "snapToOffsets" | "stylePaddingTop" | "totalSize" | "isAtEnd" | "isAtStart" | "isNearEnd" | "isNearStart" | "isWithinMaintainScrollAtEndThreshold" | "adaptiveRender" | `containerColumn${number}` | `containerSpan${number}` | `containerItemData${number}` | `containerItemKey${number}` | `containerPosition${number}` | `containerSticky${number}`;
12
+ type ListenerType = "activeStickyIndex" | "alignItemsAtEndPadding" | "anchoredEndSpaceSize" | "containerLayoutEpoch" | "debugComputedScroll" | "debugRawScroll" | "extraData" | "footerSize" | "headerSize" | "lastItemKeys" | "lastPositionUpdate" | "maintainVisibleContentPosition" | "numColumns" | "numContainers" | "numContainersPooled" | "otherAxisSize" | "readyToRender" | "scrollAdjust" | "scrollAdjustPending" | "scrollAdjustUserOffset" | "scrollSize" | "snapToOffsets" | "stylePaddingTop" | "totalSize" | "isAtEnd" | "isAtStart" | "isNearEnd" | "isNearStart" | "isWithinMaintainScrollAtEndThreshold" | "adaptiveRender" | `containerColumn${number}` | `containerSpan${number}` | `containerItemData${number}` | `containerItemIndex${number}` | `containerItemKey${number}` | `containerPosition${number}` | `containerSticky${number}`;
13
13
  type LegendListListenerType = Extract<ListenerType, "activeStickyIndex" | "anchoredEndSpaceSize" | "footerSize" | "headerSize" | "isAtEnd" | "isAtStart" | "isNearEnd" | "isNearStart" | "isWithinMaintainScrollAtEndThreshold" | "adaptiveRender" | "lastItemKeys" | "lastPositionUpdate" | "numContainers" | "numContainersPooled" | "otherAxisSize" | "readyToRender" | "snapToOffsets" | "totalSize">;
14
14
  type ListenerTypeValueMap = {
15
15
  activeStickyIndex: number;
16
16
  alignItemsAtEndPadding: number;
17
17
  anchoredEndSpaceSize: number;
18
+ containerLayoutEpoch: number;
18
19
  animatedScrollY: any;
19
20
  debugComputedScroll: number;
20
21
  debugRawScroll: number;
@@ -49,6 +50,8 @@ type ListenerTypeValueMap = {
49
50
  [K in ListenerType as K extends `containerItemKey${number}` ? K : never]: string;
50
51
  } & {
51
52
  [K in ListenerType as K extends `containerItemData${number}` ? K : never]: any;
53
+ } & {
54
+ [K in ListenerType as K extends `containerItemIndex${number}` ? K : never]: number;
52
55
  } & {
53
56
  [K in ListenerType as K extends `containerPosition${number}` ? K : never]: number;
54
57
  } & {
@@ -123,6 +126,10 @@ type LegendListRef$1 = {
123
126
  * Returns the native ScrollView component reference.
124
127
  */
125
128
  getNativeScrollRef(): any;
129
+ /**
130
+ * Returns the underlying animatable scroll component reference.
131
+ */
132
+ getAnimatableRef(): any;
126
133
  /**
127
134
  * Returns the scroll responder instance for handling scroll events.
128
135
  */
@@ -224,7 +231,8 @@ type LegendListRef$1 = {
224
231
  setVisibleContentAnchorOffset(value: number | ((val: number) => number)): void;
225
232
  };
226
233
 
227
- type LegendListRef = Omit<LegendListRef$1, "getNativeScrollRef" | "getScrollResponder" | "reportContentInset"> & {
234
+ type LegendListRef = Omit<LegendListRef$1, "getAnimatableRef" | "getNativeScrollRef" | "getScrollResponder" | "reportContentInset"> & {
235
+ getAnimatableRef(): React.ElementRef<typeof ScrollViewComponent>;
228
236
  getNativeScrollRef(): React.ElementRef<typeof ScrollViewComponent>;
229
237
  getScrollResponder(): ScrollResponderMixin;
230
238
  reportContentInset(inset?: Partial<Insets$1> | null): void;
package/keyboard.d.ts CHANGED
@@ -10,12 +10,13 @@ interface MaintainVisibleContentPositionNormalized<ItemT = any> {
10
10
  shouldRestorePosition?: (item: ItemT, index: number, data: readonly ItemT[]) => boolean;
11
11
  }
12
12
 
13
- type ListenerType = "activeStickyIndex" | "alignItemsAtEndPadding" | "anchoredEndSpaceSize" | "debugComputedScroll" | "debugRawScroll" | "extraData" | "footerSize" | "headerSize" | "lastItemKeys" | "lastPositionUpdate" | "maintainVisibleContentPosition" | "numColumns" | "numContainers" | "numContainersPooled" | "otherAxisSize" | "readyToRender" | "scrollAdjust" | "scrollAdjustPending" | "scrollAdjustUserOffset" | "scrollSize" | "snapToOffsets" | "stylePaddingTop" | "totalSize" | "isAtEnd" | "isAtStart" | "isNearEnd" | "isNearStart" | "isWithinMaintainScrollAtEndThreshold" | "adaptiveRender" | `containerColumn${number}` | `containerSpan${number}` | `containerItemData${number}` | `containerItemKey${number}` | `containerPosition${number}` | `containerSticky${number}`;
13
+ type ListenerType = "activeStickyIndex" | "alignItemsAtEndPadding" | "anchoredEndSpaceSize" | "containerLayoutEpoch" | "debugComputedScroll" | "debugRawScroll" | "extraData" | "footerSize" | "headerSize" | "lastItemKeys" | "lastPositionUpdate" | "maintainVisibleContentPosition" | "numColumns" | "numContainers" | "numContainersPooled" | "otherAxisSize" | "readyToRender" | "scrollAdjust" | "scrollAdjustPending" | "scrollAdjustUserOffset" | "scrollSize" | "snapToOffsets" | "stylePaddingTop" | "totalSize" | "isAtEnd" | "isAtStart" | "isNearEnd" | "isNearStart" | "isWithinMaintainScrollAtEndThreshold" | "adaptiveRender" | `containerColumn${number}` | `containerSpan${number}` | `containerItemData${number}` | `containerItemIndex${number}` | `containerItemKey${number}` | `containerPosition${number}` | `containerSticky${number}`;
14
14
  type LegendListListenerType = Extract<ListenerType, "activeStickyIndex" | "anchoredEndSpaceSize" | "footerSize" | "headerSize" | "isAtEnd" | "isAtStart" | "isNearEnd" | "isNearStart" | "isWithinMaintainScrollAtEndThreshold" | "adaptiveRender" | "lastItemKeys" | "lastPositionUpdate" | "numContainers" | "numContainersPooled" | "otherAxisSize" | "readyToRender" | "snapToOffsets" | "totalSize">;
15
15
  type ListenerTypeValueMap = {
16
16
  activeStickyIndex: number;
17
17
  alignItemsAtEndPadding: number;
18
18
  anchoredEndSpaceSize: number;
19
+ containerLayoutEpoch: number;
19
20
  animatedScrollY: any;
20
21
  debugComputedScroll: number;
21
22
  debugRawScroll: number;
@@ -50,6 +51,8 @@ type ListenerTypeValueMap = {
50
51
  [K in ListenerType as K extends `containerItemKey${number}` ? K : never]: string;
51
52
  } & {
52
53
  [K in ListenerType as K extends `containerItemData${number}` ? K : never]: any;
54
+ } & {
55
+ [K in ListenerType as K extends `containerItemIndex${number}` ? K : never]: number;
53
56
  } & {
54
57
  [K in ListenerType as K extends `containerPosition${number}` ? K : never]: number;
55
58
  } & {
@@ -137,6 +140,10 @@ type LegendListRef$1 = {
137
140
  * Returns the native ScrollView component reference.
138
141
  */
139
142
  getNativeScrollRef(): any;
143
+ /**
144
+ * Returns the underlying animatable scroll component reference.
145
+ */
146
+ getAnimatableRef(): any;
140
147
  /**
141
148
  * Returns the scroll responder instance for handling scroll events.
142
149
  */
@@ -241,7 +248,8 @@ type LegendListRef$1 = {
241
248
  interface AnchoredEndSpaceConfig extends Omit<AnchoredEndSpaceConfig$1, "includeInEndInset"> {
242
249
  }
243
250
 
244
- type LegendListRef = Omit<LegendListRef$1, "getNativeScrollRef" | "getScrollResponder" | "reportContentInset"> & {
251
+ type LegendListRef = Omit<LegendListRef$1, "getAnimatableRef" | "getNativeScrollRef" | "getScrollResponder" | "reportContentInset"> & {
252
+ getAnimatableRef(): React.ElementRef<typeof ScrollViewComponent>;
245
253
  getNativeScrollRef(): React.ElementRef<typeof ScrollViewComponent>;
246
254
  getScrollResponder(): ScrollResponderMixin;
247
255
  reportContentInset(inset?: Partial<Insets$1> | null): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@legendapp/list",
3
- "version": "3.3.1",
3
+ "version": "3.3.3",
4
4
  "description": "Legend List is a drop-in replacement for FlatList with much better performance and supporting dynamically sized items.",
5
5
  "sideEffects": false,
6
6
  "private": false,
package/react-native.d.ts CHANGED
@@ -8,12 +8,13 @@ interface MaintainVisibleContentPositionNormalized<ItemT = any> {
8
8
  shouldRestorePosition?: (item: ItemT, index: number, data: readonly ItemT[]) => boolean;
9
9
  }
10
10
 
11
- type ListenerType = "activeStickyIndex" | "alignItemsAtEndPadding" | "anchoredEndSpaceSize" | "debugComputedScroll" | "debugRawScroll" | "extraData" | "footerSize" | "headerSize" | "lastItemKeys" | "lastPositionUpdate" | "maintainVisibleContentPosition" | "numColumns" | "numContainers" | "numContainersPooled" | "otherAxisSize" | "readyToRender" | "scrollAdjust" | "scrollAdjustPending" | "scrollAdjustUserOffset" | "scrollSize" | "snapToOffsets" | "stylePaddingTop" | "totalSize" | "isAtEnd" | "isAtStart" | "isNearEnd" | "isNearStart" | "isWithinMaintainScrollAtEndThreshold" | "adaptiveRender" | `containerColumn${number}` | `containerSpan${number}` | `containerItemData${number}` | `containerItemKey${number}` | `containerPosition${number}` | `containerSticky${number}`;
11
+ type ListenerType = "activeStickyIndex" | "alignItemsAtEndPadding" | "anchoredEndSpaceSize" | "containerLayoutEpoch" | "debugComputedScroll" | "debugRawScroll" | "extraData" | "footerSize" | "headerSize" | "lastItemKeys" | "lastPositionUpdate" | "maintainVisibleContentPosition" | "numColumns" | "numContainers" | "numContainersPooled" | "otherAxisSize" | "readyToRender" | "scrollAdjust" | "scrollAdjustPending" | "scrollAdjustUserOffset" | "scrollSize" | "snapToOffsets" | "stylePaddingTop" | "totalSize" | "isAtEnd" | "isAtStart" | "isNearEnd" | "isNearStart" | "isWithinMaintainScrollAtEndThreshold" | "adaptiveRender" | `containerColumn${number}` | `containerSpan${number}` | `containerItemData${number}` | `containerItemIndex${number}` | `containerItemKey${number}` | `containerPosition${number}` | `containerSticky${number}`;
12
12
  type LegendListListenerType = Extract<ListenerType, "activeStickyIndex" | "anchoredEndSpaceSize" | "footerSize" | "headerSize" | "isAtEnd" | "isAtStart" | "isNearEnd" | "isNearStart" | "isWithinMaintainScrollAtEndThreshold" | "adaptiveRender" | "lastItemKeys" | "lastPositionUpdate" | "numContainers" | "numContainersPooled" | "otherAxisSize" | "readyToRender" | "snapToOffsets" | "totalSize">;
13
13
  type ListenerTypeValueMap = {
14
14
  activeStickyIndex: number;
15
15
  alignItemsAtEndPadding: number;
16
16
  anchoredEndSpaceSize: number;
17
+ containerLayoutEpoch: number;
17
18
  animatedScrollY: any;
18
19
  debugComputedScroll: number;
19
20
  debugRawScroll: number;
@@ -48,6 +49,8 @@ type ListenerTypeValueMap = {
48
49
  [K in ListenerType as K extends `containerItemKey${number}` ? K : never]: string;
49
50
  } & {
50
51
  [K in ListenerType as K extends `containerItemData${number}` ? K : never]: any;
52
+ } & {
53
+ [K in ListenerType as K extends `containerItemIndex${number}` ? K : never]: number;
51
54
  } & {
52
55
  [K in ListenerType as K extends `containerPosition${number}` ? K : never]: number;
53
56
  } & {
@@ -560,6 +563,10 @@ type LegendListRef$1 = {
560
563
  * Returns the native ScrollView component reference.
561
564
  */
562
565
  getNativeScrollRef(): any;
566
+ /**
567
+ * Returns the underlying animatable scroll component reference.
568
+ */
569
+ getAnimatableRef(): any;
563
570
  /**
564
571
  * Returns the scroll responder instance for handling scroll events.
565
572
  */
@@ -745,7 +752,8 @@ type LegendListPropsOverrides<ItemT, TItemType extends string | undefined> = Omi
745
752
  ListFooterComponentStyle?: StyleProp$1<ViewStyle$1> | undefined;
746
753
  };
747
754
  type LegendListProps<ItemT = any, TItemType extends string | undefined = string | undefined> = LegendListPropsOverrides<ItemT, TItemType>;
748
- type LegendListRef = Omit<LegendListRef$1, "getNativeScrollRef" | "getScrollResponder" | "reportContentInset"> & {
755
+ type LegendListRef = Omit<LegendListRef$1, "getAnimatableRef" | "getNativeScrollRef" | "getScrollResponder" | "reportContentInset"> & {
756
+ getAnimatableRef(): React.ElementRef<typeof ScrollViewComponent>;
749
757
  getNativeScrollRef(): React.ElementRef<typeof ScrollViewComponent>;
750
758
  getScrollResponder(): ScrollResponderMixin;
751
759
  reportContentInset(inset?: Partial<Insets$1> | null): void;