expo-router 5.2.0-canary-20250729-d8899ae → 6.0.0-beta.0

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 (215) hide show
  1. package/_ctx.android.js +1 -1
  2. package/_ctx.ios.js +1 -1
  3. package/_ctx.web.js +1 -1
  4. package/assets/modal.module.css +12 -3
  5. package/build/ExpoRoot.d.ts.map +1 -1
  6. package/build/ExpoRoot.js +12 -2
  7. package/build/ExpoRoot.js.map +1 -1
  8. package/build/Route.d.ts +9 -0
  9. package/build/Route.d.ts.map +1 -1
  10. package/build/Route.js.map +1 -1
  11. package/build/constants.d.ts +2 -0
  12. package/build/constants.d.ts.map +1 -1
  13. package/build/constants.js +3 -1
  14. package/build/constants.js.map +1 -1
  15. package/build/doctor/index.d.ts +1 -1
  16. package/build/doctor/index.d.ts.map +1 -1
  17. package/build/doctor/index.js +4 -1
  18. package/build/doctor/index.js.map +1 -1
  19. package/build/exports.d.ts +2 -2
  20. package/build/exports.d.ts.map +1 -1
  21. package/build/exports.js +6 -6
  22. package/build/exports.js.map +1 -1
  23. package/build/fork/native-stack/createNativeStackNavigator.d.ts +2 -2
  24. package/build/fork/native-stack/createNativeStackNavigator.d.ts.map +1 -1
  25. package/build/fork/native-stack/createNativeStackNavigator.js +82 -2
  26. package/build/fork/native-stack/createNativeStackNavigator.js.map +1 -1
  27. package/build/fork/useLinking.js +2 -2
  28. package/build/fork/useLinking.js.map +1 -1
  29. package/build/getLinkingConfig.d.ts +29 -2
  30. package/build/getLinkingConfig.d.ts.map +1 -1
  31. package/build/getLinkingConfig.js +35 -4
  32. package/build/getLinkingConfig.js.map +1 -1
  33. package/build/getRoutesCore.d.ts +1 -0
  34. package/build/getRoutesCore.d.ts.map +1 -1
  35. package/build/getRoutesCore.js +60 -0
  36. package/build/getRoutesCore.js.map +1 -1
  37. package/build/getServerManifest.d.ts +20 -1
  38. package/build/getServerManifest.d.ts.map +1 -1
  39. package/build/getServerManifest.js +8 -1
  40. package/build/getServerManifest.js.map +1 -1
  41. package/build/global-state/routeInfo.d.ts.map +1 -1
  42. package/build/global-state/routeInfo.js +12 -1
  43. package/build/global-state/routeInfo.js.map +1 -1
  44. package/build/global-state/router-store.d.ts.map +1 -1
  45. package/build/global-state/router-store.js +4 -0
  46. package/build/global-state/router-store.js.map +1 -1
  47. package/build/global-state/routing.d.ts +29 -1
  48. package/build/global-state/routing.d.ts.map +1 -1
  49. package/build/global-state/routing.js +78 -42
  50. package/build/global-state/routing.js.map +1 -1
  51. package/build/global-state/utils.d.ts +4 -0
  52. package/build/global-state/utils.d.ts.map +1 -0
  53. package/build/global-state/utils.js +29 -0
  54. package/build/global-state/utils.js.map +1 -0
  55. package/build/hooks.d.ts +1 -1
  56. package/build/hooks.d.ts.map +1 -1
  57. package/build/hooks.js +9 -4
  58. package/build/hooks.js.map +1 -1
  59. package/build/layouts/DrawerClient.d.ts +2 -2
  60. package/build/layouts/Stack.web.d.ts +1 -1
  61. package/build/layouts/Stack.web.d.ts.map +1 -1
  62. package/build/layouts/Stack.web.js +3 -3
  63. package/build/layouts/Stack.web.js.map +1 -1
  64. package/build/layouts/StackClient.d.ts +2 -2
  65. package/build/layouts/StackClient.d.ts.map +1 -1
  66. package/build/layouts/StackClient.js +18 -14
  67. package/build/layouts/StackClient.js.map +1 -1
  68. package/build/layouts/TabsClient.d.ts +3 -3
  69. package/build/layouts/withLayoutContext.d.ts.map +1 -1
  70. package/build/layouts/withLayoutContext.js +13 -0
  71. package/build/layouts/withLayoutContext.js.map +1 -1
  72. package/build/link/ExpoLink.d.ts.map +1 -1
  73. package/build/link/ExpoLink.js +3 -2
  74. package/build/link/ExpoLink.js.map +1 -1
  75. package/build/link/InternalLinkPreviewContext.d.ts +6 -0
  76. package/build/link/InternalLinkPreviewContext.d.ts.map +1 -0
  77. package/build/link/InternalLinkPreviewContext.js +6 -0
  78. package/build/link/InternalLinkPreviewContext.js.map +1 -0
  79. package/build/link/Link.d.ts +2 -67
  80. package/build/link/Link.d.ts.map +1 -1
  81. package/build/link/Link.js +5 -70
  82. package/build/link/Link.js.map +1 -1
  83. package/build/link/LinkWithPreview.d.ts +1 -46
  84. package/build/link/LinkWithPreview.d.ts.map +1 -1
  85. package/build/link/LinkWithPreview.js +30 -114
  86. package/build/link/LinkWithPreview.js.map +1 -1
  87. package/build/link/elements.d.ts +174 -0
  88. package/build/link/elements.d.ts.map +1 -0
  89. package/build/link/elements.js +172 -0
  90. package/build/link/elements.js.map +1 -0
  91. package/build/link/preview/HrefPreview.d.ts +1 -1
  92. package/build/link/preview/HrefPreview.d.ts.map +1 -1
  93. package/build/link/preview/HrefPreview.js +61 -7
  94. package/build/link/preview/HrefPreview.js.map +1 -1
  95. package/build/link/preview/LinkPreviewContext.d.ts +3 -2
  96. package/build/link/preview/LinkPreviewContext.d.ts.map +1 -1
  97. package/build/link/preview/LinkPreviewContext.js +3 -2
  98. package/build/link/preview/LinkPreviewContext.js.map +1 -1
  99. package/build/link/preview/native.d.ts +14 -6
  100. package/build/link/preview/native.d.ts.map +1 -1
  101. package/build/link/preview/native.js.map +1 -1
  102. package/build/link/preview/useNextScreenId.d.ts +8 -1
  103. package/build/link/preview/useNextScreenId.d.ts.map +1 -1
  104. package/build/link/preview/useNextScreenId.js +36 -32
  105. package/build/link/preview/useNextScreenId.js.map +1 -1
  106. package/build/link/preview/utils.d.ts +12 -0
  107. package/build/link/preview/utils.d.ts.map +1 -0
  108. package/build/link/preview/utils.js +66 -0
  109. package/build/link/preview/utils.js.map +1 -0
  110. package/build/modal/Modal.js +1 -1
  111. package/build/modal/Modal.js.map +1 -1
  112. package/build/modal/ModalsRenderer.js +1 -1
  113. package/build/modal/ModalsRenderer.js.map +1 -1
  114. package/build/modal/ModalsRenderer.web.js +4 -4
  115. package/build/modal/ModalsRenderer.web.js.map +1 -1
  116. package/build/modal/web/{ModalStack.web.d.ts → ModalStack.d.ts} +1 -1
  117. package/build/modal/web/ModalStack.d.ts.map +1 -0
  118. package/build/modal/web/{ModalStack.web.js → ModalStack.js} +5 -5
  119. package/build/modal/web/ModalStack.js.map +1 -0
  120. package/build/modal/web/{ModalStackRouteDrawer.web.d.ts → ModalStackRouteDrawer.d.ts} +1 -1
  121. package/build/modal/web/ModalStackRouteDrawer.d.ts.map +1 -0
  122. package/build/modal/web/{ModalStackRouteDrawer.web.js → ModalStackRouteDrawer.js} +1 -2
  123. package/build/modal/web/ModalStackRouteDrawer.js.map +1 -0
  124. package/build/modal/web/{TransparentModalStackRouteDrawer.web.d.ts → TransparentModalStackRouteDrawer.d.ts} +1 -1
  125. package/build/modal/web/TransparentModalStackRouteDrawer.d.ts.map +1 -0
  126. package/build/modal/web/{TransparentModalStackRouteDrawer.web.js → TransparentModalStackRouteDrawer.js} +1 -1
  127. package/build/modal/web/TransparentModalStackRouteDrawer.js.map +1 -0
  128. package/build/native-tabs/NativeBottomTabs/NativeBottomTabsNavigator.d.ts +17 -0
  129. package/build/native-tabs/NativeBottomTabs/NativeBottomTabsNavigator.d.ts.map +1 -0
  130. package/build/native-tabs/NativeBottomTabs/NativeBottomTabsNavigator.js +27 -0
  131. package/build/native-tabs/NativeBottomTabs/NativeBottomTabsNavigator.js.map +1 -0
  132. package/build/native-tabs/NativeBottomTabs/NativeBottomTabsRouter.d.ts +3 -0
  133. package/build/native-tabs/NativeBottomTabs/NativeBottomTabsRouter.d.ts.map +1 -0
  134. package/build/native-tabs/NativeBottomTabs/NativeBottomTabsRouter.js +65 -0
  135. package/build/native-tabs/NativeBottomTabs/NativeBottomTabsRouter.js.map +1 -0
  136. package/build/native-tabs/NativeBottomTabs/NativeTabTrigger.d.ts +47 -0
  137. package/build/native-tabs/NativeBottomTabs/NativeTabTrigger.d.ts.map +1 -0
  138. package/build/native-tabs/NativeBottomTabs/NativeTabTrigger.js +153 -0
  139. package/build/native-tabs/NativeBottomTabs/NativeTabTrigger.js.map +1 -0
  140. package/build/native-tabs/NativeBottomTabs/NativeTabs.d.ts +24 -0
  141. package/build/native-tabs/NativeBottomTabs/NativeTabs.d.ts.map +1 -0
  142. package/build/native-tabs/NativeBottomTabs/NativeTabs.js +27 -0
  143. package/build/native-tabs/NativeBottomTabs/NativeTabs.js.map +1 -0
  144. package/build/native-tabs/NativeBottomTabs/NativeTabsView.d.ts +4 -0
  145. package/build/native-tabs/NativeBottomTabs/NativeTabsView.d.ts.map +1 -0
  146. package/build/native-tabs/NativeBottomTabs/NativeTabsView.js +116 -0
  147. package/build/native-tabs/NativeBottomTabs/NativeTabsView.js.map +1 -0
  148. package/build/native-tabs/NativeBottomTabs/types.d.ts +166 -0
  149. package/build/native-tabs/NativeBottomTabs/types.d.ts.map +1 -0
  150. package/build/native-tabs/NativeBottomTabs/types.js +3 -0
  151. package/build/native-tabs/NativeBottomTabs/types.js.map +1 -0
  152. package/build/native-tabs/NativeBottomTabs/utils.d.ts +7 -0
  153. package/build/native-tabs/NativeBottomTabs/utils.d.ts.map +1 -0
  154. package/build/native-tabs/NativeBottomTabs/utils.js +21 -0
  155. package/build/native-tabs/NativeBottomTabs/utils.js.map +1 -0
  156. package/build/native-tabs/common/elements.d.ts +74 -0
  157. package/build/native-tabs/common/elements.d.ts.map +1 -0
  158. package/build/native-tabs/common/elements.js +21 -0
  159. package/build/native-tabs/common/elements.js.map +1 -0
  160. package/build/native-tabs/index.d.ts +5 -0
  161. package/build/native-tabs/index.d.ts.map +1 -0
  162. package/build/native-tabs/index.js +23 -0
  163. package/build/native-tabs/index.js.map +1 -0
  164. package/build/routes-manifest.d.ts +42 -0
  165. package/build/routes-manifest.d.ts.map +1 -1
  166. package/build/routes-manifest.js.map +1 -1
  167. package/build/rsc/middleware.d.ts +1 -1
  168. package/build/rsc/middleware.d.ts.map +1 -1
  169. package/build/rsc/middleware.js.map +1 -1
  170. package/build/testing-library/mock-config.d.ts +18 -0
  171. package/build/testing-library/mock-config.d.ts.map +1 -1
  172. package/build/testing-library/mock-config.js +4 -1
  173. package/build/testing-library/mock-config.js.map +1 -1
  174. package/build/ui/common.d.ts.map +1 -1
  175. package/build/ui/common.js +7 -6
  176. package/build/ui/common.js.map +1 -1
  177. package/build/useNavigation.d.ts.map +1 -1
  178. package/build/useNavigation.js +8 -5
  179. package/build/useNavigation.js.map +1 -1
  180. package/build/views/NoSSR.d.ts +5 -0
  181. package/build/views/NoSSR.d.ts.map +1 -0
  182. package/build/views/NoSSR.js +22 -0
  183. package/build/views/NoSSR.js.map +1 -0
  184. package/build/views/Screen.d.ts.map +1 -1
  185. package/build/views/Screen.js +4 -1
  186. package/build/views/Screen.js.map +1 -1
  187. package/build/views/Sitemap.d.ts.map +1 -1
  188. package/build/views/Sitemap.js +113 -10
  189. package/build/views/Sitemap.js.map +1 -1
  190. package/build/views/Unmatched.d.ts.map +1 -1
  191. package/build/views/Unmatched.js +14 -4
  192. package/build/views/Unmatched.js.map +1 -1
  193. package/ios/ExpoHead.podspec +10 -1
  194. package/ios/LinkPreview/LinkPreviewNativeActionView.swift +159 -21
  195. package/ios/LinkPreview/LinkPreviewNativeModule.swift +44 -6
  196. package/ios/LinkPreview/LinkPreviewNativeNavigation.h +37 -11
  197. package/ios/LinkPreview/LinkPreviewNativeNavigation.mm +110 -87
  198. package/ios/LinkPreview/LinkPreviewNativeNavigation.swift +136 -0
  199. package/ios/LinkPreview/LinkPreviewNativePreviewView.swift +0 -1
  200. package/ios/LinkPreview/LinkPreviewNativeTriggerView.swift +1 -1
  201. package/ios/LinkPreview/LinkPreviewNativeView.swift +72 -71
  202. package/package.json +42 -10
  203. package/plugin/build/index.d.ts +2 -0
  204. package/plugin/options.json +5 -0
  205. package/plugin/src/index.ts +2 -0
  206. package/plugin/tsconfig.tsbuildinfo +1 -0
  207. package/server.d.ts +2 -1
  208. package/unstable-native-tabs.d.ts +1 -0
  209. package/unstable-native-tabs.js +1 -0
  210. package/build/modal/web/ModalStack.web.d.ts.map +0 -1
  211. package/build/modal/web/ModalStack.web.js.map +0 -1
  212. package/build/modal/web/ModalStackRouteDrawer.web.d.ts.map +0 -1
  213. package/build/modal/web/ModalStackRouteDrawer.web.js.map +0 -1
  214. package/build/modal/web/TransparentModalStackRouteDrawer.web.d.ts.map +0 -1
  215. package/build/modal/web/TransparentModalStackRouteDrawer.web.js.map +0 -1
