expo-router 56.2.18 → 56.2.19

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 (52) hide show
  1. package/android/build.gradle +2 -2
  2. package/build/ExpoRoot.js +2 -2
  3. package/build/ExpoRoot.js.map +1 -1
  4. package/build/link/BaseExpoRouterLink.d.ts.map +1 -1
  5. package/build/link/BaseExpoRouterLink.js +0 -5
  6. package/build/link/BaseExpoRouterLink.js.map +1 -1
  7. package/build/link/InternalLinkPreviewContext.d.ts +0 -2
  8. package/build/link/InternalLinkPreviewContext.d.ts.map +1 -1
  9. package/build/link/InternalLinkPreviewContext.js.map +1 -1
  10. package/build/link/LinkWithPreview.d.ts.map +1 -1
  11. package/build/link/LinkWithPreview.js +0 -4
  12. package/build/link/LinkWithPreview.js.map +1 -1
  13. package/build/views/RootUnmatched.d.ts +8 -0
  14. package/build/views/RootUnmatched.d.ts.map +1 -0
  15. package/build/views/RootUnmatched.js +55 -0
  16. package/build/views/RootUnmatched.js.map +1 -0
  17. package/expo-module.config.json +1 -1
  18. package/ios/LinkPreview/LinkPreviewNativeView.swift +23 -0
  19. package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.18/expo.modules.router-56.2.18.module → 56.2.19/expo.modules.router-56.2.19.module} +7 -7
  20. package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.19/expo.modules.router-56.2.19.module.md5 +1 -0
  21. package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.19/expo.modules.router-56.2.19.module.sha1 +1 -0
  22. package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.19/expo.modules.router-56.2.19.module.sha256 +1 -0
  23. package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.19/expo.modules.router-56.2.19.module.sha512 +1 -0
  24. package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.18/expo.modules.router-56.2.18.pom → 56.2.19/expo.modules.router-56.2.19.pom} +1 -1
  25. package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.19/expo.modules.router-56.2.19.pom.md5 +1 -0
  26. package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.19/expo.modules.router-56.2.19.pom.sha1 +1 -0
  27. package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.19/expo.modules.router-56.2.19.pom.sha256 +1 -0
  28. package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.19/expo.modules.router-56.2.19.pom.sha512 +1 -0
  29. package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml +4 -4
  30. package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml.md5 +1 -1
  31. package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml.sha1 +1 -1
  32. package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml.sha256 +1 -1
  33. package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml.sha512 +1 -1
  34. package/package.json +9 -9
  35. package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.18/expo.modules.router-56.2.18.module.md5 +0 -1
  36. package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.18/expo.modules.router-56.2.18.module.sha1 +0 -1
  37. package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.18/expo.modules.router-56.2.18.module.sha256 +0 -1
  38. package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.18/expo.modules.router-56.2.18.module.sha512 +0 -1
  39. package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.18/expo.modules.router-56.2.18.pom.md5 +0 -1
  40. package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.18/expo.modules.router-56.2.18.pom.sha1 +0 -1
  41. package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.18/expo.modules.router-56.2.18.pom.sha256 +0 -1
  42. package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.18/expo.modules.router-56.2.18.pom.sha512 +0 -1
  43. /package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.18/expo.modules.router-56.2.18-sources.jar → 56.2.19/expo.modules.router-56.2.19-sources.jar} +0 -0
  44. /package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.18/expo.modules.router-56.2.18-sources.jar.md5 → 56.2.19/expo.modules.router-56.2.19-sources.jar.md5} +0 -0
  45. /package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.18/expo.modules.router-56.2.18-sources.jar.sha1 → 56.2.19/expo.modules.router-56.2.19-sources.jar.sha1} +0 -0
  46. /package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.18/expo.modules.router-56.2.18-sources.jar.sha256 → 56.2.19/expo.modules.router-56.2.19-sources.jar.sha256} +0 -0
  47. /package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.18/expo.modules.router-56.2.18-sources.jar.sha512 → 56.2.19/expo.modules.router-56.2.19-sources.jar.sha512} +0 -0
  48. /package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.18/expo.modules.router-56.2.18.aar → 56.2.19/expo.modules.router-56.2.19.aar} +0 -0
  49. /package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.18/expo.modules.router-56.2.18.aar.md5 → 56.2.19/expo.modules.router-56.2.19.aar.md5} +0 -0
  50. /package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.18/expo.modules.router-56.2.18.aar.sha1 → 56.2.19/expo.modules.router-56.2.19.aar.sha1} +0 -0
  51. /package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.18/expo.modules.router-56.2.18.aar.sha256 → 56.2.19/expo.modules.router-56.2.19.aar.sha256} +0 -0
  52. /package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.18/expo.modules.router-56.2.18.aar.sha512 → 56.2.19/expo.modules.router-56.2.19.aar.sha512} +0 -0
@@ -4,13 +4,13 @@ plugins {
4
4
  }
5
5
 
6
6
  group = 'expo.modules.router'
7
- version = '56.2.18'
7
+ version = '56.2.19'
8
8
 
