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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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 |
| 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 | ||
|
Comment on lines
5
to
+10
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): this header now runs 22 lines, past the guide's "about 12 lines at most". * @input The gesture core and Core's motion, touch and direction modules
* @output `@astryxdesign/core/internal/touch`: those modules for Lab, 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'; | ||
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:
@inputnow names the motion, touch and direction modules, but@outputstill says "the gesture core's primitives". Suggested: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.
Done in 3946ad2:
@outputnow reads "the gesture, motion, touch-presentation and direction modules Lab uses, re-exported by name".