expo-router 7.0.0-canary-20251211-7da85ea → 7.0.0-canary-20251216-6e1f9a7

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 (147) hide show
  1. package/android/build.gradle +2 -2
  2. package/build/exports.d.ts +1 -0
  3. package/build/exports.d.ts.map +1 -1
  4. package/build/exports.js +1 -0
  5. package/build/exports.js.map +1 -1
  6. package/build/layouts/StackClient.d.ts +9 -1
  7. package/build/layouts/StackClient.d.ts.map +1 -1
  8. package/build/layouts/stack-utils/StackHeaderButton.d.ts +39 -0
  9. package/build/layouts/stack-utils/StackHeaderButton.d.ts.map +1 -0
  10. package/build/layouts/stack-utils/StackHeaderButton.js +46 -0
  11. package/build/layouts/stack-utils/StackHeaderButton.js.map +1 -0
  12. package/build/layouts/stack-utils/StackHeaderComponent.d.ts.map +1 -1
  13. package/build/layouts/stack-utils/StackHeaderComponent.js +5 -6
  14. package/build/layouts/stack-utils/StackHeaderComponent.js.map +1 -1
  15. package/build/layouts/stack-utils/StackHeaderItem.d.ts +45 -0
  16. package/build/layouts/stack-utils/StackHeaderItem.d.ts.map +1 -0
  17. package/build/layouts/stack-utils/StackHeaderItem.js +52 -0
  18. package/build/layouts/stack-utils/StackHeaderItem.js.map +1 -0
  19. package/build/layouts/stack-utils/StackHeaderLeftRight.d.ts +15 -0
  20. package/build/layouts/stack-utils/StackHeaderLeftRight.d.ts.map +1 -0
  21. package/build/layouts/stack-utils/StackHeaderLeftRight.js +111 -0
  22. package/build/layouts/stack-utils/StackHeaderLeftRight.js.map +1 -0
  23. package/build/layouts/stack-utils/StackHeaderMenu.d.ts +191 -0
  24. package/build/layouts/stack-utils/StackHeaderMenu.d.ts.map +1 -0
  25. package/build/layouts/stack-utils/StackHeaderMenu.js +203 -0
  26. package/build/layouts/stack-utils/StackHeaderMenu.js.map +1 -0
  27. package/build/layouts/stack-utils/StackHeaderSpacer.d.ts +40 -0
  28. package/build/layouts/stack-utils/StackHeaderSpacer.d.ts.map +1 -0
  29. package/build/layouts/stack-utils/StackHeaderSpacer.js +41 -0
  30. package/build/layouts/stack-utils/StackHeaderSpacer.js.map +1 -0
  31. package/build/layouts/stack-utils/common-primitives.d.ts +24 -0
  32. package/build/layouts/stack-utils/common-primitives.d.ts.map +1 -0
  33. package/build/layouts/stack-utils/common-primitives.js +8 -0
  34. package/build/layouts/stack-utils/common-primitives.js.map +1 -0
  35. package/build/layouts/stack-utils/index.d.ts +16 -3
  36. package/build/layouts/stack-utils/index.d.ts.map +1 -1
  37. package/build/layouts/stack-utils/index.js +27 -8
  38. package/build/layouts/stack-utils/index.js.map +1 -1
  39. package/build/layouts/stack-utils/shared.d.ts +62 -0
  40. package/build/layouts/stack-utils/shared.d.ts.map +1 -0
  41. package/build/layouts/stack-utils/shared.js +78 -0
  42. package/build/layouts/stack-utils/shared.js.map +1 -0
  43. package/build/link/ExpoLink.d.ts.map +1 -1
  44. package/build/link/ExpoLink.js +10 -9
  45. package/build/link/ExpoLink.js.map +1 -1
  46. package/build/link/preview/native.d.ts +4 -2
  47. package/build/link/preview/native.d.ts.map +1 -1
  48. package/build/link/preview/native.js +3 -1
  49. package/build/link/preview/native.js.map +1 -1
  50. package/build/link/zoom/ZoomTransitionEnabler.ios.d.ts.map +1 -1
  51. package/build/link/zoom/ZoomTransitionEnabler.ios.js +4 -2
  52. package/build/link/zoom/ZoomTransitionEnabler.ios.js.map +1 -1
  53. package/build/link/zoom/link-apple-zoom.js +10 -3
  54. package/build/link/zoom/link-apple-zoom.js.map +1 -1
  55. package/build/link/zoom/useZoomHref.d.ts +3 -0
  56. package/build/link/zoom/useZoomHref.d.ts.map +1 -0
  57. package/build/link/zoom/useZoomHref.ios.d.ts +3 -0
  58. package/build/link/zoom/useZoomHref.ios.d.ts.map +1 -0
  59. package/build/link/zoom/useZoomHref.ios.js +38 -0
  60. package/build/link/zoom/useZoomHref.ios.js.map +1 -0
  61. package/build/link/zoom/useZoomHref.js +8 -0
  62. package/build/link/zoom/useZoomHref.js.map +1 -0
  63. package/build/link/zoom/zoom-transition-context-providers.d.ts +4 -0
  64. package/build/link/zoom/zoom-transition-context-providers.d.ts.map +1 -0
  65. package/build/link/zoom/zoom-transition-context-providers.ios.d.ts +4 -0
  66. package/build/link/zoom/zoom-transition-context-providers.ios.d.ts.map +1 -0
  67. package/build/link/zoom/zoom-transition-context-providers.ios.js +71 -0
  68. package/build/link/zoom/zoom-transition-context-providers.ios.js.map +1 -0
  69. package/build/link/zoom/zoom-transition-context-providers.js +11 -0
  70. package/build/link/zoom/zoom-transition-context-providers.js.map +1 -0
  71. package/build/link/zoom/zoom-transition-context-providers.types.d.ts +9 -0
  72. package/build/link/zoom/zoom-transition-context-providers.types.d.ts.map +1 -0
  73. package/build/link/zoom/zoom-transition-context-providers.types.js +3 -0
  74. package/build/link/zoom/zoom-transition-context-providers.types.js.map +1 -0
  75. package/build/link/zoom/zoom-transition-context.d.ts +4 -6
  76. package/build/link/zoom/zoom-transition-context.d.ts.map +1 -1
  77. package/build/link/zoom/zoom-transition-context.js +0 -27
  78. package/build/link/zoom/zoom-transition-context.js.map +1 -1
  79. package/build/primitives/types.d.ts +6 -5
  80. package/build/primitives/types.d.ts.map +1 -1
  81. package/build/primitives/types.js.map +1 -1
  82. package/build/split-view/elements.d.ts +4 -5
  83. package/build/split-view/elements.d.ts.map +1 -1
  84. package/build/split-view/elements.js +3 -0
  85. package/build/split-view/elements.js.map +1 -1
  86. package/build/split-view/index.d.ts +2 -0
  87. package/build/split-view/index.d.ts.map +1 -1
  88. package/build/split-view/index.js +15 -0
  89. package/build/split-view/index.js.map +1 -1
  90. package/build/split-view/split-view.d.ts +3 -0
  91. package/build/split-view/split-view.d.ts.map +1 -1
  92. package/build/split-view/split-view.js.map +1 -1
  93. package/build/useScreens.js +3 -3
  94. package/build/useScreens.js.map +1 -1
  95. package/expo-module.config.json +1 -1
  96. package/ios/LinkPreview/LinkPreviewNativeModule.swift +4 -1
  97. package/ios/LinkPreview/LinkZoomTransition.swift +121 -43
  98. package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251211-7da85ea/expo.modules.router-7.0.0-canary-20251211-7da85ea.module → 7.0.0-canary-20251216-6e1f9a7/expo.modules.router-7.0.0-canary-20251216-6e1f9a7.module} +7 -7
  99. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251216-6e1f9a7/expo.modules.router-7.0.0-canary-20251216-6e1f9a7.module.md5 +1 -0
  100. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251216-6e1f9a7/expo.modules.router-7.0.0-canary-20251216-6e1f9a7.module.sha1 +1 -0
  101. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251216-6e1f9a7/expo.modules.router-7.0.0-canary-20251216-6e1f9a7.module.sha256 +1 -0
  102. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251216-6e1f9a7/expo.modules.router-7.0.0-canary-20251216-6e1f9a7.module.sha512 +1 -0
  103. package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251211-7da85ea/expo.modules.router-7.0.0-canary-20251211-7da85ea.pom → 7.0.0-canary-20251216-6e1f9a7/expo.modules.router-7.0.0-canary-20251216-6e1f9a7.pom} +1 -1
  104. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251216-6e1f9a7/expo.modules.router-7.0.0-canary-20251216-6e1f9a7.pom.md5 +1 -0
  105. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251216-6e1f9a7/expo.modules.router-7.0.0-canary-20251216-6e1f9a7.pom.sha1 +1 -0
  106. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251216-6e1f9a7/expo.modules.router-7.0.0-canary-20251216-6e1f9a7.pom.sha256 +1 -0
  107. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251216-6e1f9a7/expo.modules.router-7.0.0-canary-20251216-6e1f9a7.pom.sha512 +1 -0
  108. package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml +4 -4
  109. package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml.md5 +1 -1
  110. package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml.sha1 +1 -1
  111. package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml.sha256 +1 -1
  112. package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml.sha512 +1 -1
  113. package/package.json +12 -12
  114. package/build/layouts/stack-utils/StackHeaderLeft.d.ts +0 -9
  115. package/build/layouts/stack-utils/StackHeaderLeft.d.ts.map +0 -1
  116. package/build/layouts/stack-utils/StackHeaderLeft.js +0 -17
  117. package/build/layouts/stack-utils/StackHeaderLeft.js.map +0 -1
  118. package/build/layouts/stack-utils/StackHeaderRight.d.ts +0 -9
  119. package/build/layouts/stack-utils/StackHeaderRight.d.ts.map +0 -1
  120. package/build/layouts/stack-utils/StackHeaderRight.js +0 -17
  121. package/build/layouts/stack-utils/StackHeaderRight.js.map +0 -1
  122. package/build/link/zoom/useZoomTransitionPrimitives.d.ts +0 -6
  123. package/build/link/zoom/useZoomTransitionPrimitives.d.ts.map +0 -1
  124. package/build/link/zoom/useZoomTransitionPrimitives.ios.d.ts +0 -11
  125. package/build/link/zoom/useZoomTransitionPrimitives.ios.d.ts.map +0 -1
  126. package/build/link/zoom/useZoomTransitionPrimitives.ios.js +0 -69
  127. package/build/link/zoom/useZoomTransitionPrimitives.ios.js.map +0 -1
  128. package/build/link/zoom/useZoomTransitionPrimitives.js +0 -9
  129. package/build/link/zoom/useZoomTransitionPrimitives.js.map +0 -1
  130. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251211-7da85ea/expo.modules.router-7.0.0-canary-20251211-7da85ea.module.md5 +0 -1
  131. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251211-7da85ea/expo.modules.router-7.0.0-canary-20251211-7da85ea.module.sha1 +0 -1
  132. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251211-7da85ea/expo.modules.router-7.0.0-canary-20251211-7da85ea.module.sha256 +0 -1
  133. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251211-7da85ea/expo.modules.router-7.0.0-canary-20251211-7da85ea.module.sha512 +0 -1
  134. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251211-7da85ea/expo.modules.router-7.0.0-canary-20251211-7da85ea.pom.md5 +0 -1
  135. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251211-7da85ea/expo.modules.router-7.0.0-canary-20251211-7da85ea.pom.sha1 +0 -1
  136. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251211-7da85ea/expo.modules.router-7.0.0-canary-20251211-7da85ea.pom.sha256 +0 -1
  137. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251211-7da85ea/expo.modules.router-7.0.0-canary-20251211-7da85ea.pom.sha512 +0 -1
  138. /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251211-7da85ea/expo.modules.router-7.0.0-canary-20251211-7da85ea-sources.jar → 7.0.0-canary-20251216-6e1f9a7/expo.modules.router-7.0.0-canary-20251216-6e1f9a7-sources.jar} +0 -0
  139. /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251211-7da85ea/expo.modules.router-7.0.0-canary-20251211-7da85ea-sources.jar.md5 → 7.0.0-canary-20251216-6e1f9a7/expo.modules.router-7.0.0-canary-20251216-6e1f9a7-sources.jar.md5} +0 -0
  140. /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251211-7da85ea/expo.modules.router-7.0.0-canary-20251211-7da85ea-sources.jar.sha1 → 7.0.0-canary-20251216-6e1f9a7/expo.modules.router-7.0.0-canary-20251216-6e1f9a7-sources.jar.sha1} +0 -0
  141. /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251211-7da85ea/expo.modules.router-7.0.0-canary-20251211-7da85ea-sources.jar.sha256 → 7.0.0-canary-20251216-6e1f9a7/expo.modules.router-7.0.0-canary-20251216-6e1f9a7-sources.jar.sha256} +0 -0
  142. /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251211-7da85ea/expo.modules.router-7.0.0-canary-20251211-7da85ea-sources.jar.sha512 → 7.0.0-canary-20251216-6e1f9a7/expo.modules.router-7.0.0-canary-20251216-6e1f9a7-sources.jar.sha512} +0 -0
  143. /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251211-7da85ea/expo.modules.router-7.0.0-canary-20251211-7da85ea.aar → 7.0.0-canary-20251216-6e1f9a7/expo.modules.router-7.0.0-canary-20251216-6e1f9a7.aar} +0 -0
  144. /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251211-7da85ea/expo.modules.router-7.0.0-canary-20251211-7da85ea.aar.md5 → 7.0.0-canary-20251216-6e1f9a7/expo.modules.router-7.0.0-canary-20251216-6e1f9a7.aar.md5} +0 -0
  145. /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251211-7da85ea/expo.modules.router-7.0.0-canary-20251211-7da85ea.aar.sha1 → 7.0.0-canary-20251216-6e1f9a7/expo.modules.router-7.0.0-canary-20251216-6e1f9a7.aar.sha1} +0 -0
  146. /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251211-7da85ea/expo.modules.router-7.0.0-canary-20251211-7da85ea.aar.sha256 → 7.0.0-canary-20251216-6e1f9a7/expo.modules.router-7.0.0-canary-20251216-6e1f9a7.aar.sha256} +0 -0
  147. /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251211-7da85ea/expo.modules.router-7.0.0-canary-20251211-7da85ea.aar.sha512 → 7.0.0-canary-20251216-6e1f9a7/expo.modules.router-7.0.0-canary-20251216-6e1f9a7.aar.sha512} +0 -0
