Skip to content

Commit 0a0243a

Browse files
committed
chore(core): Lab's PageControl reaches the pan recognizer, an element's shared animator and the Reduce Motion cross-fade through Core's internal touch entry
Internal entries land with their first user, per #8562. Lab's PageControl scrubs with Core's pan recognizer, animates its strip and dots with each element's one shared animator (the strip's slide and a dot's size and fade compose on it), and reads the Reduce Motion cross-fade's timing, so `@astryxdesign/core/internal/touch` also re-exports, by name: - `PanGestureRecognizer`; - `animatorFor`, an element's shared animator, as Core's components reach it (no public API has the name); - `reducedMotionFade`. Named re-exports only, of code already on main: no behavior change, no docs, no root re-export, no new entry, and the `@astryx/no-core-internal-import` lint rule already limits the entry to Core and Lab. The entry's test checks it re-exports the same values Core imports by path.
1 parent 1748182 commit 0a0243a

3 files changed

Lines changed: 23 additions & 3 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@astryxdesign/core': patch
3+
---
4+
5+
[chore] Internal: `@astryxdesign/core/internal/touch` also re-exports the pan recognizer, an element's shared animator and the Reduce Motion cross-fade, for Lab's PageControl. It is an internal entry reserved for Astryx's own packages, outside the public API.
6+
7+
@vjeux

‎packages/core/src/internal/touch.test.ts‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,13 @@ describe('internal/touch', () => {
4242
expect(entry.createMotionAnimator).toBe(animator.createAnimator);
4343
expect(entry.cubicBezier).toBe(bezier.cubicBezier);
4444
expect(entry.timing).toBe(uikitTiming.timing);
45+
// The pan recognizer, an element's shared animator and the Reduce Motion
46+
// cross-fade, as Lab's PageControl reads them.
47+
const pan = await import('../gestures/PanGestureRecognizer');
48+
const reduced = await import('../motion/reducedMotion');
49+
expect(entry.PanGestureRecognizer).toBe(pan.PanGestureRecognizer);
50+
expect(entry.animatorFor).toBe(animator.animatorFor);
51+
expect(entry.reducedMotionFade).toBe(reduced.reducedMotionFade);
4552
// No internal factory shares a public factory's name
4653
// (architecture:react-component-runtime INV13, spec:AST-107 FR6).
4754
for (const name of [

‎packages/core/src/internal/touch.ts‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
/**
44
* @file touch.ts
55
* @input The gesture core: the arena, the recognizers, their geometry and
6-
* their React hook; the animator, the cubic-bézier solver and UIKit's
7-
* timing table; the touch-presentation hook; the writing-direction read;
8-
* whether the click guard is armed
6+
* their React hook. The motion core: the animators, the Reduce Motion
7+
* cross-fade, the cubic-bézier solver and UIKit's timing table. The
8+
* touch-presentation hook, the writing-direction read and whether the click
9+
* guard is armed
910
* @output `@astryxdesign/core/internal/touch`: the gesture core's primitives
1011
* for Lab components, re-exported by name
1112
* @position An internal entry reserved for Astryx's own packages:
@@ -40,6 +41,7 @@ export {
4041
unwrapAngle,
4142
} from '../gestures/geometry';
4243
export {LongPressGestureRecognizer} from '../gestures/LongPressGestureRecognizer';
44+
export {PanGestureRecognizer} from '../gestures/PanGestureRecognizer';
4345
export {TapGestureRecognizer} from '../gestures/TapGestureRecognizer';
4446
export {DEFAULT_ENVIRONMENT} from '../gestures/types';
4547
export {useGestureRecognizer} from '../gestures/useGestureRecognizer';
@@ -54,7 +56,11 @@ export type {
5456
MotionCurve,
5557
MotionHandle,
5658
} from '../motion/animator';
59+
// An element's one shared animator, as Core's components reach it (no public
60+
// API has the name), and the Reduce Motion cross-fade's timing.
61+
export {animatorFor} from '../motion/animator';
5762
export {cubicBezier} from '../motion/bezier';
63+
export {reducedMotionFade} from '../motion/reducedMotion';
5864
export {timing} from '../motion/uikit/timing';
5965
export {isClickGuardArmed} from '../utils/clickGuard';
6066
export {useTouchPresentation} from '../utils/touchPresentation';

0 commit comments

Comments
 (0)