expo-router 7.0.0-canary-20251206-615dec1 → 7.0.0-canary-20251210-1f163e3

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 (96) hide show
  1. package/android/build.gradle +2 -2
  2. package/build/ExpoRoot.d.ts.map +1 -1
  3. package/build/ExpoRoot.js +2 -1
  4. package/build/ExpoRoot.js.map +1 -1
  5. package/build/color/android.dynamic.types.d.ts +3 -3
  6. package/build/color/android.dynamic.types.js.map +1 -1
  7. package/build/color/android.material.types.d.ts +3 -3
  8. package/build/color/android.material.types.js.map +1 -1
  9. package/build/fork/getPathFromState.d.ts.map +1 -1
  10. package/build/fork/getPathFromState.js +2 -1
  11. package/build/fork/getPathFromState.js.map +1 -1
  12. package/build/fork/getStateFromPath-forks.d.ts.map +1 -1
  13. package/build/fork/getStateFromPath-forks.js +3 -7
  14. package/build/fork/getStateFromPath-forks.js.map +1 -1
  15. package/build/link/Link.d.ts +2 -0
  16. package/build/link/Link.d.ts.map +1 -1
  17. package/build/link/Link.js +2 -0
  18. package/build/link/Link.js.map +1 -1
  19. package/build/link/elements.d.ts +15 -4
  20. package/build/link/elements.d.ts.map +1 -1
  21. package/build/link/elements.js +7 -2
  22. package/build/link/elements.js.map +1 -1
  23. package/build/link/preview/native.d.ts +5 -1
  24. package/build/link/preview/native.d.ts.map +1 -1
  25. package/build/link/preview/native.js +12 -1
  26. package/build/link/preview/native.js.map +1 -1
  27. package/build/link/useLinkHooks.d.ts +1 -1
  28. package/build/link/zoom/link-apple-zoom-target.d.ts +3 -0
  29. package/build/link/zoom/link-apple-zoom-target.d.ts.map +1 -0
  30. package/build/link/zoom/link-apple-zoom-target.js +20 -0
  31. package/build/link/zoom/link-apple-zoom-target.js.map +1 -0
  32. package/build/link/zoom/useZoomTransitionPrimitives.ios.d.ts.map +1 -1
  33. package/build/link/zoom/useZoomTransitionPrimitives.ios.js +4 -1
  34. package/build/link/zoom/useZoomTransitionPrimitives.ios.js.map +1 -1
  35. package/build/link/zoom/zoom-transition-context.d.ts +7 -0
  36. package/build/link/zoom/zoom-transition-context.d.ts.map +1 -1
  37. package/build/link/zoom/zoom-transition-context.js +32 -1
  38. package/build/link/zoom/zoom-transition-context.js.map +1 -1
  39. package/build/loaders/utils.d.ts.map +1 -1
  40. package/build/loaders/utils.js +2 -1
  41. package/build/loaders/utils.js.map +1 -1
  42. package/build/native-tabs/NativeTabTrigger.d.ts +1 -1
  43. package/build/native-tabs/NativeTabTrigger.d.ts.map +1 -1
  44. package/build/native-tabs/NativeTabTrigger.js +5 -6
  45. package/build/native-tabs/NativeTabTrigger.js.map +1 -1
  46. package/build/native-tabs/NativeTabsView.web.js +1 -1
  47. package/build/native-tabs/NativeTabsView.web.js.map +1 -1
  48. package/build/typed-routes/types.d.ts +4 -1
  49. package/build/typed-routes/types.d.ts.map +1 -1
  50. package/build/typed-routes/types.js.map +1 -1
  51. package/build/useScreens.d.ts.map +1 -1
  52. package/build/useScreens.js +6 -3
  53. package/build/useScreens.js.map +1 -1
  54. package/build/utils/url.d.ts +1 -0
  55. package/build/utils/url.d.ts.map +1 -1
  56. package/build/utils/url.js +9 -0
  57. package/build/utils/url.js.map +1 -1
  58. package/expo-module.config.json +1 -1
  59. package/ios/LinkPreview/LinkPreviewNativeActionView.swift +1 -1
  60. package/ios/LinkPreview/LinkPreviewNativeModule.swift +11 -0
  61. package/ios/LinkPreview/LinkZoomTransition.swift +126 -15
  62. package/ios/Toolbar/RouterToolbarHostView.swift +5 -1
  63. package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251206-615dec1/expo.modules.router-7.0.0-canary-20251206-615dec1.module → 7.0.0-canary-20251210-1f163e3/expo.modules.router-7.0.0-canary-20251210-1f163e3.module} +7 -7
  64. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251210-1f163e3/expo.modules.router-7.0.0-canary-20251210-1f163e3.module.md5 +1 -0
  65. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251210-1f163e3/expo.modules.router-7.0.0-canary-20251210-1f163e3.module.sha1 +1 -0
  66. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251210-1f163e3/expo.modules.router-7.0.0-canary-20251210-1f163e3.module.sha256 +1 -0
  67. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251210-1f163e3/expo.modules.router-7.0.0-canary-20251210-1f163e3.module.sha512 +1 -0
  68. package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251206-615dec1/expo.modules.router-7.0.0-canary-20251206-615dec1.pom → 7.0.0-canary-20251210-1f163e3/expo.modules.router-7.0.0-canary-20251210-1f163e3.pom} +1 -1
  69. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251210-1f163e3/expo.modules.router-7.0.0-canary-20251210-1f163e3.pom.md5 +1 -0
  70. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251210-1f163e3/expo.modules.router-7.0.0-canary-20251210-1f163e3.pom.sha1 +1 -0
  71. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251210-1f163e3/expo.modules.router-7.0.0-canary-20251210-1f163e3.pom.sha256 +1 -0
  72. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251210-1f163e3/expo.modules.router-7.0.0-canary-20251210-1f163e3.pom.sha512 +1 -0
  73. package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml +4 -4
  74. package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml.md5 +1 -1
  75. package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml.sha1 +1 -1
  76. package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml.sha256 +1 -1
  77. package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml.sha512 +1 -1
  78. package/package.json +10 -10
  79. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251206-615dec1/expo.modules.router-7.0.0-canary-20251206-615dec1.module.md5 +0 -1
  80. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251206-615dec1/expo.modules.router-7.0.0-canary-20251206-615dec1.module.sha1 +0 -1
  81. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251206-615dec1/expo.modules.router-7.0.0-canary-20251206-615dec1.module.sha256 +0 -1
  82. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251206-615dec1/expo.modules.router-7.0.0-canary-20251206-615dec1.module.sha512 +0 -1
  83. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251206-615dec1/expo.modules.router-7.0.0-canary-20251206-615dec1.pom.md5 +0 -1
  84. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251206-615dec1/expo.modules.router-7.0.0-canary-20251206-615dec1.pom.sha1 +0 -1
  85. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251206-615dec1/expo.modules.router-7.0.0-canary-20251206-615dec1.pom.sha256 +0 -1
  86. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251206-615dec1/expo.modules.router-7.0.0-canary-20251206-615dec1.pom.sha512 +0 -1
  87. /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251206-615dec1/expo.modules.router-7.0.0-canary-20251206-615dec1-sources.jar → 7.0.0-canary-20251210-1f163e3/expo.modules.router-7.0.0-canary-20251210-1f163e3-sources.jar} +0 -0
  88. /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251206-615dec1/expo.modules.router-7.0.0-canary-20251206-615dec1-sources.jar.md5 → 7.0.0-canary-20251210-1f163e3/expo.modules.router-7.0.0-canary-20251210-1f163e3-sources.jar.md5} +0 -0
  89. /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251206-615dec1/expo.modules.router-7.0.0-canary-20251206-615dec1-sources.jar.sha1 → 7.0.0-canary-20251210-1f163e3/expo.modules.router-7.0.0-canary-20251210-1f163e3-sources.jar.sha1} +0 -0
  90. /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251206-615dec1/expo.modules.router-7.0.0-canary-20251206-615dec1-sources.jar.sha256 → 7.0.0-canary-20251210-1f163e3/expo.modules.router-7.0.0-canary-20251210-1f163e3-sources.jar.sha256} +0 -0
  91. /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251206-615dec1/expo.modules.router-7.0.0-canary-20251206-615dec1-sources.jar.sha512 → 7.0.0-canary-20251210-1f163e3/expo.modules.router-7.0.0-canary-20251210-1f163e3-sources.jar.sha512} +0 -0
  92. /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251206-615dec1/expo.modules.router-7.0.0-canary-20251206-615dec1.aar → 7.0.0-canary-20251210-1f163e3/expo.modules.router-7.0.0-canary-20251210-1f163e3.aar} +0 -0
  93. /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251206-615dec1/expo.modules.router-7.0.0-canary-20251206-615dec1.aar.md5 → 7.0.0-canary-20251210-1f163e3/expo.modules.router-7.0.0-canary-20251210-1f163e3.aar.md5} +0 -0
  94. /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251206-615dec1/expo.modules.router-7.0.0-canary-20251206-615dec1.aar.sha1 → 7.0.0-canary-20251210-1f163e3/expo.modules.router-7.0.0-canary-20251210-1f163e3.aar.sha1} +0 -0
  95. /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251206-615dec1/expo.modules.router-7.0.0-canary-20251206-615dec1.aar.sha256 → 7.0.0-canary-20251210-1f163e3/expo.modules.router-7.0.0-canary-20251210-1f163e3.aar.sha256} +0 -0
  96. /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251206-615dec1/expo.modules.router-7.0.0-canary-20251206-615dec1.aar.sha512 → 7.0.0-canary-20251210-1f163e3/expo.modules.router-7.0.0-canary-20251210-1f163e3.aar.sha512} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"getStateFromPath-forks.js","sourceRoot":"","sources":["../../src/fork/getStateFromPath-forks.ts"],"names":[],"mappings":";;;;;AA2BA,wCAQC;AAED,4DAMC;AASD,oFA8BC;AAED,oCAiDC;AAED,sCAIC;AAED,oCAIC;AAED,sCAEC;AAED,kCAEC;AAED,sCAOC;AAwBD,0CAsBC;AAED,kEAKC;AAED,oCAUC;AAED,8CAgCC;AAED,0CAWC;AAQD,oDA4JC;AAED,4CAgCC;AAED,8BAUC;AAED,kDAeC;AApfD,gFAA0C;AAI1C,0CAAyE;AAiBzE;;;;GAIG;AACH,SAAgB,cAAc,CAAC,MAAsB,EAAE,MAA4B;IACjF,IAAI,CAAC,MAAM,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO;IAEnE,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;IACnC,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,SAAgB,wBAAwB,CAAC,GAAW;IAClD,IAAI,CAAC;QACH,OAAO,kBAAkB,CAAC,GAAG,CAAC,CAAC;IACjC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,GAAG,CAAC;IACb,CAAC;AACH,CAAC;AASD,SAAgB,oCAAoC,CAClD,IAAY,EACZ,UAA8B,OAAO,CAAC,GAAG,CAAC,aAAa;IAEvD,MAAM,iBAAiB,GAAG,IAAA,qCAA0B,EAAC,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC;IAElF,IAAI,QAAQ,GAAG,EAAE,CAAC;IAClB,IAAI,IAAI,GAAG,EAAE,CAAC;IACd,IAAI,CAAC;QACH,mFAAmF;QACnF,yGAAyG;QACzG,mHAAmH;QACnH,gHAAgH;Q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SAAgB,mBAAmB,CAAC,OAAe;IACjD,OAAO,IAAI,MAAM,CACf,KAAK,OAAO;SACT,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE;QACV,IAAI,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;YAC3C,OAAO,GAAG,EAAE,GAAG,CAAC;QAClB,CAAC;aAAM,IAAI,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YAC9B,OAAO,cAAc,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC;QACtD,CAAC;QAED,OAAO,GAAG,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAA,8BAAM,EAAC,EAAE,CAAC,KAAK,CAAC;IAChD,CAAC,CAAC;SACD,IAAI,CAAC,EAAE,CAAC,GAAG,CACf,CAAC;AACJ,CAAC","sourcesContent":["import { InitialState } from '@react-navigation/native';\nimport escape from 'escape-string-regexp';\nimport * as queryString from 'query-string';\n\nimport type { InitialRouteConfig, Options, ParsedRoute, RouteConfig } from './getStateFromPath';\nimport { matchGroupName, stripGroupSegmentsFromPath } from '../matchers';\n\nexport type ExpoOptions = {\n previousSegments?: string[];\n};\n\nexport type ExpoRouteConfig = {\n type: 'static' | 'dynamic' | 'layout';\n userReadableName: string;\n isIndex: boolean;\n isInitial?: boolean;\n hasChildren: boolean;\n expandedRouteNames: string[];\n parts: string[];\n staticPartCount: number;\n};\n\n/**\n * In Expo Router, the params are available at all levels of the routing config\n * @param routes\n * @returns\n */\nexport function populateParams(routes?: ParsedRoute[], params?: Record<string, any>) {\n if (!routes || !params || Object.keys(params).length === 0) return;\n\n for (const route of routes) {\n Object.assign(route, { params });\n }\n\n return routes;\n}\n\nexport function safelyDecodeURIComponent(str: string) {\n try {\n return decodeURIComponent(str);\n } catch {\n return str;\n }\n}\n\ninterface UrlWithReactNavigationConcessions {\n path: string;\n nonstandardPathname: string;\n hash: string;\n pathWithoutGroups: string;\n}\n\nexport function getUrlWithReactNavigationConcessions(\n path: string,\n baseUrl: string | undefined = process.env.EXPO_BASE_URL\n): UrlWithReactNavigationConcessions {\n const pathWithoutGroups = stripGroupSegmentsFromPath(stripBaseUrl(path, baseUrl));\n\n let pathname = '';\n let hash = '';\n try {\n // NOTE(@kitten): This used to use a dummy base URL for parsing (phony [.] example)\n // However, this seems to get flagged since it's preserved 1:1 in the output bytecode by certain scanners\n // Instead, we use an empty `file:` URL. This will still perform `pathname` normalization, search parameter parsing\n // encoding, and all other logic, except the logic that applies to hostnames and protocols, and also not leave a\n // dummy URL in the output bytecode\n const parsed = new URL(path, 'file:');\n pathname = parsed.pathname;\n hash = parsed.hash;\n } catch {\n // Do nothing with invalid URLs.\n }\n\n const withoutBaseUrl = stripBaseUrl(pathname, baseUrl);\n return {\n path,\n // Make sure there is a trailing slash\n // The slashes are at the end, not the beginning\n nonstandardPathname: withoutBaseUrl.replace(/^\\/+/g, '').replace(/\\/+$/g, '') + '/',\n hash,\n pathWithoutGroups,\n };\n}\n\nexport function createConfig(\n screen: string,\n pattern: string,\n routeNames: string[],\n config: Record<string, any> = {}\n): Omit<ExpoRouteConfig, 'isInitial'> {\n const parts: string[] = [];\n let isDynamic = false;\n const isIndex = screen === 'index' || screen.endsWith('/index');\n let staticPartCount = 0;\n\n for (const part of pattern.split('/')) {\n if (part) {\n // If any part is dynamic, then the route is dynamic\n const isDynamicPart =\n part.startsWith(':') || part.startsWith('*') || part.includes('*not-found');\n\n isDynamic ||= isDynamicPart;\n\n if (!matchGroupName(part)) {\n parts.push(part);\n\n if (!isDynamicPart) {\n staticPartCount++;\n }\n }\n }\n }\n\n const hasChildren = config.screens ? !!Object.keys(config.screens)?.length : false;\n const type = hasChildren ? 'layout' : isDynamic ? 'dynamic' : 'static';\n\n if (isIndex) {\n parts.push('index');\n staticPartCount++;\n }\n\n return {\n type,\n isIndex,\n hasChildren,\n parts,\n staticPartCount,\n userReadableName: [...routeNames.slice(0, -1), config.path || screen].join('/'),\n // Don't include the __root route name\n expandedRouteNames: routeNames.slice(1).flatMap((name) => {\n return name.split('/');\n }),\n };\n}\n\nexport function assertScreens(options?: Options<object>): asserts options is Options<object> {\n if (!options?.screens) {\n throw Error(\"You must pass a 'screens' object to 'getStateFromPath' to generate a path.\");\n }\n}\n\nexport function configRegExp(config: RouteConfig) {\n return config.pattern\n ? new RegExp(`^(${config.pattern.split('/').map(formatRegexPattern).join('')})$`)\n : undefined;\n}\n\nexport function isDynamicPart(p: string) {\n return p.length > 1 && (p.startsWith(':') || p.startsWith('*'));\n}\n\nexport function replacePart(p: string) {\n return p.replace(/^[:*]/, '').replace(/\\?$/, '');\n}\n\nexport function getParamValue(p: string, value: string) {\n if (p.startsWith('*')) {\n const values = value.split('/').filter((v) => v !== '');\n return values.length === 0 && p.endsWith('?') ? undefined : values;\n } else {\n return value;\n }\n}\n\nfunction formatRegexPattern(it: string): string {\n // Allow spaces in file path names.\n it = it.replace(' ', '%20');\n\n if (it.startsWith(':')) {\n // TODO: Remove unused match group\n return `(([^/]+\\\\/)${it.endsWith('?') ? '?' : ''})`;\n } else if (it.startsWith('*')) {\n return `((.*\\\\/)${it.endsWith('?') ? '?' : ''})`;\n }\n\n // Strip groups from the matcher\n if (matchGroupName(it) != null) {\n // Groups are optional segments\n // this enables us to match `/bar` and `/(foo)/bar` for the same route\n // NOTE(EvanBacon): Ignore this match in the regex to avoid capturing the group\n return `(?:${escape(it)}\\\\/)?`;\n }\n\n return escape(it) + `\\\\/`;\n}\n\nexport function handleUrlParams(route: ParsedRoute, params?: queryString.ParsedQuery) {\n if (params) {\n route.params = Object.assign(Object.create(null), route.params) as Record<string, any>;\n for (const [name, value] of Object.entries(params)) {\n if (route.params?.[name]) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn(\n `Route '/${route.name}' with param '${name}' was specified both in the path and as a param, removing from path`\n );\n }\n }\n\n if (!route.params?.[name]) {\n route.params[name] = value;\n continue;\n }\n }\n\n if (Object.keys(route.params).length === 0) {\n delete route.params;\n }\n }\n}\n\nexport function spreadParamsAcrossAllStates(state: InitialState, params?: Record<string, any>) {\n while (state) {\n const route = state.routes[0];\n (route as any).params = Object.assign({}, route.params, params);\n }\n}\n\nexport function stripBaseUrl(\n path: string,\n baseUrl: string | undefined = process.env.EXPO_BASE_URL\n) {\n if (process.env.NODE_ENV !== 'development') {\n if (baseUrl) {\n return path.replace(/^\\/+/g, '/').replace(new RegExp(`^\\\\/?${escape(baseUrl)}`, 'g'), '');\n }\n }\n return path;\n}\n\nexport function matchForEmptyPath(configs: RouteConfig[]) {\n // We need to add special handling of empty path so navigation to empty path also works\n // When handling empty path, we should only look at the root level config\n\n // NOTE(EvanBacon): We only care about matching leaf nodes.\n const leafNodes = configs\n .filter((config) => !config.hasChildren)\n .map((value) => {\n return {\n ...value,\n // Collapse all levels of group segments before testing.\n // This enables `app/(one)/(two)/index.js` to be matched.\n path: stripGroupSegmentsFromPath(value.path),\n };\n });\n\n const match =\n leafNodes.find(\n (config) =>\n // NOTE(EvanBacon): Test leaf node index routes that either don't have a regex or match an empty string.\n config.path === '' && (!config.regex || config.regex.test(''))\n ) ??\n leafNodes.find(\n (config) =>\n // NOTE(EvanBacon): Test leaf node dynamic routes that match an empty string.\n config.path.startsWith(':') && config.regex!.test('')\n ) ??\n // NOTE(EvanBacon): Test leaf node deep dynamic routes that match a slash.\n // This should be done last to enable dynamic routes having a higher priority.\n leafNodes.find((config) => config.path.startsWith('*') && config.regex!.test('/'));\n\n return match;\n}\n\nexport function appendIsInitial(initialRoutes: InitialRouteConfig[]) {\n const resolvedInitialPatterns = initialRoutes.map((route) =>\n joinPaths(...route.parentScreens, route.initialRouteName)\n );\n\n return function (config: RouteConfig) {\n // TODO(EvanBacon): Probably a safer way to do this\n // Mark initial routes to give them potential priority over other routes that match.\n config.isInitial = resolvedInitialPatterns.includes(config.routeNames.join('/'));\n return config;\n };\n}\n\nconst joinPaths = (...paths: string[]): string =>\n ([] as string[])\n .concat(...paths.map((p) => p.split('/')))\n .filter(Boolean)\n .join('/');\n\nexport function getRouteConfigSorter(previousSegments: string[] = []) {\n return function sortConfigs(a: RouteConfig, b: RouteConfig) {\n // Sort config so that:\n // - the most exhaustive ones are always at the beginning\n // - patterns with wildcard are always at the end\n\n // If 2 patterns are same, move the one with less route names up\n // This is an error state, so it's only useful for consistent error messages\n if (a.pattern === b.pattern) {\n return b.routeNames.join('>').localeCompare(a.routeNames.join('>'));\n }\n\n /*\n * If one of the patterns starts with the other, it is earlier in the config sorting.\n * However, configs are a mix of route configs and layout configs\n * e.g There will be a config for `/(group)`, but maybe there isn't a `/(group)/index.tsx`\n *\n * This is because you can navigate to a directory and its navigator will determine the route\n * These routes should be later in the config sorting, as their patterns are very open\n * and will prevent routes from being matched\n *\n * Therefore before we compare segment parts, we force these layout configs later in the sorting\n *\n * NOTE(marklawlor): Is this a feature we want? I'm unsure if this is a gimmick or a feature.\n */\n if (a.pattern.startsWith(b.pattern) && !b.isIndex) {\n return -1;\n }\n\n if (b.pattern.startsWith(a.pattern) && !a.isIndex) {\n return 1;\n }\n\n /*\n * Static routes should always be higher than dynamic and layout routes.\n */\n if (a.type === 'static' && b.type !== 'static') {\n return -1;\n } else if (a.type !== 'static' && b.type === 'static') {\n return 1;\n }\n\n /*\n * If the routes have any static segments, the one the most static segments should be higher\n */\n if (a.staticPartCount !== b.staticPartCount) {\n return b.staticPartCount - a.staticPartCount;\n }\n\n /*\n * If both are static/dynamic or a layout file, then we check group similarity\n */\n const similarToPreviousA = previousSegments.filter((value, index) => {\n return value === a.expandedRouteNames[index] && value.startsWith('(') && value.endsWith(')');\n });\n\n const similarToPreviousB = previousSegments.filter((value, index) => {\n return value === b.expandedRouteNames[index] && value.startsWith('(') && value.endsWith(')');\n });\n\n if (\n (similarToPreviousA.length > 0 || similarToPreviousB.length > 0) &&\n similarToPreviousA.length !== similarToPreviousB.length\n ) {\n // One matches more than the other, so pick the one that matches more\n return similarToPreviousB.length - similarToPreviousA.length;\n }\n\n /*\n * If there is not difference in similarity, then each non-group segment is compared against each other\n */\n for (let i = 0; i < Math.max(a.parts.length, b.parts.length); i++) {\n // if b is longer, b get higher priority\n if (a.parts[i] == null) {\n return 1;\n }\n // if a is longer, a get higher priority\n if (b.parts[i] == null) {\n return -1;\n }\n\n const aWildCard = a.parts[i].startsWith('*');\n const bWildCard = b.parts[i].startsWith('*');\n // if both are wildcard we compare next component\n if (aWildCard && bWildCard) {\n const aNotFound = a.parts[i].match(/^[*]not-found$/);\n const bNotFound = b.parts[i].match(/^[*]not-found$/);\n\n if (aNotFound && bNotFound) {\n continue;\n } else if (aNotFound) {\n return 1;\n } else if (bNotFound) {\n return -1;\n }\n continue;\n }\n // if only a is wild card, b get higher priority\n if (aWildCard) {\n return 1;\n }\n // if only b is wild card, a get higher priority\n if (bWildCard) {\n return -1;\n }\n\n const aSlug = a.parts[i].startsWith(':');\n const bSlug = b.parts[i].startsWith(':');\n // if both are wildcard we compare next component\n if (aSlug && bSlug) {\n const aNotFound = a.parts[i].match(/^[*]not-found$/);\n const bNotFound = b.parts[i].match(/^[*]not-found$/);\n\n if (aNotFound && bNotFound) {\n continue;\n } else if (aNotFound) {\n return 1;\n } else if (bNotFound) {\n return -1;\n }\n\n continue;\n }\n // if only a is wild card, b get higher priority\n if (aSlug) {\n return 1;\n }\n // if only b is wild card, a get higher priority\n if (bSlug) {\n return -1;\n }\n }\n\n /*\n * Both configs are identical in specificity and segments count/type\n * Try and sort by initial instead.\n *\n * TODO: We don't differentiate between the default initialRoute and group specific default routes\n *\n * const unstable_settings = {\n * \"group\": {\n * initialRouteName: \"article\"\n * }\n * }\n *\n * \"article\" will be ranked higher because its an initialRoute for a group - even if not your not currently in\n * that group. The current work around is to ways provide initialRouteName for all groups\n */\n if (a.isInitial && !b.isInitial) {\n return -1;\n } else if (!a.isInitial && b.isInitial) {\n return 1;\n }\n\n return b.parts.length - a.parts.length;\n };\n}\n\nexport function parseQueryParams(\n path: string,\n route: ParsedRoute,\n parseConfig?: Record<string, (value: string) => any>,\n hash?: string\n) {\n const searchParams = new URL(path, 'https://phony.example').searchParams;\n const params: Record<string, string | string[]> = Object.create(null);\n\n if (hash) {\n params['#'] = hash.slice(1);\n }\n\n for (const name of searchParams.keys()) {\n if (route.params?.[name]) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn(\n `Route '/${route.name}' with param '${name}' was specified both in the path and as a param, removing from path`\n );\n }\n } else {\n const values = parseConfig?.hasOwnProperty(name)\n ? searchParams.getAll(name).map((value) => parseConfig[name](value))\n : searchParams.getAll(name);\n\n // searchParams.getAll returns an array.\n // if we only have a single value, and its not an array param, we need to extract the value\n params[name] = values.length === 1 ? values[0] : values;\n }\n }\n\n return Object.keys(params).length ? params : undefined;\n}\n\nexport function cleanPath(path: string) {\n path = path\n // let remaining = path\n // END FORK\n .replace(/\\/+/g, '/') // Replace multiple slash (//) with single ones\n .replace(/^\\//, '') // Remove extra leading slash\n .replace(/\\?.*$/, ''); // Remove query params which we will handle later\n\n // Make sure there is a trailing slash\n return path.endsWith('/') ? path : `${path}/`;\n}\n\nexport function routePatternToRegex(pattern: string) {\n return new RegExp(\n `^(${pattern\n .split('/')\n .map((it) => {\n if (it.startsWith('(') && it.endsWith(')')) {\n return `${it}?`;\n } else if (it.startsWith(':')) {\n return `(([^/]+\\\\/)${it.endsWith('?') ? '?' : ''})`;\n }\n\n return `${it === '*' ? '.*' : escape(it)}\\\\/`;\n })\n .join('')})`\n );\n}\n"]}
