expo-router 6.1.0-canary-20251008-6acbc1c → 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.
Files changed (70) hide show
  1. package/_error.js +3 -36
  2. package/build/ExpoRoot.d.ts.map +1 -1
  3. package/build/ExpoRoot.js +1 -4
  4. package/build/ExpoRoot.js.map +1 -1
  5. package/build/getRoutesCore.d.ts +1 -0
  6. package/build/getRoutesCore.d.ts.map +1 -1
  7. package/build/getRoutesCore.js.map +1 -1
  8. package/build/getServerManifest.d.ts +9 -1
  9. package/build/getServerManifest.d.ts.map +1 -1
  10. package/build/getServerManifest.js +4 -1
  11. package/build/getServerManifest.js.map +1 -1
  12. package/build/modal/web/ModalStack.d.ts.map +1 -1
  13. package/build/modal/web/ModalStack.js +20 -2
  14. package/build/modal/web/ModalStack.js.map +1 -1
  15. package/build/modal/web/ModalStackRouteDrawer.d.ts +2 -1
  16. package/build/modal/web/ModalStackRouteDrawer.d.ts.map +1 -1
  17. package/build/modal/web/ModalStackRouteDrawer.js +2 -2
  18. package/build/modal/web/ModalStackRouteDrawer.js.map +1 -1
  19. package/build/modal/web/TransparentModalStackRouteDrawer.d.ts +2 -1
  20. package/build/modal/web/TransparentModalStackRouteDrawer.d.ts.map +1 -1
  21. package/build/modal/web/TransparentModalStackRouteDrawer.js +2 -2
  22. package/build/modal/web/TransparentModalStackRouteDrawer.js.map +1 -1
  23. package/build/native-tabs/NativeBottomTabs/NativeTabTrigger.d.ts.map +1 -1
  24. package/build/native-tabs/NativeBottomTabs/NativeTabTrigger.js +5 -0
  25. package/build/native-tabs/NativeBottomTabs/NativeTabTrigger.js.map +1 -1
  26. package/build/native-tabs/NativeBottomTabs/NativeTabsView.d.ts.map +1 -1
  27. package/build/native-tabs/NativeBottomTabs/NativeTabsView.js +9 -13
  28. package/build/native-tabs/NativeBottomTabs/NativeTabsView.js.map +1 -1
  29. package/build/native-tabs/common/elements.d.ts +59 -1
  30. package/build/native-tabs/common/elements.d.ts.map +1 -1
  31. package/build/native-tabs/common/elements.js.map +1 -1
  32. package/build/renderRootComponent.d.ts.map +1 -1
  33. package/build/renderRootComponent.js +7 -5
  34. package/build/renderRootComponent.js.map +1 -1
  35. package/build/routes-manifest.js +1 -1
  36. package/build/routes-manifest.js.map +1 -1
  37. package/build/views/ErrorBoundary.js +1 -1
  38. package/build/views/ErrorBoundary.js.map +1 -1
  39. package/package.json +8 -9
  40. package/plugin/build/index.d.ts +2 -0
  41. package/plugin/options.json +17 -0
  42. package/plugin/src/index.ts +2 -0
  43. package/build/modal/Modal.d.ts +0 -95
  44. package/build/modal/Modal.d.ts.map +0 -1
  45. package/build/modal/Modal.js +0 -116
  46. package/build/modal/Modal.js.map +0 -1
  47. package/build/modal/ModalComponent.d.ts +0 -7
  48. package/build/modal/ModalComponent.d.ts.map +0 -1
  49. package/build/modal/ModalComponent.js +0 -10
  50. package/build/modal/ModalComponent.js.map +0 -1
  51. package/build/modal/ModalContext.d.ts +0 -15
  52. package/build/modal/ModalContext.d.ts.map +0 -1
  53. package/build/modal/ModalContext.js +0 -90
  54. package/build/modal/ModalContext.js.map +0 -1
  55. package/build/modal/ModalsRenderer.d.ts +0 -3
  56. package/build/modal/ModalsRenderer.d.ts.map +0 -1
  57. package/build/modal/ModalsRenderer.js +0 -47
  58. package/build/modal/ModalsRenderer.js.map +0 -1
  59. package/build/modal/ModalsRenderer.web.d.ts +0 -3
  60. package/build/modal/ModalsRenderer.web.d.ts.map +0 -1
  61. package/build/modal/ModalsRenderer.web.js +0 -37
  62. package/build/modal/ModalsRenderer.web.js.map +0 -1
  63. package/build/modal/types.d.ts +0 -19
  64. package/build/modal/types.d.ts.map +0 -1
  65. package/build/modal/types.js +0 -3
  66. package/build/modal/types.js.map +0 -1
  67. package/build/modal/utils.d.ts +0 -7
  68. package/build/modal/utils.d.ts.map +0 -1
  69. package/build/modal/utils.js +0 -60
  70. package/build/modal/utils.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"elements.js","sourceRoot":"","sources":["../../../src/native-tabs/common/elements.tsx"],"names":[],"mappings":";;AAkBA,sBAEC;AA0ED,oBAEC;AA2CD,gCAEC;AAiBD,sBAEC;AA9ID,SAAgB,KAAK,CAAC,KAAiB;IACrC,OAAO,IAAI,CAAC;AACd,CAAC;AAoED;;;;;GAKG;AACH,SAAgB,IAAI,CAAC,KAAgB;IACnC,OAAO,IAAI,CAAC;AACd,CAAC;AAwBD;;;;;;;;;;;;;;;;;;GAkBG;AACH,SAAgB,UAAU,CAAuB,KAA6B;IAC5E,OAAO,IAAI,CAAC;AACd,CAAC;AAiBD,SAAgB,KAAK,CAAC,KAAiB;IACrC,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import type { ColorValue, ImageSourcePropType } from 'react-native';\nimport type { SFSymbol } from 'sf-symbols-typescript';\n\nimport type { NativeTabsLabelStyle } from '../NativeBottomTabs/types';\n\nexport interface LabelProps {\n /**\n * The text to display as the label for the tab.\n */\n children?: string;\n selectedStyle?: NativeTabsLabelStyle;\n /**\n * If true, the label will be hidden.\n * @default false\n */\n hidden?: boolean;\n}\n\nexport function Label(props: LabelProps) {\n return null;\n}\n\nexport interface SourceIconCombination {\n /**\n * The image source to use as an icon.\n *\n * The value can be provided in two ways:\n * - As an image source\n * - As an object specifying the default and selected states\n *\n * @example\n * ```tsx\n * <Icon src={require('./path/to/icon.png')} />\n * ```\n *\n * @example\n * ```tsx\n * <Icon src={{ default: require('./path/to/icon.png'), selected: require('./path/to/icon-selected.png') }} />\n * ```\n *\n * @platform Android\n * @platform iOS\n */\n src?:\n | ImageSourcePropType\n | React.ReactElement\n | {\n default?: ImageSourcePropType | React.ReactElement;\n selected: ImageSourcePropType | React.ReactElement;\n };\n drawable?: never;\n sf?: never;\n}\n\nexport interface NamedIconCombination {\n /**\n * The name of the SF Symbol to use as an icon.\n *\n * The value can be provided in two ways:\n * - As a string with the SF Symbol name\n * - As an object specifying the default and selected states\n *\n * @example\n * ```tsx\n * <Icon sf=\"magnifyingglass\" />\n * ```\n *\n * @example\n * ```tsx\n * <Icon sf={{ default: \"house\", selected: \"house.fill\" }} />\n * ```\n *\n * @platform iOS\n */\n sf?: SFSymbol | { default?: SFSymbol; selected: SFSymbol };\n /**\n * The name of the drawable resource to use as an icon.\n * @platform android\n */\n drawable?: string;\n src?: never;\n}\n\nexport type IconProps = { selectedColor?: ColorValue } & (\n | NamedIconCombination\n | SourceIconCombination\n);\n\n/**\n * Renders an icon for the tab.\n *\n * @platform ios\n * @platform android\n */\nexport function Icon(props: IconProps) {\n return null;\n}\n\nexport interface VectorIconProps<NameT extends string> {\n /**\n * The family of the vector icon.\n *\n * @example\n * ```tsx\n * import MaterialCommunityIcons from '@expo/vector-icons/MaterialCommunityIcons';\n * ```\n */\n family: {\n getImageSource: (\n name: NameT,\n size: number,\n color: ColorValue\n ) => Promise<ImageSourcePropType | null>;\n };\n /**\n * The name of the vector icon.\n */\n name: NameT;\n}\n\n/**\n * Helper component which can be used to load vector icons for `NativeTabs`.\n *\n * @example\n * ```tsx\n * import { NativeTabs, VectorIcon } from 'expo-router';\n * import MaterialCommunityIcons from '@expo/vector-icons/MaterialCommunityIcons';\n *\n * export default Layout(){\n * return (\n * <NativeTabs>\n * <NativeTabs.Trigger name=\"index\">\n * <Icon src={<VectorIcon family={MaterialCommunityIcons} name=\"home\" />} />\n * </NativeTabs.Trigger>\n * </NativeTabs>\n * );\n * }\n * ```\n */\nexport function VectorIcon<NameT extends string>(props: VectorIconProps<NameT>) {\n return null;\n}\n\nexport interface BadgeProps {\n /**\n * The text to display as the badge for the tab.\n * If not provided, the badge will not be displayed.\n */\n children?: string;\n\n /**\n * If true, the badge will be hidden.\n * @default false\n */\n hidden?: boolean;\n selectedBackgroundColor?: ColorValue;\n}\n\nexport function Badge(props: BadgeProps) {\n return null;\n}\n"]}