@@ -1,10 +1,20 @@
1
1
  import ExpoModulesCore
2
2
 
3
- class NativeLinkPreviewView: ExpoView, UIContextMenuInteractionDelegate, LinkPreviewModalDismissible {
3
+ class NativeLinkPreviewView: ExpoView, UIContextMenuInteractionDelegate,
4
+ LinkPreviewModalDismissible, LinkPreviewMenuUpdatable {
4
5
  private var trigger: NativeLinkPreviewTrigger?
5
6
  private var preview: NativeLinkPreviewContentView?
6
7
  private var interaction: UIContextMenuInteraction?
7
- private var nextScreenId: String?
8
+ var nextScreenId: String? {
9
+ didSet {
10
+ performUpdateOfPreloadedView()
11
+ }
12
+ }
13
+ var tabPath: TabPathPayload? {
14
+ didSet {
15
+ performUpdateOfPreloadedView()
16
+ }
17
+ }
8
18
  private var actions: [LinkPreviewNativeActionView] = []
9
19
 
10
20
  private let linkPreviewNativeNavigation = LinkPreviewNativeNavigation()
@@ -15,7 +25,6 @@ class NativeLinkPreviewView: ExpoView, UIContextMenuInteractionDelegate, LinkPre
15
25
  let onDidPreviewOpen = EventDispatcher()
16
26
  let onPreviewWillClose = EventDispatcher()
17
27
  let onPreviewDidClose = EventDispatcher()
18
- let onActionSelected = EventDispatcher()
19
28
 
20
29
  required init(appContext: AppContext? = nil) {
21
30
  super.init(appContext: appContext)
@@ -30,56 +39,63 @@ class NativeLinkPreviewView: ExpoView, UIContextMenuInteractionDelegate, LinkPre
30
39
 
31
40
  // MARK: - Props
32
41
 
33
- func setNextScreenId(_ screenId: String) {
34
- self.nextScreenId = screenId
35
- linkPreviewNativeNavigation.updatePreloadedView(screenId, with: self)
42
+ func performUpdateOfPreloadedView() {
43
+ if nextScreenId == nil && tabPath?.path.isEmpty != false {
44
+ // If we have no tab to change and no screen to push, then we can't update the preloaded view
45
+ return
46
+ }
47
+ // However if one these is defined then we can perform the native update
48
+ linkPreviewNativeNavigation.updatePreloadedView(
49
+ screenId: nextScreenId, tabPath: tabPath, responder: self)
36
50
  }
37
51
 
38
52
  // MARK: - Children
39
- #if RCT_NEW_ARCH_ENABLED
40
- override func mountChildComponentView(_ childComponentView: UIView, index: Int) {
41
- if let triggerView = childComponentView as? NativeLinkPreviewTrigger {
42
- trigger = triggerView
43
- if let interaction = self.interaction, self.preview != nil {
44
- trigger?.addInteraction(interaction)
53
+ #if RCT_NEW_ARCH_ENABLED
54
+ override func mountChildComponentView(_ childComponentView: UIView, index: Int) {
55
+ if let triggerView = childComponentView as? NativeLinkPreviewTrigger {
56
+ trigger = triggerView
57
+ if let interaction = self.interaction {
58
+ triggerView.addInteraction(interaction)
59
+ }
60
+ super.mountChildComponentView(childComponentView, index: index)
61
+ } else if let previewView = childComponentView as? NativeLinkPreviewContentView {
62
+ preview = previewView
63
+ if let interaction = self.interaction, let trigger = self.trigger {
64
+ trigger.addInteraction(interaction)
65
+ }
66
+ } else if let actionView = childComponentView as? LinkPreviewNativeActionView {
67
+ actionView.parentMenuUpdatable = self
68
+ actions.append(actionView)
69
+ } else {
70
+ print(
71
+ "ExpoRouter: Unknown child component view (\(childComponentView)) mounted to NativeLinkPreviewView"
72
+ )
45
73
  }
46
- super.mountChildComponentView(childComponentView, index: index)
47
- } else if let previewView = childComponentView as? NativeLinkPreviewContentView {
48
- preview = previewView
49
- if let interaction = self.interaction, let trigger = self.trigger {
50
- trigger.addInteraction(interaction)
51
- }
52
- } else if let actionView = childComponentView as? LinkPreviewNativeActionView {
53
- actions.append(actionView)
54
- } else {
55
- print(
56
- "ExpoRouter: Unknown child component view (\(childComponentView)) mounted to NativeLinkPreviewView"
57
- )
58
74
  }
59
- }
60
75
 
61
- override func unmountChildComponentView(_ child: UIView, index: Int) {
62
- if child is NativeLinkPreviewTrigger {
63
- if let interaction = self.interaction {
64
- trigger?.removeInteraction(interaction)
76
+ override func unmountChildComponentView(_ child: UIView, index: Int) {
77
+ if child is NativeLinkPreviewTrigger {
78
+ if let interaction = self.interaction {
79
+ trigger?.removeInteraction(interaction)
80
+ }
81
+ trigger = nil
82
+ super.unmountChildComponentView(child, index: index)
83
+ } else if child is NativeLinkPreviewContentView {
84
+ preview = nil
85
+ if let interaction = self.interaction {
86
+ trigger?.removeInteraction(interaction)
87
+ }
88
+ } else if let actionView = child as? LinkPreviewNativeActionView {
89
+ actions.removeAll(where: {
90
+ $0 == actionView
91
+ })
92
+ } else {
93
+ print(
94
+ "ExpoRouter: Unknown child component view (\(child)) unmounted from NativeLinkPreviewView"
95
+ )
65
96
  }
66
- trigger = nil
67
- super.unmountChildComponentView(child, index: index)
68
- } else if child is NativeLinkPreviewContentView {
69
- preview = nil
70
- if let interaction = self.interaction {
71
- trigger?.removeInteraction(interaction)
72
- }
73
- } else if let actionView = child as? LinkPreviewNativeActionView {
74
- actions.removeAll(where: {
75
- $0 == actionView
76
- })
77
- } else {
78
- print(
79
- "ExpoRouter: Unknown child component view (\(child)) unmounted from NativeLinkPreviewView")
80
97
  }
81
- }
82
- #endif
98
+ #endif
83
99
 
84
100
  // MARK: - UIContextMenuInteractionDelegate
85
101
 
@@ -108,7 +124,7 @@ class NativeLinkPreviewView: ExpoView, UIContextMenuInteractionDelegate, LinkPre
108
124
 
109
125
  let parameters = UIPreviewParameters()
110
126
  parameters.backgroundColor = .clear
111
- parameters.shadowPath = UIBezierPath(roundedRect: trigger.bounds, cornerRadius: 10)
127
+ parameters.shadowPath = UIBezierPath(roundedRect: trigger.bounds, cornerRadius: trigger.triggerBorderRadius)
112
128
 
113
129
  return UITargetedPreview(view: trigger, parameters: parameters, target: target)
114
130
  }
@@ -154,9 +170,9 @@ class NativeLinkPreviewView: ExpoView, UIContextMenuInteractionDelegate, LinkPre
154
170
 
155
171
  // MARK: - Context Menu Helpers
156
172
 
157
- private func createPreviewViewController() -> UIViewController {
173
+ private func createPreviewViewController() -> UIViewController? {
158
174
  guard let preview = preview else {
159
- return UIViewController()
175
+ return nil
160
176
  }
161
177
 
162
178
  let vc = PreviewViewController(linkPreviewNativePreview: preview)
@@ -167,38 +183,23 @@ class NativeLinkPreviewView: ExpoView, UIContextMenuInteractionDelegate, LinkPre
167
183
  return vc
168
184
  }
169
185
 
186
+ func updateMenu() {
187
+ self.interaction?.updateVisibleMenu { _ in
188
+ self.createContextMenu()
189
+ }
190
+ }
191
+
170
192
  private func createContextMenu() -> UIMenu {
171
- if actions.count == 1, let menu = convertActionViewToUiAction(actions[0]) as? UIMenu {
193
+ if actions.count == 1, let menu = actions[0].uiAction as? UIMenu {
172
194
  return menu
173
195
  }
174
196
  return UIMenu(
175
197
  title: "",
176
198
  children: actions.map { action in
177
- self.convertActionViewToUiAction(action)
199
+ action.uiAction
178
200
  }
179
201
  )
180
202
  }
181
-
182
- private func convertActionViewToUiAction(_ action: LinkPreviewNativeActionView) -> UIMenuElement {
183
- if !action.subActions.isEmpty {
184
- let subActions = action.subActions.map { subAction in
185
- self.convertActionViewToUiAction(subAction)
186
- }
187
- return UIMenu(
188
- title: action.title,
189
- image: action.icon.flatMap { UIImage(systemName: $0) },
190
- children: subActions
191
- )
192
- }
193
- return UIAction(
194
- title: action.title,
195
- image: action.icon.flatMap { UIImage(systemName: $0) }
196
- ) { _ in
197
- self.onActionSelected([
198
- "id": action.id
199
- ])
200
- }
201
- }
202
203
  }
203
204
 
204
205
  class PreviewViewController: UIViewController {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-router",
3
- "version": "5.2.0-canary-20250729-d8899ae",
3
+ "version": "6.0.0-beta.0",
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",
@@ -35,6 +35,8 @@
35
35
  "html.js",
36
36
  "index.d.ts",
37
37
  "ios",
38
+ "unstable-native-tabs.js",
39
+ "unstable-native-tabs.d.ts",
38
40
  "node",
39
41
  "plugin",
40
42
  "rsc",
@@ -76,22 +78,45 @@
76
78
  ],
77
79
  "peerDependencies": {
78
80
  "@react-navigation/drawer": "^7.3.9",
79
- "expo": "54.0.0-canary-20250729-d8899ae",
80
- "expo-constants": "17.1.8-canary-20250729-d8899ae",
81
- "expo-linking": "7.1.8-canary-20250729-d8899ae",
81
+ "@testing-library/jest-native": ">= 5.0.0",
82
+ "@testing-library/react-native": ">= 12.0.0",
83
+ "expo": "*",
84
+ "expo-constants": "*",
85
+ "expo-linking": "*",
86
+ "react": "*",
87
+ "react-dom": "*",
88
+ "react-native": "*",
89
+ "react-native-gesture-handler": "*",
82
90
  "react-native-reanimated": "*",
83
- "react-native-safe-area-context": "*",
84
- "react-native-screens": "*"
91
+ "react-native-safe-area-context": ">= 4.0.0",
92
+ "react-native-screens": "*",
93
+ "react-native-web": "*",
94
+ "react-server-dom-webpack": ">= 19.0.0"
85
95
  },
86
96
  "peerDependenciesMeta": {
97
+ "react-dom": {
98
+ "optional": true
99
+ },
100
+ "react-native-gesture-handler": {
101
+ "optional": true
102
+ },
87
103
  "react-native-reanimated": {
88
104
  "optional": true
89
105
  },
106
+ "react-native-web": {
107
+ "optional": true
108
+ },
109
+ "react-server-dom-webpack": {
110
+ "optional": true
111
+ },
90
112
  "@react-navigation/drawer": {
91
113
  "optional": true
92
114
  },
93
115
  "@testing-library/jest-native": {
94
116
  "optional": true
117
+ },
118
+ "@testing-library/react-native": {
119
+ "optional": true
95
120
  }
96
121
  },
97
122
  "devDependencies": {
@@ -105,21 +130,28 @@
105
130
  "tsd": "^0.28.1"
106
131
  },
107
132
  "dependencies": {
108
- "@expo/metro-runtime": "6.0.0-canary-20250729-d8899ae",
109
- "@expo/server": "0.6.4-canary-20250729-d8899ae",
133
+ "@expo/metro-runtime": "6.0.0",
134
+ "@expo/server": "^0.7.0",
110
135
  "@radix-ui/react-slot": "1.2.0",
111
136
  "@react-navigation/bottom-tabs": "^7.3.10",
112
137
  "@react-navigation/native": "^7.1.6",
113
138
  "@react-navigation/native-stack": "^7.3.10",
114
139
  "client-only": "^0.0.1",
140
+ "debug": "^4.3.4",
141
+ "escape-string-regexp": "^4.0.0",
142
+ "fast-deep-equal": "^3.1.3",
115
143
  "invariant": "^2.2.4",
144
+ "nanoid": "^3.3.8",
116
145
  "react-fast-compare": "^3.2.2",
117
146
  "react-native-is-edge-to-edge": "^1.1.6",
147
+ "query-string": "^7.1.3",
118
148
  "schema-utils": "^4.0.1",
119
149
  "semver": "~7.6.3",
120
150
  "server-only": "^0.0.1",
121
151
  "sf-symbols-typescript": "^2.1.0",
122
152
  "shallowequal": "^1.1.0",
123
- "vaul": "^0.9.0"
124
- }
153
+ "use-latest-callback": "^0.2.1",
154
+ "vaul": "^1.1.2"
155
+ },
156
+ "gitHead": "cb7062e2c17d1fb09522834aaaac0e19b766df62"
125
157
  }
@@ -17,5 +17,7 @@ declare const withRouter: ConfigPlugin<{
17
17
  sitemap?: boolean;
18
18
  /** Generate partial typed routes */
19
19
  partialTypedGroups?: boolean;
20
+ /** Enable experimental server middleware support with a `+middleware.ts` file. Requires `web.output: 'server'` to be set in app config. */
21
+ unstable_useServerMiddleware?: boolean;
20
22
  } | void>;
21
23
  export default withRouter;
@@ -135,6 +135,11 @@
135
135
  }
136
136
  }
137
137
  }
138
+ },
139
+ "unstable_useServerMiddleware": {
140
+ "description": "Enable experimental server middleware support with a `+middleware.ts` file. Requires `web.output: 'server'` to be set in app config.",
141
+ "type": "boolean",
142
+ "default": false
138
143
  }
139
144
  },
140
145
  "additionalProperties": false
@@ -37,6 +37,8 @@ const withRouter: ConfigPlugin<
37
37
  sitemap?: boolean;
38
38
  /** Generate partial typed routes */
39
39
  partialTypedGroups?: boolean;
40
+ /** Enable experimental server middleware support with a `+middleware.ts` file. Requires `web.output: 'server'` to be set in app config. */
41
+ unstable_useServerMiddleware?: boolean;
40
42
  } | void