9
9
  android {
10
10
  namespace "expo.modules.router"
11
11
  defaultConfig {
12
12
  versionCode 1
13
- versionName "56.2.18"
13
+ versionName "56.2.19"
14
14
  }
15
15
  lintOptions {
16
16
  abortOnError false
package/build/ExpoRoot.js CHANGED
@@ -52,9 +52,9 @@ const primitives_1 = require("./primitives");
52
52
  const native_1 = require("./react-navigation/native");
53
53
  const screensFeatureFlags_1 = require("./screensFeatureFlags");
54
54
  const url_1 = require("./utils/url");
55
+ const RootUnmatched_1 = require("./views/RootUnmatched");
55
56
  const Sitemap_1 = require("./views/Sitemap");
56
57
  const SplashScreen = __importStar(require("./views/Splash"));
57
- const Unmatched_1 = require("./views/Unmatched");
58
58
  const isTestEnv = process.env.NODE_ENV === 'test';
59
59
  const INITIAL_METRICS = react_native_1.Platform.OS === 'web' || isTestEnv
60
60
  ? {
@@ -137,7 +137,7 @@ function ContextNavigator({ context, location: initialLocation = initialUrl, wra
137
137
  function Content() {
138
138
  const children = [(0, jsx_runtime_1.jsx)(primitives_1.Screen, { name: constants_1.INTERNAL_SLOT_NAME, component: router_store_1.store.rootComponent })];
139
139
  if ((0, utils_1.shouldAppendNotFound)()) {
140
- children.push((0, jsx_runtime_1.jsx)(primitives_1.Screen, { name: constants_1.NOT_FOUND_ROUTE_NAME, component: Unmatched_1.Unmatched }));
140
+ children.push((0, jsx_runtime_1.jsx)(primitives_1.Screen, { name: constants_1.NOT_FOUND_ROUTE_NAME, component: RootUnmatched_1.RootUnmatched }));
141
141
  }
142
142
  if ((0, utils_1.shouldAppendSitemap)()) {
143
143
  children.push((0, jsx_runtime_1.jsx)(primitives_1.Screen, { name: constants_1.SITEMAP_ROUTE_NAME, component: Sitemap_1.Sitemap }));
@@ -1 +1 @@
1
- {"version":3,"file":"ExpoRoot.js","sourceRoot":"","sources":["../src/ExpoRoot.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0Db,4BA0BC;;AAlFD,iCAAsF;AACtF,+CAAwC;AACxC,mFAAkE;AAElE,2CAA2F;AAC3F,yFAAsF;AACtF,oEAA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AAI,gFAAgF,CAAC;gBAC9F,CAAC;gBAED,MAAM;YACR,KAAK,SAAS,CAAC;YACf,KAAK,KAAK,CAAC;YACX,KAAK,YAAY;gBACf,OAAO,IAAI,wCAAwC,CAAC;gBACpD,MAAM;YACR,KAAK,aAAa,CAAC;YACnB,KAAK,cAAc,CAAC;YACpB,KAAK,eAAe;gBAClB,OAAO,IAAI,+CAA+C,CAAC;gBAC3D,MAAM;QACV,CAAC;QAED,OAAO,IAAI,0EAA0E,CAAC;QAEtF,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,MAAM,EAAE,CAAC;YACpC,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;QAC3B,CAAC;QACD,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACzB,CAAC,CAAC;AACJ,CAAC;KAAM,CAAC;IACN,iBAAiB,GAAG,cAAa,CAAC,CAAC;AACrC,CAAC","sourcesContent":["'use client';\n\nimport { type PropsWithChildren, Fragment, type ComponentType, useMemo } from 'react';\nimport { Platform } from 'react-native';\nimport { SafeAreaProvider } from 'react-native-safe-area-context';\n\nimport { INTERNAL_SLOT_NAME, NOT_FOUND_ROUTE_NAME, SITEMAP_ROUTE_NAME } from './constants';\nimport { useDomComponentNavigation } from './domComponents/useDomComponentNavigation';\nimport { NavigationContainer as UpstreamNavigationContainer } from './fork/NavigationContainer';\nimport type { ExpoLinkingOptions } from './getLinkingConfig';\nimport { store, useStore } from './global-state/router-store';\nimport type { ServerContextType } from './global-state/serverLocationContext';\nimport { ServerContext } from './global-state/serverLocationContext';\nimport { StoreContext } from './global-state/storeContext';\nimport { shouldAppendNotFound, shouldAppendSitemap } from './global-state/utils';\nimport { LinkPreviewContextProvider } from './link/preview/LinkPreviewContext';\nimport { handleNavigationOnReady } from './navigationEvents/navigation';\nimport { Screen } from './primitives';\nimport type { LinkingOptions, NavigationAction } from './react-navigation/native';\nimport { StackRouter, useNavigationBuilder } from './react-navigation/native';\nimport { initScreensFeatureFlags } from './screensFeatureFlags';\nimport type { RequireContext } from './types';\nimport { parseUrlUsingCustomBase } from './utils/url';\nimport { Sitemap } from './views/Sitemap';\nimport * as SplashScreen from './views/Splash';\nimport { Unmatched } from './views/Unmatched';\n\nexport type ExpoRootProps = {\n context: RequireContext;\n location?: URL | string;\n wrapper?: ComponentType<PropsWithChildren>;\n linking?: Partial<ExpoLinkingOptions>;\n};\n\nexport type NativeIntent = {\n redirectSystemPath?: (event: {\n path: string | null;\n initial: boolean;\n }) => Promise<string | null | undefined> | string | null | undefined;\n};\n\nconst isTestEnv = process.env.NODE_ENV === 'test';\n\nconst INITIAL_METRICS =\n Platform.OS === 'web' || isTestEnv\n ? {\n frame: { x: 0, y: 0, width: 0, height: 0 },\n insets: { top: 0, left: 0, right: 0, bottom: 0 },\n }\n : undefined;\n\nconst documentTitle = {\n enabled: false,\n};\n\n/**\n * @hidden\n */\nexport function ExpoRoot({ wrapper: ParentWrapper = Fragment, ...props }: ExpoRootProps) {\n initScreensFeatureFlags();\n /*\n * Due to static rendering we need to wrap these top level views in second wrapper\n * View's like <SafeAreaProvider /> generate a <div> so if the parent wrapper\n * is a HTML document, we need to ensure its inside the <body>\n */\n const wrapper = useMemo(\n () =>\n ({ children }: PropsWithChildren) => {\n return (\n <ParentWrapper>\n <LinkPreviewContextProvider>\n <SafeAreaProvider\n // SSR support\n initialMetrics={INITIAL_METRICS}>\n {children}\n </SafeAreaProvider>\n </LinkPreviewContextProvider>\n </ParentWrapper>\n );\n },\n [ParentWrapper]\n );\n\n return <ContextNavigator {...props} wrapper={wrapper} />;\n}\n\nconst initialUrl =\n Platform.OS === 'web' && typeof window !== 'undefined'\n ? new URL(window.location.href)\n : undefined;\n\n// TODO(@ubax): Refactor onReady logic and use listeners pattern\nfunction onNavigationReady() {\n handleNavigationOnReady();\n store.onReady();\n}\n\nfunction ContextNavigator({\n context,\n location: initialLocation = initialUrl,\n wrapper: WrapperComponent = Fragment,\n linking = {},\n}: ExpoRootProps) {\n // location and linking.getInitialURL are both used to initialize the router state\n // - location is used on web and during static rendering\n // - linking.getInitialURL is used on native\n const serverContext = useMemo(() => {\n let contextType: ServerContextType = {};\n\n const url =\n typeof initialLocation === 'string'\n ? parseUrlUsingCustomBase(initialLocation)\n : initialLocation;\n\n if (url && url instanceof URL) {\n contextType = {\n location: {\n pathname: url.pathname,\n search: url.search,\n hash: url.hash,\n },\n };\n }\n\n return contextType;\n }, []);\n\n /*\n * The serverUrl is an initial URL used in server rendering environments.\n * e.g Static renders, units tests, etc\n */\n const serverUrl = serverContext.location\n ? `${serverContext.location.pathname}${serverContext.location.search}${serverContext.location.hash ?? ''}`\n : undefined;\n\n const store = useStore(context, linking, serverUrl);\n\n useDomComponentNavigation();\n\n if (store.shouldShowTutorial()) {\n SplashScreen.hideAsync();\n if (process.env.NODE_ENV === 'development') {\n const Tutorial = require('./onboard/Tutorial').Tutorial;\n return (\n <WrapperComponent>\n <Tutorial />\n </WrapperComponent>\n );\n } else {\n // Ensure tutorial styles are stripped in production.\n return null;\n }\n }\n\n return (\n <StoreContext.Provider value={store}>\n <UpstreamNavigationContainer\n ref={store.navigationRef}\n initialState={store.state}\n linking={store.linking as LinkingOptions<any>}\n onUnhandledAction={onUnhandledAction}\n onStateChange={store.onStateChange}\n documentTitle={documentTitle}\n onReady={onNavigationReady}>\n <ServerContext.Provider value={serverContext}>\n <WrapperComponent>\n <Content />\n </WrapperComponent>\n </ServerContext.Provider>\n </UpstreamNavigationContainer>\n </StoreContext.Provider>\n );\n}\n\nfunction Content() {\n const children = [<Screen name={INTERNAL_SLOT_NAME} component={store.rootComponent} />];\n if (shouldAppendNotFound()) {\n children.push(<Screen name={NOT_FOUND_ROUTE_NAME} component={Unmatched} />);\n }\n if (shouldAppendSitemap()) {\n children.push(<Screen name={SITEMAP_ROUTE_NAME} component={Sitemap} />);\n }\n const { state, descriptors, NavigationContent } = useNavigationBuilder(StackRouter, {\n children,\n id: INTERNAL_SLOT_NAME,\n });\n\n return (\n <NavigationContent>{descriptors[state.routes[state.index]!.key]!.render()}</NavigationContent>\n );\n}\n\nlet onUnhandledAction: (action: NavigationAction) => void;\n\nif (process.env.NODE_ENV !== 'production') {\n onUnhandledAction = (action: NavigationAction) => {\n const payload: Record<string, any> | undefined = action.payload;\n\n let message = `The action '${action.type}'${\n payload ? ` with payload ${JSON.stringify(action.payload)}` : ''\n } was not handled by any navigator.`;\n\n switch (action.type) {\n case 'NAVIGATE':\n case 'PUSH':\n case 'REPLACE':\n case 'JUMP_TO':\n if (payload?.name) {\n message += `\\n\\nDo you have a route named '${payload.name}'?`;\n } else {\n message += `\\n\\nYou need to pass the name of the screen to navigate to. This may be a bug.`;\n }\n\n break;\n case 'GO_BACK':\n case 'POP':\n case 'POP_TO_TOP':\n message += `\\n\\nIs there any screen to go back to?`;\n break;\n case 'OPEN_DRAWER':\n case 'CLOSE_DRAWER':\n case 'TOGGLE_DRAWER':\n message += `\\n\\nIs your screen inside a Drawer navigator?`;\n break;\n }\n\n message += `\\n\\nThis is a development-only warning and won't be shown in production.`;\n\n if (process.env.NODE_ENV === 'test') {\n throw new Error(message);\n }\n console.error(message);\n };\n} else {\n onUnhandledAction = function () {};\n}\n"]}
1
+ {"version":3,"file":"ExpoRoot.js","sourceRoot":"","sources":["../src/ExpoRoot.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0Db,4BA0BC;;AAlFD,iCAAsF;AACtF,+CAAwC;AACxC,mFAAkE;AAElE,2CAA2F;AAC3F,yFAAsF;AACtF,oEAAgG;AAEhG,8DAA8D;AAE9D,gFAAqE;AACrE,8DAA2D;AAC3D,gDAAiF;AACjF,0EAA+E;AAC/E,8DAAwE;AACxE,6CAAsC;AAEtC,sDAA8E;AAC9E,+DAAgE;AAEhE,qCAAsD;AACtD,yDAAsD;AACtD,6CAA0C;AAC1C,6DAA+C;AAgB/C,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,QA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C3D,MAAM;QACV,CAAC;QAED,OAAO,IAAI,0EAA0E,CAAC;QAEtF,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,MAAM,EAAE,CAAC;YACpC,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;QAC3B,CAAC;QACD,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACzB,CAAC,CAAC;AACJ,CAAC;KAAM,CAAC;IACN,iBAAiB,GAAG,cAAa,CAAC,CAAC;AACrC,CAAC","sourcesContent":["'use client';\n\nimport { type PropsWithChildren, Fragment, type ComponentType, useMemo } from 'react';\nimport { Platform } from 'react-native';\nimport { SafeAreaProvider } from 'react-native-safe-area-context';\n\nimport { INTERNAL_SLOT_NAME, NOT_FOUND_ROUTE_NAME, SITEMAP_ROUTE_NAME } from './constants';\nimport { useDomComponentNavigation } from './domComponents/useDomComponentNavigation';\nimport { NavigationContainer as UpstreamNavigationContainer } from './fork/NavigationContainer';\nimport type { ExpoLinkingOptions } from './getLinkingConfig';\nimport { store, useStore } from './global-state/router-store';\nimport type { ServerContextType } from './global-state/serverLocationContext';\nimport { ServerContext } from './global-state/serverLocationContext';\nimport { StoreContext } from './global-state/storeContext';\nimport { shouldAppendNotFound, shouldAppendSitemap } from './global-state/utils';\nimport { LinkPreviewContextProvider } from './link/preview/LinkPreviewContext';\nimport { handleNavigationOnReady } from './navigationEvents/navigation';\nimport { Screen } from './primitives';\nimport type { LinkingOptions, NavigationAction } from './react-navigation/native';\nimport { StackRouter, useNavigationBuilder } from './react-navigation/native';\nimport { initScreensFeatureFlags } from './screensFeatureFlags';\nimport type { RequireContext } from './types';\nimport { parseUrlUsingCustomBase } from './utils/url';\nimport { RootUnmatched } from './views/RootUnmatched';\nimport { Sitemap } from './views/Sitemap';\nimport * as SplashScreen from './views/Splash';\n\nexport type ExpoRootProps = {\n context: RequireContext;\n location?: URL | string;\n wrapper?: ComponentType<PropsWithChildren>;\n linking?: Partial<ExpoLinkingOptions>;\n};\n\nexport type NativeIntent = {\n redirectSystemPath?: (event: {\n path: string | null;\n initial: boolean;\n }) => Promise<string | null | undefined> | string | null | undefined;\n};\n\nconst isTestEnv = process.env.NODE_ENV === 'test';\n\nconst INITIAL_METRICS =\n Platform.OS === 'web' || isTestEnv\n ? {\n frame: { x: 0, y: 0, width: 0, height: 0 },\n insets: { top: 0, left: 0, right: 0, bottom: 0 },\n }\n : undefined;\n\nconst documentTitle = {\n enabled: false,\n};\n\n/**\n * @hidden\n */\nexport function ExpoRoot({ wrapper: ParentWrapper = Fragment, ...props }: ExpoRootProps) {\n initScreensFeatureFlags();\n /*\n * Due to static rendering we need to wrap these top level views in second wrapper\n * View's like <SafeAreaProvider /> generate a <div> so if the parent wrapper\n * is a HTML document, we need to ensure its inside the <body>\n */\n const wrapper = useMemo(\n () =>\n ({ children }: PropsWithChildren) => {\n return (\n <ParentWrapper>\n <LinkPreviewContextProvider>\n <SafeAreaProvider\n // SSR support\n initialMetrics={INITIAL_METRICS}>\n {children}\n </SafeAreaProvider>\n </LinkPreviewContextProvider>\n </ParentWrapper>\n );\n },\n [ParentWrapper]\n );\n\n return <ContextNavigator {...props} wrapper={wrapper} />;\n}\n\nconst initialUrl =\n Platform.OS === 'web' && typeof window !== 'undefined'\n ? new URL(window.location.href)\n : undefined;\n\n// TODO(@ubax): Refactor onReady logic and use listeners pattern\nfunction onNavigationReady() {\n handleNavigationOnReady();\n store.onReady();\n}\n\nfunction ContextNavigator({\n context,\n location: initialLocation = initialUrl,\n wrapper: WrapperComponent = Fragment,\n linking = {},\n}: ExpoRootProps) {\n // location and linking.getInitialURL are both used to initialize the router state\n // - location is used on web and during static rendering\n // - linking.getInitialURL is used on native\n const serverContext = useMemo(() => {\n let contextType: ServerContextType = {};\n\n const url =\n typeof initialLocation === 'string'\n ? parseUrlUsingCustomBase(initialLocation)\n : initialLocation;\n\n if (url && url instanceof URL) {\n contextType = {\n location: {\n pathname: url.pathname,\n search: url.search,\n hash: url.hash,\n },\n };\n }\n\n return contextType;\n }, []);\n\n /*\n * The serverUrl is an initial URL used in server rendering environments.\n * e.g Static renders, units tests, etc\n */\n const serverUrl = serverContext.location\n ? `${serverContext.location.pathname}${serverContext.location.search}${serverContext.location.hash ?? ''}`\n : undefined;\n\n const store = useStore(context, linking, serverUrl);\n\n useDomComponentNavigation();\n\n if (store.shouldShowTutorial()) {\n SplashScreen.hideAsync();\n if (process.env.NODE_ENV === 'development') {\n const Tutorial = require('./onboard/Tutorial').Tutorial;\n return (\n <WrapperComponent>\n <Tutorial />\n </WrapperComponent>\n );\n } else {\n // Ensure tutorial styles are stripped in production.\n return null;\n }\n }\n\n return (\n <StoreContext.Provider value={store}>\n <UpstreamNavigationContainer\n ref={store.navigationRef}\n initialState={store.state}\n linking={store.linking as LinkingOptions<any>}\n onUnhandledAction={onUnhandledAction}\n onStateChange={store.onStateChange}\n documentTitle={documentTitle}\n onReady={onNavigationReady}>\n <ServerContext.Provider value={serverContext}>\n <WrapperComponent>\n <Content />\n </WrapperComponent>\n </ServerContext.Provider>\n </UpstreamNavigationContainer>\n </StoreContext.Provider>\n );\n}\n\nfunction Content() {\n const children = [<Screen name={INTERNAL_SLOT_NAME} component={store.rootComponent} />];\n if (shouldAppendNotFound()) {\n children.push(<Screen name={NOT_FOUND_ROUTE_NAME} component={RootUnmatched} />);\n }\n if (shouldAppendSitemap()) {\n children.push(<Screen name={SITEMAP_ROUTE_NAME} component={Sitemap} />);\n }\n const { state, descriptors, NavigationContent } = useNavigationBuilder(StackRouter, {\n children,\n id: INTERNAL_SLOT_NAME,\n });\n\n return (\n <NavigationContent>{descriptors[state.routes[state.index]!.key]!.render()}</NavigationContent>\n );\n}\n\nlet onUnhandledAction: (action: NavigationAction) => void;\n\nif (process.env.NODE_ENV !== 'production') {\n onUnhandledAction = (action: NavigationAction) => {\n const payload: Record<string, any> | undefined = action.payload;\n\n let message = `The action '${action.type}'${\n payload ? ` with payload ${JSON.stringify(action.payload)}` : ''\n } was not handled by any navigator.`;\n\n switch (action.type) {\n case 'NAVIGATE':\n case 'PUSH':\n case 'REPLACE':\n case 'JUMP_TO':\n if (payload?.name) {\n message += `\\n\\nDo you have a route named '${payload.name}'?`;\n } else {\n message += `\\n\\nYou need to pass the name of the screen to navigate to. This may be a bug.`;\n }\n\n break;\n case 'GO_BACK':\n case 'POP':\n case 'POP_TO_TOP':\n message += `\\n\\nIs there any screen to go back to?`;\n break;\n case 'OPEN_DRAWER':\n case 'CLOSE_DRAWER':\n case 'TOGGLE_DRAWER':\n message += `\\n\\nIs your screen inside a Drawer navigator?`;\n break;\n }\n\n message += `\\n\\nThis is a development-only warning and won't be shown in production.`;\n\n if (process.env.NODE_ENV === 'test') {\n throw new Error(message);\n }\n console.error(message);\n };\n} else {\n onUnhandledAction = function () {};\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"BaseExpoRouterLink.d.ts","sourceRoot":"","sources":["../../src/link/BaseExpoRouterLink.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAMhD,wBAAgB,kBAAkB,CAAC,EACjC,IAAI,EACJ,OAAO,EACP,IAAI,EACJ,SAAS,EAET,mBAAmB,EACnB,OAAO,EACP,GAAG,EACH,MAAM,EACN,QAAQ,EACR,UAAU,EACV,mBAAmB,EAAE,QAAQ,EAC7B,QAAQ,EACR,GAAG,IAAI,EACR,EAAE,SAAS,2CAuEX"}
1
+ {"version":3,"file":"BaseExpoRouterLink.d.ts","sourceRoot":"","sources":["../../src/link/BaseExpoRouterLink.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAMhD,wBAAgB,kBAAkB,CAAC,EACjC,IAAI,EACJ,OAAO,EACP,IAAI,EACJ,SAAS,EAET,mBAAmB,EACnB,OAAO,EACP,GAAG,EACH,MAAM,EACN,QAAQ,EACR,UAAU,EACV,mBAAmB,EAAE,QAAQ,EAC7B,QAAQ,EACR,GAAG,IAAI,EACR,EAAE,SAAS,2CAkEX"}
@@ -41,7 +41,6 @@ exports.BaseExpoRouterLink = BaseExpoRouterLink;
41
41
  const jsx_runtime_1 = require("react/jsx-runtime");
42
42
  const react_1 = __importStar(require("react"));
43
43
  const react_native_1 = require("react-native");
44
- const InternalLinkPreviewContext_1 = require("./InternalLinkPreviewContext");
45
44
  const href_1 = require("./href");
46
45
  const useLinkHooks_1 = require("./useLinkHooks");
47
46
  const useLinkToPathProps_1 = __importDefault(require("./useLinkToPathProps"));
@@ -67,7 +66,6 @@ relativeToDirectory, asChild, rel, target, download, withAnchor, dangerouslySing
67
66
  event = 'REPLACE';
68
67
  if (dismissTo)
69
68
  event = 'POP_TO';
70
- const previewContext = (0, react_1.use)(InternalLinkPreviewContext_1.InternalLinkPreviewContext);
71
69
  const props = (0, useLinkToPathProps_1.default)({
72
70
  href: resolvedHref,
73
71
  event,
@@ -76,9 +74,6 @@ relativeToDirectory, asChild, rel, target, download, withAnchor, dangerouslySing
76
74
  dangerouslySingular: singular,
77
75
  });
78
76
  const onPress = (e) => {
79
- if (previewContext?.blockPressRef.current) {
80
- return;
81
- }
82
77
  if ('onPress' in rest) {
83
78
  rest.onPress?.(e);
84
79
  }
@@ -1 +1 @@
1
- {"version":3,"file":"BaseExpoRouterLink.js","sourceRoot":"","sources":["../../src/link/BaseExpoRouterLink.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBb,gDAsFC;;AAlGD,+CAA4C;AAE5C,+CAA8C;AAE9C,6EAA0E;AAC1E,iCAAqC;AAErC,iDAAmE;AACnE,8EAAsD;AACtD,0CAAuC;AACvC,qCAAkC;AAElC,SAAgB,kBAAkB,CAAC,EACjC,IAAI,EACJ,OAAO,EACP,IAAI,EACJ,SAAS;AACT,yDAAyD;AACzD,mBAAmB,EACnB,OAAO,EACP,GAAG,EACH,MAAM,EACN,QAAQ,EACR,UAAU,EACV,mBAAmB,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C,CAAC,CAAC,WAAI,CAAC,CAAC,CAAC,mBAAI,CAAC;IAExC,IAAI,OAAO,IAAI,eAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QACvD,MAAM,IAAI,KAAK,CACb,sGAAsG,CACvG,CAAC;IACJ,CAAC;IAED,6HAA6H;IAC7H,MAAM,OAAO,GAAG,CACd,uBAAC,SAAS,OACJ,KAAK,KACL,SAAS,KACT,IAAI,EACR,KAAK,EAAE,KAAK,KACR,uBAAQ,CAAC,MAAM,CAAC;YAClB,GAAG,EAAE;gBACH,OAAO,EAAE,OAAO;aACV;YACR,OAAO,EAAE,EAAE,OAAO,EAAE;SACrB,CAAC,GACF,CACH,CAAC;IAEF,OAAO,QAAQ,CAAC,CAAC,CAAC,CAChB,6DACE,uBAAC,mBAAQ,IAAC,IAAI,EAAE,IAAI,GAAI,EACvB,OAAO,IACP,CACJ,CAAC,CAAC,CAAC,CACF,OAAO,CACR,CAAC;AACJ,CAAC","sourcesContent":["'use client';\n// Fork of @react-navigation/native Link.tsx with `href` and `replace` support added and\n// `to` / `action` support removed.\nimport type { MouseEvent } from 'react';\nimport React, { useMemo, use } from 'react';\nimport type { GestureResponderEvent } from 'react-native';\nimport { Text, Platform } from 'react-native';\n\nimport { InternalLinkPreviewContext } from './InternalLinkPreviewContext';\nimport { resolveHref } from './href';\nimport type { LinkProps } from './useLinkHooks';\nimport { useInteropClassName, useHrefAttrs } from './useLinkHooks';\nimport useLinkToPathProps from './useLinkToPathProps';\nimport { Prefetch } from '../Prefetch';\nimport { Slot } from '../ui/Slot';\n\nexport function BaseExpoRouterLink({\n href,\n replace,\n push,\n dismissTo,\n // TODO: This does not prevent default on the anchor tag.\n relativeToDirectory,\n asChild,\n rel,\n target,\n download,\n withAnchor,\n dangerouslySingular: singular,\n prefetch,\n ...rest\n}: LinkProps) {\n // Mutate the style prop to add the className on web.\n const style = useInteropClassName(rest);\n\n // If not passing asChild, we need to forward the props to the anchor tag using React Native Web's `hrefAttrs`.\n const hrefAttrs = useHrefAttrs({ asChild, rel, target, download });\n\n const resolvedHref = useMemo(() => {\n if (href == null) {\n throw new Error('Link: href is required');\n }\n return resolveHref(href);\n }, [href]);\n\n let event;\n if (push) event = 'PUSH';\n if (replace) event = 'REPLACE';\n if (dismissTo) event = 'POP_TO';\n\n const previewContext = use(InternalLinkPreviewContext);\n\n const props = useLinkToPathProps({\n href: resolvedHref,\n event,\n relativeToDirectory,\n withAnchor,\n dangerouslySingular: singular,\n });\n\n const onPress = (e: MouseEvent<HTMLAnchorElement> | GestureResponderEvent) => {\n if (previewContext?.blockPressRef.current) {\n return;\n }\n if ('onPress' in rest) {\n rest.onPress?.(e);\n }\n props.onPress(e);\n };\n\n const Component = asChild ? Slot : Text;\n\n if (asChild && React.Children.count(rest.children) > 1) {\n throw new Error(\n 'Link: When using `asChild`, you must pass a single child element that will emit the `onPress` event.'\n );\n }\n\n // Avoid using createElement directly, favoring JSX, to allow tools like NativeWind to perform custom JSX handling on native.\n const element = (\n <Component\n {...props}\n {...hrefAttrs}\n {...rest}\n style={style}\n {...Platform.select({\n web: {\n onClick: onPress,\n } as any,\n default: { onPress },\n })}\n />\n );\n\n return prefetch ? (\n <>\n <Prefetch href={href} />\n {element}\n </>\n ) : (\n element\n );\n}\n"]}
1
+ {"version":3,"file":"BaseExpoRouterLink.js","sourceRoot":"","sources":["../../src/link/BaseExpoRouterLink.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeb,gDAiFC;;AA5FD,+CAAuC;AAEvC,+CAA8C;AAE9C,iCAAqC;AAErC,iDAAmE;AACnE,8EAAsD;AACtD,0CAAuC;AACvC,qCAAkC;AAElC,SAAgB,kBAAkB,CAAC,EACjC,IAAI,EACJ,OAAO,EACP,IAAI,EACJ,SAAS;AACT,yDAAyD;AACzD,mBAAmB,EACnB,OAAO,EACP,GAAG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,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QACvD,MAAM,IAAI,KAAK,CACb,sGAAsG,CACvG,CAAC;IACJ,CAAC;IAED,6HAA6H;IAC7H,MAAM,OAAO,GAAG,CACd,uBAAC,SAAS,OACJ,KAAK,KACL,SAAS,KACT,IAAI,EACR,KAAK,EAAE,KAAK,KACR,uBAAQ,CAAC,MAAM,CAAC;YAClB,GAAG,EAAE;gBACH,OAAO,EAAE,OAAO;aACV;YACR,OAAO,EAAE,EAAE,OAAO,EAAE;SACrB,CAAC,GACF,CACH,CAAC;IAEF,OAAO,QAAQ,CAAC,CAAC,CAAC,CAChB,6DACE,uBAAC,mBAAQ,IAAC,IAAI,EAAE,IAAI,GAAI,EACvB,OAAO,IACP,CACJ,CAAC,CAAC,CAAC,CACF,OAAO,CACR,CAAC;AACJ,CAAC","sourcesContent":["'use client';\n// Fork of @react-navigation/native Link.tsx with `href` and `replace` support added and\n// `to` / `action` support removed.\nimport type { MouseEvent } from 'react';\nimport React, { useMemo } from 'react';\nimport type { GestureResponderEvent } from 'react-native';\nimport { Text, Platform } from 'react-native';\n\nimport { resolveHref } from './href';\nimport type { LinkProps } from './useLinkHooks';\nimport { useInteropClassName, useHrefAttrs } from './useLinkHooks';\nimport useLinkToPathProps from './useLinkToPathProps';\nimport { Prefetch } from '../Prefetch';\nimport { Slot } from '../ui/Slot';\n\nexport function BaseExpoRouterLink({\n href,\n replace,\n push,\n dismissTo,\n // TODO: This does not prevent default on the anchor tag.\n relativeToDirectory,\n asChild,\n rel,\n target,\n download,\n withAnchor,\n dangerouslySingular: singular,\n prefetch,\n ...rest\n}: LinkProps) {\n // Mutate the style prop to add the className on web.\n const style = useInteropClassName(rest);\n\n // If not passing asChild, we need to forward the props to the anchor tag using React Native Web's `hrefAttrs`.\n const hrefAttrs = useHrefAttrs({ asChild, rel, target, download });\n\n const resolvedHref = useMemo(() => {\n if (href == null) {\n throw new Error('Link: href is required');\n }\n return resolveHref(href);\n }, [href]);\n\n let event;\n if (push) event = 'PUSH';\n if (replace) event = 'REPLACE';\n if (dismissTo) event = 'POP_TO';\n\n const props = useLinkToPathProps({\n href: resolvedHref,\n event,\n relativeToDirectory,\n withAnchor,\n dangerouslySingular: singular,\n });\n\n const onPress = (e: MouseEvent<HTMLAnchorElement> | GestureResponderEvent) => {\n if ('onPress' in rest) {\n rest.onPress?.(e);\n }\n props.onPress(e);\n };\n\n const Component = asChild ? Slot : Text;\n\n if (asChild && React.Children.count(rest.children) > 1) {\n throw new Error(\n 'Link: When using `asChild`, you must pass a single child element that will emit the `onPress` event.'\n );\n }\n\n // Avoid using createElement directly, favoring JSX, to allow tools like NativeWind to perform custom JSX handling on native.\n const element = (\n <Component\n {...props}\n {...hrefAttrs}\n {...rest}\n style={style}\n {...Platform.select({\n web: {\n onClick: onPress,\n } as any,\n default: { onPress },\n })}\n />\n );\n\n return prefetch ? (\n <>\n <Prefetch href={href} />\n {element}\n </>\n ) : (\n element\n );\n}\n"]}
@@ -1,9 +1,7 @@
1
- import { type RefObject } from 'react';
2
1
  import type { LinkProps } from './useLinkHooks';
3
2
  export type InternalLinkPreviewContextValue = {
4
3
  isVisible: boolean;
5
4
  href: LinkProps['href'];
6
- blockPressRef: RefObject<boolean>;
7
5
  };
8
6
  export declare const InternalLinkPreviewContext: import("react").Context<InternalLinkPreviewContextValue | undefined>;
9
7
  //# sourceMappingURL=InternalLinkPreviewContext.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"InternalLinkPreviewContext.d.ts","sourceRoot":"","sources":["../../src/link/InternalLinkPreviewContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEhD,MAAM,MAAM,+BAA+B,GAAG;IAC5C,SAAS,EAAE,OAAO,CAAC;IACnB,IAAI,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;IACxB,aAAa,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;CACnC,CAAC;AAEF,eAAO,MAAM,0BAA0B,sEAE3B,CAAC"}
1
+ {"version":3,"file":"InternalLinkPreviewContext.d.ts","sourceRoot":"","sources":["../../src/link/InternalLinkPreviewContext.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEhD,MAAM,MAAM,+BAA+B,GAAG;IAC5C,SAAS,EAAE,OAAO,CAAC;IACnB,IAAI,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;CACzB,CAAC;AAEF,eAAO,MAAM,0BAA0B,sEAE3B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"InternalLinkPreviewContext.js","sourceRoot":"","sources":["../../src/link/InternalLinkPreviewContext.ts"],"names":[],"mappings":";;;AAAA,iCAAsD;AAUzC,QAAA,0BAA0B,GAAG,IAAA,qBAAa,EAErD,SAAS,CAAC,CAAC","sourcesContent":["import { createContext, type RefObject } from 'react';\n\nimport type { LinkProps } from './useLinkHooks';\n\nexport type InternalLinkPreviewContextValue = {\n isVisible: boolean;\n href: LinkProps['href'];\n blockPressRef: RefObject<boolean>;\n};\n\nexport const InternalLinkPreviewContext = createContext<\n InternalLinkPreviewContextValue | undefined\n>(undefined);\n"]}
1
+ {"version":3,"file":"InternalLinkPreviewContext.js","sourceRoot":"","sources":["../../src/link/InternalLinkPreviewContext.ts"],"names":[],"mappings":";;;AAAA,iCAAsC;AASzB,QAAA,0BAA0B,GAAG,IAAA,qBAAa,EAErD,SAAS,CAAC,CAAC","sourcesContent":["import { createContext } from 'react';\n\nimport type { LinkProps } from './useLinkHooks';\n\nexport type InternalLinkPreviewContextValue = {\n isVisible: boolean;\n href: LinkProps['href'];\n};\n\nexport const InternalLinkPreviewContext = createContext<\n InternalLinkPreviewContextValue | undefined\n>(undefined);\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"LinkWithPreview.d.ts","sourceRoot":"","sources":["../../src/link/LinkWithPreview.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAIrC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAMhD,UAAU,oBAAqB,SAAQ,SAAS;IAC9C,wBAAwB,EAAE,IAAI,CAAC;CAChC;AAED,wBAAgB,eAAe,CAAC,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,EAAE,oBAAoB,2CAkI1E"}
1
+ {"version":3,"file":"LinkWithPreview.d.ts","sourceRoot":"","sources":["../../src/link/LinkWithPreview.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAIrC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAMhD,UAAU,oBAAqB,SAAQ,SAAS;IAC9C,wBAAwB,EAAE,IAAI,CAAC;CAChC;AAED,wBAAgB,eAAe,CAAC,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,EAAE,oBAAoB,2CA8H1E"}
@@ -91,7 +91,6 @@ function LinkWithPreview({ children, ...rest }) {
91
91
  const trigger = react_1.default.useMemo(() => triggerElement ?? (0, jsx_runtime_1.jsx)(elements_1.LinkTrigger, { children: children }), [triggerElement, children]);
92
92
  const preview = react_1.default.useMemo(() => ((0, url_1.shouldLinkExternally)(String(rest.href)) || !previewElement ? null : previewElement), [previewElement, rest.href]);
93
93
  const isPreviewTapped = (0, react_1.useRef)(false);
94
- const blockPressRef = (0, react_1.useRef)(false);
95
94
  const tabPathValue = (0, react_1.useMemo)(() => ({
96
95
  path: tabPath,
97
96
  }), [tabPath]);
@@ -101,7 +100,6 @@ function LinkWithPreview({ children, ...rest }) {
101
100
  }
102
101
  return ((0, jsx_runtime_1.jsx)(native_1.NativeLinkPreview, { nextScreenId: isPad ? undefined : nextScreenId, tabPath: isPad ? undefined : tabPathValue, onWillPreviewOpen: () => {
103
102
  if (hasPreview) {
104
- blockPressRef.current = true;
105
103
  isPreviewTapped.current = false;
106
104
  prefetch(rest.href);
107
105
  setIsCurrenPreviewOpen(true);
@@ -116,7 +114,6 @@ function LinkWithPreview({ children, ...rest }) {
116
114
  }
117
115
  }
118
116
  }, onPreviewDidClose: () => {
119
- blockPressRef.current = false;
120
117
  if (hasPreview && isPreviewTapped.current && isPad) {
121
118
  router.navigate(rest.href, { __internal__PreviewKey: nextScreenId });
122
119
  }
@@ -128,7 +125,6 @@ function LinkWithPreview({ children, ...rest }) {
128
125
  }, style: { display: 'contents' }, disableForceFlatten: true, children: (0, jsx_runtime_1.jsx)(NativeMenuContext_1.NativeMenuContext, { value: true, children: (0, jsx_runtime_1.jsxs)(InternalLinkPreviewContext_1.InternalLinkPreviewContext, { value: {
129
126
  isVisible: isCurrentPreviewOpen,
130
127
  href: rest.hrefForPreviewNavigation,
131
- blockPressRef,
132
128
  }, children: [(0, jsx_runtime_1.jsx)(BaseExpoRouterLink_1.BaseExpoRouterLink, { ...rest, children: trigger, ref: rest.ref }), preview, menuElement] }) }) }));
133
129
  }
134
130
  //# sourceMappingURL=LinkWithPreview.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"LinkWithPreview.js","sourceRoot":"","sources":["../../src/link/LinkWithPreview.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBb,0CAkIC;;AAzJD,+CAAoE;AACpE,+CAAwC;AAExC,oCAAqC;AACrC,6DAA0D;AAC1D,6EAA0E;AAC1E,2DAAwD;AACxD,yCAAgE;AAChE,iCAAqC;AAErC,qEAAqE;AACrE,6CAAqD;AACrD,+DAA4D;AAE5D,gDAAwD;AACxD,sCAAoD;AAEpD,MAAM,KAAK,GAAG,uBAAQ,CAAC,EAAE,KAAK,KAAK,IAAI,uBAAQ,CAAC,KAAK,CAAC;AAMtD,SAAgB,eAAe,CAAC,EAAE,QAAQ,EAAE,GAA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C,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,sBAAsB,EAAE,YAAY,EAAE,CAAC,CAAC;YACvE,CAAC;QACH,CAAC,EACD,eAAe,EAAE,GAAG,EAAE;YACpB,eAAe,CAAC,OAAO,GAAG,IAAI,CAAC;YAC/B,IAAI,CAAC,KAAK,EAAE,CAAC;gBACX,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,sBAAsB,EAAE,YAAY,EAAE,CAAC,CAAC;YACvE,CAAC;QACH,CAAC,EACD,KAAK,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,EAC9B,mBAAmB,kBACnB,uBAAC,qCAAiB,IAAC,KAAK,kBACtB,wBAAC,uDAA0B,IACzB,KAAK,EAAE;oBACL,SAAS,EAAE,oBAAoB;oBAC/B,IAAI,EAAE,IAAI,CAAC,wBAAwB;oBACnC,aAAa;iBACd,aACD,uBAAC,uCAAkB,OAAK,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,GAAI,EACjE,OAAO,EACP,WAAW,IACe,GACX,GACF,CACrB,CAAC;AACJ,CAAC","sourcesContent":["'use client';\n\nimport React, { useEffect, useMemo, useRef, useState } from 'react';\nimport { Platform } from 'react-native';\n\nimport { useRouter } from '../hooks';\nimport { BaseExpoRouterLink } from './BaseExpoRouterLink';\nimport { InternalLinkPreviewContext } from './InternalLinkPreviewContext';\nimport { NativeMenuContext } from './NativeMenuContext';\nimport { LinkMenu, LinkPreview, LinkTrigger } from './elements';\nimport { resolveHref } from './href';\nimport type { Href } from '../types';\nimport { useLinkPreviewContext } from './preview/LinkPreviewContext';\nimport { NativeLinkPreview } from './preview/native';\nimport { useNextScreenId } from './preview/useNextScreenId';\nimport type { LinkProps } from './useLinkHooks';\nimport { getFirstChildOfType } from '../utils/children';\nimport { shouldLinkExternally } from '../utils/url';\n\nconst isPad = Platform.OS === 'ios' && Platform.isPad;\n\ninterface LinkWithPreviewProps extends LinkProps {\n hrefForPreviewNavigation: Href;\n}\n\nexport function LinkWithPreview({ children, ...rest }: LinkWithPreviewProps) {\n const router = useRouter();\n const { setOpenPreviewKey } = useLinkPreviewContext();\n const [isCurrentPreviewOpen, setIsCurrenPreviewOpen] = useState(false);\n\n const hrefWithoutQuery = resolveHref(rest.hrefForPreviewNavigation).split('?')[0];\n const prevHrefWithoutQuery = useRef(hrefWithoutQuery);\n\n useEffect(() => {\n if (isCurrentPreviewOpen) {\n if (prevHrefWithoutQuery.current !== hrefWithoutQuery) {\n throw new Error(\n 'Link does not support changing the href prop after the preview has been opened. Please ensure that the href prop is stable and does not change between renders.'\n );\n }\n } else {\n prevHrefWithoutQuery.current = hrefWithoutQuery;\n }\n }, [hrefWithoutQuery]);\n\n const [{ nextScreenId, tabPath }, prefetch] = useNextScreenId();\n\n useEffect(() => {\n if (rest.replace) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error('Using replace links with preview is not supported');\n } else {\n console.warn('Using replace links with preview is not supported');\n }\n }\n }, [rest.href, rest.replace]);\n\n const triggerElement = React.useMemo(\n () => getFirstChildOfType(children, LinkTrigger),\n [children]\n );\n const menuElement = React.useMemo(() => getFirstChildOfType(children, LinkMenu), [children]);\n const previewElement = React.useMemo(\n () => getFirstChildOfType(children, LinkPreview),\n [children]\n );\n\n if ((previewElement || menuElement) && !triggerElement) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error(\n 'When you use Link.Preview, you must use Link.Trigger to specify the trigger element.'\n );\n } else {\n console.warn(\n 'When you use Link.Preview, you must use Link.Trigger to specify the trigger element.'\n );\n }\n }\n\n const trigger = React.useMemo(\n () => triggerElement ?? <LinkTrigger>{children}</LinkTrigger>,\n [triggerElement, children]\n );\n\n const preview = React.useMemo(\n () => (shouldLinkExternally(String(rest.href)) || !previewElement ? null : previewElement),\n [previewElement, rest.href]\n );\n\n const isPreviewTapped = useRef(false);\n const blockPressRef = useRef(false);\n\n const tabPathValue = useMemo(\n () => ({\n path: tabPath,\n }),\n [tabPath]\n );\n\n const hasPreview = !!previewElement;\n\n if (rest.replace) {\n return <BaseExpoRouterLink children={children} {...rest} />;\n }\n\n return (\n <NativeLinkPreview\n nextScreenId={isPad ? undefined : nextScreenId}\n tabPath={isPad ? undefined : tabPathValue}\n onWillPreviewOpen={() => {\n if (hasPreview) {\n blockPressRef.current = true;\n isPreviewTapped.current = false;\n prefetch(rest.href);\n setIsCurrenPreviewOpen(true);\n }\n }}\n onPreviewWillClose={() => {\n if (hasPreview) {\n setIsCurrenPreviewOpen(false);\n // When preview was not tapped, then we need to enable the screen stack animation\n // Otherwise this will happen in StackNavigator, when new screen is opened\n if (!isPreviewTapped.current || isPad) {\n setOpenPreviewKey(undefined);\n }\n }\n }}\n onPreviewDidClose={() => {\n blockPressRef.current = false;\n if (hasPreview && isPreviewTapped.current && isPad) {\n router.navigate(rest.href, { __internal__PreviewKey: nextScreenId });\n }\n }}\n onPreviewTapped={() => {\n isPreviewTapped.current = true;\n if (!isPad) {\n router.navigate(rest.href, { __internal__PreviewKey: nextScreenId });\n }\n }}\n style={{ display: 'contents' }}\n disableForceFlatten>\n <NativeMenuContext value>\n <InternalLinkPreviewContext\n value={{\n isVisible: isCurrentPreviewOpen,\n href: rest.hrefForPreviewNavigation,\n blockPressRef,\n }}>\n <BaseExpoRouterLink {...rest} children={trigger} ref={rest.ref} />\n {preview}\n {menuElement}\n </InternalLinkPreviewContext>\n </NativeMenuContext>\n </NativeLinkPreview>\n );\n}\n"]}
1
+ {"version":3,"file":"LinkWithPreview.js","sourceRoot":"","sources":["../../src/link/LinkWithPreview.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBb,0CA8HC;;AArJD,+CAAoE;AACpE,+CAAwC;AAExC,oCAAqC;AACrC,6DAA0D;AAC1D,6EAA0E;AAC1E,2DAAwD;AACxD,yCAAgE;AAChE,iCAAqC;AAErC,qEAAqE;AACrE,6CAAqD;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,KAAK,EAAE,CAAC;gBACnD,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,sBAAsB,EAAE,YAAY,EAAE,CAAC,CAAC;YACvE,CAAC;QACH,CAAC,EACD,eAAe,EAAE,GAAG,EAAE;YACpB,eAAe,CAAC,OAAO,GAAG,IAAI,CAAC;YAC/B,IAAI,CAAC,KAAK,EAAE,CAAC;gBACX,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,sBAAsB,EAAE,YAAY,EAAE,CAAC,CAAC;YACvE,CAAC;QACH,CAAC,EACD,KAAK,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,EAC9B,mBAAmB,kBACnB,uBAAC,qCAAiB,IAAC,KAAK,kBACtB,wBAAC,uDAA0B,IACzB,KAAK,EAAE;oBACL,SAAS,EAAE,oBAAoB;oBAC/B,IAAI,EAAE,IAAI,CAAC,wBAAwB;iBACpC,aACD,uBAAC,uCAAkB,OAAK,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,GAAI,EACjE,OAAO,EACP,WAAW,IACe,GACX,GACF,CACrB,CAAC;AACJ,CAAC","sourcesContent":["'use client';\n\nimport React, { useEffect, useMemo, useRef, useState } from 'react';\nimport { Platform } from 'react-native';\n\nimport { useRouter } from '../hooks';\nimport { BaseExpoRouterLink } from './BaseExpoRouterLink';\nimport { InternalLinkPreviewContext } from './InternalLinkPreviewContext';\nimport { NativeMenuContext } from './NativeMenuContext';\nimport { LinkMenu, LinkPreview, LinkTrigger } from './elements';\nimport { resolveHref } from './href';\nimport type { Href } from '../types';\nimport { useLinkPreviewContext } from './preview/LinkPreviewContext';\nimport { NativeLinkPreview } from './preview/native';\nimport { useNextScreenId } from './preview/useNextScreenId';\nimport type { LinkProps } from './useLinkHooks';\nimport { getFirstChildOfType } from '../utils/children';\nimport { shouldLinkExternally } from '../utils/url';\n\nconst isPad = Platform.OS === 'ios' && Platform.isPad;\n\ninterface LinkWithPreviewProps extends LinkProps {\n hrefForPreviewNavigation: Href;\n}\n\nexport function LinkWithPreview({ children, ...rest }: LinkWithPreviewProps) {\n const router = useRouter();\n const { setOpenPreviewKey } = useLinkPreviewContext();\n const [isCurrentPreviewOpen, setIsCurrenPreviewOpen] = useState(false);\n\n const hrefWithoutQuery = resolveHref(rest.hrefForPreviewNavigation).split('?')[0];\n const prevHrefWithoutQuery = useRef(hrefWithoutQuery);\n\n useEffect(() => {\n if (isCurrentPreviewOpen) {\n if (prevHrefWithoutQuery.current !== hrefWithoutQuery) {\n throw new Error(\n 'Link does not support changing the href prop after the preview has been opened. Please ensure that the href prop is stable and does not change between renders.'\n );\n }\n } else {\n prevHrefWithoutQuery.current = hrefWithoutQuery;\n }\n }, [hrefWithoutQuery]);\n\n const [{ nextScreenId, tabPath }, prefetch] = useNextScreenId();\n\n useEffect(() => {\n if (rest.replace) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error('Using replace links with preview is not supported');\n } else {\n console.warn('Using replace links with preview is not supported');\n }\n }\n }, [rest.href, rest.replace]);\n\n const triggerElement = React.useMemo(\n () => getFirstChildOfType(children, LinkTrigger),\n [children]\n );\n const menuElement = React.useMemo(() => getFirstChildOfType(children, LinkMenu), [children]);\n const previewElement = React.useMemo(\n () => getFirstChildOfType(children, LinkPreview),\n [children]\n );\n\n if ((previewElement || menuElement) && !triggerElement) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error(\n 'When you use Link.Preview, you must use Link.Trigger to specify the trigger element.'\n );\n } else {\n console.warn(\n 'When you use Link.Preview, you must use Link.Trigger to specify the trigger element.'\n );\n }\n }\n\n const trigger = React.useMemo(\n () => triggerElement ?? <LinkTrigger>{children}</LinkTrigger>,\n [triggerElement, children]\n );\n\n const preview = React.useMemo(\n () => (shouldLinkExternally(String(rest.href)) || !previewElement ? null : previewElement),\n [previewElement, rest.href]\n );\n\n const isPreviewTapped = useRef(false);\n\n const tabPathValue = useMemo(\n () => ({\n path: tabPath,\n }),\n [tabPath]\n );\n\n const hasPreview = !!previewElement;\n\n if (rest.replace) {\n return <BaseExpoRouterLink children={children} {...rest} />;\n }\n\n return (\n <NativeLinkPreview\n nextScreenId={isPad ? undefined : nextScreenId}\n tabPath={isPad ? undefined : tabPathValue}\n onWillPreviewOpen={() => {\n if (hasPreview) {\n isPreviewTapped.current = false;\n prefetch(rest.href);\n setIsCurrenPreviewOpen(true);\n }\n }}\n onPreviewWillClose={() => {\n if (hasPreview) {\n setIsCurrenPreviewOpen(false);\n // When preview was not tapped, then we need to enable the screen stack animation\n // Otherwise this will happen in StackNavigator, when new screen is opened\n if (!isPreviewTapped.current || isPad) {\n setOpenPreviewKey(undefined);\n }\n }\n }}\n onPreviewDidClose={() => {\n if (hasPreview && isPreviewTapped.current && isPad) {\n router.navigate(rest.href, { __internal__PreviewKey: nextScreenId });\n }\n }}\n onPreviewTapped={() => {\n isPreviewTapped.current = true;\n if (!isPad) {\n router.navigate(rest.href, { __internal__PreviewKey: nextScreenId });\n }\n }}\n style={{ display: 'contents' }}\n disableForceFlatten>\n <NativeMenuContext value>\n <InternalLinkPreviewContext\n value={{\n isVisible: isCurrentPreviewOpen,\n href: rest.hrefForPreviewNavigation,\n }}>\n <BaseExpoRouterLink {...rest} children={trigger} ref={rest.ref} />\n {preview}\n {menuElement}\n </InternalLinkPreviewContext>\n </NativeMenuContext>\n </NativeLinkPreview>\n );\n}\n"]}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Renders the built-in `+not-found` screen for the root router's outer slot,
3
+ * used when no route in the app matches the URL at all.
4
+ *
5
+ * @hidden
6
+ */
7
+ export declare function RootUnmatched(): import("react/jsx-runtime").JSX.Element;
8
+ //# sourceMappingURL=RootUnmatched.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RootUnmatched.d.ts","sourceRoot":"","sources":["../../src/views/RootUnmatched.tsx"],"names":[],"mappings":"AAOA;;;;;GAKG;AACH,wBAAgB,aAAa,4CAO5B"}
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ 'use client';
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
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 () {
20
+ var ownKeys = function(o) {
21
+ ownKeys = Object.getOwnPropertyNames || function (o) {
22
+ var ar = [];
23
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
+ return ar;
25
+ };
26
+ return ownKeys(o);
27
+ };
28
+ return function (mod) {
29
+ if (mod && mod.__esModule) return mod;
30
+ var result = {};
31
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
+ __setModuleDefault(result, mod);
33
+ return result;
34
+ };
35
+ })();
36
+ Object.defineProperty(exports, "__esModule", { value: true });
37
+ exports.RootUnmatched = RootUnmatched;
38
+ const jsx_runtime_1 = require("react/jsx-runtime");
39
+ const react_1 = require("react");
40
+ const Unmatched_1 = require("./Unmatched");
41
+ const SplashScreen = __importStar(require("../utils/splash"));
42
+ /**
43
+ * Renders the built-in `+not-found` screen for the root router's outer slot,
44
+ * used when no route in the app matches the URL at all.
45
+ *
46
+ * @hidden
47
+ */
48
+ function RootUnmatched() {
49
+ // https://github.com/expo/expo/issues/47687
50
+ (0, react_1.useEffect)(() => {
51
+ SplashScreen.hideAsync();
52
+ }, []);
53
+ return (0, jsx_runtime_1.jsx)(Unmatched_1.Unmatched, {});
54
+ }
55
+ //# sourceMappingURL=RootUnmatched.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RootUnmatched.js","sourceRoot":"","sources":["../../src/views/RootUnmatched.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAab,sCAOC;;AAlBD,iCAAkC;AAElC,2CAAwC;AACxC,8DAAgD;AAEhD;;;;;GAKG;AACH,SAAgB,aAAa;IAC3B,4CAA4C;IAC5C,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,YAAY,CAAC,SAAS,EAAE,CAAC;IAC3B,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,uBAAC,qBAAS,KAAG,CAAC;AACvB,CAAC","sourcesContent":["'use client';\n\nimport { useEffect } from 'react';\n\nimport { Unmatched } from './Unmatched';\nimport * as SplashScreen from '../utils/splash';\n\n/**\n * Renders the built-in `+not-found` screen for the root router's outer slot,\n * used when no route in the app matches the URL at all.\n *\n * @hidden\n */\nexport function RootUnmatched() {\n // https://github.com/expo/expo/issues/47687\n useEffect(() => {\n SplashScreen.hideAsync();\n }, []);\n\n return <Unmatched />;\n}\n"]}
@@ -9,7 +9,7 @@
9
9
  "publication": {
10
10
  "groupId": "expo.modules.router",
11
11
  "artifactId": "expo.modules.router",
12
- "version": "56.2.18",
12
+ "version": "56.2.19",
13
13
  "repository": "local-maven-repo"
14
14
  }
15
15
  }
@@ -116,6 +116,7 @@ class NativeLinkPreviewView: RouterViewWithLogger, UIContextMenuInteractionDeleg
116
116
  _ interaction: UIContextMenuInteraction,
117
117
  configurationForMenuAtLocation location: CGPoint
118
118
  ) -> UIContextMenuConfiguration? {
119
+ cancelReactNativeTouches()
119
120
  onWillPreviewOpen()
120
121
  return UIContextMenuConfiguration(
121
122
  identifier: nil,
@@ -185,6 +186,28 @@ class NativeLinkPreviewView: RouterViewWithLogger, UIContextMenuInteractionDeleg
185
186
  }
186
187
  }
187
188
 
189
+ // A press released before the menu fully presents is still recognized as a tap by
190
+ // react-native, so cancel in-flight touches on the nearest surface when the interaction
191
+ // starts. Unlike rnscreens_cancelTouches, `reset` is omitted deliberately: the press is
192
+ // still active and UIKit delivers touchesCancelled after this returns — resetting first
193
+ // desyncs the touch registry (NSAssert in -[RCTSurfaceTouchHandler _updateTouches:]).
194
+ private func cancelReactNativeTouches() {
195
+ guard let touchHandlerClass = NSClassFromString("RCTSurfaceTouchHandler") else {
196
+ return
197
+ }
198
+ var view: UIView? = self
199
+ while let current = view {
200
+ if let recognizer = current.gestureRecognizers?.first(where: { $0.isKind(of: touchHandlerClass) }) {
201
+ if recognizer.isEnabled {
202
+ recognizer.isEnabled = false
203
+ recognizer.isEnabled = true
204
+ }
205
+ return
206
+ }
207
+ view = current.superview
208
+ }
209
+ }
210
+
188
211
  // MARK: - Context Menu Helpers
189
212
 
190
213
  private func createPreviewViewController() -> UIViewController? {
@@ -3,7 +3,7 @@
3
3
  "component": {
4
4
  "group": "expo.modules.router",
5
5
  "module": "expo.modules.router",
6
- "version": "56.2.18",
6
+ "version": "56.2.19",
7
7
  "attributes": {
8
8
  "org.gradle.status": "release"
9
9
  }
@@ -24,8 +24,8 @@
24
24
  },
25
25
  "files": [
26
26
  {
27
- "name": "expo.modules.router-56.2.18.aar",
28
- "url": "expo.modules.router-56.2.18.aar",
27
+ "name": "expo.modules.router-56.2.19.aar",
28
+ "url": "expo.modules.router-56.2.19.aar",
29
29
  "size": 15835,
30
30
  "sha512": "72b5be73401c4b0a8807373f01bd79e202212f07713d071019c24eb27227a4c8568d6148d0a48338f6955f9dbe713f56e7877d8e3fe0acec28dbb68533953d90",
31
31
  "sha256": "7c41d508ab24d199ead0eb06525957cdd227a73925863865bf2956d48cb707ef",
@@ -74,8 +74,8 @@
74
74
  ],
75
75
  "files": [
76
76
  {
77
- "name": "expo.modules.router-56.2.18.aar",
78
- "url": "expo.modules.router-56.2.18.aar",
77
+ "name": "expo.modules.router-56.2.19.aar",
78
+ "url": "expo.modules.router-56.2.19.aar",
79
79
  "size": 15835,
80
80
  "sha512": "72b5be73401c4b0a8807373f01bd79e202212f07713d071019c24eb27227a4c8568d6148d0a48338f6955f9dbe713f56e7877d8e3fe0acec28dbb68533953d90",
81
81
  "sha256": "7c41d508ab24d199ead0eb06525957cdd227a73925863865bf2956d48cb707ef",
@@ -94,8 +94,8 @@
94
94
  },
95
95
  "files": [
96
96
  {
97
- "name": "expo.modules.router-56.2.18-sources.jar",
98
- "url": "expo.modules.router-56.2.18-sources.jar",
97
+ "name": "expo.modules.router-56.2.19-sources.jar",
98
+ "url": "expo.modules.router-56.2.19-sources.jar",
99
99
  "size": 2326,
100
100
  "sha512": "a1a1537b57bc0d66efbf2bdfd5f514684400b9598e549eaf53c528d1bf32ff42b7826e74fb6e115f8ec0490b9e06ffbb3c3efe9f2f703652c13291ef82b0fa03",
101
101
  "sha256": "2add0f802e663eb9b5f90e086dca0e0e337a1442e15fb372a05945e01ee0d289",
@@ -0,0 +1 @@
1
+ 97d032f3e2e77fbbd81ba81d659c85a7ee6611a4df731ceca0aaa685f81a318f
@@ -0,0 +1 @@
1
+ 2923a86597793024b982a64e85da27bd1883270b1a3960264a2aaae76cc6ddb4d1fe3b91822cd91b4c8b80d155b43302275b64e2b2d3dd41b874c55d8995599f
@@ -9,7 +9,7 @@
9
9
  <modelVersion>4.0.0</modelVersion>
10
10
  <groupId>expo.modules.router</groupId>
11
11
  <artifactId>expo.modules.router</artifactId>
12
- <version>56.2.18</version>
12
+ <version>56.2.19</version>
13
13
  <packaging>aar</packaging>
14
14
  <name>expo.modules.router</name>
15
15
  <url>https://github.com/expo/expo</url>
@@ -0,0 +1 @@
1
+ be1b52043d1e162f22275c491f86220de4598ed019826922267450dabf1db08d
@@ -0,0 +1 @@
1
+ 76be8c00ce8c2e73792c465ea572207bd9f54b40417066b7e2e5a63d38f8e3c3c91af9fdf102db17c16e37966989b60dd4ef1054f61b0a8720fe8acc7f5311cd
@@ -3,11 +3,11 @@
3
3
  <groupId>expo.modules.router</groupId>
4
4
  <artifactId>expo.modules.router</artifactId>
5
5
  <versioning>
6
- <latest>56.2.18</latest>
7
- <release>56.2.18</release>
6
+ <latest>56.2.19</latest>
7
+ <release>56.2.19</release>
8
8
  <versions>
9
- <version>56.2.18</version>
9
+ <version>56.2.19</version>
10
10
  </versions>
11
- <lastUpdated>20260806114056</lastUpdated>
11
+ <lastUpdated>20260817112413</lastUpdated>
12
12
  </versioning>
13
13
  </metadata>
@@ -1 +1 @@
1
- e5f067564130883c6707918a5deb99c2
1
+ 055e8dd22e69887e886b962d2ea0dbe2
@@ -1 +1 @@
1
- c878b54668c0f5f06845a2aea0f48031cbfa6b19
1
+ 83aef348292d61f8adac48083f4d928a54a7c8b0
@@ -1 +1 @@
1
- 2ae8723bcf094c541e536b1a141aeadb1c0e6ab5c28dc30eb510561e7a9e056a
1
+ ff7fa8cf60845dc61648bb6b52e6178d8d76ddee42af757f12db42db3fb59322
@@ -1 +1 @@
1
- bc17a31ea6866b31fc71b935206d67d766ba9dde6ae328936322deb461e447c4220a74ffcfb81ec03bff0c63e5c3d1a921b2d24242facc551adba16b531bfdeb
1
+ c2a9f6e16be7b858b34cd436c62a6e57e19943aa7cfc75f493edbce76d8b33d42b95e10a1d1c33ae5a7a0bf16b4e1e906d742548e28ea19341bc82ffcec450e6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-router",
3
- "version": "56.2.18",
3
+ "version": "56.2.19",
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",
@@ -79,11 +79,11 @@
79
79
  ],
80
80
  "peerDependencies": {
81
81
  "@expo/log-box": "^56.0.14",
82
- "@expo/metro-runtime": "^56.0.19",
82
+ "@expo/metro-runtime": "^56.0.20",
83
83
  "@testing-library/react-native": ">= 13.2.0",
84
84
  "expo": "*",
85
- "expo-constants": "^56.0.23",
86
- "expo-linking": "^56.0.16",
85
+ "expo-constants": "^56.0.24",
86
+ "expo-linking": "^56.0.17",
87
87
  "react": "*",
88
88
  "react-dom": "*",
89
89
  "react-native": "*",
@@ -136,13 +136,13 @@
136
136
  "react-native-web": "~0.21.0",
137
137
  "react-server-dom-webpack": "~19.0.6",
138
138
  "tsd": "^0.33.0",
139
- "expo": "56.0.19"
139
+ "expo": "56.0.20"
140
140
  },
141
141
  "dependencies": {
142
142
  "@expo/log-box": "^56.0.14",
143
- "@expo/metro-runtime": "^56.0.19",
143
+ "@expo/metro-runtime": "^56.0.20",
144
144
  "@expo/schema-utils": "^56.0.2",
145
- "@expo/ui": "^56.0.25",
145
+ "@expo/ui": "^56.0.26",
146
146
  "@radix-ui/react-slot": "^1.2.0",
147
147
  "@radix-ui/react-tabs": "^1.1.12",
148
148
  "@react-native-masked-view/masked-view": "^0.3.2",
@@ -153,7 +153,7 @@
153
153
  "debug": "^4.3.4",
154
154
  "escape-string-regexp": "^4.0.0",
155
155
  "expo-glass-effect": "^56.0.4",
156
- "expo-server": "^56.0.5",
156
+ "expo-server": "^56.0.6",
157
157
  "expo-symbols": "^56.0.7",
158
158
  "fast-deep-equal": "^3.1.3",
159
159
  "invariant": "^2.2.4",
@@ -169,7 +169,7 @@
169
169
  "standard-navigation": "^0.0.5",
170
170
  "vaul": "^1.1.2"
171
171
  },
172
- "gitHead": "eebecc21d8d868d97e72bd61bb8e668fb2feb704",
172
+ "gitHead": "39f9dc47fb5ddd099a2533dd0ff24be7126a1ed0",
173
173
  "scripts": {
174
174
  "build": "node ./scripts/build.js",
175
175
  "clean": "expo-module clean",
@@ -1 +0,0 @@
1
- 8d9c322735243fbdb0dac51680cc6c8be76ea46b5cd0f162f9efead6ff82319f
@@ -1 +0,0 @@
1
- c35176b3c38877fd60d20591ad8b6ed5cdbe9fb6c4e1ac1957ce217d33689a946b7cba80b4d6844bcfc2937a1d77c872e6f38ab8163a1a5618a43a61c1791f51
@@ -1 +0,0 @@
1
- 0192798df80ed32150cb25b8809add9afce63d8a277ab50a7eb85f04062c02ad
@@ -1 +0,0 @@
1
- 14f9b0824ca5fa4ccd6ef930ea24c98430df8c7a87b6681b0b8ecd53592399f8167a20f43432f853849f1de8b48016a16894f31904fff96216676c5b0bdf64e5