@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.
Files changed (260) hide show
  1. package/{dist/animated.d.mts → animated.d.mts} +1 -0
  2. package/{dist/animated.d.ts → animated.d.ts} +1 -0
  3. package/{dist/index.d.mts → index.d.mts} +8 -1
  4. package/{dist/index.d.ts → index.d.ts} +8 -1
  5. package/{dist/index.js → index.js} +50 -4
  6. package/{dist/index.mjs → index.mjs} +50 -4
  7. package/{dist/keyboard-controller.d.mts → keyboard-controller.d.mts} +4 -0
  8. package/{dist/keyboard-controller.d.ts → keyboard-controller.d.ts} +4 -0
  9. package/package.json +34 -88
  10. package/.claude/settings.local.json +0 -8
  11. package/.cursor/rules/changelog.mdc +0 -60
  12. package/.github/FUNDING.yml +0 -15
  13. package/.gitignore +0 -5
  14. package/.prettierrc.json +0 -5
  15. package/.vscode/settings.json +0 -14
  16. package/CLAUDE.md +0 -126
  17. package/biome.json +0 -46
  18. package/bun.lock +0 -1289
  19. package/bunfig.toml +0 -2
  20. package/dist/CHANGELOG.md +0 -119
  21. package/dist/LICENSE +0 -21
  22. package/dist/README.md +0 -139
  23. package/dist/package.json +0 -35
  24. package/example/README.md +0 -40
  25. package/example/api/data/genres.json +0 -23
  26. package/example/api/data/playlist/10402-10749.json +0 -1
  27. package/example/api/data/playlist/10402-10770.json +0 -1
  28. package/example/api/data/playlist/10402-37.json +0 -1
  29. package/example/api/data/playlist/10749-10752.json +0 -1
  30. package/example/api/data/playlist/10749-10770.json +0 -1
  31. package/example/api/data/playlist/10749-37.json +0 -1
  32. package/example/api/data/playlist/10749-878.json +0 -1
  33. package/example/api/data/playlist/10751-10402.json +0 -1
  34. package/example/api/data/playlist/10751-10752.json +0 -1
  35. package/example/api/data/playlist/10751-37.json +0 -1
  36. package/example/api/data/playlist/10751-53.json +0 -1
  37. package/example/api/data/playlist/10751-878.json +0 -1
  38. package/example/api/data/playlist/10751-9648.json +0 -1
  39. package/example/api/data/playlist/10752-37.json +0 -1
  40. package/example/api/data/playlist/12-10402.json +0 -1
  41. package/example/api/data/playlist/12-10749.json +0 -1
  42. package/example/api/data/playlist/12-18.json +0 -1
  43. package/example/api/data/playlist/12-27.json +0 -1
  44. package/example/api/data/playlist/12-35.json +0 -1
  45. package/example/api/data/playlist/14-36.json +0 -1
  46. package/example/api/data/playlist/14-878.json +0 -1
  47. package/example/api/data/playlist/16-10751.json +0 -1
  48. package/example/api/data/playlist/16-10770.json +0 -1
  49. package/example/api/data/playlist/16-35.json +0 -1
  50. package/example/api/data/playlist/16-36.json +0 -1
  51. package/example/api/data/playlist/16-53.json +0 -1
  52. package/example/api/data/playlist/18-10751.json +0 -1
  53. package/example/api/data/playlist/18-10752.json +0 -1
  54. package/example/api/data/playlist/18-37.json +0 -1
  55. package/example/api/data/playlist/18-53.json +0 -1
  56. package/example/api/data/playlist/18-878.json +0 -1
  57. package/example/api/data/playlist/27-10749.json +0 -1
  58. package/example/api/data/playlist/27-10770.json +0 -1
  59. package/example/api/data/playlist/28-10749.json +0 -1
  60. package/example/api/data/playlist/28-10751.json +0 -1
  61. package/example/api/data/playlist/28-10770.json +0 -1
  62. package/example/api/data/playlist/28-16.json +0 -1
  63. package/example/api/data/playlist/28-18.json +0 -1
  64. package/example/api/data/playlist/28-36.json +0 -1
  65. package/example/api/data/playlist/28-37.json +0 -1
  66. package/example/api/data/playlist/28-53.json +0 -1
  67. package/example/api/data/playlist/28-80.json +0 -1
  68. package/example/api/data/playlist/28-99.json +0 -1
  69. package/example/api/data/playlist/35-10749.json +0 -1
  70. package/example/api/data/playlist/35-10751.json +0 -1
  71. package/example/api/data/playlist/35-10752.json +0 -1
  72. package/example/api/data/playlist/35-27.json +0 -1
  73. package/example/api/data/playlist/35-36.json +0 -1
  74. package/example/api/data/playlist/35-53.json +0 -1
  75. package/example/api/data/playlist/35-80.json +0 -1
  76. package/example/api/data/playlist/36-37.json +0 -1
  77. package/example/api/data/playlist/36-878.json +0 -1
  78. package/example/api/data/playlist/36-9648.json +0 -1
  79. package/example/api/data/playlist/53-10752.json +0 -1
  80. package/example/api/data/playlist/80-10770.json +0 -1
  81. package/example/api/data/playlist/80-14.json +0 -1
  82. package/example/api/data/playlist/80-18.json +0 -1
  83. package/example/api/data/playlist/80-37.json +0 -1
  84. package/example/api/data/playlist/878-37.json +0 -1
  85. package/example/api/data/playlist/9648-10770.json +0 -1
  86. package/example/api/data/playlist/9648-37.json +0 -1
  87. package/example/api/data/playlist/9648-53.json +0 -1
  88. package/example/api/data/playlist/9648-878.json +0 -1
  89. package/example/api/data/playlist/99-10749.json +0 -1
  90. package/example/api/data/playlist/99-14.json +0 -1
  91. package/example/api/data/playlist/99-18.json +0 -1
  92. package/example/api/data/playlist/99-27.json +0 -1
  93. package/example/api/data/playlist/99-53.json +0 -1
  94. package/example/api/data/playlist/99-9648.json +0 -1
  95. package/example/api/data/playlist/index.ts +0 -73
  96. package/example/api/data/rows.json +0 -1
  97. package/example/api/index.ts +0 -36
  98. package/example/app/(tabs)/_layout.tsx +0 -60
  99. package/example/app/(tabs)/cards.tsx +0 -81
  100. package/example/app/(tabs)/index.tsx +0 -205
  101. package/example/app/(tabs)/moviesL.tsx +0 -7
  102. package/example/app/(tabs)/moviesLR.tsx +0 -7
  103. package/example/app/+not-found.tsx +0 -32
  104. package/example/app/_layout.tsx +0 -34
  105. package/example/app/accurate-scrollto/index.tsx +0 -125
  106. package/example/app/accurate-scrollto-2/index.tsx +0 -52
  107. package/example/app/accurate-scrollto-huge/index.tsx +0 -128
  108. package/example/app/add-to-end/index.tsx +0 -82
  109. package/example/app/ai-chat/index.tsx +0 -236
  110. package/example/app/bidirectional-infinite-list/index.tsx +0 -133
  111. package/example/app/cards-columns/index.tsx +0 -37
  112. package/example/app/cards-flashlist/index.tsx +0 -122
  113. package/example/app/cards-flatlist/index.tsx +0 -94
  114. package/example/app/cards-no-recycle/index.tsx +0 -110
  115. package/example/app/cards-renderItem.tsx +0 -354
  116. package/example/app/chat-example/index.tsx +0 -167
  117. package/example/app/chat-infinite/index.tsx +0 -239
  118. package/example/app/chat-keyboard/index.tsx +0 -248
  119. package/example/app/chat-resize-outer/index.tsx +0 -247
  120. package/example/app/columns/index.tsx +0 -78
  121. package/example/app/countries/index.tsx +0 -182
  122. package/example/app/countries-flashlist/index.tsx +0 -163
  123. package/example/app/countries-reorder/index.tsx +0 -187
  124. package/example/app/extra-data/index.tsx +0 -86
  125. package/example/app/filter-elements/filter-data-provider.tsx +0 -55
  126. package/example/app/filter-elements/index.tsx +0 -118
  127. package/example/app/initial-scroll-index/index.tsx +0 -106
  128. package/example/app/initial-scroll-index/renderFixedItem.tsx +0 -215
  129. package/example/app/initial-scroll-index-free-height/index.tsx +0 -70
  130. package/example/app/initial-scroll-index-keyed/index.tsx +0 -62
  131. package/example/app/lazy-list/index.tsx +0 -123
  132. package/example/app/movies-flashlist/index.tsx +0 -7
  133. package/example/app/mutable-cells/index.tsx +0 -104
  134. package/example/app/video-feed/index.tsx +0 -119
  135. package/example/app.config.js +0 -22
  136. package/example/app.json +0 -45
  137. package/example/assets/fonts/SpaceMono-Regular.ttf +0 -0
  138. package/example/assets/images/adaptive-icon.png +0 -0
  139. package/example/assets/images/favicon.png +0 -0
  140. package/example/assets/images/icon.png +0 -0
  141. package/example/assets/images/partial-react-logo.png +0 -0
  142. package/example/assets/images/react-logo.png +0 -0
  143. package/example/assets/images/react-logo@2x.png +0 -0
  144. package/example/assets/images/react-logo@3x.png +0 -0
  145. package/example/assets/images/splash-icon.png +0 -0
  146. package/example/autoscroll.sh +0 -101
  147. package/example/bun.lock +0 -2266
  148. package/example/bunfig.toml +0 -2
  149. package/example/components/Breathe.tsx +0 -54
  150. package/example/components/Circle.tsx +0 -69
  151. package/example/components/Collapsible.tsx +0 -44
  152. package/example/components/ExternalLink.tsx +0 -24
  153. package/example/components/HapticTab.tsx +0 -18
  154. package/example/components/HelloWave.tsx +0 -37
  155. package/example/components/Movies.tsx +0 -179
  156. package/example/components/ParallaxScrollView.tsx +0 -81
  157. package/example/components/ThemedText.tsx +0 -60
  158. package/example/components/ThemedView.tsx +0 -14
  159. package/example/components/__tests__/ThemedText-test.tsx +0 -10
  160. package/example/components/__tests__/__snapshots__/ThemedText-test.tsx.snap +0 -24
  161. package/example/components/ui/IconSymbol.ios.tsx +0 -32
  162. package/example/components/ui/IconSymbol.tsx +0 -43
  163. package/example/components/ui/TabBarBackground.ios.tsx +0 -22
  164. package/example/components/ui/TabBarBackground.tsx +0 -6
  165. package/example/constants/Colors.ts +0 -26
  166. package/example/constants/constants.ts +0 -5
  167. package/example/constants/useScrollTest.ts +0 -19
  168. package/example/hooks/useColorScheme.ts +0 -1
  169. package/example/hooks/useColorScheme.web.ts +0 -8
  170. package/example/hooks/useThemeColor.ts +0 -22
  171. package/example/ios/.xcode.env +0 -11
  172. package/example/ios/Podfile +0 -64
  173. package/example/ios/Podfile.lock +0 -2767
  174. package/example/ios/Podfile.properties.json +0 -5
  175. package/example/ios/listtest/AppDelegate.swift +0 -70
  176. package/example/ios/listtest/Images.xcassets/AppIcon.appiconset/App-Icon-1024x1024@1x.png +0 -0
  177. package/example/ios/listtest/Images.xcassets/AppIcon.appiconset/Contents.json +0 -14
  178. package/example/ios/listtest/Images.xcassets/Contents.json +0 -6
  179. package/example/ios/listtest/Images.xcassets/SplashScreenBackground.colorset/Contents.json +0 -20
  180. package/example/ios/listtest/Images.xcassets/SplashScreenLogo.imageset/Contents.json +0 -23
  181. package/example/ios/listtest/Images.xcassets/SplashScreenLogo.imageset/image.png +0 -0
  182. package/example/ios/listtest/Images.xcassets/SplashScreenLogo.imageset/image@2x.png +0 -0
  183. package/example/ios/listtest/Images.xcassets/SplashScreenLogo.imageset/image@3x.png +0 -0
  184. package/example/ios/listtest/Info.plist +0 -85
  185. package/example/ios/listtest/PrivacyInfo.xcprivacy +0 -48
  186. package/example/ios/listtest/SplashScreen.storyboard +0 -42
  187. package/example/ios/listtest/Supporting/Expo.plist +0 -12
  188. package/example/ios/listtest/listtest-Bridging-Header.h +0 -3
  189. package/example/ios/listtest/listtest.entitlements +0 -5
  190. package/example/ios/listtest.xcodeproj/project.pbxproj +0 -547
  191. package/example/ios/listtest.xcodeproj/xcshareddata/xcschemes/listtest.xcscheme +0 -88
  192. package/example/ios/listtest.xcworkspace/contents.xcworkspacedata +0 -10
  193. package/example/metro.config.js +0 -16
  194. package/example/package.json +0 -73
  195. package/example/scripts/reset-project.js +0 -84
  196. package/example/tsconfig.json +0 -26
  197. package/posttsup.ts +0 -24
  198. package/src/Container.tsx +0 -176
  199. package/src/Containers.tsx +0 -85
  200. package/src/ContextContainer.ts +0 -145
  201. package/src/DebugView.tsx +0 -83
  202. package/src/LazyLegendList.tsx +0 -41
  203. package/src/LeanView.tsx +0 -18
  204. package/src/LegendList.tsx +0 -558
  205. package/src/ListComponent.tsx +0 -191
  206. package/src/ScrollAdjust.tsx +0 -24
  207. package/src/ScrollAdjustHandler.ts +0 -26
  208. package/src/Separator.tsx +0 -14
  209. package/src/animated.tsx +0 -6
  210. package/src/calculateItemsInView.ts +0 -363
  211. package/src/calculateOffsetForIndex.ts +0 -23
  212. package/src/calculateOffsetWithOffsetPosition.ts +0 -26
  213. package/src/checkAllSizesKnown.ts +0 -17
  214. package/src/checkAtBottom.ts +0 -36
  215. package/src/checkAtTop.ts +0 -27
  216. package/src/checkThreshold.ts +0 -30
  217. package/src/constants.ts +0 -11
  218. package/src/createColumnWrapperStyle.ts +0 -16
  219. package/src/doInitialAllocateContainers.ts +0 -40
  220. package/src/doMaintainScrollAtEnd.ts +0 -34
  221. package/src/findAvailableContainers.ts +0 -98
  222. package/src/finishScrollTo.ts +0 -8
  223. package/src/getId.ts +0 -21
  224. package/src/getItemSize.ts +0 -52
  225. package/src/getRenderedItem.ts +0 -34
  226. package/src/getScrollVelocity.ts +0 -47
  227. package/src/handleLayout.ts +0 -70
  228. package/src/helpers.ts +0 -39
  229. package/src/index.ts +0 -11
  230. package/src/keyboard-controller.tsx +0 -63
  231. package/src/onScroll.ts +0 -66
  232. package/src/prepareMVCP.ts +0 -50
  233. package/src/reanimated.tsx +0 -63
  234. package/src/requestAdjust.ts +0 -41
  235. package/src/scrollTo.ts +0 -40
  236. package/src/scrollToIndex.ts +0 -34
  237. package/src/setDidLayout.ts +0 -25
  238. package/src/setPaddingTop.ts +0 -28
  239. package/src/state.tsx +0 -304
  240. package/src/types.ts +0 -610
  241. package/src/updateAlignItemsPaddingTop.ts +0 -18
  242. package/src/updateAllPositions.ts +0 -130
  243. package/src/updateItemSize.ts +0 -203
  244. package/src/updateTotalSize.ts +0 -44
  245. package/src/useAnimatedValue.ts +0 -6
  246. package/src/useCombinedRef.ts +0 -22
  247. package/src/useInit.ts +0 -17
  248. package/src/useSyncLayout.tsx +0 -68
  249. package/src/useValue$.ts +0 -53
  250. package/src/viewability.ts +0 -279
  251. package/tsconfig.json +0 -59
  252. package/tsup.config.ts +0 -21
  253. /package/{dist/animated.js → animated.js} +0 -0
  254. /package/{dist/animated.mjs → animated.mjs} +0 -0
  255. /package/{dist/keyboard-controller.js → keyboard-controller.js} +0 -0
  256. /package/{dist/keyboard-controller.mjs → keyboard-controller.mjs} +0 -0
  257. /package/{dist/reanimated.d.mts → reanimated.d.mts} +0 -0
  258. /package/{dist/reanimated.d.ts → reanimated.d.ts} +0 -0
  259. /package/{dist/reanimated.js → reanimated.js} +0 -0
  260. /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
