@oxy.so/bloom 4.15.0 → 4.16.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/app-shell.mdx +74 -6
- package/docs/bottom-bar.mdx +9 -1
- package/docs/hooks.mdx +23 -0
- package/docs/sidebar.mdx +15 -2
- package/docs/tab-bar.mdx +1 -1
- package/lib/commonjs/app-shell/AppShell.js +3 -1
- package/lib/commonjs/app-shell/AppShell.js.map +1 -1
- package/lib/commonjs/app-shell/AppShellEngine.js +54 -28
- package/lib/commonjs/app-shell/AppShellEngine.js.map +1 -1
- package/lib/commonjs/app-shell/AppShellHeader.js +4 -3
- package/lib/commonjs/app-shell/AppShellHeader.js.map +1 -1
- package/lib/commonjs/app-shell/NotificationBell.js +8 -4
- package/lib/commonjs/app-shell/NotificationBell.js.map +1 -1
- package/lib/commonjs/app-shell/ProOfferCard.js +19 -11
- package/lib/commonjs/app-shell/ProOfferCard.js.map +1 -1
- package/lib/commonjs/bottom-bar/BottomBarBase.js +9 -2
- package/lib/commonjs/bottom-bar/BottomBarBase.js.map +1 -1
- package/lib/commonjs/hooks/index.js +7 -0
- package/lib/commonjs/hooks/index.js.map +1 -1
- package/lib/commonjs/hooks/use-is-rtl.js +104 -0
- package/lib/commonjs/hooks/use-is-rtl.js.map +1 -0
- package/lib/commonjs/sidebar/Sidebar.js +41 -22
- package/lib/commonjs/sidebar/Sidebar.js.map +1 -1
- package/lib/commonjs/sidebar/SidebarFolder.js +11 -5
- package/lib/commonjs/sidebar/SidebarFolder.js.map +1 -1
- package/lib/commonjs/sidebar/SidebarLogoView.js +2 -2
- package/lib/commonjs/sidebar/SidebarLogoView.js.map +1 -1
- package/lib/commonjs/sidebar/SidebarModeSwitcher.js +1 -1
- package/lib/commonjs/sidebar/SidebarModeSwitcher.js.map +1 -1
- package/lib/commonjs/sidebar/SidebarPlanCard.js +3 -3
- package/lib/commonjs/sidebar/SidebarPlanCard.js.map +1 -1
- package/lib/commonjs/sidebar/SidebarRail.js +7 -1
- package/lib/commonjs/sidebar/SidebarRail.js.map +1 -1
- package/lib/commonjs/sidebar/SidebarRailItem.js +2 -2
- package/lib/commonjs/sidebar/SidebarRailItem.js.map +1 -1
- package/lib/commonjs/sidebar/SidebarTeamMenu.js +12 -7
- package/lib/commonjs/sidebar/SidebarTeamMenu.js.map +1 -1
- package/lib/commonjs/sidebar/SidebarUserMenu.js +9 -5
- package/lib/commonjs/sidebar/SidebarUserMenu.js.map +1 -1
- package/lib/commonjs/tab-bar/TabBarBase.js +57 -21
- package/lib/commonjs/tab-bar/TabBarBase.js.map +1 -1
- package/lib/module/app-shell/AppShell.js +3 -1
- package/lib/module/app-shell/AppShell.js.map +1 -1
- package/lib/module/app-shell/AppShellEngine.js +54 -28
- package/lib/module/app-shell/AppShellEngine.js.map +1 -1
- package/lib/module/app-shell/AppShellHeader.js +4 -3
- package/lib/module/app-shell/AppShellHeader.js.map +1 -1
- package/lib/module/app-shell/NotificationBell.js +8 -4
- package/lib/module/app-shell/NotificationBell.js.map +1 -1
- package/lib/module/app-shell/ProOfferCard.js +19 -11
- package/lib/module/app-shell/ProOfferCard.js.map +1 -1
- package/lib/module/bottom-bar/BottomBarBase.js +9 -2
- package/lib/module/bottom-bar/BottomBarBase.js.map +1 -1
- package/lib/module/hooks/index.js +1 -0
- package/lib/module/hooks/index.js.map +1 -1
- package/lib/module/hooks/use-is-rtl.js +97 -0
- package/lib/module/hooks/use-is-rtl.js.map +1 -0
- package/lib/module/sidebar/Sidebar.js +41 -22
- package/lib/module/sidebar/Sidebar.js.map +1 -1
- package/lib/module/sidebar/SidebarFolder.js +11 -5
- package/lib/module/sidebar/SidebarFolder.js.map +1 -1
- package/lib/module/sidebar/SidebarLogoView.js +2 -2
- package/lib/module/sidebar/SidebarLogoView.js.map +1 -1
- package/lib/module/sidebar/SidebarModeSwitcher.js +1 -1
- package/lib/module/sidebar/SidebarModeSwitcher.js.map +1 -1
- package/lib/module/sidebar/SidebarPlanCard.js +3 -3
- package/lib/module/sidebar/SidebarPlanCard.js.map +1 -1
- package/lib/module/sidebar/SidebarRail.js +7 -1
- package/lib/module/sidebar/SidebarRail.js.map +1 -1
- package/lib/module/sidebar/SidebarRailItem.js +2 -2
- package/lib/module/sidebar/SidebarRailItem.js.map +1 -1
- package/lib/module/sidebar/SidebarTeamMenu.js +12 -7
- package/lib/module/sidebar/SidebarTeamMenu.js.map +1 -1
- package/lib/module/sidebar/SidebarUserMenu.js +9 -5
- package/lib/module/sidebar/SidebarUserMenu.js.map +1 -1
- package/lib/module/tab-bar/TabBarBase.js +57 -21
- package/lib/module/tab-bar/TabBarBase.js.map +1 -1
- package/lib/typescript/commonjs/app-shell/AppShellEngine.d.ts.map +1 -1
- package/lib/typescript/commonjs/app-shell/AppShellHeader.d.ts.map +1 -1
- package/lib/typescript/commonjs/app-shell/NotificationBell.d.ts.map +1 -1
- package/lib/typescript/commonjs/app-shell/ProOfferCard.d.ts.map +1 -1
- package/lib/typescript/commonjs/app-shell/types.d.ts +16 -5
- package/lib/typescript/commonjs/app-shell/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/bottom-bar/BottomBarBase.d.ts.map +1 -1
- package/lib/typescript/commonjs/hooks/index.d.ts +1 -0
- package/lib/typescript/commonjs/hooks/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/hooks/use-is-rtl.d.ts +53 -0
- package/lib/typescript/commonjs/hooks/use-is-rtl.d.ts.map +1 -0
- package/lib/typescript/commonjs/icons/shared.d.ts +10 -10
- package/lib/typescript/commonjs/sidebar/Sidebar.d.ts.map +1 -1
- package/lib/typescript/commonjs/sidebar/SidebarFolder.d.ts.map +1 -1
- package/lib/typescript/commonjs/sidebar/SidebarRail.d.ts +1 -1
- package/lib/typescript/commonjs/sidebar/SidebarRail.d.ts.map +1 -1
- package/lib/typescript/commonjs/sidebar/SidebarTeamMenu.d.ts.map +1 -1
- package/lib/typescript/commonjs/sidebar/SidebarUserMenu.d.ts.map +1 -1
- package/lib/typescript/commonjs/sidebar/types.d.ts +24 -3
- package/lib/typescript/commonjs/sidebar/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/tab-bar/TabBarBase.d.ts.map +1 -1
- package/lib/typescript/module/app-shell/AppShellEngine.d.ts.map +1 -1
- package/lib/typescript/module/app-shell/AppShellHeader.d.ts.map +1 -1
- package/lib/typescript/module/app-shell/NotificationBell.d.ts.map +1 -1
- package/lib/typescript/module/app-shell/ProOfferCard.d.ts.map +1 -1
- package/lib/typescript/module/app-shell/types.d.ts +16 -5
- package/lib/typescript/module/app-shell/types.d.ts.map +1 -1
- package/lib/typescript/module/bottom-bar/BottomBarBase.d.ts.map +1 -1
- package/lib/typescript/module/hooks/index.d.ts +1 -0
- package/lib/typescript/module/hooks/index.d.ts.map +1 -1
- package/lib/typescript/module/hooks/use-is-rtl.d.ts +53 -0
- package/lib/typescript/module/hooks/use-is-rtl.d.ts.map +1 -0
- package/lib/typescript/module/icons/shared.d.ts +10 -10
- package/lib/typescript/module/sidebar/Sidebar.d.ts.map +1 -1
- package/lib/typescript/module/sidebar/SidebarFolder.d.ts.map +1 -1
- package/lib/typescript/module/sidebar/SidebarRail.d.ts +1 -1
- package/lib/typescript/module/sidebar/SidebarRail.d.ts.map +1 -1
- package/lib/typescript/module/sidebar/SidebarTeamMenu.d.ts.map +1 -1
- package/lib/typescript/module/sidebar/SidebarUserMenu.d.ts.map +1 -1
- package/lib/typescript/module/sidebar/types.d.ts +24 -3
- package/lib/typescript/module/sidebar/types.d.ts.map +1 -1
- package/lib/typescript/module/tab-bar/TabBarBase.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/app-shell/AppShell.tsx +1 -1
- package/src/app-shell/AppShellEngine.tsx +45 -24
- package/src/app-shell/AppShellHeader.tsx +4 -3
- package/src/app-shell/NotificationBell.tsx +8 -4
- package/src/app-shell/ProOfferCard.tsx +18 -10
- package/src/app-shell/types.ts +16 -5
- package/src/bottom-bar/BottomBarBase.tsx +9 -3
- package/src/hooks/index.ts +1 -0
- package/src/hooks/use-is-rtl.ts +102 -0
- package/src/sidebar/Sidebar.tsx +41 -21
- package/src/sidebar/SidebarFolder.tsx +7 -4
- package/src/sidebar/SidebarLogoView.tsx +2 -2
- package/src/sidebar/SidebarModeSwitcher.tsx +1 -1
- package/src/sidebar/SidebarPlanCard.tsx +3 -3
- package/src/sidebar/SidebarRail.tsx +7 -1
- package/src/sidebar/SidebarRailItem.tsx +2 -2
- package/src/sidebar/SidebarTeamMenu.tsx +10 -6
- package/src/sidebar/SidebarUserMenu.tsx +8 -5
- package/src/sidebar/types.ts +25 -3
- package/src/tab-bar/TabBarBase.tsx +58 -21
package/src/sidebar/types.ts
CHANGED
|
@@ -28,7 +28,7 @@ export interface SidebarNavItem {
|
|
|
28
28
|
activeIcon?: SidebarIcon;
|
|
29
29
|
/** Link target. On web the row renders a real anchor. */
|
|
30
30
|
href?: string;
|
|
31
|
-
/** Counter badge
|
|
31
|
+
/** Counter badge at the row's end (the right in LTR); primary-tinted when the row is selected. */
|
|
32
32
|
badge?: string | number;
|
|
33
33
|
/**
|
|
34
34
|
* An ACTION row (Settings → a modal): intercepts the navigation. When set,
|
|
@@ -87,7 +87,7 @@ export interface SidebarRailItemProps {
|
|
|
87
87
|
activeIcon?: SidebarIcon;
|
|
88
88
|
label: string;
|
|
89
89
|
href?: string;
|
|
90
|
-
/** Sits over the indicator's top-right
|
|
90
|
+
/** Sits over the indicator's top-end corner (top-right in LTR). */
|
|
91
91
|
badge?: ReactNode;
|
|
92
92
|
selected?: boolean;
|
|
93
93
|
onPress?: () => void;
|
|
@@ -158,6 +158,8 @@ export interface SidebarTeam {
|
|
|
158
158
|
groups?: SidebarMenuGroup[];
|
|
159
159
|
/** Footer line: product name and an optional version chip. */
|
|
160
160
|
footer?: { label: string; version?: string };
|
|
161
|
+
/** Names the menu the card opens. Default `` `${name} menu` ``. */
|
|
162
|
+
menuLabel?: string;
|
|
161
163
|
}
|
|
162
164
|
|
|
163
165
|
export interface SidebarAccountUser {
|
|
@@ -210,6 +212,8 @@ export interface SidebarAccount {
|
|
|
210
212
|
onManage?: () => void;
|
|
211
213
|
addUserLabel?: string;
|
|
212
214
|
manageLabel?: string;
|
|
215
|
+
/** Names the menu the switcher opens. Default `"Account menu"`. */
|
|
216
|
+
menuLabel?: string;
|
|
213
217
|
}
|
|
214
218
|
|
|
215
219
|
export interface SidebarTeamMenuProps {
|
|
@@ -289,6 +293,15 @@ export interface SidebarProps {
|
|
|
289
293
|
/** Rendered inside a mobile drawer: always expanded, close button instead of collapse. */
|
|
290
294
|
mobile?: boolean;
|
|
291
295
|
onClose?: () => void;
|
|
296
|
+
|
|
297
|
+
/** The landmark's accessible name. Default `"Sidebar"`. */
|
|
298
|
+
accessibilityLabel?: string;
|
|
299
|
+
/** Names the collapse control while expanded. Default `"Collapse sidebar"`. */
|
|
300
|
+
collapseLabel?: string;
|
|
301
|
+
/** Names the same control while collapsed. Default `"Expand sidebar"`. */
|
|
302
|
+
expandLabel?: string;
|
|
303
|
+
/** Names the `mobile` close button. Default `"Close sidebar"`. */
|
|
304
|
+
closeLabel?: string;
|
|
292
305
|
/** Expanded width fills the container instead of the size's own width. */
|
|
293
306
|
fluid?: boolean;
|
|
294
307
|
/** The panel's edge. Defaults to `card`. */
|
|
@@ -307,8 +320,17 @@ export interface SidebarProps {
|
|
|
307
320
|
searchShortcutLabel?: string;
|
|
308
321
|
/** Binds ⌘L / Ctrl+L on web. Defaults to true. */
|
|
309
322
|
searchShortcut?: boolean;
|
|
323
|
+
/** Names the quick-search button. Default `"Quick Search"`. */
|
|
310
324
|
searchLabel?: string;
|
|
325
|
+
/** Names the search button in a flat `mobile` header. Default `"Search"`. */
|
|
326
|
+
searchButtonLabel?: string;
|
|
327
|
+
/** Placeholder. Defaults `"Search navigation…"`, or `"Search..."` in a flat `mobile` header. */
|
|
311
328
|
searchPlaceholder?: string;
|
|
329
|
+
/** Names the search field. Default `"Filter navigation"`. */
|
|
330
|
+
filterLabel?: string;
|
|
331
|
+
/** Names the button that clears and closes the search. Default `"Clear navigation search"`. */
|
|
332
|
+
clearSearchLabel?: string;
|
|
333
|
+
/** Default `"No results"`. */
|
|
312
334
|
noResultsLabel?: string;
|
|
313
335
|
|
|
314
336
|
/**
|
|
@@ -346,7 +368,7 @@ export interface SidebarTreeItem {
|
|
|
346
368
|
onLongPress?: () => void;
|
|
347
369
|
key: string;
|
|
348
370
|
label: string;
|
|
349
|
-
/** A short chip
|
|
371
|
+
/** A short chip at the row's end (the right in LTR), e.g. a relative time (`34m`, `now`). */
|
|
350
372
|
meta?: string;
|
|
351
373
|
/** Link target (a real anchor on web). */
|
|
352
374
|
href?: string;
|
|
@@ -30,6 +30,7 @@ import {
|
|
|
30
30
|
Pressable,
|
|
31
31
|
StyleSheet,
|
|
32
32
|
View,
|
|
33
|
+
type GestureResponderEvent,
|
|
33
34
|
type ViewStyle,
|
|
34
35
|
} from 'react-native';
|
|
35
36
|
import { Gesture, GestureDetector } from 'react-native-gesture-handler';
|
|
@@ -48,6 +49,7 @@ import Animated, {
|
|
|
48
49
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
49
50
|
|
|
50
51
|
import { useHaptics } from '../hooks/use-haptics';
|
|
52
|
+
import { useDirectionProps, useIsRtl } from '../hooks/use-is-rtl';
|
|
51
53
|
import { useClaimBottomEdge } from '../layout/bottom-edge';
|
|
52
54
|
import { windowEdgeGap } from '../layout/edge';
|
|
53
55
|
import type { ProgressiveBlurProps } from '../progressive-blur/types';
|
|
@@ -111,6 +113,28 @@ type BarContextValue = {
|
|
|
111
113
|
|
|
112
114
|
const BarContext = createContext<BarContextValue | null>(null);
|
|
113
115
|
|
|
116
|
+
/**
|
|
117
|
+
* Whether the bar's `Tap` gesture has already reported the touch a button's
|
|
118
|
+
* press came from. The gesture activates on RELEASE, after the `Pressable` has
|
|
119
|
+
* fired, and it cancels that press on iOS alone:
|
|
120
|
+
*
|
|
121
|
+
* - iOS: RNGH sets `cancelsTouchesInView`, so a press that still arrives came
|
|
122
|
+
* from something the gesture never saw (VoiceOver, a hardware keyboard).
|
|
123
|
+
* - Android: nothing is cancelled. Measured on a Pixel 10 Pro, one tap produced
|
|
124
|
+
* `PRESSABLE selectIndex(1)` AND `GESTURE tap selectIndex(1)` ~600ms apart.
|
|
125
|
+
* A press there cannot say whether it was a touch, so every press is taken
|
|
126
|
+
* for one.
|
|
127
|
+
* - Web: nothing is cancelled either. Measured in Mention's web build, one
|
|
128
|
+
* mouse click reached `onIndexChange` twice. react-native-web says which
|
|
129
|
+
* input it was: a pointer press arrives as the DOM `click`, and a keyboard
|
|
130
|
+
* Enter or Space as `keyup`, which the gesture never sees.
|
|
131
|
+
*/
|
|
132
|
+
function gestureReportedPress(event: GestureResponderEvent): boolean {
|
|
133
|
+
if (Platform.OS === 'android') return true;
|
|
134
|
+
if (Platform.OS === 'web') return (event.nativeEvent as { type?: string }).type === 'click';
|
|
135
|
+
return false;
|
|
136
|
+
}
|
|
137
|
+
|
|
114
138
|
function OptionalGesture({ enabled, children, ...props }: ComponentProps<typeof GestureDetector> & { enabled: boolean }) {
|
|
115
139
|
return enabled ? <GestureDetector {...props}>{children}</GestureDetector> : <Fragment>{children}</Fragment>;
|
|
116
140
|
}
|
|
@@ -178,6 +202,14 @@ function TabBarBody({
|
|
|
178
202
|
const isDragging = useSharedValue(false);
|
|
179
203
|
const lastTicked = useSharedValue(-1);
|
|
180
204
|
const { colors } = useTheme();
|
|
205
|
+
// The tabs are a flex row, so they mirror under RTL by themselves; the
|
|
206
|
+
// highlight is a `translateX` from the start edge and the scrub reads a
|
|
207
|
+
// PHYSICAL `event.x`, so both take the direction explicitly.
|
|
208
|
+
const rtl = useIsRtl();
|
|
209
|
+
const dir = rtl ? -1 : 1;
|
|
210
|
+
// The capsule's `insetInlineStart` must resolve on the same side the row
|
|
211
|
+
// mirrors to; react-native-web reads that from a `dir` prop, not `<html>`.
|
|
212
|
+
const dirProps = useDirectionProps();
|
|
181
213
|
const theme = useTabBarTheme(material === 'solid' ? { ...themeOverrides, solidFallback: themeOverrides?.solidFallback ?? colors.backgroundSecondary } : themeOverrides);
|
|
182
214
|
const impact = useHaptics();
|
|
183
215
|
|
|
@@ -310,7 +342,10 @@ function TabBarBody({
|
|
|
310
342
|
// border edge either way.)
|
|
311
343
|
const barWidth = barOuterWidth - sideInset * 2;
|
|
312
344
|
const itemWidth = (barWidth - ROW_PAD_H * 2) / tabCount;
|
|
313
|
-
|
|
345
|
+
// Under RTL the first tab is at the right edge, so distance is measured
|
|
346
|
+
// from there instead.
|
|
347
|
+
const fromStart = rtl ? barWidth - x : x;
|
|
348
|
+
const raw = (fromStart - ROW_PAD_H) / itemWidth - 0.5;
|
|
314
349
|
return Math.min(Math.max(raw, 0), tabCount - 1);
|
|
315
350
|
};
|
|
316
351
|
|
|
@@ -413,6 +448,7 @@ function TabBarBody({
|
|
|
413
448
|
highlightOpacity,
|
|
414
449
|
minimized,
|
|
415
450
|
progress,
|
|
451
|
+
rtl,
|
|
416
452
|
]);
|
|
417
453
|
|
|
418
454
|
// CRITICAL — every shared value and every scalar a mapper READS must appear
|
|
@@ -497,9 +533,9 @@ function TabBarBody({
|
|
|
497
533
|
// out-of-range one is a real place — one item-width to the LEFT of the
|
|
498
534
|
// first tab, i.e. half outside the pill — not an absence.
|
|
499
535
|
opacity: highlightOpacity.value,
|
|
500
|
-
transform: [{ translateX: ROW_PAD_H + itemWidth * slideIndex.value }],
|
|
536
|
+
transform: [{ translateX: dir * (ROW_PAD_H + itemWidth * slideIndex.value) }],
|
|
501
537
|
};
|
|
502
|
-
}, [progress, slideIndex, highlightOpacity, barOuterWidth, tabCount, minimizeInset]);
|
|
538
|
+
}, [progress, slideIndex, highlightOpacity, barOuterWidth, tabCount, minimizeInset, dir]);
|
|
503
539
|
|
|
504
540
|
// Shared with `useTabBarFootprint`, so a consumer accounting for the bar in
|
|
505
541
|
// its own layout can never drift from where the bar actually sits.
|
|
@@ -534,7 +570,7 @@ function TabBarBody({
|
|
|
534
570
|
|
|
535
571
|
const ResolvedSurface = material === 'solid' ? SolidTabBarSurface : Surface;
|
|
536
572
|
return (
|
|
537
|
-
<View {...viewProps} onLayout={(event) => { setContainerWidth(event.nativeEvent.layout.width); onLayout?.(event); }} pointerEvents="box-none" style={[embedded ? { width: '100%' } : styles.root, style]}>
|
|
573
|
+
<View {...viewProps} {...dirProps} onLayout={(event) => { setContainerWidth(event.nativeEvent.layout.width); onLayout?.(event); }} pointerEvents="box-none" style={[embedded ? { width: '100%' } : styles.root, style]}>
|
|
538
574
|
{/* Progressive blur rising from the screen's bottom edge behind the pill.
|
|
539
575
|
Rendered CONDITIONALLY, and as nothing at all when off: the band is
|
|
540
576
|
full-bleed and 114pt tall at a zero bottom inset, so it blurs whatever
|
|
@@ -686,8 +722,8 @@ function TabBarButtonBody({
|
|
|
686
722
|
if (isFocused === undefined) bar?.selectIndex(index);
|
|
687
723
|
}}
|
|
688
724
|
onPress={(event) => {
|
|
689
|
-
//
|
|
690
|
-
// for
|
|
725
|
+
// Fires for keyboard and assistive-technology activation, and on
|
|
726
|
+
// Android and web also for the pointer taps the gesture reports.
|
|
691
727
|
if (bar) {
|
|
692
728
|
// Appear at the tab when hidden, slide to it when visible — the same
|
|
693
729
|
// rule the tap gesture and the controlled path follow. Skipped on the
|
|
@@ -700,20 +736,20 @@ function TabBarButtonBody({
|
|
|
700
736
|
bar.highlightOpacity.value = withTiming(1, HIGHLIGHT_FADE);
|
|
701
737
|
}
|
|
702
738
|
setMinimized(minimized, 0);
|
|
703
|
-
//
|
|
704
|
-
//
|
|
705
|
-
//
|
|
706
|
-
|
|
707
|
-
//
|
|
708
|
-
// `
|
|
709
|
-
//
|
|
710
|
-
|
|
711
|
-
//
|
|
712
|
-
//
|
|
713
|
-
//
|
|
714
|
-
// there
|
|
715
|
-
|
|
716
|
-
onPress?.(event);
|
|
739
|
+
// A tap the bar's gesture already reported is not reported again
|
|
740
|
+
// (`gestureReportedPress`). A scrollable bar has no gesture, so its
|
|
741
|
+
// presses are the only reporter.
|
|
742
|
+
const reported = bar != null && !bar.scrollable && gestureReportedPress(event);
|
|
743
|
+
// Controlled path only. On the focus-driven path the trigger's own
|
|
744
|
+
// `onPress` below performs the navigation, so reporting the selection
|
|
745
|
+
// here as well would navigate twice.
|
|
746
|
+
if (isFocused === undefined && !reported) bar?.selectIndex(index);
|
|
747
|
+
// The trigger's `onPress` is for what the gesture cannot see (keyboard,
|
|
748
|
+
// assistive technology). On web a pointer click has already navigated
|
|
749
|
+
// through `onIndexChange`, so it stands down. Android keeps calling it:
|
|
750
|
+
// a press there cannot tell a touch from a keyboard or D-pad, and
|
|
751
|
+
// dropping it would strand keyboard navigation.
|
|
752
|
+
if (!(reported && Platform.OS === 'web')) onPress?.(event);
|
|
717
753
|
}}
|
|
718
754
|
// `Pressable`'s `style` also accepts a function of the press state; both
|
|
719
755
|
// forms are composed on top of the flex-share base so a caller can tint
|
|
@@ -784,7 +820,8 @@ const styles = StyleSheet.create({
|
|
|
784
820
|
},
|
|
785
821
|
highlight: {
|
|
786
822
|
position: 'absolute',
|
|
787
|
-
|
|
823
|
+
// The START edge: the translate above runs from it, signed by direction.
|
|
824
|
+
insetInlineStart: 0,
|
|
788
825
|
borderCurve: 'continuous',
|
|
789
826
|
},
|
|
790
827
|
itemRow: {
|