41
43
  > = (config, _props) => {
42
44
  const props = _props || {};
@@ -0,0 +1 @@
1
+ {"root":["./src/index.ts"],"version":"5.8.3"}
package/server.d.ts CHANGED
@@ -1,4 +1,5 @@
1
- import { ExpoRequest, ExpoResponse } from '@expo/server/build/environment';
1
+ import { type ExpoRequest, type ExpoResponse } from '@expo/server';
2
+ export { type MiddlewareFunction } from '@expo/server';
2
3
 
3
4
  export type RequestHandler = (
4
5
  request: Request,
@@ -0,0 +1 @@
1
+ export * from './build/native-tabs';
@@ -0,0 +1 @@
1
+ module.exports = require('./build/native-tabs');
@@ -1 +0,0 @@
1
- {"version":3,"file":"ModalStack.web.d.ts","sourceRoot":"","sources":["../../../src/modal/web/ModalStack.web.tsx"],"names":[],"mappings":"AACA,OAAO,EAEL,aAAa,EAOd,MAAM,0BAA0B,CAAC;AAMlC,OAAO,KAAsB,MAAM,OAAO,CAAC;AAgG3C,QAAA,MAAM,WAAW;;;;;;;;;;;CAAkD,CAAC;AACpE,QAAA,MAAM,iBAAiB;;;;;;;;6DAAqB,CAAC;AAE7C,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"ModalStack.web.js","sourceRoot":"","sources":["../../../src/modal/web/ModalStack.web.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACb,qDASkC;AAClC,iEAIwC;AACxC,+CAA2C;AAE3C,2EAAoE;AACpE,iGAA0F;AAE1F,mCAIiB;AAEjB,uEAAoE;AAEpE,SAAS,mBAAmB,CAAC,EAC3B,gBAAgB,EAChB,QAAQ,EACR,aAAa,GACY;IACzB,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,iBAAiB,EAAE,QAAQ,EAAE,GAAG,IAAA,6BAAoB,EAM1F,oBAAW,EAAE;QACb,QAAQ;QACR,aAAa;QACb,gBAAgB;KACjB,CAAC,CAAC;IAEH,OAAO,CACL,CAAC,iBAAiB,CAChB;MAAA,CAAC,cAAc,CACb,KAAK,CAAC,CAAC,KAAK,CAAC,CACb,UAAU,CAAC,CAAC,UAAU,CAAC,CACvB,WAA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AAa,CAAC,CACrB,UAAU,CAAC,CAAC,UAAU,CAAC,CACvB,WAAW,CAAC,CAAC,WAAW,CAAC,CACzB,QAAQ,CAAC,CAAC,QAAQ,CAAC,EAErB;MAAA,CAAC,KAAK;YACJ,aAAa,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;gBAC1B,MAAM,kBAAkB,GAAG,IAAA,sCAA8B,EAAC,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC;gBAE1F,MAAM,cAAc,GAAG,kBAAkB;oBACvC,CAAC,CAAC,uEAAgC;oBAClC,CAAC,CAAC,iDAAqB,CAAC;gBAE1B,OAAO,CACL,CAAC,cAAc,CACb,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CACf,QAAQ,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CACpB,OAAO,CAAC,CAAC,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,OAAyC,CAAC,CAC1E,YAAY,CAAC,CAAC,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAC5C,SAAS,CAAC,CAAC,OAAO,CAAC,CACnB,WAAW,CAAC,CAAC,MAAM,CAAC,EACpB,CACH,CAAC;YACJ,CAAC,CAAC,CACN;IAAA,EAAE,GAAG,CAAC,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,gBAAgB,GAAG,IAAA,+BAAsB,EAAC,mBAAmB,CAAC,CAAC;AACrE,MAAM,WAAW,GAAG,IAAA,qCAAiB,EAAC,gBAAgB,EAAE,CAAC,SAAS,CAAC,CAAC;AAG3D,kCAAW;AAFpB,MAAM,iBAAiB,GAAG,WAAW,CAAC,MAAM,CAAC;AAEvB,8CAAiB","sourcesContent":["'use client';\nimport {\n createNavigatorFactory,\n ParamListBase,\n StackActionHelpers,\n StackNavigationState,\n StackRouter,\n StackRouterOptions,\n useNavigationBuilder,\n useTheme,\n} from '@react-navigation/native';\nimport {\n NativeStackNavigationEventMap,\n NativeStackNavigationOptions,\n NativeStackView,\n} from '@react-navigation/native-stack';\nimport React, { useCallback } from 'react';\n\nimport { ModalStackRouteDrawer } from './ModalStackRouteDrawer.web';\nimport { TransparentModalStackRouteDrawer } from './TransparentModalStackRouteDrawer.web';\nimport { ModalStackNavigatorProps, ModalStackViewProps } from './types';\nimport {\n convertStackStateToNonModalState,\n findLastNonModalIndex,\n isTransparentModalPresentation,\n} from './utils';\nimport { ExtendedStackNavigationOptions } from '../../layouts/StackClient';\nimport { withLayoutContext } from '../../layouts/withLayoutContext';\n\nfunction ModalStackNavigator({\n initialRouteName,\n children,\n screenOptions,\n}: ModalStackNavigatorProps) {\n const { state, navigation, descriptors, NavigationContent, describe } = useNavigationBuilder<\n StackNavigationState<ParamListBase>,\n StackRouterOptions,\n StackActionHelpers<ParamListBase>,\n NativeStackNavigationOptions,\n NativeStackNavigationEventMap\n >(StackRouter, {\n children,\n screenOptions,\n initialRouteName,\n });\n\n return (\n <NavigationContent>\n <ModalStackView\n state={state}\n navigation={navigation}\n descriptors={descriptors}\n describe={describe}\n />\n </NavigationContent>\n );\n}\n\nconst ModalStackView = ({ state, navigation, descriptors, describe }: ModalStackViewProps) => {\n const isWeb = process.env.EXPO_OS === 'web';\n const { colors } = useTheme();\n\n const { routes: filteredRoutes, index: nonModalIndex } = convertStackStateToNonModalState(\n state,\n descriptors,\n isWeb\n );\n\n const newStackState = { ...state, routes: filteredRoutes, index: nonModalIndex };\n\n const dismiss = useCallback(() => {\n navigation.goBack();\n }, [navigation]);\n\n const overlayRoutes = React.useMemo(() => {\n if (!isWeb) return [];\n const idx = findLastNonModalIndex(state, descriptors);\n return state.routes.slice(idx + 1);\n }, [isWeb, state, descriptors]);\n\n return (\n <div style={{ flex: 1, display: 'flex' }}>\n <NativeStackView\n state={newStackState}\n navigation={navigation}\n descriptors={descriptors}\n describe={describe}\n />\n {isWeb &&\n overlayRoutes.map((route) => {\n const isTransparentModal = isTransparentModalPresentation(descriptors[route.key].options);\n\n const ModalComponent = isTransparentModal\n ? TransparentModalStackRouteDrawer\n : ModalStackRouteDrawer;\n\n return (\n <ModalComponent\n key={route.key}\n routeKey={route.key}\n options={descriptors[route.key].options as ExtendedStackNavigationOptions}\n renderScreen={descriptors[route.key].render}\n onDismiss={dismiss}\n themeColors={colors}\n />\n );\n })}\n </div>\n );\n};\n\nconst createModalStack = createNavigatorFactory(ModalStackNavigator);\nconst RouterModal = withLayoutContext(createModalStack().Navigator);\nconst RouterModalScreen = RouterModal.Screen;\n\nexport { RouterModal, RouterModalScreen };\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"ModalStackRouteDrawer.web.d.ts","sourceRoot":"","sources":["../../../src/modal/web/ModalStackRouteDrawer.web.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,EAAE,8BAA8B,EAAE,MAAM,2BAA2B,CAAC;AAE3E,iBAAS,qBAAqB,CAAC,EAC7B,QAAQ,EACR,OAAO,EACP,YAAY,EACZ,SAAS,EACT,WAAW,GACZ,EAAE;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,8BAA8B,CAAC;IACxC,YAAY,EAAE,MAAM,KAAK,CAAC,SAAS,CAAC;IACpC,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,WAAW,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,CAAC;CACnD,qBAuMA;AAED,OAAO,EAAE,qBAAqB,EAAE,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"ModalStackRouteDrawer.web.js","sourceRoot":"","sources":["../../../src/modal/web/ModalStackRouteDrawer.web.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;;AA8NJ,sDAAqB;AA7N9B,kDAA0B;AAC1B,+BAA8B;AAE9B,gEAAwC;AAExC,mCAAuC;AAGvC,SAAS,qBAAqB,CAAC,EAC7B,QAAQ,EACR,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,cAAc,CAAC,CACtB;YAAA,CAAC,oHAAoH,CACrH;YAAA,CAAC,aAAM,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,qBAAW,CAAC,MAAM,CAAC,EACzE;YAAA,CAAC,aAAM,CAAC,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,qBAAW,CAAC,MAAM,CAAC,EAC3D;YAAA,CAAC,+BAA+B,CAChC;YAAA,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,qBAAW,CAAC,SAAS,CAAC,CAAC,CAAC,YAAY,EAAE,CAAC,EAAE,GAAG,CAC9D;UAAA,EAAE,GAAG,CACP;QAAA,EAAE,aAAM,CAAC,OAAO,CAClB;MAAA,EAAE,aAAM,CAAC,MAAM,CACjB;IAAA,EAAE,aAAM,CAAC,IAAI,CAAC,CACf,CAAC;AACJ,CAAC","sourcesContent":["'use client';\nimport React from 'react';\nimport { Drawer } from 'vaul';\n\nimport modalStyles from './modalStyles';\nimport { CSSWithVars } from './types';\nimport { useIsDesktop } from './utils';\nimport { ExtendedStackNavigationOptions } from '../../layouts/StackClient';\n\nfunction ModalStackRouteDrawer({\n routeKey,\n options,\n renderScreen,\n onDismiss,\n themeColors,\n}: {\n routeKey: string;\n options: ExtendedStackNavigationOptions;\n renderScreen: () => React.ReactNode;\n onDismiss: () => void;\n themeColors: { card: string; background: string };\n}) {\n const [open, setOpen] = React.useState(true);\n // Determine sheet vs. modal with an SSR-safe hook. The first render (during\n // hydration) always assumes mobile/sheet to match the server markup; an\n // effect then updates the state after mount if the viewport is desktop.\n const isDesktop = useIsDesktop();\n const isSheet = !isDesktop;\n\n // Resolve snap points logic.\n const allowed = options.sheetAllowedDetents;\n\n const isArrayDetents = Array.isArray(allowed);\n const useCustomSnapPoints = isArrayDetents && !(allowed.length === 1 && allowed[0] === 1);\n\n let snapPoints: (number | string)[] | undefined = useCustomSnapPoints\n ? (allowed as (number | string)[])\n : undefined;\n\n if (!isSheet) {\n snapPoints = [1];\n }\n\n const [snap, setSnap] = React.useState<number | string | null>(\n useCustomSnapPoints && isArrayDetents ? allowed[0] : 1\n );\n\n // Update the snap value when custom snap points change.\n React.useEffect(() => {\n if (isSheet) {\n const next = useCustomSnapPoints && isArrayDetents ? allowed[0] : 1;\n setSnap(next);\n } else {\n // Desktop modal always fixed snap at 1\n setSnap(1);\n }\n }, [isSheet, useCustomSnapPoints, isArrayDetents, allowed]);\n\n // Map react-native-screens ios sheet undimmed logic to Vaul's fadeFromIndex\n const fadeFromIndex = isSheet\n ? options.sheetLargestUndimmedDetentIndex === 'last'\n ? (snapPoints?.length ?? 0)\n : typeof options.sheetLargestUndimmedDetentIndex === 'number'\n ? options.sheetLargestUndimmedDetentIndex + 1\n : 0\n : 0;\n\n // --- Styling -----------------------------------------------------------\n\n // Using CSS variables so defaults live in CSS and can be overridden via props.\n const modalStyleVars: CSSWithVars = {\n backgroundColor: themeColors.background,\n };\n\n if (!isSheet) {\n if (options.webModalStyle?.width) {\n modalStyleVars['--expo-router-modal-width'] =\n typeof options.webModalStyle.width === 'number'\n ? `${options.webModalStyle.width}px`\n : options.webModalStyle.width;\n\n modalStyleVars['--expo-router-modal-max-width'] =\n typeof options.webModalStyle.width === 'number'\n ? `${options.webModalStyle.width}px`\n : options.webModalStyle.width;\n\n // Also set explicit width so browsers that ignore CSS vars in `width` prop still work.\n modalStyleVars.width =\n typeof options.webModalStyle.width === 'number'\n ? `${options.webModalStyle.width}px`\n : options.webModalStyle.width;\n }\n\n // Min width override\n if (options.webModalStyle?.minWidth) {\n const mw =\n typeof options.webModalStyle.minWidth === 'number'\n ? `${options.webModalStyle.minWidth}px`\n : options.webModalStyle.minWidth;\n modalStyleVars['--expo-router-modal-min-width'] = mw;\n modalStyleVars.minWidth = mw;\n }\n\n if (options.webModalStyle?.height) {\n const h =\n typeof options.webModalStyle.height === 'number'\n ? `${options.webModalStyle.height}px`\n : options.webModalStyle.height;\n modalStyleVars['--expo-router-modal-height'] = h;\n modalStyleVars.maxHeight = h;\n modalStyleVars.height = h;\n modalStyleVars.minHeight = h;\n }\n\n // Separate min-height override (takes precedence over modalHeight)\n if (options.webModalStyle?.minHeight) {\n const mh =\n typeof options.webModalStyle.minHeight === 'number'\n ? `${options.webModalStyle.minHeight}px`\n : options.webModalStyle.minHeight;\n modalStyleVars['--expo-router-modal-min-height'] = mh;\n modalStyleVars.minHeight = mh;\n }\n }\n\n const fitToContents = options.sheetAllowedDetents === 'fitToContents';\n\n if (fitToContents) {\n modalStyleVars.height = 'auto';\n modalStyleVars.minHeight = 'auto';\n\n // TODO:(@Hirbod) Clarify if we should limit maxHeight to sheets only\n // Allow sheet to grow with content but never exceed viewport height\n // dvh is important, otherwise it will scale over the visible viewport height\n modalStyleVars.maxHeight = '100dvh';\n }\n\n // Apply corner radius (default 10px)\n const radiusValue = options.sheetCornerRadius ?? 10;\n const radiusCss = typeof radiusValue === 'number' ? `${radiusValue}px` : radiusValue;\n\n if (options.webModalStyle?.border) {\n modalStyleVars['--expo-router-modal-border'] = options.webModalStyle.border;\n }\n\n if (isSheet) {\n // Only top corners for mobile sheet\n modalStyleVars.borderTopLeftRadius = radiusCss;\n modalStyleVars.borderTopRightRadius = radiusCss;\n\n // Only apply CSS var override if a custom corner radius was provided\n if (options.sheetCornerRadius) {\n modalStyleVars['--expo-router-modal-border-radius'] = radiusCss;\n }\n } else {\n // All corners for desktop modal\n if (options.sheetCornerRadius) {\n modalStyleVars.borderRadius = radiusCss;\n modalStyleVars['--expo-router-modal-border-radius'] = radiusCss;\n }\n }\n // --- End Styling -----------------------------------------------------------\n\n const handleOpenChange = (open: boolean) => {\n if (!open) onDismiss();\n };\n\n // Props that only make sense for sheets\n const sheetProps = isSheet\n ? {\n snapPoints: snapPoints as (number | string)[],\n activeSnapPoint: snap,\n setActiveSnapPoint: setSnap,\n fadeFromIndex,\n }\n : {};\n\n return (\n <Drawer.Root\n key={`${routeKey}-${isSheet ? 'sheet' : 'modal'}`}\n open={open}\n dismissible={options.gestureEnabled ?? true}\n onAnimationEnd={handleOpenChange}\n shouldScaleBackground\n autoFocus\n onOpenChange={setOpen}\n {...sheetProps}>\n <Drawer.Portal>\n <Drawer.Overlay\n className={modalStyles.overlay}\n style={\n options.webModalStyle?.overlayBackground\n ? ({\n '--expo-router-modal-overlay-background': options.webModalStyle.overlayBackground,\n } as React.CSSProperties)\n : undefined\n }\n />\n <Drawer.Content\n aria-describedby=\"modal-description\"\n className={modalStyles.drawerContent}\n style={{\n pointerEvents: 'none',\n // This needs to be limited to sheets, otherwise it will position the modal at the bottom of the screen\n ...(isSheet && fitToContents ? { height: 'auto' } : null),\n }}>\n <div\n className={modalStyles.modal}\n data-presentation={isSheet ? 'formSheet' : 'modal'}\n style={modalStyleVars}>\n {/* TODO:(@Hirbod) Figure out how to add title and description to the modal for screen readers in a meaningful way */}\n <Drawer.Title about=\"\" aria-describedby=\"\" className={modalStyles.srOnly} />\n <Drawer.Description about=\"\" className={modalStyles.srOnly} />\n {/* Render the screen content */}\n <div className={modalStyles.modalBody}>{renderScreen()}</div>\n </div>\n </Drawer.Content>\n </Drawer.Portal>\n </Drawer.Root>\n );\n}\n\nexport { ModalStackRouteDrawer };\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"TransparentModalStackRouteDrawer.web.d.ts","sourceRoot":"","sources":["../../../src/modal/web/TransparentModalStackRouteDrawer.web.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,8BAA8B,EAAE,MAAM,2BAA2B,CAAC;AAE3E,iBAAS,gCAAgC,CAAC,EACxC,QAAQ,EACR,OAAO,EACP,YAAY,EACZ,SAAS,GACV,EAAE;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,8BAA8B,CAAC;IACxC,YAAY,EAAE,MAAM,KAAK,CAAC,SAAS,CAAC;IACpC,SAAS,EAAE,MAAM,IAAI,CAAC;CACvB,qBAuBA;AAED,OAAO,EAAE,gCAAgC,EAAE,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"TransparentModalStackRouteDrawer.web.js","sourceRoot":"","sources":["../../../src/modal/web/TransparentModalStackRouteDrawer.web.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;;AA0CJ,4EAAgC;AAzCzC,kDAA0B;AAC1B,+BAA8B;AAE9B,gEAAwC;AAGxC,SAAS,gCAAgC,CAAC,EACxC,QAAQ,EACR,OAAO,EACP,YAAY,EACZ,SAAS,GAMV;IACC,MAAM,gBAAgB,GAAG,CAAC,IAAa,EAAE,EAAE;QACzC,IAAI,CAAC,IAAI;YAAE,SAAS,EAAE,CAAC;IACzB,CAAC,CAAC;IAEF,OAAO,CACL,CAAC,aAAM,CAAC,IAAI,CACV,WAAW,CACX,SAAS,CACT,GAAG,CAAC,CAAC,GAAG,QAAQ,cAAc,CAAC,CAC/B,WAAW,CAAC,CAAC,OAAO,CAAC,cAAc,IAAI,KAAK,CAAC,CAC7C,cAAc,CAAC,CAAC,gBAAgB,CAAC,CACjC;MAAA,CAAC,aAAM,CAAC,MAAM,CACZ;QAAA,CAAC,aAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,qBAAW,CAAC,wBAAwB,CAAC,CAC9D;UAAA,CAAC,oHAAoH,CACrH;UAAA,CAAC,aAAM,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,qBAAW,CAAC,MAAM,CAAC,EACzE;UAAA,CAAC,aAAM,CAAC,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,qBAAW,CAAC,MAAM,CAAC,EAC3D;UAAA,CAAC,+BAA+B,CAChC;UAAA,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,qBAAW,CAAC,SAAS,CAAC,CAAC,CAAC,YAAY,EAAE,CAAC,EAAE,GAAG,CAC9D;QAAA,EAAE,aAAM,CAAC,OAAO,CAClB;MAAA,EAAE,aAAM,CAAC,MAAM,CACjB;IAAA,EAAE,aAAM,CAAC,IAAI,CAAC,CACf,CAAC;AACJ,CAAC","sourcesContent":["'use client';\nimport React from 'react';\nimport { Drawer } from 'vaul';\n\nimport modalStyles from './modalStyles';\nimport { ExtendedStackNavigationOptions } from '../../layouts/StackClient';\n\nfunction TransparentModalStackRouteDrawer({\n routeKey,\n options,\n renderScreen,\n onDismiss,\n}: {\n routeKey: string;\n options: ExtendedStackNavigationOptions;\n renderScreen: () => React.ReactNode;\n onDismiss: () => void;\n}) {\n const handleOpenChange = (open: boolean) => {\n if (!open) onDismiss();\n };\n\n return (\n <Drawer.Root\n defaultOpen\n autoFocus\n key={`${routeKey}-transparent`}\n dismissible={options.gestureEnabled ?? false}\n onAnimationEnd={handleOpenChange}>\n <Drawer.Portal>\n <Drawer.Content className={modalStyles.transparentDrawerContent}>\n {/* TODO:(@Hirbod) Figure out how to add title and description to the modal for screen readers in a meaningful way */}\n <Drawer.Title about=\"\" aria-describedby=\"\" className={modalStyles.srOnly} />\n <Drawer.Description about=\"\" className={modalStyles.srOnly} />\n {/* Render the screen content */}\n <div className={modalStyles.modalBody}>{renderScreen()}</div>\n </Drawer.Content>\n </Drawer.Portal>\n </Drawer.Root>\n );\n}\n\nexport { TransparentModalStackRouteDrawer };\n"]}