Repository navigation
chore(lab): Lab's animator hook, over Core's internal touch entry #9754
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+298
−123
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| --- | ||
| '@astryxdesign/core': patch | ||
| --- | ||
|
|
||
| [chore] Internal: Core's internal motion engine factory is renamed `createMotionEngine` (from `createMotionAnimator`), with its types `MotionEngine` and `MotionEngineOptions`, at its source and in every internal caller. Core's internal touch entry also re-exports, by name, the UIKit gesture values, the right-to-left check, and the touch-presentation hook and query that Lab components read. Lab's `useMotionEngine` hook wraps the engine, and Lab's refresh control uses it. Apps import nothing new. | ||
|
|
||
| @vjeux |
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
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
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
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
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
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,10 +3,11 @@ | |
| /** | ||
| * @file touch.ts | ||
| * @input The gesture core: the arena, the recognizers, and their geometry; | ||
| * the pan, the motion animator and the motion math that Lab's | ||
| * useRefreshControl reads | ||
| * the pan, the motion engine and math, and the touch-presentation and | ||
| * direction helpers that Lab components read | ||
| * @output `@astryxdesign/core/internal/touch`: the gesture core's primitives | ||
| * for Lab components, re-exported by name | ||
| * and the motion, touch-presentation and direction modules for Lab | ||
| * components, re-exported by name | ||
| * @position An internal entry reserved for Astryx's own packages: | ||
| * undocumented, outside the public API and its compatibility promise | ||
| * (spec:AST-017 FR21), versioned in lockstep with Core, and allowed only in | ||
|
|
@@ -43,7 +44,7 @@ export {TapGestureRecognizer} from '../gestures/TapGestureRecognizer'; | |
| export {DEFAULT_ENVIRONMENT} from '../gestures/types'; | ||
|
|
||
| // Lab's useRefreshControl reads these: its pull's pan and the hook that | ||
| // starts it. It also reads the motion animator and math, and the scroll | ||
| // starts it. It also reads the motion engine and math, and the scroll | ||
| // view's bounce spring, for its pull, settle and end. Its indicator fades | ||
| // along the settle's curve, and the motion-role parsers read the theme's | ||
| // tokens for its end. | ||
|
|
@@ -55,12 +56,12 @@ export type { | |
| PointerKind, | ||
| } from '../gestures/types'; | ||
| export {useGestureRecognizer} from '../gestures/useGestureRecognizer'; | ||
| // The animator's internal factory. The public one, `createAnimator`, plays | ||
| // The motion engine's factory. The public one, `createAnimator`, plays | ||
| // only the theme's state-change motion. | ||
|
Comment on lines
+59
to
60
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Optional (source-comment guide): "The motion engine's factory." restates the export below. The second sentence is the reason, so it can stand alone: // The public `createAnimator` plays only the theme's state-change motion. |
||
| export {createMotionAnimator} from '../motion/animator'; | ||
| export {createMotionEngine} from '../motion/animator'; | ||
| export type { | ||
| Animator as MotionAnimator, | ||
| AnimatorOptions as MotionAnimatorOptions, | ||
| Animator as MotionEngine, | ||
| AnimatorOptions as MotionEngineOptions, | ||
| MotionCurve, | ||
| } from '../motion/animator'; | ||
| export {cubicBezier} from '../motion/bezier'; | ||
|
|
@@ -72,3 +73,10 @@ export { | |
| rubberBandSlope, | ||
| } from '../motion/rubberBand'; | ||
| export {scroll} from '../motion/uikit/scroll'; | ||
|
|
||
| // Lab components also read the UIKit gesture table, the touch presentation | ||
| // and its query, and an element's direction. | ||
| export {isRtlElement} from '../hooks/isRtlElement'; | ||
| export {UIKIT_GESTURES} from '../motion/uikit/gestures'; | ||
| export {useTouchPresentation} from '../utils/touchPresentation'; | ||
| export {TOUCH_QUERY} from '../utils/touchQueries'; | ||
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optional (source-comment guide): this header now runs 22 lines, past the guide's "about 12 lines at most".
@inputand@outputfit on one line each: