expo-router 4.0.0-preview.8 → 4.0.0

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.
Files changed (194) hide show
  1. package/assets/error.png +0 -0
  2. package/assets/file.png +0 -0
  3. package/assets/forward.png +0 -0
  4. package/assets/logotype.png +0 -0
  5. package/assets/pkg.png +0 -0
  6. package/assets/sitemap.png +0 -0
  7. package/build/ExpoRoot.js +2 -2
  8. package/build/ExpoRoot.js.map +1 -1
  9. package/build/doctor/index.d.ts +16 -0
  10. package/build/doctor/index.d.ts.map +1 -0
  11. package/build/doctor/index.js +66 -0
  12. package/build/doctor/index.js.map +1 -0
  13. package/build/exports.d.ts +1 -1
  14. package/build/exports.d.ts.map +1 -1
  15. package/build/exports.js +24 -2
  16. package/build/exports.js.map +1 -1
  17. package/build/fast-refresh.d.ts.map +1 -1
  18. package/build/fast-refresh.js.map +1 -1
  19. package/build/getRoutesCore.d.ts +1 -0
  20. package/build/getRoutesCore.d.ts.map +1 -1
  21. package/build/getRoutesCore.js +3 -1
  22. package/build/getRoutesCore.js.map +1 -1
  23. package/build/global-state/router-store.d.ts.map +1 -1
  24. package/build/global-state/router-store.js +1 -2
  25. package/build/global-state/router-store.js.map +1 -1
  26. package/build/global-state/routing.d.ts.map +1 -1
  27. package/build/global-state/routing.js +4 -0
  28. package/build/global-state/routing.js.map +1 -1
  29. package/build/head/url.d.ts +1 -0
  30. package/build/head/url.d.ts.map +1 -1
  31. package/build/head/url.js +21 -4
  32. package/build/head/url.js.map +1 -1
  33. package/build/hooks.d.ts +90 -38
  34. package/build/hooks.d.ts.map +1 -1
  35. package/build/hooks.js +46 -39
  36. package/build/hooks.js.map +1 -1
  37. package/build/imperative-api.d.ts +58 -15
  38. package/build/imperative-api.d.ts.map +1 -1
  39. package/build/imperative-api.js.map +1 -1
  40. package/build/layouts/Drawer.d.ts +2 -142
  41. package/build/layouts/Drawer.d.ts.map +1 -1
  42. package/build/layouts/Drawer.js +8 -5
  43. package/build/layouts/Drawer.js.map +1 -1
  44. package/build/layouts/DrawerClient.d.ts +144 -0
  45. package/build/layouts/DrawerClient.d.ts.map +1 -0
  46. package/build/layouts/DrawerClient.js +10 -0
  47. package/build/layouts/DrawerClient.js.map +1 -0
  48. package/build/layouts/Stack.d.ts +2 -126
  49. package/build/layouts/Stack.d.ts.map +1 -1
  50. package/build/layouts/Stack.js +8 -6
  51. package/build/layouts/Stack.js.map +1 -1
  52. package/build/layouts/StackClient.d.ts +128 -0
  53. package/build/layouts/StackClient.d.ts.map +1 -0
  54. package/build/layouts/StackClient.js +10 -0
  55. package/build/layouts/StackClient.js.map +1 -0
  56. package/build/layouts/Tabs.d.ts +2 -134
  57. package/build/layouts/Tabs.d.ts.map +1 -1
  58. package/build/layouts/Tabs.js +5 -37
  59. package/build/layouts/Tabs.js.map +1 -1
  60. package/build/layouts/TabsClient.d.ts +136 -0
  61. package/build/layouts/TabsClient.d.ts.map +1 -0
  62. package/build/layouts/TabsClient.js +44 -0
  63. package/build/layouts/TabsClient.js.map +1 -0
  64. package/build/layouts/withLayoutContext.d.ts +4 -1
  65. package/build/layouts/withLayoutContext.d.ts.map +1 -1
  66. package/build/layouts/withLayoutContext.js +4 -1
  67. package/build/layouts/withLayoutContext.js.map +1 -1
  68. package/build/link/Link.d.ts +48 -4
  69. package/build/link/Link.d.ts.map +1 -1
  70. package/build/link/Link.js +47 -3
  71. package/build/link/Link.js.map +1 -1
  72. package/build/link/href.d.ts +1 -1
  73. package/build/link/href.d.ts.map +1 -1
  74. package/build/link/href.js.map +1 -1
  75. package/build/link/useLinkHooks.d.ts +122 -29
  76. package/build/link/useLinkHooks.d.ts.map +1 -1
  77. package/build/link/useLinkHooks.js.map +1 -1
  78. package/build/onboard/Tutorial.d.ts.map +1 -1
  79. package/build/onboard/Tutorial.js +140 -86
  80. package/build/onboard/Tutorial.js.map +1 -1
  81. package/build/renderRootComponent.d.ts.map +1 -1
  82. package/build/renderRootComponent.js +1 -2
  83. package/build/renderRootComponent.js.map +1 -1
  84. package/build/rsc/exports.d.ts +3 -1
  85. package/build/rsc/exports.d.ts.map +1 -1
  86. package/build/rsc/exports.js +3 -1
  87. package/build/rsc/exports.js.map +1 -1
  88. package/build/rsc/middleware.d.ts +1 -1
  89. package/build/rsc/middleware.d.ts.map +1 -1
  90. package/build/rsc/middleware.js +2 -1
  91. package/build/rsc/middleware.js.map +1 -1
  92. package/build/rsc/router/client.d.ts +2 -2
  93. package/build/rsc/router/client.d.ts.map +1 -1
  94. package/build/rsc/router/client.js.map +1 -1
  95. package/build/rsc/router/host.d.ts.map +1 -1
  96. package/build/rsc/router/host.js +20 -15
  97. package/build/rsc/router/host.js.map +1 -1
  98. package/build/rsc/rsc-renderer.d.ts +1 -1
  99. package/build/rsc/rsc-renderer.d.ts.map +1 -1
  100. package/build/rsc/rsc-renderer.js +1 -1
  101. package/build/rsc/rsc-renderer.js.map +1 -1
  102. package/build/rsc/server.d.ts +3 -0
  103. package/build/rsc/server.d.ts.map +1 -1
  104. package/build/rsc/server.js +19 -1
  105. package/build/rsc/server.js.map +1 -1
  106. package/build/testing-library/context-stubs.d.ts.map +1 -1
  107. package/build/testing-library/context-stubs.js +3 -1
  108. package/build/testing-library/context-stubs.js.map +1 -1
  109. package/build/testing-library/mocks.js +14 -13
  110. package/build/testing-library/mocks.js.map +1 -1
  111. package/build/typed-routes/generate.d.ts +5 -1
  112. package/build/typed-routes/generate.d.ts.map +1 -1
  113. package/build/typed-routes/generate.js +129 -64
  114. package/build/typed-routes/generate.js.map +1 -1
  115. package/build/typed-routes/index.d.ts +5 -0
  116. package/build/typed-routes/index.d.ts.map +1 -1
  117. package/build/typed-routes/index.js +8 -3
  118. package/build/typed-routes/index.js.map +1 -1
  119. package/build/typed-routes/testSetup.d.ts +1 -1
  120. package/build/typed-routes/testSetup.d.ts.map +1 -1
  121. package/build/typed-routes/testSetup.js +29 -17
  122. package/build/typed-routes/testSetup.js.map +1 -1
  123. package/build/typed-routes/types.d.ts +43 -145
  124. package/build/typed-routes/types.d.ts.map +1 -1
  125. package/build/typed-routes/types.js.map +1 -1
  126. package/build/types.d.ts +33 -0
  127. package/build/types.d.ts.map +1 -1
  128. package/build/types.js.map +1 -1
  129. package/build/ui/TabContext.d.ts +158 -1
  130. package/build/ui/TabContext.d.ts.map +1 -1
  131. package/build/ui/TabContext.js +25 -1
  132. package/build/ui/TabContext.js.map +1 -1
  133. package/build/ui/TabList.d.ts +17 -1
  134. package/build/ui/TabList.d.ts.map +1 -1
  135. package/build/ui/TabList.js +16 -0
  136. package/build/ui/TabList.js.map +1 -1
  137. package/build/ui/TabSlot.d.ts +55 -5
  138. package/build/ui/TabSlot.d.ts.map +1 -1
  139. package/build/ui/TabSlot.js +38 -14
  140. package/build/ui/TabSlot.js.map +1 -1
  141. package/build/ui/TabTrigger.d.ts +65 -70
  142. package/build/ui/TabTrigger.d.ts.map +1 -1
  143. package/build/ui/TabTrigger.js +25 -1
  144. package/build/ui/TabTrigger.js.map +1 -1
  145. package/build/ui/Tabs.d.ts +89 -132
  146. package/build/ui/Tabs.d.ts.map +1 -1
  147. package/build/ui/Tabs.js +53 -8
  148. package/build/ui/Tabs.js.map +1 -1
  149. package/build/ui/common.d.ts +3 -3
  150. package/build/ui/common.d.ts.map +1 -1
  151. package/build/ui/common.js.map +1 -1
  152. package/build/useFocusEffect.d.ts +15 -6
  153. package/build/useFocusEffect.d.ts.map +1 -1
  154. package/build/useFocusEffect.js +15 -6
  155. package/build/useFocusEffect.js.map +1 -1
  156. package/build/useNavigation.d.ts +11 -5
  157. package/build/useNavigation.d.ts.map +1 -1
  158. package/build/useNavigation.js +11 -5
  159. package/build/useNavigation.js.map +1 -1
  160. package/build/utils/splash.d.ts +6 -0
  161. package/build/utils/splash.d.ts.map +1 -0
  162. package/build/utils/splash.js +51 -0
  163. package/build/utils/splash.js.map +1 -0
  164. package/build/utils/url.js +2 -2
  165. package/build/utils/url.js.map +1 -1
  166. package/build/views/Navigator.d.ts +6 -5
  167. package/build/views/Navigator.d.ts.map +1 -1
  168. package/build/views/Navigator.js +6 -5
  169. package/build/views/Navigator.js.map +1 -1
  170. package/build/views/Sitemap.d.ts.map +1 -1
  171. package/build/views/Sitemap.js +93 -46
  172. package/build/views/Sitemap.js.map +1 -1
  173. package/build/views/Splash.d.ts +1 -1
  174. package/build/views/Splash.d.ts.map +1 -1
  175. package/build/views/Splash.js +3 -13
  176. package/build/views/Splash.js.map +1 -1
  177. package/build/views/Try.d.ts +1 -1
  178. package/build/views/Try.d.ts.map +1 -1
  179. package/build/views/Try.js +1 -1
  180. package/build/views/Try.js.map +1 -1
  181. package/doctor.js +1 -0
  182. package/entry-classic.js +0 -6
  183. package/package.json +23 -24
  184. package/plugin/build/index.d.ts +2 -0
  185. package/plugin/options.json +74 -73
  186. package/plugin/src/index.ts +64 -0
  187. package/rsc/entry.js +0 -6
  188. package/rsc/headers.d.ts +3 -0
  189. package/rsc/headers.js +5 -0
  190. package/build/rsc/runtime.d.ts +0 -9
  191. package/build/rsc/runtime.d.ts.map +0 -1
  192. package/build/rsc/runtime.js +0 -36
  193. package/build/rsc/runtime.js.map +0 -1
  194. package/virtual-client-boundaries.js +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Navigator.d.ts","sourceRoot":"","sources":["../../src/views/Navigator.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAC5F,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAQ/B,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,CAA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content.