@@ -3,12 +3,14 @@ import RNScreens
3
3
  import UIKit
4
4
 
5
5
  class LinkSourceInfo {
6
- let alignment: CGRect?
6
+ var alignment: CGRect?
7
+ var animateAspectRatioChange: Bool
7
8
  weak var view: UIView?
8
9
 
9
- init(view: UIView, alignment: CGRect?) {
10
- self.alignment = alignment
10
+ init(view: UIView, alignment: CGRect?, animateAspectRatioChange: Bool) {
11
11
  self.view = view
12
+ self.alignment = alignment
13
+ self.animateAspectRatioChange = animateAspectRatioChange
12
14
  }
13
15
  }
14
16
 
@@ -16,7 +18,11 @@ class LinkZoomTransitionsSourceRepository {
16
18
  private var sources: [String: LinkSourceInfo] = [:]
17
19
  private let lock = NSLock()
18
20
 
19
- init() {}
21
+ private weak var logger: Logger?
22
+
23
+ init(logger: Logger?) {
24
+ self.logger = logger
25
+ }
20
26
 
21
27
  func registerSource(
22
28
  identifier: String,
@@ -25,8 +31,8 @@ class LinkZoomTransitionsSourceRepository {
25
31
  lock.lock()
26
32
  defer { lock.unlock() }
27
33
  if sources[identifier] != nil {
28
- print(
29
- "[expo-router] LinkPreviewZoomTransitionSource with identifier \(identifier) is already registered. Overwriting the existing source."
34
+ logger?.warn(
35
+ "[expo-router] Link.AppleZoom with identifier \(identifier) is already registered. This means that you used two sources for the same target, which is not supported and may lead to unexpected behavior."
30
36
  )
31
37
  }
32
38
  if !identifier.isEmpty {
@@ -66,11 +72,19 @@ class LinkZoomTransitionsSourceRepository {
66
72
  ) {
67
73
  lock.lock()
68
74
  defer { lock.unlock() }
69
- if let source = sources[identifier], let view = source.view, !identifier.isEmpty {
70
- sources[identifier] = LinkSourceInfo(
71
- view: view,
72
- alignment: alignment,
73
- )
75
+ if let source = sources[identifier], !identifier.isEmpty {
76
+ source.alignment = alignment
77
+ }
78
+ }
79
+
80
+ func updateAnimateAspectRatioChange(
81
+ identifier: String,
82
+ animateAspectRatioChange: Bool
83
+ ) {
84
+ lock.lock()
85
+ defer { lock.unlock() }
86
+ if let source: LinkSourceInfo = sources[identifier], !identifier.isEmpty {
87
+ source.animateAspectRatioChange = animateAspectRatioChange
74
88
  }
75
89
  }
76
90
  }
@@ -127,7 +141,6 @@ class LinkZoomTransitionSource: LinkZoomExpoView, LinkPreviewIndirectTriggerProt
127
141
 
128
142
  var alignment: CGRect? {
129
143
  didSet {
130
- // Update alignment info in the sourceRepository
131
144
  if child != nil {
132
145
  sourceRepository?.updateAlignment(
133
146
  identifier: identifier,
@@ -137,6 +150,17 @@ class LinkZoomTransitionSource: LinkZoomExpoView, LinkPreviewIndirectTriggerProt
137
150
  }
138
151
  }
139
152
 
153
+ var animateAspectRatioChange: Bool = false {
154
+ didSet {
155
+ if child != nil {
156
+ sourceRepository?.updateAnimateAspectRatioChange(
157
+ identifier: identifier,
158
+ animateAspectRatioChange: animateAspectRatioChange
159
+ )
160
+ }
161
+ }
162
+ }
163
+
140
164
  var identifier: String = "" {
141
165
  didSet {
142
166
  guard identifier != oldValue else { return }
@@ -144,7 +168,9 @@ class LinkZoomTransitionSource: LinkZoomExpoView, LinkPreviewIndirectTriggerProt
144
168
  if oldValue.isEmpty {
145
169
  sourceRepository?.registerSource(
146
170
  identifier: identifier,
147
- source: LinkSourceInfo(view: child, alignment: alignment)
171
+ source: LinkSourceInfo(
172
+ view: child, alignment: alignment,
173
+ animateAspectRatioChange: animateAspectRatioChange)
148
174
  )
149
175
  } else {
150
176
  sourceRepository?.updateIdentifier(
@@ -164,27 +190,30 @@ class LinkZoomTransitionSource: LinkZoomExpoView, LinkPreviewIndirectTriggerProt
164
190
  _ childComponentView: UIView,
165
191
  index: Int
166
192
  ) {
167
- if child != nil {
168
- print(
169
- "[expo-router] LinkZoomTransitionSource can only have one child view."
193
+ guard child == nil else {
194
+ logger?.warn(
195
+ "[expo-router] Link.AppleZoom can only have a single native child. If you passed a single child, consider adding collapsible={false} to your component"
170
196
  )
171
197
  return
172
198
  }
173
199
  child = childComponentView
174
200
  sourceRepository?.registerSource(
175
201
  identifier: identifier,
176
- source: LinkSourceInfo(view: childComponentView, alignment: alignment)
202
+ source: LinkSourceInfo(
203
+ view: childComponentView, alignment: alignment,
204
+ animateAspectRatioChange: animateAspectRatioChange)
177
205
  )
178
206
  super.mountChildComponentView(childComponentView, index: index)
179
207
  }
180
208
 
181
209
  override func unmountChildComponentView(_ child: UIView, index: Int) {
182
- if child == self.child {
183
- self.child = nil
184
- sourceRepository?.unregisterSource(
185
- identifier: identifier
186
- )
210
+ guard child == self.child else {
211
+ return
187
212
  }
213
+ self.child = nil
214
+ sourceRepository?.unregisterSource(
215
+ identifier: identifier
216
+ )
188
217
  super.unmountChildComponentView(child, index: index)
189
218
  }
190
219
  }
@@ -195,8 +224,8 @@ class LinkZoomTransitionAlignmentRectDetector: LinkZoomExpoView {
195
224
  var identifier: String = "" {
196
225
  didSet {
197
226
  if oldValue != identifier && !oldValue.isEmpty {
198
- print(
199
- "[expo-router] LinkZoomTransitionAlignmentRectDetector does not support changing the identifier after it has been set."
227
+ logger?.warn(
228
+ "[expo-router] LinkZoomTransitionAlignmentRectDetector does not support changing the identifier after it has been set. This is most likely an internal bug in expo-router."
200
229
  )
201
230
  return
202
231
  }
@@ -213,9 +242,9 @@ class LinkZoomTransitionAlignmentRectDetector: LinkZoomExpoView {
213
242
  _ childComponentView: UIView,
214
243
  index: Int
215
244
  ) {
216
- if child != nil {
217
- print(
218
- "[expo-router] LinkZoomTransitionAlignmentRectDetector can only have one child view."
245
+ guard child == nil else {
246
+ logger?.warn(
247
+ "[expo-router] Link.AppleZoomTarget can only have a single native child."
219
248
  )
220
249
  return
221
250
  }
@@ -230,13 +259,14 @@ class LinkZoomTransitionAlignmentRectDetector: LinkZoomExpoView {
230
259
  }
231
260
 
232
261
  override func unmountChildComponentView(_ child: UIView, index: Int) {
233
- if child == self.child {
234
- self.child = nil
235
- alignmentViewRepository?.removeIfSame(
236
- identifier: identifier,
237
- alignmentView: child
238
- )
262
+ guard child == self.child else {
263
+ return
239
264
  }
265
+ self.child = nil
266
+ alignmentViewRepository?.removeIfSame(
267
+ identifier: identifier,
268
+ alignmentView: child
269
+ )
240
270
  super.unmountChildComponentView(child, index: index)
241
271
  }
242
272
  }
@@ -265,17 +295,28 @@ class LinkZoomTransitionEnabler: LinkZoomExpoView {
265
295
  let options = UIViewController.Transition.ZoomOptions()
266
296
 
267
297
  options.alignmentRectProvider = { context in
268
- let sourceInfo = self.sourceRepository?.getSource(
269
- identifier: self.zoomTransitionSourceIdentifier)
270
- let alignmentView = self.alignmentViewRepository?.get(
271
- identifier: self.zoomTransitionSourceIdentifier)
272
- if let alignmentView = alignmentView {
273
- return alignmentView.convert(
274
- alignmentView.bounds,
275
- to: context.zoomedViewController.view
276
- )
298
+ guard
299
+ let sourceInfo = self.sourceRepository?.getSource(
300
+ identifier: self.zoomTransitionSourceIdentifier)
301
+ else {
302
+ return nil
303
+ }
304
+ guard
305
+ let alignmentView = self.alignmentViewRepository?.get(
306
+ identifier: self.zoomTransitionSourceIdentifier)
307
+ else {
308
+ return sourceInfo.alignment
309
+ }
310
+
311
+ let rect = alignmentView.convert(
312
+ alignmentView.bounds,
313
+ to: context.zoomedViewController.view
314
+ )
315
+ if sourceInfo.animateAspectRatioChange,
316
+ let sourceView = sourceInfo.view {
317
+ return self.calculateAdjustedRect(rect, toMatch: sourceView.bounds.size)
277
318
  }
278
- return sourceInfo?.alignment
319
+ return rect
279
320
  }
280
321
  options.interactiveDismissShouldBegin = { _ in
281
322
  !self.isPreventingInteractiveDismissal
@@ -302,6 +343,41 @@ class LinkZoomTransitionEnabler: LinkZoomExpoView {
302
343
  }
303
344
  }
304
345
 
346
+ private func calculateAdjustedRect(
347
+ _ rect: CGRect, toMatch sourceSize: CGSize
348
+ ) -> CGRect {
349
+ guard sourceSize.width > 0, sourceSize.height > 0,
350
+ rect.width > 0, rect.height > 0
351
+ else {
352
+ return rect
353
+ }
354
+ let sourceAspectRatio = sourceSize.width / sourceSize.height
355
+ let rectAspectRatio = rect.width / rect.height
356
+
357
+ if abs(sourceAspectRatio - rectAspectRatio) < 0.001 {
358
+ return rect // Aspect ratios are essentially equal
359
+ }
360
+
361
+ if rectAspectRatio > sourceAspectRatio {
362
+ // Rect is wider - adjust width
363
+ let adjustedWidth = rect.height * sourceAspectRatio
364
+ return CGRect(
365
+ x: rect.midX - (adjustedWidth / 2),
366
+ y: rect.origin.y,
367
+ width: adjustedWidth,
368
+ height: rect.height
369
+ )
370
+ }
371
+ // Rect is taller - adjust height
372
+ let adjustedHeight = rect.width / sourceAspectRatio
373
+ return CGRect(
374
+ x: rect.origin.x,
375
+ y: rect.midY - (adjustedHeight / 2),
376
+ width: rect.width,
377
+ height: adjustedHeight
378
+ )
379
+ }
380
+
305
381
  private func findViewController() -> RNSScreen? {
306
382
  var responder: UIResponder? = self
307
383
  while let r = responder {
@@ -335,4 +411,6 @@ class LinkZoomExpoView: ExpoView {
335
411
  }
336
412
  return module.zoomAlignmentViewRepository
337
413
  }
414
+
415
+ lazy var logger = appContext?.jsLogger
338
416
  }
@@ -3,7 +3,7 @@
3
3
  "component": {
4
4
  "group": "expo.modules.router",
5
5
  "module": "expo.modules.router",
6
- "version": "7.0.0-canary-20251211-7da85ea",
6
+ "version": "7.0.0-canary-20251216-6e1f9a7",
7
7
  "attributes": {
8
8
  "org.gradle.status": "release"
9
9
  }
@@ -24,8 +24,8 @@
24
24
  },
25
25
  "files": [
26
26
  {
27
- "name": "expo.modules.router-7.0.0-canary-20251211-7da85ea.aar",
28
- "url": "expo.modules.router-7.0.0-canary-20251211-7da85ea.aar",
27
+ "name": "expo.modules.router-7.0.0-canary-20251216-6e1f9a7.aar",
28
+ "url": "expo.modules.router-7.0.0-canary-20251216-6e1f9a7.aar",
29
29
  "size": 13671,
30
30
  "sha512": "f51bd2a6d3fcc9075dbf99d66f77162d530586d0793d68e109a55f6edfbe4ff98bc9c9c5d587d0feec99807b6ae94a729232000e89f840278b21f4d423caa520",
31
31
  "sha256": "089d182f36875a201ad1b30b44d39812cd5155af987f3d33cd5eef8542103c82",
@@ -60,8 +60,8 @@
60
60
  ],
61
61
  "files": [
62
62
  {
63
- "name": "expo.modules.router-7.0.0-canary-20251211-7da85ea.aar",
64
- "url": "expo.modules.router-7.0.0-canary-20251211-7da85ea.aar",
63
+ "name": "expo.modules.router-7.0.0-canary-20251216-6e1f9a7.aar",
64
+ "url": "expo.modules.router-7.0.0-canary-20251216-6e1f9a7.aar",
65
65
  "size": 13671,
66
66
  "sha512": "f51bd2a6d3fcc9075dbf99d66f77162d530586d0793d68e109a55f6edfbe4ff98bc9c9c5d587d0feec99807b6ae94a729232000e89f840278b21f4d423caa520",
67
67
  "sha256": "089d182f36875a201ad1b30b44d39812cd5155af987f3d33cd5eef8542103c82",
@@ -80,8 +80,8 @@
80
80
  },
81
81
  "files": [
82
82
  {
83
- "name": "expo.modules.router-7.0.0-canary-20251211-7da85ea-sources.jar",
84
- "url": "expo.modules.router-7.0.0-canary-20251211-7da85ea-sources.jar",
83
+ "name": "expo.modules.router-7.0.0-canary-20251216-6e1f9a7-sources.jar",
84
+ "url": "expo.modules.router-7.0.0-canary-20251216-6e1f9a7-sources.jar",
85
85
  "size": 2318,
86
86
  "sha512": "9864add8e93e3c0a9a9c930aaed67016b15054c3fafd59a0bd3a5402d7cdc5827be84c22c2c137f3e5acb4e39270d9bfb9ca3fe11234458d4f2e0d4c78747f48",
87
87
  "sha256": "d5dff6259e86de721fc0f07fe740a5e18088e19b76738719b0a6f94caef06224",
@@ -0,0 +1 @@
1
+ d9665917800ec6a62bc4b9adaffb0aac3cf6534c3499fff8ff8d4d3fa5bdd199832a4ca51feebd86d2f1d1f3a86e13cd260ae8fa9c29ae33ad22f5013e8c71e7
@@ -9,7 +9,7 @@
9
9
  <modelVersion>4.0.0</modelVersion>
10
10
  <groupId>expo.modules.router</groupId>
11
11
  <artifactId>expo.modules.router</artifactId>
12
- <version>7.0.0-canary-20251211-7da85ea</version>
12
+ <version>7.0.0-canary-20251216-6e1f9a7</version>
13
13
  <packaging>aar</packaging>
14
14
  <name>expo.modules.router</name>
15
15
  <url>https://github.com/expo/expo</url>
@@ -0,0 +1 @@
1
+ ebe337d50192acd4ef69978915e08d3b51ad7e4078a52bb498de32bfae043866bbbc4cacff17af781deaec0b65e7e6a0a1496aab395dd4cba3634ca931efcca3
@@ -3,11 +3,11 @@
3
3
  <groupId>expo.modules.router</groupId>
4
4
  <artifactId>expo.modules.router</artifactId>
5
5
  <versioning>
6
- <latest>7.0.0-canary-20251211-7da85ea</latest>
7
- <release>7.0.0-canary-20251211-7da85ea</release>
6
+ <latest>7.0.0-canary-20251216-6e1f9a7</latest>
7
+ <release>7.0.0-canary-20251216-6e1f9a7</release>
8
8
  <versions>
9
- <version>7.0.0-canary-20251211-7da85ea</version>
9
+ <version>7.0.0-canary-20251216-6e1f9a7</version>
10
10
  </versions>
11
- <lastUpdated>20251211212254</lastUpdated>
11
+ <lastUpdated>20251216074519</lastUpdated>
12
12
  </versioning>
13
13
  </metadata>
@@ -1 +1 @@
1
- 89246345f931072dd5a6cbb681ff9071
1
+ 2a4f62869e73091472ab8285a3723da5
@@ -1 +1 @@
1
- 73846ff86844d0a19f8fad9d546a991a42368df6
1
+ 0bf438566c4abf2eb9360ea041d7570ba4607032
@@ -1 +1 @@
1
- 3efd8b36d801893a38e3d0382c32457635c7b3be3f94ae09dbc9983a38e71b85
1
+ 543f585654035c7f66c63d4a89ec26cf6c0a434d6b743944e9aa19cf5a532d38
@@ -1 +1 @@
1
- 52cb932e164c2aab2129a168c12c9496fcce68e8f1154152902813dca0a6a22b9168d239c35ab7902b6238a7f8db62ec433772edc27edfca0b4da3c67cc2cd7d
1
+ 51d9160727f18e8b69ad1de60f6a27f75bf1510d64f591e1a2201d49597673f6a4fd8d1a4128e57fa1072c03a7f697b9c641d48c7afffe16401412a4a70a1d52
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-router",
3
- "version": "7.0.0-canary-20251211-7da85ea",
3
+ "version": "7.0.0-canary-20251216-6e1f9a7",
4
4
  "description": "Expo Router is a file-based router for React Native and web applications.",
5
5
  "author": "650 Industries, Inc.",
6
6
  "license": "MIT",
@@ -83,14 +83,14 @@
83
83
  "expo"
84
84
  ],
85
85
  "peerDependencies": {
86
- "@expo/metro-runtime": "6.2.0-canary-20251211-7da85ea",
87
- "@expo/log-box": "0.0.13-canary-20251211-7da85ea",
86
+ "@expo/metro-runtime": "6.2.0-canary-20251216-6e1f9a7",
87
+ "@expo/log-box": "0.0.13-canary-20251216-6e1f9a7",
88
88
  "@react-navigation/drawer": "^7.7.2",
89
89
  "@testing-library/react-native": ">= 12.0.0",
90
- "expo": "55.0.0-canary-20251211-7da85ea",
91
- "expo-constants": "18.1.0-canary-20251211-7da85ea",
92
- "expo-linking": "8.0.11-canary-20251211-7da85ea",
93
- "expo-symbols": "1.1.0-canary-20251211-7da85ea",
90
+ "expo": "55.0.0-canary-20251216-6e1f9a7",
91
+ "expo-constants": "18.1.0-canary-20251216-6e1f9a7",
92
+ "expo-linking": "8.0.11-canary-20251216-6e1f9a7",
93
+ "expo-symbols": "1.1.0-canary-20251216-6e1f9a7",
94
94
  "react": "*",
95
95
  "react-dom": "*",
96
96
  "react-native": "*",
@@ -99,7 +99,7 @@
99
99
  "react-native-safe-area-context": ">= 5.4.0",
100
100
  "react-native-screens": "*",
101
101
  "react-native-web": "*",
102
- "react-server-dom-webpack": "~19.0.2 || ~19.1.3 || ~19.2.2"
102
+ "react-server-dom-webpack": "~19.0.3 || ~19.1.4 || ~19.2.3"
103
103
  },
104
104
  "peerDependenciesMeta": {
105
105
  "@testing-library/react-native": {
@@ -132,11 +132,11 @@
132
132
  "@types/react-dom": "^19.1.7",
133
133
  "@types/semver": "^7.7.0",
134
134
  "immer": "^10.1.1",
135
- "react-server-dom-webpack": "~19.0.2"
135
+ "react-server-dom-webpack": "~19.0.3"
136
136
  },
137
137
  "dependencies": {
138
- "@expo/metro-runtime": "6.2.0-canary-20251211-7da85ea",
139
- "@expo/schema-utils": "0.1.9-canary-20251211-7da85ea",
138
+ "@expo/metro-runtime": "6.2.0-canary-20251216-6e1f9a7",
139
+ "@expo/schema-utils": "0.1.9-canary-20251216-6e1f9a7",
140
140
  "@radix-ui/react-slot": "1.2.0",
141
141
  "@radix-ui/react-tabs": "^1.1.12",
142
142
  "@react-navigation/bottom-tabs": "^7.7.3",
@@ -145,7 +145,7 @@
145
145
  "client-only": "^0.0.1",
146
146
  "debug": "^4.3.4",
147
147
  "escape-string-regexp": "^4.0.0",
148
- "expo-server": "1.0.6-canary-20251211-7da85ea",
148
+ "expo-server": "1.0.6-canary-20251216-6e1f9a7",
149
149
  "fast-deep-equal": "^3.1.3",
150
150
  "invariant": "^2.2.4",
151
151
  "nanoid": "^3.3.8",
@@ -1,9 +0,0 @@
1
- import { NativeStackNavigationOptions } from '@react-navigation/native-stack';
2
- import type { ReactNode } from 'react';
3
- export interface StackHeaderLeftProps {
4
- children?: ReactNode;
5
- asChild?: boolean;
6
- }
7
- export declare function StackHeaderLeft(props: StackHeaderLeftProps): null;
8
- export declare function appendStackHeaderLeftPropsToOptions(options: NativeStackNavigationOptions, props: StackHeaderLeftProps): NativeStackNavigationOptions;
9
- //# sourceMappingURL=StackHeaderLeft.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"StackHeaderLeft.d.ts","sourceRoot":"","sources":["../../../src/layouts/stack-utils/StackHeaderLeft.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,QAE1D;AAED,wBAAgB,mCAAmC,CACjD,OAAO,EAAE,4BAA4B,EACrC,KAAK,EAAE,oBAAoB,GAC1B,4BAA4B,CAS9B"}
@@ -1,17 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.StackHeaderLeft = StackHeaderLeft;
4
- exports.appendStackHeaderLeftPropsToOptions = appendStackHeaderLeftPropsToOptions;
5
- function StackHeaderLeft(props) {
6
- return null;
7
- }
8
- function appendStackHeaderLeftPropsToOptions(options, props) {
9
- if (!props.asChild) {
10
- return options;
11
- }
12
- return {
13
- ...options,
14
- headerLeft: () => props.children,
15
- };
16
- }
17
- //# sourceMappingURL=StackHeaderLeft.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"StackHeaderLeft.js","sourceRoot":"","sources":["../../../src/layouts/stack-utils/StackHeaderLeft.tsx"],"names":[],"mappings":";;AAQA,0CAEC;AAED,kFAYC;AAhBD,SAAgB,eAAe,CAAC,KAA2B;IACzD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAgB,mCAAmC,CACjD,OAAqC,EACrC,KAA2B;IAE3B,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;QACnB,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,OAAO;QACL,GAAG,OAAO;QACV,UAAU,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,QAAQ;KACjC,CAAC;AACJ,CAAC","sourcesContent":["import { NativeStackNavigationOptions } from '@react-navigation/native-stack';\nimport type { ReactNode } from 'react';\n\nexport interface StackHeaderLeftProps {\n children?: ReactNode;\n asChild?: boolean;\n}\n\nexport function StackHeaderLeft(props: StackHeaderLeftProps) {\n return null;\n}\n\nexport function appendStackHeaderLeftPropsToOptions(\n options: NativeStackNavigationOptions,\n props: StackHeaderLeftProps\n): NativeStackNavigationOptions {\n if (!props.asChild) {\n return options;\n }\n\n return {\n ...options,\n headerLeft: () => props.children,\n };\n}\n"]}
@@ -1,9 +0,0 @@
1
- import { NativeStackNavigationOptions } from '@react-navigation/native-stack';
2
- import type { ReactNode } from 'react';
3
- export interface StackHeaderRightProps {
4
- children?: ReactNode;
5
- asChild?: boolean;
6
- }
7
- export declare function StackHeaderRight(props: StackHeaderRightProps): null;
8
- export declare function appendStackHeaderRightPropsToOptions(options: NativeStackNavigationOptions, props: StackHeaderRightProps): NativeStackNavigationOptions;
9
- //# sourceMappingURL=StackHeaderRight.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"StackHeaderRight.d.ts","sourceRoot":"","sources":["../../../src/layouts/stack-utils/StackHeaderRight.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,QAE5D;AAED,wBAAgB,oCAAoC,CAClD,OAAO,EAAE,4BAA4B,EACrC,KAAK,EAAE,qBAAqB,GAC3B,4BAA4B,CAS9B"}
@@ -1,17 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.StackHeaderRight = StackHeaderRight;
4
- exports.appendStackHeaderRightPropsToOptions = appendStackHeaderRightPropsToOptions;
5
- function StackHeaderRight(props) {
6
- return null;
7
- }
8
- function appendStackHeaderRightPropsToOptions(options, props) {
9
- if (!props.asChild) {
10
- return options;
11
- }
12
- return {
13
- ...options,
14
- headerRight: () => props.children,
15
- };
16
- }
17
- //# sourceMappingURL=StackHeaderRight.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"StackHeaderRight.js","sourceRoot":"","sources":["../../../src/layouts/stack-utils/StackHeaderRight.tsx"],"names":[],"mappings":";;AAQA,4CAEC;AAED,oFAYC;AAhBD,SAAgB,gBAAgB,CAAC,KAA4B;IAC3D,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAgB,oCAAoC,CAClD,OAAqC,EACrC,KAA4B;IAE5B,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;QACnB,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,OAAO;QACL,GAAG,OAAO;QACV,WAAW,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,QAAQ;KAClC,CAAC;AACJ,CAAC","sourcesContent":["import { NativeStackNavigationOptions } from '@react-navigation/native-stack';\nimport type { ReactNode } from 'react';\n\nexport interface StackHeaderRightProps {\n children?: ReactNode;\n asChild?: boolean;\n}\n\nexport function StackHeaderRight(props: StackHeaderRightProps) {\n return null;\n}\n\nexport function appendStackHeaderRightPropsToOptions(\n options: NativeStackNavigationOptions,\n props: StackHeaderRightProps\n): NativeStackNavigationOptions {\n if (!props.asChild) {\n return options;\n }\n\n return {\n ...options,\n headerRight: () => props.children,\n };\n}\n"]}
@@ -1,6 +0,0 @@
1
- import { LinkProps } from '../useLinkHooks';
2
- export declare function useZoomTransitionPrimitives({ href }: LinkProps): {
3
- zoomTransitionSourceContextValue: undefined;
4
- href: string | import("../..").HrefObject;
5
- };
6
- //# sourceMappingURL=useZoomTransitionPrimitives.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useZoomTransitionPrimitives.d.ts","sourceRoot":"","sources":["../../../src/link/zoom/useZoomTransitionPrimitives.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAG5C,wBAAgB,2BAA2B,CAAC,EAAE,IAAI,EAAE,EAAE,SAAS;;;EAG9D"}
@@ -1,11 +0,0 @@
1
- import { LinkProps } from '../useLinkHooks';
2
- export declare function useZoomTransitionPrimitives({ href, asChild }: LinkProps): {
3
- zoomTransitionSourceContextValue: {
4
- identifier: string;
5
- addSource: () => void;
6
- removeSource: () => void;
7
- canAddSource: boolean;
8
- } | undefined;
9
- href: string | import("../..").HrefObject;
10
- };
11
- //# sourceMappingURL=useZoomTransitionPrimitives.ios.d.ts.map
@@ -1 +0,0 @@
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"}
@@ -1,69 +0,0 @@
1
- "use strict";
2
- 'use client';
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.useZoomTransitionPrimitives = useZoomTransitionPrimitives;
5
- const non_secure_1 = require("nanoid/non-secure");
6
- const react_1 = require("react");
7
- const ZoomTransitionEnabler_1 = require("./ZoomTransitionEnabler");
8
- const navigationParams_1 = require("../../navigationParams");
9
- const url_1 = require("../../utils/url");
10
- const PreviewRouteContext_1 = require("../preview/PreviewRouteContext");
11
- function useZoomTransitionPrimitives({ href, asChild }) {
12
- const isPreview = (0, PreviewRouteContext_1.useIsPreview)();
13
- const zoomTransitionId = (0, react_1.useMemo)(() => !isPreview && process.env.EXPO_OS === 'ios' && (0, ZoomTransitionEnabler_1.isZoomTransitionEnabled)()
14
- ? (0, non_secure_1.nanoid)()
15
- : undefined, []);
16
- const [numberOfSources, setNumberOfSources] = (0, react_1.useState)(0);
17
- const addSource = (0, react_1.useCallback)(() => {
18
- setNumberOfSources((prev) => prev + 1);
19
- }, []);
20
- const removeSource = (0, react_1.useCallback)(() => {
21
- setNumberOfSources((prev) => prev - 1);
22
- }, []);
23
- const hasZoomSource = numberOfSources > 0;
24
- (0, react_1.useEffect)(() => {
25
- if (numberOfSources > 1) {
26
- throw new Error('[expo-router] Only one Link.ZoomTransitionSource can be used within a single Link component.');
27
- }
28
- }, [numberOfSources]);
29
- (0, react_1.useEffect)(() => {
30
- if (hasZoomSource && !asChild) {
31
- console.warn('[expo-router] Using zoom transition links without `asChild` prop may lead to unexpected behavior. Please ensure to set `asChild` when using zoom transitions.');
32
- }
33
- }, [hasZoomSource, asChild]);
34
- const zoomTransitionSourceContextValue = (0, react_1.useMemo)(() => {
35
- if (!zoomTransitionId) {
36
- return undefined;
37
- }
38
- return {
39
- identifier: zoomTransitionId,
40
- addSource,
41
- removeSource,
42
- canAddSource: !hasZoomSource,
43
- };
44
- }, [zoomTransitionId, addSource, removeSource, hasZoomSource]);
45
- const computedHref = (0, react_1.useMemo)(() => {
46
- if (!hasZoomSource || !zoomTransitionId) {
47
- return href;
48
- }
49
- if (typeof href === 'string') {
50
- const { pathname, searchParams } = (0, url_1.parseUrlUsingCustomBase)(href);
51
- return {
52
- pathname,
53
- params: {
54
- ...Object.fromEntries(searchParams.entries()),
55
- [navigationParams_1.INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SOURCE_ID_PARAM_NAME]: zoomTransitionId,
56
- },
57
- };
58
- }
59
- return {
60
- pathname: href.pathname,
61
- params: {
62
- ...(href.params ?? {}),
63
- [navigationParams_1.INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SOURCE_ID_PARAM_NAME]: zoomTransitionId,
64
- },
65
- };
66
- }, [href, zoomTransitionId, hasZoomSource]);
67
- return { zoomTransitionSourceContextValue, href: computedHref };
68
- }
69
- //# sourceMappingURL=useZoomTransitionPrimitives.ios.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useZoomTransitionPrimitives.ios.js","sourceRoot":"","sources":["../../../src/link/zoom/useZoomTransitionPrimitives.ios.tsx"],"names":[],"mappings":"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","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 { 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"]}