@legendapp/list 2.0.0-beta.3 → 2.0.0-beta.5

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/.DS_Store ADDED
Binary file
package/index.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as React$1 from 'react';
2
2
  import { ComponentProps, ReactNode, Dispatch, SetStateAction } from 'react';
3
- import { View, Animated, ScrollView, LayoutRectangle, ScrollViewComponent, ScrollResponderMixin, StyleProp, ViewStyle, ScrollViewProps } from 'react-native';
3
+ import { View, Animated, ScrollView, LayoutRectangle, ScrollViewComponent, ScrollResponderMixin, StyleProp, ViewStyle, NativeSyntheticEvent, NativeScrollEvent, ScrollViewProps } from 'react-native';
4
4
  import Animated$1 from 'react-native-reanimated';
5
5
 
6
6
  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";
@@ -30,9 +30,10 @@ declare class ScrollAdjustHandler {
30
30
  constructor(ctx: StateContext);
31
31
  requestAdjust(add: number): void;
32
32
  setMounted(): void;
33
+ getAdjust(): number;
33
34
  }
34
35
 
35
- type BaseScrollViewProps<TScrollView> = Omit<TScrollView, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices" | "removeClippedSubviews" | "children">;
36
+ type BaseScrollViewProps<TScrollView> = Omit<TScrollView, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices" | "removeClippedSubviews" | "children" | "onScroll">;
36
37
  interface DataModeProps<ItemT, TItemType extends string | undefined> {
37
38
  /**
38
39
  * Array of items to render in the list.
@@ -195,6 +196,7 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
195
196
  * Function to call when the user pulls to refresh.
196
197
  */
197
198
  onRefresh?: () => void;
199
+ onScroll?: (event: NativeSyntheticEvent<NativeScrollEvent>) => void;
198
200
  /**
199
201
  * Called when scrolling reaches the start within onStartReachedThreshold.
200
202
  */
@@ -287,7 +289,6 @@ interface InternalState {
287
289
  sizesKnown: Map<string, number>;
288
290
  containerItemKeys: Set<string>;
289
291
  containerItemTypes: Map<number, string>;
290
- pendingAdjust: number;
291
292
  isStartReached: boolean;
292
293
  isEndReached: boolean;
293
294
  isAtEnd: boolean;
@@ -352,14 +353,6 @@ interface InternalState {
352
353
  loadStartTime: number;
353
354
  initialScroll: ScrollIndexWithOffset | undefined;
354
355
  lastLayout: LayoutRectangle | undefined;
355
- queuedItemSizeUpdates: {
356
- itemKey: string;
357
- sizeObj: {
358
- width: number;
359
- height: number;
360
- };
361
- }[];
362
- queuedItemSizeUpdatesWaiting?: boolean;
363
356
  timeoutSetPaddingTop?: any;
364
357
  activeStickyIndex: number | undefined;
365
358
  stickyContainers: Map<number, number>;
package/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as React$1 from 'react';
2
2
  import { ComponentProps, ReactNode, Dispatch, SetStateAction } from 'react';
3
- import { View, Animated, ScrollView, LayoutRectangle, ScrollViewComponent, ScrollResponderMixin, StyleProp, ViewStyle, ScrollViewProps } from 'react-native';
3
+ import { View, Animated, ScrollView, LayoutRectangle, ScrollViewComponent, ScrollResponderMixin, StyleProp, ViewStyle, NativeSyntheticEvent, NativeScrollEvent, ScrollViewProps } from 'react-native';
4
4
  import Animated$1 from 'react-native-reanimated';
5
5
 
6
6
  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";
@@ -30,9 +30,10 @@ declare class ScrollAdjustHandler {
30
30
  constructor(ctx: StateContext);
31
31
  requestAdjust(add: number): void;
32
32
  setMounted(): void;
33
+ getAdjust(): number;
33
34
  }
34
35
 
35
- type BaseScrollViewProps<TScrollView> = Omit<TScrollView, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices" | "removeClippedSubviews" | "children">;
36
+ type BaseScrollViewProps<TScrollView> = Omit<TScrollView, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices" | "removeClippedSubviews" | "children" | "onScroll">;
36
37
  interface DataModeProps<ItemT, TItemType extends string | undefined> {
37
38
  /**
38
39
  * Array of items to render in the list.
@@ -195,6 +196,7 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
195
196
  * Function to call when the user pulls to refresh.
196
197
  */
197
198
  onRefresh?: () => void;
199
+ onScroll?: (event: NativeSyntheticEvent<NativeScrollEvent>) => void;
198
200
  /**
199
201
  * Called when scrolling reaches the start within onStartReachedThreshold.
200
202
  */
@@ -287,7 +289,6 @@ interface InternalState {
287
289
  sizesKnown: Map<string, number>;
288
290
  containerItemKeys: Set<string>;
289
291
  containerItemTypes: Map<number, string>;
290
- pendingAdjust: number;
291
292
  isStartReached: boolean;
292
293
  isEndReached: boolean;
293
294
  isAtEnd: boolean;
@@ -352,14 +353,6 @@ interface InternalState {
352
353
  loadStartTime: number;
353
354
  initialScroll: ScrollIndexWithOffset | undefined;
354
355
  lastLayout: LayoutRectangle | undefined;
355
- queuedItemSizeUpdates: {
356
- itemKey: string;
357
- sizeObj: {
358
- width: number;
359
- height: number;
360
- };
361
- }[];
362
- queuedItemSizeUpdatesWaiting?: boolean;
363
356
  timeoutSetPaddingTop?: any;
364
357
  activeStickyIndex: number | undefined;
365
358
  stickyContainers: Map<number, number>;