@legendapp/list 2.0.0-next.2 → 2.0.0-next.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/{dist/animated.d.mts → animated.d.mts} +1 -0
- package/{dist/animated.d.ts → animated.d.ts} +1 -0
- package/{dist/index.d.mts → index.d.mts} +8 -1
- package/{dist/index.d.ts → index.d.ts} +8 -1
- package/{dist/index.js → index.js} +50 -4
- package/{dist/index.mjs → index.mjs} +50 -4
- package/{dist/keyboard-controller.d.mts → keyboard-controller.d.mts} +4 -0
- package/{dist/keyboard-controller.d.ts → keyboard-controller.d.ts} +4 -0
- package/package.json +34 -88
- package/.claude/settings.local.json +0 -8
- package/.cursor/rules/changelog.mdc +0 -60
- package/.github/FUNDING.yml +0 -15
- package/.gitignore +0 -5
- package/.prettierrc.json +0 -5
- package/.vscode/settings.json +0 -14
- package/CLAUDE.md +0 -126
- package/biome.json +0 -46
- package/bun.lock +0 -1289
- package/bunfig.toml +0 -2
- package/dist/CHANGELOG.md +0 -119
- package/dist/LICENSE +0 -21
- package/dist/README.md +0 -139
- package/dist/package.json +0 -35
- package/example/README.md +0 -40
- package/example/api/data/genres.json +0 -23
- package/example/api/data/playlist/10402-10749.json +0 -1
- package/example/api/data/playlist/10402-10770.json +0 -1
- package/example/api/data/playlist/10402-37.json +0 -1
- package/example/api/data/playlist/10749-10752.json +0 -1
- package/example/api/data/playlist/10749-10770.json +0 -1
- package/example/api/data/playlist/10749-37.json +0 -1
- package/example/api/data/playlist/10749-878.json +0 -1
- package/example/api/data/playlist/10751-10402.json +0 -1
- package/example/api/data/playlist/10751-10752.json +0 -1
- package/example/api/data/playlist/10751-37.json +0 -1
- package/example/api/data/playlist/10751-53.json +0 -1
- package/example/api/data/playlist/10751-878.json +0 -1
- package/example/api/data/playlist/10751-9648.json +0 -1
- package/example/api/data/playlist/10752-37.json +0 -1
- package/example/api/data/playlist/12-10402.json +0 -1
- package/example/api/data/playlist/12-10749.json +0 -1
- package/example/api/data/playlist/12-18.json +0 -1
- package/example/api/data/playlist/12-27.json +0 -1
- package/example/api/data/playlist/12-35.json +0 -1
- package/example/api/data/playlist/14-36.json +0 -1
- package/example/api/data/playlist/14-878.json +0 -1
- package/example/api/data/playlist/16-10751.json +0 -1
- package/example/api/data/playlist/16-10770.json +0 -1
- package/example/api/data/playlist/16-35.json +0 -1
- package/example/api/data/playlist/16-36.json +0 -1
- package/example/api/data/playlist/16-53.json +0 -1
- package/example/api/data/playlist/18-10751.json +0 -1
- package/example/api/data/playlist/18-10752.json +0 -1
- package/example/api/data/playlist/18-37.json +0 -1
- package/example/api/data/playlist/18-53.json +0 -1
- package/example/api/data/playlist/18-878.json +0 -1
- package/example/api/data/playlist/27-10749.json +0 -1
- package/example/api/data/playlist/27-10770.json +0 -1
- package/example/api/data/playlist/28-10749.json +0 -1
- package/example/api/data/playlist/28-10751.json +0 -1
- package/example/api/data/playlist/28-10770.json +0 -1
- package/example/api/data/playlist/28-16.json +0 -1
- package/example/api/data/playlist/28-18.json +0 -1
- package/example/api/data/playlist/28-36.json +0 -1
- package/example/api/data/playlist/28-37.json +0 -1
- package/example/api/data/playlist/28-53.json +0 -1
- package/example/api/data/playlist/28-80.json +0 -1
- package/example/api/data/playlist/28-99.json +0 -1
- package/example/api/data/playlist/35-10749.json +0 -1
- package/example/api/data/playlist/35-10751.json +0 -1
- package/example/api/data/playlist/35-10752.json +0 -1
- package/example/api/data/playlist/35-27.json +0 -1
- package/example/api/data/playlist/35-36.json +0 -1
- package/example/api/data/playlist/35-53.json +0 -1
- package/example/api/data/playlist/35-80.json +0 -1
- package/example/api/data/playlist/36-37.json +0 -1
- package/example/api/data/playlist/36-878.json +0 -1
- package/example/api/data/playlist/36-9648.json +0 -1
- package/example/api/data/playlist/53-10752.json +0 -1
- package/example/api/data/playlist/80-10770.json +0 -1
- package/example/api/data/playlist/80-14.json +0 -1
- package/example/api/data/playlist/80-18.json +0 -1
- package/example/api/data/playlist/80-37.json +0 -1
- package/example/api/data/playlist/878-37.json +0 -1
- package/example/api/data/playlist/9648-10770.json +0 -1
- package/example/api/data/playlist/9648-37.json +0 -1
- package/example/api/data/playlist/9648-53.json +0 -1
- package/example/api/data/playlist/9648-878.json +0 -1
- package/example/api/data/playlist/99-10749.json +0 -1
- package/example/api/data/playlist/99-14.json +0 -1
- package/example/api/data/playlist/99-18.json +0 -1
- package/example/api/data/playlist/99-27.json +0 -1
- package/example/api/data/playlist/99-53.json +0 -1
- package/example/api/data/playlist/99-9648.json +0 -1
- package/example/api/data/playlist/index.ts +0 -73
- package/example/api/data/rows.json +0 -1
- package/example/api/index.ts +0 -36
- package/example/app/(tabs)/_layout.tsx +0 -60
- package/example/app/(tabs)/cards.tsx +0 -81
- package/example/app/(tabs)/index.tsx +0 -205
- package/example/app/(tabs)/moviesL.tsx +0 -7
- package/example/app/(tabs)/moviesLR.tsx +0 -7
- package/example/app/+not-found.tsx +0 -32
- package/example/app/_layout.tsx +0 -34
- package/example/app/accurate-scrollto/index.tsx +0 -125
- package/example/app/accurate-scrollto-2/index.tsx +0 -52
- package/example/app/accurate-scrollto-huge/index.tsx +0 -128
- package/example/app/add-to-end/index.tsx +0 -82
- package/example/app/ai-chat/index.tsx +0 -236
- package/example/app/bidirectional-infinite-list/index.tsx +0 -133
- package/example/app/cards-columns/index.tsx +0 -37
- package/example/app/cards-flashlist/index.tsx +0 -122
- package/example/app/cards-flatlist/index.tsx +0 -94
- package/example/app/cards-no-recycle/index.tsx +0 -110
- package/example/app/cards-renderItem.tsx +0 -354
- package/example/app/chat-example/index.tsx +0 -167
- package/example/app/chat-infinite/index.tsx +0 -239
- package/example/app/chat-keyboard/index.tsx +0 -248
- package/example/app/chat-resize-outer/index.tsx +0 -247
- package/example/app/columns/index.tsx +0 -78
- package/example/app/countries/index.tsx +0 -182
- package/example/app/countries-flashlist/index.tsx +0 -163
- package/example/app/countries-reorder/index.tsx +0 -187
- package/example/app/extra-data/index.tsx +0 -86
- package/example/app/filter-elements/filter-data-provider.tsx +0 -55
- package/example/app/filter-elements/index.tsx +0 -118
- package/example/app/initial-scroll-index/index.tsx +0 -106
- package/example/app/initial-scroll-index/renderFixedItem.tsx +0 -215
- package/example/app/initial-scroll-index-free-height/index.tsx +0 -70
- package/example/app/initial-scroll-index-keyed/index.tsx +0 -62
- package/example/app/lazy-list/index.tsx +0 -123
- package/example/app/movies-flashlist/index.tsx +0 -7
- package/example/app/mutable-cells/index.tsx +0 -104
- package/example/app/video-feed/index.tsx +0 -119
- package/example/app.config.js +0 -22
- package/example/app.json +0 -45
- package/example/assets/fonts/SpaceMono-Regular.ttf +0 -0
- package/example/assets/images/adaptive-icon.png +0 -0
- package/example/assets/images/favicon.png +0 -0
- package/example/assets/images/icon.png +0 -0
- package/example/assets/images/partial-react-logo.png +0 -0
- package/example/assets/images/react-logo.png +0 -0
- package/example/assets/images/react-logo@2x.png +0 -0
- package/example/assets/images/react-logo@3x.png +0 -0
- package/example/assets/images/splash-icon.png +0 -0
- package/example/autoscroll.sh +0 -101
- package/example/bun.lock +0 -2266
- package/example/bunfig.toml +0 -2
- package/example/components/Breathe.tsx +0 -54
- package/example/components/Circle.tsx +0 -69
- package/example/components/Collapsible.tsx +0 -44
- package/example/components/ExternalLink.tsx +0 -24
- package/example/components/HapticTab.tsx +0 -18
- package/example/components/HelloWave.tsx +0 -37
- package/example/components/Movies.tsx +0 -179
- package/example/components/ParallaxScrollView.tsx +0 -81
- package/example/components/ThemedText.tsx +0 -60
- package/example/components/ThemedView.tsx +0 -14
- package/example/components/__tests__/ThemedText-test.tsx +0 -10
- package/example/components/__tests__/__snapshots__/ThemedText-test.tsx.snap +0 -24
- package/example/components/ui/IconSymbol.ios.tsx +0 -32
- package/example/components/ui/IconSymbol.tsx +0 -43
- package/example/components/ui/TabBarBackground.ios.tsx +0 -22
- package/example/components/ui/TabBarBackground.tsx +0 -6
- package/example/constants/Colors.ts +0 -26
- package/example/constants/constants.ts +0 -5
- package/example/constants/useScrollTest.ts +0 -19
- package/example/hooks/useColorScheme.ts +0 -1
- package/example/hooks/useColorScheme.web.ts +0 -8
- package/example/hooks/useThemeColor.ts +0 -22
- package/example/ios/.xcode.env +0 -11
- package/example/ios/Podfile +0 -64
- package/example/ios/Podfile.lock +0 -2767
- package/example/ios/Podfile.properties.json +0 -5
- package/example/ios/listtest/AppDelegate.swift +0 -70
- package/example/ios/listtest/Images.xcassets/AppIcon.appiconset/App-Icon-1024x1024@1x.png +0 -0
- package/example/ios/listtest/Images.xcassets/AppIcon.appiconset/Contents.json +0 -14
- package/example/ios/listtest/Images.xcassets/Contents.json +0 -6
- package/example/ios/listtest/Images.xcassets/SplashScreenBackground.colorset/Contents.json +0 -20
- package/example/ios/listtest/Images.xcassets/SplashScreenLogo.imageset/Contents.json +0 -23
- package/example/ios/listtest/Images.xcassets/SplashScreenLogo.imageset/image.png +0 -0
- package/example/ios/listtest/Images.xcassets/SplashScreenLogo.imageset/image@2x.png +0 -0
- package/example/ios/listtest/Images.xcassets/SplashScreenLogo.imageset/image@3x.png +0 -0
- package/example/ios/listtest/Info.plist +0 -85
- package/example/ios/listtest/PrivacyInfo.xcprivacy +0 -48
- package/example/ios/listtest/SplashScreen.storyboard +0 -42
- package/example/ios/listtest/Supporting/Expo.plist +0 -12
- package/example/ios/listtest/listtest-Bridging-Header.h +0 -3
- package/example/ios/listtest/listtest.entitlements +0 -5
- package/example/ios/listtest.xcodeproj/project.pbxproj +0 -547
- package/example/ios/listtest.xcodeproj/xcshareddata/xcschemes/listtest.xcscheme +0 -88
- package/example/ios/listtest.xcworkspace/contents.xcworkspacedata +0 -10
- package/example/metro.config.js +0 -16
- package/example/package.json +0 -73
- package/example/scripts/reset-project.js +0 -84
- package/example/tsconfig.json +0 -26
- package/posttsup.ts +0 -24
- package/src/Container.tsx +0 -176
- package/src/Containers.tsx +0 -85
- package/src/ContextContainer.ts +0 -145
- package/src/DebugView.tsx +0 -83
- package/src/LazyLegendList.tsx +0 -41
- package/src/LeanView.tsx +0 -18
- package/src/LegendList.tsx +0 -558
- package/src/ListComponent.tsx +0 -191
- package/src/ScrollAdjust.tsx +0 -24
- package/src/ScrollAdjustHandler.ts +0 -26
- package/src/Separator.tsx +0 -14
- package/src/animated.tsx +0 -6
- package/src/calculateItemsInView.ts +0 -363
- package/src/calculateOffsetForIndex.ts +0 -23
- package/src/calculateOffsetWithOffsetPosition.ts +0 -26
- package/src/checkAllSizesKnown.ts +0 -17
- package/src/checkAtBottom.ts +0 -36
- package/src/checkAtTop.ts +0 -27
- package/src/checkThreshold.ts +0 -30
- package/src/constants.ts +0 -11
- package/src/createColumnWrapperStyle.ts +0 -16
- package/src/doInitialAllocateContainers.ts +0 -40
- package/src/doMaintainScrollAtEnd.ts +0 -34
- package/src/findAvailableContainers.ts +0 -98
- package/src/finishScrollTo.ts +0 -8
- package/src/getId.ts +0 -21
- package/src/getItemSize.ts +0 -52
- package/src/getRenderedItem.ts +0 -34
- package/src/getScrollVelocity.ts +0 -47
- package/src/handleLayout.ts +0 -70
- package/src/helpers.ts +0 -39
- package/src/index.ts +0 -11
- package/src/keyboard-controller.tsx +0 -63
- package/src/onScroll.ts +0 -66
- package/src/prepareMVCP.ts +0 -50
- package/src/reanimated.tsx +0 -63
- package/src/requestAdjust.ts +0 -41
- package/src/scrollTo.ts +0 -40
- package/src/scrollToIndex.ts +0 -34
- package/src/setDidLayout.ts +0 -25
- package/src/setPaddingTop.ts +0 -28
- package/src/state.tsx +0 -304
- package/src/types.ts +0 -610
- package/src/updateAlignItemsPaddingTop.ts +0 -18
- package/src/updateAllPositions.ts +0 -130
- package/src/updateItemSize.ts +0 -203
- package/src/updateTotalSize.ts +0 -44
- package/src/useAnimatedValue.ts +0 -6
- package/src/useCombinedRef.ts +0 -22
- package/src/useInit.ts +0 -17
- package/src/useSyncLayout.tsx +0 -68
- package/src/useValue$.ts +0 -53
- package/src/viewability.ts +0 -279
- package/tsconfig.json +0 -59
- package/tsup.config.ts +0 -21
- /package/{dist/animated.js → animated.js} +0 -0
- /package/{dist/animated.mjs → animated.mjs} +0 -0
- /package/{dist/keyboard-controller.js → keyboard-controller.js} +0 -0
- /package/{dist/keyboard-controller.mjs → keyboard-controller.mjs} +0 -0
- /package/{dist/reanimated.d.mts → reanimated.d.mts} +0 -0
- /package/{dist/reanimated.d.ts → reanimated.d.ts} +0 -0
- /package/{dist/reanimated.js → reanimated.js} +0 -0
- /package/{dist/reanimated.mjs → reanimated.mjs} +0 -0
|
@@ -65,6 +65,7 @@ declare const AnimatedLegendList: Animated.AnimatedComponent<(<T>(props: Omit<Om
|
|
|
65
65
|
onLoad?: (info: {
|
|
66
66
|
elapsedTimeInMs: number;
|
|
67
67
|
}) => void;
|
|
68
|
+
snapToIndices?: number[];
|
|
68
69
|
} & React$1.RefAttributes<_legendapp_list.LegendListRef>) => React.ReactNode)>;
|
|
69
70
|
|
|
70
71
|
export { AnimatedLegendList };
|
|
@@ -65,6 +65,7 @@ declare const AnimatedLegendList: Animated.AnimatedComponent<(<T>(props: Omit<Om
|
|
|
65
65
|
onLoad?: (info: {
|
|
66
66
|
elapsedTimeInMs: number;
|
|
67
67
|
}) => void;
|
|
68
|
+
snapToIndices?: number[];
|
|
68
69
|
} & React$1.RefAttributes<_legendapp_list.LegendListRef>) => React.ReactNode)>;
|
|
69
70
|
|
|
70
71
|
export { AnimatedLegendList };
|
|
@@ -5,7 +5,7 @@ import { View, ScrollView, Animated, StyleProp, ViewStyle, ScrollViewProps, Layo
|
|
|
5
5
|
import Animated$1 from 'react-native-reanimated';
|
|
6
6
|
import * as _legendapp_list_reanimated from '@legendapp/list/reanimated';
|
|
7
7
|
|
|
8
|
-
type ListenerType = "numContainers" | "numContainersPooled" | `containerItemKey${number}` | `containerItemData${number}` | `containerPosition${number}` | `containerColumn${number}` | "containersDidLayout" | "extraData" | "numColumns" | "lastItemKeys" | "totalSize" | "alignItemsPaddingTop" | "stylePaddingTop" | "scrollAdjust" | "scrollAdjustUserOffset" | "headerSize" | "footerSize" | "maintainVisibleContentPosition" | "debugRawScroll" | "debugComputedScroll" | "otherAxisSize" | "scrollSize";
|
|
8
|
+
type ListenerType = "numContainers" | "numContainersPooled" | `containerItemKey${number}` | `containerItemData${number}` | `containerPosition${number}` | `containerColumn${number}` | "containersDidLayout" | "extraData" | "numColumns" | "lastItemKeys" | "totalSize" | "alignItemsPaddingTop" | "stylePaddingTop" | "scrollAdjust" | "scrollAdjustUserOffset" | "headerSize" | "footerSize" | "maintainVisibleContentPosition" | "debugRawScroll" | "debugComputedScroll" | "otherAxisSize" | "snapToOffsets" | "scrollSize";
|
|
9
9
|
interface StateContext {
|
|
10
10
|
listeners: Map<ListenerType, Set<(value: any) => void>>;
|
|
11
11
|
values: Map<ListenerType, any>;
|
|
@@ -232,6 +232,7 @@ type LegendListPropsBase<ItemT, TScrollView extends ComponentProps<typeof Scroll
|
|
|
232
232
|
onLoad?: (info: {
|
|
233
233
|
elapsedTimeInMs: number;
|
|
234
234
|
}) => void;
|
|
235
|
+
snapToIndices?: number[];
|
|
235
236
|
};
|
|
236
237
|
interface MaintainScrollAtEndOptions {
|
|
237
238
|
onLayout?: boolean;
|
|
@@ -357,6 +358,7 @@ interface InternalState {
|
|
|
357
358
|
numColumns: number;
|
|
358
359
|
initialContainerPoolRatio: number;
|
|
359
360
|
stylePaddingTop: number | undefined;
|
|
361
|
+
snapToIndices: number[] | undefined;
|
|
360
362
|
};
|
|
361
363
|
}
|
|
362
364
|
interface ViewableRange<T> {
|
|
@@ -377,6 +379,7 @@ type ScrollState = {
|
|
|
377
379
|
endBuffered: number;
|
|
378
380
|
isAtEnd: boolean;
|
|
379
381
|
isAtStart: boolean;
|
|
382
|
+
positions: Map<string, number>;
|
|
380
383
|
scroll: number;
|
|
381
384
|
scrollLength: number;
|
|
382
385
|
start: number;
|
|
@@ -618,6 +621,7 @@ declare const LegendList: <T>(props: Omit<Omit<react_native.ScrollViewProps, "sc
|
|
|
618
621
|
onLoad?: (info: {
|
|
619
622
|
elapsedTimeInMs: number;
|
|
620
623
|
}) => void;
|
|
624
|
+
snapToIndices?: number[];
|
|
621
625
|
} & React$1.RefAttributes<LegendListRef>) => React$1.ReactNode;
|
|
622
626
|
|
|
623
627
|
interface LazyLegendListProps<ItemT, ListT> extends Omit<LegendListProps<ItemT>, "data" | "keyExtractor" | "renderItem"> {
|
|
@@ -686,6 +690,7 @@ declare const LazyLegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_
|
|
|
686
690
|
onLoad?: (info: {
|
|
687
691
|
elapsedTimeInMs: number;
|
|
688
692
|
}) => void;
|
|
693
|
+
snapToIndices?: number[];
|
|
689
694
|
} & React$1.RefAttributes<LegendListRef>) => React$1.ReactNode) | react_native.Animated.AnimatedComponent<(<T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices" | "removeClippedSubviews" | "children"> & {
|
|
690
695
|
alignItemsAtEnd?: boolean;
|
|
691
696
|
columnWrapperStyle?: ColumnWrapperStyle;
|
|
@@ -748,6 +753,7 @@ declare const LazyLegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_
|
|
|
748
753
|
onLoad?: (info: {
|
|
749
754
|
elapsedTimeInMs: number;
|
|
750
755
|
}) => void;
|
|
756
|
+
snapToIndices?: number[];
|
|
751
757
|
} & React$1.RefAttributes<LegendListRef>) => React$1.ReactNode)> | (<ItemT_1>(props: _legendapp_list_reanimated.AnimatedLegendListProps<ItemT_1> & {
|
|
752
758
|
ref?: React$1.Ref<LegendListRef>;
|
|
753
759
|
}) => React$1.ReactElement | null) = <T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices" | "removeClippedSubviews" | "children"> & {
|
|
@@ -812,6 +818,7 @@ declare const LazyLegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_
|
|
|
812
818
|
onLoad?: (info: {
|
|
813
819
|
elapsedTimeInMs: number;
|
|
814
820
|
}) => void;
|
|
821
|
+
snapToIndices?: number[];
|
|
815
822
|
} & React$1.RefAttributes<LegendListRef>) => React$1.ReactNode>(props: LazyLegendListProps<ItemT, ListT> & React$1.RefAttributes<LegendListRef>) => React$1.ReactNode;
|
|
816
823
|
|
|
817
824
|
declare function useViewability(callback: ViewabilityCallback, configId?: string): void;
|
|
@@ -5,7 +5,7 @@ import { View, ScrollView, Animated, StyleProp, ViewStyle, ScrollViewProps, Layo
|
|
|
5
5
|
import Animated$1 from 'react-native-reanimated';
|
|
6
6
|
import * as _legendapp_list_reanimated from '@legendapp/list/reanimated';
|
|
7
7
|
|
|
8
|
-
type ListenerType = "numContainers" | "numContainersPooled" | `containerItemKey${number}` | `containerItemData${number}` | `containerPosition${number}` | `containerColumn${number}` | "containersDidLayout" | "extraData" | "numColumns" | "lastItemKeys" | "totalSize" | "alignItemsPaddingTop" | "stylePaddingTop" | "scrollAdjust" | "scrollAdjustUserOffset" | "headerSize" | "footerSize" | "maintainVisibleContentPosition" | "debugRawScroll" | "debugComputedScroll" | "otherAxisSize" | "scrollSize";
|
|
8
|
+
type ListenerType = "numContainers" | "numContainersPooled" | `containerItemKey${number}` | `containerItemData${number}` | `containerPosition${number}` | `containerColumn${number}` | "containersDidLayout" | "extraData" | "numColumns" | "lastItemKeys" | "totalSize" | "alignItemsPaddingTop" | "stylePaddingTop" | "scrollAdjust" | "scrollAdjustUserOffset" | "headerSize" | "footerSize" | "maintainVisibleContentPosition" | "debugRawScroll" | "debugComputedScroll" | "otherAxisSize" | "snapToOffsets" | "scrollSize";
|
|
9
9
|
interface StateContext {
|
|
10
10
|
listeners: Map<ListenerType, Set<(value: any) => void>>;
|
|
11
11
|
values: Map<ListenerType, any>;
|
|
@@ -232,6 +232,7 @@ type LegendListPropsBase<ItemT, TScrollView extends ComponentProps<typeof Scroll
|
|
|
232
232
|
onLoad?: (info: {
|
|
233
233
|
elapsedTimeInMs: number;
|
|
234
234
|
}) => void;
|
|
235
|
+
snapToIndices?: number[];
|
|
235
236
|
};
|
|
236
237
|
interface MaintainScrollAtEndOptions {
|
|
237
238
|
onLayout?: boolean;
|
|
@@ -357,6 +358,7 @@ interface InternalState {
|
|
|
357
358
|
numColumns: number;
|
|
358
359
|
initialContainerPoolRatio: number;
|
|
359
360
|
stylePaddingTop: number | undefined;
|
|
361
|
+
snapToIndices: number[] | undefined;
|
|
360
362
|
};
|
|
361
363
|
}
|
|
362
364
|
interface ViewableRange<T> {
|
|
@@ -377,6 +379,7 @@ type ScrollState = {
|
|
|
377
379
|
endBuffered: number;
|
|
378
380
|
isAtEnd: boolean;
|
|
379
381
|
isAtStart: boolean;
|
|
382
|
+
positions: Map<string, number>;
|
|
380
383
|
scroll: number;
|
|
381
384
|
scrollLength: number;
|
|
382
385
|
start: number;
|
|
@@ -618,6 +621,7 @@ declare const LegendList: <T>(props: Omit<Omit<react_native.ScrollViewProps, "sc
|
|
|
618
621
|
onLoad?: (info: {
|
|
619
622
|
elapsedTimeInMs: number;
|
|
620
623
|
}) => void;
|
|
624
|
+
snapToIndices?: number[];
|
|
621
625
|
} & React$1.RefAttributes<LegendListRef>) => React$1.ReactNode;
|
|
622
626
|
|
|
623
627
|
interface LazyLegendListProps<ItemT, ListT> extends Omit<LegendListProps<ItemT>, "data" | "keyExtractor" | "renderItem"> {
|
|
@@ -686,6 +690,7 @@ declare const LazyLegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_
|
|
|
686
690
|
onLoad?: (info: {
|
|
687
691
|
elapsedTimeInMs: number;
|
|
688
692
|
}) => void;
|
|
693
|
+
snapToIndices?: number[];
|
|
689
694
|
} & React$1.RefAttributes<LegendListRef>) => React$1.ReactNode) | react_native.Animated.AnimatedComponent<(<T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices" | "removeClippedSubviews" | "children"> & {
|
|
690
695
|
alignItemsAtEnd?: boolean;
|
|
691
696
|
columnWrapperStyle?: ColumnWrapperStyle;
|
|
@@ -748,6 +753,7 @@ declare const LazyLegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_
|
|
|
748
753
|
onLoad?: (info: {
|
|
749
754
|
elapsedTimeInMs: number;
|
|
750
755
|
}) => void;
|
|
756
|
+
snapToIndices?: number[];
|
|
751
757
|
} & React$1.RefAttributes<LegendListRef>) => React$1.ReactNode)> | (<ItemT_1>(props: _legendapp_list_reanimated.AnimatedLegendListProps<ItemT_1> & {
|
|
752
758
|
ref?: React$1.Ref<LegendListRef>;
|
|
753
759
|
}) => React$1.ReactElement | null) = <T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices" | "removeClippedSubviews" | "children"> & {
|
|
@@ -812,6 +818,7 @@ declare const LazyLegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_
|
|
|
812
818
|
onLoad?: (info: {
|
|
813
819
|
elapsedTimeInMs: number;
|
|
814
820
|
}) => void;
|
|
821
|
+
snapToIndices?: number[];
|
|
815
822
|
} & React$1.RefAttributes<LegendListRef>) => React$1.ReactNode>(props: LazyLegendListProps<ItemT, ListT> & React$1.RefAttributes<LegendListRef>) => React$1.ReactNode;
|
|
816
823
|
|
|
817
824
|
declare function useViewability(callback: ViewabilityCallback, configId?: string): void;
|
|
@@ -573,6 +573,13 @@ function ScrollAdjust() {
|
|
|
573
573
|
}
|
|
574
574
|
);
|
|
575
575
|
}
|
|
576
|
+
|
|
577
|
+
// src/SnapWrapper.tsx
|
|
578
|
+
function SnapWrapper({ ScrollComponent, ...props }) {
|
|
579
|
+
const [snapToOffsets] = useArr$(["snapToOffsets"]);
|
|
580
|
+
console.log("snapToOffsets", snapToOffsets);
|
|
581
|
+
return /* @__PURE__ */ React.createElement(ScrollComponent, { ...props, snapToOffsets });
|
|
582
|
+
}
|
|
576
583
|
function useSyncLayout({
|
|
577
584
|
onChange
|
|
578
585
|
}) {
|
|
@@ -647,6 +654,7 @@ var ListComponent = typedMemo(function ListComponent2({
|
|
|
647
654
|
renderScrollComponent,
|
|
648
655
|
scrollAdjustHandler,
|
|
649
656
|
onLayoutHeader,
|
|
657
|
+
snapToIndices,
|
|
650
658
|
...rest
|
|
651
659
|
}) {
|
|
652
660
|
const ctx = useStateContext();
|
|
@@ -664,10 +672,12 @@ var ListComponent = typedMemo(function ListComponent2({
|
|
|
664
672
|
}, 0);
|
|
665
673
|
}
|
|
666
674
|
}, [canRender]);
|
|
675
|
+
const SnapOrScroll = snapToIndices ? SnapWrapper : ScrollComponent;
|
|
667
676
|
return /* @__PURE__ */ React3__namespace.createElement(
|
|
668
|
-
|
|
677
|
+
SnapOrScroll,
|
|
669
678
|
{
|
|
670
679
|
...rest,
|
|
680
|
+
ScrollComponent: snapToIndices ? ScrollComponent : void 0,
|
|
671
681
|
style,
|
|
672
682
|
maintainVisibleContentPosition: maintainVisibleContentPosition && !ListEmptyComponent ? { minIndexForVisible: 0 } : void 0,
|
|
673
683
|
contentContainerStyle: [
|
|
@@ -1120,6 +1130,21 @@ function setDidLayout(ctx, state) {
|
|
|
1120
1130
|
}
|
|
1121
1131
|
}
|
|
1122
1132
|
|
|
1133
|
+
// src/updateSnapToOffsets.ts
|
|
1134
|
+
function updateSnapToOffsets(ctx, state) {
|
|
1135
|
+
const {
|
|
1136
|
+
positions,
|
|
1137
|
+
props: { snapToIndices }
|
|
1138
|
+
} = state;
|
|
1139
|
+
const snapToOffsets = Array(snapToIndices.length);
|
|
1140
|
+
for (let i = 0; i < snapToIndices.length; i++) {
|
|
1141
|
+
const idx = snapToIndices[i];
|
|
1142
|
+
const key = getId(state, idx);
|
|
1143
|
+
snapToOffsets[i] = positions.get(key);
|
|
1144
|
+
}
|
|
1145
|
+
set$(ctx, "snapToOffsets", snapToOffsets);
|
|
1146
|
+
}
|
|
1147
|
+
|
|
1123
1148
|
// src/setPaddingTop.ts
|
|
1124
1149
|
function setPaddingTop(ctx, { stylePaddingTop, alignItemsPaddingTop }) {
|
|
1125
1150
|
if (stylePaddingTop !== void 0) {
|
|
@@ -1190,7 +1215,16 @@ function addTotalSize(ctx, state, key, add) {
|
|
|
1190
1215
|
// src/updateAllPositions.ts
|
|
1191
1216
|
function updateAllPositions(ctx, state, dataChanged) {
|
|
1192
1217
|
var _a, _b, _c, _d, _e;
|
|
1193
|
-
const {
|
|
1218
|
+
const {
|
|
1219
|
+
averageSizes,
|
|
1220
|
+
columns,
|
|
1221
|
+
indexByKey,
|
|
1222
|
+
positions,
|
|
1223
|
+
firstFullyOnScreenIndex,
|
|
1224
|
+
idCache,
|
|
1225
|
+
sizesKnown,
|
|
1226
|
+
props: { snapToIndices }
|
|
1227
|
+
} = state;
|
|
1194
1228
|
const data = state.props.data;
|
|
1195
1229
|
const numColumns = peek$(ctx, "numColumns");
|
|
1196
1230
|
const indexByKeyForChecking = __DEV__ ? /* @__PURE__ */ new Map() : void 0;
|
|
@@ -1270,6 +1304,9 @@ function updateAllPositions(ctx, state, dataChanged) {
|
|
|
1270
1304
|
}
|
|
1271
1305
|
}
|
|
1272
1306
|
updateTotalSize(ctx, state);
|
|
1307
|
+
if (snapToIndices) {
|
|
1308
|
+
updateSnapToOffsets(ctx, state);
|
|
1309
|
+
}
|
|
1273
1310
|
}
|
|
1274
1311
|
|
|
1275
1312
|
// src/viewability.ts
|
|
@@ -2126,6 +2163,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
2126
2163
|
initialContainerPoolRatio = 2,
|
|
2127
2164
|
viewabilityConfig,
|
|
2128
2165
|
viewabilityConfigCallbackPairs,
|
|
2166
|
+
snapToIndices,
|
|
2129
2167
|
onViewableItemsChanged,
|
|
2130
2168
|
onStartReached,
|
|
2131
2169
|
onEndReached,
|
|
@@ -2227,7 +2265,8 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
2227
2265
|
viewabilityConfigCallbackPairs: void 0,
|
|
2228
2266
|
numColumns: numColumnsProp,
|
|
2229
2267
|
initialContainerPoolRatio,
|
|
2230
|
-
stylePaddingTop: stylePaddingTopState
|
|
2268
|
+
stylePaddingTop: stylePaddingTopState,
|
|
2269
|
+
snapToIndices
|
|
2231
2270
|
};
|
|
2232
2271
|
state.refScroller = refScroller;
|
|
2233
2272
|
const checkResetContainers = (isFirst2) => {
|
|
@@ -2322,6 +2361,11 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
2322
2361
|
}
|
|
2323
2362
|
}
|
|
2324
2363
|
}, []);
|
|
2364
|
+
React3.useLayoutEffect(() => {
|
|
2365
|
+
if (snapToIndices) {
|
|
2366
|
+
updateSnapToOffsets(ctx, state);
|
|
2367
|
+
}
|
|
2368
|
+
}, [snapToIndices]);
|
|
2325
2369
|
React3.useLayoutEffect(() => {
|
|
2326
2370
|
const didAllocateContainers = doInitialAllocateContainersCallback();
|
|
2327
2371
|
if (!didAllocateContainers) {
|
|
@@ -2396,6 +2440,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
2396
2440
|
endBuffered: state2.endBuffered,
|
|
2397
2441
|
isAtEnd: state2.isAtEnd,
|
|
2398
2442
|
isAtStart: state2.isAtStart,
|
|
2443
|
+
positions: state2.positions,
|
|
2399
2444
|
scroll: state2.scroll,
|
|
2400
2445
|
scrollLength: state2.scrollLength,
|
|
2401
2446
|
start: state2.startNoBuffer,
|
|
@@ -2499,7 +2544,8 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
2499
2544
|
style,
|
|
2500
2545
|
contentContainerStyle,
|
|
2501
2546
|
scrollAdjustHandler: (_a = refState.current) == null ? void 0 : _a.scrollAdjustHandler,
|
|
2502
|
-
onLayoutHeader
|
|
2547
|
+
onLayoutHeader,
|
|
2548
|
+
snapToIndices
|
|
2503
2549
|
}
|
|
2504
2550
|
), __DEV__ && ENABLE_DEBUG_VIEW && /* @__PURE__ */ React3__namespace.createElement(DebugView, { state: refState.current }));
|
|
2505
2551
|
});
|
|
@@ -552,6 +552,13 @@ function ScrollAdjust() {
|
|
|
552
552
|
}
|
|
553
553
|
);
|
|
554
554
|
}
|
|
555
|
+
|
|
556
|
+
// src/SnapWrapper.tsx
|
|
557
|
+
function SnapWrapper({ ScrollComponent, ...props }) {
|
|
558
|
+
const [snapToOffsets] = useArr$(["snapToOffsets"]);
|
|
559
|
+
console.log("snapToOffsets", snapToOffsets);
|
|
560
|
+
return /* @__PURE__ */ React.createElement(ScrollComponent, { ...props, snapToOffsets });
|
|
561
|
+
}
|
|
555
562
|
function useSyncLayout({
|
|
556
563
|
onChange
|
|
557
564
|
}) {
|
|
@@ -626,6 +633,7 @@ var ListComponent = typedMemo(function ListComponent2({
|
|
|
626
633
|
renderScrollComponent,
|
|
627
634
|
scrollAdjustHandler,
|
|
628
635
|
onLayoutHeader,
|
|
636
|
+
snapToIndices,
|
|
629
637
|
...rest
|
|
630
638
|
}) {
|
|
631
639
|
const ctx = useStateContext();
|
|
@@ -643,10 +651,12 @@ var ListComponent = typedMemo(function ListComponent2({
|
|
|
643
651
|
}, 0);
|
|
644
652
|
}
|
|
645
653
|
}, [canRender]);
|
|
654
|
+
const SnapOrScroll = snapToIndices ? SnapWrapper : ScrollComponent;
|
|
646
655
|
return /* @__PURE__ */ React3.createElement(
|
|
647
|
-
|
|
656
|
+
SnapOrScroll,
|
|
648
657
|
{
|
|
649
658
|
...rest,
|
|
659
|
+
ScrollComponent: snapToIndices ? ScrollComponent : void 0,
|
|
650
660
|
style,
|
|
651
661
|
maintainVisibleContentPosition: maintainVisibleContentPosition && !ListEmptyComponent ? { minIndexForVisible: 0 } : void 0,
|
|
652
662
|
contentContainerStyle: [
|
|
@@ -1099,6 +1109,21 @@ function setDidLayout(ctx, state) {
|
|
|
1099
1109
|
}
|
|
1100
1110
|
}
|
|
1101
1111
|
|
|
1112
|
+
// src/updateSnapToOffsets.ts
|
|
1113
|
+
function updateSnapToOffsets(ctx, state) {
|
|
1114
|
+
const {
|
|
1115
|
+
positions,
|
|
1116
|
+
props: { snapToIndices }
|
|
1117
|
+
} = state;
|
|
1118
|
+
const snapToOffsets = Array(snapToIndices.length);
|
|
1119
|
+
for (let i = 0; i < snapToIndices.length; i++) {
|
|
1120
|
+
const idx = snapToIndices[i];
|
|
1121
|
+
const key = getId(state, idx);
|
|
1122
|
+
snapToOffsets[i] = positions.get(key);
|
|
1123
|
+
}
|
|
1124
|
+
set$(ctx, "snapToOffsets", snapToOffsets);
|
|
1125
|
+
}
|
|
1126
|
+
|
|
1102
1127
|
// src/setPaddingTop.ts
|
|
1103
1128
|
function setPaddingTop(ctx, { stylePaddingTop, alignItemsPaddingTop }) {
|
|
1104
1129
|
if (stylePaddingTop !== void 0) {
|
|
@@ -1169,7 +1194,16 @@ function addTotalSize(ctx, state, key, add) {
|
|
|
1169
1194
|
// src/updateAllPositions.ts
|
|
1170
1195
|
function updateAllPositions(ctx, state, dataChanged) {
|
|
1171
1196
|
var _a, _b, _c, _d, _e;
|
|
1172
|
-
const {
|
|
1197
|
+
const {
|
|
1198
|
+
averageSizes,
|
|
1199
|
+
columns,
|
|
1200
|
+
indexByKey,
|
|
1201
|
+
positions,
|
|
1202
|
+
firstFullyOnScreenIndex,
|
|
1203
|
+
idCache,
|
|
1204
|
+
sizesKnown,
|
|
1205
|
+
props: { snapToIndices }
|
|
1206
|
+
} = state;
|
|
1173
1207
|
const data = state.props.data;
|
|
1174
1208
|
const numColumns = peek$(ctx, "numColumns");
|
|
1175
1209
|
const indexByKeyForChecking = __DEV__ ? /* @__PURE__ */ new Map() : void 0;
|
|
@@ -1249,6 +1283,9 @@ function updateAllPositions(ctx, state, dataChanged) {
|
|
|
1249
1283
|
}
|
|
1250
1284
|
}
|
|
1251
1285
|
updateTotalSize(ctx, state);
|
|
1286
|
+
if (snapToIndices) {
|
|
1287
|
+
updateSnapToOffsets(ctx, state);
|
|
1288
|
+
}
|
|
1252
1289
|
}
|
|
1253
1290
|
|
|
1254
1291
|
// src/viewability.ts
|
|
@@ -2105,6 +2142,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
2105
2142
|
initialContainerPoolRatio = 2,
|
|
2106
2143
|
viewabilityConfig,
|
|
2107
2144
|
viewabilityConfigCallbackPairs,
|
|
2145
|
+
snapToIndices,
|
|
2108
2146
|
onViewableItemsChanged,
|
|
2109
2147
|
onStartReached,
|
|
2110
2148
|
onEndReached,
|
|
@@ -2206,7 +2244,8 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
2206
2244
|
viewabilityConfigCallbackPairs: void 0,
|
|
2207
2245
|
numColumns: numColumnsProp,
|
|
2208
2246
|
initialContainerPoolRatio,
|
|
2209
|
-
stylePaddingTop: stylePaddingTopState
|
|
2247
|
+
stylePaddingTop: stylePaddingTopState,
|
|
2248
|
+
snapToIndices
|
|
2210
2249
|
};
|
|
2211
2250
|
state.refScroller = refScroller;
|
|
2212
2251
|
const checkResetContainers = (isFirst2) => {
|
|
@@ -2301,6 +2340,11 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
2301
2340
|
}
|
|
2302
2341
|
}
|
|
2303
2342
|
}, []);
|
|
2343
|
+
useLayoutEffect(() => {
|
|
2344
|
+
if (snapToIndices) {
|
|
2345
|
+
updateSnapToOffsets(ctx, state);
|
|
2346
|
+
}
|
|
2347
|
+
}, [snapToIndices]);
|
|
2304
2348
|
useLayoutEffect(() => {
|
|
2305
2349
|
const didAllocateContainers = doInitialAllocateContainersCallback();
|
|
2306
2350
|
if (!didAllocateContainers) {
|
|
@@ -2375,6 +2419,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
2375
2419
|
endBuffered: state2.endBuffered,
|
|
2376
2420
|
isAtEnd: state2.isAtEnd,
|
|
2377
2421
|
isAtStart: state2.isAtStart,
|
|
2422
|
+
positions: state2.positions,
|
|
2378
2423
|
scroll: state2.scroll,
|
|
2379
2424
|
scrollLength: state2.scrollLength,
|
|
2380
2425
|
start: state2.startNoBuffer,
|
|
@@ -2478,7 +2523,8 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
2478
2523
|
style,
|
|
2479
2524
|
contentContainerStyle,
|
|
2480
2525
|
scrollAdjustHandler: (_a = refState.current) == null ? void 0 : _a.scrollAdjustHandler,
|
|
2481
|
-
onLayoutHeader
|
|
2526
|
+
onLayoutHeader,
|
|
2527
|
+
snapToIndices
|
|
2482
2528
|
}
|
|
2483
2529
|
), __DEV__ && ENABLE_DEBUG_VIEW && /* @__PURE__ */ React3.createElement(DebugView, { state: refState.current }));
|
|
2484
2530
|
});
|
|
@@ -66,6 +66,7 @@ declare const LegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_nati
|
|
|
66
66
|
onLoad?: (info: {
|
|
67
67
|
elapsedTimeInMs: number;
|
|
68
68
|
}) => void;
|
|
69
|
+
snapToIndices?: number[];
|
|
69
70
|
} & React.RefAttributes<LegendListRef>) => React.ReactNode) | react_native.Animated.AnimatedComponent<(<T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices" | "removeClippedSubviews" | "children"> & {
|
|
70
71
|
alignItemsAtEnd?: boolean;
|
|
71
72
|
columnWrapperStyle?: _legendapp_list.ColumnWrapperStyle;
|
|
@@ -128,6 +129,7 @@ declare const LegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_nati
|
|
|
128
129
|
onLoad?: (info: {
|
|
129
130
|
elapsedTimeInMs: number;
|
|
130
131
|
}) => void;
|
|
132
|
+
snapToIndices?: number[];
|
|
131
133
|
} & React.RefAttributes<LegendListRef>) => React.ReactNode)> | (<ItemT_1>(props: _legendapp_list_reanimated.AnimatedLegendListProps<ItemT_1> & {
|
|
132
134
|
ref?: React.Ref<LegendListRef>;
|
|
133
135
|
}) => React.ReactElement | null) = <T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices" | "removeClippedSubviews" | "children"> & {
|
|
@@ -192,6 +194,7 @@ declare const LegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_nati
|
|
|
192
194
|
onLoad?: (info: {
|
|
193
195
|
elapsedTimeInMs: number;
|
|
194
196
|
}) => void;
|
|
197
|
+
snapToIndices?: number[];
|
|
195
198
|
} & React.RefAttributes<LegendListRef>) => React.ReactNode>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices" | "removeClippedSubviews" | "children"> & {
|
|
196
199
|
alignItemsAtEnd?: boolean;
|
|
197
200
|
columnWrapperStyle?: _legendapp_list.ColumnWrapperStyle;
|
|
@@ -254,6 +257,7 @@ declare const LegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_nati
|
|
|
254
257
|
onLoad?: (info: {
|
|
255
258
|
elapsedTimeInMs: number;
|
|
256
259
|
}) => void;
|
|
260
|
+
snapToIndices?: number[];
|
|
257
261
|
} & {
|
|
258
262
|
LegendList?: ListT;
|
|
259
263
|
} & React.RefAttributes<LegendListRef>) => React.ReactNode;
|
|
@@ -66,6 +66,7 @@ declare const LegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_nati
|
|
|
66
66
|
onLoad?: (info: {
|
|
67
67
|
elapsedTimeInMs: number;
|
|
68
68
|
}) => void;
|
|
69
|
+
snapToIndices?: number[];
|
|
69
70
|
} & React.RefAttributes<LegendListRef>) => React.ReactNode) | react_native.Animated.AnimatedComponent<(<T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices" | "removeClippedSubviews" | "children"> & {
|
|
70
71
|
alignItemsAtEnd?: boolean;
|
|
71
72
|
columnWrapperStyle?: _legendapp_list.ColumnWrapperStyle;
|
|
@@ -128,6 +129,7 @@ declare const LegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_nati
|
|
|
128
129
|
onLoad?: (info: {
|
|
129
130
|
elapsedTimeInMs: number;
|
|
130
131
|
}) => void;
|
|
132
|
+
snapToIndices?: number[];
|
|
131
133
|
} & React.RefAttributes<LegendListRef>) => React.ReactNode)> | (<ItemT_1>(props: _legendapp_list_reanimated.AnimatedLegendListProps<ItemT_1> & {
|
|
132
134
|
ref?: React.Ref<LegendListRef>;
|
|
133
135
|
}) => React.ReactElement | null) = <T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices" | "removeClippedSubviews" | "children"> & {
|
|
@@ -192,6 +194,7 @@ declare const LegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_nati
|
|
|
192
194
|
onLoad?: (info: {
|
|
193
195
|
elapsedTimeInMs: number;
|
|
194
196
|
}) => void;
|
|
197
|
+
snapToIndices?: number[];
|
|
195
198
|
} & React.RefAttributes<LegendListRef>) => React.ReactNode>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices" | "removeClippedSubviews" | "children"> & {
|
|
196
199
|
alignItemsAtEnd?: boolean;
|
|
197
200
|
columnWrapperStyle?: _legendapp_list.ColumnWrapperStyle;
|
|
@@ -254,6 +257,7 @@ declare const LegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_nati
|
|
|
254
257
|
onLoad?: (info: {
|
|
255
258
|
elapsedTimeInMs: number;
|
|
256
259
|
}) => void;
|
|
260
|
+
snapToIndices?: number[];
|
|
257
261
|
} & {
|
|
258
262
|
LegendList?: ListT;
|
|
259
263
|
} & React.RefAttributes<LegendListRef>) => React.ReactNode;
|
package/package.json
CHANGED
|
@@ -1,89 +1,35 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
"engines": {
|
|
37
|
-
"node": ">=16.6.0",
|
|
38
|
-
"npm": ">=8.11.0"
|
|
39
|
-
},
|
|
40
|
-
"scripts": {
|
|
41
|
-
"build": "tsup && bun run posttsup.ts",
|
|
42
|
-
"publish": "bun run build && cd dist && npm publish",
|
|
43
|
-
"publish:next": "bun run build && cd dist && npm publish --tag next",
|
|
44
|
-
"publish:beta": "bun run build && cd dist && npm publish --tag beta",
|
|
45
|
-
"lint": "bunx biome check ./src && bunx biome format ./src && bun run lint:example",
|
|
46
|
-
"lint:example": "bunx biome check ./example/app && bunx biome format ./example/app",
|
|
47
|
-
"lint:fix": "bunx biome lint --write ./src && bunx biome format --write ./src && bunx biome check --write ./src && bun run lint:fix:example",
|
|
48
|
-
"lint:fix:example": "bunx biome lint --write ./example/app && bunx biome format --write ./example/app && bunx biome check --write ./example/app"
|
|
49
|
-
},
|
|
50
|
-
"peerDependencies": {
|
|
51
|
-
"react": "*",
|
|
52
|
-
"react-native": "*"
|
|
53
|
-
},
|
|
54
|
-
"devDependencies": {
|
|
55
|
-
"@biomejs/biome": "^1.9.4",
|
|
56
|
-
"@types/bun": "^1.1.13",
|
|
57
|
-
"@types/react": "^18.3.12",
|
|
58
|
-
"@types/use-sync-external-store": "^1.5.0",
|
|
59
|
-
"react": "^18.3.1",
|
|
60
|
-
"react-native": "^0.76.2",
|
|
61
|
-
"react-native-keyboard-controller": "^1.17.0",
|
|
62
|
-
"react-native-reanimated": "^3.16.6",
|
|
63
|
-
"tsup": "^8.3.5",
|
|
64
|
-
"typescript": "^5.8.3"
|
|
65
|
-
},
|
|
66
|
-
"author": "Legend <contact@legendapp.com> (https://github.com/LegendApp)",
|
|
67
|
-
"keywords": [
|
|
68
|
-
"react",
|
|
69
|
-
"react-native",
|
|
70
|
-
"list"
|
|
71
|
-
],
|
|
72
|
-
"repository": "github:LegendApp/legend-list",
|
|
73
|
-
"license": "MIT",
|
|
74
|
-
"bugs": {
|
|
75
|
-
"url": "https://github.com/LegendApp/legend-list/issues"
|
|
76
|
-
},
|
|
77
|
-
"homepage": "https://github.com/LegendApp/legend-list#readme",
|
|
78
|
-
"publishConfig": {
|
|
79
|
-
"registry": "https://registry.npmjs.org/"
|
|
80
|
-
},
|
|
81
|
-
"commitlint": {
|
|
82
|
-
"extends": [
|
|
83
|
-
"@commitlint/config-conventional"
|
|
84
|
-
]
|
|
85
|
-
},
|
|
86
|
-
"dependencies": {
|
|
87
|
-
"use-sync-external-store": "^1.5.0"
|
|
88
|
-
}
|
|
89
|
-
}
|
|
2
|
+
"name": "@legendapp/list",
|
|
3
|
+
"version": "2.0.0-next.3",
|
|
4
|
+
"description": "Legend List is a drop-in replacement for FlatList with much better performance and supporting dynamically sized items.",
|
|
5
|
+
"sideEffects": false,
|
|
6
|
+
"private": false,
|
|
7
|
+
"main": "./index.js",
|
|
8
|
+
"module": "./index.mjs",
|
|
9
|
+
"types": "./index.d.ts",
|
|
10
|
+
"files": [
|
|
11
|
+
"**"
|
|
12
|
+
],
|
|
13
|
+
"peerDependencies": {
|
|
14
|
+
"react": "*",
|
|
15
|
+
"react-native": "*"
|
|
16
|
+
},
|
|
17
|
+
"author": "Legend <contact@legendapp.com> (https://github.com/LegendApp)",
|
|
18
|
+
"keywords": [
|
|
19
|
+
"react",
|
|
20
|
+
"react-native",
|
|
21
|
+
"list"
|
|
22
|
+
],
|
|
23
|
+
"repository": "github:LegendApp/legend-list",
|
|
24
|
+
"license": "MIT",
|
|
25
|
+
"bugs": {
|
|
26
|
+
"url": "https://github.com/LegendApp/legend-list/issues"
|
|
27
|
+
},
|
|
28
|
+
"homepage": "https://github.com/LegendApp/legend-list#readme",
|
|
29
|
+
"publishConfig": {
|
|
30
|
+
"registry": "https://registry.npmjs.org/"
|
|
31
|
+
},
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"use-sync-external-store": "^1.5.0"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description:
|
|
3
|
-
globs: CHANGELOG.md
|
|
4
|
-
alwaysApply: false
|
|
5
|
-
---
|
|
6
|
-
# Changelog Update Rules
|
|
7
|
-
|
|
8
|
-
## Process for Adding Git Changes to Changelog
|
|
9
|
-
|
|
10
|
-
When updating the changelog with recent git commits, follow these guidelines:
|
|
11
|
-
|
|
12
|
-
### 1. Identify Relevant Commits
|
|
13
|
-
- Get all commits since the last version using: `git log --oneline --since="$(git log --grep="X.X.X" --format="%cd" --date=iso | head -1)" --reverse`
|
|
14
|
-
- Exclude non-user-facing commits like:
|
|
15
|
-
- "Update changelog"
|
|
16
|
-
- "chore:" commits
|
|
17
|
-
- Internal refactoring that doesn't affect API
|
|
18
|
-
- "Refactor*" commits
|
|
19
|
-
|
|
20
|
-
### 2. Categorize Changes
|
|
21
|
-
Organize changes by type with these prefixes, in this order:
|
|
22
|
-
- **Feat:** New features and capabilities
|
|
23
|
-
- **Fix:** Bug fixes and corrections
|
|
24
|
-
- **Perf:** Performance improvements
|
|
25
|
-
- **Improvement:** Enhancements to existing functionality
|
|
26
|
-
|
|
27
|
-
Skip **Refactor:**, they don't need to be in the changelog
|
|
28
|
-
|
|
29
|
-
### 3. Format Guidelines
|
|
30
|
-
- Write user-friendly descriptions, not raw commit messages
|
|
31
|
-
- Focus on the impact/benefit to users
|
|
32
|
-
- Be concise but descriptive
|
|
33
|
-
- Use present tense ("Fix X" not "Fixed X")
|
|
34
|
-
- Group similar changes together when possible
|
|
35
|
-
|
|
36
|
-
### 4. Version Organization
|
|
37
|
-
- Add changes to the current version in package.json
|
|
38
|
-
- If significant changes warrant a new version, bump version first
|
|
39
|
-
- List most important changes (breaking changes, major features) first
|
|
40
|
-
- Group fixes and minor improvements at the end
|
|
41
|
-
|
|
42
|
-
### 5. Example Format
|
|
43
|
-
```markdown
|
|
44
|
-
## X.X.X
|
|
45
|
-
- Fix: [Issue description and impact]
|
|
46
|
-
- Fix: [Another bug fix]
|
|
47
|
-
- Feat: [New feature description]
|
|
48
|
-
- Refactor: [API change description]
|
|
49
|
-
- Perf: [Performance improvement description]
|
|
50
|
-
- Improvement: [Enhancement description]
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
### 6. Quality Check
|
|
54
|
-
- Ensure all user-facing changes are documented
|
|
55
|
-
- Verify technical accuracy of descriptions
|
|
56
|
-
- Check that breaking changes are clearly marked
|
|
57
|
-
- Review for consistency in tone and format
|
|
58
|
-
|
|
59
|
-
### 7. Update package version
|
|
60
|
-
If a specific version number is requested and it is newer than the version in package.json, update package.json
|