1
+ {"version":3,"file":"elements.js","sourceRoot":"","sources":["../../../src/native-tabs/common/elements.tsx"],"names":[],"mappings":";;AAkBA,sBAEC;AAsID,oBAEC;AA2CD,gCAEC;AAiBD,sBAEC;AA1MD,SAAgB,KAAK,CAAC,KAAiB;IACrC,OAAO,IAAI,CAAC;AACd,CAAC;AAgID;;;;;GAKG;AACH,SAAgB,IAAI,CAAC,KAAgB;IACnC,OAAO,IAAI,CAAC;AACd,CAAC;AAwBD;;;;;;;;;;;;;;;;;;GAkBG;AACH,SAAgB,UAAU,CAAuB,KAA6B;IAC5E,OAAO,IAAI,CAAC;AACd,CAAC;AAiBD,SAAgB,KAAK,CAAC,KAAiB;IACrC,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import type { ColorValue, ImageSourcePropType } from 'react-native';\nimport type { SFSymbol } from 'sf-symbols-typescript';\n\nimport type { NativeTabsLabelStyle } from '../NativeBottomTabs/types';\n\nexport interface LabelProps {\n /**\n * The text to display as the label for the tab.\n */\n children?: string;\n selectedStyle?: NativeTabsLabelStyle;\n /**\n * If true, the label will be hidden.\n * @default false\n */\n hidden?: boolean;\n}\n\nexport function Label(props: LabelProps) {\n return null;\n}\n\nexport interface SourceIconCombination {\n /**\n * The image source to use as an icon.\n *\n * The value can be provided in two ways:\n * - As an image source\n * - As an object specifying the default and selected states\n *\n * @example\n * ```tsx\n * <Icon src={require('./path/to/icon.png')} />\n * ```\n *\n * @example\n * ```tsx\n * <Icon src={{ default: require('./path/to/icon.png'), selected: require('./path/to/icon-selected.png') }} />\n * ```\n *\n * @platform Android\n * @platform iOS\n */\n src?:\n | ImageSourcePropType\n | React.ReactElement\n | {\n default?: ImageSourcePropType | React.ReactElement;\n selected: ImageSourcePropType | React.ReactElement;\n };\n drawable?: never;\n sf?: never;\n androidSrc?: never;\n}\n\nexport interface NamedIconCombination {\n /**\n * The name of the SF Symbol to use as an icon.\n *\n * The value can be provided in two ways:\n * - As a string with the SF Symbol name\n * - As an object specifying the default and selected states\n *\n * @example\n * ```tsx\n * <Icon sf=\"magnifyingglass\" />\n * ```\n *\n * @example\n * ```tsx\n * <Icon sf={{ default: \"house\", selected: \"house.fill\" }} />\n * ```\n *\n * @platform iOS\n */\n sf?: SFSymbol | { default?: SFSymbol; selected: SFSymbol };\n /**\n * The name of the drawable resource to use as an icon.\n * @platform android\n */\n drawable?: string;\n src?: never;\n androidSrc?: never;\n}\n\nexport interface CrossPlatformIconCombination {\n /**\n * The name of the SF Symbol to use as an icon on iOS.\n *\n * The value can be provided in two ways:\n * - As a string with the SF Symbol name\n * - As an object specifying the default and selected states\n *\n * @example\n * ```tsx\n * <Icon sf=\"magnifyingglass\" androidSrc={require('./search.png')} />\n * ```\n *\n * @example\n * ```tsx\n * <Icon\n * sf={{ default: \"house\", selected: \"house.fill\" }}\n * androidSrc={{ default: require('./home.png'), selected: require('./home-filled.png') }}\n * />\n * ```\n *\n * @platform iOS\n */\n sf?: SFSymbol | { default?: SFSymbol; selected: SFSymbol };\n /**\n * The image source to use as an icon on Android.\n *\n * The value can be provided in two ways:\n * - As an image source\n * - As an object specifying the default and selected states\n *\n * @example\n * ```tsx\n * <Icon sf=\"magnifyingglass\" androidSrc={require('./search.png')} />\n * ```\n *\n * @example\n * ```tsx\n * <Icon\n * sf={{ default: \"house\", selected: \"house.fill\" }}\n * androidSrc={{ default: require('./icon.png'), selected: require('./icon-selected.png') }}\n * />\n * ```\n *\n * @platform Android\n */\n androidSrc?:\n | ImageSourcePropType\n | React.ReactElement\n | {\n default?: ImageSourcePropType | React.ReactElement;\n selected: ImageSourcePropType | React.ReactElement;\n };\n src?: never;\n drawable?: never;\n}\n\nexport type IconProps = { selectedColor?: ColorValue } & (\n | NamedIconCombination\n | SourceIconCombination\n | CrossPlatformIconCombination\n);\n\n/**\n * Renders an icon for the tab.\n *\n * @platform ios\n * @platform android\n */\nexport function Icon(props: IconProps) {\n return null;\n}\n\nexport interface VectorIconProps<NameT extends string> {\n /**\n * The family of the vector icon.\n *\n * @example\n * ```tsx\n * import MaterialCommunityIcons from '@expo/vector-icons/MaterialCommunityIcons';\n * ```\n */\n family: {\n getImageSource: (\n name: NameT,\n size: number,\n color: ColorValue\n ) => Promise<ImageSourcePropType | null>;\n };\n /**\n * The name of the vector icon.\n */\n name: NameT;\n}\n\n/**\n * Helper component which can be used to load vector icons for `NativeTabs`.\n *\n * @example\n * ```tsx\n * import { NativeTabs, VectorIcon } from 'expo-router';\n * import MaterialCommunityIcons from '@expo/vector-icons/MaterialCommunityIcons';\n *\n * export default Layout(){\n * return (\n * <NativeTabs>\n * <NativeTabs.Trigger name=\"index\">\n * <Icon src={<VectorIcon family={MaterialCommunityIcons} name=\"home\" />} />\n * </NativeTabs.Trigger>\n * </NativeTabs>\n * );\n * }\n * ```\n */\nexport function VectorIcon<NameT extends string>(props: VectorIconProps<NameT>) {\n return null;\n}\n\nexport interface BadgeProps {\n /**\n * The text to display as the badge for the tab.\n * If not provided, the badge will not be displayed.\n */\n children?: string;\n\n /**\n * If true, the badge will be hidden.\n * @default false\n */\n hidden?: boolean;\n selectedBackgroundColor?: ColorValue;\n}\n\nexport function Badge(props: BadgeProps) {\n return null;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"renderRootComponent.d.ts","sourceRoot":"","sources":["../src/renderRootComponent.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAgD/B;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,QAsCtE"}
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"}
@@ -37,7 +37,6 @@ exports.renderRootComponent = renderRootComponent;
37
37
  const expo_1 = require("expo");
38
38
  const React = __importStar(require("react"));
39
39
  const react_native_1 = require("react-native");
40
- const log_box_1 = require("@expo/log-box");
41
40
  const SplashScreen = __importStar(require("./utils/splash"));
42
41
  function isBaseObject(obj) {
43
42
  if (Object.prototype.toString.call(obj) !== '[object Object]') {
@@ -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.useLogBox)();
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
- (0, expo_1.registerRootComponent)(Component);
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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqDA,kDAsCC;AA3FD,+BAA6C;AAC7C,6CAA+B;AAC/B,+CAAoC;AACpC,2CAA0C;AAE1C,6DAA+C;AAE/C,SAAS,YAAY,CAAC,GAAQ;IAC5B,IAAI,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,iBAAiB,EAAE,CAAC;QAC9D,OAAO,KAAK,CAAC;IACf,CAAC;IACD,MAAM,KAAK,GAAG,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;IACzC,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QACnB,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,KAAK,KAAK,MAAM,CAAC,SAAS,CAAC;AACpC,CAAC;AAED,SAAS,aAAa,CAAC,KAAU;IAC/B,OAAO,CACL,KAAK;Q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AAmF;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';\nimport { useLogBox } from '@expo/log-box';\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 if (process.env.NODE_ENV !== 'production') {\n useLogBox();\n }\n\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 registerRootComponent(Component);\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"]}
1
+ {"version":3,"file":"renderRootComponent.js","sourceRoot":"","sources":["../src/renderRootComponent.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoDA,kDAwCC;AA5FD,+BAA6C;AAC7C,6CAA+B;AAC/B,+CAAoC;AAEpC,6DAA+C;AAE/C,SAAS,YAAY,CAAC,GAAQ;IAC5B,IAAI,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,iBAAiB,EAAE,CAAC;QAC9D,OAAO,KAAK,CAAC;IACf,CAAC;IACD,MAAM,KAAK,GAAG,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;IACzC,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QACnB,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,KAAK,KAAK,MAAM,CAAC,SAAS,CAAC;AACpC,CAAC;AAED,SAAS,aAAa,CAAC,KAAU;IAC/B,OAAO,CACL,KAAK;QACL,OAAO,KAAK,KAAK,QAAQ;QACzB,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ;QAC9B,OAAO,KAAK,CAAC,OAAO,KAAK,QAAQ,CA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AA2C;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"]}
@@ -25,6 +25,6 @@ function createRoutesManifest(paths, options) {
25
25
  if (!routeTree) {
26
26
  return null;
27
27
  }
28
- return (0, getServerManifest_1.getServerManifest)(routeTree);
28
+ return (0, getServerManifest_1.getServerManifest)(routeTree, { headers: options.headers });
29
29
  }
30
30
  //# sourceMappingURL=routes-manifest.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"routes-manifest.js","sourceRoot":"","sources":["../src/routes-manifest.ts"],"names":[],"mappings":";;AA6CA,oDAkBC;AA/DD,0CAA0C;AAC1C,sBAAsB;AACtB,iDAAyD;AACzD,2DAAwD;AAgCxD,SAAS,uBAAuB,CAAC,MAAgB,EAAE;IACjD,MAAM,aAAa,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,CAAC,EAAE,OAAO,KAAI,CAAC,EAAE,CAAC,CAAC;IAE3D,MAAM,CAAC,cAAc,CAAC,aAAa,EAAE,MAAM,EAAE;QAC3C,KAAK,EAAE,GAAG,EAAE,CAAC,GAAG;KACjB,CAAC,CAAC;IAEH,OAAO,aAA+B,CAAC;AACzC,CAAC;AAED,SAAgB,oBAAoB,CAClC,KAAe,EACf,OAAgB;IAEhB,mCAAmC;IACnC,MAAM,SAAS,GAAG,IAAA,wBAAS,EAAC,uBAAuB,CAAC,KAAK,CAAC,EAAE;QAC1D,GAAG,OAAO;QACV,iBAAiB,EAAE,IAAI;QACvB,2BAA2B,EAAE,IAAI;QACjC,mBAAmB,EAAE,IAAI;QACzB,iBAAiB,EAAE,IAAI;QACvB,QAAQ,EAAE,KAAK;KAChB,CAAC,CAAC;IAEH,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,IAAA,qCAAiB,EAAC,SAAS,CAAC,CAAC;AACtC,CAAC","sourcesContent":["// This file runs in Node.js environments.\n// no relative imports\nimport { type Options, getRoutes } from './getRoutesSSR';\nimport { getServerManifest } from './getServerManifest';\nimport { type RequireContext } from './types';\n\nexport { Options };\n\nexport type RouteInfo<TRegex = string> = {\n file: string;\n page: string;\n namedRegex: TRegex;\n routeKeys: Record<string, string>;\n permanent?: boolean;\n methods?: string[];\n};\n\nexport type MiddlewareInfo = {\n /**\n * Path to the module that contains the middleware function as a default export.\n *\n * @example _expo/functions/+middleware.js\n */\n file: string;\n};\n\nexport type ExpoRoutesManifestV1<TRegex = string> = {\n middleware?: MiddlewareInfo;\n apiRoutes: RouteInfo<TRegex>[];\n htmlRoutes: RouteInfo<TRegex>[];\n notFoundRoutes: RouteInfo<TRegex>[];\n redirects: RouteInfo<TRegex>[];\n rewrites: RouteInfo<TRegex>[];\n};\n\nfunction createMockContextModule(map: string[] = []) {\n const contextModule = (_key: string) => ({ default() {} });\n\n Object.defineProperty(contextModule, 'keys', {\n value: () => map,\n });\n\n return contextModule as RequireContext;\n}\n\nexport function createRoutesManifest(\n paths: string[],\n options: Options\n): ExpoRoutesManifestV1 | null {\n // TODO: Drop this part for Node.js\n const routeTree = getRoutes(createMockContextModule(paths), {\n ...options,\n preserveApiRoutes: true,\n preserveRedirectAndRewrites: true,\n ignoreRequireErrors: true,\n ignoreEntryPoints: true,\n platform: 'web',\n });\n\n if (!routeTree) {\n return null;\n }\n return getServerManifest(routeTree);\n}\n"]}
1
+ {"version":3,"file":"routes-manifest.js","sourceRoot":"","sources":["../src/routes-manifest.ts"],"names":[],"mappings":";;AA6CA,oDAkBC;AA/DD,0CAA0C;AAC1C,sBAAsB;AACtB,iDAAyD;AACzD,2DAAwD;AAgCxD,SAAS,uBAAuB,CAAC,MAAgB,EAAE;IACjD,MAAM,aAAa,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,CAAC,EAAE,OAAO,KAAI,CAAC,EAAE,CAAC,CAAC;IAE3D,MAAM,CAAC,cAAc,CAAC,aAAa,EAAE,MAAM,EAAE;QAC3C,KAAK,EAAE,GAAG,EAAE,CAAC,GAAG;KACjB,CAAC,CAAC;IAEH,OAAO,aAA+B,CAAC;AACzC,CAAC;AAED,SAAgB,oBAAoB,CAClC,KAAe,EACf,OAAgB;IAEhB,mCAAmC;IACnC,MAAM,SAAS,GAAG,IAAA,wBAAS,EAAC,uBAAuB,CAAC,KAAK,CAAC,EAAE;QAC1D,GAAG,OAAO;QACV,iBAAiB,EAAE,IAAI;QACvB,2BAA2B,EAAE,IAAI;QACjC,mBAAmB,EAAE,IAAI;QACzB,iBAAiB,EAAE,IAAI;QACvB,QAAQ,EAAE,KAAK;KAChB,CAAC,CAAC;IAEH,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,IAAA,qCAAiB,EAAC,SAAS,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;AACpE,CAAC","sourcesContent":["// This file runs in Node.js environments.\n// no relative imports\nimport { type Options, getRoutes } from './getRoutesSSR';\nimport { getServerManifest } from './getServerManifest';\nimport { type RequireContext } from './types';\n\nexport { Options };\n\nexport type RouteInfo<TRegex = string> = {\n file: string;\n page: string;\n namedRegex: TRegex;\n routeKeys: Record<string, string>;\n permanent?: boolean;\n methods?: string[];\n};\n\nexport type MiddlewareInfo = {\n /**\n * Path to the module that contains the middleware function as a default export.\n *\n * @example _expo/functions/+middleware.js\n */\n file: string;\n};\n\nexport type ExpoRoutesManifestV1<TRegex = string> = {\n middleware?: MiddlewareInfo;\n apiRoutes: RouteInfo<TRegex>[];\n htmlRoutes: RouteInfo<TRegex>[];\n notFoundRoutes: RouteInfo<TRegex>[];\n redirects: RouteInfo<TRegex>[];\n rewrites: RouteInfo<TRegex>[];\n};\n\nfunction createMockContextModule(map: string[] = []) {\n const contextModule = (_key: string) => ({ default() {} });\n\n Object.defineProperty(contextModule, 'keys', {\n value: () => map,\n });\n\n return contextModule as RequireContext;\n}\n\nexport function createRoutesManifest(\n paths: string[],\n options: Options\n): ExpoRoutesManifestV1 | null {\n // TODO: Drop this part for Node.js\n const routeTree = getRoutes(createMockContextModule(paths), {\n ...options,\n preserveApiRoutes: true,\n preserveRedirectAndRewrites: true,\n ignoreRequireErrors: true,\n ignoreEntryPoints: true,\n platform: 'web',\n });\n\n if (!routeTree) {\n return null;\n }\n return getServerManifest(routeTree, { headers: options.headers });\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.useContext)(bottom_tabs_1.BottomTabBarHeightContext);
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;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;IACD,WAAW,EAAE;QACX,GAAG,uBAAQ,CAAC,MAAM,CAAC;YACjB,GAAG,EAAE;gBACH,kBAAkB,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 { 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,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,YAAY,CAAC,CAC3F;eAAO,CAAC,KAAK,CAAC,OAAO,CACvB;MAAA,EAAE,mBAAI,CACR;IAAA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O;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-20251008-6acbc1c",
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-20251008-6acbc1c",
81
- "@expo/log-box": "0.0.13-canary-20251008-6acbc1c",
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-20251008-6acbc1c",
85
- "expo-constants": "18.0.10-canary-20251008-6acbc1c",
86
- "expo-linking": "8.0.9-canary-20251008-6acbc1c",
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-20251008-6acbc1c",
133
- "@expo/schema-utils": "0.1.8-canary-20251008-6acbc1c",
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.0.1-canary-20251008-6acbc1c",
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",
@@ -17,6 +17,8 @@ declare const withRouter: ConfigPlugin<{
17
17
  sitemap?: boolean;
18
18
  /** Generate partial typed routes */
19
19
  partialTypedGroups?: boolean;
20
+ /** A list of headers that are set on every route response from the server */
21
+ headers: Record<string, string | string[]>;
20
22
  /** Enable experimental server middleware support with a `+middleware.ts` file. Requires `web.output: 'server'` to be set in app config. */
21
23
  unstable_useServerMiddleware?: boolean;
22
24
  /** Enable experimental data loader support. Requires `web.output: 'static'` to be set in app config. */
@@ -136,6 +136,23 @@
136
136
  }
137
137
  }
138
138
  },
139
+ "headers": {
140
+ "description": "A list of headers that are set on every route response from the server",
141
+ "type": "object",
142
+ "additionalProperties": {
143
+ "oneOf": [
144
+ {
145
+ "type": "string"
146
+ },
147
+ {
148
+ "type": "array",
149
+ "items": {
150
+ "type": "string"
151
+ }
152
+ }
153
+ ]
154
+ }
155
+ },
139
156
  "unstable_useServerMiddleware": {
140
157
  "description": "Enable experimental server middleware support with a `+middleware.ts` file. Requires `web.output: 'server'` to be set in app config.",
141
158
  "type": "boolean",
@@ -37,6 +37,8 @@ const withRouter: ConfigPlugin<
37
37
  sitemap?: boolean;
38
38
  /** Generate partial typed routes */
39
39
  partialTypedGroups?: boolean;
40
+ /** A list of headers that are set on every route response from the server */
41
+ headers: Record<string, string | string[]>;
40
42
  /** Enable experimental server middleware support with a `+middleware.ts` file. Requires `web.output: 'server'` to be set in app config. */
41
43
  unstable_useServerMiddleware?: boolean;
42
44
  /** Enable experimental data loader support. Requires `web.output: 'static'` to be set in app config. */
@@ -1,95 +0,0 @@
1
- import { ViewProps } from 'react-native';
2
- import { type ModalConfig } from './ModalContext';
3
- export interface ModalProps extends ViewProps {
4
- /**
5
- * The content of the modal.
6
- */
7
- children?: React.ReactNode;
8
- /**
9
- * Whether the modal is visible or not.
10
- * When set to `true`, the modal will be opened.
11
- * When set to `false`, the modal will be closed.
12
- */
13
- visible: boolean;
14
- /**
15
- * Callback that is called after modal is closed.
16
- * This is called when the modal is closed programmatically or when the user dismisses it.
17
- */
18
- onClose?: () => void;
19
- /**
20
- * Callback that is called after modal is shown.
21
- */
22
- onShow?: () => void;
23
- /**
24
- * The animation type for the modal.
25
- * This can be one of 'none', 'slide', or 'fade'.
26
- */
27
- animationType?: ModalConfig['animationType'];
28
- /**
29
- * The presentation style for the modal.
30
- * This can be one of 'fullScreen', 'pageSheet', 'formSheet', or 'overFullScreen'.
31
- * - `fullScreen`: The modal covers the entire screen. When `transparent` is set to `true`, it will fallback to `overFullScreen`.
32
- * - `pageSheet`: The modal is presented as a page sheet on iOS. Defaults to `fullScreen` on Android.
33
- * - `formSheet`: The modal is presented as a form sheet.
34
- * - `overFullScreen`: The modal is presented over the full screen, allowing interaction with the underlying content.
35
- *
36
- * @default 'fullScreen'
37
- */
38
- presentationStyle?: ModalConfig['presentationStyle'];
39
- /**
40
- * Whether the modal should be rendered as a transparent overlay.
41
- * This will render the modal without a background, allowing the content behind it to be visible.
42
- *
43
- * On Android, this will fallback to `overFullScreen` presentation style.
44
- */
45
- transparent?: boolean;
46
- /**
47
- * See {@link ScreenProps["sheetAllowedDetents"]}.
48
- *
49
- * Describes heights where a sheet can rest.
50
- * Works only when `presentation` is set to `formSheet`.
51
- *
52
- * Heights should be described as fraction (a number from `[0, 1]` interval) of screen height / maximum detent height.
53
- * You can pass an array of ascending values each defining allowed sheet detent. iOS accepts any number of detents,
54
- * while **Android is limited to three**.
55
- *
56
- * @default 'fitToContents'
57
- */
58
- detents?: ModalConfig['detents'];
59
- /**
60
- * Determines whether the modal should close when navigating away from the screen that opened it.
61
- *
62
- * If set to `true`, the modal will close when the user navigates to a different screen.
63
- *
64
- * If set to `false`, the modal will remain open when pushing a new screen.
65
- * However, it will still close when navigating back or replacing the current screen.
66
- */
67
- closeOnNavigation?: boolean;
68
- }
69
- /**
70
- * A standalone modal component that can be used in Expo Router apps.
71
- * It always renders on top of the application's content.
72
- * Internally, the modal is rendered as a `Stack.Screen`, with the presentation style determined by the `presentationStyle` prop.
73
- *
74
- * **Props should be set before the modal is opened. Changes to the props will take effect after the modal is reopened.**
75
- *
76
- * This component is not linkable. If you need to link to a modal, use `<Stack.Screen options={{ presentationStyle: "modal" }} />` instead.
77
- *
78
- * @example
79
- * ```tsx
80
- * import { Modal } from 'expo-router';
81
- *
82
- * function Page() {
83
- * const [modalVisible, setModalVisible] = useState(false);
84
- * return (
85
- * <Modal
86
- * visible={modalVisible}
87
- * onClose={() => setModalVisible(false)}
88
- * >
89
- * <Text>Hello World</Text>
90
- * </Modal>
91
- * );
92
- * }
93
- */
94
- export declare function Modal(props: ModalProps): null;
95
- //# sourceMappingURL=Modal.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../src/modal/Modal.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAc,SAAS,EAAE,MAAM,cAAc,CAAC;AAGrD,OAAO,EAAmB,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAInE,MAAM,WAAW,UAAW,SAAQ,SAAS;IAC3C;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B;;;;OAIG;IACH,OAAO,EAAE,OAAO,CAAC;IACjB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB;;;OAGG;IACH,aAAa,CAAC,EAAE,WAAW,CAAC,eAAe,CAAC,CAAC;IAC7C;;;;;;;;;OASG;IACH,iBAAiB,CAAC,EAAE,WAAW,CAAC,mBAAmB,CAAC,CAAC;IACrD;;;;;OAKG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IACjC;;;;;;;OAOG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE,UAAU,QAgGtC"}
@@ -1,116 +0,0 @@
1
- "use strict";
2
- 'use client';
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.Modal = Modal;
5
- const non_secure_1 = require("nanoid/non-secure");
6
- const react_1 = require("react");
7
- const react_native_1 = require("react-native");
8
- const ModalContext_1 = require("./ModalContext");
9
- const useNavigation_1 = require("../useNavigation");
10
- const utils_1 = require("./utils");
11
- /**
12
- * A standalone modal component that can be used in Expo Router apps.
13
- * It always renders on top of the application's content.
14
- * Internally, the modal is rendered as a `Stack.Screen`, with the presentation style determined by the `presentationStyle` prop.
15
- *
16
- * **Props should be set before the modal is opened. Changes to the props will take effect after the modal is reopened.**
17
- *
18
- * This component is not linkable. If you need to link to a modal, use `<Stack.Screen options={{ presentationStyle: "modal" }} />` instead.
19
- *
20
- * @example
21
- * ```tsx
22
- * import { Modal } from 'expo-router';
23
- *
24
- * function Page() {
25
- * const [modalVisible, setModalVisible] = useState(false);
26
- * return (
27
- * <Modal
28
- * visible={modalVisible}
29
- * onClose={() => setModalVisible(false)}
30
- * >
31
- * <Text>Hello World</Text>
32
- * </Modal>
33
- * );
34
- * }
35
- */
36
- function Modal(props) {
37
- const { children, visible, onClose, onShow, animationType, presentationStyle, transparent, detents, closeOnNavigation, ...viewProps } = props;
38
- const { openModal, updateModal, closeModal, addEventListener } = (0, ModalContext_1.useModalContext)();
39
- const [currentModalId, setCurrentModalId] = (0, react_1.useState)();
40
- const navigation = (0, useNavigation_1.useNavigation)();
41
- (0, react_1.useEffect)(() => {
42
- if (!(0, utils_1.areDetentsValid)(detents)) {
43
- throw new Error(`Invalid detents provided to Modal: ${JSON.stringify(detents)}`);
44
- }
45
- }, [detents]);
46
- (0, react_1.useEffect)(() => {
47
- if (__DEV__ &&
48
- presentationStyle === 'formSheet' &&
49
- detents !== 'fitToContents' &&
50
- process.env.EXPO_OS === 'ios' &&
51
- react_native_1.StyleSheet.flatten(props.style)?.flex) {
52
- console.warn(
53
- // TODO: ENG-16230: Add warning link to documentation
54
- 'The `formSheet` presentation style does not support flex styles on iOS. Consider using a fixed height view or scroll view with `fitToContents` detent instead. See ');
55
- }
56
- }, [props.style, presentationStyle, detents]);
57
- (0, react_1.useEffect)(() => {
58
- if (visible) {
59
- const newId = (0, non_secure_1.nanoid)();
60
- openModal({
61
- animationType,
62
- presentationStyle,
63
- transparent,
64
- viewProps,
65
- component: children,
66
- uniqueId: newId,
67
- parentNavigationProp: navigation,
68
- detents: detents ?? (presentationStyle === 'formSheet' ? 'fitToContents' : undefined),
69
- });
70
- setCurrentModalId(newId);
71
- return () => {
72
- closeModal(newId);
73
- };
74
- }
75
- return () => { };
76
- }, [visible]);
77
- (0, react_1.useEffect)(() => {
78
- if (navigation.isFocused()) {
79
- return navigation.addListener('blur', () => {
80
- if (currentModalId && closeOnNavigation) {
81
- closeModal(currentModalId);
82
- }
83
- });
84
- }
85
- return () => { };
86
- }, [navigation, closeModal, currentModalId, closeOnNavigation]);
87
- (0, react_1.useEffect)(() => {
88
- if (currentModalId && visible) {
89
- updateModal(currentModalId, {
90
- component: children,
91
- });
92
- }
93
- }, [children]);
94
- (0, react_1.useEffect)(() => {
95
- if (currentModalId) {
96
- const unsubscribeShow = addEventListener('show', (id) => {
97
- if (id === currentModalId) {
98
- onShow?.();
99
- }
100
- });
101
- const unsubscribeClose = addEventListener('close', (id) => {
102
- if (id === currentModalId) {
103
- onClose?.();
104
- setCurrentModalId(undefined);
105
- }
106
- });
107
- return () => {
108
- unsubscribeShow();
109
- unsubscribeClose();
110
- };
111
- }
112
- return () => { };
113
- }, [currentModalId, addEventListener, onClose, onShow]);
114
- return null;
115
- }
116
- //# sourceMappingURL=Modal.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Modal.js","sourceRoot":"","sources":["../../src/modal/Modal.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;AAwGb,sBAgGC;AArMD,kDAA2C;AAC3C,iCAA4C;AAC5C,+CAAqD;AAGrD,iDAAmE;AACnE,oDAAiD;AACjD,mCAA0C;AAqE1C;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,SAAgB,KAAK,CAAC,KAAiB;IACrC,MAAM,EACJ,QAAQ,EACR,OAAO,EACP,OAAO,EACP,MAAM,EACN,aAAa,EACb,iBAAiB,EACjB,WAAW,EACX,OAAO,EACP,iBAAiB,EACjB,GAAG,SAAS,EACb,GAAG,KAAK,CAAC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E,CAAC;oBAC1B,OAAO,EAAE,EAAE,CAAC;oBACZ,iBAAiB,CAAC,SAAS,CAAC,CAAC;gBAC/B,CAAC;YACH,CAAC,CAAC,CAAC;YACH,OAAO,GAAG,EAAE;gBACV,eAAe,EAAE,CAAC;gBAClB,gBAAgB,EAAE,CAAC;YACrB,CAAC,CAAC;QACJ,CAAC;QACD,OAAO,GAAG,EAAE,GAAE,CAAC,CAAC;IAClB,CAAC,EAAE,CAAC,cAAc,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;IACxD,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["'use client';\n\nimport { type NavigationProp, type ParamListBase } from '@react-navigation/native';\nimport { nanoid } from 'nanoid/non-secure';\nimport { useEffect, useState } from 'react';\nimport { StyleSheet, ViewProps } from 'react-native';\nimport { type ScreenProps } from 'react-native-screens';\n\nimport { useModalContext, type ModalConfig } from './ModalContext';\nimport { useNavigation } from '../useNavigation';\nimport { areDetentsValid } from './utils';\n\nexport interface ModalProps extends ViewProps {\n /**\n * The content of the modal.\n */\n children?: React.ReactNode;\n /**\n * Whether the modal is visible or not.\n * When set to `true`, the modal will be opened.\n * When set to `false`, the modal will be closed.\n */\n visible: boolean;\n /**\n * Callback that is called after modal is closed.\n * This is called when the modal is closed programmatically or when the user dismisses it.\n */\n onClose?: () => void;\n /**\n * Callback that is called after modal is shown.\n */\n onShow?: () => void;\n /**\n * The animation type for the modal.\n * This can be one of 'none', 'slide', or 'fade'.\n */\n animationType?: ModalConfig['animationType'];\n /**\n * The presentation style for the modal.\n * This can be one of 'fullScreen', 'pageSheet', 'formSheet', or 'overFullScreen'.\n * - `fullScreen`: The modal covers the entire screen. When `transparent` is set to `true`, it will fallback to `overFullScreen`.\n * - `pageSheet`: The modal is presented as a page sheet on iOS. Defaults to `fullScreen` on Android.\n * - `formSheet`: The modal is presented as a form sheet.\n * - `overFullScreen`: The modal is presented over the full screen, allowing interaction with the underlying content.\n *\n * @default 'fullScreen'\n */\n presentationStyle?: ModalConfig['presentationStyle'];\n /**\n * Whether the modal should be rendered as a transparent overlay.\n * This will render the modal without a background, allowing the content behind it to be visible.\n *\n * On Android, this will fallback to `overFullScreen` presentation style.\n */\n transparent?: boolean;\n /**\n * See {@link ScreenProps[\"sheetAllowedDetents\"]}.\n *\n * Describes heights where a sheet can rest.\n * Works only when `presentation` is set to `formSheet`.\n *\n * Heights should be described as fraction (a number from `[0, 1]` interval) of screen height / maximum detent height.\n * You can pass an array of ascending values each defining allowed sheet detent. iOS accepts any number of detents,\n * while **Android is limited to three**.\n *\n * @default 'fitToContents'\n */\n detents?: ModalConfig['detents'];\n /**\n * Determines whether the modal should close when navigating away from the screen that opened it.\n *\n * If set to `true`, the modal will close when the user navigates to a different screen.\n *\n * If set to `false`, the modal will remain open when pushing a new screen.\n * However, it will still close when navigating back or replacing the current screen.\n */\n closeOnNavigation?: boolean;\n}\n\n/**\n * A standalone modal component that can be used in Expo Router apps.\n * It always renders on top of the application's content.\n * Internally, the modal is rendered as a `Stack.Screen`, with the presentation style determined by the `presentationStyle` prop.\n *\n * **Props should be set before the modal is opened. Changes to the props will take effect after the modal is reopened.**\n *\n * This component is not linkable. If you need to link to a modal, use `<Stack.Screen options={{ presentationStyle: \"modal\" }} />` instead.\n *\n * @example\n * ```tsx\n * import { Modal } from 'expo-router';\n *\n * function Page() {\n * const [modalVisible, setModalVisible] = useState(false);\n * return (\n * <Modal\n * visible={modalVisible}\n * onClose={() => setModalVisible(false)}\n * >\n * <Text>Hello World</Text>\n * </Modal>\n * );\n * }\n */\nexport function Modal(props: ModalProps) {\n const {\n children,\n visible,\n onClose,\n onShow,\n animationType,\n presentationStyle,\n transparent,\n detents,\n closeOnNavigation,\n ...viewProps\n } = props;\n const { openModal, updateModal, closeModal, addEventListener } = useModalContext();\n const [currentModalId, setCurrentModalId] = useState<string | undefined>();\n const navigation = useNavigation<NavigationProp<ParamListBase>>();\n useEffect(() => {\n if (!areDetentsValid(detents)) {\n throw new Error(`Invalid detents provided to Modal: ${JSON.stringify(detents)}`);\n }\n }, [detents]);\n useEffect(() => {\n if (\n __DEV__ &&\n presentationStyle === 'formSheet' &&\n detents !== 'fitToContents' &&\n process.env.EXPO_OS === 'ios' &&\n StyleSheet.flatten(props.style)?.flex\n ) {\n console.warn(\n // TODO: ENG-16230: Add warning link to documentation\n 'The `formSheet` presentation style does not support flex styles on iOS. Consider using a fixed height view or scroll view with `fitToContents` detent instead. See '\n );\n }\n }, [props.style, presentationStyle, detents]);\n useEffect(() => {\n if (visible) {\n const newId = nanoid();\n openModal({\n animationType,\n presentationStyle,\n transparent,\n viewProps,\n component: children,\n uniqueId: newId,\n parentNavigationProp: navigation,\n detents: detents ?? (presentationStyle === 'formSheet' ? 'fitToContents' : undefined),\n });\n setCurrentModalId(newId);\n return () => {\n closeModal(newId);\n };\n }\n return () => {};\n }, [visible]);\n\n useEffect(() => {\n if (navigation.isFocused()) {\n return navigation.addListener('blur', () => {\n if (currentModalId && closeOnNavigation) {\n closeModal(currentModalId);\n }\n });\n }\n return () => {};\n }, [navigation, closeModal, currentModalId, closeOnNavigation]);\n\n useEffect(() => {\n if (currentModalId && visible) {\n updateModal(currentModalId, {\n component: children,\n });\n }\n }, [children]);\n\n useEffect(() => {\n if (currentModalId) {\n const unsubscribeShow = addEventListener('show', (id) => {\n if (id === currentModalId) {\n onShow?.();\n }\n });\n const unsubscribeClose = addEventListener('close', (id) => {\n if (id === currentModalId) {\n onClose?.();\n setCurrentModalId(undefined);\n }\n });\n return () => {\n unsubscribeShow();\n unsubscribeClose();\n };\n }\n return () => {};\n }, [currentModalId, addEventListener, onClose, onShow]);\n return null;\n}\n"]}
@@ -1,7 +0,0 @@
1
- import { type ModalConfig } from './ModalContext';
2
- interface ModalComponentProps {
3
- modalConfig: ModalConfig;
4
- }
5
- export declare function ModalComponent({ modalConfig }: ModalComponentProps): import("react").JSX.Element;
6
- export {};
7
- //# sourceMappingURL=ModalComponent.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ModalComponent.d.ts","sourceRoot":"","sources":["../../src/modal/ModalComponent.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,UAAU,mBAAmB;IAC3B,WAAW,EAAE,WAAW,CAAC;CAC1B;AAED,wBAAgB,cAAc,CAAC,EAAE,WAAW,EAAE,EAAE,mBAAmB,+BAKlE"}
@@ -1,10 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ModalComponent = ModalComponent;
4
- const native_1 = require("@react-navigation/native");
5
- function ModalComponent({ modalConfig }) {
6
- const component = modalConfig.component;
7
- const navigationProp = modalConfig.parentNavigationProp;
8
- return <native_1.NavigationContext value={navigationProp}>{component}</native_1.NavigationContext>;
9
- }
10
- //# sourceMappingURL=ModalComponent.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ModalComponent.js","sourceRoot":"","sources":["../../src/modal/ModalComponent.tsx"],"names":[],"mappings":";;AAQA,wCAKC;AAbD,qDAA6D;AAQ7D,SAAgB,cAAc,CAAC,EAAE,WAAW,EAAuB;IACjE,MAAM,SAAS,GAAG,WAAW,CAAC,SAAS,CAAC;IACxC,MAAM,cAAc,GAAG,WAAW,CAAC,oBAAoB,CAAC;IAExD,OAAO,CAAC,0BAAiB,CAAC,KAAK,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE,0BAAiB,CAAC,CAAC;AACnF,CAAC","sourcesContent":["import { NavigationContext } from '@react-navigation/native';\n\nimport { type ModalConfig } from './ModalContext';\n\ninterface ModalComponentProps {\n modalConfig: ModalConfig;\n}\n\nexport function ModalComponent({ modalConfig }: ModalComponentProps) {\n const component = modalConfig.component;\n const navigationProp = modalConfig.parentNavigationProp;\n\n return <NavigationContext value={navigationProp}>{component}</NavigationContext>;\n}\n"]}
@@ -1,15 +0,0 @@
1
- import { type PropsWithChildren } from 'react';
2
- import { type ModalConfig } from './types';
3
- export { type ModalConfig };
4
- declare const ALLOWED_EVENT_TYPE_LISTENERS: readonly ["close", "show"];
5
- type AllowedEventTypeListeners = (typeof ALLOWED_EVENT_TYPE_LISTENERS)[number];
6
- export interface ModalContextType {
7
- modalConfigs: ModalConfig[];
8
- openModal: (config: ModalConfig) => void;
9
- updateModal: (id: string, config: Omit<Partial<ModalConfig>, 'uniqueId'>) => void;
10
- closeModal: (id: string) => void;
11
- addEventListener: (type: AllowedEventTypeListeners, callback: (id: string) => void) => () => void;
12
- }
13
- export declare const ModalContextProvider: ({ children }: PropsWithChildren) => import("react").JSX.Element;
14
- export declare const useModalContext: () => ModalContextType;
15
- //# sourceMappingURL=ModalContext.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ModalContext.d.ts","sourceRoot":"","sources":["../../src/modal/ModalContext.tsx"],"names":[],"mappings":"AAEA,OAAO,EAOL,KAAK,iBAAiB,EACvB,MAAM,OAAO,CAAC;AAGf,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C,OAAO,EAAE,KAAK,WAAW,EAAE,CAAC;AAE5B,QAAA,MAAM,4BAA4B,4BAA6B,CAAC;AAChE,KAAK,yBAAyB,GAAG,CAAC,OAAO,4BAA4B,CAAC,CAAC,MAAM,CAAC,CAAC;AAE/E,MAAM,WAAW,gBAAgB;IAC/B,YAAY,EAAE,WAAW,EAAE,CAAC;IAC5B,SAAS,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,CAAC;IACzC,WAAW,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,UAAU,CAAC,KAAK,IAAI,CAAC;IAClF,UAAU,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,gBAAgB,EAAE,CAAC,IAAI,EAAE,yBAAyB,EAAE,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,KAAK,MAAM,IAAI,CAAC;CACnG;AAID,eAAO,MAAM,oBAAoB,GAAI,cAAc,iBAAiB,gCA0FnE,CAAC;AAEF,eAAO,MAAM,eAAe,wBAM3B,CAAC"}