- ScrollComponent,
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 { averageSizes, columns, indexByKey, positions, firstFullyOnScreenIndex, idCache, sizesKnown } = state;
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
- ScrollComponent,
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 { averageSizes, columns, indexByKey, positions, firstFullyOnScreenIndex, idCache, sizesKnown } = state;
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
- "name": "@legendapp/list",
3
- "version": "2.0.0-next.2",
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
- "exports": {
14
- "./package.json": "./package.json",
15
- ".": {
16
- "types": "./index.d.ts",
17
- "import": "./index.mjs",
18
- "require": "./index.js"
19
- },
20
- "./animated": {
21
- "types": "./animated.d.ts",
22
- "import": "./animated.mjs",
23
- "require": "./animated.js"
24
- },
25
- "./reanimated": {
26
- "types": "./reanimated.d.ts",
27
- "import": "./reanimated.mjs",
28
- "require": "./reanimated.js"
29
- },
30
- "./keyboard-controller": {
31
- "types": "./keyboard-controller.d.ts",
32
- "import": "./keyboard-controller.mjs",
33
- "require": "./keyboard-controller.js"
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,8 +0,0 @@
1
- {
2
- "permissions": {
3
- "allow": [
4
- "Bash(bun run:*)"
5
- ],
6
- "deny": []
7
- }
8
- }
@@ -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