@legendapp/list 2.0.0-next.2 → 2.0.0-next.21
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} +10 -3
- package/{dist/animated.d.ts → animated.d.ts} +10 -3
- package/{dist/animated.js → animated.js} +2 -2
- package/{dist/animated.mjs → animated.mjs} +2 -2
- package/{dist/index.d.mts → index.d.mts} +86 -167
- package/{dist/index.d.ts → index.d.ts} +86 -167
- package/{dist/index.js → index.js} +1594 -1098
- package/{dist/index.mjs → index.mjs} +1596 -1100
- package/keyboard-controller.d.mts +148 -0
- package/keyboard-controller.d.ts +148 -0
- package/{dist/keyboard-controller.js → keyboard-controller.js} +4 -4
- package/{dist/keyboard-controller.mjs → keyboard-controller.mjs} +4 -4
- package/package.json +34 -88
- package/{dist/reanimated.d.mts → reanimated.d.mts} +2 -2
- package/{dist/reanimated.d.ts → reanimated.d.ts} +2 -2
- package/reanimated.js +60 -0
- package/reanimated.mjs +53 -0
- 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/keyboard-controller.d.mts +0 -261
- package/dist/keyboard-controller.d.ts +0 -261
- package/dist/package.json +0 -35
- package/dist/reanimated.js +0 -58
- package/dist/reanimated.mjs +0 -51
- 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
|
@@ -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
|
package/.github/FUNDING.yml
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
# These are supported funding model platforms
|
|
2
|
-
|
|
3
|
-
github: [jmeistrich]
|
|
4
|
-
patreon: # Replace with a single Patreon username
|
|
5
|
-
open_collective: # Replace with a single Open Collective username
|
|
6
|
-
ko_fi: # Replace with a single Ko-fi username
|
|
7
|
-
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
|
8
|
-
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
|
9
|
-
liberapay: # Replace with a single Liberapay username
|
|
10
|
-
issuehunt: # Replace with a single IssueHunt username
|
|
11
|
-
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
|
|
12
|
-
polar: # Replace with a single Polar username
|
|
13
|
-
buy_me_a_coffee: # Replace with a single Buy Me a Coffee username
|
|
14
|
-
thanks_dev: # Replace with a single thanks.dev username
|
|
15
|
-
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
|
package/.gitignore
DELETED
package/.prettierrc.json
DELETED
package/.vscode/settings.json
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"editor.codeActionsOnSave": {
|
|
3
|
-
"source.organizeImports.biome": "explicit",
|
|
4
|
-
"quickfix.biome": "explicit"
|
|
5
|
-
},
|
|
6
|
-
"editor.defaultFormatter": "biomejs.biome",
|
|
7
|
-
"[typescriptreact]": {
|
|
8
|
-
"editor.defaultFormatter": "biomejs.biome"
|
|
9
|
-
},
|
|
10
|
-
"[typescript]": {
|
|
11
|
-
"editor.defaultFormatter": "biomejs.biome"
|
|
12
|
-
},
|
|
13
|
-
"editor.formatOnSave": true
|
|
14
|
-
}
|
package/CLAUDE.md
DELETED
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
# CLAUDE.md
|
|
2
|
-
|
|
3
|
-
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
|
4
|
-
|
|
5
|
-
## Development Commands
|
|
6
|
-
|
|
7
|
-
### Build and Development
|
|
8
|
-
- `bun run build` - Build the package using tsup and run post-build script
|
|
9
|
-
- `bun run publish:manual` - Build and publish to npm manually
|
|
10
|
-
- `bun run lint` - Check code formatting with Biome for src and example
|
|
11
|
-
- `bun run lint:fix` - Auto-fix formatting issues with Biome for src and example
|
|
12
|
-
|
|
13
|
-
### Example App Development
|
|
14
|
-
The repository includes a React Native example app in the `example/` directory:
|
|
15
|
-
- `cd example && bun i && bun run ios` - Run the example app on iOS
|
|
16
|
-
- Example app uses Expo and demonstrates various Legend List features
|
|
17
|
-
|
|
18
|
-
### Build Process
|
|
19
|
-
- Uses tsup for TypeScript compilation with multiple entry points:
|
|
20
|
-
- `src/index.ts` (main export)
|
|
21
|
-
- `src/animated.tsx` (animated variant)
|
|
22
|
-
- `src/reanimated.tsx` (reanimated variant)
|
|
23
|
-
- `src/keyboard-controller.tsx` (keyboard integration)
|
|
24
|
-
- Post-build script (`posttsup.ts`) copies LICENSE, CHANGELOG.md, README.md to dist and modifies package.json for publishing
|
|
25
|
-
- Builds to both CommonJS and ESM formats with TypeScript declarations
|
|
26
|
-
|
|
27
|
-
## Architecture Overview
|
|
28
|
-
|
|
29
|
-
Legend List is a high-performance React Native list component designed as a drop-in replacement for FlatList with better performance, especially for dynamically sized items.
|
|
30
|
-
|
|
31
|
-
### Core Components
|
|
32
|
-
|
|
33
|
-
**LegendList** (`src/LegendList.tsx`): Main component that wraps functionality in a StateProvider
|
|
34
|
-
- Handles virtualization logic, scroll management, and item positioning
|
|
35
|
-
- Manages anchor elements for `maintainVisibleContentPosition`
|
|
36
|
-
- Implements advanced scroll adjustment and jump prevention
|
|
37
|
-
- Uses container recycling for optimal performance
|
|
38
|
-
|
|
39
|
-
**State Management** (`src/state.tsx`): Global state management using observable patterns
|
|
40
|
-
- Manages container positions, item data, and scroll state
|
|
41
|
-
- Provides reactive updates to child components
|
|
42
|
-
|
|
43
|
-
**Container System** (`src/Container.tsx`, `src/Containers.tsx`): Manages item rendering containers
|
|
44
|
-
- Implements container recycling when `recycleItems` is enabled
|
|
45
|
-
- Handles absolute positioning of list items
|
|
46
|
-
- Manages container allocation and deallocation
|
|
47
|
-
|
|
48
|
-
**Scroll Adjustment** (`src/ScrollAdjustHandler.ts`): Handles complex scroll position adjustments
|
|
49
|
-
- Prevents scroll jumps when items are added/removed
|
|
50
|
-
- Manages scroll position during layout changes
|
|
51
|
-
|
|
52
|
-
### Key Features Architecture
|
|
53
|
-
|
|
54
|
-
**Dynamic Item Sizing**: Items can have varying heights without performance penalties
|
|
55
|
-
- Uses `getEstimatedItemSize` or `estimatedItemSize` for initial estimates
|
|
56
|
-
- Measures actual sizes on layout and adjusts total size calculations
|
|
57
|
-
- Maintains position accuracy through size change events
|
|
58
|
-
|
|
59
|
-
**Bidirectional Infinite Lists**: Supports infinite scrolling in both directions
|
|
60
|
-
- `onStartReached` and `onEndReached` callbacks with configurable thresholds
|
|
61
|
-
- Maintains scroll position when items are added to the beginning
|
|
62
|
-
|
|
63
|
-
**Chat UI Support**:
|
|
64
|
-
- `alignItemsAtEnd` aligns content to bottom for chat interfaces
|
|
65
|
-
- `maintainScrollAtEnd` automatically scrolls to end when new items are added
|
|
66
|
-
- Avoids need for inverted lists which cause animation issues
|
|
67
|
-
|
|
68
|
-
**Column Support**: Multi-column layouts via `numColumns` prop
|
|
69
|
-
- Manages row heights when items have different sizes within the same row
|
|
70
|
-
- Handles column-aware positioning and gap calculations via `columnWrapperStyle`
|
|
71
|
-
|
|
72
|
-
### Performance Optimizations
|
|
73
|
-
|
|
74
|
-
**Virtualization**: Only renders items in the visible area plus buffer zones
|
|
75
|
-
- `drawDistance` controls how far ahead/behind to render items
|
|
76
|
-
- Dynamic buffer adjustment based on scroll velocity
|
|
77
|
-
- Container recycling to minimize React element creation/destruction
|
|
78
|
-
|
|
79
|
-
**Scroll Jump Prevention**: Sophisticated system to prevent visual jumps
|
|
80
|
-
- Anchor element tracking for `maintainVisibleContentPosition`
|
|
81
|
-
- Scroll history tracking for velocity calculations
|
|
82
|
-
- Position adjustment when item sizes change
|
|
83
|
-
|
|
84
|
-
**Batched Updates**: Groups layout calculations to reduce renders
|
|
85
|
-
- Uses `requestAnimationFrame` for batching size change calculations
|
|
86
|
-
- Optimizes container position updates
|
|
87
|
-
|
|
88
|
-
## Integration Patterns
|
|
89
|
-
|
|
90
|
-
### Basic Usage
|
|
91
|
-
Legend List is designed as a drop-in FlatList replacement:
|
|
92
|
-
```typescript
|
|
93
|
-
<LegendList
|
|
94
|
-
data={data}
|
|
95
|
-
renderItem={renderItem}
|
|
96
|
-
keyExtractor={(item) => item.id}
|
|
97
|
-
recycleItems={true}
|
|
98
|
-
/>
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
### Optional Integrations
|
|
102
|
-
- **Animated**: `@legendapp/list/animated` - Works with React Native Animated
|
|
103
|
-
- **Reanimated**: `@legendapp/list/reanimated` - Works with React Native Reanimated
|
|
104
|
-
- **Keyboard Controller**: `@legendapp/list/keyboard-controller` - Integrates with react-native-keyboard-controller
|
|
105
|
-
|
|
106
|
-
### Viewability Tracking
|
|
107
|
-
Supports advanced viewability detection:
|
|
108
|
-
- Compatible with FlatList's `viewabilityConfig` and `onViewableItemsChanged`
|
|
109
|
-
- Custom hooks available: `useViewability`, `useViewabilityAmount`
|
|
110
|
-
|
|
111
|
-
## Important Development Notes
|
|
112
|
-
|
|
113
|
-
- When working with container recycling (`recycleItems={true}`), be cautious about local state in item components
|
|
114
|
-
- The `keyExtractor` is crucial for performance and correct behavior when data changes
|
|
115
|
-
- Use `getEstimatedItemSize` for better performance with varying item sizes
|
|
116
|
-
- The component uses advanced scroll position management that should not be interfered with directly
|
|
117
|
-
|
|
118
|
-
## Configuration Files
|
|
119
|
-
|
|
120
|
-
- **Biome** (`biome.json`): Used for linting and formatting with specific rules for the project
|
|
121
|
-
- **TypeScript** (`tsconfig.json`): Configured for React Native with path mappings for internal imports
|
|
122
|
-
- **Cursor Rules**: `.cursor/rules/changelog.mdc` contains guidelines for maintaining the changelog
|
|
123
|
-
|
|
124
|
-
## Testing the Library
|
|
125
|
-
|
|
126
|
-
To test changes, use the comprehensive example app which demonstrates various scenarios including dynamic sizing, infinite loading, chat interfaces, and performance comparisons with FlatList.
|
package/biome.json
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
|
|
3
|
-
"vcs": {
|
|
4
|
-
"enabled": false,
|
|
5
|
-
"clientKind": "git",
|
|
6
|
-
"useIgnoreFile": false
|
|
7
|
-
},
|
|
8
|
-
"files": {
|
|
9
|
-
"ignoreUnknown": false,
|
|
10
|
-
"ignore": []
|
|
11
|
-
},
|
|
12
|
-
"formatter": {
|
|
13
|
-
"enabled": true,
|
|
14
|
-
"formatWithErrors": false,
|
|
15
|
-
"indentStyle": "space",
|
|
16
|
-
"indentWidth": 4,
|
|
17
|
-
"lineEnding": "lf",
|
|
18
|
-
"lineWidth": 120
|
|
19
|
-
},
|
|
20
|
-
"organizeImports": {
|
|
21
|
-
"enabled": true
|
|
22
|
-
},
|
|
23
|
-
"linter": {
|
|
24
|
-
"enabled": true,
|
|
25
|
-
"rules": {
|
|
26
|
-
"recommended": true,
|
|
27
|
-
"style": {
|
|
28
|
-
"noNonNullAssertion": "off"
|
|
29
|
-
},
|
|
30
|
-
"suspicious": {
|
|
31
|
-
"noArrayIndexKey": "off",
|
|
32
|
-
"noExplicitAny": "off",
|
|
33
|
-
"noConfusingVoidType": "off"
|
|
34
|
-
},
|
|
35
|
-
"correctness": {
|
|
36
|
-
"noUnusedImports": "warn",
|
|
37
|
-
"useExhaustiveDependencies": "off"
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
|
-
"javascript": {
|
|
42
|
-
"formatter": {
|
|
43
|
-
"quoteStyle": "double"
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|