feat!: API refactor#17
Merged
Merged
Conversation
556c1fc to
65dffc1
Compare
Owner
Author
|
todo: check the export shape |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR refactors the library to the new context-first v1 API, simplifies the public surface, and updates the examples/docs to match it.
The main goal is to replace the old prop-passing header flow with a cleaner model built around:
HeaderMotion.HeaderHeaderMotion.Header.DynamicHeaderMotion.BridgeHeaderMotion.NavigationBridgeuseMotionProgress()It also adds header panning, improves custom-scrollable ergonomics, and rewrites the docs/migration guide around the actual current API.
What changed
New header API
HeaderMotion.Headeris now the actual header container primitiveHeaderMotion.Header.Dynamicmarks the collapsible/measured dynamic sectionHeaderMotion.HeaderHeaderMotion.Header.DynamicasChildsupport was added for bothHeaderandHeader.DynamicNavigation bridging
HeaderMotion.BridgeHeaderMotion.NavigationBridgeuseHeaderMotionBridge()HeaderMotion.HeaderMotion hooks / context
useMotionProgress()was narrowed to the real animation surface:progressprogressThresholduseHeaderMotionBridge()Header panning
HeaderMotion.HeaderpannablepanDecayConfigHeaderPanBoundaryScrollable integration
HeaderMotion.ScrollView,HeaderMotion.FlatList,HeaderMotion.ScrollManager, andcreateHeaderMotionScrollable()headerOffsetStrategyensureScrollableContentMinHeightcreateHeaderMotionScrollable()as the preferred path, with managers as fallback for more complex casesFile / naming cleanup
Bridge.tsxNavigationBridge.tsxHeader.tsxHeaderDynamic.tsxHeaderBase.tsxsrc/index.tsBreaking changes
HeaderMotion.Headeris no longer a render-prop bridgeAnimatedHeaderBasewas removed from the public APIHeaderBasewas removed from the public APIWithCollapsibleHeaderPropswas removedWithCollapsiblePagedHeaderPropswas removeduseMotionProgress()no longer returns measurement callbacksprogressThresholdusage now needs to treat it as aSharedValueBridge+NavigationBridgeExamples and docs
new-apiexampleasChildexampleREADME.mdMIGRATION-v1.md