expo-router 6.0.5 → 6.0.6
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Navigator.d.ts","sourceRoot":"","sources":["../../src/views/Navigator.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAC/E,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Navigator.d.ts","sourceRoot":"","sources":["../../src/views/Navigator.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAC/E,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAIrD,MAAM,MAAM,qBAAqB,GAAG,UAAU,CAAC,OAAO,oBAAoB,CAAC,GAAG;IAC5E,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,aAAa,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;CACtC,CAAC;AAEF,eAAO,MAAM,gBAAgB,6CAA0D,CAAC;AAMxF,KAAK,0BAA0B,GAAG,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC;AAC7E,KAAK,2BAA2B,GAAG,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC;AAE9E,MAAM,MAAM,cAAc,CAAC,CAAC,SAAS,0BAA0B,IAAI;IACjE,gBAAgB,CAAC,EAAE,2BAA2B,CAAC,kBAAkB,CAAC,CAAC;IACnE,aAAa,CAAC,EAAE,2BAA2B,CAAC,eAAe,CAAC,CAAC;IAC7D,QAAQ,CAAC,EAAE,2BAA2B,CAAC,UAAU,CAAC,CAAC;IACnD,MAAM,CAAC,EAAE,CAAC,CAAC;IACX,aAAa,CAAC,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,kBAAkB,CAAC,CAAC;CAC5D,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,CAAC,SAAS,0BAA0B,GAAG,OAAO,WAAW,EAAE,EACnF,gBAAgB,EAChB,aAAa,EACb,QAAQ,EACR,MAAM,EACN,aAAa,GACd,EAAE,cAAc,CAAC,CAAC,CAAC,4BA0CnB;yBAhDe,SAAS;;;;;AAkDzB;;GAEG;AACH,wBAAgB,mBAAmB,0BAMlC;AAqBD;;;;;;;;;;GAUG;AACH,wBAAgB,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE,UAAU,CAAC,qBAchE;AAED;;GAEG;AACH,iBAAS,aAAa,sBAMrB;AAED;;GAEG;AACH,wBAAgB,gBAAgB,sBAS/B"}
|
package/build/views/Navigator.js
CHANGED
|
@@ -42,7 +42,6 @@ exports.Slot = Slot;
|
|
|
42
42
|
exports.DefaultNavigator = DefaultNavigator;
|
|
43
43
|
const native_1 = require("@react-navigation/native");
|
|
44
44
|
const React = __importStar(require("react"));
|
|
45
|
-
const react_1 = require("react");
|
|
46
45
|
const react_native_is_edge_to_edge_1 = require("react-native-is-edge-to-edge");
|
|
47
46
|
const react_native_safe_area_context_1 = require("react-native-safe-area-context");
|
|
48
47
|
const Screen_1 = require("./Screen");
|
|
@@ -144,14 +143,16 @@ function NavigatorSlot() {
|
|
|
144
143
|
const { state, descriptors } = context;
|
|
145
144
|
return descriptors[state.routes[state.index].key]?.render() ?? null;
|
|
146
145
|
}
|
|
147
|
-
const SlotNavigatorWrapper = process.env.EXPO_OS === 'android' && (0, react_native_is_edge_to_edge_1.isEdgeToEdge)() ? react_1.Fragment : react_native_safe_area_context_1.SafeAreaView;
|
|
148
146
|
/**
|
|
149
147
|
* The default navigator for the app when no root _layout is provided.
|
|
150
148
|
*/
|
|
151
149
|
function DefaultNavigator() {
|
|
152
|
-
|
|
150
|
+
if (process.env.EXPO_OS === 'android' && (0, react_native_is_edge_to_edge_1.isEdgeToEdge)()) {
|
|
151
|
+
return <SlotNavigator />;
|
|
152
|
+
}
|
|
153
|
+
return (<react_native_safe_area_context_1.SafeAreaView style={{ flex: 1 }}>
|
|
153
154
|
<SlotNavigator />
|
|
154
|
-
</
|
|
155
|
+
</react_native_safe_area_context_1.SafeAreaView>);
|
|
155
156
|
}
|
|
156
157
|
Navigator.Slot = NavigatorSlot;
|
|
157
158
|
Navigator.useContext = useNavigatorContext;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Navigator.js","sourceRoot":"","sources":["../../src/views/Navigator.tsx"],"names":[],"mappings":";AAAA,mCAAmC;AACnC,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"Navigator.js","sourceRoot":"","sources":["../../src/views/Navigator.tsx"],"names":[],"mappings":";AAAA,mCAAmC;AACnC,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwCb,8BAgDC;AAKD,kDAMC;AAgCD,oBAcC;AAgBD,4CASC;AAxKD,qDAA+E;AAC/E,6CAA+B;AAC/B,+EAA4D;AAC5D,mFAA8D;AAE9D,qCAAkC;AAClC,oCAAyC;AACzC,wDAAqD;AACrD,oEAAuE;AACvE,8CAAiD;AAOpC,QAAA,gBAAgB,GAAG,KAAK,CAAC,aAAa,CAA+B,IAAI,CAAC,CAAC;AAExF,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,EAAE,CAAC;IAC1C,wBAAgB,CAAC,WAAW,GAAG,kBAAkB,CAAC;AACpD,CAAC;AAaD;;;;GAIG;AACH,SAAgB,SAAS,CAA4D,EACnF,gBAAgB,EAChB,aAAa,EACb,QAAQ,EACR,MAAM,EACN,aAAa,GACK;IAClB,MAAM,UAAU,GAAG,IAAA,qBAAa,GAA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AC;AAED;;GAEG;AACH,SAAgB,gBAAgB;IAC9B,IAAI,OAAO,CAAC,GAAG,CAAC,OAAO,KAAK,SAAS,IAAI,IAAA,2CAAY,GAAE,EAAE,CAAC;QACxD,OAAO,CAAC,aAAa,CAAC,AAAD,EAAG,CAAC;IAC3B,CAAC;IACD,OAAO,CACL,CAAC,6CAAY,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,CAC/B;MAAA,CAAC,aAAa,CAAC,AAAD,EAChB;IAAA,EAAE,6CAAY,CAAC,CAChB,CAAC;AACJ,CAAC;AAED,SAAS,CAAC,IAAI,GAAG,aAAa,CAAC;AAC/B,SAAS,CAAC,UAAU,GAAG,mBAAmB,CAAC;AAE3C,wCAAwC;AACxC,SAAS,CAAC,MAAM,GAAG,eAAM,CAAC","sourcesContent":["// Copyright © 2024 650 Industries.\n'use client';\n\nimport { RouterFactory, useNavigationBuilder } from '@react-navigation/native';\nimport * as React from 'react';\nimport { isEdgeToEdge } from 'react-native-is-edge-to-edge';\nimport { SafeAreaView } from 'react-native-safe-area-context';\n\nimport { Screen } from './Screen';\nimport { useContextKey } from '../Route';\nimport { StackRouter } from '../layouts/StackClient';\nimport { useFilterScreenChildren } from '../layouts/withLayoutContext';\nimport { useSortedScreens } from '../useScreens';\n\nexport type NavigatorContextValue = ReturnType<typeof useNavigationBuilder> & {\n contextKey: string;\n router: RouterFactory<any, any, any>;\n};\n\nexport const NavigatorContext = React.createContext<NavigatorContextValue | null>(null);\n\nif (process.env.NODE_ENV !== 'production') {\n NavigatorContext.displayName = 'NavigatorContext';\n}\n\ntype UseNavigationBuilderRouter = Parameters<typeof useNavigationBuilder>[0];\ntype UseNavigationBuilderOptions = Parameters<typeof useNavigationBuilder>[1];\n\nexport type NavigatorProps<T extends UseNavigationBuilderRouter> = {\n initialRouteName?: UseNavigationBuilderOptions['initialRouteName'];\n screenOptions?: UseNavigationBuilderOptions['screenOptions'];\n children?: UseNavigationBuilderOptions['children'];\n router?: T;\n routerOptions?: Omit<Parameters<T>[0], 'initialRouteName'>;\n};\n\n/**\n * An unstyled custom navigator. Good for basic web layouts.\n *\n * @hidden\n */\nexport function Navigator<T extends UseNavigationBuilderRouter = typeof StackRouter>({\n initialRouteName,\n screenOptions,\n children,\n router,\n routerOptions,\n}: NavigatorProps<T>) {\n const contextKey = useContextKey();\n\n // A custom navigator can have a mix of Screen and other components (like a Slot inside a View)\n const {\n screens,\n children: nonScreenChildren,\n protectedScreens,\n } = useFilterScreenChildren(children, {\n isCustomNavigator: true,\n contextKey,\n });\n\n const sortedScreens = useSortedScreens(screens ?? [], protectedScreens);\n\n router ||= StackRouter as unknown as T;\n\n const navigation = useNavigationBuilder(router, {\n // Used for getting the parent with navigation.getParent('/normalized/path')\n ...routerOptions,\n id: contextKey,\n children: sortedScreens || [<Screen key=\"default\" />],\n screenOptions,\n initialRouteName,\n });\n\n // useNavigationBuilder requires at least one screen to be defined otherwise it will throw.\n if (!sortedScreens.length) {\n console.warn(`Navigator at \"${contextKey}\" has no children.`);\n return null;\n }\n\n return (\n <NavigatorContext.Provider\n value={{\n ...navigation,\n contextKey,\n router,\n }}>\n {nonScreenChildren}\n </NavigatorContext.Provider>\n );\n}\n\n/**\n * @hidden\n */\nexport function useNavigatorContext() {\n const context = React.use(NavigatorContext);\n if (!context) {\n throw new Error('useNavigatorContext must be used within a <Navigator />');\n }\n return context;\n}\n\nfunction SlotNavigator(props: NavigatorProps<any>) {\n const contextKey = useContextKey();\n\n // Allows adding Screen components as children to configure routes.\n const { screens, protectedScreens } = useFilterScreenChildren([], {\n contextKey,\n });\n\n const { state, descriptors, NavigationContent } = useNavigationBuilder(StackRouter, {\n ...props,\n id: contextKey,\n children: useSortedScreens(screens ?? [], protectedScreens),\n });\n\n return (\n <NavigationContent>{descriptors[state.routes[state.index].key].render()}</NavigationContent>\n );\n}\n\n/**\n * Renders the currently selected content.\n *\n * There are actually two different implementations of `<Slot/>`:\n * - Used inside a `_layout` as the `Navigator`\n * - Used inside a `Navigator` as the content\n *\n * Since a custom `Navigator` will set the `NavigatorContext.contextKey` to\n * the current `_layout`, you can use this to determine if you are inside\n * a custom navigator or not.\n */\nexport function Slot(props: Omit<NavigatorProps<any>, 'children'>) {\n const contextKey = useContextKey();\n const context = React.use(NavigatorContext);\n\n if (context?.contextKey !== contextKey) {\n // The _layout has changed since the last navigator\n return <SlotNavigator {...props} />;\n }\n\n /*\n * The user has defined a custom navigator\n * <Navigator><Slot /></Navigator>\n */\n return <NavigatorSlot />;\n}\n\n/**\n * Render the current navigator content.\n */\nfunction NavigatorSlot() {\n const context = useNavigatorContext();\n\n const { state, descriptors } = context;\n\n return descriptors[state.routes[state.index].key]?.render() ?? null;\n}\n\n/**\n * The default navigator for the app when no root _layout is provided.\n */\nexport function DefaultNavigator() {\n if (process.env.EXPO_OS === 'android' && isEdgeToEdge()) {\n return <SlotNavigator />;\n }\n return (\n <SafeAreaView style={{ flex: 1 }}>\n <SlotNavigator />\n </SafeAreaView>\n );\n}\n\nNavigator.Slot = NavigatorSlot;\nNavigator.useContext = useNavigatorContext;\n\n/** Used to configure route settings. */\nNavigator.Screen = Screen;\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-router",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.6",
|
|
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",
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
"@react-navigation/drawer": "^7.5.0",
|
|
82
82
|
"@testing-library/react-native": ">= 12.0.0",
|
|
83
83
|
"expo": "*",
|
|
84
|
-
"expo-constants": "^18.0.
|
|
84
|
+
"expo-constants": "^18.0.9",
|
|
85
85
|
"expo-linking": "^8.0.8",
|
|
86
86
|
"react": "*",
|
|
87
87
|
"react-dom": "*",
|
|
@@ -152,5 +152,5 @@
|
|
|
152
152
|
"use-latest-callback": "^0.2.1",
|
|
153
153
|
"vaul": "^1.1.2"
|
|
154
154
|
},
|
|
155
|
-
"gitHead": "
|
|
155
|
+
"gitHead": "e1bc61d046f09264a85b7730a1b7ae931b0f0af4"
|
|
156
156
|
}
|