expo-router 7.0.0-canary-20251210-1f163e3 → 7.0.0-canary-20251212-acb11f2

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 (86) hide show
  1. package/android/build.gradle +2 -2
  2. package/build/link/ExpoLink.d.ts.map +1 -1
  3. package/build/link/ExpoLink.js +10 -9
  4. package/build/link/ExpoLink.js.map +1 -1
  5. package/build/link/useLinkHooks.d.ts +1 -1
  6. package/build/link/zoom/ZoomTransitionEnabler.ios.d.ts.map +1 -1
  7. package/build/link/zoom/ZoomTransitionEnabler.ios.js +4 -2
  8. package/build/link/zoom/ZoomTransitionEnabler.ios.js.map +1 -1
  9. package/build/link/zoom/link-apple-zoom.js +7 -2
  10. package/build/link/zoom/link-apple-zoom.js.map +1 -1
  11. package/build/link/zoom/useZoomHref.d.ts +3 -0
  12. package/build/link/zoom/useZoomHref.d.ts.map +1 -0
  13. package/build/link/zoom/useZoomHref.ios.d.ts +3 -0
  14. package/build/link/zoom/useZoomHref.ios.d.ts.map +1 -0
  15. package/build/link/zoom/useZoomHref.ios.js +38 -0
  16. package/build/link/zoom/useZoomHref.ios.js.map +1 -0
  17. package/build/link/zoom/useZoomHref.js +8 -0
  18. package/build/link/zoom/useZoomHref.js.map +1 -0
  19. package/build/link/zoom/zoom-transition-context-providers.d.ts +4 -0
  20. package/build/link/zoom/zoom-transition-context-providers.d.ts.map +1 -0
  21. package/build/link/zoom/zoom-transition-context-providers.ios.d.ts +4 -0
  22. package/build/link/zoom/zoom-transition-context-providers.ios.d.ts.map +1 -0
  23. package/build/link/zoom/zoom-transition-context-providers.ios.js +71 -0
  24. package/build/link/zoom/zoom-transition-context-providers.ios.js.map +1 -0
  25. package/build/link/zoom/zoom-transition-context-providers.js +11 -0
  26. package/build/link/zoom/zoom-transition-context-providers.js.map +1 -0
  27. package/build/link/zoom/zoom-transition-context-providers.types.d.ts +9 -0
  28. package/build/link/zoom/zoom-transition-context-providers.types.d.ts.map +1 -0
  29. package/build/link/zoom/zoom-transition-context-providers.types.js +3 -0
  30. package/build/link/zoom/zoom-transition-context-providers.types.js.map +1 -0
  31. package/build/link/zoom/zoom-transition-context.d.ts +4 -6
  32. package/build/link/zoom/zoom-transition-context.d.ts.map +1 -1
  33. package/build/link/zoom/zoom-transition-context.js +0 -27
  34. package/build/link/zoom/zoom-transition-context.js.map +1 -1
  35. package/build/onboard/Tutorial.d.ts.map +1 -1
  36. package/build/onboard/Tutorial.js +19 -8
  37. package/build/onboard/Tutorial.js.map +1 -1
  38. package/build/useScreens.js +3 -3
  39. package/build/useScreens.js.map +1 -1
  40. package/expo-module.config.json +1 -1
  41. 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 → 7.0.0-canary-20251212-acb11f2/expo.modules.router-7.0.0-canary-20251212-acb11f2.module} +7 -7
  42. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251212-acb11f2/expo.modules.router-7.0.0-canary-20251212-acb11f2.module.md5 +1 -0
  43. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251212-acb11f2/expo.modules.router-7.0.0-canary-20251212-acb11f2.module.sha1 +1 -0
  44. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251212-acb11f2/expo.modules.router-7.0.0-canary-20251212-acb11f2.module.sha256 +1 -0
  45. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251212-acb11f2/expo.modules.router-7.0.0-canary-20251212-acb11f2.module.sha512 +1 -0
  46. 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 → 7.0.0-canary-20251212-acb11f2/expo.modules.router-7.0.0-canary-20251212-acb11f2.pom} +1 -1
  47. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251212-acb11f2/expo.modules.router-7.0.0-canary-20251212-acb11f2.pom.md5 +1 -0
  48. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251212-acb11f2/expo.modules.router-7.0.0-canary-20251212-acb11f2.pom.sha1 +1 -0
  49. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251212-acb11f2/expo.modules.router-7.0.0-canary-20251212-acb11f2.pom.sha256 +1 -0
  50. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251212-acb11f2/expo.modules.router-7.0.0-canary-20251212-acb11f2.pom.sha512 +1 -0
  51. package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml +4 -4
  52. package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml.md5 +1 -1
  53. package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml.sha1 +1 -1
  54. package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml.sha256 +1 -1
  55. package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml.sha512 +1 -1
  56. package/package.json +12 -12
  57. package/build/link/zoom/useZoomTransitionPrimitives.d.ts +0 -6
  58. package/build/link/zoom/useZoomTransitionPrimitives.d.ts.map +0 -1
  59. package/build/link/zoom/useZoomTransitionPrimitives.ios.d.ts +0 -11
  60. package/build/link/zoom/useZoomTransitionPrimitives.ios.d.ts.map +0 -1
  61. package/build/link/zoom/useZoomTransitionPrimitives.ios.js +0 -69
  62. package/build/link/zoom/useZoomTransitionPrimitives.ios.js.map +0 -1
  63. package/build/link/zoom/useZoomTransitionPrimitives.js +0 -9
  64. package/build/link/zoom/useZoomTransitionPrimitives.js.map +0 -1
  65. package/build/onboard/createEntryFile.d.ts +0 -4
  66. package/build/onboard/createEntryFile.d.ts.map +0 -1
  67. package/build/onboard/createEntryFile.js +0 -63
  68. package/build/onboard/createEntryFile.js.map +0 -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.module.md5 +0 -1
  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.module.sha1 +0 -1
  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.module.sha256 +0 -1
  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.module.sha512 +0 -1
  73. 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 +0 -1
  74. 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 +0 -1
  75. 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 +0 -1
  76. 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 +0 -1
  77. /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-sources.jar → 7.0.0-canary-20251212-acb11f2/expo.modules.router-7.0.0-canary-20251212-acb11f2-sources.jar} +0 -0
  78. /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-sources.jar.md5 → 7.0.0-canary-20251212-acb11f2/expo.modules.router-7.0.0-canary-20251212-acb11f2-sources.jar.md5} +0 -0
  79. /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-sources.jar.sha1 → 7.0.0-canary-20251212-acb11f2/expo.modules.router-7.0.0-canary-20251212-acb11f2-sources.jar.sha1} +0 -0
  80. /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-sources.jar.sha256 → 7.0.0-canary-20251212-acb11f2/expo.modules.router-7.0.0-canary-20251212-acb11f2-sources.jar.sha256} +0 -0
  81. /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-sources.jar.sha512 → 7.0.0-canary-20251212-acb11f2/expo.modules.router-7.0.0-canary-20251212-acb11f2-sources.jar.sha512} +0 -0
  82. /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.aar → 7.0.0-canary-20251212-acb11f2/expo.modules.router-7.0.0-canary-20251212-acb11f2.aar} +0 -0
  83. /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.aar.md5 → 7.0.0-canary-20251212-acb11f2/expo.modules.router-7.0.0-canary-20251212-acb11f2.aar.md5} +0 -0
  84. /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.aar.sha1 → 7.0.0-canary-20251212-acb11f2/expo.modules.router-7.0.0-canary-20251212-acb11f2.aar.sha1} +0 -0
  85. /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.aar.sha256 → 7.0.0-canary-20251212-acb11f2/expo.modules.router-7.0.0-canary-20251212-acb11f2.aar.sha256} +0 -0
  86. /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.aar.sha512 → 7.0.0-canary-20251212-acb11f2/expo.modules.router-7.0.0-canary-20251212-acb11f2.aar.sha512} +0 -0
@@ -4,13 +4,13 @@ plugins {
4
4
  }
5
5
 
6
6
  group = 'expo.modules.router'
7
- version = '7.0.0-canary-20251210-1f163e3'
7
+ version = '7.0.0-canary-20251212-acb11f2'
8
8
 