1
+ {"version":3,"file":"getStateFromPath-forks.js","sourceRoot":"","sources":["../../src/fork/getStateFromPath-forks.ts"],"names":[],"mappings":";;;;;AA4BA,wCAQC;AAED,4DAMC;AASD,oFAyBC;AAED,oCAiDC;AAED,sCAIC;AAED,oCAIC;AAED,sCAEC;AAED,kCAEC;AAED,sCAOC;AAwBD,0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G,CAAC,EAAE,CAAC;YAC9B,OAAO,cAAc,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC;QACtD,CAAC;QAED,OAAO,GAAG,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAA,8BAAM,EAAC,EAAE,CAAC,KAAK,CAAC;IAChD,CAAC,CAAC;SACD,IAAI,CAAC,EAAE,CAAC,GAAG,CACf,CAAC;AACJ,CAAC","sourcesContent":["import { InitialState } from '@react-navigation/native';\nimport escape from 'escape-string-regexp';\nimport * as queryString from 'query-string';\n\nimport type { InitialRouteConfig, Options, ParsedRoute, RouteConfig } from './getStateFromPath';\nimport { matchGroupName, stripGroupSegmentsFromPath } from '../matchers';\nimport { parseUrlUsingCustomBase } from '../utils/url';\n\nexport type ExpoOptions = {\n previousSegments?: string[];\n};\n\nexport type ExpoRouteConfig = {\n type: 'static' | 'dynamic' | 'layout';\n userReadableName: string;\n isIndex: boolean;\n isInitial?: boolean;\n hasChildren: boolean;\n expandedRouteNames: string[];\n parts: string[];\n staticPartCount: number;\n};\n\n/**\n * In Expo Router, the params are available at all levels of the routing config\n * @param routes\n * @returns\n */\nexport function populateParams(routes?: ParsedRoute[], params?: Record<string, any>) {\n if (!routes || !params || Object.keys(params).length === 0) return;\n\n for (const route of routes) {\n Object.assign(route, { params });\n }\n\n return routes;\n}\n\nexport function safelyDecodeURIComponent(str: string) {\n try {\n return decodeURIComponent(str);\n } catch {\n return str;\n }\n}\n\ninterface UrlWithReactNavigationConcessions {\n path: string;\n nonstandardPathname: string;\n hash: string;\n pathWithoutGroups: string;\n}\n\nexport function getUrlWithReactNavigationConcessions(\n path: string,\n baseUrl: string | undefined = process.env.EXPO_BASE_URL\n): UrlWithReactNavigationConcessions {\n const pathWithoutGroups = stripGroupSegmentsFromPath(stripBaseUrl(path, baseUrl));\n\n let pathname = '';\n let hash = '';\n try {\n const parsed = parseUrlUsingCustomBase(path);\n pathname = parsed.pathname;\n hash = parsed.hash;\n } catch {\n // Do nothing with invalid URLs.\n }\n\n const withoutBaseUrl = stripBaseUrl(pathname, baseUrl);\n return {\n path,\n // Make sure there is a trailing slash\n // The slashes are at the end, not the beginning\n nonstandardPathname: withoutBaseUrl.replace(/^\\/+/g, '').replace(/\\/+$/g, '') + '/',\n hash,\n pathWithoutGroups,\n };\n}\n\nexport function createConfig(\n screen: string,\n pattern: string,\n routeNames: string[],\n config: Record<string, any> = {}\n): Omit<ExpoRouteConfig, 'isInitial'> {\n const parts: string[] = [];\n let isDynamic = false;\n const isIndex = screen === 'index' || screen.endsWith('/index');\n let staticPartCount = 0;\n\n for (const part of pattern.split('/')) {\n if (part) {\n // If any part is dynamic, then the route is dynamic\n const isDynamicPart =\n part.startsWith(':') || part.startsWith('*') || part.includes('*not-found');\n\n isDynamic ||= isDynamicPart;\n\n if (!matchGroupName(part)) {\n parts.push(part);\n\n if (!isDynamicPart) {\n staticPartCount++;\n }\n }\n }\n }\n\n const hasChildren = config.screens ? !!Object.keys(config.screens)?.length : false;\n const type = hasChildren ? 'layout' : isDynamic ? 'dynamic' : 'static';\n\n if (isIndex) {\n parts.push('index');\n staticPartCount++;\n }\n\n return {\n type,\n isIndex,\n hasChildren,\n parts,\n staticPartCount,\n userReadableName: [...routeNames.slice(0, -1), config.path || screen].join('/'),\n // Don't include the __root route name\n expandedRouteNames: routeNames.slice(1).flatMap((name) => {\n return name.split('/');\n }),\n };\n}\n\nexport function assertScreens(options?: Options<object>): asserts options is Options<object> {\n if (!options?.screens) {\n throw Error(\"You must pass a 'screens' object to 'getStateFromPath' to generate a path.\");\n }\n}\n\nexport function configRegExp(config: RouteConfig) {\n return config.pattern\n ? new RegExp(`^(${config.pattern.split('/').map(formatRegexPattern).join('')})$`)\n : undefined;\n}\n\nexport function isDynamicPart(p: string) {\n return p.length > 1 && (p.startsWith(':') || p.startsWith('*'));\n}\n\nexport function replacePart(p: string) {\n return p.replace(/^[:*]/, '').replace(/\\?$/, '');\n}\n\nexport function getParamValue(p: string, value: string) {\n if (p.startsWith('*')) {\n const values = value.split('/').filter((v) => v !== '');\n return values.length === 0 && p.endsWith('?') ? undefined : values;\n } else {\n return value;\n }\n}\n\nfunction formatRegexPattern(it: string): string {\n // Allow spaces in file path names.\n it = it.replace(' ', '%20');\n\n if (it.startsWith(':')) {\n // TODO: Remove unused match group\n return `(([^/]+\\\\/)${it.endsWith('?') ? '?' : ''})`;\n } else if (it.startsWith('*')) {\n return `((.*\\\\/)${it.endsWith('?') ? '?' : ''})`;\n }\n\n // Strip groups from the matcher\n if (matchGroupName(it) != null) {\n // Groups are optional segments\n // this enables us to match `/bar` and `/(foo)/bar` for the same route\n // NOTE(EvanBacon): Ignore this match in the regex to avoid capturing the group\n return `(?:${escape(it)}\\\\/)?`;\n }\n\n return escape(it) + `\\\\/`;\n}\n\nexport function handleUrlParams(route: ParsedRoute, params?: queryString.ParsedQuery) {\n if (params) {\n route.params = Object.assign(Object.create(null), route.params) as Record<string, any>;\n for (const [name, value] of Object.entries(params)) {\n if (route.params?.[name]) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn(\n `Route '/${route.name}' with param '${name}' was specified both in the path and as a param, removing from path`\n );\n }\n }\n\n if (!route.params?.[name]) {\n route.params[name] = value;\n continue;\n }\n }\n\n if (Object.keys(route.params).length === 0) {\n delete route.params;\n }\n }\n}\n\nexport function spreadParamsAcrossAllStates(state: InitialState, params?: Record<string, any>) {\n while (state) {\n const route = state.routes[0];\n (route as any).params = Object.assign({}, route.params, params);\n }\n}\n\nexport function stripBaseUrl(\n path: string,\n baseUrl: string | undefined = process.env.EXPO_BASE_URL\n) {\n if (process.env.NODE_ENV !== 'development') {\n if (baseUrl) {\n return path.replace(/^\\/+/g, '/').replace(new RegExp(`^\\\\/?${escape(baseUrl)}`, 'g'), '');\n }\n }\n return path;\n}\n\nexport function matchForEmptyPath(configs: RouteConfig[]) {\n // We need to add special handling of empty path so navigation to empty path also works\n // When handling empty path, we should only look at the root level config\n\n // NOTE(EvanBacon): We only care about matching leaf nodes.\n const leafNodes = configs\n .filter((config) => !config.hasChildren)\n .map((value) => {\n return {\n ...value,\n // Collapse all levels of group segments before testing.\n // This enables `app/(one)/(two)/index.js` to be matched.\n path: stripGroupSegmentsFromPath(value.path),\n };\n });\n\n const match =\n leafNodes.find(\n (config) =>\n // NOTE(EvanBacon): Test leaf node index routes that either don't have a regex or match an empty string.\n config.path === '' && (!config.regex || config.regex.test(''))\n ) ??\n leafNodes.find(\n (config) =>\n // NOTE(EvanBacon): Test leaf node dynamic routes that match an empty string.\n config.path.startsWith(':') && config.regex!.test('')\n ) ??\n // NOTE(EvanBacon): Test leaf node deep dynamic routes that match a slash.\n // This should be done last to enable dynamic routes having a higher priority.\n leafNodes.find((config) => config.path.startsWith('*') && config.regex!.test('/'));\n\n return match;\n}\n\nexport function appendIsInitial(initialRoutes: InitialRouteConfig[]) {\n const resolvedInitialPatterns = initialRoutes.map((route) =>\n joinPaths(...route.parentScreens, route.initialRouteName)\n );\n\n return function (config: RouteConfig) {\n // TODO(EvanBacon): Probably a safer way to do this\n // Mark initial routes to give them potential priority over other routes that match.\n config.isInitial = resolvedInitialPatterns.includes(config.routeNames.join('/'));\n return config;\n };\n}\n\nconst joinPaths = (...paths: string[]): string =>\n ([] as string[])\n .concat(...paths.map((p) => p.split('/')))\n .filter(Boolean)\n .join('/');\n\nexport function getRouteConfigSorter(previousSegments: string[] = []) {\n return function sortConfigs(a: RouteConfig, b: RouteConfig) {\n // Sort config so that:\n // - the most exhaustive ones are always at the beginning\n // - patterns with wildcard are always at the end\n\n // If 2 patterns are same, move the one with less route names up\n // This is an error state, so it's only useful for consistent error messages\n if (a.pattern === b.pattern) {\n return b.routeNames.join('>').localeCompare(a.routeNames.join('>'));\n }\n\n /*\n * If one of the patterns starts with the other, it is earlier in the config sorting.\n * However, configs are a mix of route configs and layout configs\n * e.g There will be a config for `/(group)`, but maybe there isn't a `/(group)/index.tsx`\n *\n * This is because you can navigate to a directory and its navigator will determine the route\n * These routes should be later in the config sorting, as their patterns are very open\n * and will prevent routes from being matched\n *\n * Therefore before we compare segment parts, we force these layout configs later in the sorting\n *\n * NOTE(marklawlor): Is this a feature we want? I'm unsure if this is a gimmick or a feature.\n */\n if (a.pattern.startsWith(b.pattern) && !b.isIndex) {\n return -1;\n }\n\n if (b.pattern.startsWith(a.pattern) && !a.isIndex) {\n return 1;\n }\n\n /*\n * Static routes should always be higher than dynamic and layout routes.\n */\n if (a.type === 'static' && b.type !== 'static') {\n return -1;\n } else if (a.type !== 'static' && b.type === 'static') {\n return 1;\n }\n\n /*\n * If the routes have any static segments, the one the most static segments should be higher\n */\n if (a.staticPartCount !== b.staticPartCount) {\n return b.staticPartCount - a.staticPartCount;\n }\n\n /*\n * If both are static/dynamic or a layout file, then we check group similarity\n */\n const similarToPreviousA = previousSegments.filter((value, index) => {\n return value === a.expandedRouteNames[index] && value.startsWith('(') && value.endsWith(')');\n });\n\n const similarToPreviousB = previousSegments.filter((value, index) => {\n return value === b.expandedRouteNames[index] && value.startsWith('(') && value.endsWith(')');\n });\n\n if (\n (similarToPreviousA.length > 0 || similarToPreviousB.length > 0) &&\n similarToPreviousA.length !== similarToPreviousB.length\n ) {\n // One matches more than the other, so pick the one that matches more\n return similarToPreviousB.length - similarToPreviousA.length;\n }\n\n /*\n * If there is not difference in similarity, then each non-group segment is compared against each other\n */\n for (let i = 0; i < Math.max(a.parts.length, b.parts.length); i++) {\n // if b is longer, b get higher priority\n if (a.parts[i] == null) {\n return 1;\n }\n // if a is longer, a get higher priority\n if (b.parts[i] == null) {\n return -1;\n }\n\n const aWildCard = a.parts[i].startsWith('*');\n const bWildCard = b.parts[i].startsWith('*');\n // if both are wildcard we compare next component\n if (aWildCard && bWildCard) {\n const aNotFound = a.parts[i].match(/^[*]not-found$/);\n const bNotFound = b.parts[i].match(/^[*]not-found$/);\n\n if (aNotFound && bNotFound) {\n continue;\n } else if (aNotFound) {\n return 1;\n } else if (bNotFound) {\n return -1;\n }\n continue;\n }\n // if only a is wild card, b get higher priority\n if (aWildCard) {\n return 1;\n }\n // if only b is wild card, a get higher priority\n if (bWildCard) {\n return -1;\n }\n\n const aSlug = a.parts[i].startsWith(':');\n const bSlug = b.parts[i].startsWith(':');\n // if both are wildcard we compare next component\n if (aSlug && bSlug) {\n const aNotFound = a.parts[i].match(/^[*]not-found$/);\n const bNotFound = b.parts[i].match(/^[*]not-found$/);\n\n if (aNotFound && bNotFound) {\n continue;\n } else if (aNotFound) {\n return 1;\n } else if (bNotFound) {\n return -1;\n }\n\n continue;\n }\n // if only a is wild card, b get higher priority\n if (aSlug) {\n return 1;\n }\n // if only b is wild card, a get higher priority\n if (bSlug) {\n return -1;\n }\n }\n\n /*\n * Both configs are identical in specificity and segments count/type\n * Try and sort by initial instead.\n *\n * TODO: We don't differentiate between the default initialRoute and group specific default routes\n *\n * const unstable_settings = {\n * \"group\": {\n * initialRouteName: \"article\"\n * }\n * }\n *\n * \"article\" will be ranked higher because its an initialRoute for a group - even if not your not currently in\n * that group. The current work around is to ways provide initialRouteName for all groups\n */\n if (a.isInitial && !b.isInitial) {\n return -1;\n } else if (!a.isInitial && b.isInitial) {\n return 1;\n }\n\n return b.parts.length - a.parts.length;\n };\n}\n\nexport function parseQueryParams(\n path: string,\n route: ParsedRoute,\n parseConfig?: Record<string, (value: string) => any>,\n hash?: string\n) {\n const searchParams = parseUrlUsingCustomBase(path).searchParams;\n const params: Record<string, string | string[]> = Object.create(null);\n\n if (hash) {\n params['#'] = hash.slice(1);\n }\n\n for (const name of searchParams.keys()) {\n if (route.params?.[name]) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn(\n `Route '/${route.name}' with param '${name}' was specified both in the path and as a param, removing from path`\n );\n }\n } else {\n const values = parseConfig?.hasOwnProperty(name)\n ? searchParams.getAll(name).map((value) => parseConfig[name](value))\n : searchParams.getAll(name);\n\n // searchParams.getAll returns an array.\n // if we only have a single value, and its not an array param, we need to extract the value\n params[name] = values.length === 1 ? values[0] : values;\n }\n }\n\n return Object.keys(params).length ? params : undefined;\n}\n\nexport function cleanPath(path: string) {\n path = path\n // let remaining = path\n // END FORK\n .replace(/\\/+/g, '/') // Replace multiple slash (//) with single ones\n .replace(/^\\//, '') // Remove extra leading slash\n .replace(/\\?.*$/, ''); // Remove query params which we will handle later\n\n // Make sure there is a trailing slash\n return path.endsWith('/') ? path : `${path}/`;\n}\n\nexport function routePatternToRegex(pattern: string) {\n return new RegExp(\n `^(${pattern\n .split('/')\n .map((it) => {\n if (it.startsWith('(') && it.endsWith(')')) {\n return `${it}?`;\n } else if (it.startsWith(':')) {\n return `(([^/]+\\\\/)${it.endsWith('?') ? '?' : ''})`;\n }\n\n return `${it === '*' ? '.*' : escape(it)}\\\\/`;\n })\n .join('')})`\n );\n}\n"]}
@@ -1,6 +1,7 @@
1
1
  import { LinkMenuAction, LinkPreview, LinkTrigger } from './elements';
