Repository navigation
feat(core): the rect morph's paths, the rect a grow-out presentation shows at each progress #9764
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
base: main
Are you sure you want to change the base?
Changes from all commits
3dd581e
3cfb3b1
273da1e
f1149cd
df642e0
1b794af
ad7f8fb
822013a
6354fa3
6176b9d
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: the rect morph's paths, the geometry touch presentations share when they grow out of a source rect and shrink back into it. `lerpPath` (a straight line between two rects) and `edgeGrowPath` (UIKit's popover, growing out of a point on its edge) name the rect an element shows at each progress, and say how an interrupted motion continues in their own law; `morphCurves` turns a path into compositor curves (`translate`, `scale` and a companion `opacity`). Not exported from the package entry point; no component uses them yet. | ||
|
|
||
| @vjeux |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -56,8 +56,11 @@ export type { | |
| /** | ||
| * The curves from `from` to `to` as `progress` moves from 0 to 1. The scale | ||
| * and the length move together, so the scale along the axis is their product. | ||
| * | ||
| * @internal Read by the rect morph's popover proofs; not exported from the | ||
| * package. | ||
| */ | ||
| function surfaceCurves( | ||
| export function surfaceCurves( | ||
|
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. Miss, non-blocking: this file's header still lists only |
||
| from: SurfaceState, | ||
| to: SurfaceState, | ||
| axis: 'x' | 'y', | ||
|
|
@@ -82,8 +85,16 @@ function timingOn(element: Element, tokens: ThemeTimingTokens): MotionCurve { | |
| return readThemeTiming(element, tokens) ?? easedProgress(0, x => x); | ||
| } | ||
|
|
||
| /** What `animator` shows now, split back into scale and length. */ | ||
| function readState(animator: Animator, axis: 'x' | 'y'): SurfaceState { | ||
| /** | ||
| * What `animator` shows now, split back into scale and length. | ||
| * | ||
| * @internal Read by the rect morph's popover proofs; not exported from the | ||
| * package. | ||
| */ | ||
| export function readState( | ||
| animator: Pick<Animator, 'get'>, | ||
| axis: 'x' | 'y', | ||
| ): SurfaceState { | ||
| const across = animator.get(axis === 'x' ? 'scaleY' : 'scaleX'); | ||
| const along = animator.get(axis === 'x' ? 'scaleX' : 'scaleY'); | ||
| return { | ||
|
|
||
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.
Non-blocking:
motion/rectMorph.tsis not onmainor at this head yet, so this clause makes the current record describe a file that does not exist until #9769 lands. Consider dropping "motion/rectMorph.tsimports it;" here and adding it with #9769.