9
9
  android {
10
10
  namespace "expo.modules.router"
11
11
  defaultConfig {
12
12
  versionCode 1
13
- versionName "7.0.0-canary-20251210-1f163e3"
13
+ versionName "7.0.0-canary-20251212-acb11f2"
14
14
  }
15
15
  lintOptions {
16
16
  abortOnError false
@@ -1 +1 @@
1
- {"version":3,"file":"ExpoLink.d.ts","sourceRoot":"","sources":["../../src/link/ExpoLink.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAmC,MAAM,OAAO,CAAC;AAMxD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAK3C,wBAAgB,QAAQ,CAAC,KAAK,EAAE,SAAS,qBA4BxC"}
1
+ {"version":3,"file":"ExpoLink.d.ts","sourceRoot":"","sources":["../../src/link/ExpoLink.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAmC,MAAM,OAAO,CAAC;AAMxD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAK3C,wBAAgB,QAAQ,CAAC,KAAK,EAAE,SAAS,qBAMxC"}
@@ -44,29 +44,30 @@ const BaseExpoRouterLink_1 = require("./BaseExpoRouterLink");
44
44
  const LinkWithPreview_1 = require("./LinkWithPreview");
45
45
  const elements_1 = require("./elements");
46
46
  const PreviewRouteContext_1 = require("./preview/PreviewRouteContext");
47
- const useZoomTransitionPrimitives_1 = require("./zoom/useZoomTransitionPrimitives");
47
+ const useZoomHref_1 = require("./zoom/useZoomHref");
48
48
  const url_1 = require("../utils/url");
49
- const zoom_transition_context_1 = require("./zoom/zoom-transition-context");
49
+ const zoom_transition_context_providers_1 = require("./zoom/zoom-transition-context-providers");
50
50
  function ExpoLink(props) {
51
+ return (<zoom_transition_context_providers_1.ZoomTransitionSourceContextProvider linkProps={props}>
52
+ <ExpoLinkImpl {...props}/>
53
+ </zoom_transition_context_providers_1.ZoomTransitionSourceContextProvider>);
54
+ }
55
+ function ExpoLinkImpl(props) {
51
56
  const isPreview = (0, PreviewRouteContext_1.useIsPreview)();
52
- const { zoomTransitionSourceContextValue, href } = (0, useZoomTransitionPrimitives_1.useZoomTransitionPrimitives)(props);
57
+ const href = (0, useZoomHref_1.useZoomHref)(props);
53
58
  const shouldUseLinkWithPreview = process.env.EXPO_OS === 'ios' &&
54
59
  isLinkWithPreview(props) &&
55
60
  !isPreview &&
56
61
  expo_constants_1.default?.expoConfig?.newArchEnabled !== false;
57
62
  if (shouldUseLinkWithPreview) {
58
- return (<zoom_transition_context_1.ZoomTransitionSourceContext value={zoomTransitionSourceContextValue}>
59
- <LinkWithPreview_1.LinkWithPreview {...props} href={href} hrefForPreviewNavigation={props.href}/>
60
- </zoom_transition_context_1.ZoomTransitionSourceContext>);
63
+ return <LinkWithPreview_1.LinkWithPreview {...props} href={href} hrefForPreviewNavigation={props.href}/>;
61
64
  }
62
65
  let children = props.children;
63
66
  if (react_1.default.Children.count(props.children) > 1) {
64
67
  const arrayChildren = react_1.default.Children.toArray(props.children).filter((child) => !(0, react_1.isValidElement)(child) || (child.type !== elements_1.LinkPreview && child.type !== elements_1.LinkMenu));
65
68
  children = arrayChildren.length === 1 ? arrayChildren[0] : props.children;
66
69
  }
67
- return (<zoom_transition_context_1.ZoomTransitionSourceContext value={zoomTransitionSourceContextValue}>
68
- <BaseExpoRouterLink_1.BaseExpoRouterLink {...props} href={href} children={children}/>
69
- </zoom_transition_context_1.ZoomTransitionSourceContext>);
70
+ return <BaseExpoRouterLink_1.BaseExpoRouterLink {...props} href={href} children={children}/>;
70
71
  }
71
72
  function isLinkWithPreview(props) {
72
73
  const isExternal = (0, url_1.shouldLinkExternally)(String(props.href));
@@ -1 +1 @@
1
- {"version":3,"file":"ExpoLink.js","sourceRoot":"","sources":["../../src/link/ExpoLink.tsx"],"names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W,IAAI,KAAK,CAAC,IAAI,KAAK,mBAAQ,CAAC,CAC7F,CAAC;QACF,QAAQ,GAAG,aAAa,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC;IAC5E,CAAC;IAED,OAAO,CACL,CAAC,qDAA2B,CAAC,KAAK,CAAC,CAAC,gCAAgC,CAAC,CACnE;MAAA,CAAC,uCAAkB,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,EAChE;IAAA,EAAE,qDAA2B,CAAC,CAC/B,CAAC;AACJ,CAAC;AAED,SAAS,iBAAiB,CAAC,KAAgB;IACzC,MAAM,UAAU,GAAG,IAAA,0BAAoB,EAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;IAC5D,OAAO,gBAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,IAAI,CAC1C,CAAC,KAAK,EAAE,EAAE,CACR,IAAA,sBAAc,EAAC,KAAK,CAAC;QACrB,CAAC,CAAC,CAAC,UAAU,IAAI,KAAK,CAAC,IAAI,KAAK,sBAAW,CAAC,IAAI,KAAK,CAAC,IAAI,KAAK,mBAAQ,CAAC,CAC3E,CAAC;AACJ,CAAC","sourcesContent":["'use client';\n\nimport Constants from 'expo-constants';\nimport React, { Children, isValidElement } from 'react';\n\nimport { BaseExpoRouterLink } from './BaseExpoRouterLink';\nimport { LinkWithPreview } from './LinkWithPreview';\nimport { LinkMenu, LinkPreview } from './elements';\nimport { useIsPreview } from './preview/PreviewRouteContext';\nimport { LinkProps } from './useLinkHooks';\nimport { useZoomTransitionPrimitives } from './zoom/useZoomTransitionPrimitives';\nimport { shouldLinkExternally } from '../utils/url';\nimport { ZoomTransitionSourceContext } from './zoom/zoom-transition-context';\n\nexport function ExpoLink(props: LinkProps) {\n const isPreview = useIsPreview();\n const { zoomTransitionSourceContextValue, href } = useZoomTransitionPrimitives(props);\n const shouldUseLinkWithPreview =\n process.env.EXPO_OS === 'ios' &&\n isLinkWithPreview(props) &&\n !isPreview &&\n Constants?.expoConfig?.newArchEnabled !== false;\n if (shouldUseLinkWithPreview) {\n return (\n <ZoomTransitionSourceContext value={zoomTransitionSourceContextValue}>\n <LinkWithPreview {...props} href={href} hrefForPreviewNavigation={props.href} />\n </ZoomTransitionSourceContext>\n );\n }\n let children = props.children;\n if (React.Children.count(props.children) > 1) {\n const arrayChildren = React.Children.toArray(props.children).filter(\n (child) => !isValidElement(child) || (child.type !== LinkPreview && child.type !== LinkMenu)\n );\n children = arrayChildren.length === 1 ? arrayChildren[0] : props.children;\n }\n\n return (\n <ZoomTransitionSourceContext value={zoomTransitionSourceContextValue}>\n <BaseExpoRouterLink {...props} href={href} children={children} />\n </ZoomTransitionSourceContext>\n );\n}\n\nfunction isLinkWithPreview(props: LinkProps): boolean {\n const isExternal = shouldLinkExternally(String(props.href));\n return Children.toArray(props.children).some(\n (child) =>\n isValidElement(child) &&\n ((!isExternal && child.type === LinkPreview) || child.type === LinkMenu)\n );\n}\n"]}
1
+ {"version":3,"file":"ExpoLink.js","sourceRoot":"","sources":["../../src/link/ExpoLink.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcb,4BAMC;AAlBD,oEAAuC;AACvC,+CAAwD;AAExD,6DAA0D;AAC1D,uDAAoD;AACpD,yCAAmD;AACnD,uEAA6D;AAE7D,oDAAiD;AACjD,sCAAoD;AACpD,gGAA+F;AAE/F,SAAgB,QAAQ,CAAC,KAAgB;IACvC,OAAO,CACL,CAAC,uEAAmC,CAAC,SAAS,CAAC,CAAC,KAAK,CAAC,CACpD;MAAA,CAAC,YAAY,CAAC,IAAI,KAAK,CAAC,EAC1B;IAAA,EAAE,uEAAmC,CAAC,CACvC,CAAC;AACJ,CA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C;AAED,SAAS,iBAAiB,CAAC,KAAgB;IACzC,MAAM,UAAU,GAAG,IAAA,0BAAoB,EAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;IAC5D,OAAO,gBAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,IAAI,CAC1C,CAAC,KAAK,EAAE,EAAE,CACR,IAAA,sBAAc,EAAC,KAAK,CAAC;QACrB,CAAC,CAAC,CAAC,UAAU,IAAI,KAAK,CAAC,IAAI,KAAK,sBAAW,CAAC,IAAI,KAAK,CAAC,IAAI,KAAK,mBAAQ,CAAC,CAC3E,CAAC;AACJ,CAAC","sourcesContent":["'use client';\n\nimport Constants from 'expo-constants';\nimport React, { Children, isValidElement } from 'react';\n\nimport { BaseExpoRouterLink } from './BaseExpoRouterLink';\nimport { LinkWithPreview } from './LinkWithPreview';\nimport { LinkMenu, LinkPreview } from './elements';\nimport { useIsPreview } from './preview/PreviewRouteContext';\nimport { LinkProps } from './useLinkHooks';\nimport { useZoomHref } from './zoom/useZoomHref';\nimport { shouldLinkExternally } from '../utils/url';\nimport { ZoomTransitionSourceContextProvider } from './zoom/zoom-transition-context-providers';\n\nexport function ExpoLink(props: LinkProps) {\n return (\n <ZoomTransitionSourceContextProvider linkProps={props}>\n <ExpoLinkImpl {...props} />\n </ZoomTransitionSourceContextProvider>\n );\n}\n\nfunction ExpoLinkImpl(props: LinkProps) {\n const isPreview = useIsPreview();\n const href = useZoomHref(props);\n const shouldUseLinkWithPreview =\n process.env.EXPO_OS === 'ios' &&\n isLinkWithPreview(props) &&\n !isPreview &&\n Constants?.expoConfig?.newArchEnabled !== false;\n if (shouldUseLinkWithPreview) {\n return <LinkWithPreview {...props} href={href} hrefForPreviewNavigation={props.href} />;\n }\n let children = props.children;\n if (React.Children.count(props.children) > 1) {\n const arrayChildren = React.Children.toArray(props.children).filter(\n (child) => !isValidElement(child) || (child.type !== LinkPreview && child.type !== LinkMenu)\n );\n children = arrayChildren.length === 1 ? arrayChildren[0] : props.children;\n }\n\n return <BaseExpoRouterLink {...props} href={href} children={children} />;\n}\n\nfunction isLinkWithPreview(props: LinkProps): boolean {\n const isExternal = shouldLinkExternally(String(props.href));\n return Children.toArray(props.children).some(\n (child) =>\n isValidElement(child) &&\n ((!isExternal && child.type === LinkPreview) || child.type === LinkMenu)\n );\n}\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").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)[] | {
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)[] | {
215
215
  $$css: boolean;
216
216
  __routerLinkClassName: string;
217
217
  })[] | null | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"ZoomTransitionEnabler.ios.d.ts","sourceRoot":"","sources":["../../../src/link/zoom/ZoomTransitionEnabler.ios.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAahF,wBAAgB,oBAAoB,SAGnC;AAED,wBAAgB,uBAAuB,YAEtC;AAED,wBAAgB,qBAAqB,CAAC,EAAE,KAAK,EAAE,EAAE,0BAA0B,sCAmC1E"}
1
+ {"version":3,"file":"ZoomTransitionEnabler.ios.d.ts","sourceRoot":"","sources":["../../../src/link/zoom/ZoomTransitionEnabler.ios.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAahF,wBAAgB,oBAAoB,SAKnC;AAED,wBAAgB,uBAAuB,YAEtC;AAED,wBAAgB,qBAAqB,CAAC,EAAE,KAAK,EAAE,EAAE,0BAA0B,sCAmC1E"}
@@ -10,8 +10,10 @@ const PreviewRouteContext_1 = require("../preview/PreviewRouteContext");
10
10
  const native_1 = require("../preview/native");
11
11
  let _isZoomTransitionEnabled = false;
12
12
  function enableZoomTransition() {
13
- console.warn('[expo-router] Zoom transition is an experimental feature. Use at your own risk.');
14
- _isZoomTransitionEnabled = true;
13
+ if (process.env.EXPO_OS === 'ios') {
14
+ console.warn('[expo-router] Zoom transition is an experimental feature. Use at your own risk.');
15
+ _isZoomTransitionEnabled = true;
16
+ }
15
17
  }
16
18
  function isZoomTransitionEnabled() {
17
19
  return _isZoomTransitionEnabled;
@@ -1 +1 @@
1
- {"version":3,"file":"ZoomTransitionEnabler.ios.js","sourceRoot":"","sources":["../../../src/link/zoom/ZoomTransitionEnabler.ios.tsx"],"names":[],"mappings":";;AAeA,oDAGC;AAED,0DAEC;AAED,sDAmCC;AA3DD,iCAA4B;AAG5B,qFAAiF;AACjF,6DAKgC;AAChC,wEAA8D;AAC9D,8CAA8D;AAE9D,IAAI,wBAAwB,GAAG,KAAK,CAAC;AAErC,SAAgB,oBAAoB;IAClC,OAAO,CAAC,IAAI,CAAC,iFAAiF,CAAC,CAAC;IAChG,wBAAwB,GAAG,IAAI,CAAC;AAClC,CAAC;AAED,SAAgB,uBAAuB;IACrC,OAAO,wBAAwB,CAAC;AAClC,CAAC;AAED,SAAgB,qBAAqB,CAAC,EAAE,KAAK,EAA8B;IACzE,MAAM,SAAS,GAAG,IAAA,kCAAY,GAAE,CAAC;IACjC,IACE,uBAAuB,EAAE;QACzB,CAAC,SAAS;QACV,KAAK;QACL,OAAO,KAAK,KAAK,QAAQ;QACzB,QAAQ,IAAI,KAAK;QACjB,OAAO,KAAK,CAAC,MAAM,KAAK,QAAQ;QAChC,KAAK,IAAI,KAAK;QACd,OAAO,KAAK,CAAC,GAAG,KAAK,QAAQ,EAC7B,CAAC;QACD,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,IAAI,EAAE,CAAC;QAClC,MAAM,cAAc,GAAG,IAAA,8CAA2B,EAAC,MAAM,CAAC,CAAC;QAC3D,MAAM,gBAAgB,GACpB,cAAc,CAAC,4EAAyD,CAAC,CAAC;QAC5E,MAAM,sBAAsB,GAC1B,cAAc,CAAC,4EAAyD,CAAC,CAAC;QAC5E,MAAM,uBAAuB,GAC3B,CAAC,CAAC,cAAc,CAAC,wEAAqD,CAAC,CAAC;QAC1E,MAAM,iBAAiB,GACrB,CAAC,CAAC,gBAAgB,IAAI,sBAAsB,KAAK,KAAK,CAAC,GAAG,IAAI,CAAC,uBAAuB,CAAC;QACzF,IAAI,iBAAiB,IAAI,OAAO,gBAAgB,KAAK,QAAQ,EAAE,CAAC;YAC9D,MAAM,cAAc,GAAG,IAAA,WAAG,EAAC,wCAAkB,CAAC,CAAC;YAC/C,MAAM,iBAAiB,GAAG,cAAc,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YACpD,MAAM,2BAA2B,GAAG,iBAAiB,EAAE,OAAO,EAAE,cAAc,KAAK,KAAK,CAAC;YACzF,OAAO,CACL,CAAC,kCAAyB,CACxB,8BAA8B,CAAC,CAAC,gBAAgB,CAAC,CACjD,2BAA2B,CAAC,CAAC,2BAA2B,CAAC,EACzD,CACH,CAAC;QACJ,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import { use } from 'react';\n\nimport type { ZoomTransitionEnablerProps } from './ZoomTransitionEnabler.types';\nimport { DescriptorsContext } from '../../fork/native-stack/descriptors-context';\nimport {\n getInternalExpoRouterParams,\n INTERNAL_EXPO_ROUTER_IS_PREVIEW_NAVIGATION_PARAM_NAME,\n INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SCREEN_ID_PARAM_NAME,\n INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SOURCE_ID_PARAM_NAME,\n} from '../../navigationParams';\nimport { useIsPreview } from '../preview/PreviewRouteContext';\nimport { LinkZoomTransitionEnabler } from '../preview/native';\n\nlet _isZoomTransitionEnabled = false;\n\nexport function enableZoomTransition() {\n console.warn('[expo-router] Zoom transition is an experimental feature. Use at your own risk.');\n _isZoomTransitionEnabled = true;\n}\n\nexport function isZoomTransitionEnabled() {\n return _isZoomTransitionEnabled;\n}\n\nexport function ZoomTransitionEnabler({ route }: ZoomTransitionEnablerProps) {\n const isPreview = useIsPreview();\n if (\n isZoomTransitionEnabled() &&\n !isPreview &&\n route &&\n typeof route === 'object' &&\n 'params' in route &&\n typeof route.params === 'object' &&\n 'key' in route &&\n typeof route.key === 'string'\n ) {\n const params = route.params ?? {};\n const internalParams = getInternalExpoRouterParams(params);\n const zoomTransitionId =\n internalParams[INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SOURCE_ID_PARAM_NAME];\n const zoomTransitionScreenId =\n internalParams[INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SCREEN_ID_PARAM_NAME];\n const isLinkPreviewNavigation =\n !!internalParams[INTERNAL_EXPO_ROUTER_IS_PREVIEW_NAVIGATION_PARAM_NAME];\n const hasZoomTransition =\n !!zoomTransitionId && zoomTransitionScreenId === route.key && !isLinkPreviewNavigation;\n if (hasZoomTransition && typeof zoomTransitionId === 'string') {\n const descriptorsMap = use(DescriptorsContext);\n const currentDescriptor = descriptorsMap[route.key];\n const preventInteractiveDismissal = currentDescriptor?.options?.gestureEnabled === false;\n return (\n <LinkZoomTransitionEnabler\n zoomTransitionSourceIdentifier={zoomTransitionId}\n preventInteractiveDismissal={preventInteractiveDismissal}\n />\n );\n }\n }\n return null;\n}\n"]}
1
+ {"version":3,"file":"ZoomTransitionEnabler.ios.js","sourceRoot":"","sources":["../../../src/link/zoom/ZoomTransitionEnabler.ios.tsx"],"names":[],"mappings":";;AAeA,oDAKC;AAED,0DAEC;AAED,sDAmCC;AA7DD,iCAA4B;AAG5B,qFAAiF;AACjF,6DAKgC;AAChC,wEAA8D;AAC9D,8CAA8D;AA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G,CAAC,CAAC;YACpD,MAAM,2BAA2B,GAAG,iBAAiB,EAAE,OAAO,EAAE,cAAc,KAAK,KAAK,CAAC;YACzF,OAAO,CACL,CAAC,kCAAyB,CACxB,8BAA8B,CAAC,CAAC,gBAAgB,CAAC,CACjD,2BAA2B,CAAC,CAAC,2BAA2B,CAAC,EACzD,CACH,CAAC;QACJ,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import { use } from 'react';\n\nimport type { ZoomTransitionEnablerProps } from './ZoomTransitionEnabler.types';\nimport { DescriptorsContext } from '../../fork/native-stack/descriptors-context';\nimport {\n getInternalExpoRouterParams,\n INTERNAL_EXPO_ROUTER_IS_PREVIEW_NAVIGATION_PARAM_NAME,\n INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SCREEN_ID_PARAM_NAME,\n INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SOURCE_ID_PARAM_NAME,\n} from '../../navigationParams';\nimport { useIsPreview } from '../preview/PreviewRouteContext';\nimport { LinkZoomTransitionEnabler } from '../preview/native';\n\nlet _isZoomTransitionEnabled = false;\n\nexport function enableZoomTransition() {\n if (process.env.EXPO_OS === 'ios') {\n console.warn('[expo-router] Zoom transition is an experimental feature. Use at your own risk.');\n _isZoomTransitionEnabled = true;\n }\n}\n\nexport function isZoomTransitionEnabled() {\n return _isZoomTransitionEnabled;\n}\n\nexport function ZoomTransitionEnabler({ route }: ZoomTransitionEnablerProps) {\n const isPreview = useIsPreview();\n if (\n isZoomTransitionEnabled() &&\n !isPreview &&\n route &&\n typeof route === 'object' &&\n 'params' in route &&\n typeof route.params === 'object' &&\n 'key' in route &&\n typeof route.key === 'string'\n ) {\n const params = route.params ?? {};\n const internalParams = getInternalExpoRouterParams(params);\n const zoomTransitionId =\n internalParams[INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SOURCE_ID_PARAM_NAME];\n const zoomTransitionScreenId =\n internalParams[INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SCREEN_ID_PARAM_NAME];\n const isLinkPreviewNavigation =\n !!internalParams[INTERNAL_EXPO_ROUTER_IS_PREVIEW_NAVIGATION_PARAM_NAME];\n const hasZoomTransition =\n !!zoomTransitionId && zoomTransitionScreenId === route.key && !isLinkPreviewNavigation;\n if (hasZoomTransition && typeof zoomTransitionId === 'string') {\n const descriptorsMap = use(DescriptorsContext);\n const currentDescriptor = descriptorsMap[route.key];\n const preventInteractiveDismissal = currentDescriptor?.options?.gestureEnabled === false;\n return (\n <LinkZoomTransitionEnabler\n zoomTransitionSourceIdentifier={zoomTransitionId}\n preventInteractiveDismissal={preventInteractiveDismissal}\n />\n );\n }\n }\n return null;\n}\n"]}
@@ -29,8 +29,13 @@ function LinkAppleZoomImpl({ children, alignmentRect, ...rest }) {
29
29
  addSource();
30
30
  return removeSource;
31
31
  }, [addSource, removeSource]);
32
- if (react_1.Children.count(children) > 1) {
33
- console.warn('[expo-router] Link.ZoomTransitionSource only accepts a single child component. Please wrap multiple children in a View or another container component.');
32
+ const hasTooManyChildren = react_1.Children.count(children) > 1;
33
+ (0, react_1.useEffect)(() => {
34
+ if (process.env.NODE_ENV !== 'production' && hasTooManyChildren) {
35
+ console.warn('[expo-router] Link.ZoomTransitionSource only accepts a single child component. Please wrap multiple children in a View or another container component.');
36
+ }
37
+ }, [hasTooManyChildren]);
38
+ if (hasTooManyChildren) {
34
39
  return null;
35
40
  }
36
41
  return (<native_1.LinkZoomTransitionSource identifier={identifier} alignment={alignmentRect}>
@@ -1 +1 @@
1
- {"version":3,"file":"link-apple-zoom.js","sourceRoot":"","sources":["../../../src/link/zoom/link-apple-zoom.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;AA6Bb,sCAKC;AAhCD,iCAAyE;AAEzE,2EAAsE;AACtE,uEAAwE;AACxE,wCAAqC;AACrC,8CAA6D;AAgB7D;;;;;GAKG;AACH,SAAgB,aAAa,CAAC,KAAyB;IACrD,IAAI,CAAC,IAAA,mDAAuB,GAAE,EAAE,CAAC;QAC/B,OAAO,CAAC,WAAI,CAAC,IAAI,KAAK,CAAC,EAAG,CAAC;IAC7B,CAAC;IACD,OAAO,CAAC,iBAAiB,CAAC,IAAI,KAAK,CAAC,EAAG,CAAC;AAC1C,CAAC;AAMD,SAAS,iBAAiB,CAAC,EAAE,QAAQ,EAAE,aAAa,EAAE,GAAG,IAAI,EAA0B;IACrF,MAAM,KAAK,GAAG,IAAA,WAAG,EAAC,qDAA2B,CAAC,CAAC;IAC/C,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CAAC,oEAAoE,CAAC,CAAC;IACxF,CAAC;IACD,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,GAAG,KAAK,CAAC;IAEtD,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,SAAS,EAAE,CAAC;QACZ,OAAO,YAAY,CAAC;IACtB,CAAC,EAAE,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC,CAAC;IAE9B,IAAI,gBAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QACjC,OAAO,CAAC,IAAI,CACV,wJAAwJ,CACzJ,CAAC;QACF,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,CACL,CAAC,iCAAwB,CAAC,UAAU,CAAC,CAAC,UAAU,CAAC,CAAC,SAAS,CAAC,CAAC,aAAa,CAAC,CACzE;MAAA,CAAC,WAAI,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,WAAI,CAClC;IAAA,EAAE,iCAAwB,CAAC,CAC5B,CAAC;AACJ,CAAC","sourcesContent":["'use client';\n\nimport { Children, use, useEffect, type PropsWithChildren } from 'react';\n\nimport { isZoomTransitionEnabled } from './ZoomTransitionEnabler.ios';\nimport { ZoomTransitionSourceContext } from './zoom-transition-context';\nimport { Slot } from '../../ui/Slot';\nimport { LinkZoomTransitionSource } from '../preview/native';\n\ninterface LinkAppleZoomProps extends PropsWithChildren {\n /**\n * Defines the rectangle used for the zoom transition's alignment. This rectangle is specified in the zoomed screen's coordinate space.\n *\n * @platform ios 18+\n */\n alignmentRect?: {\n x: number;\n y: number;\n width: number;\n height: number;\n };\n}\n\n/**\n * When this component is used inside a Link, [zoom transition](https://developer.apple.com/documentation/uikit/enhancing-your-app-with-fluid-transitions?language=objc)\n * will be used when navigating to the link's href.\n *\n * @platform ios 18+\n */\nexport function LinkAppleZoom(props: LinkAppleZoomProps) {\n if (!isZoomTransitionEnabled()) {\n return <Slot {...props} />;\n }\n return <LinkAppleZoomImpl {...props} />;\n}\n\ntype LinkAppleZoomImplProps = LinkAppleZoomProps & {\n onPress?: () => void;\n};\n\nfunction LinkAppleZoomImpl({ children, alignmentRect, ...rest }: LinkAppleZoomImplProps) {\n const value = use(ZoomTransitionSourceContext);\n if (!value) {\n throw new Error('[expo-router] Link.ZoomTransitionSource must be used within a Link');\n }\n const { identifier, addSource, removeSource } = value;\n\n useEffect(() => {\n addSource();\n return removeSource;\n }, [addSource, removeSource]);\n\n if (Children.count(children) > 1) {\n console.warn(\n '[expo-router] Link.ZoomTransitionSource only accepts a single child component. Please wrap multiple children in a View or another container component.'\n );\n return null;\n }\n\n return (\n <LinkZoomTransitionSource identifier={identifier} alignment={alignmentRect}>\n <Slot {...rest}>{children}</Slot>\n </LinkZoomTransitionSource>\n );\n}\n"]}
1
+ {"version":3,"file":"link-apple-zoom.js","sourceRoot":"","sources":["../../../src/link/zoom/link-apple-zoom.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;AA6Bb,sCAKC;AAhCD,iCAAyE;AAEzE,2EAAsE;AACtE,uEAAwE;AACxE,wCAAqC;AACrC,8CAA6D;AAgB7D;;;;;GAKG;AACH,SAAgB,aAAa,CAAC,KAAyB;IACrD,IAAI,CAAC,IAAA,mDAAuB,GAAE,EAAE,CAAC;QAC/B,OAAO,CAAC,WAAI,CAAC,IAAI,KAAK,CAAC,EAAG,CAAC;IAC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ZoomTransitionEnabled } from './ZoomTransitionEnabler.ios';\nimport { ZoomTransitionSourceContext } from './zoom-transition-context';\nimport { Slot } from '../../ui/Slot';\nimport { LinkZoomTransitionSource } from '../preview/native';\n\ninterface LinkAppleZoomProps extends PropsWithChildren {\n /**\n * Defines the rectangle used for the zoom transition's alignment. This rectangle is specified in the zoomed screen's coordinate space.\n *\n * @platform ios 18+\n */\n alignmentRect?: {\n x: number;\n y: number;\n width: number;\n height: number;\n };\n}\n\n/**\n * When this component is used inside a Link, [zoom transition](https://developer.apple.com/documentation/uikit/enhancing-your-app-with-fluid-transitions?language=objc)\n * will be used when navigating to the link's href.\n *\n * @platform ios 18+\n */\nexport function LinkAppleZoom(props: LinkAppleZoomProps) {\n if (!isZoomTransitionEnabled()) {\n return <Slot {...props} />;\n }\n return <LinkAppleZoomImpl {...props} />;\n}\n\ntype LinkAppleZoomImplProps = LinkAppleZoomProps & {\n onPress?: () => void;\n};\n\nfunction LinkAppleZoomImpl({ children, alignmentRect, ...rest }: LinkAppleZoomImplProps) {\n const value = use(ZoomTransitionSourceContext);\n if (!value) {\n throw new Error('[expo-router] Link.ZoomTransitionSource must be used within a Link');\n }\n const { identifier, addSource, removeSource } = value;\n\n useEffect(() => {\n addSource();\n return removeSource;\n }, [addSource, removeSource]);\n\n const hasTooManyChildren = Children.count(children) > 1;\n\n useEffect(() => {\n if (process.env.NODE_ENV !== 'production' && hasTooManyChildren) {\n console.warn(\n '[expo-router] Link.ZoomTransitionSource only accepts a single child component. Please wrap multiple children in a View or another container component.'\n );\n }\n }, [hasTooManyChildren]);\n\n if (hasTooManyChildren) {\n return null;\n }\n\n return (\n <LinkZoomTransitionSource identifier={identifier} alignment={alignmentRect}>\n <Slot {...rest}>{children}</Slot>\n </LinkZoomTransitionSource>\n );\n}\n"]}
@@ -0,0 +1,3 @@
1
+ import { LinkProps } from '../useLinkHooks';
2
+ export declare function useZoomHref({ href }: LinkProps): string | import("../..").HrefObject;
3
+ //# sourceMappingURL=useZoomHref.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useZoomHref.d.ts","sourceRoot":"","sources":["../../../src/link/zoom/useZoomHref.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,wBAAgB,WAAW,CAAC,EAAE,IAAI,EAAE,EAAE,SAAS,uCAE9C"}
@@ -0,0 +1,3 @@
1
+ import { LinkProps } from '../useLinkHooks';
2
+ export declare function useZoomHref({ href }: LinkProps): string | import("../..").HrefObject;
3
+ //# sourceMappingURL=useZoomHref.ios.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useZoomHref.ios.d.ts","sourceRoot":"","sources":["../../../src/link/zoom/useZoomHref.ios.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAG5C,wBAAgB,WAAW,CAAC,EAAE,IAAI,EAAE,EAAE,SAAS,uCA8B9C"}
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ 'use client';
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.useZoomHref = useZoomHref;
5
+ const react_1 = require("react");
6
+ const navigationParams_1 = require("../../navigationParams");
7
+ const url_1 = require("../../utils/url");
8
+ const zoom_transition_context_1 = require("./zoom-transition-context");
9
+ function useZoomHref({ href }) {
10
+ const value = (0, react_1.use)(zoom_transition_context_1.ZoomTransitionSourceContext);
11
+ if (!value) {
12
+ throw new Error('[expo-router] useZoomHref must be used within a ZoomTransitionSourceContextProvider. This is most likely a bug in expo-router.');
13
+ }
14
+ const { hasZoomSource, identifier } = value;
15
+ return (0, react_1.useMemo)(() => {
16
+ if (!hasZoomSource) {
17
+ return href;
18
+ }
19
+ if (typeof href === 'string') {
20
+ const { pathname, searchParams } = (0, url_1.parseUrlUsingCustomBase)(href);
21
+ return {
22
+ pathname,
23
+ params: {
24
+ ...Object.fromEntries(searchParams.entries()),
25
+ [navigationParams_1.INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SOURCE_ID_PARAM_NAME]: identifier,
26
+ },
27
+ };
28
+ }
29
+ return {
30
+ pathname: href.pathname,
31
+ params: {
32
+ ...(href.params ?? {}),
33
+ [navigationParams_1.INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SOURCE_ID_PARAM_NAME]: identifier,
34
+ },
35
+ };
36
+ }, [href, identifier, hasZoomSource]);
37
+ }
38
+ //# sourceMappingURL=useZoomHref.ios.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useZoomHref.ios.js","sourceRoot":"","sources":["../../../src/link/zoom/useZoomHref.ios.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;AASb,kCA8BC;AArCD,iCAAqC;AAErC,6DAAmG;AACnG,yCAA0D;AAE1D,uEAAwE;AAExE,SAAgB,WAAW,CAAC,EAAE,IAAI,EAAa;IAC7C,MAAM,KAAK,GAAG,IAAA,WAAG,EAAC,qDAA2B,CAAC,CAAC;IAC/C,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CACb,gIAAgI,CACjI,CAAC;IACJ,CAAC;IACD,MAAM,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,KAAK,CAAC;IAC5C,OAAO,IAAA,eAAO,EAAC,GAAG,EAAE;QAClB,IAAI,CAAC,aAAa,EAAE,CAAC;YACnB,OAAO,IAAI,CAAC;QACd,CAAC;QACD,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;YAC7B,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,GAAG,IAAA,6BAAuB,EAAC,IAAI,CAAC,CAAC;YACjE,OAAO;gBACL,QAAQ;gBACR,MAAM,EAAE;oBACN,GAAG,MAAM,CAAC,WAAW,CAAC,YAAY,CAAC,OAAO,EAAE,CAAC;oBAC7C,CAAC,4EAAyD,CAAC,EAAE,UAAU;iBACxE;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,UAAU;aACxE;SACF,CAAC;IACJ,CAAC,EAAE,CAAC,IAAI,EAAE,UAAU,EAAE,aAAa,CAAC,CAAC,CAAC;AACxC,CAAC","sourcesContent":["'use client';\n\nimport { use, useMemo } from 'react';\n\nimport { INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SOURCE_ID_PARAM_NAME } from '../../navigationParams';\nimport { parseUrlUsingCustomBase } from '../../utils/url';\nimport { LinkProps } from '../useLinkHooks';\nimport { ZoomTransitionSourceContext } from './zoom-transition-context';\n\nexport function useZoomHref({ href }: LinkProps) {\n const value = use(ZoomTransitionSourceContext);\n if (!value) {\n throw new Error(\n '[expo-router] useZoomHref must be used within a ZoomTransitionSourceContextProvider. This is most likely a bug in expo-router.'\n );\n }\n const { hasZoomSource, identifier } = value;\n return useMemo(() => {\n if (!hasZoomSource) {\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]: identifier,\n },\n };\n }\n return {\n pathname: href.pathname,\n params: {\n ...(href.params ?? {}),\n [INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SOURCE_ID_PARAM_NAME]: identifier,\n },\n };\n }, [href, identifier, hasZoomSource]);\n}\n"]}
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ 'use client';
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.useZoomHref = useZoomHref;
5
+ function useZoomHref({ href }) {
6
+ return href;
7
+ }
8
+ //# sourceMappingURL=useZoomHref.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useZoomHref.js","sourceRoot":"","sources":["../../../src/link/zoom/useZoomHref.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;AAIb,kCAEC;AAFD,SAAgB,WAAW,CAAC,EAAE,IAAI,EAAa;IAC7C,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["'use client';\n\nimport { LinkProps } from '../useLinkHooks';\n\nexport function useZoomHref({ href }: LinkProps) {\n return href;\n}\n"]}
@@ -0,0 +1,4 @@
1
+ import type { ZoomTransitionSourceContextProviderProps, ZoomTransitionTargetContextProviderProps } from './zoom-transition-context-providers.types';
2
+ export declare function ZoomTransitionSourceContextProvider({ children, }: ZoomTransitionSourceContextProviderProps): import("react").ReactNode;
3
+ export declare function ZoomTransitionTargetContextProvider({ children, }: ZoomTransitionTargetContextProviderProps): import("react").ReactNode;
4
+ //# sourceMappingURL=zoom-transition-context-providers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zoom-transition-context-providers.d.ts","sourceRoot":"","sources":["../../../src/link/zoom/zoom-transition-context-providers.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,wCAAwC,EACxC,wCAAwC,EACzC,MAAM,2CAA2C,CAAC;AAEnD,wBAAgB,mCAAmC,CAAC,EAClD,QAAQ,GACT,EAAE,wCAAwC,6BAE1C;AAED,wBAAgB,mCAAmC,CAAC,EAClD,QAAQ,GACT,EAAE,wCAAwC,6BAE1C"}
@@ -0,0 +1,4 @@
1
+ import type { ZoomTransitionSourceContextProviderProps, ZoomTransitionTargetContextProviderProps } from './zoom-transition-context-providers.types';
2
+ export declare function ZoomTransitionSourceContextProvider({ children, linkProps, }: ZoomTransitionSourceContextProviderProps): import("react").JSX.Element;
3
+ export declare function ZoomTransitionTargetContextProvider({ route, children, }: ZoomTransitionTargetContextProviderProps): 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;
4
+ //# sourceMappingURL=zoom-transition-context-providers.ios.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zoom-transition-context-providers.ios.d.ts","sourceRoot":"","sources":["../../../src/link/zoom/zoom-transition-context-providers.ios.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EACV,wCAAwC,EACxC,wCAAwC,EACzC,MAAM,2CAA2C,CAAC;AASnD,wBAAgB,mCAAmC,CAAC,EAClD,QAAQ,EACR,SAAS,GACV,EAAE,wCAAwC,+BAgD1C;AAED,wBAAgB,mCAAmC,CAAC,EAClD,KAAK,EACL,QAAQ,GACT,EAAE,wCAAwC,+VA4B1C"}
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+ 'use client';
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.ZoomTransitionSourceContextProvider = ZoomTransitionSourceContextProvider;
5
+ exports.ZoomTransitionTargetContextProvider = ZoomTransitionTargetContextProvider;
6
+ const react_1 = require("react");
7
+ const ZoomTransitionEnabler_ios_1 = require("./ZoomTransitionEnabler.ios");
8
+ const zoom_transition_context_1 = require("./zoom-transition-context");
9
+ const navigationParams_1 = require("../../navigationParams");
10
+ const url_1 = require("../../utils/url");
11
+ const PreviewRouteContext_1 = require("../preview/PreviewRouteContext");
12
+ function ZoomTransitionSourceContextProvider({ children, linkProps, }) {
13
+ const { href, asChild } = linkProps;
14
+ const isExternalHref = typeof href === 'string' ? (0, url_1.shouldLinkExternally)(href) : (0, url_1.shouldLinkExternally)(href.pathname);
15
+ const numberOfSources = (0, react_1.useRef)(0);
16
+ const [hasZoomSource, setHasZoomSource] = (0, react_1.useState)(false);
17
+ const zoomTransitionId = (0, react_1.useId)();
18
+ const addSource = (0, react_1.useCallback)(() => {
19
+ if (!(0, ZoomTransitionEnabler_ios_1.isZoomTransitionEnabled)()) {
20
+ throw new Error('[expo-router] Zoom transitions are not enabled.');
21
+ }
22
+ if (numberOfSources.current >= 1) {
23
+ throw new Error('[expo-router] Only one Link.ZoomTransitionSource can be used within a single Link component.');
24
+ }
25
+ if (!asChild) {
26
+ throw new Error('[expo-router] Link must be used with `asChild` prop to enable zoom transitions.');
27
+ }
28
+ if (isExternalHref) {
29
+ throw new Error('[expo-router] Zoom transitions can only be used with internal links.');
30
+ }
31
+ numberOfSources.current += 1;
32
+ setHasZoomSource(true);
33
+ }, [asChild, isExternalHref]);
34
+ const removeSource = (0, react_1.useCallback)(() => {
35
+ numberOfSources.current -= 1;
36
+ if (numberOfSources.current <= 0) {
37
+ setHasZoomSource(false);
38
+ }
39
+ }, []);
40
+ const value = (0, react_1.useMemo)(() => ({
41
+ identifier: zoomTransitionId,
42
+ hasZoomSource,
43
+ addSource,
44
+ removeSource,
45
+ }), [zoomTransitionId, hasZoomSource, addSource, removeSource]);
46
+ return <zoom_transition_context_1.ZoomTransitionSourceContext value={value}>{children}</zoom_transition_context_1.ZoomTransitionSourceContext>;
47
+ }
48
+ function ZoomTransitionTargetContextProvider({ route, children, }) {
49
+ const isPreview = (0, PreviewRouteContext_1.useIsPreview)();
50
+ if ((0, ZoomTransitionEnabler_ios_1.isZoomTransitionEnabled)() &&
51
+ !isPreview &&
52
+ route &&
53
+ typeof route === 'object' &&
54
+ 'params' in route &&
55
+ typeof route.params === 'object' &&
56
+ 'key' in route &&
57
+ typeof route.key === 'string') {
58
+ const params = route.params ?? {};
59
+ const internalParams = (0, navigationParams_1.getInternalExpoRouterParams)(params);
60
+ const zoomTransitionId = internalParams[navigationParams_1.INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SOURCE_ID_PARAM_NAME];
61
+ const zoomTransitionScreenId = internalParams[navigationParams_1.INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SCREEN_ID_PARAM_NAME];
62
+ const hasZoomTransition = !!zoomTransitionId && zoomTransitionScreenId === route.key;
63
+ if (hasZoomTransition && typeof zoomTransitionId === 'string') {
64
+ return (<zoom_transition_context_1.ZoomTransitionTargetContext value={{ identifier: zoomTransitionId }}>
65
+ {children}
66
+ </zoom_transition_context_1.ZoomTransitionTargetContext>);
67
+ }
68
+ }
69
+ return children;
70
+ }
71
+ //# sourceMappingURL=zoom-transition-context-providers.ios.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zoom-transition-context-providers.ios.js","sourceRoot":"","sources":["../../../src/link/zoom/zoom-transition-context-providers.ios.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;AAsBb,kFAmDC;AAED,kFA+BC;AAxGD,iCAAsE;AAEtE,2EAAsE;AACtE,uEAImC;AAKnC,6DAIgC;AAChC,yCAAuD;AACvD,wEAA8D;AAE9D,SAAgB,mCAAmC,CAAC,EAClD,QAAQ,EACR,SAAS,GACgC;IACzC,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,SAAS,CAAC;IACpC,MAAM,cAAc,GAClB,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAA,0BAAoB,EAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAA,0BAAoB,EAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC9F,MAAM,eAAe,GAAG,IAAA,cAAM,EAAC,CAAC,CAAC,CAAC;IAClC,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,IAAA,gBAAQ,EAAC,KAAK,CAAC,CAAC;IAE1D,MAAM,gBAAgB,GAAG,IAAA,aAAK,GAAE,CAAC;IAEjC,MAAM,SAAS,GAAG,IAAA,mBAAW,EAAC,GAAG,EAAE;QACjC,IAAI,CAAC,IAAA,mDAAuB,GAAE,EAAE,CAAC;YAC/B,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;QACrE,CAAC;QACD,IAAI,eAAe,CAAC,OAAO,IAAI,CAAC,EAAE,CAAC;YACjC,MAAM,IAAI,KAAK,CACb,8FAA8F,CAC/F,CAAC;QACJ,CAAC;QACD,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,MAAM,IAAI,KAAK,CACb,iFAAiF,CAClF,CAAC;QACJ,CAAC;QACD,IAAI,cAAc,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AA2B,EAAC,MAAM,CAAC,CAAC;QAC3D,MAAM,gBAAgB,GACpB,cAAc,CAAC,4EAAyD,CAAC,CAAC;QAC5E,MAAM,sBAAsB,GAC1B,cAAc,CAAC,4EAAyD,CAAC,CAAC;QAC5E,MAAM,iBAAiB,GAAG,CAAC,CAAC,gBAAgB,IAAI,sBAAsB,KAAK,KAAK,CAAC,GAAG,CAAC;QACrF,IAAI,iBAAiB,IAAI,OAAO,gBAAgB,KAAK,QAAQ,EAAE,CAAC;YAC9D,OAAO,CACL,CAAC,qDAA2B,CAAC,KAAK,CAAC,CAAC,EAAE,UAAU,EAAE,gBAAgB,EAAE,CAAC,CACnE;UAAA,CAAC,QAAQ,CACX;QAAA,EAAE,qDAA2B,CAAC,CAC/B,CAAC;QACJ,CAAC;IACH,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC","sourcesContent":["'use client';\n\nimport { useCallback, useId, useMemo, useRef, useState } from 'react';\n\nimport { isZoomTransitionEnabled } from './ZoomTransitionEnabler.ios';\nimport {\n ZoomTransitionSourceContext,\n ZoomTransitionTargetContext,\n type ZoomTransitionSourceContextValueType,\n} from './zoom-transition-context';\nimport type {\n ZoomTransitionSourceContextProviderProps,\n ZoomTransitionTargetContextProviderProps,\n} from './zoom-transition-context-providers.types';\nimport {\n getInternalExpoRouterParams,\n INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SCREEN_ID_PARAM_NAME,\n INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SOURCE_ID_PARAM_NAME,\n} from '../../navigationParams';\nimport { shouldLinkExternally } from '../../utils/url';\nimport { useIsPreview } from '../preview/PreviewRouteContext';\n\nexport function ZoomTransitionSourceContextProvider({\n children,\n linkProps,\n}: ZoomTransitionSourceContextProviderProps) {\n const { href, asChild } = linkProps;\n const isExternalHref =\n typeof href === 'string' ? shouldLinkExternally(href) : shouldLinkExternally(href.pathname);\n const numberOfSources = useRef(0);\n const [hasZoomSource, setHasZoomSource] = useState(false);\n\n const zoomTransitionId = useId();\n\n const addSource = useCallback(() => {\n if (!isZoomTransitionEnabled()) {\n throw new Error('[expo-router] Zoom transitions are not enabled.');\n }\n if (numberOfSources.current >= 1) {\n throw new Error(\n '[expo-router] Only one Link.ZoomTransitionSource can be used within a single Link component.'\n );\n }\n if (!asChild) {\n throw new Error(\n '[expo-router] Link must be used with `asChild` prop to enable zoom transitions.'\n );\n }\n if (isExternalHref) {\n throw new Error('[expo-router] Zoom transitions can only be used with internal links.');\n }\n numberOfSources.current += 1;\n setHasZoomSource(true);\n }, [asChild, isExternalHref]);\n\n const removeSource = useCallback(() => {\n numberOfSources.current -= 1;\n if (numberOfSources.current <= 0) {\n setHasZoomSource(false);\n }\n }, []);\n\n const value = useMemo<ZoomTransitionSourceContextValueType>(\n () => ({\n identifier: zoomTransitionId,\n hasZoomSource,\n addSource,\n removeSource,\n }),\n [zoomTransitionId, hasZoomSource, addSource, removeSource]\n );\n\n return <ZoomTransitionSourceContext value={value}>{children}</ZoomTransitionSourceContext>;\n}\n\nexport function ZoomTransitionTargetContextProvider({\n route,\n children,\n}: ZoomTransitionTargetContextProviderProps) {\n const isPreview = useIsPreview();\n if (\n isZoomTransitionEnabled() &&\n !isPreview &&\n route &&\n typeof route === 'object' &&\n 'params' in route &&\n typeof route.params === 'object' &&\n 'key' in route &&\n typeof route.key === 'string'\n ) {\n const params = route.params ?? {};\n const internalParams = getInternalExpoRouterParams(params);\n const zoomTransitionId =\n internalParams[INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SOURCE_ID_PARAM_NAME];\n const zoomTransitionScreenId =\n internalParams[INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SCREEN_ID_PARAM_NAME];\n const hasZoomTransition = !!zoomTransitionId && zoomTransitionScreenId === route.key;\n if (hasZoomTransition && typeof zoomTransitionId === 'string') {\n return (\n <ZoomTransitionTargetContext value={{ identifier: zoomTransitionId }}>\n {children}\n </ZoomTransitionTargetContext>\n );\n }\n }\n return children;\n}\n"]}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ZoomTransitionSourceContextProvider = ZoomTransitionSourceContextProvider;
4
+ exports.ZoomTransitionTargetContextProvider = ZoomTransitionTargetContextProvider;
5
+ function ZoomTransitionSourceContextProvider({ children, }) {
6
+ return children;
7
+ }
8
+ function ZoomTransitionTargetContextProvider({ children, }) {
9
+ return children;
10
+ }
11
+ //# sourceMappingURL=zoom-transition-context-providers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zoom-transition-context-providers.js","sourceRoot":"","sources":["../../../src/link/zoom/zoom-transition-context-providers.tsx"],"names":[],"mappings":";;AAKA,kFAIC;AAED,kFAIC;AAVD,SAAgB,mCAAmC,CAAC,EAClD,QAAQ,GACiC;IACzC,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,SAAgB,mCAAmC,CAAC,EAClD,QAAQ,GACiC;IACzC,OAAO,QAAQ,CAAC;AAClB,CAAC","sourcesContent":["import type {\n ZoomTransitionSourceContextProviderProps,\n ZoomTransitionTargetContextProviderProps,\n} from './zoom-transition-context-providers.types';\n\nexport function ZoomTransitionSourceContextProvider({\n children,\n}: ZoomTransitionSourceContextProviderProps) {\n return children;\n}\n\nexport function ZoomTransitionTargetContextProvider({\n children,\n}: ZoomTransitionTargetContextProviderProps) {\n return children;\n}\n"]}
@@ -0,0 +1,9 @@
1
+ import { type PropsWithChildren } from 'react';
2
+ import type { LinkProps } from '../useLinkHooks';
3
+ export interface ZoomTransitionTargetContextProviderProps extends PropsWithChildren {
4
+ route: unknown;
5
+ }
6
+ export interface ZoomTransitionSourceContextProviderProps extends PropsWithChildren {
7
+ linkProps: LinkProps;
8
+ }
9
+ //# sourceMappingURL=zoom-transition-context-providers.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zoom-transition-context-providers.types.d.ts","sourceRoot":"","sources":["../../../src/link/zoom/zoom-transition-context-providers.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE/C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEjD,MAAM,WAAW,wCAAyC,SAAQ,iBAAiB;IACjF,KAAK,EAAE,OAAO,CAAC;CAChB;AAED,MAAM,WAAW,wCAAyC,SAAQ,iBAAiB;IACjF,SAAS,EAAE,SAAS,CAAC;CACtB"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=zoom-transition-context-providers.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zoom-transition-context-providers.types.js","sourceRoot":"","sources":["../../../src/link/zoom/zoom-transition-context-providers.types.ts"],"names":[],"mappings":"","sourcesContent":["import { type PropsWithChildren } from 'react';\n\nimport type { LinkProps } from '../useLinkHooks';\n\nexport interface ZoomTransitionTargetContextProviderProps extends PropsWithChildren {\n route: unknown;\n}\n\nexport interface ZoomTransitionSourceContextProviderProps extends PropsWithChildren {\n linkProps: LinkProps;\n}\n"]}
@@ -1,14 +1,12 @@
1
- import { type PropsWithChildren } from 'react';
2
1
  export type ZoomTransitionSourceContextValueType = {
3
2
  identifier: string;
3
+ hasZoomSource: boolean;
4
4
  addSource: () => void;
5
5
  removeSource: () => void;
6
6
  } | undefined;
7
7
  export declare const ZoomTransitionSourceContext: import("react").Context<ZoomTransitionSourceContextValueType>;
8
- export declare const ZoomTransitionTargetContext: import("react").Context<{
8
+ export interface ZoomTransitionTargetContextValueType {
9
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;
10
+ }
11
+ export declare const ZoomTransitionTargetContext: import("react").Context<ZoomTransitionTargetContextValueType>;
14
12
  //# 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,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"}
1
+ {"version":3,"file":"zoom-transition-context.d.ts","sourceRoot":"","sources":["../../../src/link/zoom/zoom-transition-context.tsx"],"names":[],"mappings":"AAIA,MAAM,MAAM,oCAAoC,GAC5C;IACE,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,OAAO,CAAC;IACvB,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,YAAY,EAAE,MAAM,IAAI,CAAC;CAC1B,GACD,SAAS,CAAC;AAEd,eAAO,MAAM,2BAA2B,+DACwB,CAAC;AAEjE,MAAM,WAAW,oCAAoC;IACnD,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAED,eAAO,MAAM,2BAA2B,+DAEtC,CAAC"}
@@ -2,36 +2,9 @@
2
2
  'use client';
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.ZoomTransitionTargetContext = exports.ZoomTransitionSourceContext = void 0;
5
- exports.ZoomTransitionTargetContextProvider = ZoomTransitionTargetContextProvider;
6
5
  const react_1 = require("react");
7
- const ZoomTransitionEnabler_ios_1 = require("./ZoomTransitionEnabler.ios");
8
- const navigationParams_1 = require("../../navigationParams");
9
- const PreviewRouteContext_1 = require("../preview/PreviewRouteContext");
10
6
  exports.ZoomTransitionSourceContext = (0, react_1.createContext)(undefined);
11
7
  exports.ZoomTransitionTargetContext = (0, react_1.createContext)({
12
8
  identifier: null,
13
9
  });
14
- function ZoomTransitionTargetContextProvider({ route, children, }) {
15
- const isPreview = (0, PreviewRouteContext_1.useIsPreview)();
16
- if ((0, ZoomTransitionEnabler_ios_1.isZoomTransitionEnabled)() &&
17
- !isPreview &&
18
- route &&
19
- typeof route === 'object' &&
20
- 'params' in route &&
21
- typeof route.params === 'object' &&
22
- 'key' in route &&
23
- typeof route.key === 'string') {
24
- const params = route.params ?? {};
25
- const internalParams = (0, navigationParams_1.getInternalExpoRouterParams)(params);
26
- const zoomTransitionId = internalParams[navigationParams_1.INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SOURCE_ID_PARAM_NAME];
27
- const zoomTransitionScreenId = internalParams[navigationParams_1.INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SCREEN_ID_PARAM_NAME];
28
- const hasZoomTransition = !!zoomTransitionId && zoomTransitionScreenId === route.key;
29
- if (hasZoomTransition && typeof zoomTransitionId === 'string') {
30
- return (<exports.ZoomTransitionTargetContext value={{ identifier: zoomTransitionId }}>
31
- {children}
32
- </exports.ZoomTransitionTargetContext>);
33
- }
34
- }
35
- return children;
36
- }
37
10
  //# sourceMappingURL=zoom-transition-context.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"zoom-transition-context.js","sourceRoot":"","sources":["../../../src/link/zoom/zoom-transition-context.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;AA2Bb,kFA+BC;AAxDD,iCAA8D;AAE9D,2EAAsE;AACtE,6DAIgC;AAChC,wEAA8D;AAUjD,QAAA,2BAA2B,GACtC,IAAA,qBAAa,EAAuC,SAAS,CAAC,CAAC;AAEpD,QAAA,2BAA2B,GAAG,IAAA,qBAAa,EAAgC;IACtF,UAAU,EAAE,IAAI;CACjB,CAAC,CAAC;AAEH,SAAgB,mCAAmC,CAAC,EAClD,KAAK,EACL,QAAQ,GAC8B;IACtC,MAAM,SAAS,GAAG,IAAA,kCAAY,GAAE,CAAC;IACjC,IACE,IAAA,mDAAuB,GAAE;QACzB,CAAC,SAAS;QACV,KAAK;QACL,OAAO,KAAK,KAAK,QAAQ;QACzB,QAAQ,IAAI,KAAK;QACjB,OAAO,KAAK,CAAC,MAAM,KAAK,QAAQ;QAChC,KAAK,IAAI,KAAK;QACd,OAAO,KAAK,CAAC,GAAG,KAAK,QAAQ,EAC7B,CAAC;QACD,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,IAAI,EAAE,CAAC;QAClC,MAAM,cAAc,GAAG,IAAA,8CAA2B,EAAC,MAAM,CAAC,CAAC;QAC3D,MAAM,gBAAgB,GACpB,cAAc,CAAC,4EAAyD,CAAC,CAAC;QAC5E,MAAM,sBAAsB,GAC1B,cAAc,CAAC,4EAAyD,CAAC,CAAC;QAC5E,MAAM,iBAAiB,GAAG,CAAC,CAAC,gBAAgB,IAAI,sBAAsB,KAAK,KAAK,CAAC,GAAG,CAAC;QACrF,IAAI,iBAAiB,IAAI,OAAO,gBAAgB,KAAK,QAAQ,EAAE,CAAC;YAC9D,OAAO,CACL,CAAC,mCAA2B,CAAC,KAAK,CAAC,CAAC,EAAE,UAAU,EAAE,gBAAgB,EAAE,CAAC,CACnE;UAAA,CAAC,QAAQ,CACX;QAAA,EAAE,mCAA2B,CAAC,CAC/B,CAAC;QACJ,CAAC;IACH,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC","sourcesContent":["'use client';\n\nimport { createContext, type PropsWithChildren } from 'react';\n\nimport { isZoomTransitionEnabled } from './ZoomTransitionEnabler.ios';\nimport {\n getInternalExpoRouterParams,\n INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SCREEN_ID_PARAM_NAME,\n INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SOURCE_ID_PARAM_NAME,\n} from '../../navigationParams';\nimport { useIsPreview } from '../preview/PreviewRouteContext';\n\nexport type ZoomTransitionSourceContextValueType =\n | {\n identifier: string;\n addSource: () => void;\n removeSource: () => void;\n }\n | undefined;\n\nexport const ZoomTransitionSourceContext =\n createContext<ZoomTransitionSourceContextValueType>(undefined);\n\nexport const ZoomTransitionTargetContext = createContext<{ identifier: string | null }>({\n identifier: null,\n});\n\nexport function ZoomTransitionTargetContextProvider({\n route,\n children,\n}: PropsWithChildren<{ route: unknown }>) {\n const isPreview = useIsPreview();\n if (\n isZoomTransitionEnabled() &&\n !isPreview &&\n route &&\n typeof route === 'object' &&\n 'params' in route &&\n typeof route.params === 'object' &&\n 'key' in route &&\n typeof route.key === 'string'\n ) {\n const params = route.params ?? {};\n const internalParams = getInternalExpoRouterParams(params);\n const zoomTransitionId =\n internalParams[INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SOURCE_ID_PARAM_NAME];\n const zoomTransitionScreenId =\n internalParams[INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SCREEN_ID_PARAM_NAME];\n const hasZoomTransition = !!zoomTransitionId && zoomTransitionScreenId === route.key;\n if (hasZoomTransition && typeof zoomTransitionId === 'string') {\n return (\n <ZoomTransitionTargetContext value={{ identifier: zoomTransitionId }}>\n {children}\n </ZoomTransitionTargetContext>\n );\n }\n }\n return children;\n}\n"]}
1
+ {"version":3,"file":"zoom-transition-context.js","sourceRoot":"","sources":["../../../src/link/zoom/zoom-transition-context.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;AAEb,iCAAsC;AAWzB,QAAA,2BAA2B,GACtC,IAAA,qBAAa,EAAuC,SAAS,CAAC,CAAC;AAMpD,QAAA,2BAA2B,GAAG,IAAA,qBAAa,EAAuC;IAC7F,UAAU,EAAE,IAAI;CACjB,CAAC,CAAC","sourcesContent":["'use client';\n\nimport { createContext } from 'react';\n\nexport type ZoomTransitionSourceContextValueType =\n | {\n identifier: string;\n hasZoomSource: boolean;\n addSource: () => void;\n removeSource: () => void;\n }\n | undefined;\n\nexport const ZoomTransitionSourceContext =\n createContext<ZoomTransitionSourceContextValueType>(undefined);\n\nexport interface ZoomTransitionTargetContextValueType {\n identifier: string | null;\n}\n\nexport const ZoomTransitionTargetContext = createContext<ZoomTransitionTargetContextValueType>({\n identifier: null,\n});\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Tutorial.d.ts","sourceRoot":"","sources":["../../src/onboard/Tutorial.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAU1B,wBAAgB,QAAQ,sBAgEvB"}
1
+ {"version":3,"file":"Tutorial.d.ts","sourceRoot":"","sources":["../../src/onboard/Tutorial.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAwB1B,wBAAgB,QAAQ,sBAgEvB"}
@@ -7,10 +7,22 @@ exports.Tutorial = Tutorial;
7
7
  const react_1 = __importDefault(require("react"));
8
8
  const react_native_1 = require("react-native");
9
9
  const react_native_safe_area_context_1 = require("react-native-safe-area-context");
10
- const createEntryFile_1 = require("./createEntryFile");
11
10
  const exports_1 = require("../exports");
11
+ const getDevServer_1 = require("../getDevServer");
12
12
  const Pressable_1 = require("../views/Pressable");
13
13
  const canAutoTouchFile = process.env.EXPO_ROUTER_APP_ROOT != null;
14
+ function createEntryFileAsync() {
15
+ if (process.env.NODE_ENV === 'production') {
16
+ // No dev server
17
+ console.warn('createEntryFile() cannot be used in production');
18
+ return;
19
+ }
20
+ // Pings middleware in the Expo CLI dev server.
21
+ return fetch((0, getDevServer_1.getDevServer)().url + '_expo/touch', {
22
+ method: 'POST',
23
+ body: JSON.stringify({ type: 'router_index' }),
24
+ });
25
+ }
14
26
  function Tutorial() {
15
27
  react_1.default.useEffect(() => {
16
28
  if (react_native_1.Platform.OS === 'web') {
@@ -69,18 +81,18 @@ function Tutorial() {
69
81
  </react_native_safe_area_context_1.SafeAreaView>);
70
82
  }
71
83
  function getRootDir() {
72
- const dir = process.env.EXPO_ROUTER_ABS_APP_ROOT;
73
- if (dir.match(/\/src\/app$/)) {
84
+ const dir = process.env.EXPO_ROUTER_APP_ROOT ?? '';
85
+ if (/[\\/]src[\\/]app$/.test(dir)) {
74
86
  return 'src/app';
75
87
  }
76
- else if (dir.match(/\/app$/)) {
88
+ else if (/[\\/]app$/.test(dir)) {
77
89
  return 'app';
78
90
  }
79
- return dir.split('/').pop() ?? dir;
91
+ return dir.split(/[\\/]/).pop() ?? '';
80
92
  }
81
93
  function Button() {
82
94
  return (<Pressable_1.Pressable onPress={() => {
83
- (0, createEntryFile_1.createEntryFileAsync)();
95
+ createEntryFileAsync();
84
96
  }} style={styles.button}>
85
97
  {({ pressed, hovered }) => (<react_native_1.View style={[
86
98
  styles.buttonContainer,
@@ -106,8 +118,7 @@ function Button() {
106
118
  native: { color: '#000' },
107
119
  }),
108
120
  ]}>
109
- <react_native_1.Text style={styles.textSecondary}>$</react_native_1.Text> touch {getRootDir()}
110
- /index.tsx
121
+ <react_native_1.Text style={styles.textSecondary}>$</react_native_1.Text> touch {`${getRootDir()}/index.tsx`}
111
122
  </react_native_1.Text>
112
123
  </react_native_1.View>)}
113
124
  </Pressable_1.Pressable>);