expo-router 6.1.0-canary-20251008-f2d1b4a → 6.1.0-canary-20251009-9919e08
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/_error.js +3 -36
- package/build/modal/web/ModalStack.d.ts.map +1 -1
- package/build/modal/web/ModalStack.js +3 -1
- package/build/modal/web/ModalStack.js.map +1 -1
- package/build/modal/web/ModalStackRouteDrawer.d.ts +2 -1
- package/build/modal/web/ModalStackRouteDrawer.d.ts.map +1 -1
- package/build/modal/web/ModalStackRouteDrawer.js +2 -2
- package/build/modal/web/ModalStackRouteDrawer.js.map +1 -1
- package/build/modal/web/TransparentModalStackRouteDrawer.d.ts +2 -1
- package/build/modal/web/TransparentModalStackRouteDrawer.d.ts.map +1 -1
- package/build/modal/web/TransparentModalStackRouteDrawer.js +2 -2
- package/build/modal/web/TransparentModalStackRouteDrawer.js.map +1 -1
- package/build/native-tabs/NativeBottomTabs/NativeTabsView.d.ts.map +1 -1
- package/build/native-tabs/NativeBottomTabs/NativeTabsView.js +9 -13
- package/build/native-tabs/NativeBottomTabs/NativeTabsView.js.map +1 -1
- package/build/renderRootComponent.d.ts.map +1 -1
- package/build/renderRootComponent.js +7 -5
- package/build/renderRootComponent.js.map +1 -1
- package/build/views/ErrorBoundary.js +1 -1
- package/build/views/ErrorBoundary.js.map +1 -1
- package/package.json +8 -9
package/_error.js
CHANGED
|
@@ -1,37 +1,4 @@
|
|
|
1
|
-
import LogBoxInspectorContainer from '@expo/
|
|
2
|
-
import {
|
|
1
|
+
import { LogBoxInspectorContainer } from '@expo/metro-runtime/src/error-overlay/ErrorOverlay';
|
|
2
|
+
import { registerRootComponent } from 'expo';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
function registerRootComponentInShadowDOM(component) {
|
|
7
|
-
AppRegistry.registerComponent('main', () => component);
|
|
8
|
-
|
|
9
|
-
if (Platform.OS !== 'web' || !window) {
|
|
10
|
-
console.error('expo-router/_error can be rendered only on Web.');
|
|
11
|
-
return;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
const host = window.document.getElementById('root');
|
|
15
|
-
if (!host) {
|
|
16
|
-
throw new Error('Required HTML element with id "root" was not found in the document HTML.');
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
const shadow = host.attachShadow({ mode: 'open' });
|
|
20
|
-
const rootTag = window.document.createElement('div');
|
|
21
|
-
rootTag.id = 'shadow-root';
|
|
22
|
-
shadow.appendChild(rootTag);
|
|
23
|
-
|
|
24
|
-
AppRegistry.runApplication('main', {
|
|
25
|
-
rootTag,
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
// NOTE(@krystofwoldrich): Same as `react-native-stylesheet`
|
|
29
|
-
// I would expect the loaded css to be attached to the shadow host (not document head)
|
|
30
|
-
// For now we need to copy the styles manually
|
|
31
|
-
window.document.querySelectorAll('style').forEach((styleEl) => {
|
|
32
|
-
const isHmrLoadedCss = !!styleEl.getAttribute('data-expo-css-hmr');
|
|
33
|
-
if (isHmrLoadedCss) {
|
|
34
|
-
shadow.appendChild(styleEl.cloneNode(true));
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
}
|
|
4
|
+
registerRootComponent(LogBoxInspectorContainer);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModalStack.d.ts","sourceRoot":"","sources":["../../../src/modal/web/ModalStack.tsx"],"names":[],"mappings":"AACA,OAAO,EAGL,aAAa,
|
|
1
|
+
{"version":3,"file":"ModalStack.d.ts","sourceRoot":"","sources":["../../../src/modal/web/ModalStack.tsx"],"names":[],"mappings":"AACA,OAAO,EAGL,aAAa,EASd,MAAM,0BAA0B,CAAC;AAMlC,OAAO,KAAiC,MAAM,OAAO,CAAC;AAwHtD,QAAA,MAAM,WAAW;;;;;;;;;;;CAAkD,CAAC;AACpE,QAAA,MAAM,iBAAiB;;;;;;;;6DAAqB,CAAC;AAE7C,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,CAAC"}
|
|
@@ -67,6 +67,7 @@ function ModalStackNavigator({ initialRouteName, children, screenOptions, }) {
|
|
|
67
67
|
const ModalStackView = ({ state, navigation, descriptors, describe }) => {
|
|
68
68
|
const isWeb = process.env.EXPO_OS === 'web';
|
|
69
69
|
const { colors } = (0, native_1.useTheme)();
|
|
70
|
+
const { preventedRoutes } = (0, native_1.usePreventRemoveContext)();
|
|
70
71
|
const { routes: filteredRoutes, index: nonModalIndex } = (0, utils_1.convertStackStateToNonModalState)(state, descriptors, isWeb);
|
|
71
72
|
const newStackState = {
|
|
72
73
|
...state,
|
|
@@ -87,10 +88,11 @@ const ModalStackView = ({ state, navigation, descriptors, describe }) => {
|
|
|
87
88
|
{isWeb &&
|
|
88
89
|
overlayRoutes.map((route) => {
|
|
89
90
|
const isTransparentModal = (0, utils_1.isTransparentModalPresentation)(descriptors[route.key].options);
|
|
91
|
+
const isRemovePrevented = preventedRoutes[route.key]?.preventRemove;
|
|
90
92
|
const ModalComponent = isTransparentModal
|
|
91
93
|
? TransparentModalStackRouteDrawer_1.TransparentModalStackRouteDrawer
|
|
92
94
|
: ModalStackRouteDrawer_1.ModalStackRouteDrawer;
|
|
93
|
-
return (<ModalComponent key={route.key} routeKey={route.key} options={descriptors[route.key].options} renderScreen={descriptors[route.key].render} onDismiss={dismiss} themeColors={colors}/>);
|
|
95
|
+
return (<ModalComponent key={route.key} routeKey={route.key} options={descriptors[route.key].options} renderScreen={descriptors[route.key].render} onDismiss={dismiss} dismissible={isRemovePrevented ? false : undefined} themeColors={colors}/>);
|
|
94
96
|
})}
|
|
95
97
|
</div>);
|
|
96
98
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModalStack.js","sourceRoot":"","sources":["../../../src/modal/web/ModalStack.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACb,
|
|
1
|
+
{"version":3,"file":"ModalStack.js","sourceRo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ackActions,\n StackNavigationState,\n StackRouter,\n StackRouterOptions,\n useNavigationBuilder,\n usePreventRemoveContext,\n useTheme,\n} from '@react-navigation/native';\nimport {\n NativeStackNavigationEventMap,\n NativeStackNavigationOptions,\n NativeStackView,\n} from '@react-navigation/native-stack';\nimport React, { useCallback, useEffect } from 'react';\n\nimport { ModalStackRouteDrawer } from './ModalStackRouteDrawer';\nimport { TransparentModalStackRouteDrawer } from './TransparentModalStackRouteDrawer';\nimport { ModalStackNavigatorProps, ModalStackViewProps } from './types';\nimport {\n convertStackStateToNonModalState,\n findLastNonModalIndex,\n isTransparentModalPresentation,\n} from './utils';\nimport { ExtendedStackNavigationOptions } from '../../layouts/StackClient';\nimport { withLayoutContext } from '../../layouts/withLayoutContext';\n\nfunction ModalStackNavigator({\n initialRouteName,\n children,\n screenOptions,\n}: ModalStackNavigatorProps) {\n const { state, navigation, descriptors, NavigationContent, describe } = useNavigationBuilder<\n StackNavigationState<ParamListBase>,\n StackRouterOptions,\n StackActionHelpers<ParamListBase>,\n NativeStackNavigationOptions,\n NativeStackNavigationEventMap\n >(StackRouter, {\n children,\n screenOptions,\n initialRouteName,\n });\n\n useEffect(\n () =>\n // @ts-expect-error: there may not be a tab navigator in parent\n navigation?.addListener?.('tabPress', (e: EventArg<'tabPress', true>) => {\n requestAnimationFrame(() => {\n if (navigation.isFocused() && !e.defaultPrevented) {\n navigation.dispatch({\n ...StackActions.popToTop(),\n target: state.key,\n });\n }\n });\n }),\n [navigation, state.key]\n );\n\n return (\n <NavigationContent>\n <ModalStackView\n state={state}\n navigation={navigation}\n descriptors={descriptors}\n describe={describe}\n />\n </NavigationContent>\n );\n}\n\nconst ModalStackView = ({ state, navigation, descriptors, describe }: ModalStackViewProps) => {\n const isWeb = process.env.EXPO_OS === 'web';\n const { colors } = useTheme();\n const { preventedRoutes } = usePreventRemoveContext();\n\n const { routes: filteredRoutes, index: nonModalIndex } = convertStackStateToNonModalState(\n state,\n descriptors,\n isWeb\n );\n\n const newStackState = {\n ...state,\n routes: filteredRoutes,\n index: nonModalIndex,\n };\n\n const dismiss = useCallback(() => {\n navigation.goBack();\n }, [navigation]);\n\n const overlayRoutes = React.useMemo(() => {\n if (!isWeb) return [];\n const idx = findLastNonModalIndex(state, descriptors);\n return state.routes.slice(idx + 1);\n }, [isWeb, state, descriptors]);\n\n return (\n <div style={{ flex: 1, display: 'flex' }}>\n <NativeStackView\n state={newStackState}\n navigation={navigation}\n descriptors={descriptors}\n describe={describe}\n />\n {isWeb &&\n overlayRoutes.map((route) => {\n const isTransparentModal = isTransparentModalPresentation(descriptors[route.key].options);\n\n const isRemovePrevented = preventedRoutes[route.key]?.preventRemove;\n\n const ModalComponent = isTransparentModal\n ? TransparentModalStackRouteDrawer\n : ModalStackRouteDrawer;\n\n return (\n <ModalComponent\n key={route.key}\n routeKey={route.key}\n options={descriptors[route.key].options as ExtendedStackNavigationOptions}\n renderScreen={descriptors[route.key].render}\n onDismiss={dismiss}\n dismissible={isRemovePrevented ? false : undefined}\n themeColors={colors}\n />\n );\n })}\n </div>\n );\n};\n\nconst createModalStack = createNavigatorFactory(ModalStackNavigator);\nconst RouterModal = withLayoutContext(createModalStack().Navigator);\nconst RouterModalScreen = RouterModal.Screen;\n\nexport { RouterModal, RouterModalScreen };\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ExtendedStackNavigationOptions } from '../../layouts/StackClient';
|
|
3
|
-
declare function ModalStackRouteDrawer({ routeKey, options, renderScreen, onDismiss, themeColors, }: {
|
|
3
|
+
declare function ModalStackRouteDrawer({ routeKey, options, dismissible, renderScreen, onDismiss, themeColors, }: {
|
|
4
4
|
routeKey: string;
|
|
5
5
|
options: ExtendedStackNavigationOptions;
|
|
6
6
|
renderScreen: () => React.ReactNode;
|
|
@@ -9,6 +9,7 @@ declare function ModalStackRouteDrawer({ routeKey, options, renderScreen, onDism
|
|
|
9
9
|
card: string;
|
|
10
10
|
background: string;
|
|
11
11
|
};
|
|
12
|
+
dismissible?: boolean;
|
|
12
13
|
}): React.JSX.Element;
|
|
13
14
|
export { ModalStackRouteDrawer };
|
|
14
15
|
//# sourceMappingURL=ModalStackRouteDrawer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModalStackRouteDrawer.d.ts","sourceRoot":"","sources":["../../../src/modal/web/ModalStackRouteDrawer.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,EAAE,8BAA8B,EAAE,MAAM,2BAA2B,CAAC;AAE3E,iBAAS,qBAAqB,CAAC,EAC7B,QAAQ,EACR,OAAO,EACP,YAAY,EACZ,SAAS,EACT,WAAW,GACZ,EAAE;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,8BAA8B,CAAC;IACxC,YAAY,EAAE,MAAM,KAAK,CAAC,SAAS,CAAC;IACpC,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,WAAW,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"ModalStackRouteDrawer.d.ts","sourceRoot":"","sources":["../../../src/modal/web/ModalStackRouteDrawer.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,EAAE,8BAA8B,EAAE,MAAM,2BAA2B,CAAC;AAE3E,iBAAS,qBAAqB,CAAC,EAC7B,QAAQ,EACR,OAAO,EACP,WAAW,EACX,YAAY,EACZ,SAAS,EACT,WAAW,GACZ,EAAE;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,8BAA8B,CAAC;IACxC,YAAY,EAAE,MAAM,KAAK,CAAC,SAAS,CAAC;IACpC,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,WAAW,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,CAAC;IAClD,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,qBAsMA;AAED,OAAO,EAAE,qBAAqB,EAAE,CAAC"}
|
|
@@ -9,7 +9,7 @@ const react_1 = __importDefault(require("react"));
|
|
|
9
9
|
const vaul_1 = require("vaul");
|
|
10
10
|
const modalStyles_1 = __importDefault(require("./modalStyles"));
|
|
11
11
|
const utils_1 = require("./utils");
|
|
12
|
-
function ModalStackRouteDrawer({ routeKey, options, renderScreen, onDismiss, themeColors, }) {
|
|
12
|
+
function ModalStackRouteDrawer({ routeKey, options, dismissible, renderScreen, onDismiss, themeColors, }) {
|
|
13
13
|
const [open, setOpen] = react_1.default.useState(true);
|
|
14
14
|
// Determine sheet vs. modal with an SSR-safe hook. The first render (during
|
|
15
15
|
// hydration) always assumes mobile/sheet to match the server markup; an
|
|
@@ -136,7 +136,7 @@ function ModalStackRouteDrawer({ routeKey, options, renderScreen, onDismiss, the
|
|
|
136
136
|
fadeFromIndex,
|
|
137
137
|
}
|
|
138
138
|
: {};
|
|
139
|
-
return (<vaul_1.Drawer.Root key={`${routeKey}-${isSheet ? 'sheet' : 'modal'}`} open={open} dismissible={options.gestureEnabled ?? true} onAnimationEnd={handleOpenChange} shouldScaleBackground autoFocus onOpenChange={setOpen} {...sheetProps}>
|
|
139
|
+
return (<vaul_1.Drawer.Root key={`${routeKey}-${isSheet ? 'sheet' : 'modal'}`} open={open} dismissible={dismissible ?? options.gestureEnabled ?? true} onAnimationEnd={handleOpenChange} shouldScaleBackground autoFocus onOpenChange={setOpen} {...sheetProps}>
|
|
140
140
|
<vaul_1.Drawer.Portal>
|
|
141
141
|
<vaul_1.Drawer.Overlay className={modalStyles_1.default.overlay} style={options.webModalStyle?.overlayBackground
|
|
142
142
|
? {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModalStackRouteDrawer.js","sourceRoot":"","sources":["../../../src/modal/web/ModalStackRouteDrawer.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;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C,CAC7B,iBAAiB,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,CACnD,KAAK,CAAC,CAAC,cAAc,CAAC,CACtB;YAAA,CAAC,oHAAoH,CACrH;YAAA,CAAC,aAAM,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,qBAAW,CAAC,MAAM,CAAC,EACzE;YAAA,CAAC,aAAM,CAAC,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,qBAAW,CAAC,MAAM,CAAC,EAC3D;YAAA,CAAC,+BAA+B,CAChC;YAAA,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,qBAAW,CAAC,SAAS,CAAC,CAAC,CAAC,YAAY,EAAE,CAAC,EAAE,GAAG,CAC9D;UAAA,EAAE,GAAG,CACP;QAAA,EAAE,aAAM,CAAC,OAAO,CAClB;MAAA,EAAE,aAAM,CAAC,MAAM,CACjB;IAAA,EAAE,aAAM,CAAC,IAAI,CAAC,CACf,CAAC;AACJ,CAAC","sourcesContent":["'use client';\nimport React from 'react';\nimport { Drawer } from 'vaul';\n\nimport modalStyles from './modalStyles';\nimport { CSSWithVars } from './types';\nimport { useIsDesktop } from './utils';\nimport { ExtendedStackNavigationOptions } from '../../layouts/StackClient';\n\nfunction ModalStackRouteDrawer({\n routeKey,\n options,\n renderScreen,\n onDismiss,\n themeColors,\n}: {\n routeKey: string;\n options: ExtendedStackNavigationOptions;\n renderScreen: () => React.ReactNode;\n onDismiss: () => void;\n themeColors: { card: string; background: string };\n}) {\n const [open, setOpen] = React.useState(true);\n // Determine sheet vs. modal with an SSR-safe hook. The first render (during\n // hydration) always assumes mobile/sheet to match the server markup; an\n // effect then updates the state after mount if the viewport is desktop.\n const isDesktop = useIsDesktop();\n const isSheet = !isDesktop;\n\n // Resolve snap points logic.\n const allowed = options.sheetAllowedDetents;\n\n const isArrayDetents = Array.isArray(allowed);\n const useCustomSnapPoints = isArrayDetents && !(allowed.length === 1 && allowed[0] === 1);\n\n let snapPoints: (number | string)[] | undefined = useCustomSnapPoints\n ? (allowed as (number | string)[])\n : undefined;\n\n if (!isSheet) {\n snapPoints = [1];\n }\n\n const [snap, setSnap] = React.useState<number | string | null>(\n useCustomSnapPoints && isArrayDetents ? allowed[0] : 1\n );\n\n // Update the snap value when custom snap points change.\n React.useEffect(() => {\n if (isSheet) {\n const next = useCustomSnapPoints && isArrayDetents ? allowed[0] : 1;\n setSnap(next);\n } else {\n // Desktop modal always fixed snap at 1\n setSnap(1);\n }\n }, [isSheet, useCustomSnapPoints, isArrayDetents, allowed]);\n\n // Map react-native-screens ios sheet undimmed logic to Vaul's fadeFromIndex\n const fadeFromIndex = isSheet\n ? options.sheetLargestUndimmedDetentIndex === 'last'\n ? (snapPoints?.length ?? 0)\n : typeof options.sheetLargestUndimmedDetentIndex === 'number'\n ? options.sheetLargestUndimmedDetentIndex + 1\n : 0\n : 0;\n\n // --- Styling -----------------------------------------------------------\n\n // Using CSS variables so defaults live in CSS and can be overridden via props.\n const modalStyleVars: CSSWithVars = {\n backgroundColor: themeColors.background,\n };\n\n if (!isSheet) {\n if (options.webModalStyle?.width) {\n modalStyleVars['--expo-router-modal-width'] =\n typeof options.webModalStyle.width === 'number'\n ? `${options.webModalStyle.width}px`\n : options.webModalStyle.width;\n\n modalStyleVars['--expo-router-modal-max-width'] =\n typeof options.webModalStyle.width === 'number'\n ? `${options.webModalStyle.width}px`\n : options.webModalStyle.width;\n\n // Also set explicit width so browsers that ignore CSS vars in `width` prop still work.\n modalStyleVars.width =\n typeof options.webModalStyle.width === 'number'\n ? `${options.webModalStyle.width}px`\n : options.webModalStyle.width;\n }\n\n // Min width override\n if (options.webModalStyle?.minWidth) {\n const mw =\n typeof options.webModalStyle.minWidth === 'number'\n ? `${options.webModalStyle.minWidth}px`\n : options.webModalStyle.minWidth;\n modalStyleVars['--expo-router-modal-min-width'] = mw;\n modalStyleVars.minWidth = mw;\n }\n\n if (options.webModalStyle?.height) {\n const h =\n typeof options.webModalStyle.height === 'number'\n ? `${options.webModalStyle.height}px`\n : options.webModalStyle.height;\n modalStyleVars['--expo-router-modal-height'] = h;\n modalStyleVars.maxHeight = h;\n modalStyleVars.height = h;\n modalStyleVars.minHeight = h;\n }\n\n // Separate min-height override (takes precedence over modalHeight)\n if (options.webModalStyle?.minHeight) {\n const mh =\n typeof options.webModalStyle.minHeight === 'number'\n ? `${options.webModalStyle.minHeight}px`\n : options.webModalStyle.minHeight;\n modalStyleVars['--expo-router-modal-min-height'] = mh;\n modalStyleVars.minHeight = mh;\n }\n }\n\n const fitToContents = options.sheetAllowedDetents === 'fitToContents';\n\n if (fitToContents) {\n modalStyleVars.height = 'auto';\n modalStyleVars.minHeight = 'auto';\n\n // TODO:(@Hirbod) Clarify if we should limit maxHeight to sheets only\n // Allow sheet to grow with content but never exceed viewport height\n // dvh is important, otherwise it will scale over the visible viewport height\n modalStyleVars.maxHeight = '100dvh';\n }\n\n // Apply corner radius (default 24px for iOS 26)\n const radiusValue = options.sheetCornerRadius ?? 24;\n const radiusCss = typeof radiusValue === 'number' ? `${radiusValue}px` : radiusValue;\n\n if (options.webModalStyle?.border) {\n modalStyleVars['--expo-router-modal-border'] = options.webModalStyle.border;\n }\n\n if (options.webModalStyle?.shadow) {\n modalStyleVars['--expo-router-modal-shadow'] = options.webModalStyle.shadow;\n }\n\n if (isSheet) {\n // Only top corners for mobile sheet\n modalStyleVars.borderTopLeftRadius = radiusCss;\n modalStyleVars.borderTopRightRadius = radiusCss;\n\n // Always set CSS var to ensure consistency with default iOS 26 radius\n modalStyleVars['--expo-router-modal-border-radius'] = radiusCss;\n } else {\n // All corners for desktop modal - always set CSS var for iOS 26 default\n modalStyleVars['--expo-router-modal-border-radius'] = radiusCss;\n }\n // --- End Styling -----------------------------------------------------------\n\n const handleOpenChange = (open: boolean) => {\n if (!open) onDismiss();\n };\n\n // Props that only make sense for sheets\n const sheetProps = isSheet\n ? {\n snapPoints: snapPoints as (number | string)[],\n activeSnapPoint: snap,\n setActiveSnapPoint: setSnap,\n fadeFromIndex,\n }\n : {};\n\n return (\n <Drawer.Root\n key={`${routeKey}-${isSheet ? 'sheet' : 'modal'}`}\n open={open}\n dismissible={options.gestureEnabled ?? true}\n onAnimationEnd={handleOpenChange}\n shouldScaleBackground\n autoFocus\n onOpenChange={setOpen}\n {...sheetProps}>\n <Drawer.Portal>\n <Drawer.Overlay\n className={modalStyles.overlay}\n style={\n options.webModalStyle?.overlayBackground\n ? ({\n '--expo-router-modal-overlay-background': options.webModalStyle.overlayBackground,\n } as React.CSSProperties)\n : undefined\n }\n />\n <Drawer.Content\n aria-describedby=\"modal-description\"\n className={modalStyles.drawerContent}\n style={{\n pointerEvents: 'none',\n // This needs to be limited to sheets, otherwise it will position the modal at the bottom of the screen\n ...(isSheet && fitToContents ? { height: 'auto' } : null),\n }}>\n <div\n className={modalStyles.modal}\n data-presentation={isSheet ? 'formSheet' : 'modal'}\n style={modalStyleVars}>\n {/* TODO:(@Hirbod) Figure out how to add title and description to the modal for screen readers in a meaningful way */}\n <Drawer.Title about=\"\" aria-describedby=\"\" className={modalStyles.srOnly} />\n <Drawer.Description about=\"\" className={modalStyles.srOnly} />\n {/* Render the screen content */}\n <div className={modalStyles.modalBody}>{renderScreen()}</div>\n </div>\n </Drawer.Content>\n </Drawer.Portal>\n </Drawer.Root>\n );\n}\n\nexport { ModalStackRouteDrawer };\n"]}
|
|
1
|
+
{"version":3,"file":"ModalStackRouteDrawer.js","sourceRoot":"","sources":["../../../src/modal/web/ModalStackRouteDrawer.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;;AA+NJ,sDAAqB;AA9N9B,kDAA0B;AAC1B,+BAA8B;AAE9B,gEAAwC;AAExC,mCAAuC;AAGvC,SAAS,qBAAqB,CAAC,EAC7B,QAAQ,EACR,OAAO,EACP,WAAW,EACX,YAAY,EACZ,SAAS,EACT,WAAW,G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H;YAAA,CAAC,aAAM,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,qBAAW,CAAC,MAAM,CAAC,EACzE;YAAA,CAAC,aAAM,CAAC,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,qBAAW,CAAC,MAAM,CAAC,EAC3D;YAAA,CAAC,+BAA+B,CAChC;YAAA,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,qBAAW,CAAC,SAAS,CAAC,CAAC,CAAC,YAAY,EAAE,CAAC,EAAE,GAAG,CAC9D;UAAA,EAAE,GAAG,CACP;QAAA,EAAE,aAAM,CAAC,OAAO,CAClB;MAAA,EAAE,aAAM,CAAC,MAAM,CACjB;IAAA,EAAE,aAAM,CAAC,IAAI,CAAC,CACf,CAAC;AACJ,CAAC","sourcesContent":["'use client';\nimport React from 'react';\nimport { Drawer } from 'vaul';\n\nimport modalStyles from './modalStyles';\nimport { CSSWithVars } from './types';\nimport { useIsDesktop } from './utils';\nimport { ExtendedStackNavigationOptions } from '../../layouts/StackClient';\n\nfunction ModalStackRouteDrawer({\n routeKey,\n options,\n dismissible,\n renderScreen,\n onDismiss,\n themeColors,\n}: {\n routeKey: string;\n options: ExtendedStackNavigationOptions;\n renderScreen: () => React.ReactNode;\n onDismiss: () => void;\n themeColors: { card: string; background: string };\n dismissible?: boolean;\n}) {\n const [open, setOpen] = React.useState(true);\n // Determine sheet vs. modal with an SSR-safe hook. The first render (during\n // hydration) always assumes mobile/sheet to match the server markup; an\n // effect then updates the state after mount if the viewport is desktop.\n const isDesktop = useIsDesktop();\n const isSheet = !isDesktop;\n\n // Resolve snap points logic.\n const allowed = options.sheetAllowedDetents;\n\n const isArrayDetents = Array.isArray(allowed);\n const useCustomSnapPoints = isArrayDetents && !(allowed.length === 1 && allowed[0] === 1);\n\n let snapPoints: (number | string)[] | undefined = useCustomSnapPoints\n ? (allowed as (number | string)[])\n : undefined;\n\n if (!isSheet) {\n snapPoints = [1];\n }\n\n const [snap, setSnap] = React.useState<number | string | null>(\n useCustomSnapPoints && isArrayDetents ? allowed[0] : 1\n );\n\n // Update the snap value when custom snap points change.\n React.useEffect(() => {\n if (isSheet) {\n const next = useCustomSnapPoints && isArrayDetents ? allowed[0] : 1;\n setSnap(next);\n } else {\n // Desktop modal always fixed snap at 1\n setSnap(1);\n }\n }, [isSheet, useCustomSnapPoints, isArrayDetents, allowed]);\n\n // Map react-native-screens ios sheet undimmed logic to Vaul's fadeFromIndex\n const fadeFromIndex = isSheet\n ? options.sheetLargestUndimmedDetentIndex === 'last'\n ? (snapPoints?.length ?? 0)\n : typeof options.sheetLargestUndimmedDetentIndex === 'number'\n ? options.sheetLargestUndimmedDetentIndex + 1\n : 0\n : 0;\n\n // --- Styling -----------------------------------------------------------\n\n // Using CSS variables so defaults live in CSS and can be overridden via props.\n const modalStyleVars: CSSWithVars = {\n backgroundColor: themeColors.background,\n };\n\n if (!isSheet) {\n if (options.webModalStyle?.width) {\n modalStyleVars['--expo-router-modal-width'] =\n typeof options.webModalStyle.width === 'number'\n ? `${options.webModalStyle.width}px`\n : options.webModalStyle.width;\n\n modalStyleVars['--expo-router-modal-max-width'] =\n typeof options.webModalStyle.width === 'number'\n ? `${options.webModalStyle.width}px`\n : options.webModalStyle.width;\n\n // Also set explicit width so browsers that ignore CSS vars in `width` prop still work.\n modalStyleVars.width =\n typeof options.webModalStyle.width === 'number'\n ? `${options.webModalStyle.width}px`\n : options.webModalStyle.width;\n }\n\n // Min width override\n if (options.webModalStyle?.minWidth) {\n const mw =\n typeof options.webModalStyle.minWidth === 'number'\n ? `${options.webModalStyle.minWidth}px`\n : options.webModalStyle.minWidth;\n modalStyleVars['--expo-router-modal-min-width'] = mw;\n modalStyleVars.minWidth = mw;\n }\n\n if (options.webModalStyle?.height) {\n const h =\n typeof options.webModalStyle.height === 'number'\n ? `${options.webModalStyle.height}px`\n : options.webModalStyle.height;\n modalStyleVars['--expo-router-modal-height'] = h;\n modalStyleVars.maxHeight = h;\n modalStyleVars.height = h;\n modalStyleVars.minHeight = h;\n }\n\n // Separate min-height override (takes precedence over modalHeight)\n if (options.webModalStyle?.minHeight) {\n const mh =\n typeof options.webModalStyle.minHeight === 'number'\n ? `${options.webModalStyle.minHeight}px`\n : options.webModalStyle.minHeight;\n modalStyleVars['--expo-router-modal-min-height'] = mh;\n modalStyleVars.minHeight = mh;\n }\n }\n\n const fitToContents = options.sheetAllowedDetents === 'fitToContents';\n\n if (fitToContents) {\n modalStyleVars.height = 'auto';\n modalStyleVars.minHeight = 'auto';\n\n // TODO:(@Hirbod) Clarify if we should limit maxHeight to sheets only\n // Allow sheet to grow with content but never exceed viewport height\n // dvh is important, otherwise it will scale over the visible viewport height\n modalStyleVars.maxHeight = '100dvh';\n }\n\n // Apply corner radius (default 24px for iOS 26)\n const radiusValue = options.sheetCornerRadius ?? 24;\n const radiusCss = typeof radiusValue === 'number' ? `${radiusValue}px` : radiusValue;\n\n if (options.webModalStyle?.border) {\n modalStyleVars['--expo-router-modal-border'] = options.webModalStyle.border;\n }\n\n if (options.webModalStyle?.shadow) {\n modalStyleVars['--expo-router-modal-shadow'] = options.webModalStyle.shadow;\n }\n\n if (isSheet) {\n // Only top corners for mobile sheet\n modalStyleVars.borderTopLeftRadius = radiusCss;\n modalStyleVars.borderTopRightRadius = radiusCss;\n\n // Always set CSS var to ensure consistency with default iOS 26 radius\n modalStyleVars['--expo-router-modal-border-radius'] = radiusCss;\n } else {\n // All corners for desktop modal - always set CSS var for iOS 26 default\n modalStyleVars['--expo-router-modal-border-radius'] = radiusCss;\n }\n // --- End Styling -----------------------------------------------------------\n\n const handleOpenChange = (open: boolean) => {\n if (!open) onDismiss();\n };\n\n // Props that only make sense for sheets\n const sheetProps = isSheet\n ? {\n snapPoints: snapPoints as (number | string)[],\n activeSnapPoint: snap,\n setActiveSnapPoint: setSnap,\n fadeFromIndex,\n }\n : {};\n\n return (\n <Drawer.Root\n key={`${routeKey}-${isSheet ? 'sheet' : 'modal'}`}\n open={open}\n dismissible={dismissible ?? options.gestureEnabled ?? true}\n onAnimationEnd={handleOpenChange}\n shouldScaleBackground\n autoFocus\n onOpenChange={setOpen}\n {...sheetProps}>\n <Drawer.Portal>\n <Drawer.Overlay\n className={modalStyles.overlay}\n style={\n options.webModalStyle?.overlayBackground\n ? ({\n '--expo-router-modal-overlay-background': options.webModalStyle.overlayBackground,\n } as React.CSSProperties)\n : undefined\n }\n />\n <Drawer.Content\n aria-describedby=\"modal-description\"\n className={modalStyles.drawerContent}\n style={{\n pointerEvents: 'none',\n // This needs to be limited to sheets, otherwise it will position the modal at the bottom of the screen\n ...(isSheet && fitToContents ? { height: 'auto' } : null),\n }}>\n <div\n className={modalStyles.modal}\n data-presentation={isSheet ? 'formSheet' : 'modal'}\n style={modalStyleVars}>\n {/* TODO:(@Hirbod) Figure out how to add title and description to the modal for screen readers in a meaningful way */}\n <Drawer.Title about=\"\" aria-describedby=\"\" className={modalStyles.srOnly} />\n <Drawer.Description about=\"\" className={modalStyles.srOnly} />\n {/* Render the screen content */}\n <div className={modalStyles.modalBody}>{renderScreen()}</div>\n </div>\n </Drawer.Content>\n </Drawer.Portal>\n </Drawer.Root>\n );\n}\n\nexport { ModalStackRouteDrawer };\n"]}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ExtendedStackNavigationOptions } from '../../layouts/StackClient';
|
|
3
|
-
declare function TransparentModalStackRouteDrawer({ routeKey, options, renderScreen, onDismiss, }: {
|
|
3
|
+
declare function TransparentModalStackRouteDrawer({ routeKey, options, dismissible, renderScreen, onDismiss, }: {
|
|
4
4
|
routeKey: string;
|
|
5
5
|
options: ExtendedStackNavigationOptions;
|
|
6
6
|
renderScreen: () => React.ReactNode;
|
|
7
7
|
onDismiss: () => void;
|
|
8
|
+
dismissible?: boolean;
|
|
8
9
|
}): React.JSX.Element;
|
|
9
10
|
export { TransparentModalStackRouteDrawer };
|
|
10
11
|
//# sourceMappingURL=TransparentModalStackRouteDrawer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TransparentModalStackRouteDrawer.d.ts","sourceRoot":"","sources":["../../../src/modal/web/TransparentModalStackRouteDrawer.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,8BAA8B,EAAE,MAAM,2BAA2B,CAAC;AAE3E,iBAAS,gCAAgC,CAAC,EACxC,QAAQ,EACR,OAAO,EACP,YAAY,EACZ,SAAS,GACV,EAAE;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,8BAA8B,CAAC;IACxC,YAAY,EAAE,MAAM,KAAK,CAAC,SAAS,CAAC;IACpC,SAAS,EAAE,MAAM,IAAI,CAAC;CACvB,qBAuBA;AAED,OAAO,EAAE,gCAAgC,EAAE,CAAC"}
|
|
1
|
+
{"version":3,"file":"TransparentModalStackRouteDrawer.d.ts","sourceRoot":"","sources":["../../../src/modal/web/TransparentModalStackRouteDrawer.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,8BAA8B,EAAE,MAAM,2BAA2B,CAAC;AAE3E,iBAAS,gCAAgC,CAAC,EACxC,QAAQ,EACR,OAAO,EACP,WAAW,EACX,YAAY,EACZ,SAAS,GACV,EAAE;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,8BAA8B,CAAC;IACxC,YAAY,EAAE,MAAM,KAAK,CAAC,SAAS,CAAC;IACpC,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,qBAuBA;AAED,OAAO,EAAE,gCAAgC,EAAE,CAAC"}
|
|
@@ -8,12 +8,12 @@ exports.TransparentModalStackRouteDrawer = TransparentModalStackRouteDrawer;
|
|
|
8
8
|
const react_1 = __importDefault(require("react"));
|
|
9
9
|
const vaul_1 = require("vaul");
|
|
10
10
|
const modalStyles_1 = __importDefault(require("./modalStyles"));
|
|
11
|
-
function TransparentModalStackRouteDrawer({ routeKey, options, renderScreen, onDismiss, }) {
|
|
11
|
+
function TransparentModalStackRouteDrawer({ routeKey, options, dismissible, renderScreen, onDismiss, }) {
|
|
12
12
|
const handleOpenChange = (open) => {
|
|
13
13
|
if (!open)
|
|
14
14
|
onDismiss();
|
|
15
15
|
};
|
|
16
|
-
return (<vaul_1.Drawer.Root defaultOpen autoFocus key={`${routeKey}-transparent`} dismissible={options.gestureEnabled ?? false} onAnimationEnd={handleOpenChange}>
|
|
16
|
+
return (<vaul_1.Drawer.Root defaultOpen autoFocus key={`${routeKey}-transparent`} dismissible={dismissible ?? options.gestureEnabled ?? false} onAnimationEnd={handleOpenChange}>
|
|
17
17
|
<vaul_1.Drawer.Portal>
|
|
18
18
|
<vaul_1.Drawer.Content className={modalStyles_1.default.transparentDrawerContent}>
|
|
19
19
|
{/* TODO:(@Hirbod) Figure out how to add title and description to the modal for screen readers in a meaningful way */}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TransparentModalStackRouteDrawer.js","sourceRoot":"","sources":["../../../src/modal/web/TransparentModalStackRouteDrawer.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;;
|
|
1
|
+
{"version":3,"file":"TransparentModalStackRouteDrawer.js","sourceRoot":"","sources":["../../../src/modal/web/TransparentModalStackRouteDrawer.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;;AA4CJ,4EAAgC;AA3CzC,kDAA0B;AAC1B,+BAA8B;AAE9B,gEAAwC;AAGxC,SAAS,gCAAgC,CAAC,EACxC,QAAQ,EACR,OAAO,EACP,WAAW,EACX,YAAY,EACZ,SAAS,GAOV;IACC,MAAM,gBAAgB,GAAG,CAAC,IAAa,EAAE,EAAE;QACzC,IAAI,CAAC,IAAI;YAAE,SAAS,EAAE,CAAC;IACzB,CAAC,CAAC;IAEF,OAAO,CACL,CAAC,aAAM,CAAC,IAAI,CACV,WAAW,CACX,SAAS,CACT,GAAG,CAAC,CAAC,GAAG,QAAQ,cAAc,CAAC,CAC/B,WAAW,CAAC,CAAC,WAAW,IAAI,OAAO,CAAC,cAAc,IAAI,KAAK,CAAC,CAC5D,cAAc,CAAC,CAAC,gBAAgB,CAAC,CACjC;MAAA,CAAC,aAAM,CAAC,MAAM,CACZ;QAAA,CAAC,aAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,qBAAW,CAAC,wBAAwB,CAAC,CAC9D;UAAA,CAAC,oHAAoH,CACrH;UAAA,CAAC,aAAM,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,qBAAW,CAAC,MAAM,CAAC,EACzE;UAAA,CAAC,aAAM,CAAC,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,qBAAW,CAAC,MAAM,CAAC,EAC3D;UAAA,CAAC,+BAA+B,CAChC;UAAA,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,qBAAW,CAAC,SAAS,CAAC,CAAC,CAAC,YAAY,EAAE,CAAC,EAAE,GAAG,CAC9D;QAAA,EAAE,aAAM,CAAC,OAAO,CAClB;MAAA,EAAE,aAAM,CAAC,MAAM,CACjB;IAAA,EAAE,aAAM,CAAC,IAAI,CAAC,CACf,CAAC;AACJ,CAAC","sourcesContent":["'use client';\nimport React from 'react';\nimport { Drawer } from 'vaul';\n\nimport modalStyles from './modalStyles';\nimport { ExtendedStackNavigationOptions } from '../../layouts/StackClient';\n\nfunction TransparentModalStackRouteDrawer({\n routeKey,\n options,\n dismissible,\n renderScreen,\n onDismiss,\n}: {\n routeKey: string;\n options: ExtendedStackNavigationOptions;\n renderScreen: () => React.ReactNode;\n onDismiss: () => void;\n dismissible?: boolean;\n}) {\n const handleOpenChange = (open: boolean) => {\n if (!open) onDismiss();\n };\n\n return (\n <Drawer.Root\n defaultOpen\n autoFocus\n key={`${routeKey}-transparent`}\n dismissible={dismissible ?? options.gestureEnabled ?? false}\n onAnimationEnd={handleOpenChange}>\n <Drawer.Portal>\n <Drawer.Content className={modalStyles.transparentDrawerContent}>\n {/* TODO:(@Hirbod) Figure out how to add title and description to the modal for screen readers in a meaningful way */}\n <Drawer.Title about=\"\" aria-describedby=\"\" className={modalStyles.srOnly} />\n <Drawer.Description about=\"\" className={modalStyles.srOnly} />\n {/* Render the screen content */}\n <div className={modalStyles.modalBody}>{renderScreen()}</div>\n </Drawer.Content>\n </Drawer.Portal>\n </Drawer.Root>\n );\n}\n\nexport { TransparentModalStackRouteDrawer };\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativeTabsView.d.ts","sourceRoot":"","sources":["../../../src/native-tabs/NativeBottomTabs/NativeTabsView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyD,MAAM,OAAO,CAAC;AAkB9E,OAAO,EAKL,KAAK,mBAAmB,EACzB,MAAM,SAAS,CAAC;AASjB,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,
|
|
1
|
+
{"version":3,"file":"NativeTabsView.d.ts","sourceRoot":"","sources":["../../../src/native-tabs/NativeBottomTabs/NativeTabsView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyD,MAAM,OAAO,CAAC;AAkB9E,OAAO,EAKL,KAAK,mBAAmB,EACzB,MAAM,SAAS,CAAC;AASjB,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,qBA6HxD"}
|
|
@@ -53,6 +53,11 @@ function NativeTabsView(props) {
|
|
|
53
53
|
blurEffect = undefined;
|
|
54
54
|
}
|
|
55
55
|
const deferredFocusedIndex = (0, react_1.useDeferredValue)(focusedIndex);
|
|
56
|
+
// We need to check if the deferred index is not out of bounds
|
|
57
|
+
// This can happen when the focused index is the last tab, and user removes that tab
|
|
58
|
+
// In that case the deferred index will still point to the last tab, but after re-render
|
|
59
|
+
// it will be out of bounds
|
|
60
|
+
const inBoundsDeferredFocusedIndex = deferredFocusedIndex < routes.length ? deferredFocusedIndex : focusedIndex;
|
|
56
61
|
let standardAppearance = (0, appearance_1.convertStyleToAppearance)({
|
|
57
62
|
...props.labelStyle,
|
|
58
63
|
iconColor: props.iconColor,
|
|
@@ -80,24 +85,15 @@ function NativeTabsView(props) {
|
|
|
80
85
|
.filter(({ route: { key } }) => (0, utils_1.shouldTabBeVisible)(descriptors[key].options))
|
|
81
86
|
.map(({ route, index }) => {
|
|
82
87
|
const descriptor = descriptors[route.key];
|
|
83
|
-
const isFocused = index ===
|
|
88
|
+
const isFocused = index === inBoundsDeferredFocusedIndex;
|
|
84
89
|
return (<Screen key={route.key} routeKey={route.key} name={route.name} descriptor={descriptor} isFocused={isFocused} standardAppearance={appearances[index].standardAppearance} scrollEdgeAppearance={appearances[index].scrollEdgeAppearance} badgeTextColor={props.badgeTextColor}/>);
|
|
85
90
|
});
|
|
91
|
+
const currentTabAppearance = appearances[inBoundsDeferredFocusedIndex]?.standardAppearance;
|
|
86
92
|
return (<BottomTabsWrapper
|
|
87
93
|
// #region android props
|
|
88
|
-
tabBarItemTitleFontColor={
|
|
89
|
-
?.tabBarItemTitleFontColor} tabBarItemTitleFontFamily={appearances[deferredFocusedIndex].standardAppearance.stacked?.normal
|
|
90
|
-
?.tabBarItemTitleFontFamily} tabBarItemTitleFontSize={appearances[deferredFocusedIndex].standardAppearance.stacked?.normal
|
|
91
|
-
?.tabBarItemTitleFontSize} tabBarItemTitleFontSizeActive={appearances[deferredFocusedIndex].standardAppearance.stacked?.normal
|
|
92
|
-
?.tabBarItemTitleFontSize} tabBarItemTitleFontWeight={appearances[deferredFocusedIndex].standardAppearance.stacked?.normal
|
|
93
|
-
?.tabBarItemTitleFontWeight} tabBarItemTitleFontStyle={appearances[deferredFocusedIndex].standardAppearance.stacked?.normal
|
|
94
|
-
?.tabBarItemTitleFontStyle} tabBarItemIconColor={appearances[deferredFocusedIndex].standardAppearance.stacked?.normal?.tabBarItemIconColor} tabBarBackgroundColor={appearances[deferredFocusedIndex].standardAppearance.tabBarBackgroundColor ??
|
|
95
|
-
props.backgroundColor ??
|
|
96
|
-
undefined} tabBarItemRippleColor={props.rippleColor} tabBarItemLabelVisibilityMode={props.labelVisibilityMode} tabBarItemIconColorActive={appearances[deferredFocusedIndex].standardAppearance?.stacked?.selected
|
|
97
|
-
?.tabBarItemIconColor ?? props?.tintColor} tabBarItemTitleFontColorActive={appearances[deferredFocusedIndex].standardAppearance?.stacked?.selected
|
|
98
|
-
?.tabBarItemTitleFontColor ?? props?.tintColor}
|
|
94
|
+
tabBarItemTitleFontColor={currentTabAppearance?.stacked?.normal?.tabBarItemTitleFontColor} tabBarItemTitleFontFamily={currentTabAppearance?.stacked?.normal?.tabBarItemTitleFontFamily} tabBarItemTitleFontSize={currentTabAppearance?.stacked?.normal?.tabBarItemTitleFontSize} tabBarItemTitleFontSizeActive={currentTabAppearance?.stacked?.normal?.tabBarItemTitleFontSize} tabBarItemTitleFontWeight={currentTabAppearance?.stacked?.normal?.tabBarItemTitleFontWeight} tabBarItemTitleFontStyle={currentTabAppearance?.stacked?.normal?.tabBarItemTitleFontStyle} tabBarItemIconColor={currentTabAppearance?.stacked?.normal?.tabBarItemIconColor} tabBarBackgroundColor={currentTabAppearance?.tabBarBackgroundColor ?? props.backgroundColor ?? undefined} tabBarItemRippleColor={props.rippleColor} tabBarItemLabelVisibilityMode={props.labelVisibilityMode} tabBarItemIconColorActive={currentTabAppearance?.stacked?.selected?.tabBarItemIconColor ?? props?.tintColor} tabBarItemTitleFontColorActive={currentTabAppearance?.stacked?.selected?.tabBarItemTitleFontColor ?? props?.tintColor}
|
|
99
95
|
// tabBarItemTitleFontSizeActive={activeStyle?.fontSize}
|
|
100
|
-
tabBarItemActiveIndicatorColor={options[
|
|
96
|
+
tabBarItemActiveIndicatorColor={options[inBoundsDeferredFocusedIndex]?.indicatorColor ?? props?.indicatorColor} tabBarItemActiveIndicatorEnabled={!disableIndicator}
|
|
101
97
|
// #endregion
|
|
102
98
|
// #region iOS props
|
|
103
99
|
tabBarTintColor={props?.tintColor} tabBarMinimizeBehavior={minimizeBehavior}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativeTabsView.js","sourceRoot":"","sources":["../../../src/native-tabs/NativeBottomTabs/NativeTabsView.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCA,wCA4IC;AA7KD,+CAA8E;AAE9E,+DAO8B;AAG9B,6CAKsB;AACtB,mCAMiB;AACjB,mCAA6C;AAE7C,8FAA8F;AAC9F,+DAA+D;AAC/D,mCAAY,CAAC,UAAU,CAAC,oBAAoB,GAAG,KAAK,CAAC;AAErD,MAAM,uBAAuB,GAAG,IAAI,GAAG,CAAS,8BAAsB,CAAC,CAAC;AAExE,SAAgB,cAAc,CAAC,KAA0B;IACvD,MAAM,EAAE,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,YAAY,EAAE,GAAG,KAAK,CAAC;IAC5E,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC;IACnD,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IAEzB,IAAI,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC;IAClC,IAAI,UAAU,IAAI,CAAC,uBAAuB,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC;QAC3D,OAAO,CAAC,IAAI,CACV,2BAA2B,UAAU,2BAA2B,8BAAsB,CAAC,GAAG,CACxF,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,MAAM,GAAG,CAC1B,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CACf,CAAC;QACF,UAAU,GAAG,SAAS,CAAC;IACzB,CAAC;IAED,MAAM,oBAAoB,GAAG,IAAA,wBAAgB,EAAC,YAAY,CAAC,CAAC;IAC5D,IAAI,kBAAkB,GAAG,IAAA,qCAAwB,EAAC;QAChD,GAAG,KAA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AA6B,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC;IAC/E,IAAI,sBAAsB,IAAI,CAAC,mCAAmC,CAAC,GAAG,CAAC,sBAAsB,CAAC,EAAE,CAAC;QAC/F,OAAO,CAAC,IAAI,CACV,iCAAiC,sBAAsB,2BAA2B,4CAAoC,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,IAAI,QAAQ,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CACvK,CAAC;QACF,sBAAsB,GAAG,SAAS,CAAC;IACrC,CAAC;IACD,IACE,6BAA6B;QAC7B,CAAC,0CAA0C,CAAC,GAAG,CAAC,6BAA6B,CAAC,EAC9E,CAAC;QACD,OAAO,CAAC,IAAI,CACV,oCAAoC,6BAA6B,2BAA2B,qDAA6C,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAClL,CAAC;QACF,6BAA6B,GAAG,SAAS,CAAC;IAC5C,CAAC;IAED,OAAO,CACL,CAAC,iCAAU,CACT,6BAA6B,CAAC,CAAC,6BAA6B,CAAC,CAC7D,sBAAsB,CAAC,CAAC,sBAAsB,CAAC,CAC/C,IAAI,IAAI,CAAC,EACT,CACH,CAAC;AACJ,CAAC","sourcesContent":["import React, { useDeferredValue, useEffect, useMemo, useState } from 'react';\nimport type { ColorValue, ImageSourcePropType } from 'react-native';\nimport {\n BottomTabs,\n BottomTabsScreen,\n featureFlags,\n type BottomTabsProps,\n type BottomTabsScreenAppearance,\n type BottomTabsScreenProps,\n} from 'react-native-screens';\nimport type { SFSymbol } from 'sf-symbols-typescript';\n\nimport {\n appendSelectedStyleToAppearance,\n convertStyleToAppearance,\n createScrollEdgeAppearanceFromOptions,\n createStandardAppearanceFromOptions,\n} from './appearance';\nimport {\n SUPPORTED_BLUR_EFFECTS,\n SUPPORTED_TAB_BAR_ITEM_LABEL_VISIBILITY_MODES,\n SUPPORTED_TAB_BAR_MINIMIZE_BEHAVIORS,\n type NativeTabOptions,\n type NativeTabsViewProps,\n} from './types';\nimport { shouldTabBeVisible } from './utils';\n\n// We let native tabs to control the changes. This requires freeze to be disabled for tab bar.\n// Otherwise user may see glitches when switching between tabs.\nfeatureFlags.experiment.controlledBottomTabs = false;\n\nconst supportedBlurEffectsSet = new Set<string>(SUPPORTED_BLUR_EFFECTS);\n\nexport function NativeTabsView(props: NativeTabsViewProps) {\n const { builder, minimizeBehavior, disableIndicator, focusedIndex } = props;\n const { state, descriptors, navigation } = builder;\n const { routes } = state;\n\n let blurEffect = props.blurEffect;\n if (blurEffect && !supportedBlurEffectsSet.has(blurEffect)) {\n console.warn(\n `Unsupported blurEffect: ${blurEffect}. Supported values are: ${SUPPORTED_BLUR_EFFECTS.map(\n (effect) => `\"${effect}\"`\n ).join(', ')}`\n );\n blurEffect = undefined;\n }\n\n const deferredFocusedIndex = useDeferredValue(focusedIndex);\n let standardAppearance = convertStyleToAppearance({\n ...props.labelStyle,\n iconColor: props.iconColor,\n blurEffect,\n backgroundColor: props.backgroundColor,\n badgeBackgroundColor: props.badgeBackgroundColor,\n });\n if (props.tintColor) {\n standardAppearance = appendSelectedStyleToAppearance(\n { iconColor: props.tintColor, color: props.tintColor },\n standardAppearance\n );\n }\n const scrollEdgeAppearance = convertStyleToAppearance({\n ...props.labelStyle,\n iconColor: props.iconColor,\n blurEffect,\n backgroundColor: props.backgroundColor,\n badgeBackgroundColor: props.badgeBackgroundColor,\n });\n\n const appearances = routes.map((route) => ({\n standardAppearance: createStandardAppearanceFromOptions(\n descriptors[route.key].options,\n standardAppearance\n ),\n scrollEdgeAppearance: createScrollEdgeAppearanceFromOptions(\n descriptors[route.key].options,\n scrollEdgeAppearance\n ),\n }));\n\n const options = routes.map((route) => descriptors[route.key].options);\n\n const children = routes\n .map((route, index) => ({ route, index }))\n .filter(({ route: { key } }) => shouldTabBeVisible(descriptors[key].options))\n .map(({ route, index }) => {\n const descriptor = descriptors[route.key];\n const isFocused = index === deferredFocusedIndex;\n\n return (\n <Screen\n key={route.key}\n routeKey={route.key}\n name={route.name}\n descriptor={descriptor}\n isFocused={isFocused}\n standardAppearance={appearances[index].standardAppearance}\n scrollEdgeAppearance={appearances[index].scrollEdgeAppearance}\n badgeTextColor={props.badgeTextColor}\n />\n );\n });\n\n return (\n <BottomTabsWrapper\n // #region android props\n tabBarItemTitleFontColor={\n appearances[deferredFocusedIndex].standardAppearance.stacked?.normal\n ?.tabBarItemTitleFontColor\n }\n tabBarItemTitleFontFamily={\n appearances[deferredFocusedIndex].standardAppearance.stacked?.normal\n ?.tabBarItemTitleFontFamily\n }\n tabBarItemTitleFontSize={\n appearances[deferredFocusedIndex].standardAppearance.stacked?.normal\n ?.tabBarItemTitleFontSize\n }\n tabBarItemTitleFontSizeActive={\n appearances[deferredFocusedIndex].standardAppearance.stacked?.normal\n ?.tabBarItemTitleFontSize\n }\n tabBarItemTitleFontWeight={\n appearances[deferredFocusedIndex].standardAppearance.stacked?.normal\n ?.tabBarItemTitleFontWeight\n }\n tabBarItemTitleFontStyle={\n appearances[deferredFocusedIndex].standardAppearance.stacked?.normal\n ?.tabBarItemTitleFontStyle\n }\n tabBarItemIconColor={\n appearances[deferredFocusedIndex].standardAppearance.stacked?.normal?.tabBarItemIconColor\n }\n tabBarBackgroundColor={\n appearances[deferredFocusedIndex].standardAppearance.tabBarBackgroundColor ??\n props.backgroundColor ??\n undefined\n }\n tabBarItemRippleColor={props.rippleColor}\n tabBarItemLabelVisibilityMode={props.labelVisibilityMode}\n tabBarItemIconColorActive={\n appearances[deferredFocusedIndex].standardAppearance?.stacked?.selected\n ?.tabBarItemIconColor ?? props?.tintColor\n }\n tabBarItemTitleFontColorActive={\n appearances[deferredFocusedIndex].standardAppearance?.stacked?.selected\n ?.tabBarItemTitleFontColor ?? props?.tintColor\n }\n // tabBarItemTitleFontSizeActive={activeStyle?.fontSize}\n tabBarItemActiveIndicatorColor={\n options[deferredFocusedIndex]?.indicatorColor ?? props?.indicatorColor\n }\n tabBarItemActiveIndicatorEnabled={!disableIndicator}\n // #endregion\n // #region iOS props\n tabBarTintColor={props?.tintColor}\n tabBarMinimizeBehavior={minimizeBehavior}\n // #endregion\n onNativeFocusChange={({ nativeEvent: { tabKey } }) => {\n const descriptor = descriptors[tabKey];\n const route = descriptor.route;\n navigation.dispatch({\n type: 'JUMP_TO',\n target: state.key,\n payload: {\n name: route.name,\n },\n });\n }}>\n {children}\n </BottomTabsWrapper>\n );\n}\n\nfunction Screen(props: {\n routeKey: string;\n name: string;\n descriptor: NativeTabsViewProps['builder']['descriptors'][string];\n isFocused: boolean;\n standardAppearance: BottomTabsScreenAppearance;\n scrollEdgeAppearance: BottomTabsScreenAppearance;\n badgeTextColor: ColorValue | undefined;\n}) {\n const {\n routeKey,\n name,\n descriptor,\n isFocused,\n standardAppearance,\n scrollEdgeAppearance,\n badgeTextColor,\n } = props;\n const title = descriptor.options.title ?? name;\n\n const icon = useAwaitedScreensIcon(descriptor.options.icon);\n const selectedIcon = useAwaitedScreensIcon(descriptor.options.selectedIcon);\n\n return (\n <BottomTabsScreen\n {...descriptor.options}\n tabBarItemBadgeBackgroundColor={\n standardAppearance.stacked?.normal?.tabBarItemBadgeBackgroundColor\n }\n tabBarItemBadgeTextColor={badgeTextColor}\n standardAppearance={standardAppearance}\n scrollEdgeAppearance={scrollEdgeAppearance}\n iconResourceName={getAndroidIconResourceName(icon)}\n iconResource={getAndroidIconResource(icon)}\n icon={convertOptionsIconToPropsIcon(icon)}\n selectedIcon={convertOptionsIconToPropsIcon(selectedIcon)}\n title={title}\n freezeContents={false}\n tabKey={routeKey}\n systemItem={descriptor.options.role}\n isFocused={isFocused}>\n {descriptor.render()}\n </BottomTabsScreen>\n );\n}\n\ntype AwaitedIcon =\n | {\n sf?: SFSymbol;\n drawable?: string;\n }\n | {\n src?: ImageSourcePropType;\n };\n\nfunction useAwaitedScreensIcon(icon: NativeTabOptions['icon']) {\n const src = icon && typeof icon === 'object' && 'src' in icon ? icon.src : undefined;\n const [awaitedIcon, setAwaitedIcon] = useState<AwaitedIcon | undefined>(undefined);\n\n useEffect(() => {\n const loadIcon = async () => {\n if (src && src instanceof Promise) {\n const awaitedSrc = await src;\n if (awaitedSrc) {\n const currentAwaitedIcon = { src: awaitedSrc };\n setAwaitedIcon(currentAwaitedIcon);\n }\n }\n };\n loadIcon();\n // Checking `src` rather then icon here, to avoid unnecessary re-renders\n // The icon object can be recreated, while src should stay the same\n // In this case as we control `VectorIcon`, it will only change if `family` or `name` props change\n // So we should be safe with promise resolving\n }, [src]);\n\n return useMemo(() => (isAwaitedIcon(icon) ? icon : awaitedIcon), [awaitedIcon, icon]);\n}\n\nfunction isAwaitedIcon(icon: NativeTabOptions['icon']): icon is AwaitedIcon {\n return !icon || !('src' in icon && icon.src instanceof Promise);\n}\n\nfunction convertOptionsIconToPropsIcon(\n icon: AwaitedIcon | undefined\n): BottomTabsScreenProps['icon'] {\n if (!icon) {\n return undefined;\n }\n if ('sf' in icon && icon.sf) {\n return { sfSymbolName: icon.sf };\n } else if ('src' in icon && icon.src) {\n return { templateSource: icon.src };\n }\n return undefined;\n}\n\nfunction getAndroidIconResource(\n icon: AwaitedIcon | undefined\n): BottomTabsScreenProps['iconResource'] {\n if (icon && 'src' in icon && icon.src) {\n return icon.src;\n }\n return undefined;\n}\n\nfunction getAndroidIconResourceName(\n icon: AwaitedIcon | undefined\n): BottomTabsScreenProps['iconResourceName'] {\n if (icon && 'drawable' in icon && icon.drawable) {\n return icon.drawable;\n }\n return undefined;\n}\n\nconst supportedTabBarMinimizeBehaviorsSet = new Set<string>(SUPPORTED_TAB_BAR_MINIMIZE_BEHAVIORS);\nconst supportedTabBarItemLabelVisibilityModesSet = new Set<string>(\n SUPPORTED_TAB_BAR_ITEM_LABEL_VISIBILITY_MODES\n);\n\nfunction BottomTabsWrapper(props: BottomTabsProps) {\n let { tabBarMinimizeBehavior, tabBarItemLabelVisibilityMode, ...rest } = props;\n if (tabBarMinimizeBehavior && !supportedTabBarMinimizeBehaviorsSet.has(tabBarMinimizeBehavior)) {\n console.warn(\n `Unsupported minimizeBehavior: ${tabBarMinimizeBehavior}. Supported values are: ${SUPPORTED_TAB_BAR_MINIMIZE_BEHAVIORS.map((behavior) => `\"${behavior}\"`).join(', ')}`\n );\n tabBarMinimizeBehavior = undefined;\n }\n if (\n tabBarItemLabelVisibilityMode &&\n !supportedTabBarItemLabelVisibilityModesSet.has(tabBarItemLabelVisibilityMode)\n ) {\n console.warn(\n `Unsupported labelVisibilityMode: ${tabBarItemLabelVisibilityMode}. Supported values are: ${SUPPORTED_TAB_BAR_ITEM_LABEL_VISIBILITY_MODES.map((mode) => `\"${mode}\"`).join(', ')}`\n );\n tabBarItemLabelVisibilityMode = undefined;\n }\n\n return (\n <BottomTabs\n tabBarItemLabelVisibilityMode={tabBarItemLabelVisibilityMode}\n tabBarMinimizeBehavior={tabBarMinimizeBehavior}\n {...rest}\n />\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"NativeTabsView.js","sourceRoot":"","sources":["../../../src/native-tabs/NativeBottomTabs/NativeTabsView.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCA,wCA6HC;AA9JD,+CAA8E;AAE9E,+DAO8B;AAG9B,6CAKsB;AACtB,mCAMiB;AACjB,mCAA6C;AAE7C,8FAA8F;AAC9F,+DAA+D;AAC/D,mCAAY,CAAC,UAAU,CAAC,oBAAoB,GAAG,KAAK,CAAC;AAErD,MAAM,uBAAuB,GAAG,IAAI,GAAG,CAAS,8BAAsB,CAAC,CAAC;AAExE,SAAgB,cAAc,CAAC,KAA0B;IACvD,MAAM,EAAE,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,YAAY,EAAE,GAAG,KAAK,CAAC;IAC5E,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC;IACnD,MAAM,EAAE,M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T,CACH,CAAC;AACJ,CAAC","sourcesContent":["import React, { useDeferredValue, useEffect, useMemo, useState } from 'react';\nimport type { ColorValue, ImageSourcePropType } from 'react-native';\nimport {\n BottomTabs,\n BottomTabsScreen,\n featureFlags,\n type BottomTabsProps,\n type BottomTabsScreenAppearance,\n type BottomTabsScreenProps,\n} from 'react-native-screens';\nimport type { SFSymbol } from 'sf-symbols-typescript';\n\nimport {\n appendSelectedStyleToAppearance,\n convertStyleToAppearance,\n createScrollEdgeAppearanceFromOptions,\n createStandardAppearanceFromOptions,\n} from './appearance';\nimport {\n SUPPORTED_BLUR_EFFECTS,\n SUPPORTED_TAB_BAR_ITEM_LABEL_VISIBILITY_MODES,\n SUPPORTED_TAB_BAR_MINIMIZE_BEHAVIORS,\n type NativeTabOptions,\n type NativeTabsViewProps,\n} from './types';\nimport { shouldTabBeVisible } from './utils';\n\n// We let native tabs to control the changes. This requires freeze to be disabled for tab bar.\n// Otherwise user may see glitches when switching between tabs.\nfeatureFlags.experiment.controlledBottomTabs = false;\n\nconst supportedBlurEffectsSet = new Set<string>(SUPPORTED_BLUR_EFFECTS);\n\nexport function NativeTabsView(props: NativeTabsViewProps) {\n const { builder, minimizeBehavior, disableIndicator, focusedIndex } = props;\n const { state, descriptors, navigation } = builder;\n const { routes } = state;\n\n let blurEffect = props.blurEffect;\n if (blurEffect && !supportedBlurEffectsSet.has(blurEffect)) {\n console.warn(\n `Unsupported blurEffect: ${blurEffect}. Supported values are: ${SUPPORTED_BLUR_EFFECTS.map(\n (effect) => `\"${effect}\"`\n ).join(', ')}`\n );\n blurEffect = undefined;\n }\n\n const deferredFocusedIndex = useDeferredValue(focusedIndex);\n // We need to check if the deferred index is not out of bounds\n // This can happen when the focused index is the last tab, and user removes that tab\n // In that case the deferred index will still point to the last tab, but after re-render\n // it will be out of bounds\n const inBoundsDeferredFocusedIndex =\n deferredFocusedIndex < routes.length ? deferredFocusedIndex : focusedIndex;\n\n let standardAppearance = convertStyleToAppearance({\n ...props.labelStyle,\n iconColor: props.iconColor,\n blurEffect,\n backgroundColor: props.backgroundColor,\n badgeBackgroundColor: props.badgeBackgroundColor,\n });\n if (props.tintColor) {\n standardAppearance = appendSelectedStyleToAppearance(\n { iconColor: props.tintColor, color: props.tintColor },\n standardAppearance\n );\n }\n const scrollEdgeAppearance = convertStyleToAppearance({\n ...props.labelStyle,\n iconColor: props.iconColor,\n blurEffect,\n backgroundColor: props.backgroundColor,\n badgeBackgroundColor: props.badgeBackgroundColor,\n });\n\n const appearances = routes.map((route) => ({\n standardAppearance: createStandardAppearanceFromOptions(\n descriptors[route.key].options,\n standardAppearance\n ),\n scrollEdgeAppearance: createScrollEdgeAppearanceFromOptions(\n descriptors[route.key].options,\n scrollEdgeAppearance\n ),\n }));\n\n const options = routes.map((route) => descriptors[route.key].options);\n\n const children = routes\n .map((route, index) => ({ route, index }))\n .filter(({ route: { key } }) => shouldTabBeVisible(descriptors[key].options))\n .map(({ route, index }) => {\n const descriptor = descriptors[route.key];\n const isFocused = index === inBoundsDeferredFocusedIndex;\n\n return (\n <Screen\n key={route.key}\n routeKey={route.key}\n name={route.name}\n descriptor={descriptor}\n isFocused={isFocused}\n standardAppearance={appearances[index].standardAppearance}\n scrollEdgeAppearance={appearances[index].scrollEdgeAppearance}\n badgeTextColor={props.badgeTextColor}\n />\n );\n });\n\n const currentTabAppearance = appearances[inBoundsDeferredFocusedIndex]?.standardAppearance;\n\n return (\n <BottomTabsWrapper\n // #region android props\n tabBarItemTitleFontColor={currentTabAppearance?.stacked?.normal?.tabBarItemTitleFontColor}\n tabBarItemTitleFontFamily={currentTabAppearance?.stacked?.normal?.tabBarItemTitleFontFamily}\n tabBarItemTitleFontSize={currentTabAppearance?.stacked?.normal?.tabBarItemTitleFontSize}\n tabBarItemTitleFontSizeActive={currentTabAppearance?.stacked?.normal?.tabBarItemTitleFontSize}\n tabBarItemTitleFontWeight={currentTabAppearance?.stacked?.normal?.tabBarItemTitleFontWeight}\n tabBarItemTitleFontStyle={currentTabAppearance?.stacked?.normal?.tabBarItemTitleFontStyle}\n tabBarItemIconColor={currentTabAppearance?.stacked?.normal?.tabBarItemIconColor}\n tabBarBackgroundColor={\n currentTabAppearance?.tabBarBackgroundColor ?? props.backgroundColor ?? undefined\n }\n tabBarItemRippleColor={props.rippleColor}\n tabBarItemLabelVisibilityMode={props.labelVisibilityMode}\n tabBarItemIconColorActive={\n currentTabAppearance?.stacked?.selected?.tabBarItemIconColor ?? props?.tintColor\n }\n tabBarItemTitleFontColorActive={\n currentTabAppearance?.stacked?.selected?.tabBarItemTitleFontColor ?? props?.tintColor\n }\n // tabBarItemTitleFontSizeActive={activeStyle?.fontSize}\n tabBarItemActiveIndicatorColor={\n options[inBoundsDeferredFocusedIndex]?.indicatorColor ?? props?.indicatorColor\n }\n tabBarItemActiveIndicatorEnabled={!disableIndicator}\n // #endregion\n // #region iOS props\n tabBarTintColor={props?.tintColor}\n tabBarMinimizeBehavior={minimizeBehavior}\n // #endregion\n onNativeFocusChange={({ nativeEvent: { tabKey } }) => {\n const descriptor = descriptors[tabKey];\n const route = descriptor.route;\n navigation.dispatch({\n type: 'JUMP_TO',\n target: state.key,\n payload: {\n name: route.name,\n },\n });\n }}>\n {children}\n </BottomTabsWrapper>\n );\n}\n\nfunction Screen(props: {\n routeKey: string;\n name: string;\n descriptor: NativeTabsViewProps['builder']['descriptors'][string];\n isFocused: boolean;\n standardAppearance: BottomTabsScreenAppearance;\n scrollEdgeAppearance: BottomTabsScreenAppearance;\n badgeTextColor: ColorValue | undefined;\n}) {\n const {\n routeKey,\n name,\n descriptor,\n isFocused,\n standardAppearance,\n scrollEdgeAppearance,\n badgeTextColor,\n } = props;\n const title = descriptor.options.title ?? name;\n\n const icon = useAwaitedScreensIcon(descriptor.options.icon);\n const selectedIcon = useAwaitedScreensIcon(descriptor.options.selectedIcon);\n\n return (\n <BottomTabsScreen\n {...descriptor.options}\n tabBarItemBadgeBackgroundColor={\n standardAppearance.stacked?.normal?.tabBarItemBadgeBackgroundColor\n }\n tabBarItemBadgeTextColor={badgeTextColor}\n standardAppearance={standardAppearance}\n scrollEdgeAppearance={scrollEdgeAppearance}\n iconResourceName={getAndroidIconResourceName(icon)}\n iconResource={getAndroidIconResource(icon)}\n icon={convertOptionsIconToPropsIcon(icon)}\n selectedIcon={convertOptionsIconToPropsIcon(selectedIcon)}\n title={title}\n freezeContents={false}\n tabKey={routeKey}\n systemItem={descriptor.options.role}\n isFocused={isFocused}>\n {descriptor.render()}\n </BottomTabsScreen>\n );\n}\n\ntype AwaitedIcon =\n | {\n sf?: SFSymbol;\n drawable?: string;\n }\n | {\n src?: ImageSourcePropType;\n };\n\nfunction useAwaitedScreensIcon(icon: NativeTabOptions['icon']) {\n const src = icon && typeof icon === 'object' && 'src' in icon ? icon.src : undefined;\n const [awaitedIcon, setAwaitedIcon] = useState<AwaitedIcon | undefined>(undefined);\n\n useEffect(() => {\n const loadIcon = async () => {\n if (src && src instanceof Promise) {\n const awaitedSrc = await src;\n if (awaitedSrc) {\n const currentAwaitedIcon = { src: awaitedSrc };\n setAwaitedIcon(currentAwaitedIcon);\n }\n }\n };\n loadIcon();\n // Checking `src` rather then icon here, to avoid unnecessary re-renders\n // The icon object can be recreated, while src should stay the same\n // In this case as we control `VectorIcon`, it will only change if `family` or `name` props change\n // So we should be safe with promise resolving\n }, [src]);\n\n return useMemo(() => (isAwaitedIcon(icon) ? icon : awaitedIcon), [awaitedIcon, icon]);\n}\n\nfunction isAwaitedIcon(icon: NativeTabOptions['icon']): icon is AwaitedIcon {\n return !icon || !('src' in icon && icon.src instanceof Promise);\n}\n\nfunction convertOptionsIconToPropsIcon(\n icon: AwaitedIcon | undefined\n): BottomTabsScreenProps['icon'] {\n if (!icon) {\n return undefined;\n }\n if ('sf' in icon && icon.sf) {\n return { sfSymbolName: icon.sf };\n } else if ('src' in icon && icon.src) {\n return { templateSource: icon.src };\n }\n return undefined;\n}\n\nfunction getAndroidIconResource(\n icon: AwaitedIcon | undefined\n): BottomTabsScreenProps['iconResource'] {\n if (icon && 'src' in icon && icon.src) {\n return icon.src;\n }\n return undefined;\n}\n\nfunction getAndroidIconResourceName(\n icon: AwaitedIcon | undefined\n): BottomTabsScreenProps['iconResourceName'] {\n if (icon && 'drawable' in icon && icon.drawable) {\n return icon.drawable;\n }\n return undefined;\n}\n\nconst supportedTabBarMinimizeBehaviorsSet = new Set<string>(SUPPORTED_TAB_BAR_MINIMIZE_BEHAVIORS);\nconst supportedTabBarItemLabelVisibilityModesSet = new Set<string>(\n SUPPORTED_TAB_BAR_ITEM_LABEL_VISIBILITY_MODES\n);\n\nfunction BottomTabsWrapper(props: BottomTabsProps) {\n let { tabBarMinimizeBehavior, tabBarItemLabelVisibilityMode, ...rest } = props;\n if (tabBarMinimizeBehavior && !supportedTabBarMinimizeBehaviorsSet.has(tabBarMinimizeBehavior)) {\n console.warn(\n `Unsupported minimizeBehavior: ${tabBarMinimizeBehavior}. Supported values are: ${SUPPORTED_TAB_BAR_MINIMIZE_BEHAVIORS.map((behavior) => `\"${behavior}\"`).join(', ')}`\n );\n tabBarMinimizeBehavior = undefined;\n }\n if (\n tabBarItemLabelVisibilityMode &&\n !supportedTabBarItemLabelVisibilityModesSet.has(tabBarItemLabelVisibilityMode)\n ) {\n console.warn(\n `Unsupported labelVisibilityMode: ${tabBarItemLabelVisibilityMode}. Supported values are: ${SUPPORTED_TAB_BAR_ITEM_LABEL_VISIBILITY_MODES.map((mode) => `\"${mode}\"`).join(', ')}`\n );\n tabBarItemLabelVisibilityMode = undefined;\n }\n\n return (\n <BottomTabs\n tabBarItemLabelVisibilityMode={tabBarItemLabelVisibilityMode}\n tabBarMinimizeBehavior={tabBarMinimizeBehavior}\n {...rest}\n />\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderRootComponent.d.ts","sourceRoot":"","sources":["../src/renderRootComponent.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"renderRootComponent.d.ts","sourceRoot":"","sources":["../src/renderRootComponent.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AA+C/B;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,QAwCtE"}
|
|
@@ -34,7 +34,6 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.renderRootComponent = renderRootComponent;
|
|
37
|
-
const log_box_1 = require("@expo/log-box");
|
|
38
37
|
const expo_1 = require("expo");
|
|
39
38
|
const React = __importStar(require("react"));
|
|
40
39
|
const react_native_1 = require("react-native");
|
|
@@ -79,15 +78,18 @@ function convertError(error) {
|
|
|
79
78
|
*/
|
|
80
79
|
function renderRootComponent(Component) {
|
|
81
80
|
try {
|
|
82
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
83
|
-
(0, log_box_1.setupLogBox)();
|
|
84
|
-
}
|
|
85
81
|
// This must be delayed so the user has a chance to call it first.
|
|
86
82
|
setTimeout(() => {
|
|
87
83
|
SplashScreen._internal_preventAutoHideAsync?.();
|
|
88
84
|
});
|
|
89
85
|
React.startTransition(() => {
|
|
90
|
-
(
|
|
86
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
87
|
+
const { withErrorOverlay } = require('@expo/metro-runtime/error-overlay');
|
|
88
|
+
(0, expo_1.registerRootComponent)(withErrorOverlay(Component));
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
(0, expo_1.registerRootComponent)(Component);
|
|
92
|
+
}
|
|
91
93
|
});
|
|
92
94
|
}
|
|
93
95
|
catch (e) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderRootComponent.js","sourceRoot":"","sources":["../src/renderRootComponent.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"renderRootComponent.js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C,CAAC,CAAC;AAClC,CAAC;AAED;;;GAGG;AACH,SAAgB,mBAAmB,CAAC,SAAmC;IACrE,IAAI,CAAC;QACH,kEAAkE;QAClE,UAAU,CAAC,GAAG,EAAE;YACd,YAAY,CAAC,8BAA8B,EAAE,EAAE,CAAC;QAClD,CAAC,CAAC,CAAC;QAEH,KAAK,CAAC,eAAe,CAAC,GAAG,EAAE;YACzB,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,EAAE,CAAC;gBAC1C,MAAM,EAAE,gBAAgB,EAAE,GACxB,OAAO,CAAC,mCAAmC,CAAuD,CAAC;gBACrG,IAAA,4BAAqB,EAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC,CAAC;YACrD,CAAC;iBAAM,CAAC;gBACN,IAAA,4BAAqB,EAAC,SAAS,CAAC,CAAC;YACnC,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,uEAAuE;QACvE,YAAY,CAAC,SAAS,EAAE,CAAC;QAEzB,MAAM,KAAK,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;QAC9B,2CAA2C;QAC3C,mFAAmF;QACnF,yIAAyI;QACzI,+FAA+F;QAC/F,IAAA,4BAAqB,EAAC,GAAG,EAAE,CAAC,CAAC,mBAAI,CAAC,AAAD,EAAG,CAAC,CAAC;QAEtC,gFAAgF;QAChF,IAAI,OAAO,CAAC,GAAG,CAAC,OAAO,KAAK,KAAK,EAAE,CAAC;YAClC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YACrB,OAAO,CAAC,KAAK,CAAC,kEAAkE,CAAC,CAAC;QACpF,CAAC;QAED,+CAA+C;QAC/C,UAAU,CAAC,GAAG,EAAE;YACd,MAAM,KAAK,CAAC;QACd,CAAC,CAAC,CAAC;QAEH,+CAA+C;IACjD,CAAC;AACH,CAAC","sourcesContent":["import { registerRootComponent } from 'expo';\nimport * as React from 'react';\nimport { View } from 'react-native';\n\nimport * as SplashScreen from './utils/splash';\n\nfunction isBaseObject(obj: any) {\n if (Object.prototype.toString.call(obj) !== '[object Object]') {\n return false;\n }\n const proto = Object.getPrototypeOf(obj);\n if (proto === null) {\n return true;\n }\n return proto === Object.prototype;\n}\n\nfunction isErrorShaped(error: any): error is Error {\n return (\n error &&\n typeof error === 'object' &&\n typeof error.name === 'string' &&\n typeof error.message === 'string'\n );\n}\n\n/**\n * After we throw this error, any number of tools could handle it.\n * This check ensures the error is always in a reason state before surfacing it to the runtime.\n */\nfunction convertError(error: any) {\n if (isErrorShaped(error)) {\n return error;\n }\n\n if (process.env.NODE_ENV === 'development') {\n if (error == null) {\n return new Error('A null/undefined error was thrown.');\n }\n }\n\n if (isBaseObject(error)) {\n return new Error(JSON.stringify(error));\n }\n\n return new Error(String(error));\n}\n\n/**\n * Register and mount the root component using the predefined rendering\n * method. This function ensures the Splash Screen and errors are handled correctly.\n */\nexport function renderRootComponent(Component: React.ComponentType<any>) {\n try {\n // This must be delayed so the user has a chance to call it first.\n setTimeout(() => {\n SplashScreen._internal_preventAutoHideAsync?.();\n });\n\n React.startTransition(() => {\n if (process.env.NODE_ENV !== 'production') {\n const { withErrorOverlay } =\n require('@expo/metro-runtime/error-overlay') as typeof import('@expo/metro-runtime/error-overlay');\n registerRootComponent(withErrorOverlay(Component));\n } else {\n registerRootComponent(Component);\n }\n });\n } catch (e) {\n // Hide the splash screen if there was an error so the user can see it.\n SplashScreen.hideAsync();\n\n const error = convertError(e);\n // Prevent the app from throwing confusing:\n // ERROR Invariant Violation: \"main\" has not been registered. This can happen if:\n // * Metro (the local dev server) is run from the wrong folder. Check if Metro is running, stop it and restart it in the current project.\n // * A module failed to load due to an error and `AppRegistry.registerComponent` wasn't called.\n registerRootComponent(() => <View />);\n\n // Console is pretty useless on native, on web you get interactive stack traces.\n if (process.env.EXPO_OS === 'web') {\n console.error(error);\n console.error(`A runtime error has occurred while rendering the root component.`);\n }\n\n // Give React a tick to render before throwing.\n setTimeout(() => {\n throw error;\n });\n\n // TODO: Render a production-only error screen.\n }\n}\n"]}
|
|
@@ -24,7 +24,7 @@ function StandardErrorView({ error }) {
|
|
|
24
24
|
</react_native_1.View>);
|
|
25
25
|
}
|
|
26
26
|
function ErrorBoundary({ error, retry }) {
|
|
27
|
-
const inTabBar = (0, react_1.
|
|
27
|
+
const inTabBar = (0, react_1.use)(bottom_tabs_1.BottomTabBarHeightContext);
|
|
28
28
|
const Wrapper = inTabBar ? react_native_1.View : react_native_safe_area_context_1.SafeAreaView;
|
|
29
29
|
const isServerError = error instanceof errors_1.ReactServerError;
|
|
30
30
|
return (<react_native_1.View style={styles.container}>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorBoundary.js","sourceRoot":"","sources":["../../src/views/ErrorBoundary.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;AA8Bb,sCAuCC;AAnED,+DAA0E;AAC1E,iCAAmC;AACnC,+CAAuF;AACvF,mFAA8D;AAE9D,2CAAwC;AAExC,uCAAoC;AACpC,iDAAwD;AAExD,SAAS,iBAAiB,CAAC,EAAE,KAAK,EAAoB;IACpD,OAAO,CACL,CAAC,mBAAI,CACH,KAAK,CAAC,CAAC;YACL,YAAY,EAAE,EAAE;YAChB,GAAG,EAAE,CAAC;YACN,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,OAAO,KAAK,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ;SAC5D,CAAC,CACF;MAAA,CAAC,mBAAI,CAAC,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CACtD;;MACF,EAAE,mBAAI,CACN;MAAA,CAAC,mBAAI,CAAC,MAAM,CAAC,sBAAsB,CAAC,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,YAA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,EAAE;KACjB;IACD,IAAI,EAAE;QACJ,KAAK,EAAE,uBAAuB;QAC9B,mBAAmB,EAAE,OAAO;QAC5B,kBAAkB,EAAE,WAAW;QAC/B,QAAQ,EAAE,EAAE;QACZ,SAAS,EAAE,QAAQ;KACpB;CACF,CAAC,CAAC","sourcesContent":["'use client';\n\nimport { BottomTabBarHeightContext } from '@react-navigation/bottom-tabs';\nimport { useContext } from 'react';\nimport { StyleSheet, Text, View, Platform, ScrollView, TextInput } from 'react-native';\nimport { SafeAreaView } from 'react-native-safe-area-context';\n\nimport { Pressable } from './Pressable';\nimport { ErrorBoundaryProps } from './Try';\nimport { Link } from '../link/Link';\nimport { ReactServerError } from '../rsc/router/errors';\n\nfunction StandardErrorView({ error }: { error: Error }) {\n return (\n <View\n style={{\n marginBottom: 12,\n gap: 4,\n flexWrap: process.env.EXPO_OS === 'web' ? 'wrap' : 'nowrap',\n }}>\n <Text role=\"heading\" aria-level={1} style={styles.title}>\n Something went wrong\n </Text>\n <Text testID=\"router_error_message\" role=\"heading\" aria-level={2} style={styles.errorMessage}>\n Error: {error.message}\n </Text>\n </View>\n );\n}\n\nexport function ErrorBoundary({ error, retry }: ErrorBoundaryProps) {\n const inTabBar = useContext(BottomTabBarHeightContext);\n const Wrapper = inTabBar ? View : SafeAreaView;\n\n const isServerError = error instanceof ReactServerError;\n return (\n <View style={styles.container}>\n <Wrapper style={{ flex: 1, gap: 8, maxWidth: 720, marginHorizontal: 'auto' }}>\n {isServerError ? (\n <ReactServerErrorView error={error} />\n ) : (\n <StandardErrorView error={error} />\n )}\n <View style={{ flex: 1 }} />\n\n {process.env.NODE_ENV === 'development' && (\n <Link testID=\"router_error_sitemap\" href=\"/_sitemap\" style={styles.link}>\n Sitemap\n </Link>\n )}\n <Pressable testID=\"router_error_retry\" onPress={retry}>\n {({ hovered, pressed }) => (\n <View\n style={[styles.buttonInner, (hovered || pressed) && { backgroundColor: 'white' }]}>\n <Text\n style={[\n styles.buttonText,\n {\n color: hovered || pressed ? 'black' : 'white',\n },\n ]}>\n Retry\n </Text>\n </View>\n )}\n </Pressable>\n </Wrapper>\n </View>\n );\n}\n\nconst COMMON_ERROR_STATUS: Record<number, string | undefined> = {\n 404: 'NOT_FOUND',\n 500: 'INTERNAL_SERVER_ERROR',\n 503: 'SERVICE_UNAVAILABLE',\n 504: 'GATEWAY_TIMEOUT',\n};\n\n// TODO: This should probably be replaced by a DOM component that loads server errors in the future.\nfunction ReactServerErrorView({ error }: { error: ReactServerError }) {\n let title = String(error.statusCode);\n title += ': ' + (COMMON_ERROR_STATUS[error.statusCode] ?? 'Server Error');\n\n const errorId = error.headers.get('cf-ray');\n\n const date = error.headers.get('Date');\n\n return (\n <View\n style={{\n padding: 12,\n gap: 8,\n }}>\n <Text\n selectable\n allowFontScaling\n style={{\n fontSize: Platform.select({ web: 24, default: 16 }),\n fontWeight: 'bold',\n marginBottom: 4,\n color: 'white',\n }}>\n {title}\n </Text>\n\n {process.env.EXPO_OS === 'web' ? (\n <ScrollView\n style={{\n borderColor: 'rgba(255,255,255,0.5)',\n borderTopWidth: StyleSheet.hairlineWidth,\n borderBottomWidth: StyleSheet.hairlineWidth,\n maxHeight: 150,\n }}\n contentContainerStyle={{ paddingVertical: 4 }}>\n <Text\n testID=\"router_error_message\"\n selectable\n allowFontScaling\n style={{\n color: 'white',\n }}>\n {error.message}\n </Text>\n </ScrollView>\n ) : (\n <TextInput\n testID=\"router_error_message\"\n scrollEnabled\n multiline\n editable={false}\n allowFontScaling\n value={error.message}\n style={{\n borderColor: 'rgba(255,255,255,0.5)',\n borderTopWidth: StyleSheet.hairlineWidth,\n borderBottomWidth: StyleSheet.hairlineWidth,\n paddingVertical: 4,\n maxHeight: 150,\n color: 'white',\n }}\n />\n )}\n\n <InfoRow title=\"Code\" right={error.statusCode} />\n {errorId && <InfoRow title=\"ID\" right={errorId} />}\n {date && <InfoRow title=\"Date\" right={date} />}\n\n {error.url && (\n <Text selectable allowFontScaling style={{ fontSize: 14, opacity: 0.5, color: 'white' }}>\n {error.url}\n </Text>\n )}\n </View>\n );\n}\n\nfunction InfoRow({ title, right }: { title: string; right?: any }) {\n const style = {\n fontSize: 16,\n color: 'white',\n };\n\n return (\n <View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>\n <Text selectable allowFontScaling style={style}>\n {title}\n </Text>\n {right && (\n <Text selectable allowFontScaling style={[style, styles.code]}>\n {right}\n </Text>\n )}\n </View>\n );\n}\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n backgroundColor: 'black',\n padding: 24,\n alignItems: 'stretch',\n justifyContent: 'center',\n },\n title: {\n color: 'white',\n fontSize: Platform.select({ web: 32, default: 24 }),\n fontWeight: 'bold',\n },\n buttonText: {\n fontSize: 18,\n fontWeight: 'bold',\n color: 'black',\n ...Platform.select({\n web: {\n transitionDuration: '100ms',\n },\n }),\n },\n buttonInner: {\n ...Platform.select({\n web: {\n transitionDuration: '100ms',\n },\n }),\n paddingVertical: 12,\n paddingHorizontal: 24,\n borderColor: 'white',\n borderWidth: 2,\n marginLeft: 8,\n justifyContent: 'center',\n alignItems: 'center',\n },\n code: {\n fontFamily: Platform.select({\n default: 'Courier',\n ios: 'Courier New',\n android: 'monospace',\n }),\n fontWeight: '500',\n },\n errorMessage: {\n color: 'white',\n fontSize: 16,\n },\n subtitle: {\n color: 'white',\n fontSize: 14,\n marginBottom: 12,\n },\n link: {\n color: 'rgba(255,255,255,0.4)',\n textDecorationStyle: 'solid',\n textDecorationLine: 'underline',\n fontSize: 14,\n textAlign: 'center',\n },\n});\n"]}
|
|
1
|
+
{"version":3,"file":"ErrorBoundary.js","sourceRoot":"","sources":["../../src/views/ErrorBoundary.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;AA8Bb,sCAuCC;AAnED,+DAA0E;AAC1E,iCAA4B;AAC5B,+CAAuF;AACvF,mFAA8D;AAE9D,2CAAwC;AAExC,uCAAoC;AACpC,iDAAwD;AAExD,SAAS,iBAAiB,CAAC,EAAE,KAAK,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kB,EAAE,OAAO;aAC5B;SACF,CAAC;QACF,eAAe,EAAE,EAAE;QACnB,iBAAiB,EAAE,EAAE;QACrB,WAAW,EAAE,OAAO;QACpB,WAAW,EAAE,CAAC;QACd,UAAU,EAAE,CAAC;QACb,cAAc,EAAE,QAAQ;QACxB,UAAU,EAAE,QAAQ;KACrB;IACD,IAAI,EAAE;QACJ,UAAU,EAAE,uBAAQ,CAAC,MAAM,CAAC;YAC1B,OAAO,EAAE,SAAS;YAClB,GAAG,EAAE,aAAa;YAClB,OAAO,EAAE,WAAW;SACrB,CAAC;QACF,UAAU,EAAE,KAAK;KAClB;IACD,YAAY,EAAE;QACZ,KAAK,EAAE,OAAO;QACd,QAAQ,EAAE,EAAE;KACb;IACD,QAAQ,EAAE;QACR,KAAK,EAAE,OAAO;QACd,QAAQ,EAAE,EAAE;QACZ,YAAY,EAAE,EAAE;KACjB;IACD,IAAI,EAAE;QACJ,KAAK,EAAE,uBAAuB;QAC9B,mBAAmB,EAAE,OAAO;QAC5B,kBAAkB,EAAE,WAAW;QAC/B,QAAQ,EAAE,EAAE;QACZ,SAAS,EAAE,QAAQ;KACpB;CACF,CAAC,CAAC","sourcesContent":["'use client';\n\nimport { BottomTabBarHeightContext } from '@react-navigation/bottom-tabs';\nimport { use } from 'react';\nimport { StyleSheet, Text, View, Platform, ScrollView, TextInput } from 'react-native';\nimport { SafeAreaView } from 'react-native-safe-area-context';\n\nimport { Pressable } from './Pressable';\nimport { ErrorBoundaryProps } from './Try';\nimport { Link } from '../link/Link';\nimport { ReactServerError } from '../rsc/router/errors';\n\nfunction StandardErrorView({ error }: { error: Error }) {\n return (\n <View\n style={{\n marginBottom: 12,\n gap: 4,\n flexWrap: process.env.EXPO_OS === 'web' ? 'wrap' : 'nowrap',\n }}>\n <Text role=\"heading\" aria-level={1} style={styles.title}>\n Something went wrong\n </Text>\n <Text testID=\"router_error_message\" role=\"heading\" aria-level={2} style={styles.errorMessage}>\n Error: {error.message}\n </Text>\n </View>\n );\n}\n\nexport function ErrorBoundary({ error, retry }: ErrorBoundaryProps) {\n const inTabBar = use(BottomTabBarHeightContext);\n const Wrapper = inTabBar ? View : SafeAreaView;\n\n const isServerError = error instanceof ReactServerError;\n return (\n <View style={styles.container}>\n <Wrapper style={{ flex: 1, gap: 8, maxWidth: 720, marginHorizontal: 'auto' }}>\n {isServerError ? (\n <ReactServerErrorView error={error} />\n ) : (\n <StandardErrorView error={error} />\n )}\n <View style={{ flex: 1 }} />\n\n {process.env.NODE_ENV === 'development' && (\n <Link testID=\"router_error_sitemap\" href=\"/_sitemap\" style={styles.link}>\n Sitemap\n </Link>\n )}\n <Pressable testID=\"router_error_retry\" onPress={retry}>\n {({ hovered, pressed }) => (\n <View\n style={[styles.buttonInner, (hovered || pressed) && { backgroundColor: 'white' }]}>\n <Text\n style={[\n styles.buttonText,\n {\n color: hovered || pressed ? 'black' : 'white',\n },\n ]}>\n Retry\n </Text>\n </View>\n )}\n </Pressable>\n </Wrapper>\n </View>\n );\n}\n\nconst COMMON_ERROR_STATUS: Record<number, string | undefined> = {\n 404: 'NOT_FOUND',\n 500: 'INTERNAL_SERVER_ERROR',\n 503: 'SERVICE_UNAVAILABLE',\n 504: 'GATEWAY_TIMEOUT',\n};\n\n// TODO: This should probably be replaced by a DOM component that loads server errors in the future.\nfunction ReactServerErrorView({ error }: { error: ReactServerError }) {\n let title = String(error.statusCode);\n title += ': ' + (COMMON_ERROR_STATUS[error.statusCode] ?? 'Server Error');\n\n const errorId = error.headers.get('cf-ray');\n\n const date = error.headers.get('Date');\n\n return (\n <View\n style={{\n padding: 12,\n gap: 8,\n }}>\n <Text\n selectable\n allowFontScaling\n style={{\n fontSize: Platform.select({ web: 24, default: 16 }),\n fontWeight: 'bold',\n marginBottom: 4,\n color: 'white',\n }}>\n {title}\n </Text>\n\n {process.env.EXPO_OS === 'web' ? (\n <ScrollView\n style={{\n borderColor: 'rgba(255,255,255,0.5)',\n borderTopWidth: StyleSheet.hairlineWidth,\n borderBottomWidth: StyleSheet.hairlineWidth,\n maxHeight: 150,\n }}\n contentContainerStyle={{ paddingVertical: 4 }}>\n <Text\n testID=\"router_error_message\"\n selectable\n allowFontScaling\n style={{\n color: 'white',\n }}>\n {error.message}\n </Text>\n </ScrollView>\n ) : (\n <TextInput\n testID=\"router_error_message\"\n scrollEnabled\n multiline\n editable={false}\n allowFontScaling\n value={error.message}\n style={{\n borderColor: 'rgba(255,255,255,0.5)',\n borderTopWidth: StyleSheet.hairlineWidth,\n borderBottomWidth: StyleSheet.hairlineWidth,\n paddingVertical: 4,\n maxHeight: 150,\n color: 'white',\n }}\n />\n )}\n\n <InfoRow title=\"Code\" right={error.statusCode} />\n {errorId && <InfoRow title=\"ID\" right={errorId} />}\n {date && <InfoRow title=\"Date\" right={date} />}\n\n {error.url && (\n <Text selectable allowFontScaling style={{ fontSize: 14, opacity: 0.5, color: 'white' }}>\n {error.url}\n </Text>\n )}\n </View>\n );\n}\n\nfunction InfoRow({ title, right }: { title: string; right?: any }) {\n const style = {\n fontSize: 16,\n color: 'white',\n };\n\n return (\n <View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>\n <Text selectable allowFontScaling style={style}>\n {title}\n </Text>\n {right && (\n <Text selectable allowFontScaling style={[style, styles.code]}>\n {right}\n </Text>\n )}\n </View>\n );\n}\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n backgroundColor: 'black',\n padding: 24,\n alignItems: 'stretch',\n justifyContent: 'center',\n },\n title: {\n color: 'white',\n fontSize: Platform.select({ web: 32, default: 24 }),\n fontWeight: 'bold',\n },\n buttonText: {\n fontSize: 18,\n fontWeight: 'bold',\n color: 'black',\n ...Platform.select({\n web: {\n transitionDuration: '100ms',\n },\n }),\n },\n buttonInner: {\n ...Platform.select({\n web: {\n transitionDuration: '100ms',\n },\n }),\n paddingVertical: 12,\n paddingHorizontal: 24,\n borderColor: 'white',\n borderWidth: 2,\n marginLeft: 8,\n justifyContent: 'center',\n alignItems: 'center',\n },\n code: {\n fontFamily: Platform.select({\n default: 'Courier',\n ios: 'Courier New',\n android: 'monospace',\n }),\n fontWeight: '500',\n },\n errorMessage: {\n color: 'white',\n fontSize: 16,\n },\n subtitle: {\n color: 'white',\n fontSize: 14,\n marginBottom: 12,\n },\n link: {\n color: 'rgba(255,255,255,0.4)',\n textDecorationStyle: 'solid',\n textDecorationLine: 'underline',\n fontSize: 14,\n textAlign: 'center',\n },\n});\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-router",
|
|
3
|
-
"version": "6.1.0-canary-
|
|
3
|
+
"version": "6.1.0-canary-20251009-9919e08",
|
|
4
4
|
"description": "Expo Router is a file-based router for React Native and web applications.",
|
|
5
5
|
"author": "650 Industries, Inc.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -77,13 +77,12 @@
|
|
|
77
77
|
"expo"
|
|
78
78
|
],
|
|
79
79
|
"peerDependencies": {
|
|
80
|
-
"@expo/metro-runtime": "6.1.3-canary-
|
|
81
|
-
"@expo/log-box": "0.0.13-canary-20251008-f2d1b4a",
|
|
80
|
+
"@expo/metro-runtime": "6.1.3-canary-20251009-9919e08",
|
|
82
81
|
"@react-navigation/drawer": "^7.5.0",
|
|
83
82
|
"@testing-library/react-native": ">= 12.0.0",
|
|
84
|
-
"expo": "55.0.0-canary-
|
|
85
|
-
"expo-constants": "18.0.10-canary-
|
|
86
|
-
"expo-linking": "8.0.9-canary-
|
|
83
|
+
"expo": "55.0.0-canary-20251009-9919e08",
|
|
84
|
+
"expo-constants": "18.0.10-canary-20251009-9919e08",
|
|
85
|
+
"expo-linking": "8.0.9-canary-20251009-9919e08",
|
|
87
86
|
"react": "*",
|
|
88
87
|
"react-dom": "*",
|
|
89
88
|
"react-native": "*",
|
|
@@ -129,8 +128,8 @@
|
|
|
129
128
|
"tsd": "^0.28.1"
|
|
130
129
|
},
|
|
131
130
|
"dependencies": {
|
|
132
|
-
"@expo/metro-runtime": "6.1.3-canary-
|
|
133
|
-
"@expo/schema-utils": "0.1.8-canary-
|
|
131
|
+
"@expo/metro-runtime": "6.1.3-canary-20251009-9919e08",
|
|
132
|
+
"@expo/schema-utils": "0.1.8-canary-20251009-9919e08",
|
|
134
133
|
"@radix-ui/react-slot": "1.2.0",
|
|
135
134
|
"@radix-ui/react-tabs": "^1.1.12",
|
|
136
135
|
"@react-navigation/bottom-tabs": "^7.4.0",
|
|
@@ -139,7 +138,7 @@
|
|
|
139
138
|
"client-only": "^0.0.1",
|
|
140
139
|
"debug": "^4.3.4",
|
|
141
140
|
"escape-string-regexp": "^4.0.0",
|
|
142
|
-
"expo-server": "1.1.0-canary-
|
|
141
|
+
"expo-server": "1.1.0-canary-20251009-9919e08",
|
|
143
142
|
"fast-deep-equal": "^3.1.3",
|
|
144
143
|
"invariant": "^2.2.4",
|
|
145
144
|
"nanoid": "^3.3.8",
|