102
102
  *
103
- * There are actually two different implementations of Slot:
104
- * - Used inside a _layout as the Navigator
105
- * - Used inside a Navigator as the content
103
+ * There are actually two different implementations of `<Slot/>`:
104
+ * - Used inside a `_layout` as the `Navigator`
105
+ * - Used inside a `Navigator` as the content
106
106
  *
107
- * As a custom <Navigator /> will set the NavigatorContext.contextKey to be the current _layout,
108
- * we can use this to determine if we are inside a custom navigator or not.
107
+ * Since a custom `Navigator` will set the `NavigatorContext.contextKey` to
108
+ * the current `_layout`, you can use this to determine if you are inside
109
+ * a custom navigator or not.
109
110
  */
110
111
  function Slot(props) {
111
112
  const contextKey = (0, Route_1.useContextKey)();
@@ -1 +1 @@
1
- {"version":3,"file":"Navigator.js","sourceRoot":"","sources":["../../src/views/Navigator.tsx"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEb,qDAA4F;AAC5F,6CAA+B;AAC/B,mFAA8D;AAE9D,qCAAkC;AAClC,oCAAyC;AACzC,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;IACzC,wBAAgB,CAAC,WAAW,GAAG,kBAAkB,CAAC;CACnD;AAaD;;;;GAIG;AACH,SAAgB,SAAS,CAA4D,EACnF,gBAAgB,EAChB,aAAa,EACb,QAAQ,EACR,MAAM,EACN,aAAa,GACK;IAClB,MAAM,UAAU,GAAG,IAAA,qBAAa,GAAE,CAAC;IAEnC,+FAA+F;IAC/F,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,GAAG,IAAA,2CAAuB,EAAC,QAAQ,EAAE;QACjF,iBAAiB,EAAE,IAAI;QACvB,UAAU;KACX,CAAC,CAAC;IAEH,MAAM,aAAa,GAAG,IAAA,6BAAgB,EAAC,OAAO,IAAI,EAAE,CA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,GAAG,mBAAmB,CAAC;AAE3C,wCAAwC;AACxC,SAAS,CAAC,MAAM,GAAG,eAAM,CAAC","sourcesContent":["// Copyright © 2024 650 Industries.\n'use client';\n\nimport { RouterFactory, StackRouter, useNavigationBuilder } from '@react-navigation/native';\nimport * as React from 'react';\nimport { SafeAreaView } from 'react-native-safe-area-context';\n\nimport { Screen } from './Screen';\nimport { useContextKey } from '../Route';\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 { screens, children: nonScreenChildren } = useFilterScreenChildren(children, {\n isCustomNavigator: true,\n contextKey,\n });\n\n const sortedScreens = useSortedScreens(screens ?? []);\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.useContext(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 } = useFilterScreenChildren([], {\n contextKey,\n });\n\n const { state, descriptors, NavigationContent } = useNavigationBuilder(StackRouter, {\n ...props,\n id: contextKey,\n children: useSortedScreens(screens ?? []),\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 * As a custom <Navigator /> will set the NavigatorContext.contextKey to be the current _layout,\n * we can use this to determine if we are inside a custom navigator or not.\n */\nexport function Slot(props: Omit<NavigatorProps<any>, 'children'>) {\n const contextKey = useContextKey();\n const context = React.useContext(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 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"]}
1
+ {"version":3,"file":"Navigator.js","sourceRoot":"","sources":["../../src/views/Navigator.tsx"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEb,qDAA4F;AAC5F,6CAA+B;AAC/B,mFAA8D;AAE9D,qCAAkC;AAClC,oCAAyC;AACzC,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;IACzC,wBAAgB,CAAC,WAAW,GAAG,kBAAkB,CAAC;CACnD;AAaD;;;;GAIG;AACH,SAAgB,SAAS,CAA4D,EACnF,gBAAgB,EAChB,aAAa,EACb,QAAQ,EACR,MAAM,EACN,aAAa,GACK;IAClB,MAAM,UAAU,GAAG,IAAA,qBAAa,GAAE,CAAC;IAEnC,+FAA+F;IAC/F,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,GAAG,IAAA,2CAAuB,EAAC,QAAQ,EAAE;QACjF,iBAAiB,EAAE,IAAI;QACvB,UAAU;KACX,CAAC,CAAC;IAEH,MAAM,aAAa,GAAG,IAAA,6BAAgB,EAAC,OAAO,IAAI,EAAE,CAAC,CAAC;IAEtD,MAAM,KAAK,oBAA2B,CAAC;IAEvC,MAAM,UAAU,GAAG,IAAA,6BAAoB,EAAC,MAAM,EAAE;QAC9C,4EAA4E;QAC5E,GAAG,aAAa;QAChB,EAAE,EAAE,UAAU;QACd,QAAQ,EAAE,aAAa,IAAI,CAAC,CAAC,eAAM,CAAC,GAAG,CAAC,SAAS,EAAG,CAAC;QACrD,aAAa;QACb,gBAAgB;KACjB,CAAC,CAAC;IAEH,2FAA2F;IAC3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AgB,IAAI,CAAC,KAA4C;IAC/D,MAAM,UAAU,GAAG,IAAA,qBAAa,GAAE,CAAC;IACnC,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,wBAAgB,CAAC,CAAC;IAEnD,IAAI,OAAO,EAAE,UAAU,KAAK,UAAU,EAAE;QACtC,mDAAmD;QACnD,OAAO,CAAC,aAAa,CAAC,IAAI,KAAK,CAAC,EAAG,CAAC;KACrC;IAED;;;OAGG;IACH,OAAO,CAAC,aAAa,CAAC,AAAD,EAAG,CAAC;AAC3B,CAAC;AAdD,oBAcC;AAED;;GAEG;AACH,SAAS,aAAa;IACpB,MAAM,OAAO,GAAG,mBAAmB,EAAE,CAAC;IAEtC,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC;IAEvC,OAAO,WAAW,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,IAAI,IAAI,CAAC;AACtE,CAAC;AAED;;GAEG;AACH,SAAgB,gBAAgB;IAC9B,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;AAND,4CAMC;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, StackRouter, useNavigationBuilder } from '@react-navigation/native';\nimport * as React from 'react';\nimport { SafeAreaView } from 'react-native-safe-area-context';\n\nimport { Screen } from './Screen';\nimport { useContextKey } from '../Route';\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 { screens, children: nonScreenChildren } = useFilterScreenChildren(children, {\n isCustomNavigator: true,\n contextKey,\n });\n\n const sortedScreens = useSortedScreens(screens ?? []);\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.useContext(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 } = useFilterScreenChildren([], {\n contextKey,\n });\n\n const { state, descriptors, NavigationContent } = useNavigationBuilder(StackRouter, {\n ...props,\n id: contextKey,\n children: useSortedScreens(screens ?? []),\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.useContext(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 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"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Sitemap.d.ts","sourceRoot":"","sources":["../../src/views/Sitemap.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,KAAK,MAAM,OAAO,CAAC;AAuB1B,wBAAgB,aAAa,IAAI,4BAA4B,CAmB5D;AAED,wBAAgB,OAAO,sBA2BtB"}
1
+ {"version":3,"file":"Sitemap.d.ts","sourceRoot":"","sources":["../../src/views/Sitemap.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,KAAK,MAAM,OAAO,CAAC;AAc1B,wBAAgB,aAAa,IAAI,4BAA4B,CAiC5D;AAED,wBAAgB,OAAO,sBAStB"}
@@ -15,11 +15,10 @@ const imperative_api_1 = require("../imperative-api");
15
15
  const Link_1 = require("../link/Link");
16
16
  const matchers_1 = require("../matchers");
17
17
  const statusbar_1 = require("../utils/statusbar");
18
- const INDENT = 24;
18
+ const INDENT = 20;
19
19
  function getNavOptions() {
20
20
  return {
21
21
  title: 'sitemap',
22
- headerShown: false,
23
22
  presentation: 'modal',
24
23
  headerLargeTitle: false,
25
24
  headerTitleStyle: {
@@ -34,40 +33,36 @@ function getNavOptions() {
34
33
  // @ts-expect-error: mistyped
35
34
  borderBottomColor: '#323232',
36
35
  },
36
+ header: () => {
37
+ const WrapperElement = react_native_1.Platform.OS === 'android' ? react_native_safe_area_context_1.SafeAreaView : react_native_1.View;
38
+ return (<WrapperElement style={styles.header}>
39
+ <react_native_1.View style={styles.headerContent}>
40
+ <react_native_1.View style={styles.headerIcon}>
41
+ <SitemapIcon />
42
+ </react_native_1.View>
43
+ <react_native_1.Text role="heading" aria-level={1} style={styles.title}>
44
+ Sitemap
45
+ </react_native_1.Text>
46
+ </react_native_1.View>
47
+ </WrapperElement>);
48
+ },
37
49
  };
38
50
  }
39
51
  exports.getNavOptions = getNavOptions;
40
52
  function Sitemap() {
41
- const { top, bottom } = (0, react_native_safe_area_context_1.useSafeAreaInsets)();
42
- const { width } = (0, react_native_1.useWindowDimensions)();
43
53
  return (<react_native_1.View style={styles.container}>
44
54
  {!statusbar_1.hasViewControllerBasedStatusBarAppearance && <react_native_1.StatusBar barStyle="light-content"/>}
45
- <react_native_1.View style={[
46
- styles.main,
47
- {
48
- minWidth: Math.min(960, width * 0.9),
49
- },
50
- ]}>
51
- <react_native_1.ScrollView contentContainerStyle={[
52
- styles.scroll,
53
- {
54
- paddingTop: top + 12,
55
- paddingBottom: bottom + 12,
56
- },
57
- ]} style={{ flex: 1 }}>
58
- <FileSystemView />
59
- </react_native_1.ScrollView>
60
- </react_native_1.View>
55
+ <react_native_1.ScrollView contentContainerStyle={styles.scroll}>
56
+ <FileSystemView />
57
+ </react_native_1.ScrollView>
61
58
  </react_native_1.View>);
62
59
  }
63
60
  exports.Sitemap = Sitemap;
64
61
  function FileSystemView() {
65
62
  const routes = (0, router_store_1.useExpoRouter)().getSortedRoutes();
66
- return (<>
67
- {routes.map((child) => (<react_native_1.View key={child.contextKey} style={styles.itemContainer}>
68
- <FileItem route={child}/>
69
- </react_native_1.View>))}
70
- </>);
63
+ return routes.map((route) => (<react_native_1.View key={route.contextKey} style={styles.itemContainer}>
64
+ <FileItem route={route}/>
65
+ </react_native_1.View>));
71
66
  }
72
67
  function FileItem({ route, level = 0, parents = [], isInitial = false, }) {
73
68
  const disabled = route.children.length > 0;
@@ -75,13 +70,13 @@ function FileItem({ route, level = 0, parents = [], isInitial = false, }) {
75
70
  const href = react_1.default.useMemo(() => {
76
71
  return ('/' +
77
72
  segments
78
- .map((v) => {
73
+ .map((segment) => {
79
74
  // add an extra layer of entropy to the url for deep dynamic routes
80
- if ((0, matchers_1.matchDeepDynamicRouteName)(v)) {
81
- return v + '/' + Date.now();
75
+ if ((0, matchers_1.matchDeepDynamicRouteName)(segment)) {
76
+ return segment + '/' + Date.now();
82
77
  }
83
78
  // index must be erased but groups can be preserved.
84
- return v === 'index' ? '' : v;
79
+ return segment === 'index' ? '' : segment;
85
80
  })
86
81
  .filter(Boolean)
87
82
  .join('/'));
@@ -92,10 +87,10 @@ function FileItem({ route, level = 0, parents = [], isInitial = false, }) {
92
87
  if (route.contextKey.match(/_layout\.[jt]sx?$/)) {
93
88
  return segments[segments.length - 2] + '/' + segments[segments.length - 1];
94
89
  }
95
- const segmentCount = route.route.split('/').length;
90
+ const routeSegmentsCount = route.route.split('/').length;
96
91
  // Join the segment count in reverse order
97
92
  // This presents files without layout routes as children with all relevant segments.
98
- return segments.slice(-segmentCount).join('/');
93
+ return segments.slice(-routeSegmentsCount).join('/');
99
94
  }, [route]);
100
95
  const info = isInitial ? 'Initial' : route.generated ? 'Virtual' : '';
101
96
  return (<>
@@ -104,17 +99,17 @@ function FileItem({ route, level = 0, parents = [], isInitial = false, }) {
104
99
  // Ensure the modal pops
105
100
  imperative_api_1.router.back();
106
101
  }
107
- }} style={{ flex: 1, display: 'flex' }} disabled={disabled} asChild
102
+ }} disabled={disabled} asChild
108
103
  // Ensure we replace the history so you can't go back to this page.
109
104
  replace>
110
- <Pressable_1.Pressable style={{ flex: 1 }}>
105
+ <Pressable_1.Pressable>
111
106
  {({ pressed, hovered }) => (<react_native_1.View style={[
112
107
  styles.itemPressable,
113
108
  {
114
109
  paddingLeft: INDENT + level * INDENT,
115
- backgroundColor: hovered ? 'rgba(255,255,255,0.1)' : 'transparent',
110
+ backgroundColor: hovered ? '#202425' : 'transparent',
116
111
  },
117
- pressed && { backgroundColor: '#323232' },
112
+ pressed && { backgroundColor: '#26292b' },
118
113
  disabled && { opacity: 0.4 },
119
114
  ]}>
120
115
  <react_native_1.View style={{ flexDirection: 'row', alignItems: 'center' }}>
@@ -141,27 +136,70 @@ function PkgIcon() {
141
136
  function ForwardIcon() {
142
137
  return <react_native_1.Image style={styles.image} source={require('expo-router/assets/forward.png')}/>;
143
138
  }
139
+ function SitemapIcon() {
140
+ return <react_native_1.Image style={styles.image} source={require('expo-router/assets/sitemap.png')}/>;
141
+ }
144
142
  const styles = react_native_1.StyleSheet.create({
145
143
  container: {
146
144
  backgroundColor: 'black',
147
145
  flex: 1,
148
146
  alignItems: 'stretch',
149
147
  },
150
- main: {
151
- marginHorizontal: 'auto',
152
- flex: 1,
153
- alignItems: 'stretch',
148
+ header: {
149
+ backgroundColor: '#151718',
150
+ paddingVertical: 16,
151
+ borderBottomWidth: 1,
152
+ borderColor: '#313538',
153
+ shadowColor: '#000',
154
+ shadowOffset: {
155
+ width: 0,
156
+ height: 3,
157
+ },
158
+ shadowOpacity: 0.33,
159
+ shadowRadius: 3,
160
+ elevation: 8,
161
+ },
162
+ headerContent: {
163
+ flexDirection: 'row',
164
+ alignItems: 'center',
165
+ gap: 14,
166
+ paddingHorizontal: '5%',
167
+ ...react_native_1.Platform.select({
168
+ web: {
169
+ width: '100%',
170
+ maxWidth: 960,
171
+ marginHorizontal: 'auto',
172
+ },
173
+ }),
174
+ },
175
+ title: {
176
+ color: 'white',
177
+ fontSize: 28,
178
+ fontWeight: 'bold',
154
179
  },
155
180
  scroll: {
156
- paddingHorizontal: 12,
157
- // flex: 1,
158
- // paddingTop: top + 12,
159
- alignItems: 'stretch',
181
+ paddingHorizontal: '5%',
182
+ paddingVertical: 16,
183
+ ...react_native_1.Platform.select({
184
+ ios: {
185
+ paddingBottom: 24,
186
+ },
187
+ web: {
188
+ width: '100%',
189
+ maxWidth: 960,
190
+ marginHorizontal: 'auto',
191
+ paddingBottom: 24,
192
+ },
193
+ default: {
194
+ paddingBottom: 12,
195
+ },
196
+ }),
160
197
  },
161
198
  itemContainer: {
162
199
  borderWidth: 1,
163
- borderColor: '#323232',
164
- borderRadius: 19,
200
+ borderColor: '#313538',
201
+ backgroundColor: '#151718',
202
+ borderRadius: 12,
165
203
  marginBottom: 12,
166
204
  overflow: 'hidden',
167
205
  },
@@ -179,6 +217,15 @@ const styles = react_native_1.StyleSheet.create({
179
217
  },
180
218
  filename: { color: 'white', fontSize: 20, marginLeft: 12 },
181
219
  virtual: { textAlign: 'right', color: 'white' },
182
- image: { width: 24, height: 24, resizeMode: 'contain' },
220
+ image: { width: 24, height: 24, resizeMode: 'contain', opacity: 0.6 },
221
+ headerIcon: {
222
+ width: 40,
223
+ height: 40,
224
+ backgroundColor: '#202425',
225
+ borderRadius: 8,
226
+ flexDirection: 'row',
227
+ alignItems: 'center',
228
+ justifyContent: 'center',
229
+ },
183
230
  });
184
231
  //# sourceMappingURL=Sitemap.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Sitemap.js","sourceRoot":"","sources":["../../src/views/Sitemap.tsx"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,YAAY,CAAC;;;;;;;AAGb,kDAA0B;AAC1B,+CASsB;AACtB,mFAAmE;AAEnE,2CAAwC;AAExC,+DAA6D;AAC7D,sDAA2C;AAC3C,uCAAoC;AACpC,0CAAwD;AACxD,kDAA+E;AAE/E,MAAM,MAAM,GAAG,EAAE,CAAC;AAElB,SAAgB,aAAa;IAC3B,OAAO;QACL,KAAK,EAAE,SAAS;QAChB,WAAW,EAAE,KAAK;QAClB,YAAY,EAAE,OAAO;QACrB,gBAAgB,EAAE,KAAK;QACvB,gBAAgB,EAAE;YAChB,KAAK,EAAE,OAAO;SACf;QACD,eAAe,EAAE,OAAO;QACxB,qBAAqB,EAAE;YACrB,KAAK,EAAE,OAAO;SACf;QACD,WAAW,EAAE;YACX,eAAe,EAAE,OAAO;YACxB,6BAA6B;YAC7B,iBAAiB,EAAE,SAAS;SAC7B;KACF,CAAC;AACJ,CAAC;AAnBD,sCAmBC;AAED,SAAgB,OAAO;IACrB,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,IAAA,kDAAiB,GAAE,CAAC;IAC5C,MAAM,EAAE,KAAK,EAAE,GAAG,IAAA,kCAAmB,GAAE,CAAC;IACxC,OAAO,CACL,CAAC,mBAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAC5B;MAAA,CAAC,CAAC,qDAAyC,IAAI,CAAC,wBAAS,CAAC,QAAQ,CAAC,eAAe,EAAG,CACrF;MAAA,CAAC,mBAAI,CACH,KAAK,CAAC,CAAC;YACL,MAAM,CAAC,IAAI;YACX;gBACE,QAAQ,EAAE,IAAI,CAAC,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BAAQ,CAAC,MAAM,CAAC;YACjB,GAAG,EAAE;gBACH,kBAAkB,EAAE,OAAO;aAC5B;SACF,CAAC;KACH;IACD,QAAQ,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE;IAC1D,OAAO,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE;IAC/C,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE;CACxD,CAAC,CAAC","sourcesContent":["// Copyright © 2024 650 Industries.\n'use client';\n\nimport { NativeStackNavigationOptions } from '@react-navigation/native-stack';\nimport React from 'react';\nimport {\n Image,\n StyleSheet,\n Text,\n View,\n ScrollView,\n Platform,\n StatusBar,\n useWindowDimensions,\n} from 'react-native';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\n\nimport { Pressable } from './Pressable';\nimport { RouteNode } from '../Route';\nimport { useExpoRouter } from '../global-state/router-store';\nimport { router } from '../imperative-api';\nimport { Link } from '../link/Link';\nimport { matchDeepDynamicRouteName } from '../matchers';\nimport { hasViewControllerBasedStatusBarAppearance } from '../utils/statusbar';\n\nconst INDENT = 24;\n\nexport function getNavOptions(): NativeStackNavigationOptions {\n return {\n title: 'sitemap',\n headerShown: false,\n presentation: 'modal',\n headerLargeTitle: false,\n headerTitleStyle: {\n color: 'white',\n },\n headerTintColor: 'white',\n headerLargeTitleStyle: {\n color: 'white',\n },\n headerStyle: {\n backgroundColor: 'black',\n // @ts-expect-error: mistyped\n borderBottomColor: '#323232',\n },\n };\n}\n\nexport function Sitemap() {\n const { top, bottom } = useSafeAreaInsets();\n const { width } = useWindowDimensions();\n return (\n <View style={styles.container}>\n {!hasViewControllerBasedStatusBarAppearance && <StatusBar barStyle=\"light-content\" />}\n <View\n style={[\n styles.main,\n {\n minWidth: Math.min(960, width * 0.9),\n },\n ]}>\n <ScrollView\n contentContainerStyle={[\n styles.scroll,\n {\n paddingTop: top + 12,\n paddingBottom: bottom + 12,\n },\n ]}\n style={{ flex: 1 }}>\n <FileSystemView />\n </ScrollView>\n </View>\n </View>\n );\n}\n\nfunction FileSystemView() {\n const routes = useExpoRouter().getSortedRoutes();\n\n return (\n <>\n {routes.map((child) => (\n <View key={child.contextKey} style={styles.itemContainer}>\n <FileItem route={child} />\n </View>\n ))}\n </>\n );\n}\n\nfunction FileItem({\n route,\n level = 0,\n parents = [],\n isInitial = false,\n}: {\n route: RouteNode;\n level?: number;\n parents?: string[];\n isInitial?: boolean;\n}) {\n const disabled = route.children.length > 0;\n\n const segments = React.useMemo(\n () => [...parents, ...route.route.split('/')],\n [parents, route.route]\n );\n\n const href = React.useMemo(() => {\n return (\n '/' +\n segments\n .map((v) => {\n // add an extra layer of entropy to the url for deep dynamic routes\n if (matchDeepDynamicRouteName(v)) {\n return v + '/' + Date.now();\n }\n // index must be erased but groups can be preserved.\n return v === 'index' ? '' : v;\n })\n .filter(Boolean)\n .join('/')\n );\n }, [segments, route.route]);\n\n const filename = React.useMemo(() => {\n const segments = route.contextKey.split('/');\n // join last two segments for layout routes\n if (route.contextKey.match(/_layout\\.[jt]sx?$/)) {\n return segments[segments.length - 2] + '/' + segments[segments.length - 1];\n }\n\n const segmentCount = route.route.split('/').length;\n\n // Join the segment count in reverse order\n // This presents files without layout routes as children with all relevant segments.\n return segments.slice(-segmentCount).join('/');\n }, [route]);\n\n const info = isInitial ? 'Initial' : route.generated ? 'Virtual' : '';\n\n return (\n <>\n {!route.internal && (\n <Link\n accessibilityLabel={route.contextKey}\n href={href}\n onPress={() => {\n if (Platform.OS !== 'web' && router.canGoBack()) {\n // Ensure the modal pops\n router.back();\n }\n }}\n style={{ flex: 1, display: 'flex' }}\n disabled={disabled}\n asChild\n // Ensure we replace the history so you can't go back to this page.\n replace>\n <Pressable style={{ flex: 1 }}>\n {({ pressed, hovered }) => (\n <View\n style={[\n styles.itemPressable,\n {\n paddingLeft: INDENT + level * INDENT,\n backgroundColor: hovered ? 'rgba(255,255,255,0.1)' : 'transparent',\n },\n pressed && { backgroundColor: '#323232' },\n disabled && { opacity: 0.4 },\n ]}>\n <View style={{ flexDirection: 'row', alignItems: 'center' }}>\n {route.children.length ? <PkgIcon /> : <FileIcon />}\n <Text style={styles.filename}>{filename}</Text>\n </View>\n\n <View style={{ flexDirection: 'row', alignItems: 'center' }}>\n {!!info && (\n <Text style={[styles.virtual, !disabled && { marginRight: 8 }]}>{info}</Text>\n )}\n {!disabled && <ForwardIcon />}\n </View>\n </View>\n )}\n </Pressable>\n </Link>\n )}\n {route.children.map((child) => (\n <FileItem\n key={child.contextKey}\n route={child}\n isInitial={route.initialRouteName === child.route}\n parents={segments}\n level={level + (route.generated ? 0 : 1)}\n />\n ))}\n </>\n );\n}\n\nfunction FileIcon() {\n return <Image style={styles.image} source={require('expo-router/assets/file.png')} />;\n}\n\nfunction PkgIcon() {\n return <Image style={styles.image} source={require('expo-router/assets/pkg.png')} />;\n}\n\nfunction ForwardIcon() {\n return <Image style={styles.image} source={require('expo-router/assets/forward.png')} />;\n}\n\nconst styles = StyleSheet.create({\n container: {\n backgroundColor: 'black',\n flex: 1,\n alignItems: 'stretch',\n },\n main: {\n marginHorizontal: 'auto',\n flex: 1,\n\n alignItems: 'stretch',\n },\n scroll: {\n paddingHorizontal: 12,\n // flex: 1,\n // paddingTop: top + 12,\n alignItems: 'stretch',\n },\n itemContainer: {\n borderWidth: 1,\n borderColor: '#323232',\n borderRadius: 19,\n marginBottom: 12,\n overflow: 'hidden',\n },\n itemPressable: {\n paddingHorizontal: INDENT,\n paddingVertical: 16,\n flexDirection: 'row',\n justifyContent: 'space-between',\n alignItems: 'center',\n ...Platform.select({\n web: {\n transitionDuration: '100ms',\n },\n }),\n },\n filename: { color: 'white', fontSize: 20, marginLeft: 12 },\n virtual: { textAlign: 'right', color: 'white' },\n image: { width: 24, height: 24, resizeMode: 'contain' },\n});\n"]}
1
+ {"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,EAAE,EAAE;QACV,eAAe,EAAE,SAAS;QAC1B,YAAY,EAAE,CAAC;QACf,aAAa,EAAE,KAAK;QACpB,UAAU,EAAE,QAAQ;QACpB,cAAc,EAAE,QAAQ;KACzB;CACF,CAAC,CAAC","sourcesContent":["// Copyright © 2024 650 Industries.\n'use client';\n\nimport { NativeStackNavigationOptions } from '@react-navigation/native-stack';\nimport React from 'react';\nimport { Image, StyleSheet, Text, View, ScrollView, Platform, StatusBar } from 'react-native';\nimport { SafeAreaView } from 'react-native-safe-area-context';\n\nimport { Pressable } from './Pressable';\nimport { RouteNode } from '../Route';\nimport { useExpoRouter } from '../global-state/router-store';\nimport { router } from '../imperative-api';\nimport { Link } from '../link/Link';\nimport { matchDeepDynamicRouteName } from '../matchers';\nimport { hasViewControllerBasedStatusBarAppearance } from '../utils/statusbar';\n\nconst INDENT = 20;\n\nexport function getNavOptions(): NativeStackNavigationOptions {\n return {\n title: 'sitemap',\n presentation: 'modal',\n headerLargeTitle: false,\n headerTitleStyle: {\n color: 'white',\n },\n headerTintColor: 'white',\n headerLargeTitleStyle: {\n color: 'white',\n },\n headerStyle: {\n backgroundColor: 'black',\n // @ts-expect-error: mistyped\n borderBottomColor: '#323232',\n },\n header: () => {\n const WrapperElement = Platform.OS === 'android' ? SafeAreaView : View;\n return (\n <WrapperElement style={styles.header}>\n <View style={styles.headerContent}>\n <View style={styles.headerIcon}>\n <SitemapIcon />\n </View>\n <Text role=\"heading\" aria-level={1} style={styles.title}>\n Sitemap\n </Text>\n </View>\n </WrapperElement>\n );\n },\n };\n}\n\nexport function Sitemap() {\n return (\n <View style={styles.container}>\n {!hasViewControllerBasedStatusBarAppearance && <StatusBar barStyle=\"light-content\" />}\n <ScrollView contentContainerStyle={styles.scroll}>\n <FileSystemView />\n </ScrollView>\n </View>\n );\n}\n\nfunction FileSystemView() {\n const routes = useExpoRouter().getSortedRoutes();\n return routes.map((route) => (\n <View key={route.contextKey} style={styles.itemContainer}>\n <FileItem route={route} />\n </View>\n ));\n}\n\nfunction FileItem({\n route,\n level = 0,\n parents = [],\n isInitial = false,\n}: {\n route: RouteNode;\n level?: number;\n parents?: string[];\n isInitial?: boolean;\n}) {\n const disabled = route.children.length > 0;\n\n const segments = React.useMemo(\n () => [...parents, ...route.route.split('/')],\n [parents, route.route]\n );\n\n const href = React.useMemo(() => {\n return (\n '/' +\n segments\n .map((segment) => {\n // add an extra layer of entropy to the url for deep dynamic routes\n if (matchDeepDynamicRouteName(segment)) {\n return segment + '/' + Date.now();\n }\n // index must be erased but groups can be preserved.\n return segment === 'index' ? '' : segment;\n })\n .filter(Boolean)\n .join('/')\n );\n }, [segments, route.route]);\n\n const filename = React.useMemo(() => {\n const segments = route.contextKey.split('/');\n // join last two segments for layout routes\n if (route.contextKey.match(/_layout\\.[jt]sx?$/)) {\n return segments[segments.length - 2] + '/' + segments[segments.length - 1];\n }\n\n const routeSegmentsCount = route.route.split('/').length;\n\n // Join the segment count in reverse order\n // This presents files without layout routes as children with all relevant segments.\n return segments.slice(-routeSegmentsCount).join('/');\n }, [route]);\n\n const info = isInitial ? 'Initial' : route.generated ? 'Virtual' : '';\n\n return (\n <>\n {!route.internal && (\n <Link\n accessibilityLabel={route.contextKey}\n href={href}\n onPress={() => {\n if (Platform.OS !== 'web' && router.canGoBack()) {\n // Ensure the modal pops\n router.back();\n }\n }}\n disabled={disabled}\n asChild\n // Ensure we replace the history so you can't go back to this page.\n replace>\n <Pressable>\n {({ pressed, hovered }) => (\n <View\n style={[\n styles.itemPressable,\n {\n paddingLeft: INDENT + level * INDENT,\n backgroundColor: hovered ? '#202425' : 'transparent',\n },\n pressed && { backgroundColor: '#26292b' },\n disabled && { opacity: 0.4 },\n ]}>\n <View style={{ flexDirection: 'row', alignItems: 'center' }}>\n {route.children.length ? <PkgIcon /> : <FileIcon />}\n <Text style={styles.filename}>{filename}</Text>\n </View>\n\n <View style={{ flexDirection: 'row', alignItems: 'center' }}>\n {!!info && (\n <Text style={[styles.virtual, !disabled && { marginRight: 8 }]}>{info}</Text>\n )}\n {!disabled && <ForwardIcon />}\n </View>\n </View>\n )}\n </Pressable>\n </Link>\n )}\n {route.children.map((child) => (\n <FileItem\n key={child.contextKey}\n route={child}\n isInitial={route.initialRouteName === child.route}\n parents={segments}\n level={level + (route.generated ? 0 : 1)}\n />\n ))}\n </>\n );\n}\n\nfunction FileIcon() {\n return <Image style={styles.image} source={require('expo-router/assets/file.png')} />;\n}\n\nfunction PkgIcon() {\n return <Image style={styles.image} source={require('expo-router/assets/pkg.png')} />;\n}\n\nfunction ForwardIcon() {\n return <Image style={styles.image} source={require('expo-router/assets/forward.png')} />;\n}\n\nfunction SitemapIcon() {\n return <Image style={styles.image} source={require('expo-router/assets/sitemap.png')} />;\n}\n\nconst styles = StyleSheet.create({\n container: {\n backgroundColor: 'black',\n flex: 1,\n alignItems: 'stretch',\n },\n header: {\n backgroundColor: '#151718',\n paddingVertical: 16,\n borderBottomWidth: 1,\n borderColor: '#313538',\n shadowColor: '#000',\n shadowOffset: {\n width: 0,\n height: 3,\n },\n shadowOpacity: 0.33,\n shadowRadius: 3,\n elevation: 8,\n },\n headerContent: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: 14,\n paddingHorizontal: '5%',\n ...Platform.select({\n web: {\n width: '100%',\n maxWidth: 960,\n marginHorizontal: 'auto',\n },\n }),\n },\n title: {\n color: 'white',\n fontSize: 28,\n fontWeight: 'bold',\n },\n scroll: {\n paddingHorizontal: '5%',\n paddingVertical: 16,\n ...Platform.select({\n ios: {\n paddingBottom: 24,\n },\n web: {\n width: '100%',\n maxWidth: 960,\n marginHorizontal: 'auto',\n paddingBottom: 24,\n },\n default: {\n paddingBottom: 12,\n },\n }),\n },\n itemContainer: {\n borderWidth: 1,\n borderColor: '#313538',\n backgroundColor: '#151718',\n borderRadius: 12,\n marginBottom: 12,\n overflow: 'hidden',\n },\n itemPressable: {\n paddingHorizontal: INDENT,\n paddingVertical: 16,\n flexDirection: 'row',\n justifyContent: 'space-between',\n alignItems: 'center',\n ...Platform.select({\n web: {\n transitionDuration: '100ms',\n },\n }),\n },\n filename: { color: 'white', fontSize: 20, marginLeft: 12 },\n virtual: { textAlign: 'right', color: 'white' },\n image: { width: 24, height: 24, resizeMode: 'contain', opacity: 0.6 },\n headerIcon: {\n width: 40,\n height: 40,\n backgroundColor: '#202425',\n borderRadius: 8,\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'center',\n },\n});\n"]}
@@ -1,2 +1,2 @@
1
- export * as SplashScreen from 'expo-splash-screen';
1
+ export * from '../utils/splash';
2
2
  //# sourceMappingURL=Splash.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Splash.d.ts","sourceRoot":"","sources":["../../src/views/Splash.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,YAAY,MAAM,oBAAoB,CAAC"}
1
+ {"version":3,"file":"Splash.d.ts","sourceRoot":"","sources":["../../src/views/Splash.tsx"],"names":[],"mappings":"AACA,cAAc,iBAAiB,CAAC"}
@@ -11,19 +11,9 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
11
11
  if (k2 === undefined) k2 = k;
12
12
  o[k2] = m[k];
13
13
  }));
14
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
- Object.defineProperty(o, "default", { enumerable: true, value: v });
16
- }) : function(o, v) {
17
- o["default"] = v;
18
- });
19
- var __importStar = (this && this.__importStar) || function (mod) {
20
- if (mod && mod.__esModule) return mod;
21
- var result = {};
22
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
23
- __setModuleDefault(result, mod);
24
- return result;
14
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
25
16
  };
26
17
  Object.defineProperty(exports, "__esModule", { value: true });
27
- exports.SplashScreen = void 0;
28
- exports.SplashScreen = __importStar(require("expo-splash-screen"));
18
+ __exportStar(require("../utils/splash"), exports);
29
19
  //# sourceMappingURL=Splash.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Splash.js","sourceRoot":"","sources":["../../src/views/Splash.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;AACb,mEAAmD","sourcesContent":["'use client';\nexport * as SplashScreen from 'expo-splash-screen';\n"]}
1
+ {"version":3,"file":"Splash.js","sourceRoot":"","sources":["../../src/views/Splash.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;AACb,kDAAgC","sourcesContent":["'use client';\nexport * from '../utils/splash';\n"]}
@@ -1,7 +1,7 @@
1
1
  import React, { Component, type ComponentType, type PropsWithChildren } from 'react';
2
2
  /** Props passed to a page's `ErrorBoundary` export. */
3
3
  export type ErrorBoundaryProps = {
4
- /** Retry rendering the component by clearing the `error` state. */
4
+ /** A function that will re-render the route component by clearing the `error` state. */
5
5
  retry: () => Promise<void>;
6
6
  /** The error that was thrown. */
7
7
  error: Error;
@@ -1 +1 @@
1
- {"version":3,"file":"Try.d.ts","sourceRoot":"","sources":["../../src/views/Try.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,KAAK,aAAa,EAAE,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAIrF,uDAAuD;AACvD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,mEAAmE;IACnE,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3B,iCAAiC;IACjC,KAAK,EAAE,KAAK,CAAC;CACd,CAAC;AAGF,qBAAa,GAAI,SAAQ,SAAS,CAChC,iBAAiB,CAAC;IAChB,KAAK,EAAE,aAAa,CAAC,kBAAkB,CAAC,CAAC;CAC1C,CAAC,EACF;IAAE,KAAK,CAAC,EAAE,KAAK,CAAA;CAAE,CAClB;IACC,KAAK;;MAAwB;IAE7B,MAAM,CAAC,wBAAwB,CAAC,KAAK,EAAE,KAAK;;;IAY5C,KAAK,sBAMH;IAEF,MAAM;CAQP"}
1
+ {"version":3,"file":"Try.d.ts","sourceRoot":"","sources":["../../src/views/Try.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,KAAK,aAAa,EAAE,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAKrF,uDAAuD;AACvD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,wFAAwF;IACxF,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3B,iCAAiC;IACjC,KAAK,EAAE,KAAK,CAAC;CACd,CAAC;AAGF,qBAAa,GAAI,SAAQ,SAAS,CAChC,iBAAiB,CAAC;IAChB,KAAK,EAAE,aAAa,CAAC,kBAAkB,CAAC,CAAC;CAC1C,CAAC,EACF;IAAE,KAAK,CAAC,EAAE,KAAK,CAAA;CAAE,CAClB;IACC,KAAK;;MAAwB;IAE7B,MAAM,CAAC,wBAAwB,CAAC,KAAK,EAAE,KAAK;;;IAY5C,KAAK,sBAMH;IAEF,MAAM;CAQP"}
@@ -25,8 +25,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
25
25
  };
26
26
  Object.defineProperty(exports, "__esModule", { value: true });
27
27
  exports.Try = void 0;
28
- const SplashScreen = __importStar(require("expo-splash-screen"));
29
28
  const react_1 = __importStar(require("react"));
29
+ const SplashScreen = __importStar(require("./Splash"));
30
30
  const errors_1 = require("../rsc/router/errors");
31
31
  // No way to access `getDerivedStateFromError` from a function component afaict.
32
32
  class Try extends react_1.Component {
@@ -1 +1 @@
1
- {"version":3,"file":"Try.js","sourceRoot":"","sources":["../../src/views/Try.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEb,iEAAmD;AACnD,+CAAqF;AAErF,iDAAwD;AAUxD,gFAAgF;AAChF,MAAa,GAAI,SAAQ,iBAKxB;IACC,KAAK,GAAG,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC;IAE7B,MAAM,CAAC,wBAAwB,CAAC,KAAY;QAC1C,mDAAmD;QACnD,YAAY,CAAC,SAAS,EAAE,CAAC;QAEzB,IAAI,OAAO,IAAI,KAAK,YAAY,yBAAgB,EAAE;YAChD,0BAA0B;YAC1B,OAAO,IAAI,CAAC;SACb;QAED,OAAO,EAAE,KAAK,EAAE,CAAC;IACnB,CAAC;IAED,KAAK,GAAG,GAAG,EAAE;QACX,OAAO,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE;YACnC,IAAI,CAAC,QAAQ,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,GAAG,EAAE;gBACvC,OAAO,EAAE,CAAC;YACZ,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,MAAM;QACJ,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QAC7B,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QACtD,IAAI,CAAC,KAAK,EAAE;YACV,OAAO,QAAQ,CAAC;SACjB;QACD,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,EAAG,CAAC;IAC5D,CAAC;CACF;AApCD,kBAoCC","sourcesContent":["'use client';\n\nimport * as SplashScreen from 'expo-splash-screen';\nimport React, { Component, type ComponentType, type PropsWithChildren } from 'react';\n\nimport { MetroServerError } from '../rsc/router/errors';\n\n/** Props passed to a page's `ErrorBoundary` export. */\nexport type ErrorBoundaryProps = {\n /** Retry rendering the component by clearing the `error` state. */\n retry: () => Promise<void>;\n /** The error that was thrown. */\n error: Error;\n};\n\n// No way to access `getDerivedStateFromError` from a function component afaict.\nexport class Try extends Component<\n PropsWithChildren<{\n catch: ComponentType<ErrorBoundaryProps>;\n }>,\n { error?: Error }\n> {\n state = { error: undefined };\n\n static getDerivedStateFromError(error: Error) {\n // Force hide the splash screen if an error occurs.\n SplashScreen.hideAsync();\n\n if (__DEV__ && error instanceof MetroServerError) {\n // Throw up to the LogBox.\n return null;\n }\n\n return { error };\n }\n\n retry = () => {\n return new Promise<void>((resolve) => {\n this.setState({ error: undefined }, () => {\n resolve();\n });\n });\n };\n\n render() {\n const { error } = this.state;\n const { catch: ErrorBoundary, children } = this.props;\n if (!error) {\n return children;\n }\n return <ErrorBoundary error={error} retry={this.retry} />;\n }\n}\n"]}
1
+ {"version":3,"file":"Try.js","sourceRoot":"","sources":["../../src/views/Try.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEb,+CAAqF;AAErF,uDAAyC;AACzC,iDAAwD;AAUxD,gFAAgF;AAChF,MAAa,GAAI,SAAQ,iBAKxB;IACC,KAAK,GAAG,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC;IAE7B,MAAM,CAAC,wBAAwB,CAAC,KAAY;QAC1C,mDAAmD;QACnD,YAAY,CAAC,SAAS,EAAE,CAAC;QAEzB,IAAI,OAAO,IAAI,KAAK,YAAY,yBAAgB,EAAE;YAChD,0BAA0B;YAC1B,OAAO,IAAI,CAAC;SACb;QAED,OAAO,EAAE,KAAK,EAAE,CAAC;IACnB,CAAC;IAED,KAAK,GAAG,GAAG,EAAE;QACX,OAAO,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE;YACnC,IAAI,CAAC,QAAQ,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,GAAG,EAAE;gBACvC,OAAO,EAAE,CAAC;YACZ,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,MAAM;QACJ,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QAC7B,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QACtD,IAAI,CAAC,KAAK,EAAE;YACV,OAAO,QAAQ,CAAC;SACjB;QACD,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,EAAG,CAAC;IAC5D,CAAC;CACF;AApCD,kBAoCC","sourcesContent":["'use client';\n\nimport React, { Component, type ComponentType, type PropsWithChildren } from 'react';\n\nimport * as SplashScreen from './Splash';\nimport { MetroServerError } from '../rsc/router/errors';\n\n/** Props passed to a page's `ErrorBoundary` export. */\nexport type ErrorBoundaryProps = {\n /** A function that will re-render the route component by clearing the `error` state. */\n retry: () => Promise<void>;\n /** The error that was thrown. */\n error: Error;\n};\n\n// No way to access `getDerivedStateFromError` from a function component afaict.\nexport class Try extends Component<\n PropsWithChildren<{\n catch: ComponentType<ErrorBoundaryProps>;\n }>,\n { error?: Error }\n> {\n state = { error: undefined };\n\n static getDerivedStateFromError(error: Error) {\n // Force hide the splash screen if an error occurs.\n SplashScreen.hideAsync();\n\n if (__DEV__ && error instanceof MetroServerError) {\n // Throw up to the LogBox.\n return null;\n }\n\n return { error };\n }\n\n retry = () => {\n return new Promise<void>((resolve) => {\n this.setState({ error: undefined }, () => {\n resolve();\n });\n });\n };\n\n render() {\n const { error } = this.state;\n const { catch: ErrorBoundary, children } = this.props;\n if (!error) {\n return children;\n }\n return <ErrorBoundary error={error} retry={this.retry} />;\n }\n}\n"]}
package/doctor.js ADDED
@@ -0,0 +1 @@
1
+ module.exports = require('./build/doctor');
package/entry-classic.js CHANGED
@@ -2,12 +2,6 @@
2
2
  // on web.
3
3
  import '@expo/metro-runtime';
4
4
 
5
- // Hook for the virtual client modules.
6
- // TODO: Remove this in favor of the webpack runtime one.
7
- import 'expo-router/virtual-client-boundaries';
8
- // Add server component support.
9
- import 'expo-router/build/rsc/runtime';
10
-
11
5
  import { App } from 'expo-router/build/qualified-entry';
12
6
  import { renderRootComponent } from 'expo-router/build/renderRootComponent';
13
7
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-router",
3
- "version": "4.0.0-preview.8",
3
+ "version": "4.0.0",
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",
@@ -15,34 +15,34 @@
15
15
  "link",
16
16
  "assets",
17
17
  "build",
18
- "ios",
19
- "rsc",
20
- "node",
21
- "plugin",
22
18
  "!src",
23
- "types",
24
- "_ctx.*",
25
19
  "_ctx-html.js",
26
20
  "_ctx-shared.js",
21
+ "_ctx.*",
27
22
  "_error.js",
28
23
  "app.plugin.js",
29
- "virtual-client-boundaries.js",
30
24
  "babel.js",
31
- "drawer.js",
25
+ "doctor.js",
32
26
  "drawer.d.ts",
33
- "entry.js",
27
+ "drawer.js",
34
28
  "entry-classic.js",
29
+ "entry.js",
35
30
  "expo-module.config.json",
36
- "head.js",
37
31
  "head.d.ts",
38
- "html.js",
32
+ "head.js",
39
33
  "html.d.ts",
34
+ "html.js",
40
35
  "index.d.ts",
41
- "stack.js",
42
- "stack.d.ts",
43
- "server.js",
36
+ "ios",
37
+ "node",
38
+ "plugin",
39
+ "rsc",
44
40
  "server.d.ts",
41
+ "server.js",
42
+ "stack.d.ts",
43
+ "stack.js",
45
44
  "tabs.js",
45
+ "types",
46
46
  "tabs.d.ts",
47
47
  "ui.js",
48
48
  "ui.d.ts",
@@ -74,13 +74,13 @@
74
74
  "expo"
75
75
  ],
76
76
  "peerDependencies": {
77
- "@react-navigation/drawer": "7.0.0-rc.33",
77
+ "@react-navigation/drawer": "^7.0.0",
78
78
  "expo": "*",
79
79
  "expo-constants": "*",
80
80
  "expo-linking": "*",
81
81
  "react-native-reanimated": "*",
82
82
  "react-native-safe-area-context": "*",
83
- "react-native-screens": "*"
83
+ "react-native-screens": "^4.0.0"
84
84
  },
85
85
  "peerDependenciesMeta": {
86
86
  "react-native-reanimated": {
@@ -94,7 +94,7 @@
94
94
  }
95
95
  },
96
96
  "devDependencies": {
97
- "@react-navigation/drawer": "7.0.0-rc.33",
97
+ "@react-navigation/drawer": "7.0.0",
98
98
  "@testing-library/jest-native": "^5.4.2",
99
99
  "@testing-library/react": "^15.0.7",
100
100
  "@testing-library/react-native": "^12.5.1",
@@ -103,18 +103,17 @@
103
103
  "tsd": "^0.28.1"
104
104
  },
105
105
  "dependencies": {
106
- "@expo/metro-runtime": "4.0.0-preview.0",
106
+ "@expo/metro-runtime": "4.0.0-preview.2",
107
107
  "@expo/server": "^0.5.0-preview.0",
108
108
  "@radix-ui/react-slot": "1.0.1",
109
- "@react-navigation/bottom-tabs": "7.0.0-rc.36",
110
- "@react-navigation/native": "7.0.0-rc.21",
111
- "@react-navigation/native-stack": "7.0.0-rc.30",
109
+ "@react-navigation/bottom-tabs": "^7.0.0",
110
+ "@react-navigation/native": "^7.0.0",
111
+ "@react-navigation/native-stack": "^7.0.0",
112
112
  "client-only": "^0.0.1",
113
- "expo-splash-screen": "0.28.5",
114
113
  "react-helmet-async": "^1.3.0",
115
114
  "react-native-helmet-async": "2.0.4",
116
115
  "schema-utils": "^4.0.1",
117
116
  "server-only": "^0.0.1"
118
117
  },
119
- "gitHead": "7ffb25de324eb80fb04e87fe80c0436b954d52cf"
118
+ "gitHead": "1f84b4c952ed9785c41ee65c9877e44f1df27af9"
120
119
  }
@@ -15,5 +15,7 @@ declare const withRouter: ConfigPlugin<{
15
15
  };
16
16
  /** Should the sitemap be generated. Defaults to `true` */
17
17
  sitemap?: boolean;
18
+ /** Generate partial typed routes */
19
+ partialTypedGroups?: boolean;
18
20
  } | void>;
19
21
  export default withRouter;