Skip to content

Commit b86bd24

Browse files
committed
chore(core): Core's internal touch entry re-exports what Lab's TabBar reads, and its strings join the catalog
Re-exports only, no new behavior: @astryxdesign/core/internal/touch adds the pan recognizer, the press tracker, the finger-scroll reader, the text-selection lock, the touch query, the rubber band and UIKit's gesture values, none under a public factory's name. Core's message catalog gains TabBar's three strings: the More tab's label, the search's Cancel button and a badged tab's name. They land ahead of the Lab component, so the Lab batches change only Lab. The entry stays outside the public API: no docs, no root re-export, and the @astryx/no-core-internal-import rule keeps it to Core and Lab.
1 parent 1748182 commit b86bd24

4 files changed

Lines changed: 47 additions & 4 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+
[experimental] Lab's experimental TabBar reaches Core's pan recognizer, press tracker, finger-scroll reader, selection lock, touch query, rubber band and UIKit gesture values through Core's internal `@astryxdesign/core/internal/touch` entry. That entry stays outside the public API and its compatibility promise. TabBar's strings join Core's message catalog.
6+
7+
@vjeux

‎packages/core/locales/en.json‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -811,10 +811,22 @@
811811
"defaultMessage": "Maximum value",
812812
"description": "Accessible name of the upper thumb of a range Slider (two thumbs), announced together with the Slider's own label, for example \"Price range, Maximum value, 80\". Never shown on screen."
813813
},
814+
"@astryx.tabBar.badgedItem": {
815+
"defaultMessage": "{label}, {badge}",
816+
"description": "Screen-reader name of a bottom tab bar item that shows a badge (\"Library, 3\"). {label} is the tab's visible name; {badge} is the badge's count or its own label (\"3 unread\"). Translators may reorder the two or change the separator."
817+
},
814818
"@astryx.tabList.label": {
815819
"defaultMessage": "Tabs",
816820
"description": "Screen-reader-only fallback name for a horizontal tab bar. Plural noun; \"Tabs\" here = UI tab panels, not browser tabs or the Tab key."
817821
},
822+
"@astryx.tabBar.more": {
823+
"defaultMessage": "More",
824+
"description": "Label of the tab that collects a phone tab bar's sections past the fourth (iOS's More tab), and the name of the list of those sections it shows. One short word."
825+
},
826+
"@astryx.tabBar.cancelSearch": {
827+
"defaultMessage": "Cancel",
828+
"description": "Name of the button that ends search in a phone tab bar's search tab. The tab bar draws it over its search circle, beside the active field, as iOS draws its cancel button. It is the tab bar's own button, not the search field's own Cancel button. One short word."
829+
},
818830
"@astryx.table.label": {
819831
"defaultMessage": "Table",
820832
"description": "Fallback screen-reader-only accessible name for a data-table region when the consumer provides none. Noun (\"a table\"), not the verb \"to table\"."

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,22 @@ describe('internal/touch', () => {
5656
expect(entry).not.toHaveProperty('touchModule');
5757
});
5858

59+
it('re-exports the pan recognizer, the press tracker, the finger-scroll reader, the selection lock, the touch query, the rubber band and UIKit gesture values by name', async () => {
60+
const entry: Record<string, unknown> = await import('./touch');
61+
const modules: Record<string, Record<string, unknown>> = {
62+
PanGestureRecognizer: await import('../gestures/PanGestureRecognizer'),
63+
useFingerScroll: await import('../gestures/useFingerScroll'),
64+
usePressTracker: await import('../gestures/usePressTracker'),
65+
lockSelection: await import('../utils/selectionLock'),
66+
TOUCH_QUERY: await import('../utils/touchQueries'),
67+
rubberBand: await import('../motion/rubberBand'),
68+
UIKIT_GESTURES: await import('../motion/uikit/gestures'),
69+
};
70+
for (const [name, module] of Object.entries(modules)) {
71+
expect(entry[name], name).toBe(module[name]);
72+
}
73+
});
74+
5975
it('attaches no window or document listeners when it loads', async () => {
6076
vi.resetModules();
6177
const onWindow = vi.spyOn(window, 'addEventListener');

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

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22

33
/**
44
* @file touch.ts
5-
* @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
5+
* @input The gesture core: the arena, the recognizers and their geometry,
6+
* React hook, press tracker, finger-scroll reader and text-selection lock.
7+
* The animator, the cubic-bézier solver, the rubber band and UIKit's gesture
8+
* and timing tables. The touch-presentation hook and its query, the
9+
* writing-direction read, and whether the click 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,9 +41,12 @@ 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';
47+
export {useFingerScroll} from '../gestures/useFingerScroll';
4548
export {useGestureRecognizer} from '../gestures/useGestureRecognizer';
49+
export {usePressTracker} from '../gestures/usePressTracker';
4650
export {isRtlElement} from '../hooks/isRtlElement';
4751
// The animator's internal factory, under a name no public factory has: the
4852
// public animator factory is `createAnimator`.
@@ -55,6 +59,10 @@ export type {
5559
MotionHandle,
5660
} from '../motion/animator';
5761
export {cubicBezier} from '../motion/bezier';
62+
export {rubberBand} from '../motion/rubberBand';
63+
export {UIKIT_GESTURES} from '../motion/uikit/gestures';
5864
export {timing} from '../motion/uikit/timing';
5965
export {isClickGuardArmed} from '../utils/clickGuard';
66+
export {lockSelection} from '../utils/selectionLock';
6067
export {useTouchPresentation} from '../utils/touchPresentation';
68+
export {TOUCH_QUERY} from '../utils/touchQueries';

0 commit comments

Comments
 (0)