2
2
  import type { LinkProps, WebAnchorProps } from './useLinkHooks';
3
3
  import { LinkAppleZoom } from './zoom/link-apple-zoom';
4
+ import { LinkAppleZoomTarget } from './zoom/link-apple-zoom-target';
4
5
  export declare const Link: ((props: LinkProps) => import("react").JSX.Element) & {
5
6
  resolveHref: (href: import("..").Href) => string;
6
7
  Menu: import("react").FC<import("./elements").LinkMenuProps>;
@@ -8,6 +9,7 @@ export declare const Link: ((props: LinkProps) => import("react").JSX.Element) &
8
9
  Preview: typeof LinkPreview;
9
10
  MenuAction: typeof LinkMenuAction;
10
11
  AppleZoom: typeof LinkAppleZoom;
12
+ AppleZoomTarget: typeof LinkAppleZoomTarget;
11
13
  };
12
14
  export type LinkComponent = typeof Link;
13
15
  export { LinkProps, WebAnchorProps };
@@ -1 +1 @@
1
- {"version":3,"file":"Link.d.ts","sourceRoot":"","sources":["../../src/link/Link.tsx"],"names":[],"mappings":"AACA,OAAO,EAAY,cAAc,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEhF,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD,eAAO,MAAM,IAAI,WA2BM,SAAS;;;;;;;CAY/B,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,OAAO,IAAI,CAAC;AAExC,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"Link.d.ts","sourceRoot":"","sources":["../../src/link/Link.tsx"],"names":[],"mappings":"AACA,OAAO,EAAY,cAAc,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEhF,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAEpE,eAAO,MAAM,IAAI,WA2BM,SAAS;;;;;;;;CAa/B,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,OAAO,IAAI,CAAC;AAExC,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC"}
@@ -5,6 +5,7 @@ const ExpoLink_1 = require("./ExpoLink");
5
5
  const elements_1 = require("./elements");
6
6
  const href_1 = require("./href");
7
7
  const link_apple_zoom_1 = require("./zoom/link-apple-zoom");
8
+ const link_apple_zoom_target_1 = require("./zoom/link-apple-zoom-target");
8
9
  exports.Link = Object.assign(
9
10
  /**
10
11
  * Component that renders a link using [`href`](#href) to another route.
@@ -42,6 +43,7 @@ function Link(props) {
42
43
  Preview: elements_1.LinkPreview,
43
44
  MenuAction: elements_1.LinkMenuAction,
44
45
  AppleZoom: link_apple_zoom_1.LinkAppleZoom,
46
+ AppleZoomTarget: link_apple_zoom_target_1.LinkAppleZoomTarget,
45
47
  });
46
48
  var Redirect_1 = require("./Redirect");
47
49
  Object.defineProperty(exports, "Redirect", { enumerable: true, get: function () { return Redirect_1.Redirect; } });
@@ -1 +1 @@
1
- {"version":3,"file":"Link.js","sourceRoot":"","sources":["../../src/link/Link.tsx"],"names":[],"mappings":";;;AAAA,yCAAsC;AACtC,yCAAgF;AAChF,iCAAqC;AAErC,4DAAuD;AAE1C,QAAA,IAAI,GAAG,MAAM,CAAC,MAAM;AAC/B;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,SAAS,IAAI,CAAC,KAAgB;IAC5B,8EAA8E;IAC9E,OAAO,CAAC,mBAAQ,CAAC,IAAI,KAAK,CAAC,EAAG,CAAC;AACjC,CAAC,EACD;IACE,WAAW,EAAX,kBAAW;IACX,IAAI,EAAE,mBAAQ;IACd,OAAO,EAAE,sBAAW;IACpB,OAAO,EAAE,sBAAW;IACpB,UAAU,EAAE,yBAAc;IAC1B,SAAS,EAAE,+BAAa;CACzB,CACF,CAAC;AAKF,uCAAqD;AAA5C,oGAAA,QAAQ,OAAA","sourcesContent":["import { ExpoLink } from './ExpoLink';\nimport { LinkMenu, LinkMenuAction, LinkPreview, LinkTrigger } from './elements';\nimport { resolveHref } from './href';\nimport type { LinkProps, WebAnchorProps } from './useLinkHooks';\nimport { LinkAppleZoom } from './zoom/link-apple-zoom';\n\nexport const Link = Object.assign(\n /**\n * Component that renders a link using [`href`](#href) to another route.\n * By default, it accepts children and wraps them in a `<Text>` component.\n *\n * Uses an anchor tag (`<a>`) on web and performs a client-side navigation to preserve\n * the state of the website and navigate faster. The web-only attributes such as `target`,\n * `rel`, and `download` are supported and passed to the anchor tag on web. See\n * [`WebAnchorProps`](#webanchorprops) for more details.\n *\n * > **Note**: Client-side navigation works with both single-page apps,\n * and [static-rendering](/router/reference/static-rendering/).\n *\n * @example\n * ```tsx\n * import { Link } from 'expo-router';\n * import { View } from 'react-native';\n *\n * export default function Route() {\n * return (\n * <View>\n * <Link href=\"/about\">About</Link>\n * </View>\n * );\n *}\n * ```\n */\n function Link(props: LinkProps) {\n // Re-exporting ExpoLink here so that Link.* can be used in server components.\n return <ExpoLink {...props} />;\n },\n {\n resolveHref,\n Menu: LinkMenu,\n Trigger: LinkTrigger,\n Preview: LinkPreview,\n MenuAction: LinkMenuAction,\n AppleZoom: LinkAppleZoom,\n }\n);\n\nexport type LinkComponent = typeof Link;\n\nexport { LinkProps, WebAnchorProps };\nexport { Redirect, RedirectProps } from './Redirect';\n"]}
1
+ {"version":3,"file":"Link.js","sourceRoot":"","sources":["../../src/link/Link.tsx"],"names":[],"mappings":";;;AAAA,yCAAsC;AACtC,yCAAgF;AAChF,iCAAqC;AAErC,4DAAuD;AACvD,0EAAoE;AAEvD,QAAA,IAAI,GAAG,MAAM,CAAC,MAAM;AAC/B;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,SAAS,IAAI,CAAC,KAAgB;IAC5B,8EAA8E;IAC9E,OAAO,CAAC,mBAAQ,CAAC,IAAI,KAAK,CAAC,EAAG,CAAC;AACjC,CAAC,EACD;IACE,WAAW,EAAX,kBAAW;IACX,IAAI,EAAE,mBAAQ;IACd,OAAO,EAAE,sBAAW;IACpB,OAAO,EAAE,sBAAW;IACpB,UAAU,EAAE,yBAAc;IAC1B,SAAS,EAAE,+BAAa;IACxB,eAAe,EAAE,4CAAmB;CACrC,CACF,CAAC;AAKF,uCAAqD;AAA5C,oGAAA,QAAQ,OAAA","sourcesContent":["import { ExpoLink } from './ExpoLink';\nimport { LinkMenu, LinkMenuAction, LinkPreview, LinkTrigger } from './elements';\nimport { resolveHref } from './href';\nimport type { LinkProps, WebAnchorProps } from './useLinkHooks';\nimport { LinkAppleZoom } from './zoom/link-apple-zoom';\nimport { LinkAppleZoomTarget } from './zoom/link-apple-zoom-target';\n\nexport const Link = Object.assign(\n /**\n * Component that renders a link using [`href`](#href) to another route.\n * By default, it accepts children and wraps them in a `<Text>` component.\n *\n * Uses an anchor tag (`<a>`) on web and performs a client-side navigation to preserve\n * the state of the website and navigate faster. The web-only attributes such as `target`,\n * `rel`, and `download` are supported and passed to the anchor tag on web. See\n * [`WebAnchorProps`](#webanchorprops) for more details.\n *\n * > **Note**: Client-side navigation works with both single-page apps,\n * and [static-rendering](/router/reference/static-rendering/).\n *\n * @example\n * ```tsx\n * import { Link } from 'expo-router';\n * import { View } from 'react-native';\n *\n * export default function Route() {\n * return (\n * <View>\n * <Link href=\"/about\">About</Link>\n * </View>\n * );\n *}\n * ```\n */\n function Link(props: LinkProps) {\n // Re-exporting ExpoLink here so that Link.* can be used in server components.\n return <ExpoLink {...props} />;\n },\n {\n resolveHref,\n Menu: LinkMenu,\n Trigger: LinkTrigger,\n Preview: LinkPreview,\n MenuAction: LinkMenuAction,\n AppleZoom: LinkAppleZoom,\n AppleZoomTarget: LinkAppleZoomTarget,\n }\n);\n\nexport type LinkComponent = typeof Link;\n\nexport { LinkProps, WebAnchorProps };\nexport { Redirect, RedirectProps } from './Redirect';\n"]}
@@ -1,4 +1,4 @@
1
- import React, { type PropsWithChildren, type ReactElement } from 'react';
1
+ import React, { type PropsWithChildren } from 'react';
2
2
  import type { ViewStyle } from 'react-native';
3
3
  import type { SFSymbol } from 'sf-symbols-typescript';
4
4
  export interface LinkMenuActionProps {
@@ -83,7 +83,7 @@ export interface LinkMenuProps {
83
83
  * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenu/options-swift.struct/destructive) for more information.
84
84
  */
85
85
  destructive?: boolean;
86
- children: ReactElement<LinkMenuActionProps> | ReactElement<LinkMenuActionProps>[];
86
+ children?: React.ReactNode;
87
87
  }
88
88
  /**
89
89
  * Groups context menu actions for a link.
@@ -159,7 +159,18 @@ export interface LinkPreviewProps {
159
159
  * @platform ios
160
160
  */
161
161
  export declare function LinkPreview(props: LinkPreviewProps): React.JSX.Element | null;
162
- export type LinkTriggerProps = PropsWithChildren;
162
+ export interface LinkTriggerProps extends PropsWithChildren {
163
+ /**
164
+ * A shorthand for enabling the Apple Zoom Transition on this link trigger.
165
+ *
166
+ * When set to `true`, the trigger will be wrapped with `Link.AppleZoom`.
167
+ * If another `Link.AppleZoom` is already used inside `Link.Trigger`, an error
168
+ * will be thrown.
169
+ *
170
+ * @platform ios 18+
171
+ */
172
+ withAppleZoom?: boolean;
173
+ }
163
174
  /**
164
175
  * Serves as the trigger for a link.
165
176
  * The content inside this component will be rendered as part of the base link.
@@ -179,5 +190,5 @@ export type LinkTriggerProps = PropsWithChildren;
179
190
  *
180
191
  * @platform ios
181
192
  */
182
- export declare function LinkTrigger(props: LinkTriggerProps): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | React.JSX.Element | null | undefined;
193
+ export declare function LinkTrigger({ withAppleZoom, ...props }: LinkTriggerProps): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | React.JSX.Element | null | undefined;
183
194
  //# sourceMappingURL=elements.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"elements.d.ts","sourceRoot":"","sources":["../../src/link/elements.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,EAIZ,KAAK,iBAAiB,EACtB,KAAK,YAAY,EAClB,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAQtD,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB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AW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAqB5C,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC,SAAS,EAAE,UAAU,GAAG,OAAO,GAAG,QAAQ,CAAC,GAAG;IAChF;;;;;OAKG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B;;;;OAIG;IACH,KAAK,CAAC,EAAE,gBAAgB,CAAC;CAC1B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,4BAwBlD;AAED,MAAM,WAAW,gBAAiB,SAAQ,iBAAiB;IACzD;;;;;;;;OAQG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,WAAW,CAAC,EAAE,aAAa,EAAE,GAAG,KAAK,EAAE,EAAE,gBAAgB,mSAgBxE"}
@@ -45,6 +45,7 @@ const HrefPreview_1 = require("./preview/HrefPreview");
45
45
  const PreviewRouteContext_1 = require("./preview/PreviewRouteContext");
46
46
  const native_1 = require("./preview/native");
47
47
  const Slot_1 = require("../ui/Slot");
48
+ const link_apple_zoom_1 = require("./zoom/link-apple-zoom");
48
49
  /**
49
50
  * This component renders a context menu action for a link.
50
51
  * It should only be used as a child of `Link.Menu` or `LinkMenu`.
@@ -161,7 +162,7 @@ function LinkPreview(props) {
161
162
  *
162
163
  * @platform ios
163
164
  */
164
- function LinkTrigger(props) {
165
+ function LinkTrigger({ withAppleZoom, ...props }) {
165
166
  if (react_1.default.Children.count(props.children) > 1 || !(0, react_1.isValidElement)(props.children)) {
166
167
  // If onPress is passed, this means that Link passed props to this component.
167
168
  // We can assume that asChild is used, so we throw an error, because link will not work in this case.
@@ -170,6 +171,10 @@ function LinkTrigger(props) {
170
171
  }
171
172
  return props.children;
172
173
  }
173
- return <Slot_1.Slot {...props}/>;
174
+ const content = <Slot_1.Slot {...props}/>;
175
+ if (withAppleZoom) {
176
+ return <link_apple_zoom_1.LinkAppleZoom>{content}</link_apple_zoom_1.LinkAppleZoom>;
177
+ }
178
+ return content;
174
179
  }
175
180
  //# sourceMappingURL=elements.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"elements.js","sourceRoot":"","sources":["../../src/link/elements.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgEb,wCAcC;AA4ID,kCAwBC;AAuBD,kCAYC;AAnRD,kDAA2C;AAC3C,+CAMe;AAIf,6EAA0E;AAC1E,uDAAoD;AACpD,uEAA6D;AAC7D,6CAAqF;AACrF,qCAAkC;AAuClC;;;;;;;GAOG;AACH,SAAgB,cAAc,CAAC,KAA0B;IACvD,MAAM,UAAU,GAAG,IAAA,eAAO,EAAC,GAAG,EAAE,CAAC,IAAA,mBAAM,GAAE,EAAE,EAAE,CAAC,CAAC;IAC/C,IAAI,IAAA,kCAAY,GAAE,IAAI,OAAO,CAAC,GAAG,CAAC,OAAO,KAAK,KAAK,IAAI,CAAC,IAAA,WAAG,EAAC,uDAA0B,CAAC,EAAE,CAAC;QACxF,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,EAAE,sBAAsB,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC;IAC3D,OAAO,CACL,CAAC,gCAAuB,CACtB,IAAI,IAAI,CAAC,CACT,UAAU,CAAC,CAAC,OAAO,CAAC,CACpB,aAAa,CAAC,CAAC,sBAAsB,CAAC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AG,CAAC,IAAI,CAAC,IAAA,sBAAc,EAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC;QAChF,6EAA6E;QAC7E,qGAAqG;QACrG,IAAI,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,SAAS,IAAI,KAAK,EAAE,CAAC;YAC7D,MAAM,IAAI,KAAK,CACb,gHAAgH,CACjH,CAAC;QACJ,CAAC;QACD,OAAO,KAAK,CAAC,QAAQ,CAAC;IACxB,CAAC;IACD,OAAO,CAAC,WAAI,CAAC,IAAI,KAAK,CAAC,EAAG,CAAC;AAC7B,CAAC","sourcesContent":["'use client';\n\nimport { nanoid } from 'nanoid/non-secure';\nimport React, {\n isValidElement,\n use,\n useMemo,\n type PropsWithChildren,\n type ReactElement,\n} from 'react';\nimport type { ViewStyle } from 'react-native';\nimport type { SFSymbol } from 'sf-symbols-typescript';\n\nimport { InternalLinkPreviewContext } from './InternalLinkPreviewContext';\nimport { HrefPreview } from './preview/HrefPreview';\nimport { useIsPreview } from './preview/PreviewRouteContext';\nimport { NativeLinkPreviewAction, NativeLinkPreviewContent } from './preview/native';\nimport { Slot } from '../ui/Slot';\n\nexport interface LinkMenuActionProps {\n /**\n * The title of the menu item.\n */\n title: string;\n /**\n * Optional SF Symbol displayed alongside the menu item.\n */\n icon?: SFSymbol;\n /**\n * If `true`, the menu item will be disabled and not selectable.\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenuelement/attributes/disabled) for more information.\n */\n disabled?: boolean;\n /**\n * If `true`, the menu item will be displayed as destructive.\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenuelement/attributes/destructive) for more information.\n */\n destructive?: boolean;\n /**\n * If `true`, the menu will be kept presented after the action is selected.\n *\n * This is marked as unstable, because when action is selected it will recreate the menu,\n * which will close all opened submenus and reset the scroll position.\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenuelement/attributes/keepsmenupresented) for more information.\n */\n unstable_keepPresented?: boolean;\n /**\n * If `true`, the menu item will be displayed as selected.\n */\n isOn?: boolean;\n onPress: () => void;\n}\n\n/**\n * This component renders a context menu action for a link.\n * It should only be used as a child of `Link.Menu` or `LinkMenu`.\n *\n * > **Note**: You can use the alias `Link.MenuAction` for this component.\n *\n * @platform ios\n */\nexport function LinkMenuAction(props: LinkMenuActionProps) {\n const identifier = useMemo(() => nanoid(), []);\n if (useIsPreview() || process.env.EXPO_OS !== 'ios' || !use(InternalLinkPreviewContext)) {\n return null;\n }\n const { unstable_keepPresented, onPress, ...rest } = props;\n return (\n <NativeLinkPreviewAction\n {...rest}\n onSelected={onPress}\n keepPresented={unstable_keepPresented}\n identifier={identifier}\n />\n );\n}\n\nexport interface LinkMenuProps {\n /**\n * The title of the menu item\n */\n title?: string;\n /**\n * Optional SF Symbol displayed alongside the menu item.\n */\n icon?: string;\n /**\n * If `true`, the menu will be displayed as a palette.\n * This means that the menu will be displayed as one row\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenu/options-swift.struct/displayaspalette) for more information.\n */\n palette?: boolean;\n /**\n * @deprecated Use `palette` prop instead.\n */\n displayAsPalette?: boolean;\n /**\n * If `true`, the menu will be displayed inline.\n * This means that the menu will not be collapsed\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenu/options-swift.struct/displayinline) for more information.\n */\n inline?: boolean;\n /**\n * @deprecated Use `inline` prop instead.\n */\n displayInline?: boolean;\n /**\n * If `true`, the menu item will be displayed as destructive.\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenu/options-swift.struct/destructive) for more information.\n */\n destructive?: boolean;\n children: ReactElement<LinkMenuActionProps> | ReactElement<LinkMenuActionProps>[];\n}\n\n/**\n * Groups context menu actions for a link.\n *\n * If multiple `Link.Menu` components are used within a single `Link`, only the first will be rendered.\n * Only `Link.MenuAction` and `LinkMenuAction` components are allowed as children.\n *\n * @example\n * ```tsx\n * <Link.Menu>\n * <Link.MenuAction title=\"Action 1\" onPress={() => {}} />\n * <Link.MenuAction title=\"Action 2\" onPress={() => {}} />\n * </Link.Menu>\n * ```\n *\n * > **Note**: You can use the alias `Link.Menu` for this component.\n *\n * @platform ios\n */\nexport const LinkMenu: React.FC<LinkMenuProps> = (props) => {\n const identifier = useMemo(() => nanoid(), []);\n if (useIsPreview() || process.env.EXPO_OS !== 'ios' || !use(InternalLinkPreviewContext)) {\n return null;\n }\n const children = React.Children.toArray(props.children).filter(\n (child) => isValidElement(child) && (child.type === LinkMenuAction || child.type === LinkMenu)\n );\n const displayAsPalette = props.palette ?? props.displayAsPalette;\n const displayInline = props.inline ?? props.displayInline;\n return (\n <NativeLinkPreviewAction\n {...props}\n displayAsPalette={displayAsPalette}\n displayInline={displayInline}\n title={props.title ?? ''}\n onSelected={() => {}}\n children={children}\n identifier={identifier}\n />\n );\n};\n\nexport type LinkPreviewStyle = Omit<ViewStyle, 'position' | 'width' | 'height'> & {\n /**\n * Sets the preferred width of the preview.\n * If not set, full width of the screen will be used.\n *\n * This is only **preferred** width, the actual width may be different\n */\n width?: number;\n\n /**\n * Sets the preferred height of the preview.\n * If not set, full height of the screen will be used.\n *\n * This is only **preferred** height, the actual height may be different\n */\n height?: number;\n};\n\nexport interface LinkPreviewProps {\n children?: React.ReactNode;\n /**\n * Custom styles for the preview container.\n *\n * Note that some styles may not work, as they are limited or reset by the native view\n */\n style?: LinkPreviewStyle;\n}\n\n/**\n * A component used to render and customize the link preview.\n *\n * If `Link.Preview` is used without any props, it will render a preview of the `href` passed to the `Link`.\n *\n * If multiple `Link.Preview` components are used within a single `Link`, only the first one will be rendered.\n *\n * To customize the preview, you can pass custom content as children.\n *\n * @example\n * ```tsx\n * <Link href=\"/about\">\n * <Link.Preview>\n * <Text>Custom Preview Content</Text>\n * </Link.Preview>\n * </Link>\n * ```\n *\n * @example\n * ```tsx\n * <Link href=\"/about\">\n * <Link.Preview />\n * </Link>\n * ```\n *\n * > **Note**: You can use the alias `Link.Preview` for this component.\n *\n * @platform ios\n */\nexport function LinkPreview(props: LinkPreviewProps) {\n const { children, style } = props;\n const internalPreviewContext = use(InternalLinkPreviewContext);\n if (useIsPreview() || process.env.EXPO_OS !== 'ios' || !internalPreviewContext) {\n return null;\n }\n const { isVisible, href } = internalPreviewContext;\n const { width, height, ...restOfStyle } = style ?? {};\n const contentSize = {\n width: width ?? 0,\n height: height ?? 0,\n };\n let content: React.ReactNode;\n if (children) {\n content = isVisible ? children : null;\n } else {\n content = isVisible ? <HrefPreview href={href} /> : null;\n }\n\n return (\n <NativeLinkPreviewContent style={restOfStyle} preferredContentSize={contentSize}>\n {content}\n </NativeLinkPreviewContent>\n );\n}\n\nexport type LinkTriggerProps = PropsWithChildren;\n\n/**\n * Serves as the trigger for a link.\n * The content inside this component will be rendered as part of the base link.\n *\n * If multiple `Link.Trigger` components are used within a single `Link`, only the first will be rendered.\n *\n * @example\n * ```tsx\n * <Link href=\"/about\">\n * <Link.Trigger>\n * Trigger\n * </Link.Trigger>\n * </Link>\n * ```\n *\n * > **Note**: You can use the alias `Link.Trigger` for this component.\n *\n * @platform ios\n */\nexport function LinkTrigger(props: LinkTriggerProps) {\n if (React.Children.count(props.children) > 1 || !isValidElement(props.children)) {\n // If onPress is passed, this means that Link passed props to this component.\n // We can assume that asChild is used, so we throw an error, because link will not work in this case.\n if (props && typeof props === 'object' && 'onPress' in props) {\n throw new Error(\n 'When using Link.Trigger in an asChild Link, you must pass a single child element that will emit onPress event.'\n );\n }\n return props.children;\n }\n return <Slot {...props} />;\n}\n"]}
1
+ {"version":3,"file":"elements.js","sourceRoot":"","sources":["../../src/link/elements.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2Db,wCAcC;AA4ID,kCAwBC;AAkCD,kCAgBC;AA7RD,kDAA2C;AAC3C,+CAAoF;AAIpF,6EAA0E;AAC1E,uDAAoD;AACpD,uEAA6D;AAC7D,6CAAqF;AACrF,qCAAkC;AAClC,4DAAuD;AA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CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC;IACxC,CAAC;SAAM,CAAC;QACN,OAAO,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC,yBAAW,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,EAAG,CAAC,CAAC,CAAC,IAAI,CAAC;IAC3D,CAAC;IAED,OAAO,CACL,CAAC,iCAAwB,CAAC,KAAK,CAAC,CAAC,WAAW,CAAC,CAAC,oBAAoB,CAAC,CAAC,WAAW,CAAC,CAC9E;MAAA,CAAC,OAAO,CACV;IAAA,EAAE,iCAAwB,CAAC,CAC5B,CAAC;AACJ,CAAC;AAeD;;;;;;;;;;;;;;;;;;GAkBG;AACH,SAAgB,WAAW,CAAC,EAAE,aAAa,EAAE,GAAG,KAAK,EAAoB;IACvE,IAAI,eAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,IAAA,sBAAc,EAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC;QAChF,6EAA6E;QAC7E,qGAAqG;QACrG,IAAI,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,SAAS,IAAI,KAAK,EAAE,CAAC;YAC7D,MAAM,IAAI,KAAK,CACb,gHAAgH,CACjH,CAAC;QACJ,CAAC;QACD,OAAO,KAAK,CAAC,QAAQ,CAAC;IACxB,CAAC;IACD,MAAM,OAAO,GAAG,CAAC,WAAI,CAAC,IAAI,KAAK,CAAC,EAAG,CAAC;IACpC,IAAI,aAAa,EAAE,CAAC;QAClB,OAAO,CAAC,+BAAa,CAAC,CAAC,OAAO,CAAC,EAAE,+BAAa,CAAC,CAAC;IAClD,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC","sourcesContent":["'use client';\n\nimport { nanoid } from 'nanoid/non-secure';\nimport React, { isValidElement, use, useMemo, type PropsWithChildren } from 'react';\nimport type { ViewStyle } from 'react-native';\nimport type { SFSymbol } from 'sf-symbols-typescript';\n\nimport { InternalLinkPreviewContext } from './InternalLinkPreviewContext';\nimport { HrefPreview } from './preview/HrefPreview';\nimport { useIsPreview } from './preview/PreviewRouteContext';\nimport { NativeLinkPreviewAction, NativeLinkPreviewContent } from './preview/native';\nimport { Slot } from '../ui/Slot';\nimport { LinkAppleZoom } from './zoom/link-apple-zoom';\n\nexport interface LinkMenuActionProps {\n /**\n * The title of the menu item.\n */\n title: string;\n /**\n * Optional SF Symbol displayed alongside the menu item.\n */\n icon?: SFSymbol;\n /**\n * If `true`, the menu item will be disabled and not selectable.\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenuelement/attributes/disabled) for more information.\n */\n disabled?: boolean;\n /**\n * If `true`, the menu item will be displayed as destructive.\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenuelement/attributes/destructive) for more information.\n */\n destructive?: boolean;\n /**\n * If `true`, the menu will be kept presented after the action is selected.\n *\n * This is marked as unstable, because when action is selected it will recreate the menu,\n * which will close all opened submenus and reset the scroll position.\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenuelement/attributes/keepsmenupresented) for more information.\n */\n unstable_keepPresented?: boolean;\n /**\n * If `true`, the menu item will be displayed as selected.\n */\n isOn?: boolean;\n onPress: () => void;\n}\n\n/**\n * This component renders a context menu action for a link.\n * It should only be used as a child of `Link.Menu` or `LinkMenu`.\n *\n * > **Note**: You can use the alias `Link.MenuAction` for this component.\n *\n * @platform ios\n */\nexport function LinkMenuAction(props: LinkMenuActionProps) {\n const identifier = useMemo(() => nanoid(), []);\n if (useIsPreview() || process.env.EXPO_OS !== 'ios' || !use(InternalLinkPreviewContext)) {\n return null;\n }\n const { unstable_keepPresented, onPress, ...rest } = props;\n return (\n <NativeLinkPreviewAction\n {...rest}\n onSelected={onPress}\n keepPresented={unstable_keepPresented}\n identifier={identifier}\n />\n );\n}\n\nexport interface LinkMenuProps {\n /**\n * The title of the menu item\n */\n title?: string;\n /**\n * Optional SF Symbol displayed alongside the menu item.\n */\n icon?: string;\n /**\n * If `true`, the menu will be displayed as a palette.\n * This means that the menu will be displayed as one row\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenu/options-swift.struct/displayaspalette) for more information.\n */\n palette?: boolean;\n /**\n * @deprecated Use `palette` prop instead.\n */\n displayAsPalette?: boolean;\n /**\n * If `true`, the menu will be displayed inline.\n * This means that the menu will not be collapsed\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenu/options-swift.struct/displayinline) for more information.\n */\n inline?: boolean;\n /**\n * @deprecated Use `inline` prop instead.\n */\n displayInline?: boolean;\n /**\n * If `true`, the menu item will be displayed as destructive.\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenu/options-swift.struct/destructive) for more information.\n */\n destructive?: boolean;\n children?: React.ReactNode;\n}\n\n/**\n * Groups context menu actions for a link.\n *\n * If multiple `Link.Menu` components are used within a single `Link`, only the first will be rendered.\n * Only `Link.MenuAction` and `LinkMenuAction` components are allowed as children.\n *\n * @example\n * ```tsx\n * <Link.Menu>\n * <Link.MenuAction title=\"Action 1\" onPress={() => {}} />\n * <Link.MenuAction title=\"Action 2\" onPress={() => {}} />\n * </Link.Menu>\n * ```\n *\n * > **Note**: You can use the alias `Link.Menu` for this component.\n *\n * @platform ios\n */\nexport const LinkMenu: React.FC<LinkMenuProps> = (props) => {\n const identifier = useMemo(() => nanoid(), []);\n if (useIsPreview() || process.env.EXPO_OS !== 'ios' || !use(InternalLinkPreviewContext)) {\n return null;\n }\n const children = React.Children.toArray(props.children).filter(\n (child) => isValidElement(child) && (child.type === LinkMenuAction || child.type === LinkMenu)\n );\n const displayAsPalette = props.palette ?? props.displayAsPalette;\n const displayInline = props.inline ?? props.displayInline;\n return (\n <NativeLinkPreviewAction\n {...props}\n displayAsPalette={displayAsPalette}\n displayInline={displayInline}\n title={props.title ?? ''}\n onSelected={() => {}}\n children={children}\n identifier={identifier}\n />\n );\n};\n\nexport type LinkPreviewStyle = Omit<ViewStyle, 'position' | 'width' | 'height'> & {\n /**\n * Sets the preferred width of the preview.\n * If not set, full width of the screen will be used.\n *\n * This is only **preferred** width, the actual width may be different\n */\n width?: number;\n\n /**\n * Sets the preferred height of the preview.\n * If not set, full height of the screen will be used.\n *\n * This is only **preferred** height, the actual height may be different\n */\n height?: number;\n};\n\nexport interface LinkPreviewProps {\n children?: React.ReactNode;\n /**\n * Custom styles for the preview container.\n *\n * Note that some styles may not work, as they are limited or reset by the native view\n */\n style?: LinkPreviewStyle;\n}\n\n/**\n * A component used to render and customize the link preview.\n *\n * If `Link.Preview` is used without any props, it will render a preview of the `href` passed to the `Link`.\n *\n * If multiple `Link.Preview` components are used within a single `Link`, only the first one will be rendered.\n *\n * To customize the preview, you can pass custom content as children.\n *\n * @example\n * ```tsx\n * <Link href=\"/about\">\n * <Link.Preview>\n * <Text>Custom Preview Content</Text>\n * </Link.Preview>\n * </Link>\n * ```\n *\n * @example\n * ```tsx\n * <Link href=\"/about\">\n * <Link.Preview />\n * </Link>\n * ```\n *\n * > **Note**: You can use the alias `Link.Preview` for this component.\n *\n * @platform ios\n */\nexport function LinkPreview(props: LinkPreviewProps) {\n const { children, style } = props;\n const internalPreviewContext = use(InternalLinkPreviewContext);\n if (useIsPreview() || process.env.EXPO_OS !== 'ios' || !internalPreviewContext) {\n return null;\n }\n const { isVisible, href } = internalPreviewContext;\n const { width, height, ...restOfStyle } = style ?? {};\n const contentSize = {\n width: width ?? 0,\n height: height ?? 0,\n };\n let content: React.ReactNode;\n if (children) {\n content = isVisible ? children : null;\n } else {\n content = isVisible ? <HrefPreview href={href} /> : null;\n }\n\n return (\n <NativeLinkPreviewContent style={restOfStyle} preferredContentSize={contentSize}>\n {content}\n </NativeLinkPreviewContent>\n );\n}\n\nexport interface LinkTriggerProps extends PropsWithChildren {\n /**\n * A shorthand for enabling the Apple Zoom Transition on this link trigger.\n *\n * When set to `true`, the trigger will be wrapped with `Link.AppleZoom`.\n * If another `Link.AppleZoom` is already used inside `Link.Trigger`, an error\n * will be thrown.\n *\n * @platform ios 18+\n */\n withAppleZoom?: boolean;\n}\n\n/**\n * Serves as the trigger for a link.\n * The content inside this component will be rendered as part of the base link.\n *\n * If multiple `Link.Trigger` components are used within a single `Link`, only the first will be rendered.\n *\n * @example\n * ```tsx\n * <Link href=\"/about\">\n * <Link.Trigger>\n * Trigger\n * </Link.Trigger>\n * </Link>\n * ```\n *\n * > **Note**: You can use the alias `Link.Trigger` for this component.\n *\n * @platform ios\n */\nexport function LinkTrigger({ withAppleZoom, ...props }: LinkTriggerProps) {\n if (React.Children.count(props.children) > 1 || !isValidElement(props.children)) {\n // If onPress is passed, this means that Link passed props to this component.\n // We can assume that asChild is used, so we throw an error, because link will not work in this case.\n if (props && typeof props === 'object' && 'onPress' in props) {\n throw new Error(\n 'When using Link.Trigger in an asChild Link, you must pass a single child element that will emit onPress event.'\n );\n }\n return props.children;\n }\n const content = <Slot {...props} />;\n if (withAppleZoom) {\n return <LinkAppleZoom>{content}</LinkAppleZoom>;\n }\n return content;\n}\n"]}
@@ -1,4 +1,4 @@
1
- import type { PropsWithChildren } from 'react';
1
+ import { type PropsWithChildren } from 'react';
2
2
  import { type ViewProps } from 'react-native';
3
3
  export interface NativeLinkPreviewActionProps {
4
4
  identifier: string;
@@ -54,5 +54,9 @@ export declare function LinkZoomTransitionSource(props: PropsWithChildren<{
54
54
  identifier: string;
55
55
  alignment?: LinkSourceAlignmentRect;
56
56
  }>): import("react").JSX.Element | null;
57
+ export declare function LinkZoomTransitionAlignmentRectDetector(props: {
58
+ identifier: string;
59
+ children: React.ReactNode;
60
+ }): import("react").JSX.Element | null;
57
61
  export {};
58
62
  //# sourceMappingURL=native.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"native.d.ts","sourceRoot":"","sources":["../../../src/link/preview/native.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,EAAwB,KAAK,SAAS,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C;IAAC,SAAS,CAAC,EAAE,uBAAuB,CAAA;CAAE,CAAC,sCActF;AAOD,wBAAgB,uCAAuC,CAAC,KAAK,EAAE;IAC7D,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,sCAaA"}
@@ -6,7 +6,9 @@ exports.NativeLinkPreview = NativeLinkPreview;
6
6
  exports.NativeLinkPreviewContent = NativeLinkPreviewContent;
7
7
  exports.LinkZoomTransitionEnabler = LinkZoomTransitionEnabler;
8
8
  exports.LinkZoomTransitionSource = LinkZoomTransitionSource;
9
+ exports.LinkZoomTransitionAlignmentRectDetector = LinkZoomTransitionAlignmentRectDetector;
9
10
  const expo_1 = require("expo");
11
+ const react_1 = require("react");
10
12
  const react_native_1 = require("react-native");
11
13
  const areNativeViewsAvailable = process.env.EXPO_OS === 'ios' && !react_native_1.Platform.isTV && global.RN$Bridgeless === true;
12
14
  const LinkPreviewNativeActionView = areNativeViewsAvailable
@@ -62,7 +64,16 @@ function LinkZoomTransitionSource(props) {
62
64
  if (!LinkZoomTransitionSourceNativeView) {
63
65
  return null;
64
66
  }
65
- return (<LinkZoomTransitionSourceNativeView {...props} disableForceFlatten style={{ display: 'contents' }}/>);
67
+ return (<LinkZoomTransitionSourceNativeView {...props} disableForceFlatten collapsable={false} collapsableChildren={false} style={{ display: 'contents' }}/>);
68
+ }
69
+ const LinkZoomTransitionAlignmentRectDetectorNative = areNativeViewsAvailable
70
+ ? (0, expo_1.requireNativeView)('ExpoRouterNativeLinkPreview', 'LinkZoomTransitionAlignmentRectDetector')
71
+ : react_1.Fragment;
72
+ function LinkZoomTransitionAlignmentRectDetector(props) {
73
+ if (!LinkZoomTransitionAlignmentRectDetectorNative) {
74
+ return null;
75
+ }
76
+ return (<LinkZoomTransitionAlignmentRectDetectorNative {...props} disableForceFlatten collapsable={false} collapsableChildren={false} style={{ display: 'contents' }}/>);
66
77
  }
67
78
  // #endregion
68
79
  //# sourceMappingURL=native.js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,MAAM,KAAK,GAAG,yBAAU,CAAC,OAAO,CAAC;QAC/B,KAAK,CAAC,KAAK;QACX;YACE,QAAQ,EAAE,UAAU;YACpB,GAAG,EAAE,CAAC;YACN,IAAI,EAAE,CAAC;SACC;KACX,CAAC,CAAC;IACH,OAAO,CAAC,4BAA4B,CAAC,IAAI,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,EAAG,CAAC;AACnE,CAAC;AACD,aAAa;AAEb,0BAA0B;AAC1B,MAAM,mCAAmC,GAE9B,uBAAuB;IAChC,CAAC,CAAC,IAAA,wBAAiB,EAAC,6BAA6B,EAAE,2BAA2B,CAAC;IAC/E,CAAC,CAAC,IAAI,CAAC;AACT,SAAgB,yBAAyB,CAAC,KAGzC;IACC,IAAI,CAAC,mCAAmC,EAAE,CAAC;QACzC,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,CACL,CAAC,mCAAmC,CAClC,IAAI,KAAK,CAAC,CACV,mBAAmB,CACnB,KAAK,CAAC,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC,EAC/B,CACH,CAAC;AACJ,CAAC;AASD,MAAM,kCAAkC,GAM7B,uBAAuB;IAChC,CAAC,CAAC,IAAA,wBAAiB,EAAC,6BAA6B,EAAE,0BAA0B,CAAC;IAC9E,CAAC,CAAC,IAAI,CAAC;AACT,SAAgB,wBAAwB,CACtC,KAAqF;IAErF,IAAI,CAAC,kCAAkC,EAAE,CAAC;QACxC,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,CACL,CAAC,kCAAkC,CACjC,IAAI,KAAK,CAAC,CACV,mBAAmB,CACnB,KAAK,CAAC,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC,EAC/B,CACH,CAAC;AACJ,CAAC;AACD,aAAa","sourcesContent":["'use client';\n\nimport { requireNativeView } from 'expo';\nimport type { PropsWithChildren } from 'react';\nimport { Platform, StyleSheet, type ViewProps } from 'react-native';\n\nconst areNativeViewsAvailable =\n process.env.EXPO_OS === 'ios' && !Platform.isTV && global.RN$Bridgeless === true;\n\n// #region Action View\nexport interface NativeLinkPreviewActionProps {\n identifier: string;\n title: string;\n icon?: string;\n children?: React.ReactNode;\n disabled?: boolean;\n destructive?: boolean;\n // This may lead to race conditions, when two menu actions are on at the same time.\n // The logic should be enforced in the JS code, rather than in the native code.\n // singleSelection?: boolean;\n displayAsPalette?: boolean;\n displayInline?: boolean;\n isOn?: boolean;\n // There are issues with menu state updates when keep presented is set to true.\n // When updating the context menu state, it will either not update or it will recreate the menu. The latter is a problem,\n // because it will close all opened submenus and reset the scroll position.\n // TODO: (@ubax) find a way to fix this.\n keepPresented?: boolean;\n onSelected: () => void;\n}\nconst LinkPreviewNativeActionView: React.ComponentType<NativeLinkPreviewActionProps> | null =\n areNativeViewsAvailable\n ? requireNativeView('ExpoRouterNativeLinkPreview', 'LinkPreviewNativeActionView')\n : null;\nexport function NativeLinkPreviewAction(props: NativeLinkPreviewActionProps) {\n if (!LinkPreviewNativeActionView) {\n return null;\n }\n return <LinkPreviewNativeActionView {...props} />;\n}\n// #endregion\n\n// #region Preview View\nexport interface TabPath {\n oldTabKey: string;\n newTabKey: string;\n}\nexport interface NativeLinkPreviewProps extends ViewProps {\n nextScreenId: string | undefined;\n tabPath:\n | {\n path: TabPath[];\n }\n | undefined;\n disableForceFlatten?: boolean;\n onWillPreviewOpen?: () => void;\n onDidPreviewOpen?: () => void;\n onPreviewWillClose?: () => void;\n onPreviewDidClose?: () => void;\n onPreviewTapped?: () => void;\n onPreviewTappedAnimationCompleted?: () => void;\n children: React.ReactNode;\n}\nconst NativeLinkPreviewView: React.ComponentType<NativeLinkPreviewProps> | null =\n areNativeViewsAvailable\n ? requireNativeView('ExpoRouterNativeLinkPreview', 'NativeLinkPreviewView')\n : null;\nexport function NativeLinkPreview(props: NativeLinkPreviewProps) {\n if (!NativeLinkPreviewView) {\n return null;\n }\n return <NativeLinkPreviewView {...props} />;\n}\n// #endregion\n\n// #region Preview Content View\nexport interface NativeLinkPreviewContentProps extends ViewProps {\n preferredContentSize?: { width: number; height: number };\n}\nconst NativeLinkPreviewContentView: React.ComponentType<NativeLinkPreviewContentProps> | null =\n areNativeViewsAvailable\n ? requireNativeView('ExpoRouterNativeLinkPreview', 'NativeLinkPreviewContentView')\n : null;\n\nexport function NativeLinkPreviewContent(props: NativeLinkPreviewContentProps) {\n if (!NativeLinkPreviewContentView) {\n return null;\n }\n const style = StyleSheet.flatten([\n props.style,\n {\n position: 'absolute',\n top: 0,\n left: 0,\n } as const,\n ]);\n return <NativeLinkPreviewContentView {...props} style={style} />;\n}\n// #endregion\n\n// #region Zoom transition\nconst LinkZoomTransitionEnablerNativeView: React.ComponentType<\n ViewProps & { zoomTransitionSourceIdentifier: string; disableForceFlatten?: boolean }\n> | null = areNativeViewsAvailable\n ? requireNativeView('ExpoRouterNativeLinkPreview', 'LinkZoomTransitionEnabler')\n : null;\nexport function LinkZoomTransitionEnabler(props: {\n zoomTransitionSourceIdentifier: string;\n preventInteractiveDismissal?: boolean;\n}) {\n if (!LinkZoomTransitionEnablerNativeView) {\n return null;\n }\n return (\n <LinkZoomTransitionEnablerNativeView\n {...props}\n disableForceFlatten\n style={{ display: 'contents' }}\n />\n );\n}\n\ninterface LinkSourceAlignmentRect {\n x: number;\n y: number;\n width: number;\n height: number;\n}\n\nconst LinkZoomTransitionSourceNativeView: React.ComponentType<\n ViewProps & {\n identifier: string;\n disableForceFlatten?: boolean;\n alignment?: LinkSourceAlignmentRect;\n }\n> | null = areNativeViewsAvailable\n ? requireNativeView('ExpoRouterNativeLinkPreview', 'LinkZoomTransitionSource')\n : null;\nexport function LinkZoomTransitionSource(\n props: PropsWithChildren<{ identifier: string; alignment?: LinkSourceAlignmentRect }>\n) {\n if (!LinkZoomTransitionSourceNativeView) {\n return null;\n }\n return (\n <LinkZoomTransitionSourceNativeView\n {...props}\n disableForceFlatten\n style={{ display: 'contents' }}\n />\n );\n}\n// #endregion\n"]}
1
+ {"version":3,"file":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AAiB,EAAC,6BAA6B,EAAE,yCAAyC,CAAC;IAC7F,CAAC,CAAC,gBAAQ,CAAC;AACb,SAAgB,uCAAuC,CAAC,KAGvD;IACC,IAAI,CAAC,6CAA6C,EAAE,CAAC;QACnD,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,CACL,CAAC,6CAA6C,CAC5C,IAAI,KAAK,CAAC,CACV,mBAAmB,CACnB,WAAW,CAAC,CAAC,KAAK,CAAC,CACnB,mBAAmB,CAAC,CAAC,KAAK,CAAC,CAC3B,KAAK,CAAC,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC,EAC/B,CACH,CAAC;AACJ,CAAC;AACD,aAAa","sourcesContent":["'use client';\n\nimport { requireNativeView } from 'expo';\nimport { Fragment, type PropsWithChildren } from 'react';\nimport { Platform, StyleSheet, type ViewProps } from 'react-native';\n\nconst areNativeViewsAvailable =\n process.env.EXPO_OS === 'ios' && !Platform.isTV && global.RN$Bridgeless === true;\n\n// #region Action View\nexport interface NativeLinkPreviewActionProps {\n identifier: string;\n title: string;\n icon?: string;\n children?: React.ReactNode;\n disabled?: boolean;\n destructive?: boolean;\n // This may lead to race conditions, when two menu actions are on at the same time.\n // The logic should be enforced in the JS code, rather than in the native code.\n // singleSelection?: boolean;\n displayAsPalette?: boolean;\n displayInline?: boolean;\n isOn?: boolean;\n // There are issues with menu state updates when keep presented is set to true.\n // When updating the context menu state, it will either not update or it will recreate the menu. The latter is a problem,\n // because it will close all opened submenus and reset the scroll position.\n // TODO: (@ubax) find a way to fix this.\n keepPresented?: boolean;\n onSelected: () => void;\n}\nconst LinkPreviewNativeActionView: React.ComponentType<NativeLinkPreviewActionProps> | null =\n areNativeViewsAvailable\n ? requireNativeView('ExpoRouterNativeLinkPreview', 'LinkPreviewNativeActionView')\n : null;\nexport function NativeLinkPreviewAction(props: NativeLinkPreviewActionProps) {\n if (!LinkPreviewNativeActionView) {\n return null;\n }\n return <LinkPreviewNativeActionView {...props} />;\n}\n// #endregion\n\n// #region Preview View\nexport interface TabPath {\n oldTabKey: string;\n newTabKey: string;\n}\nexport interface NativeLinkPreviewProps extends ViewProps {\n nextScreenId: string | undefined;\n tabPath:\n | {\n path: TabPath[];\n }\n | undefined;\n disableForceFlatten?: boolean;\n onWillPreviewOpen?: () => void;\n onDidPreviewOpen?: () => void;\n onPreviewWillClose?: () => void;\n onPreviewDidClose?: () => void;\n onPreviewTapped?: () => void;\n onPreviewTappedAnimationCompleted?: () => void;\n children: React.ReactNode;\n}\nconst NativeLinkPreviewView: React.ComponentType<NativeLinkPreviewProps> | null =\n areNativeViewsAvailable\n ? requireNativeView('ExpoRouterNativeLinkPreview', 'NativeLinkPreviewView')\n : null;\nexport function NativeLinkPreview(props: NativeLinkPreviewProps) {\n if (!NativeLinkPreviewView) {\n return null;\n }\n return <NativeLinkPreviewView {...props} />;\n}\n// #endregion\n\n// #region Preview Content View\nexport interface NativeLinkPreviewContentProps extends ViewProps {\n preferredContentSize?: { width: number; height: number };\n}\nconst NativeLinkPreviewContentView: React.ComponentType<NativeLinkPreviewContentProps> | null =\n areNativeViewsAvailable\n ? requireNativeView('ExpoRouterNativeLinkPreview', 'NativeLinkPreviewContentView')\n : null;\n\nexport function NativeLinkPreviewContent(props: NativeLinkPreviewContentProps) {\n if (!NativeLinkPreviewContentView) {\n return null;\n }\n const style = StyleSheet.flatten([\n props.style,\n {\n position: 'absolute',\n top: 0,\n left: 0,\n } as const,\n ]);\n return <NativeLinkPreviewContentView {...props} style={style} />;\n}\n// #endregion\n\n// #region Zoom transition\nconst LinkZoomTransitionEnablerNativeView: React.ComponentType<\n ViewProps & { zoomTransitionSourceIdentifier: string; disableForceFlatten?: boolean }\n> | null = areNativeViewsAvailable\n ? requireNativeView('ExpoRouterNativeLinkPreview', 'LinkZoomTransitionEnabler')\n : null;\nexport function LinkZoomTransitionEnabler(props: {\n zoomTransitionSourceIdentifier: string;\n preventInteractiveDismissal?: boolean;\n}) {\n if (!LinkZoomTransitionEnablerNativeView) {\n return null;\n }\n return (\n <LinkZoomTransitionEnablerNativeView\n {...props}\n disableForceFlatten\n style={{ display: 'contents' }}\n />\n );\n}\n\ninterface LinkSourceAlignmentRect {\n x: number;\n y: number;\n width: number;\n height: number;\n}\n\nconst LinkZoomTransitionSourceNativeView: React.ComponentType<\n ViewProps & {\n identifier: string;\n disableForceFlatten?: boolean;\n alignment?: LinkSourceAlignmentRect;\n }\n> | null = areNativeViewsAvailable\n ? requireNativeView('ExpoRouterNativeLinkPreview', 'LinkZoomTransitionSource')\n : null;\nexport function LinkZoomTransitionSource(\n props: PropsWithChildren<{ identifier: string; alignment?: LinkSourceAlignmentRect }>\n) {\n if (!LinkZoomTransitionSourceNativeView) {\n return null;\n }\n return (\n <LinkZoomTransitionSourceNativeView\n {...props}\n disableForceFlatten\n collapsable={false}\n collapsableChildren={false}\n style={{ display: 'contents' }}\n />\n );\n}\n\nconst LinkZoomTransitionAlignmentRectDetectorNative: React.ComponentType<\n ViewProps & { identifier: string; disableForceFlatten?: boolean; children?: React.ReactNode }\n> | null = areNativeViewsAvailable\n ? requireNativeView('ExpoRouterNativeLinkPreview', 'LinkZoomTransitionAlignmentRectDetector')\n : Fragment;\nexport function LinkZoomTransitionAlignmentRectDetector(props: {\n identifier: string;\n children: React.ReactNode;\n}) {\n if (!LinkZoomTransitionAlignmentRectDetectorNative) {\n return null;\n }\n return (\n <LinkZoomTransitionAlignmentRectDetectorNative\n {...props}\n disableForceFlatten\n collapsable={false}\n collapsableChildren={false}\n style={{ display: 'contents' }}\n />\n );\n}\n// #endregion\n"]}
@@ -211,7 +211,7 @@ export interface LinkProps extends Omit<TextProps, 'href'>, WebAnchorProps {
211
211
  export declare function useInteropClassName(props: {
212
212
  style?: TextProps['style'];
213
213
  className?: string;
214
- }): false | "" | import("react-native").TextStyle | (import("react-native").TextStyle | import("react-native").Falsy | import("react-native").RecursiveArray<import("react-native").TextStyle | import("react-native").Falsy> | readonly (import("react-native").TextStyle | import("react-native").Falsy)[] | {
214
+ }): false | "" | import("react-native").TextStyle | (import("react-native").Falsy | import("react-native").TextStyle | import("react-native").RecursiveArray<import("react-native").Falsy | import("react-native").TextStyle> | readonly (import("react-native").Falsy | import("react-native").TextStyle)[] | {
215
215
  $$css: boolean;
216
216
  __routerLinkClassName: string;
217
217
  })[] | null | undefined;
@@ -0,0 +1,3 @@
1
+ import { type PropsWithChildren } from 'react';
2
+ export declare function LinkAppleZoomTarget({ children }: PropsWithChildren): string | number | bigint | boolean | Iterable<import("react").ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | null | undefined> | import("react").JSX.Element | null | undefined;
3
+ //# sourceMappingURL=link-apple-zoom-target.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"link-apple-zoom-target.d.ts","sourceRoot":"","sources":["../../../src/link/zoom/link-apple-zoom-target.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAK9D,wBAAgB,mBAAmB,CAAC,EAAE,QAAQ,EAAE,EAAE,iBAAiB,+VAgBlE"}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LinkAppleZoomTarget = LinkAppleZoomTarget;
4
+ const react_1 = require("react");
5
+ const zoom_transition_context_1 = require("./zoom-transition-context");
6
+ const native_1 = require("../preview/native");
7
+ function LinkAppleZoomTarget({ children }) {
8
+ if (react_1.Children.count(children) > 1) {
9
+ console.warn('[expo-router] Link.AppleZoomTarget only accepts a single child component. Please wrap multiple children in a View or another container component.');
10
+ return null;
11
+ }
12
+ const { identifier } = (0, react_1.use)(zoom_transition_context_1.ZoomTransitionTargetContext);
13
+ if (!identifier) {
14
+ return children;
15
+ }
16
+ return (<native_1.LinkZoomTransitionAlignmentRectDetector identifier={identifier}>
17
+ {children}
18
+ </native_1.LinkZoomTransitionAlignmentRectDetector>);
19
+ }
20
+ //# sourceMappingURL=link-apple-zoom-target.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"link-apple-zoom-target.js","sourceRoot":"","sources":["../../../src/link/zoom/link-apple-zoom-target.tsx"],"names":[],"mappings":";;AAKA,kDAgBC;AArBD,iCAA8D;AAE9D,uEAAwE;AACxE,8CAA4E;AAE5E,SAAgB,mBAAmB,CAAC,EAAE,QAAQ,EAAqB;IACjE,IAAI,gBAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QACjC,OAAO,CAAC,IAAI,CACV,mJAAmJ,CACpJ,CAAC;QACF,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,EAAE,UAAU,EAAE,GAAG,IAAA,WAAG,EAAC,qDAA2B,CAAC,CAAC;IACxD,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,OAAO,QAAQ,CAAC;IAClB,CAAC;IACD,OAAO,CACL,CAAC,gDAAuC,CAAC,UAAU,CAAC,CAAC,UAAU,CAAC,CAC9D;MAAA,CAAC,QAAQ,CACX;IAAA,EAAE,gDAAuC,CAAC,CAC3C,CAAC;AACJ,CAAC","sourcesContent":["import { Children, use, type PropsWithChildren } from 'react';\n\nimport { ZoomTransitionTargetContext } from './zoom-transition-context';\nimport { LinkZoomTransitionAlignmentRectDetector } from '../preview/native';\n\nexport function LinkAppleZoomTarget({ children }: PropsWithChildren) {\n if (Children.count(children) > 1) {\n console.warn(\n '[expo-router] Link.AppleZoomTarget only accepts a single child component. Please wrap multiple children in a View or another container component.'\n );\n return null;\n }\n const { identifier } = use(ZoomTransitionTargetContext);\n if (!identifier) {\n return children;\n }\n return (\n <LinkZoomTransitionAlignmentRectDetector identifier={identifier}>\n {children}\n </LinkZoomTransitionAlignmentRectDetector>\n );\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"useZoomTransitionPrimitives.ios.d.ts","sourceRoot":"","sources":["../../../src/link/zoom/useZoomTransitionPrimitives.ios.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,wBAAgB,2BAA2B,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,SAAS;;;;;;;;EAqEvE"}
1
+ {"version":3,"file":"useZoomTransitionPrimitives.ios.d.ts","sourceRoot":"","sources":["../../../src/link/zoom/useZoomTransitionPrimitives.ios.tsx"],"names":[],"mappings":"AASA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,wBAAgB,2BAA2B,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,SAAS;;;;;;;;EAuEvE"}
@@ -6,6 +6,7 @@ const non_secure_1 = require("nanoid/non-secure");
6
6
  const react_1 = require("react");
7
7
  const ZoomTransitionEnabler_1 = require("./ZoomTransitionEnabler");
8
8
  const navigationParams_1 = require("../../navigationParams");
9
+ const url_1 = require("../../utils/url");
9
10
  const PreviewRouteContext_1 = require("../preview/PreviewRouteContext");
10
11
  function useZoomTransitionPrimitives({ href, asChild }) {
11
12
  const isPreview = (0, PreviewRouteContext_1.useIsPreview)();
@@ -46,9 +47,11 @@ function useZoomTransitionPrimitives({ href, asChild }) {
46
47
  return href;
47
48
  }
48
49
  if (typeof href === 'string') {
50
+ const { pathname, searchParams } = (0, url_1.parseUrlUsingCustomBase)(href);
49
51
  return {
50
- pathname: href,
52
+ pathname,
51
53
  params: {
54
+ ...Object.fromEntries(searchParams.entries()),
52
55
  [navigationParams_1.INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SOURCE_ID_PARAM_NAME]: zoomTransitionId,
53
56
  },
54
57
  };
@@ -1 +1 @@
1
- {"version":3,"file":"useZoomTransitionPrimitives.ios.js","sourceRoot":"","sources":["../../../src/link/zoom/useZoomTransitionPrimitives.ios.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;AAUb,kEAqEC;AA7ED,kDAA2C;AAC3C,iCAAkE;AAElE,mEAAkE;AAClE,6DAAmG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IAE7B,MAAM,gCAAgC,GAAG,IAAA,eAAO,EAAC,GAAG,EAAE;QACpD,IAAI,CAAC,gBAAgB,EAAE,CAAC;YACtB,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,OAAO;YACL,UAAU,EAAE,gBAAgB;YAC5B,SAAS;YACT,YAAY;YACZ,YAAY,EAAE,CAAC,aAAa;SAC7B,CAAC;IACJ,CAAC,EAAE,CAAC,gBAAgB,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,CAAC,CAAC,CAAC;IAE/D,MAAM,YAAY,GAAG,IAAA,eAAO,EAAC,GAAG,EAAE;QAChC,IAAI,CAAC,aAAa,IAAI,CAAC,gBAAgB,EAAE,CAAC;YACxC,OAAO,IAAI,CAAC;QACd,CAAC;QACD,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;YAC7B,OAAO;gBACL,QAAQ,EAAE,IAAI;gBACd,MAAM,EAAE;oBACN,CAAC,4EAAyD,CAAC,EAAE,gBAAgB;iBAC9E;aACF,CAAC;QACJ,CAAC;QACD,OAAO;YACL,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,MAAM,EAAE;gBACN,GAAG,CAAC,IAAI,CAAC,MAAM,IAAI,EAAE,CAAC;gBACtB,CAAC,4EAAyD,CAAC,EAAE,gBAAgB;aAC9E;SACF,CAAC;IACJ,CAAC,EAAE,CAAC,IAAI,EAAE,gBAAgB,EAAE,aAAa,CAAC,CAAC,CAAC;IAC5C,OAAO,EAAE,gCAAgC,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;AAClE,CAAC","sourcesContent":["'use client';\n\nimport { nanoid } from 'nanoid/non-secure';\nimport { useCallback, useEffect, useMemo, useState } from 'react';\n\nimport { isZoomTransitionEnabled } from './ZoomTransitionEnabler';\nimport { INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SOURCE_ID_PARAM_NAME } from '../../navigationParams';\nimport { useIsPreview } from '../preview/PreviewRouteContext';\nimport { LinkProps } from '../useLinkHooks';\n\nexport function useZoomTransitionPrimitives({ href, asChild }: LinkProps) {\n const isPreview = useIsPreview();\n const zoomTransitionId = useMemo(\n () =>\n !isPreview && process.env.EXPO_OS === 'ios' && isZoomTransitionEnabled()\n ? nanoid()\n : undefined,\n []\n );\n\n const [numberOfSources, setNumberOfSources] = useState(0);\n const addSource = useCallback(() => {\n setNumberOfSources((prev) => prev + 1);\n }, []);\n const removeSource = useCallback(() => {\n setNumberOfSources((prev) => prev - 1);\n }, []);\n\n const hasZoomSource = numberOfSources > 0;\n\n useEffect(() => {\n if (numberOfSources > 1) {\n throw new Error(\n '[expo-router] Only one Link.ZoomTransitionSource can be used within a single Link component.'\n );\n }\n }, [numberOfSources]);\n\n useEffect(() => {\n if (hasZoomSource && !asChild) {\n console.warn(\n '[expo-router] Using zoom transition links without `asChild` prop may lead to unexpected behavior. Please ensure to set `asChild` when using zoom transitions.'\n );\n }\n }, [hasZoomSource, asChild]);\n\n const zoomTransitionSourceContextValue = useMemo(() => {\n if (!zoomTransitionId) {\n return undefined;\n }\n return {\n identifier: zoomTransitionId,\n addSource,\n removeSource,\n canAddSource: !hasZoomSource,\n };\n }, [zoomTransitionId, addSource, removeSource, hasZoomSource]);\n\n const computedHref = useMemo(() => {\n if (!hasZoomSource || !zoomTransitionId) {\n return href;\n }\n if (typeof href === 'string') {\n return {\n pathname: href,\n params: {\n [INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SOURCE_ID_PARAM_NAME]: zoomTransitionId,\n },\n };\n }\n return {\n pathname: href.pathname,\n params: {\n ...(href.params ?? {}),\n [INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SOURCE_ID_PARAM_NAME]: zoomTransitionId,\n },\n };\n }, [href, zoomTransitionId, hasZoomSource]);\n return { zoomTransitionSourceContextValue, href: computedHref };\n}\n"]}
1
+ {"version":3,"file":"useZoomTransitionPrimitives.ios.js","sourceRoot":"","sources":["../../../src/link/zoom/useZoomTransitionPrimitives.ios.tsx"],"names":[],"mappings":";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cesContent":["'use client';\n\nimport { nanoid } from 'nanoid/non-secure';\nimport { useCallback, useEffect, useMemo, useState } from 'react';\n\nimport { isZoomTransitionEnabled } from './ZoomTransitionEnabler';\nimport { INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SOURCE_ID_PARAM_NAME } from '../../navigationParams';\nimport { parseUrlUsingCustomBase } from '../../utils/url';\nimport { useIsPreview } from '../preview/PreviewRouteContext';\nimport { LinkProps } from '../useLinkHooks';\n\nexport function useZoomTransitionPrimitives({ href, asChild }: LinkProps) {\n const isPreview = useIsPreview();\n const zoomTransitionId = useMemo(\n () =>\n !isPreview && process.env.EXPO_OS === 'ios' && isZoomTransitionEnabled()\n ? nanoid()\n : undefined,\n []\n );\n\n const [numberOfSources, setNumberOfSources] = useState(0);\n const addSource = useCallback(() => {\n setNumberOfSources((prev) => prev + 1);\n }, []);\n const removeSource = useCallback(() => {\n setNumberOfSources((prev) => prev - 1);\n }, []);\n\n const hasZoomSource = numberOfSources > 0;\n\n useEffect(() => {\n if (numberOfSources > 1) {\n throw new Error(\n '[expo-router] Only one Link.ZoomTransitionSource can be used within a single Link component.'\n );\n }\n }, [numberOfSources]);\n\n useEffect(() => {\n if (hasZoomSource && !asChild) {\n console.warn(\n '[expo-router] Using zoom transition links without `asChild` prop may lead to unexpected behavior. Please ensure to set `asChild` when using zoom transitions.'\n );\n }\n }, [hasZoomSource, asChild]);\n\n const zoomTransitionSourceContextValue = useMemo(() => {\n if (!zoomTransitionId) {\n return undefined;\n }\n return {\n identifier: zoomTransitionId,\n addSource,\n removeSource,\n canAddSource: !hasZoomSource,\n };\n }, [zoomTransitionId, addSource, removeSource, hasZoomSource]);\n\n const computedHref = useMemo(() => {\n if (!hasZoomSource || !zoomTransitionId) {\n return href;\n }\n if (typeof href === 'string') {\n const { pathname, searchParams } = parseUrlUsingCustomBase(href);\n return {\n pathname,\n params: {\n ...Object.fromEntries(searchParams.entries()),\n [INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SOURCE_ID_PARAM_NAME]: zoomTransitionId,\n },\n };\n }\n return {\n pathname: href.pathname,\n params: {\n ...(href.params ?? {}),\n [INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SOURCE_ID_PARAM_NAME]: zoomTransitionId,\n },\n };\n }, [href, zoomTransitionId, hasZoomSource]);\n return { zoomTransitionSourceContextValue, href: computedHref };\n}\n"]}
@@ -1,7 +1,14 @@
1
+ import { type PropsWithChildren } from 'react';
1
2
  export type ZoomTransitionSourceContextValueType = {
2
3
  identifier: string;
3
4
  addSource: () => void;
4
5
  removeSource: () => void;
5
6
  } | undefined;
6
7
  export declare const ZoomTransitionSourceContext: import("react").Context<ZoomTransitionSourceContextValueType>;
8
+ export declare const ZoomTransitionTargetContext: import("react").Context<{
9
+ identifier: string | null;
10
+ }>;
11
+ export declare function ZoomTransitionTargetContextProvider({ route, children, }: PropsWithChildren<{
12
+ route: unknown;
13
+ }>): string | number | bigint | boolean | Iterable<import("react").ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | null | undefined> | import("react").JSX.Element | null | undefined;
7
14
  //# sourceMappingURL=zoom-transition-context.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"zoom-transition-context.d.ts","sourceRoot":"","sources":["../../../src/link/zoom/zoom-transition-context.tsx"],"names":[],"mappings":"AAEA,MAAM,MAAM,oCAAoC,GAC5C;IACE,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,YAAY,EAAE,MAAM,IAAI,CAAC;CAC1B,GACD,SAAS,CAAC;AAEd,eAAO,MAAM,2BAA2B,+DACwB,CAAC"}
1
+ {"version":3,"file":"zoom-transition-context.d.ts","sourceRoot":"","sources":["../../../src/link/zoom/zoom-transition-context.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAiB,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAU9D,MAAM,MAAM,oCAAoC,GAC5C;IACE,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,YAAY,EAAE,MAAM,IAAI,CAAC;CAC1B,GACD,SAAS,CAAC;AAEd,eAAO,MAAM,2BAA2B,+DACwB,CAAC;AAEjE,eAAO,MAAM,2BAA2B;gBAA+B,MAAM,GAAG,IAAI;EAElF,CAAC;AAEH,wBAAgB,mCAAmC,CAAC,EAClD,KAAK,EACL,QAAQ,GACT,EAAE,iBAAiB,CAAC;IAAE,KAAK,EAAE,OAAO,CAAA;CAAE,CAAC,+VA4BvC"}