@legendapp/list 2.0.16 → 2.0.17

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,10 @@
1
+ ## 2.0.17
2
+ - Feat: Add stickyHeaderOffset property to control sticky header positioning
3
+ - Feat: Add sticky header backdrop component support
4
+ - Fix: Improve KeyboardAvoidingLegendList quality by using animated contentOffset y instead of reanimated scrollTo
5
+ - Fix: Initial scroll could sometimes be out of range beyond the ScrollView if some items are much larger than the estimated size
6
+ - Fix: Item layout updates now work correctly when container is the exact same size as previous item on old arch
7
+
1
8
  ## 2.0.16
2
9
  - Feat: Add KeyboardAvoidingLegendList component for better keyboard handling integration
3
10
  - Fix: Stale containers are not being removed and overlap with new data when using getItemType #335
package/index.d.mts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as React$1 from 'react';
2
2
  import { ComponentProps, Key, ReactNode, Dispatch, SetStateAction } from 'react';
3
3
  import { View, Animated, ScrollView, LayoutRectangle, ScrollViewComponent, ScrollResponderMixin, StyleProp, ViewStyle, NativeSyntheticEvent, NativeScrollEvent, ScrollViewProps } from 'react-native';
4
- import Animated$1 from 'react-native-reanimated';
4
+ import Reanimated 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";
7
7
  interface StateContext {
@@ -216,7 +216,7 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
216
216
  onStartReachedThreshold?: number | null | undefined;
217
217
  /**
218
218
  * Called when the sticky header changes.
219
- */
219
+ */
220
220
  onStickyHeaderChange?: (info: {
221
221
  index: number;
222
222
  item: any;
@@ -280,11 +280,29 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
280
280
  * @default undefined
281
281
  */
282
282
  stickyIndices?: number[];
283
+ /**
284
+ * Configuration for sticky headers.
285
+ * @default undefined
286
+ */
287
+ stickyHeaderConfig?: StickyHeaderConfig;
283
288
  getItemType?: (item: ItemT, index: number) => TItemType;
284
289
  getFixedItemSize?: (index: number, item: ItemT, type: TItemType) => number | undefined;
285
290
  itemsAreEqual?: (itemPrevious: ItemT, item: ItemT, index: number, data: readonly ItemT[]) => boolean;
286
291
  }
287
- 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);
292
+ type LegendListPropsBase<ItemT, TScrollView extends ComponentProps<typeof ScrollView> | ComponentProps<typeof Animated.ScrollView> | ComponentProps<typeof Reanimated.ScrollView>, TItemType extends string | undefined = string | undefined> = BaseScrollViewProps<TScrollView> & LegendListSpecificProps<ItemT, TItemType> & (DataModeProps<ItemT, TItemType> | ChildrenModeProps);
293
+ interface StickyHeaderConfig {
294
+ /**
295
+ * Specifies how far from the top edge sticky headers should start sticking.
296
+ * Useful for scenarios with a fixed navbar or header, where sticky elements pin below it..
297
+ * @default 0
298
+ */
299
+ offset?: number;
300
+ /**
301
+ * Component to render as a backdrop behind the sticky header.
302
+ * @default undefined
303
+ */
304
+ backdropComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
305
+ }
288
306
  interface MaintainScrollAtEndOptions {
289
307
  onLayout?: boolean;
290
308
  onItemLayout?: boolean;
@@ -639,4 +657,4 @@ declare function useListScrollSize(): {
639
657
  };
640
658
  declare function useSyncLayout(): () => void;
641
659
 
642
- 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 };
660
+ 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 StickyHeaderConfig, 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
@@ -1,7 +1,7 @@
1
1
  import * as React$1 from 'react';
2
2
  import { ComponentProps, Key, ReactNode, Dispatch, SetStateAction } from 'react';
3
3
  import { View, Animated, ScrollView, LayoutRectangle, ScrollViewComponent, ScrollResponderMixin, StyleProp, ViewStyle, NativeSyntheticEvent, NativeScrollEvent, ScrollViewProps } from 'react-native';
4
- import Animated$1 from 'react-native-reanimated';
4
+ import Reanimated 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";
7
7
  interface StateContext {
@@ -216,7 +216,7 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
216
216
  onStartReachedThreshold?: number | null | undefined;
217
217
  /**
218
218
  * Called when the sticky header changes.
219
- */
219
+ */
220
220
  onStickyHeaderChange?: (info: {
221
221
  index: number;
222
222
  item: any;
@@ -280,11 +280,29 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
280
280
  * @default undefined
281
281
  */
282
282
  stickyIndices?: number[];
283
+ /**
284
+ * Configuration for sticky headers.
285
+ * @default undefined
286
+ */
287
+ stickyHeaderConfig?: StickyHeaderConfig;
283
288
  getItemType?: (item: ItemT, index: number) => TItemType;
284
289
  getFixedItemSize?: (index: number, item: ItemT, type: TItemType) => number | undefined;
285
290
  itemsAreEqual?: (itemPrevious: ItemT, item: ItemT, index: number, data: readonly ItemT[]) => boolean;
286
291
  }
287
- 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);
292
+ type LegendListPropsBase<ItemT, TScrollView extends ComponentProps<typeof ScrollView> | ComponentProps<typeof Animated.ScrollView> | ComponentProps<typeof Reanimated.ScrollView>, TItemType extends string | undefined = string | undefined> = BaseScrollViewProps<TScrollView> & LegendListSpecificProps<ItemT, TItemType> & (DataModeProps<ItemT, TItemType> | ChildrenModeProps);
293
+ interface StickyHeaderConfig {
294
+ /**
295
+ * Specifies how far from the top edge sticky headers should start sticking.
296
+ * Useful for scenarios with a fixed navbar or header, where sticky elements pin below it..
297
+ * @default 0
298
+ */
299
+ offset?: number;
300
+ /**
301
+ * Component to render as a backdrop behind the sticky header.
302
+ * @default undefined
303
+ */
304
+ backdropComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
305
+ }
288
306
  interface MaintainScrollAtEndOptions {
289
307
  onLayout?: boolean;
290
308
  onItemLayout?: boolean;
@@ -639,4 +657,4 @@ declare function useListScrollSize(): {
639
657
  };
640
658
  declare function useSyncLayout(): () => void;
641
659
 
642
- 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 };
660
+ 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 StickyHeaderConfig, 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.js CHANGED
@@ -232,6 +232,15 @@ function useValue$(key, params) {
232
232
  }
233
233
  var typedForwardRef = React2.forwardRef;
234
234
  var typedMemo = React2.memo;
235
+ var getComponent = (Component) => {
236
+ if (React2__namespace.isValidElement(Component)) {
237
+ return Component;
238
+ }
239
+ if (Component) {
240
+ return /* @__PURE__ */ React2__namespace.createElement(Component, null);
241
+ }
242
+ return null;
243
+ };
235
244
 
236
245
  // src/components/PositionView.tsx
237
246
  var PositionViewState = typedMemo(function PositionView({
@@ -280,22 +289,42 @@ var PositionViewSticky = typedMemo(function PositionViewSticky2({
280
289
  animatedScrollY,
281
290
  stickyOffset,
282
291
  index,
292
+ stickyHeaderConfig,
293
+ children,
283
294
  ...rest
284
295
  }) {
285
296
  const [position = POSITION_OUT_OF_VIEW, headerSize] = useArr$([`containerPosition${id}`, "headerSize"]);
286
297
  const transform = React2__namespace.useMemo(() => {
298
+ var _a;
287
299
  if (animatedScrollY && stickyOffset !== void 0) {
300
+ const stickyOffset2 = (_a = stickyHeaderConfig == null ? void 0 : stickyHeaderConfig.offset) != null ? _a : 0;
288
301
  const stickyPosition = animatedScrollY.interpolate({
289
302
  extrapolateLeft: "clamp",
290
303
  extrapolateRight: "extend",
291
- inputRange: [position + headerSize, position + 5e3 + headerSize],
304
+ inputRange: [position + headerSize - stickyOffset2, position + 5e3 + headerSize - stickyOffset2],
292
305
  outputRange: [position, position + 5e3]
293
306
  });
294
307
  return horizontal ? [{ translateX: stickyPosition }] : [{ translateY: stickyPosition }];
295
308
  }
296
- }, [animatedScrollY, headerSize, horizontal, stickyOffset, position]);
309
+ }, [animatedScrollY, headerSize, horizontal, stickyOffset, position, stickyHeaderConfig == null ? void 0 : stickyHeaderConfig.offset]);
297
310
  const viewStyle = React2__namespace.useMemo(() => [style, { zIndex: index + 1e3 }, { transform }], [style, transform]);
298
- return /* @__PURE__ */ React2__namespace.createElement(reactNative.Animated.View, { ref: refView, style: viewStyle, ...rest });
311
+ const renderStickyHeaderBackdrop = React2__namespace.useMemo(() => {
312
+ if (!(stickyHeaderConfig == null ? void 0 : stickyHeaderConfig.backdropComponent)) {
313
+ return null;
314
+ }
315
+ return /* @__PURE__ */ React2__namespace.createElement(
316
+ reactNative.View,
317
+ {
318
+ style: {
319
+ inset: 0,
320
+ pointerEvents: "none",
321
+ position: "absolute"
322
+ }
323
+ },
324
+ getComponent(stickyHeaderConfig == null ? void 0 : stickyHeaderConfig.backdropComponent)
325
+ );
326
+ }, [stickyHeaderConfig == null ? void 0 : stickyHeaderConfig.backdropComponent]);
327
+ return /* @__PURE__ */ React2__namespace.createElement(reactNative.Animated.View, { ref: refView, style: viewStyle, ...rest }, renderStickyHeaderBackdrop, children);
299
328
  });
300
329
  var PositionView3 = IsNewArchitecture ? PositionViewState : PositionViewAnimated;
301
330
  var symbolFirst = Symbol();
@@ -481,7 +510,8 @@ var Container = typedMemo(function Container2({
481
510
  horizontal,
482
511
  getRenderedItem: getRenderedItem2,
483
512
  updateItemSize: updateItemSize2,
484
- ItemSeparatorComponent
513
+ ItemSeparatorComponent,
514
+ stickyHeaderConfig
485
515
  }) {
486
516
  const ctx = useStateContext();
487
517
  const { columnWrapperStyle, animatedScrollY } = ctx;
@@ -580,6 +610,7 @@ var Container = typedMemo(function Container2({
580
610
  if (!IsNewArchitecture) {
581
611
  React2.useEffect(() => {
582
612
  if (!isNullOrUndefined(itemKey)) {
613
+ didLayoutRef.current = false;
583
614
  const timeout = setTimeout(() => {
584
615
  if (!didLayoutRef.current && refLastSize.current) {
585
616
  updateItemSize2(itemKey, refLastSize.current);
@@ -603,6 +634,7 @@ var Container = typedMemo(function Container2({
603
634
  key: recycleItems ? void 0 : itemKey,
604
635
  onLayout,
605
636
  refView: ref,
637
+ stickyHeaderConfig,
606
638
  stickyOffset: isSticky ? stickyOffset : void 0,
607
639
  style
608
640
  },
@@ -617,7 +649,8 @@ var Containers = typedMemo(function Containers2({
617
649
  ItemSeparatorComponent,
618
650
  waitForInitialLayout,
619
651
  updateItemSize: updateItemSize2,
620
- getRenderedItem: getRenderedItem2
652
+ getRenderedItem: getRenderedItem2,
653
+ stickyHeaderConfig
621
654
  }) {
622
655
  const ctx = useStateContext();
623
656
  const columnWrapperStyle = ctx.columnWrapperStyle;
@@ -644,6 +677,7 @@ var Containers = typedMemo(function Containers2({
644
677
  id: i,
645
678
  key: i,
646
679
  recycleItems,
680
+ stickyHeaderConfig,
647
681
  updateItemSize: updateItemSize2
648
682
  }
649
683
  )
@@ -700,15 +734,6 @@ function SnapWrapper({ ScrollComponent, ...props }) {
700
734
  }
701
735
 
702
736
  // src/components/ListComponent.tsx
703
- var getComponent = (Component) => {
704
- if (React2__namespace.isValidElement(Component)) {
705
- return Component;
706
- }
707
- if (Component) {
708
- return /* @__PURE__ */ React2__namespace.createElement(Component, null);
709
- }
710
- return null;
711
- };
712
737
  var Padding = () => {
713
738
  const animPaddingTop = useValue$("alignItemsPaddingTop", { delay: 0 });
714
739
  return /* @__PURE__ */ React2__namespace.createElement(reactNative.Animated.View, { style: { paddingTop: animPaddingTop } });
@@ -755,6 +780,7 @@ var ListComponent = typedMemo(function ListComponent2({
755
780
  onLayoutHeader,
756
781
  snapToIndices,
757
782
  stickyIndices,
783
+ stickyHeaderConfig,
758
784
  ...rest
759
785
  }) {
760
786
  const ctx = useStateContext();
@@ -800,6 +826,7 @@ var ListComponent = typedMemo(function ListComponent2({
800
826
  horizontal,
801
827
  ItemSeparatorComponent,
802
828
  recycleItems,
829
+ stickyHeaderConfig,
803
830
  updateItemSize: updateItemSize2,
804
831
  waitForInitialLayout
805
832
  }
@@ -2412,8 +2439,17 @@ function onScroll(ctx, state, event) {
2412
2439
  if (((_b = (_a = event.nativeEvent) == null ? void 0 : _a.contentSize) == null ? void 0 : _b.height) === 0 && ((_c = event.nativeEvent.contentSize) == null ? void 0 : _c.width) === 0) {
2413
2440
  return;
2414
2441
  }
2415
- const newScroll = event.nativeEvent.contentOffset[state.props.horizontal ? "x" : "y"];
2442
+ let newScroll = event.nativeEvent.contentOffset[state.props.horizontal ? "x" : "y"];
2416
2443
  state.scrollPending = newScroll;
2444
+ console.log("newScroll", newScroll);
2445
+ const maxOffset = Math.max(0, getContentSize(ctx) - state.scrollLength);
2446
+ if (state.initialScroll && newScroll > maxOffset) {
2447
+ newScroll = maxOffset;
2448
+ scrollTo(state, {
2449
+ noScrollingTo: true,
2450
+ offset: newScroll
2451
+ });
2452
+ }
2417
2453
  updateScroll(ctx, state, newScroll);
2418
2454
  onScrollProp == null ? void 0 : onScrollProp(event);
2419
2455
  }
@@ -2787,6 +2823,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
2787
2823
  viewabilityConfig,
2788
2824
  viewabilityConfigCallbackPairs,
2789
2825
  waitForInitialLayout = true,
2826
+ stickyHeaderConfig,
2790
2827
  ...rest
2791
2828
  } = props;
2792
2829
  const { childrenMode } = rest;
@@ -3188,6 +3225,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
3188
3225
  scrollAdjustHandler: (_a = refState.current) == null ? void 0 : _a.scrollAdjustHandler,
3189
3226
  scrollEventThrottle: reactNative.Platform.OS === "web" ? 16 : void 0,
3190
3227
  snapToIndices,
3228
+ stickyHeaderConfig,
3191
3229
  stickyIndices,
3192
3230
  style,
3193
3231
  updateItemSize: fns.updateItemSize,
package/index.mjs CHANGED
@@ -211,6 +211,15 @@ function useValue$(key, params) {
211
211
  }
212
212
  var typedForwardRef = forwardRef;
213
213
  var typedMemo = memo;
214
+ var getComponent = (Component) => {
215
+ if (React2.isValidElement(Component)) {
216
+ return Component;
217
+ }
218
+ if (Component) {
219
+ return /* @__PURE__ */ React2.createElement(Component, null);
220
+ }
221
+ return null;
222
+ };
214
223
 
215
224
  // src/components/PositionView.tsx
216
225
  var PositionViewState = typedMemo(function PositionView({
@@ -259,22 +268,42 @@ var PositionViewSticky = typedMemo(function PositionViewSticky2({
259
268
  animatedScrollY,
260
269
  stickyOffset,
261
270
  index,
271
+ stickyHeaderConfig,
272
+ children,
262
273
  ...rest
263
274
  }) {
264
275
  const [position = POSITION_OUT_OF_VIEW, headerSize] = useArr$([`containerPosition${id}`, "headerSize"]);
265
276
  const transform = React2.useMemo(() => {
277
+ var _a;
266
278
  if (animatedScrollY && stickyOffset !== void 0) {
279
+ const stickyOffset2 = (_a = stickyHeaderConfig == null ? void 0 : stickyHeaderConfig.offset) != null ? _a : 0;
267
280
  const stickyPosition = animatedScrollY.interpolate({
268
281
  extrapolateLeft: "clamp",
269
282
  extrapolateRight: "extend",
270
- inputRange: [position + headerSize, position + 5e3 + headerSize],
283
+ inputRange: [position + headerSize - stickyOffset2, position + 5e3 + headerSize - stickyOffset2],
271
284
  outputRange: [position, position + 5e3]
272
285
  });
273
286
  return horizontal ? [{ translateX: stickyPosition }] : [{ translateY: stickyPosition }];
274
287
  }
275
- }, [animatedScrollY, headerSize, horizontal, stickyOffset, position]);
288
+ }, [animatedScrollY, headerSize, horizontal, stickyOffset, position, stickyHeaderConfig == null ? void 0 : stickyHeaderConfig.offset]);
276
289
  const viewStyle = React2.useMemo(() => [style, { zIndex: index + 1e3 }, { transform }], [style, transform]);
277
- return /* @__PURE__ */ React2.createElement(Animated.View, { ref: refView, style: viewStyle, ...rest });
290
+ const renderStickyHeaderBackdrop = React2.useMemo(() => {
291
+ if (!(stickyHeaderConfig == null ? void 0 : stickyHeaderConfig.backdropComponent)) {
292
+ return null;
293
+ }
294
+ return /* @__PURE__ */ React2.createElement(
295
+ View,
296
+ {
297
+ style: {
298
+ inset: 0,
299
+ pointerEvents: "none",
300
+ position: "absolute"
301
+ }
302
+ },
303
+ getComponent(stickyHeaderConfig == null ? void 0 : stickyHeaderConfig.backdropComponent)
304
+ );
305
+ }, [stickyHeaderConfig == null ? void 0 : stickyHeaderConfig.backdropComponent]);
306
+ return /* @__PURE__ */ React2.createElement(Animated.View, { ref: refView, style: viewStyle, ...rest }, renderStickyHeaderBackdrop, children);
278
307
  });
279
308
  var PositionView3 = IsNewArchitecture ? PositionViewState : PositionViewAnimated;
280
309
  var symbolFirst = Symbol();
@@ -460,7 +489,8 @@ var Container = typedMemo(function Container2({
460
489
  horizontal,
461
490
  getRenderedItem: getRenderedItem2,
462
491
  updateItemSize: updateItemSize2,
463
- ItemSeparatorComponent
492
+ ItemSeparatorComponent,
493
+ stickyHeaderConfig
464
494
  }) {
465
495
  const ctx = useStateContext();
466
496
  const { columnWrapperStyle, animatedScrollY } = ctx;
@@ -559,6 +589,7 @@ var Container = typedMemo(function Container2({
559
589
  if (!IsNewArchitecture) {
560
590
  useEffect(() => {
561
591
  if (!isNullOrUndefined(itemKey)) {
592
+ didLayoutRef.current = false;
562
593
  const timeout = setTimeout(() => {
563
594
  if (!didLayoutRef.current && refLastSize.current) {
564
595
  updateItemSize2(itemKey, refLastSize.current);
@@ -582,6 +613,7 @@ var Container = typedMemo(function Container2({
582
613
  key: recycleItems ? void 0 : itemKey,
583
614
  onLayout,
584
615
  refView: ref,
616
+ stickyHeaderConfig,
585
617
  stickyOffset: isSticky ? stickyOffset : void 0,
586
618
  style
587
619
  },
@@ -596,7 +628,8 @@ var Containers = typedMemo(function Containers2({
596
628
  ItemSeparatorComponent,
597
629
  waitForInitialLayout,
598
630
  updateItemSize: updateItemSize2,
599
- getRenderedItem: getRenderedItem2
631
+ getRenderedItem: getRenderedItem2,
632
+ stickyHeaderConfig
600
633
  }) {
601
634
  const ctx = useStateContext();
602
635
  const columnWrapperStyle = ctx.columnWrapperStyle;
@@ -623,6 +656,7 @@ var Containers = typedMemo(function Containers2({
623
656
  id: i,
624
657
  key: i,
625
658
  recycleItems,
659
+ stickyHeaderConfig,
626
660
  updateItemSize: updateItemSize2
627
661
  }
628
662
  )
@@ -679,15 +713,6 @@ function SnapWrapper({ ScrollComponent, ...props }) {
679
713
  }
680
714
 
681
715
  // src/components/ListComponent.tsx
682
- var getComponent = (Component) => {
683
- if (React2.isValidElement(Component)) {
684
- return Component;
685
- }
686
- if (Component) {
687
- return /* @__PURE__ */ React2.createElement(Component, null);
688
- }
689
- return null;
690
- };
691
716
  var Padding = () => {
692
717
  const animPaddingTop = useValue$("alignItemsPaddingTop", { delay: 0 });
693
718
  return /* @__PURE__ */ React2.createElement(Animated.View, { style: { paddingTop: animPaddingTop } });
@@ -734,6 +759,7 @@ var ListComponent = typedMemo(function ListComponent2({
734
759
  onLayoutHeader,
735
760
  snapToIndices,
736
761
  stickyIndices,
762
+ stickyHeaderConfig,
737
763
  ...rest
738
764
  }) {
739
765
  const ctx = useStateContext();
@@ -779,6 +805,7 @@ var ListComponent = typedMemo(function ListComponent2({
779
805
  horizontal,
780
806
  ItemSeparatorComponent,
781
807
  recycleItems,
808
+ stickyHeaderConfig,
782
809
  updateItemSize: updateItemSize2,
783
810
  waitForInitialLayout
784
811
  }
@@ -2391,8 +2418,17 @@ function onScroll(ctx, state, event) {
2391
2418
  if (((_b = (_a = event.nativeEvent) == null ? void 0 : _a.contentSize) == null ? void 0 : _b.height) === 0 && ((_c = event.nativeEvent.contentSize) == null ? void 0 : _c.width) === 0) {
2392
2419
  return;
2393
2420
  }
2394
- const newScroll = event.nativeEvent.contentOffset[state.props.horizontal ? "x" : "y"];
2421
+ let newScroll = event.nativeEvent.contentOffset[state.props.horizontal ? "x" : "y"];
2395
2422
  state.scrollPending = newScroll;
2423
+ console.log("newScroll", newScroll);
2424
+ const maxOffset = Math.max(0, getContentSize(ctx) - state.scrollLength);
2425
+ if (state.initialScroll && newScroll > maxOffset) {
2426
+ newScroll = maxOffset;
2427
+ scrollTo(state, {
2428
+ noScrollingTo: true,
2429
+ offset: newScroll
2430
+ });
2431
+ }
2396
2432
  updateScroll(ctx, state, newScroll);
2397
2433
  onScrollProp == null ? void 0 : onScrollProp(event);
2398
2434
  }
@@ -2766,6 +2802,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
2766
2802
  viewabilityConfig,
2767
2803
  viewabilityConfigCallbackPairs,
2768
2804
  waitForInitialLayout = true,
2805
+ stickyHeaderConfig,
2769
2806
  ...rest
2770
2807
  } = props;
2771
2808
  const { childrenMode } = rest;
@@ -3167,6 +3204,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
3167
3204
  scrollAdjustHandler: (_a = refState.current) == null ? void 0 : _a.scrollAdjustHandler,
3168
3205
  scrollEventThrottle: Platform.OS === "web" ? 16 : void 0,
3169
3206
  snapToIndices,
3207
+ stickyHeaderConfig,
3170
3208
  stickyIndices,
3171
3209
  style,
3172
3210
  updateItemSize: fns.updateItemSize,
package/keyboard.js CHANGED
@@ -26,21 +26,48 @@ function _interopNamespace(e) {
26
26
 
27
27
  var React__namespace = /*#__PURE__*/_interopNamespace(React);
28
28
 
29
+ // src/integrations/keyboard.tsx
30
+
31
+ // src/utils/helpers.ts
32
+ function isFunction(obj) {
33
+ return typeof obj === "function";
34
+ }
35
+
36
+ // src/hooks/useCombinedRef.ts
37
+ var useCombinedRef = (...refs) => {
38
+ const callback = React.useCallback((element) => {
39
+ for (const ref of refs) {
40
+ if (!ref) {
41
+ continue;
42
+ }
43
+ if (isFunction(ref)) {
44
+ ref(element);
45
+ } else {
46
+ ref.current = element;
47
+ }
48
+ }
49
+ }, refs);
50
+ return callback;
51
+ };
52
+
29
53
  // src/integrations/keyboard.tsx
30
54
  var KeyboardAvoidingLegendList = React.forwardRef(function KeyboardAvoidingLegendList2(props, forwardedRef) {
31
55
  const {
32
56
  contentInset: contentInsetProp,
33
57
  horizontal,
34
58
  onScroll: onScrollProp,
35
- scrollEventThrottle,
36
59
  safeAreaInsetBottom = 0,
37
60
  ...rest
38
61
  } = props;
39
- const resolvedScrollEventThrottle = scrollEventThrottle != null ? scrollEventThrottle : 16;
62
+ const refLegendList = React.useRef(null);
63
+ const combinedRef = useCombinedRef(forwardedRef, refLegendList);
40
64
  const scrollViewRef = reactNativeReanimated.useAnimatedRef();
41
65
  const scrollOffsetY = reactNativeReanimated.useSharedValue(0);
66
+ const animatedOffsetY = reactNativeReanimated.useSharedValue(null);
42
67
  const scrollOffsetAtKeyboardStart = reactNativeReanimated.useSharedValue(0);
43
68
  const keyboardInset = reactNativeReanimated.useSharedValue(0);
69
+ const keyboardHeight = reactNativeReanimated.useSharedValue(0);
70
+ const isOpening = reactNativeReanimated.useSharedValue(false);
44
71
  const scrollHandler = reactNativeReanimated.useAnimatedScrollHandler(
45
72
  (event) => {
46
73
  scrollOffsetY.value = event.contentOffset[horizontal ? "x" : "y"];
@@ -50,46 +77,71 @@ var KeyboardAvoidingLegendList = React.forwardRef(function KeyboardAvoidingLegen
50
77
  },
51
78
  [onScrollProp, horizontal]
52
79
  );
80
+ const setScrollProcessingEnabled = React.useCallback(
81
+ (enabled) => {
82
+ var _a;
83
+ (_a = refLegendList.current) == null ? void 0 : _a.setScrollProcessingEnabled(enabled);
84
+ },
85
+ [refLegendList]
86
+ );
53
87
  reactNativeKeyboardController.useKeyboardHandler(
54
88
  // biome-ignore assist/source/useSortedKeys: prefer start/move/end
55
89
  {
56
- onStart: () => {
90
+ onStart: (event) => {
57
91
  "worklet";
92
+ if (event.height > 0) {
93
+ keyboardHeight.set(event.height - safeAreaInsetBottom);
94
+ }
95
+ isOpening.set(event.progress > 0);
58
96
  scrollOffsetAtKeyboardStart.value = scrollOffsetY.value;
97
+ animatedOffsetY.set(scrollOffsetY.value);
98
+ reactNativeReanimated.runOnJS(setScrollProcessingEnabled)(false);
59
99
  },
60
100
  onMove: (event) => {
61
101
  "worklet";
62
- const targetOffset = scrollOffsetAtKeyboardStart.value + event.height;
102
+ const vIsOpening = isOpening.get();
103
+ const vKeyboardHeight = keyboardHeight.get();
104
+ const vProgress = vIsOpening ? event.progress : 1 - event.progress;
105
+ const targetOffset = scrollOffsetAtKeyboardStart.value + (vIsOpening ? vKeyboardHeight : -vKeyboardHeight) * vProgress;
63
106
  scrollOffsetY.value = targetOffset;
64
- reactNativeReanimated.scrollTo(scrollViewRef, 0, targetOffset, false);
107
+ animatedOffsetY.set(targetOffset);
65
108
  if (!horizontal) {
66
109
  keyboardInset.value = Math.max(0, event.height - safeAreaInsetBottom);
67
110
  }
68
111
  },
69
112
  onEnd: (event) => {
70
113
  "worklet";
71
- const targetOffset = scrollOffsetAtKeyboardStart.value + event.height;
114
+ const vIsOpening = isOpening.get();
115
+ const vKeyboardHeight = keyboardHeight.get();
116
+ const targetOffset = scrollOffsetAtKeyboardStart.value + (vIsOpening ? vKeyboardHeight : -vKeyboardHeight) * (vIsOpening ? event.progress : 1 - event.progress);
72
117
  scrollOffsetY.value = targetOffset;
73
- reactNativeReanimated.scrollTo(scrollViewRef, 0, targetOffset, false);
118
+ animatedOffsetY.set(targetOffset);
74
119
  if (!horizontal) {
75
120
  keyboardInset.value = Math.max(0, event.height - safeAreaInsetBottom);
76
121
  }
122
+ reactNativeReanimated.runOnJS(setScrollProcessingEnabled)(true);
77
123
  }
78
124
  },
79
125
  [scrollViewRef, safeAreaInsetBottom]
80
126
  );
81
- const animatedProps = reactNative.Platform.OS === "ios" ? reactNativeReanimated.useAnimatedProps(() => {
127
+ const animatedProps = reactNativeReanimated.useAnimatedProps(() => {
82
128
  "worklet";
83
129
  var _a, _b, _c, _d;
84
- return {
130
+ const baseProps = {
131
+ contentOffset: animatedOffsetY.value === null ? void 0 : {
132
+ x: 0,
133
+ y: animatedOffsetY.value
134
+ }
135
+ };
136
+ return reactNative.Platform.OS === "ios" ? Object.assign(baseProps, {
85
137
  contentInset: {
86
138
  bottom: ((_a = contentInsetProp == null ? void 0 : contentInsetProp.bottom) != null ? _a : 0) + (horizontal ? 0 : keyboardInset.value),
87
139
  left: (_b = contentInsetProp == null ? void 0 : contentInsetProp.left) != null ? _b : 0,
88
140
  right: (_c = contentInsetProp == null ? void 0 : contentInsetProp.right) != null ? _c : 0,
89
141
  top: (_d = contentInsetProp == null ? void 0 : contentInsetProp.top) != null ? _d : 0
90
142
  }
91
- };
92
- }) : void 0;
143
+ }) : baseProps;
144
+ });
93
145
  const style = reactNative.Platform.OS !== "ios" ? reactNativeReanimated.useAnimatedStyle(() => ({
94
146
  marginBottom: keyboardInset.value
95
147
  })) : void 0;
@@ -100,9 +152,8 @@ var KeyboardAvoidingLegendList = React.forwardRef(function KeyboardAvoidingLegen
100
152
  animatedProps,
101
153
  keyboardDismissMode: "interactive",
102
154
  onScroll: scrollHandler,
103
- ref: forwardedRef,
155
+ ref: combinedRef,
104
156
  refScrollView: scrollViewRef,
105
- scrollEventThrottle: resolvedScrollEventThrottle,
106
157
  scrollIndicatorInsets: { bottom: 0, top: 0 },
107
158
  style
108
159
  }
package/keyboard.mjs CHANGED
@@ -1,25 +1,52 @@
1
1
  import * as React from 'react';
2
- import { forwardRef } from 'react';
2
+ import { forwardRef, useRef, useCallback } from 'react';
3
3
  import { Platform } from 'react-native';
4
4
  import { useKeyboardHandler } from 'react-native-keyboard-controller';
5
- import { useAnimatedRef, useSharedValue, useAnimatedScrollHandler, runOnJS, scrollTo, useAnimatedProps, useAnimatedStyle } from 'react-native-reanimated';
5
+ import { useAnimatedRef, useSharedValue, useAnimatedScrollHandler, runOnJS, useAnimatedProps, useAnimatedStyle } from 'react-native-reanimated';
6
6
  import { AnimatedLegendList } from '@legendapp/list/reanimated';
7
7
 
8
+ // src/integrations/keyboard.tsx
9
+
10
+ // src/utils/helpers.ts
11
+ function isFunction(obj) {
12
+ return typeof obj === "function";
13
+ }
14
+
15
+ // src/hooks/useCombinedRef.ts
16
+ var useCombinedRef = (...refs) => {
17
+ const callback = useCallback((element) => {
18
+ for (const ref of refs) {
19
+ if (!ref) {
20
+ continue;
21
+ }
22
+ if (isFunction(ref)) {
23
+ ref(element);
24
+ } else {
25
+ ref.current = element;
26
+ }
27
+ }
28
+ }, refs);
29
+ return callback;
30
+ };
31
+
8
32
  // src/integrations/keyboard.tsx
9
33
  var KeyboardAvoidingLegendList = forwardRef(function KeyboardAvoidingLegendList2(props, forwardedRef) {
10
34
  const {
11
35
  contentInset: contentInsetProp,
12
36
  horizontal,
13
37
  onScroll: onScrollProp,
14
- scrollEventThrottle,
15
38
  safeAreaInsetBottom = 0,
16
39
  ...rest
17
40
  } = props;
18
- const resolvedScrollEventThrottle = scrollEventThrottle != null ? scrollEventThrottle : 16;
41
+ const refLegendList = useRef(null);
42
+ const combinedRef = useCombinedRef(forwardedRef, refLegendList);
19
43
  const scrollViewRef = useAnimatedRef();
20
44
  const scrollOffsetY = useSharedValue(0);
45
+ const animatedOffsetY = useSharedValue(null);
21
46
  const scrollOffsetAtKeyboardStart = useSharedValue(0);
22
47
  const keyboardInset = useSharedValue(0);
48
+ const keyboardHeight = useSharedValue(0);
49
+ const isOpening = useSharedValue(false);
23
50
  const scrollHandler = useAnimatedScrollHandler(
24
51
  (event) => {
25
52
  scrollOffsetY.value = event.contentOffset[horizontal ? "x" : "y"];
@@ -29,46 +56,71 @@ var KeyboardAvoidingLegendList = forwardRef(function KeyboardAvoidingLegendList2
29
56
  },
30
57
  [onScrollProp, horizontal]
31
58
  );
59
+ const setScrollProcessingEnabled = useCallback(
60
+ (enabled) => {
61
+ var _a;
62
+ (_a = refLegendList.current) == null ? void 0 : _a.setScrollProcessingEnabled(enabled);
63
+ },
64
+ [refLegendList]
65
+ );
32
66
  useKeyboardHandler(
33
67
  // biome-ignore assist/source/useSortedKeys: prefer start/move/end
34
68
  {
35
- onStart: () => {
69
+ onStart: (event) => {
36
70
  "worklet";
71
+ if (event.height > 0) {
72
+ keyboardHeight.set(event.height - safeAreaInsetBottom);
73
+ }
74
+ isOpening.set(event.progress > 0);
37
75
  scrollOffsetAtKeyboardStart.value = scrollOffsetY.value;
76
+ animatedOffsetY.set(scrollOffsetY.value);
77
+ runOnJS(setScrollProcessingEnabled)(false);
38
78
  },
39
79
  onMove: (event) => {
40
80
  "worklet";
41
- const targetOffset = scrollOffsetAtKeyboardStart.value + event.height;
81
+ const vIsOpening = isOpening.get();
82
+ const vKeyboardHeight = keyboardHeight.get();
83
+ const vProgress = vIsOpening ? event.progress : 1 - event.progress;
84
+ const targetOffset = scrollOffsetAtKeyboardStart.value + (vIsOpening ? vKeyboardHeight : -vKeyboardHeight) * vProgress;
42
85
  scrollOffsetY.value = targetOffset;
43
- scrollTo(scrollViewRef, 0, targetOffset, false);
86
+ animatedOffsetY.set(targetOffset);
44
87
  if (!horizontal) {
45
88
  keyboardInset.value = Math.max(0, event.height - safeAreaInsetBottom);
46
89
  }
47
90
  },
48
91
  onEnd: (event) => {
49
92
  "worklet";
50
- const targetOffset = scrollOffsetAtKeyboardStart.value + event.height;
93
+ const vIsOpening = isOpening.get();
94
+ const vKeyboardHeight = keyboardHeight.get();
95
+ const targetOffset = scrollOffsetAtKeyboardStart.value + (vIsOpening ? vKeyboardHeight : -vKeyboardHeight) * (vIsOpening ? event.progress : 1 - event.progress);
51
96
  scrollOffsetY.value = targetOffset;
52
- scrollTo(scrollViewRef, 0, targetOffset, false);
97
+ animatedOffsetY.set(targetOffset);
53
98
  if (!horizontal) {
54
99
  keyboardInset.value = Math.max(0, event.height - safeAreaInsetBottom);
55
100
  }
101
+ runOnJS(setScrollProcessingEnabled)(true);
56
102
  }
57
103
  },
58
104
  [scrollViewRef, safeAreaInsetBottom]
59
105
  );
60
- const animatedProps = Platform.OS === "ios" ? useAnimatedProps(() => {
106
+ const animatedProps = useAnimatedProps(() => {
61
107
  "worklet";
62
108
  var _a, _b, _c, _d;
63
- return {
109
+ const baseProps = {
110
+ contentOffset: animatedOffsetY.value === null ? void 0 : {
111
+ x: 0,
112
+ y: animatedOffsetY.value
113
+ }
114
+ };
115
+ return Platform.OS === "ios" ? Object.assign(baseProps, {
64
116
  contentInset: {
65
117
  bottom: ((_a = contentInsetProp == null ? void 0 : contentInsetProp.bottom) != null ? _a : 0) + (horizontal ? 0 : keyboardInset.value),
66
118
  left: (_b = contentInsetProp == null ? void 0 : contentInsetProp.left) != null ? _b : 0,
67
119
  right: (_c = contentInsetProp == null ? void 0 : contentInsetProp.right) != null ? _c : 0,
68
120
  top: (_d = contentInsetProp == null ? void 0 : contentInsetProp.top) != null ? _d : 0
69
121
  }
70
- };
71
- }) : void 0;
122
+ }) : baseProps;
123
+ });
72
124
  const style = Platform.OS !== "ios" ? useAnimatedStyle(() => ({
73
125
  marginBottom: keyboardInset.value
74
126
  })) : void 0;
@@ -79,9 +131,8 @@ var KeyboardAvoidingLegendList = forwardRef(function KeyboardAvoidingLegendList2
79
131
  animatedProps,
80
132
  keyboardDismissMode: "interactive",
81
133
  onScroll: scrollHandler,
82
- ref: forwardedRef,
134
+ ref: combinedRef,
83
135
  refScrollView: scrollViewRef,
84
- scrollEventThrottle: resolvedScrollEventThrottle,
85
136
  scrollIndicatorInsets: { bottom: 0, top: 0 },
86
137
  style
87
138
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@legendapp/list",
3
- "version": "2.0.16",
3
+ "version": "2.0.17",
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/reanimated.d.mts CHANGED
@@ -1,12 +1,12 @@
1
1
  import * as React from 'react';
2
2
  import { ComponentProps } from 'react';
3
- import Animated from 'react-native-reanimated';
3
+ import Reanimated from 'react-native-reanimated';
4
4
  import { LegendListPropsBase, LegendListRef } from '@legendapp/list';
5
5
 
6
6
  type KeysToOmit = "getEstimatedItemSize" | "getFixedItemSize" | "getItemType" | "keyExtractor" | "animatedProps" | "renderItem" | "onItemSizeChanged" | "itemsAreEqual" | "ItemSeparatorComponent";
7
- type PropsBase<ItemT> = LegendListPropsBase<ItemT, ComponentProps<typeof Animated.ScrollView>>;
7
+ type PropsBase<ItemT> = LegendListPropsBase<ItemT, ComponentProps<typeof Reanimated.ScrollView>>;
8
8
  interface AnimatedLegendListPropsBase<ItemT> extends Omit<PropsBase<ItemT>, KeysToOmit> {
9
- refScrollView?: React.Ref<Animated.ScrollView>;
9
+ refScrollView?: React.Ref<Reanimated.ScrollView>;
10
10
  }
11
11
  type OtherAnimatedLegendListProps<ItemT> = Pick<PropsBase<ItemT>, KeysToOmit>;
12
12
  type AnimatedLegendListProps<ItemT> = Omit<AnimatedLegendListPropsBase<ItemT>, "refLegendList" | "ref"> & OtherAnimatedLegendListProps<ItemT>;
package/reanimated.d.ts CHANGED
@@ -1,12 +1,12 @@
1
1
  import * as React from 'react';
2
2
  import { ComponentProps } from 'react';
3
- import Animated from 'react-native-reanimated';
3
+ import Reanimated from 'react-native-reanimated';
4
4
  import { LegendListPropsBase, LegendListRef } from '@legendapp/list';
5
5
 
6
6
  type KeysToOmit = "getEstimatedItemSize" | "getFixedItemSize" | "getItemType" | "keyExtractor" | "animatedProps" | "renderItem" | "onItemSizeChanged" | "itemsAreEqual" | "ItemSeparatorComponent";
7
- type PropsBase<ItemT> = LegendListPropsBase<ItemT, ComponentProps<typeof Animated.ScrollView>>;
7
+ type PropsBase<ItemT> = LegendListPropsBase<ItemT, ComponentProps<typeof Reanimated.ScrollView>>;
8
8
  interface AnimatedLegendListPropsBase<ItemT> extends Omit<PropsBase<ItemT>, KeysToOmit> {
9
- refScrollView?: React.Ref<Animated.ScrollView>;
9
+ refScrollView?: React.Ref<Reanimated.ScrollView>;
10
10
  }
11
11
  type OtherAnimatedLegendListProps<ItemT> = Pick<PropsBase<ItemT>, KeysToOmit>;
12
12
  type AnimatedLegendListProps<ItemT> = Omit<AnimatedLegendListPropsBase<ItemT>, "refLegendList" | "ref"> & OtherAnimatedLegendListProps<ItemT>;
package/reanimated.js CHANGED
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var React = require('react');
4
- var Animated = require('react-native-reanimated');
4
+ var Reanimated = require('react-native-reanimated');
5
5
  var list = require('@legendapp/list');
6
6
 
7
7
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
@@ -25,7 +25,7 @@ function _interopNamespace(e) {
25
25
  }
26
26
 
27
27
  var React__namespace = /*#__PURE__*/_interopNamespace(React);
28
- var Animated__default = /*#__PURE__*/_interopDefault(Animated);
28
+ var Reanimated__default = /*#__PURE__*/_interopDefault(Reanimated);
29
29
 
30
30
  // src/integrations/reanimated.tsx
31
31
 
@@ -65,7 +65,7 @@ var LegendListForwardedRef = typedMemo(
65
65
  return /* @__PURE__ */ React__namespace.createElement(list.LegendList, { ref: refFn, refScrollView: ref, ...rest });
66
66
  })
67
67
  );
68
- var AnimatedLegendListComponent = Animated__default.default.createAnimatedComponent(LegendListForwardedRef);
68
+ var AnimatedLegendListComponent = Reanimated__default.default.createAnimatedComponent(LegendListForwardedRef);
69
69
  var AnimatedLegendList = typedMemo(
70
70
  React__namespace.forwardRef(function AnimatedLegendList2(props, ref) {
71
71
  const { refScrollView, ...rest } = props;
package/reanimated.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { useCallback, memo } from 'react';
3
- import Animated from 'react-native-reanimated';
3
+ import Reanimated from 'react-native-reanimated';
4
4
  import { LegendList } from '@legendapp/list';
5
5
 
6
6
  // src/integrations/reanimated.tsx
@@ -41,7 +41,7 @@ var LegendListForwardedRef = typedMemo(
41
41
  return /* @__PURE__ */ React.createElement(LegendList, { ref: refFn, refScrollView: ref, ...rest });
42
42
  })
43
43
  );
44
- var AnimatedLegendListComponent = Animated.createAnimatedComponent(LegendListForwardedRef);
44
+ var AnimatedLegendListComponent = Reanimated.createAnimatedComponent(LegendListForwardedRef);
45
45
  var AnimatedLegendList = typedMemo(
46
46
  React.forwardRef(function AnimatedLegendList2(props, ref) {
47
47
  const { refScrollView, ...rest } = props;