@legendapp/list 3.4.0 → 3.6.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/reanimated.d.ts CHANGED
@@ -226,6 +226,8 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
226
226
  index: number;
227
227
  viewOffset?: number | undefined;
228
228
  viewPosition?: number | undefined;
229
+ /** Alignment used only when the item exceeds the viewport. Omit to preserve viewPosition. */
230
+ viewPositionFallback?: "start" | "end";
229
231
  };
230
232
  /**
231
233
  * Initial scroll position in pixels.
@@ -652,6 +654,8 @@ type LegendListRef$1 = {
652
654
  index: number;
653
655
  viewOffset?: number | undefined;
654
656
  viewPosition?: number | undefined;
657
+ /** Alignment used only when the item exceeds the viewport. Omit to preserve viewPosition. */
658
+ viewPositionFallback?: "start" | "end";
655
659
  }): Promise<void>;
656
660
  /**
657
661
  * Scrolls to a specific item in the list.
@@ -666,6 +670,8 @@ type LegendListRef$1 = {
666
670
  item: any;
667
671
  viewOffset?: number | undefined;
668
672
  viewPosition?: number | undefined;
673
+ /** Alignment used only when the item exceeds the viewport. Omit to preserve viewPosition. */
674
+ viewPositionFallback?: "start" | "end";
669
675
  }): Promise<void>;
670
676
  /**
671
677
  * Scrolls to a specific offset in pixels.
package/section-list.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as react_native from 'react-native';
2
- import { SectionListData, ScrollViewProps, NativeSyntheticEvent as NativeSyntheticEvent$1, NativeScrollEvent as NativeScrollEvent$1, ScrollView, StyleProp as StyleProp$1, ViewStyle as ViewStyle$1, ScrollViewComponent, ScrollResponderMixin, Insets as Insets$1, SectionBase, SectionListRenderItemInfo, SectionListScrollParams } from 'react-native';
2
+ import { SectionListData, ScrollViewProps, NativeSyntheticEvent as NativeSyntheticEvent$1, NativeScrollEvent as NativeScrollEvent$1, ScrollView, StyleProp as StyleProp$1, ViewStyle as ViewStyle$1, ScrollViewComponent, ScrollResponderMixin, Insets as Insets$1, SectionBase, SectionListRenderItemInfo, SectionListScrollParams as SectionListScrollParams$1 } from 'react-native';
3
3
  import * as React from 'react';
4
4
  import { Key } from 'react';
5
5
 
@@ -282,6 +282,8 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
282
282
  index: number;
283
283
  viewOffset?: number | undefined;
284
284
  viewPosition?: number | undefined;
285
+ /** Alignment used only when the item exceeds the viewport. Omit to preserve viewPosition. */
286
+ viewPositionFallback?: "start" | "end";
285
287
  };
286
288
  /**
287
289
  * Initial scroll position in pixels.
@@ -708,6 +710,8 @@ type LegendListRef$1 = {
708
710
  index: number;
709
711
  viewOffset?: number | undefined;
710
712
  viewPosition?: number | undefined;
713
+ /** Alignment used only when the item exceeds the viewport. Omit to preserve viewPosition. */
714
+ viewPositionFallback?: "start" | "end";
711
715
  }): Promise<void>;
712
716
  /**
713
717
  * Scrolls to a specific item in the list.
@@ -722,6 +726,8 @@ type LegendListRef$1 = {
722
726
  item: any;
723
727
  viewOffset?: number | undefined;
724
728
  viewPosition?: number | undefined;
729
+ /** Alignment used only when the item exceeds the viewport. Omit to preserve viewPosition. */
730
+ viewPositionFallback?: "start" | "end";
725
731
  }): Promise<void>;
726
732
  /**
727
733
  * Scrolls to a specific offset in pixels.
@@ -818,6 +824,9 @@ type LegendListRef = Omit<LegendListRef$1, "getAnimatableRef" | "getNativeScroll
818
824
  reportContentInset(inset?: Partial<Insets$1> | null): void;
819
825
  };
820
826
 
827
+ type SectionListScrollParams = SectionListScrollParams$1 & {
828
+ viewPositionFallback?: "start" | "end";
829
+ };
821
830
  type SectionListViewToken<ItemT, SectionT> = {
822
831
  item: ItemT;
823
832
  key: string;
package/section-list.js CHANGED
@@ -281,7 +281,14 @@ var SectionList = typedMemo(
281
281
  ]
282
282
  );
283
283
  const scrollToLocation = React__namespace.useCallback(
284
- ({ sectionIndex, itemIndex, viewOffset, viewPosition, animated }) => {
284
+ ({
285
+ sectionIndex,
286
+ itemIndex,
287
+ viewOffset,
288
+ viewPosition,
289
+ viewPositionFallback,
290
+ animated
291
+ }) => {
285
292
  var _a, _b, _c;
286
293
  const meta = sectionMeta[sectionIndex];
287
294
  if (!meta) return;
@@ -291,7 +298,8 @@ var SectionList = typedMemo(
291
298
  animated,
292
299
  index: target,
293
300
  viewOffset,
294
- viewPosition
301
+ viewPosition,
302
+ viewPositionFallback
295
303
  });
296
304
  },
297
305
  [sectionMeta]
package/section-list.mjs CHANGED
@@ -259,7 +259,14 @@ var SectionList = typedMemo(
259
259
  ]
260
260
  );
261
261
  const scrollToLocation = React.useCallback(
262
- ({ sectionIndex, itemIndex, viewOffset, viewPosition, animated }) => {
262
+ ({
263
+ sectionIndex,
264
+ itemIndex,
265
+ viewOffset,
266
+ viewPosition,
267
+ viewPositionFallback,
268
+ animated
269
+ }) => {
263
270
  var _a, _b, _c;
264
271
  const meta = sectionMeta[sectionIndex];
265
272
  if (!meta) return;
@@ -269,7 +276,8 @@ var SectionList = typedMemo(
269
276
  animated,
270
277
  index: target,
271
278
  viewOffset,
272
- viewPosition
279
+ viewPosition,
280
+ viewPositionFallback
273
281
  });
274
282
  },
275
283
  [sectionMeta]