@react-navigation/native 8.0.0-alpha.4 → 8.0.0-alpha.40

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 (455) hide show
  1. package/android/build.gradle +4 -6
  2. package/android/src/main/java/org/reactnavigation/MaterialSymbolModule.kt +20 -9
  3. package/android/src/main/java/org/reactnavigation/MaterialSymbolTypeface.kt +61 -18
  4. package/android/src/main/java/org/reactnavigation/MaterialSymbolView.kt +39 -14
  5. package/android/src/main/java/org/reactnavigation/MaterialSymbolViewManager.kt +14 -7
  6. package/android/src/main/java/org/reactnavigation/ReactNavigationPackage.kt +3 -1
  7. package/assets/fonts/MaterialSymbolsOutlined.codepoints +179 -24
  8. package/assets/fonts/MaterialSymbolsOutlined_100.ttf +0 -0
  9. package/assets/fonts/MaterialSymbolsOutlined_200.ttf +0 -0
  10. package/assets/fonts/MaterialSymbolsOutlined_300.ttf +0 -0
  11. package/assets/fonts/MaterialSymbolsOutlined_400.ttf +0 -0
  12. package/assets/fonts/MaterialSymbolsOutlined_500.ttf +0 -0
  13. package/assets/fonts/MaterialSymbolsOutlined_600.ttf +0 -0
  14. package/assets/fonts/MaterialSymbolsOutlined_700.ttf +0 -0
  15. package/assets/fonts/MaterialSymbolsRounded.codepoints +179 -24
  16. package/assets/fonts/MaterialSymbolsRounded_100.ttf +0 -0
  17. package/assets/fonts/MaterialSymbolsRounded_200.ttf +0 -0
  18. package/assets/fonts/MaterialSymbolsRounded_300.ttf +0 -0
  19. package/assets/fonts/MaterialSymbolsRounded_400.ttf +0 -0
  20. package/assets/fonts/MaterialSymbolsRounded_500.ttf +0 -0
  21. package/assets/fonts/MaterialSymbolsRounded_600.ttf +0 -0
  22. package/assets/fonts/MaterialSymbolsRounded_700.ttf +0 -0
  23. package/assets/fonts/MaterialSymbolsSharp.codepoints +179 -24
  24. package/assets/fonts/MaterialSymbolsSharp_100.ttf +0 -0
  25. package/assets/fonts/MaterialSymbolsSharp_200.ttf +0 -0
  26. package/assets/fonts/MaterialSymbolsSharp_300.ttf +0 -0
  27. package/assets/fonts/MaterialSymbolsSharp_400.ttf +0 -0
  28. package/assets/fonts/MaterialSymbolsSharp_500.ttf +0 -0
  29. package/assets/fonts/MaterialSymbolsSharp_600.ttf +0 -0
  30. package/assets/fonts/MaterialSymbolsSharp_700.ttf +0 -0
  31. package/ios/ReactNavigationCornerInsetView.h +14 -0
  32. package/ios/ReactNavigationCornerInsetView.mm +182 -0
  33. package/ios/ReactNavigationCornerInsetView.swift +193 -0
  34. package/ios/ReactNavigationCornerInsetViewComponentDescriptor.h +23 -0
  35. package/ios/ReactNavigationCornerInsetViewShadowNode.h +27 -0
  36. package/ios/ReactNavigationCornerInsetViewShadowNode.mm +42 -0
  37. package/ios/ReactNavigationCornerInsetViewState.h +19 -0
  38. package/ios/ReactNavigationSFSymbolView.mm +22 -9
  39. package/ios/ReactNavigationSFSymbolView.swift +355 -65
  40. package/lib/module/Link.js +80 -24
  41. package/lib/module/Link.js.map +1 -1
  42. package/lib/module/Link.native.js +72 -0
  43. package/lib/module/Link.native.js.map +1 -0
  44. package/lib/module/NavigationContainer.js +22 -17
  45. package/lib/module/NavigationContainer.js.map +1 -1
  46. package/lib/module/__stubs__/createStackNavigator.js +10 -4
  47. package/lib/module/__stubs__/createStackNavigator.js.map +1 -1
  48. package/lib/module/constants.js +5 -0
  49. package/lib/module/constants.js.map +1 -0
  50. package/lib/module/constants.native.js +6 -0
  51. package/lib/module/constants.native.js.map +1 -0
  52. package/lib/module/createMemoryHistory.js +23 -7
  53. package/lib/module/createMemoryHistory.js.map +1 -1
  54. package/lib/module/createStandardNavigationFactories.js +99 -0
  55. package/lib/module/createStandardNavigationFactories.js.map +1 -0
  56. package/lib/module/createStaticNavigation.js +5 -4
  57. package/lib/module/createStaticNavigation.js.map +1 -1
  58. package/lib/module/extractPathFromURL.js +2 -2
  59. package/lib/module/extractPathFromURL.js.map +1 -1
  60. package/lib/module/getStateFromHref.js +2 -2
  61. package/lib/module/getStateFromHref.js.map +1 -1
  62. package/lib/module/index.js +5 -3
  63. package/lib/module/index.js.map +1 -1
  64. package/lib/module/native/CornerInset.ios.js +69 -0
  65. package/lib/module/native/CornerInset.ios.js.map +1 -0
  66. package/lib/module/native/CornerInset.js +12 -0
  67. package/lib/module/native/CornerInset.js.map +1 -0
  68. package/lib/module/native/MaterialSymbol.android.js +3 -12
  69. package/lib/module/native/MaterialSymbol.android.js.map +1 -1
  70. package/lib/module/native/MaterialSymbolViewNativeComponent.ts +6 -3
  71. package/lib/module/native/ReactNavigationCornerInsetViewNativeComponent.ts +33 -0
  72. package/lib/module/native/SFSymbol.ios.js +35 -14
  73. package/lib/module/native/SFSymbol.ios.js.map +1 -1
  74. package/lib/module/native/SFSymbolViewNativeComponent.ts +30 -14
  75. package/lib/module/server/ServerContext.js.map +1 -0
  76. package/lib/module/server/index.js +21 -0
  77. package/lib/module/server/index.js.map +1 -0
  78. package/lib/module/theming/DarkTheme.js +5 -5
  79. package/lib/module/theming/DarkTheme.js.map +1 -1
  80. package/lib/module/theming/LightTheme.js +16 -0
  81. package/lib/module/theming/LightTheme.js.map +1 -0
  82. package/lib/module/theming/MaterialFallbackTheme.js +28 -0
  83. package/lib/module/theming/MaterialFallbackTheme.js.map +1 -0
  84. package/lib/module/theming/MaterialTheme.android.js +33 -0
  85. package/lib/module/theming/MaterialTheme.android.js.map +1 -0
  86. package/lib/module/theming/MaterialTheme.js +4 -0
  87. package/lib/module/theming/MaterialTheme.js.map +1 -0
  88. package/lib/module/theming/fonts.js +15 -54
  89. package/lib/module/theming/fonts.js.map +1 -1
  90. package/lib/module/theming/fonts.native.js +42 -0
  91. package/lib/module/theming/fonts.native.js.map +1 -0
  92. package/lib/module/useBackButton.js.map +1 -1
  93. package/lib/module/useBackButton.native.js +4 -1
  94. package/lib/module/useBackButton.native.js.map +1 -1
  95. package/lib/module/useDeepStableValue.js +12 -0
  96. package/lib/module/useDeepStableValue.js.map +1 -0
  97. package/lib/module/useDocumentTitle.js.map +1 -1
  98. package/lib/module/useLinkBuilder.js +8 -7
  99. package/lib/module/useLinkBuilder.js.map +1 -1
  100. package/lib/module/useLinkProps.js +150 -68
  101. package/lib/module/useLinkProps.js.map +1 -1
  102. package/lib/module/useLinkTo.js +1 -1
  103. package/lib/module/useLinkTo.js.map +1 -1
  104. package/lib/module/useLinking.js +203 -32
  105. package/lib/module/useLinking.js.map +1 -1
  106. package/lib/module/useLinking.native.js +25 -8
  107. package/lib/module/useLinking.native.js.map +1 -1
  108. package/lib/module/useLocale.js +1 -1
  109. package/lib/module/useLocale.js.map +1 -1
  110. package/lib/module/useMemoArray.js +25 -0
  111. package/lib/module/useMemoArray.js.map +1 -0
  112. package/lib/module/useRoutePath.js +1 -1
  113. package/lib/module/useRoutePath.js.map +1 -1
  114. package/lib/module/useScrollToTop.js +3 -2
  115. package/lib/module/useScrollToTop.js.map +1 -1
  116. package/lib/typescript/src/Link.d.ts +17 -9
  117. package/lib/typescript/src/Link.d.ts.map +1 -1
  118. package/lib/typescript/src/Link.native.d.ts +4 -0
  119. package/lib/typescript/src/Link.native.d.ts.map +1 -0
  120. package/lib/typescript/src/LinkingContext.d.ts +1 -1
  121. package/lib/typescript/src/LinkingContext.d.ts.map +1 -1
  122. package/lib/typescript/src/LocaleDirContext.d.ts +1 -1
  123. package/lib/typescript/src/LocaleDirContext.d.ts.map +1 -1
  124. package/lib/typescript/src/NavigationContainer.d.ts +13 -6
  125. package/lib/typescript/src/NavigationContainer.d.ts.map +1 -1
  126. package/lib/typescript/src/__stubs__/createStackNavigator.d.ts +6 -9
  127. package/lib/typescript/src/__stubs__/createStackNavigator.d.ts.map +1 -1
  128. package/lib/typescript/src/constants.d.ts +4 -0
  129. package/lib/typescript/src/constants.d.ts.map +1 -0
  130. package/lib/typescript/src/constants.native.d.ts +4 -0
  131. package/lib/typescript/src/constants.native.d.ts.map +1 -0
  132. package/lib/typescript/src/createMemoryHistory.d.ts +1 -1
  133. package/lib/typescript/src/createMemoryHistory.d.ts.map +1 -1
  134. package/lib/typescript/src/createStandardNavigationFactories.d.ts +33 -0
  135. package/lib/typescript/src/createStandardNavigationFactories.d.ts.map +1 -0
  136. package/lib/typescript/src/createStaticNavigation.d.ts +7 -7
  137. package/lib/typescript/src/createStaticNavigation.d.ts.map +1 -1
  138. package/lib/typescript/src/extractPathFromURL.d.ts +1 -1
  139. package/lib/typescript/src/extractPathFromURL.d.ts.map +1 -1
  140. package/lib/typescript/src/getStateFromHref.d.ts +3 -3
  141. package/lib/typescript/src/getStateFromHref.d.ts.map +1 -1
  142. package/lib/typescript/src/index.d.ts +16 -14
  143. package/lib/typescript/src/index.d.ts.map +1 -1
  144. package/lib/typescript/src/native/CornerInset.d.ts +28 -0
  145. package/lib/typescript/src/native/CornerInset.d.ts.map +1 -0
  146. package/lib/typescript/src/native/CornerInset.ios.d.ts +8 -0
  147. package/lib/typescript/src/native/CornerInset.ios.d.ts.map +1 -0
  148. package/lib/typescript/src/native/MaterialSymbol.android.d.ts +1 -1
  149. package/lib/typescript/src/native/MaterialSymbol.android.d.ts.map +1 -1
  150. package/lib/typescript/src/native/MaterialSymbol.d.ts +2 -2
  151. package/lib/typescript/src/native/MaterialSymbol.d.ts.map +1 -1
  152. package/lib/typescript/src/native/MaterialSymbolData.d.ts +1 -1
  153. package/lib/typescript/src/native/MaterialSymbolData.d.ts.map +1 -1
  154. package/lib/typescript/src/native/MaterialSymbolViewNativeComponent.d.ts +2 -2
  155. package/lib/typescript/src/native/MaterialSymbolViewNativeComponent.d.ts.map +1 -1
  156. package/lib/typescript/src/native/ReactNavigationCornerInsetViewNativeComponent.d.ts +14 -0
  157. package/lib/typescript/src/native/ReactNavigationCornerInsetViewNativeComponent.d.ts.map +1 -0
  158. package/lib/typescript/src/native/SFSymbol.d.ts +1 -1
  159. package/lib/typescript/src/native/SFSymbol.d.ts.map +1 -1
  160. package/lib/typescript/src/native/SFSymbol.ios.d.ts +2 -2
  161. package/lib/typescript/src/native/SFSymbol.ios.d.ts.map +1 -1
  162. package/lib/typescript/src/native/SFSymbolViewNativeComponent.d.ts +26 -13
  163. package/lib/typescript/src/native/SFSymbolViewNativeComponent.d.ts.map +1 -1
  164. package/lib/typescript/src/native/types.d.ts +241 -45
  165. package/lib/typescript/src/native/types.d.ts.map +1 -1
  166. package/lib/typescript/src/{ServerContext.d.ts → server/ServerContext.d.ts} +1 -4
  167. package/lib/typescript/src/server/ServerContext.d.ts.map +1 -0
  168. package/lib/typescript/src/server/index.d.ts +10 -0
  169. package/lib/typescript/src/server/index.d.ts.map +1 -0
  170. package/lib/typescript/src/theming/DarkTheme.d.ts +4 -38
  171. package/lib/typescript/src/theming/DarkTheme.d.ts.map +1 -1
  172. package/lib/typescript/src/theming/LightTheme.d.ts +30 -0
  173. package/lib/typescript/src/theming/LightTheme.d.ts.map +1 -0
  174. package/lib/typescript/src/theming/{DefaultTheme.d.ts → MaterialFallbackTheme.d.ts} +25 -30
  175. package/lib/typescript/src/theming/MaterialFallbackTheme.d.ts.map +1 -0
  176. package/lib/typescript/src/theming/MaterialTheme.android.d.ts +115 -0
  177. package/lib/typescript/src/theming/MaterialTheme.android.d.ts.map +1 -0
  178. package/lib/typescript/src/theming/MaterialTheme.d.ts +2 -0
  179. package/lib/typescript/src/theming/MaterialTheme.d.ts.map +1 -0
  180. package/lib/typescript/src/theming/fonts.d.ts +0 -34
  181. package/lib/typescript/src/theming/fonts.d.ts.map +1 -1
  182. package/lib/typescript/src/theming/fonts.native.d.ts +36 -0
  183. package/lib/typescript/src/theming/fonts.native.d.ts.map +1 -0
  184. package/lib/typescript/src/types.d.ts +13 -16
  185. package/lib/typescript/src/types.d.ts.map +1 -1
  186. package/lib/typescript/src/useBackButton.d.ts +1 -1
  187. package/lib/typescript/src/useBackButton.d.ts.map +1 -1
  188. package/lib/typescript/src/useBackButton.native.d.ts.map +1 -1
  189. package/lib/typescript/src/useDeepStableValue.d.ts +2 -0
  190. package/lib/typescript/src/useDeepStableValue.d.ts.map +1 -0
  191. package/lib/typescript/src/useDocumentTitle.d.ts +2 -2
  192. package/lib/typescript/src/useDocumentTitle.d.ts.map +1 -1
  193. package/lib/typescript/src/useLinkBuilder.d.ts +56 -68
  194. package/lib/typescript/src/useLinkBuilder.d.ts.map +1 -1
  195. package/lib/typescript/src/useLinkProps.d.ts +36 -12
  196. package/lib/typescript/src/useLinkProps.d.ts.map +1 -1
  197. package/lib/typescript/src/useLinking.d.ts +7 -45
  198. package/lib/typescript/src/useLinking.d.ts.map +1 -1
  199. package/lib/typescript/src/useLinking.native.d.ts +9 -83
  200. package/lib/typescript/src/useLinking.native.d.ts.map +1 -1
  201. package/lib/typescript/src/useLocale.d.ts +1 -1
  202. package/lib/typescript/src/useMemoArray.d.ts +2 -0
  203. package/lib/typescript/src/useMemoArray.d.ts.map +1 -0
  204. package/lib/typescript/src/useScrollToTop.d.ts.map +1 -1
  205. package/package.json +47 -23
  206. package/src/Link.native.tsx +69 -0
  207. package/src/Link.tsx +126 -37
  208. package/src/NavigationContainer.tsx +47 -39
  209. package/src/__stubs__/createStackNavigator.tsx +19 -17
  210. package/src/constants.native.tsx +10 -0
  211. package/src/constants.tsx +5 -0
  212. package/src/createMemoryHistory.tsx +28 -7
  213. package/src/createStandardNavigationFactories.tsx +219 -0
  214. package/src/createStaticNavigation.tsx +13 -17
  215. package/src/extractPathFromURL.tsx +5 -3
  216. package/src/getStateFromHref.tsx +8 -3
  217. package/src/index.tsx +11 -2
  218. package/src/native/CornerInset.ios.tsx +87 -0
  219. package/src/native/CornerInset.tsx +40 -0
  220. package/src/native/MaterialSymbol.android.tsx +2 -18
  221. package/src/native/MaterialSymbol.tsx +1 -1
  222. package/src/native/MaterialSymbolData.tsx +155 -0
  223. package/src/native/MaterialSymbolViewNativeComponent.ts +6 -3
  224. package/src/native/ReactNavigationCornerInsetViewNativeComponent.ts +33 -0
  225. package/src/native/SFSymbol.ios.tsx +73 -14
  226. package/src/native/SFSymbolViewNativeComponent.ts +30 -14
  227. package/src/native/types.tsx +297 -47
  228. package/src/{ServerContext.tsx → server/ServerContext.tsx} +1 -4
  229. package/src/server/index.tsx +19 -0
  230. package/src/theming/DarkTheme.tsx +4 -4
  231. package/src/theming/{DefaultTheme.tsx → LightTheme.tsx} +4 -4
  232. package/src/theming/MaterialFallbackTheme.tsx +29 -0
  233. package/src/theming/MaterialTheme.android.tsx +45 -0
  234. package/src/theming/MaterialTheme.tsx +4 -0
  235. package/src/theming/fonts.native.tsx +41 -0
  236. package/src/theming/fonts.tsx +15 -54
  237. package/src/types.tsx +38 -40
  238. package/src/useBackButton.native.tsx +2 -0
  239. package/src/useBackButton.tsx +2 -2
  240. package/src/useDeepStableValue.tsx +12 -0
  241. package/src/useDocumentTitle.tsx +2 -2
  242. package/src/useLinkBuilder.tsx +15 -7
  243. package/src/useLinkProps.tsx +379 -126
  244. package/src/useLinkTo.tsx +1 -1
  245. package/src/useLinking.native.tsx +64 -35
  246. package/src/useLinking.tsx +323 -47
  247. package/src/useLocale.tsx +1 -1
  248. package/src/useMemoArray.tsx +41 -0
  249. package/src/useRoutePath.tsx +1 -1
  250. package/src/useScrollToTop.tsx +3 -2
  251. package/android/build/.transforms/586a73aab4c351d3f13dc604ca6964e8/results.bin +0 -1
  252. package/android/build/.transforms/586a73aab4c351d3f13dc604ca6964e8/transformed/classes/classes_dex/classes.dex +0 -0
  253. package/android/build/.transforms/fb9c4b42fa16b6541a5819cb4bf06272/results.bin +0 -1
  254. package/android/build/.transforms/fb9c4b42fa16b6541a5819cb4bf06272/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/facebook/fbreact/specs/NativeMaterialSymbolModuleSpec.dex +0 -0
  255. package/android/build/.transforms/fb9c4b42fa16b6541a5819cb4bf06272/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/facebook/react/viewmanagers/ReactNavigationMaterialSymbolViewManagerDelegate.dex +0 -0
  256. package/android/build/.transforms/fb9c4b42fa16b6541a5819cb4bf06272/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/facebook/react/viewmanagers/ReactNavigationMaterialSymbolViewManagerInterface.dex +0 -0
  257. package/android/build/.transforms/fb9c4b42fa16b6541a5819cb4bf06272/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/facebook/react/viewmanagers/ReactNavigationSFSymbolViewManagerDelegate.dex +0 -0
  258. package/android/build/.transforms/fb9c4b42fa16b6541a5819cb4bf06272/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/facebook/react/viewmanagers/ReactNavigationSFSymbolViewManagerInterface.dex +0 -0
  259. package/android/build/.transforms/fb9c4b42fa16b6541a5819cb4bf06272/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/org/reactnavigation/BuildConfig.dex +0 -0
  260. package/android/build/.transforms/fb9c4b42fa16b6541a5819cb4bf06272/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/org/reactnavigation/MaterialSymbolModule$Companion.dex +0 -0
  261. package/android/build/.transforms/fb9c4b42fa16b6541a5819cb4bf06272/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/org/reactnavigation/MaterialSymbolModule$WhenMappings.dex +0 -0
  262. package/android/build/.transforms/fb9c4b42fa16b6541a5819cb4bf06272/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/org/reactnavigation/MaterialSymbolModule$getImageSource$1.dex +0 -0
  263. package/android/build/.transforms/fb9c4b42fa16b6541a5819cb4bf06272/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/org/reactnavigation/MaterialSymbolModule.dex +0 -0
  264. package/android/build/.transforms/fb9c4b42fa16b6541a5819cb4bf06272/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/org/reactnavigation/MaterialSymbolTypeface.dex +0 -0
  265. package/android/build/.transforms/fb9c4b42fa16b6541a5819cb4bf06272/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/org/reactnavigation/MaterialSymbolTypefaceResult.dex +0 -0
  266. package/android/build/.transforms/fb9c4b42fa16b6541a5819cb4bf06272/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/org/reactnavigation/MaterialSymbolView.dex +0 -0
  267. package/android/build/.transforms/fb9c4b42fa16b6541a5819cb4bf06272/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/org/reactnavigation/MaterialSymbolViewManager$Companion.dex +0 -0
  268. package/android/build/.transforms/fb9c4b42fa16b6541a5819cb4bf06272/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/org/reactnavigation/MaterialSymbolViewManager.dex +0 -0
  269. package/android/build/.transforms/fb9c4b42fa16b6541a5819cb4bf06272/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/org/reactnavigation/ReactNavigationPackage.dex +0 -0
  270. package/android/build/.transforms/fb9c4b42fa16b6541a5819cb4bf06272/transformed/bundleLibRuntimeToDirDebug/desugar_graph.bin +0 -0
  271. package/android/build/generated/source/buildConfig/debug/org/reactnavigation/BuildConfig.java +0 -10
  272. package/android/build/generated/source/codegen/java/com/facebook/fbreact/specs/NativeMaterialSymbolModuleSpec.java +0 -39
  273. package/android/build/generated/source/codegen/java/com/facebook/react/viewmanagers/ReactNavigationMaterialSymbolViewManagerDelegate.java +0 -45
  274. package/android/build/generated/source/codegen/java/com/facebook/react/viewmanagers/ReactNavigationMaterialSymbolViewManagerInterface.java +0 -22
  275. package/android/build/generated/source/codegen/java/com/facebook/react/viewmanagers/ReactNavigationSFSymbolViewManagerDelegate.java +0 -39
  276. package/android/build/generated/source/codegen/java/com/facebook/react/viewmanagers/ReactNavigationSFSymbolViewManagerInterface.java +0 -20
  277. package/android/build/generated/source/codegen/jni/CMakeLists.txt +0 -28
  278. package/android/build/generated/source/codegen/jni/ReactNavigationSpec-generated.cpp +0 -32
  279. package/android/build/generated/source/codegen/jni/ReactNavigationSpec.h +0 -31
  280. package/android/build/generated/source/codegen/jni/react/renderer/components/ReactNavigationSpec/ComponentDescriptors.cpp +0 -23
  281. package/android/build/generated/source/codegen/jni/react/renderer/components/ReactNavigationSpec/ComponentDescriptors.h +0 -25
  282. package/android/build/generated/source/codegen/jni/react/renderer/components/ReactNavigationSpec/EventEmitters.cpp +0 -17
  283. package/android/build/generated/source/codegen/jni/react/renderer/components/ReactNavigationSpec/EventEmitters.h +0 -30
  284. package/android/build/generated/source/codegen/jni/react/renderer/components/ReactNavigationSpec/Props.cpp +0 -106
  285. package/android/build/generated/source/codegen/jni/react/renderer/components/ReactNavigationSpec/Props.h +0 -118
  286. package/android/build/generated/source/codegen/jni/react/renderer/components/ReactNavigationSpec/ReactNavigationSpecJSI-generated.cpp +0 -31
  287. package/android/build/generated/source/codegen/jni/react/renderer/components/ReactNavigationSpec/ReactNavigationSpecJSI.h +0 -71
  288. package/android/build/generated/source/codegen/jni/react/renderer/components/ReactNavigationSpec/ShadowNodes.cpp +0 -18
  289. package/android/build/generated/source/codegen/jni/react/renderer/components/ReactNavigationSpec/ShadowNodes.h +0 -43
  290. package/android/build/generated/source/codegen/jni/react/renderer/components/ReactNavigationSpec/States.cpp +0 -16
  291. package/android/build/generated/source/codegen/jni/react/renderer/components/ReactNavigationSpec/States.h +0 -22
  292. package/android/build/generated/source/codegen/schema.json +0 -1
  293. package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/AndroidManifest.xml +0 -7
  294. package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/output-metadata.json +0 -18
  295. package/android/build/intermediates/aar_metadata/debug/writeDebugAarMetadata/aar-metadata.properties +0 -6
  296. package/android/build/intermediates/annotation_processor_list/debug/javaPreCompileDebug/annotationProcessors.json +0 -1
  297. package/android/build/intermediates/assets/debug/mergeDebugAssets/fonts/MaterialSymbols.hash +0 -1
  298. package/android/build/intermediates/assets/debug/mergeDebugAssets/fonts/MaterialSymbolsOutlined_400.ttf +0 -0
  299. package/android/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.jar +0 -0
  300. package/android/build/intermediates/compile_r_class_jar/debug/generateDebugRFile/R.jar +0 -0
  301. package/android/build/intermediates/compile_symbol_list/debug/generateDebugRFile/R.txt +0 -0
  302. package/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +0 -1
  303. package/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml +0 -2
  304. package/android/build/intermediates/incremental/mergeDebugAssets/merger.xml +0 -2
  305. package/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +0 -2
  306. package/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +0 -2
  307. package/android/build/intermediates/java_res/debug/processDebugJavaRes/out/META-INF/react-navigation_native_debug.kotlin_module +0 -0
  308. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/facebook/fbreact/specs/NativeMaterialSymbolModuleSpec.class +0 -0
  309. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/facebook/react/viewmanagers/ReactNavigationMaterialSymbolViewManagerDelegate.class +0 -0
  310. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/facebook/react/viewmanagers/ReactNavigationMaterialSymbolViewManagerInterface.class +0 -0
  311. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/facebook/react/viewmanagers/ReactNavigationSFSymbolViewManagerDelegate.class +0 -0
  312. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/facebook/react/viewmanagers/ReactNavigationSFSymbolViewManagerInterface.class +0 -0
  313. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/org/reactnavigation/BuildConfig.class +0 -0
  314. package/android/build/intermediates/local_only_symbol_list/debug/parseDebugLocalResources/R-def.txt +0 -2
  315. package/android/build/intermediates/manifest_merge_blame_file/debug/processDebugManifest/manifest-merger-blame-debug-report.txt +0 -7
  316. package/android/build/intermediates/merged_manifest/debug/processDebugManifest/AndroidManifest.xml +0 -7
  317. package/android/build/intermediates/navigation_json/debug/extractDeepLinksDebug/navigation.json +0 -1
  318. package/android/build/intermediates/nested_resources_validation_report/debug/generateDebugResources/nestedResourcesValidationReport.txt +0 -1
  319. package/android/build/intermediates/react-navigation/fonts/MaterialSymbols.hash +0 -1
  320. package/android/build/intermediates/react-navigation/fonts/MaterialSymbolsOutlined_400.ttf +0 -0
  321. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/META-INF/react-navigation_native_debug.kotlin_module +0 -0
  322. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/facebook/fbreact/specs/NativeMaterialSymbolModuleSpec.class +0 -0
  323. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/facebook/react/viewmanagers/ReactNavigationMaterialSymbolViewManagerDelegate.class +0 -0
  324. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/facebook/react/viewmanagers/ReactNavigationMaterialSymbolViewManagerInterface.class +0 -0
  325. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/facebook/react/viewmanagers/ReactNavigationSFSymbolViewManagerDelegate.class +0 -0
  326. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/facebook/react/viewmanagers/ReactNavigationSFSymbolViewManagerInterface.class +0 -0
  327. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/org/reactnavigation/BuildConfig.class +0 -0
  328. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/org/reactnavigation/MaterialSymbolModule$Companion.class +0 -0
  329. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/org/reactnavigation/MaterialSymbolModule$WhenMappings.class +0 -0
  330. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/org/reactnavigation/MaterialSymbolModule$getImageSource$1.class +0 -0
  331. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/org/reactnavigation/MaterialSymbolModule.class +0 -0
  332. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/org/reactnavigation/MaterialSymbolTypeface.class +0 -0
  333. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/org/reactnavigation/MaterialSymbolTypefaceResult.class +0 -0
  334. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/org/reactnavigation/MaterialSymbolView.class +0 -0
  335. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/org/reactnavigation/MaterialSymbolViewManager$Companion.class +0 -0
  336. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/org/reactnavigation/MaterialSymbolViewManager.class +0 -0
  337. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/org/reactnavigation/ReactNavigationPackage.class +0 -0
  338. package/android/build/intermediates/runtime_library_classes_jar/debug/bundleLibRuntimeToJarDebug/classes.jar +0 -0
  339. package/android/build/intermediates/symbol_list_with_package_name/debug/generateDebugRFile/package-aware-r.txt +0 -1
  340. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab +0 -0
  341. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream +0 -0
  342. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream.len +0 -0
  343. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.len +0 -0
  344. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.values.at +0 -0
  345. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i +0 -0
  346. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i.len +0 -0
  347. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab +0 -0
  348. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream +0 -0
  349. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream.len +0 -0
  350. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.len +0 -0
  351. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.values.at +0 -0
  352. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i +0 -0
  353. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i.len +0 -0
  354. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab +0 -0
  355. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream +0 -0
  356. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream.len +0 -0
  357. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.len +0 -0
  358. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at +0 -0
  359. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i +0 -0
  360. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i.len +0 -0
  361. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab +0 -0
  362. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.keystream +0 -0
  363. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.keystream.len +0 -0
  364. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.len +0 -0
  365. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.values.at +0 -0
  366. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab_i +0 -0
  367. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab_i.len +0 -0
  368. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab +0 -0
  369. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream +0 -0
  370. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len +0 -0
  371. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.len +0 -0
  372. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at +0 -0
  373. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i +0 -0
  374. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i.len +0 -0
  375. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab +0 -0
  376. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream +0 -0
  377. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream.len +0 -0
  378. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.len +0 -0
  379. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.at +0 -0
  380. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i +0 -0
  381. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i.len +0 -0
  382. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab +0 -0
  383. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream +0 -0
  384. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream.len +0 -0
  385. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.len +0 -0
  386. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at +0 -0
  387. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i +0 -0
  388. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i.len +0 -0
  389. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab +0 -0
  390. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream +0 -0
  391. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream.len +0 -0
  392. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.len +0 -0
  393. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.values.at +0 -0
  394. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i +0 -0
  395. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i.len +0 -0
  396. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab +0 -0
  397. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream +0 -0
  398. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream.len +0 -0
  399. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.len +0 -0
  400. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.values.at +0 -0
  401. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i +0 -0
  402. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i.len +0 -0
  403. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/counters.tab +0 -2
  404. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab +0 -0
  405. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream +0 -0
  406. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream.len +0 -0
  407. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.len +0 -0
  408. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.values.at +0 -0
  409. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i +0 -0
  410. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i.len +0 -0
  411. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab +0 -0
  412. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream +0 -0
  413. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream.len +0 -0
  414. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.len +0 -0
  415. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.values.at +0 -0
  416. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i +0 -0
  417. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i.len +0 -0
  418. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab +0 -0
  419. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream +0 -0
  420. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream.len +0 -0
  421. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.len +0 -0
  422. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.values.at +0 -0
  423. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i +0 -0
  424. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i.len +0 -0
  425. package/android/build/kotlin/compileDebugKotlin/cacheable/last-build.bin +0 -0
  426. package/android/build/kotlin/compileDebugKotlin/classpath-snapshot/shrunk-classpath-snapshot.bin +0 -0
  427. package/android/build/outputs/logs/manifest-merger-debug-report.txt +0 -16
  428. package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
  429. package/android/build/tmp/kotlin-classes/debug/META-INF/react-navigation_native_debug.kotlin_module +0 -0
  430. package/android/build/tmp/kotlin-classes/debug/org/reactnavigation/MaterialSymbolModule$Companion.class +0 -0
  431. package/android/build/tmp/kotlin-classes/debug/org/reactnavigation/MaterialSymbolModule$WhenMappings.class +0 -0
  432. package/android/build/tmp/kotlin-classes/debug/org/reactnavigation/MaterialSymbolModule$getImageSource$1.class +0 -0
  433. package/android/build/tmp/kotlin-classes/debug/org/reactnavigation/MaterialSymbolModule.class +0 -0
  434. package/android/build/tmp/kotlin-classes/debug/org/reactnavigation/MaterialSymbolTypeface.class +0 -0
  435. package/android/build/tmp/kotlin-classes/debug/org/reactnavigation/MaterialSymbolTypefaceResult.class +0 -0
  436. package/android/build/tmp/kotlin-classes/debug/org/reactnavigation/MaterialSymbolView.class +0 -0
  437. package/android/build/tmp/kotlin-classes/debug/org/reactnavigation/MaterialSymbolViewManager$Companion.class +0 -0
  438. package/android/build/tmp/kotlin-classes/debug/org/reactnavigation/MaterialSymbolViewManager.class +0 -0
  439. package/android/build/tmp/kotlin-classes/debug/org/reactnavigation/ReactNavigationPackage.class +0 -0
  440. package/lib/module/ServerContainer.js +0 -55
  441. package/lib/module/ServerContainer.js.map +0 -1
  442. package/lib/module/ServerContext.js.map +0 -1
  443. package/lib/module/__stubs__/window.js +0 -75
  444. package/lib/module/__stubs__/window.js.map +0 -1
  445. package/lib/module/theming/DefaultTheme.js +0 -16
  446. package/lib/module/theming/DefaultTheme.js.map +0 -1
  447. package/lib/typescript/src/ServerContainer.d.ts +0 -14
  448. package/lib/typescript/src/ServerContainer.d.ts.map +0 -1
  449. package/lib/typescript/src/ServerContext.d.ts.map +0 -1
  450. package/lib/typescript/src/__stubs__/window.d.ts +0 -18
  451. package/lib/typescript/src/__stubs__/window.d.ts.map +0 -1
  452. package/lib/typescript/src/theming/DefaultTheme.d.ts.map +0 -1
  453. package/src/ServerContainer.tsx +0 -57
  454. package/src/__stubs__/window.tsx +0 -77
  455. /package/lib/module/{ServerContext.js → server/ServerContext.js} +0 -0
package/src/Link.tsx CHANGED
@@ -1,72 +1,161 @@
1
1
  import { type RootParamList, useTheme } from '@react-navigation/core';
2
2
  import * as React from 'react';
3
- import {
4
- type GestureResponderEvent,
5
- Platform,
6
- Text,
7
- type TextProps,
8
- } from 'react-native';
3
+ import type { GestureResponderEvent, TextProps, TextStyle } from 'react-native';
9
4
 
10
5
  import { type LinkProps, useLinkProps } from './useLinkProps';
11
6
 
12
- type Props<
7
+ type PressEvent =
8
+ | React.MouseEvent<HTMLAnchorElement, MouseEvent>
9
+ | GestureResponderEvent;
10
+
11
+ type LinkBaseProps = {
12
+ target?: React.AnchorHTMLAttributes<HTMLAnchorElement>['target'];
13
+ disabled?: boolean | undefined;
14
+ id?: string | undefined;
15
+ testID?: string | undefined;
16
+ onPress?: (e: PressEvent) => void;
17
+ numberOfLines?: number | undefined;
18
+ className?: React.AnchorHTMLAttributes<HTMLAnchorElement>['className'];
19
+ style?: (React.CSSProperties & TextStyle) | undefined;
20
+ children: React.ReactNode;
21
+ } & Pick<
22
+ TextProps,
23
+ | 'aria-busy'
24
+ | 'aria-expanded'
25
+ | 'aria-hidden'
26
+ | 'aria-label'
27
+ | 'aria-labelledby'
28
+ | 'aria-live'
29
+ >;
30
+
31
+ export type Props<
13
32
  ParamList extends {} = RootParamList,
14
- RouteName extends keyof ParamList = keyof ParamList,
15
- > = LinkProps<ParamList, RouteName> &
16
- Omit<TextProps, 'disabled'> & {
17
- target?: string;
18
- onPress?: (
19
- e: React.MouseEvent<HTMLAnchorElement, MouseEvent> | GestureResponderEvent
20
- ) => void;
21
- disabled?: boolean | null;
22
- children: React.ReactNode;
23
- };
33
+ RouteName extends Extract<keyof ParamList, string> = Extract<
34
+ keyof ParamList,
35
+ string
36
+ >,
37
+ > = LinkProps<NoInfer<ParamList>, RouteName> & LinkBaseProps;
24
38
 
25
39
  /**
26
40
  * Component to render link to another screen using a path.
27
41
  * Uses an anchor tag on the web.
28
42
  *
43
+ * @param props.in Name of the current or parent screen whose navigator contains the target screen.
29
44
  * @param props.screen Name of the screen to navigate to (e.g. `'Feeds'`).
30
45
  * @param props.params Params to pass to the screen to navigate to (e.g. `{ sort: 'hot' }`).
31
46
  * @param props.href Optional absolute path to use for the href (e.g. `/feeds/hot`).
32
- * @param props.action Optional action to use for in-page navigation. By default, the path is parsed to an action based on linking config.
47
+ * @param props.action Optional action to override the in-page navigation. The `href` is still derived from `screen`, so this can be used to render a link while dispatching a different action (e.g. a `replace`).
33
48
  * @param props.children Child elements to render the content.
34
49
  */
35
50
  export function Link<
36
- const ParamList extends {} = RootParamList,
37
- const RouteName extends keyof ParamList = keyof ParamList,
51
+ ParamList extends {} = RootParamList,
52
+ RouteName extends Extract<keyof ParamList, string> = Extract<
53
+ keyof ParamList,
54
+ string
55
+ >,
38
56
  >({
57
+ in: parent,
39
58
  screen,
40
59
  params,
41
60
  action,
42
61
  href,
62
+ target,
63
+ disabled,
64
+ id,
65
+ testID,
66
+ onPress,
67
+ className,
43
68
  style,
44
- ...rest
69
+ children,
70
+ 'aria-label': ariaLabel,
71
+ 'aria-busy': ariaBusy,
72
+ 'aria-expanded': ariaExpanded,
73
+ 'aria-hidden': ariaHidden,
74
+ 'aria-labelledby': ariaLabelledBy,
75
+ 'aria-live': ariaLive,
45
76
  }: Props<ParamList, RouteName>) {
77
+ // @ts-expect-error: destructuring loses the relationship between target props
78
+ const props = useLinkProps({ in: parent, screen, params, action, href });
79
+
80
+ // Keep usage of `useTheme` after `useLinkProps`
81
+ // This ensures proper error when used outside of navigation container
46
82
  const { colors, fonts } = useTheme();
47
- // @ts-expect-error: This is already type-checked by the prop types
48
- const props = useLinkProps<ParamList>({ screen, params, action, href });
49
83
 
50
- const onPress = (
51
- e: React.MouseEvent<HTMLAnchorElement, MouseEvent> | GestureResponderEvent
52
- ) => {
53
- if ('onPress' in rest) {
54
- rest.onPress?.(e);
84
+ if (typeof colors.primary !== 'string') {
85
+ throw new Error('Invalid color format.');
86
+ }
87
+
88
+ const onClick = (e: React.MouseEvent<HTMLAnchorElement, MouseEvent>) => {
89
+ if (disabled) {
90
+ e.preventDefault();
91
+ e.stopPropagation();
92
+ return;
55
93
  }
56
94
 
95
+ onPress?.(e);
96
+
57
97
  // Let user prevent default behavior
58
98
  if (!e.defaultPrevented) {
59
99
  props.onPress(e);
60
100
  }
61
101
  };
62
102
 
63
- return React.createElement(Text, {
64
- ...props,
65
- ...rest,
66
- ...Platform.select({
67
- web: { onClick: onPress } as any,
68
- default: { onPress },
69
- }),
70
- style: [{ color: colors.primary }, fonts.regular, style],
71
- });
103
+ return (
104
+ <a
105
+ aria-busy={ariaBusy}
106
+ aria-disabled={disabled}
107
+ aria-expanded={ariaExpanded}
108
+ aria-hidden={ariaHidden}
109
+ aria-label={ariaLabel}
110
+ aria-labelledby={ariaLabelledBy}
111
+ aria-live={ariaLive}
112
+ id={id}
113
+ data-testid={testID}
114
+ tabIndex={props.href == null ? 0 : undefined}
115
+ target={target}
116
+ role={props.role}
117
+ href={props.href}
118
+ onAuxClick={
119
+ disabled
120
+ ? (e) => {
121
+ e.preventDefault();
122
+ e.stopPropagation();
123
+ }
124
+ : undefined
125
+ }
126
+ onClick={onClick}
127
+ onKeyDown={
128
+ props.href == null
129
+ ? (e) => {
130
+ // On browser, pressing Enter on a link triggers a click event
131
+ // So we simulate browser behavior when href is not provided
132
+ if (e.key === 'Enter') {
133
+ e.preventDefault();
134
+ e.currentTarget.click();
135
+ }
136
+ }
137
+ : undefined
138
+ }
139
+ className={className}
140
+ style={{
141
+ backgroundColor: 'transparent',
142
+ boxSizing: 'border-box',
143
+ color: colors.primary,
144
+ cursor: disabled ? 'default' : 'pointer',
145
+ display: 'inline',
146
+ fontSize: 14,
147
+ margin: 0,
148
+ overflowWrap: 'break-word',
149
+ padding: 0,
150
+ position: 'relative',
151
+ textAlign: 'start',
152
+ textDecoration: 'none',
153
+ whiteSpace: 'pre-wrap',
154
+ ...fonts.regular,
155
+ ...style,
156
+ }}
157
+ >
158
+ {children}
159
+ </a>
160
+ );
72
161
  }
@@ -6,17 +6,18 @@ import {
6
6
  type InitialState,
7
7
  type NavigationContainerProps,
8
8
  type NavigationContainerRef,
9
- type ParamListBase,
9
+ type NavigationState,
10
+ type PartialState,
10
11
  type RootParamList,
11
12
  ThemeProvider,
12
13
  validatePathConfig,
13
14
  } from '@react-navigation/core';
14
15
  import * as React from 'react';
15
- import { I18nManager, Platform } from 'react-native';
16
16
 
17
+ import { DEFAULT_DIRECTION, IS_NATIVE } from './constants';
17
18
  import { LinkingContext } from './LinkingContext';
18
19
  import { LocaleDirContext } from './LocaleDirContext';
19
- import { DefaultTheme } from './theming/DefaultTheme';
20
+ import { LightTheme } from './theming/LightTheme';
20
21
  import type {
21
22
  DocumentTitleOptions,
22
23
  LinkingOptions,
@@ -30,8 +31,17 @@ import { type Thenable, useThenable } from './useThenable';
30
31
 
31
32
  declare global {
32
33
  var REACT_NAVIGATION_DEVTOOLS: WeakMap<
33
- NavigationContainerRef<any>,
34
- { readonly linking: LinkingOptions<any> }
34
+ object,
35
+ {
36
+ readonly linking: LinkingOptions<any>;
37
+ readonly listeners: Set<
38
+ (data: {
39
+ type: 'link';
40
+ url: string;
41
+ state: PartialState<NavigationState> | undefined;
42
+ }) => void
43
+ >;
44
+ }
35
45
  >;
36
46
  }
37
47
 
@@ -95,30 +105,32 @@ type Props<ParamList extends {}> = NavigationContainerProps & {
95
105
  * unless `documentTitle.enabled` is `false`.
96
106
  */
97
107
  documentTitle?: DocumentTitleOptions;
108
+ /**
109
+ * Ref object which refers to the navigation object containing helper methods.
110
+ */
111
+ ref?: React.Ref<NavigationContainerRef<ParamList>> | undefined;
98
112
  };
99
113
 
100
114
  const RESTORE_STATE_ERROR =
101
115
  'Failed to restore navigation state. The state will be initialized based on the navigation tree.';
102
116
 
103
- function NavigationContainerInner(
104
- {
105
- direction = I18nManager.getConstants().isRTL ? 'rtl' : 'ltr',
106
- theme = DefaultTheme,
107
- linking,
108
- persistor,
109
- fallback = null,
110
- documentTitle,
111
- onStateChange,
112
- ...rest
113
- }: Props<ParamListBase>,
114
- ref?: React.Ref<NavigationContainerRef<ParamListBase> | null>
115
- ) {
116
- if (linking?.config) {
117
- validatePathConfig(linking.config);
118
- }
119
-
120
- const refContainer =
121
- React.useRef<NavigationContainerRef<ParamListBase>>(null);
117
+ /**
118
+ * Container component that manages the navigation state.
119
+ *
120
+ * This should be rendered at the root wrapping the whole app.
121
+ */
122
+ export function NavigationContainer<ParamList extends {} = RootParamList>({
123
+ direction = DEFAULT_DIRECTION,
124
+ theme = LightTheme,
125
+ linking,
126
+ persistor,
127
+ fallback = null,
128
+ documentTitle,
129
+ onStateChange,
130
+ ref,
131
+ ...rest
132
+ }: Props<ParamList>) {
133
+ const refContainer = React.useRef<NavigationContainerRef<ParamList>>(null);
122
134
 
123
135
  useBackButton(refContainer);
124
136
  useDocumentTitle(refContainer, documentTitle);
@@ -132,6 +144,10 @@ function NavigationContainerInner(
132
144
  };
133
145
  }
134
146
 
147
+ if (linking?.config) {
148
+ validatePathConfig(linking.config);
149
+ }
150
+
135
151
  return {
136
152
  options: {
137
153
  ...linking,
@@ -150,10 +166,16 @@ function NavigationContainerInner(
150
166
  // This will be used by the devtools
151
167
  React.useEffect(() => {
152
168
  if (refContainer.current) {
169
+ const previous = REACT_NAVIGATION_DEVTOOLS.get(refContainer.current);
170
+ const listeners = previous?.listeners ?? new Set();
171
+
153
172
  REACT_NAVIGATION_DEVTOOLS.set(refContainer.current, {
154
173
  get linking() {
155
174
  return linkingConfig.options;
156
175
  },
176
+ get listeners() {
177
+ return listeners;
178
+ },
157
179
  });
158
180
  }
159
181
  });
@@ -166,8 +188,7 @@ function NavigationContainerInner(
166
188
  return getInitialState();
167
189
  });
168
190
 
169
- const isPersistenceSupported =
170
- Platform.OS === 'web' ? !linkingConfig.options.enabled : true;
191
+ const isPersistenceSupported = IS_NATIVE || !linkingConfig.options.enabled;
171
192
 
172
193
  const [isPersistedStateResolved, initialStateFromPersisted] = useThenable(
173
194
  () => {
@@ -253,16 +274,3 @@ function NavigationContainerInner(
253
274
  </LocaleDirContext.Provider>
254
275
  );
255
276
  }
256
-
257
- /**
258
- * Container component that manages the navigation state.
259
- *
260
- * This should be rendered at the root wrapping the whole app.
261
- */
262
- export const NavigationContainer = React.forwardRef(
263
- NavigationContainerInner
264
- ) as <ParamList extends {} = RootParamList>(
265
- props: Props<ParamList> & {
266
- ref?: React.Ref<NavigationContainerRef<ParamList>>;
267
- }
268
- ) => React.ReactElement;
@@ -1,11 +1,10 @@
1
1
  import {
2
2
  createNavigatorFactory,
3
3
  type DefaultNavigatorOptions,
4
- type NavigationListBase,
4
+ type NavigatorTypeBagBase,
5
5
  type ParamListBase,
6
6
  type StackNavigationState,
7
7
  StackRouter,
8
- type TypedNavigator,
9
8
  useNavigationBuilder,
10
9
  } from '@react-navigation/core';
11
10
 
@@ -23,22 +22,25 @@ const StackNavigator = (
23
22
  props
24
23
  );
25
24
 
26
- return (
27
- <NavigationContent>
28
- {descriptors[state.routes[state.index].key].render()}
29
- </NavigationContent>
30
- );
25
+ const route = state.routes[state.index];
26
+
27
+ if (route == null) {
28
+ throw new Error(`Couldn't find a route at index ${state.index}.`);
29
+ }
30
+
31
+ const descriptor = descriptors[route.key];
32
+
33
+ if (descriptor == null) {
34
+ throw new Error(`Couldn't find a descriptor for route '${route.key}'.`);
35
+ }
36
+
37
+ return <NavigationContent>{descriptor.render()}</NavigationContent>;
31
38
  };
32
39
 
33
- export function createStackNavigator<
34
- ParamList extends ParamListBase,
35
- >(): TypedNavigator<{
36
- ParamList: ParamList;
37
- State: StackNavigationState<ParamList>;
38
- ScreenOptions: {};
39
- EventMap: {};
40
- NavigationList: NavigationListBase<ParamList>;
40
+ interface StubStackTypeBag extends NavigatorTypeBagBase {
41
+ State: StackNavigationState<this['ParamList']>;
41
42
  Navigator: typeof StackNavigator;
42
- }> {
43
- return createNavigatorFactory(StackNavigator)();
44
43
  }
44
+
45
+ export const createStackNavigator =
46
+ createNavigatorFactory<StubStackTypeBag>(StackNavigator);
@@ -0,0 +1,10 @@
1
+ import { I18nManager } from 'react-native';
2
+
3
+ import type { LocaleDirection } from './types';
4
+
5
+ export const DEFAULT_DIRECTION: LocaleDirection = I18nManager.getConstants()
6
+ .isRTL
7
+ ? 'rtl'
8
+ : 'ltr';
9
+
10
+ export const IS_NATIVE = true;
@@ -0,0 +1,5 @@
1
+ import type { LocaleDirection } from './types';
2
+
3
+ export const DEFAULT_DIRECTION: LocaleDirection = 'ltr';
4
+
5
+ export const IS_NATIVE = false;
@@ -10,6 +10,8 @@ type HistoryRecord = {
10
10
  path: string;
11
11
  };
12
12
 
13
+ const getPathWithoutHash = (path: string) => path.split('#')[0] ?? '';
14
+
13
15
  export function createMemoryHistory() {
14
16
  let index = 0;
15
17
  let items: HistoryRecord[] = [];
@@ -48,11 +50,17 @@ export function createMemoryHistory() {
48
50
  },
49
51
 
50
52
  backIndex({ path }: { path: string }) {
53
+ const pathWithoutHash = getPathWithoutHash(path);
54
+
51
55
  // We need to find the index from the element before current to get closest path to go back to
52
56
  for (let i = index - 1; i >= 0; i--) {
53
57
  const item = items[i];
54
58
 
55
- if (item.path === path) {
59
+ if (item == null) {
60
+ continue;
61
+ }
62
+
63
+ if (item.path === pathWithoutHash) {
56
64
  return i;
57
65
  }
58
66
  }
@@ -64,12 +72,13 @@ export function createMemoryHistory() {
64
72
  interrupt();
65
73
 
66
74
  const id = nanoid();
75
+ const pathWithoutHash = getPathWithoutHash(path);
67
76
 
68
77
  // When a new entry is pushed, all the existing entries after index will be inaccessible
69
78
  // So we remove any existing entries after the current index to clean them up
70
79
  items = items.slice(0, index + 1);
71
80
 
72
- items.push({ path, state, id });
81
+ items.push({ path: pathWithoutHash, state, id });
73
82
  index = items.length - 1;
74
83
 
75
84
  // We pass empty string for title because it's ignored in all browsers except safari
@@ -83,6 +92,7 @@ export function createMemoryHistory() {
83
92
  interrupt();
84
93
 
85
94
  const id = window.history.state?.id ?? nanoid();
95
+ const pathWithoutHash = getPathWithoutHash(path);
86
96
 
87
97
  // Need to keep the hash part of the path if there was no previous history entry
88
98
  // or the previous history entry had the same path
@@ -98,13 +108,16 @@ export function createMemoryHistory() {
98
108
  // So we need to push the entry as there's nothing to replace
99
109
 
100
110
  pathWithHash = pathWithHash + hash;
101
- items = [{ path: pathWithHash, state, id }];
111
+ items = [{ path: pathWithoutHash, state, id }];
102
112
  index = 0;
103
113
  } else {
104
- if (items[index].path === path) {
114
+ const item = items[index];
115
+
116
+ if (item?.path === pathWithoutHash) {
105
117
  pathWithHash = pathWithHash + hash;
106
118
  }
107
- items[index] = { path, state, id };
119
+
120
+ items[index] = { path: pathWithoutHash, state, id };
108
121
  }
109
122
 
110
123
  window.history.replaceState({ id }, '', pathWithHash);
@@ -138,6 +151,8 @@ export function createMemoryHistory() {
138
151
  return;
139
152
  }
140
153
 
154
+ const targetId = items[index]?.id;
155
+
141
156
  // When we call `history.go`, `popstate` will fire when there's history to go back to
142
157
  // So we need to somehow handle following cases:
143
158
  // - There's history to go back, `history.go` is called, and `popstate` fires
@@ -147,7 +162,11 @@ export function createMemoryHistory() {
147
162
  const done = (interrupted?: boolean) => {
148
163
  clearTimeout(timer);
149
164
 
150
- if (interrupted) {
165
+ // The current entry may not be the one we intended to land on:
166
+ // - The traversal didn't happen yet, e.g. it took longer than the timeout
167
+ // - The user navigated in the browser while our traversal was in-flight
168
+ // So we treat it the same as the operation being interrupted
169
+ if (interrupted || window.history.state?.id !== targetId) {
151
170
  reject(new Error('History was changed during navigation.'));
152
171
  return;
153
172
  }
@@ -176,10 +195,12 @@ export function createMemoryHistory() {
176
195
  // But on Firefox, it seems to take much longer, around 50ms from our testing
177
196
  // We're using a hacky timeout since there doesn't seem to be way to know for sure
178
197
  const timer = setTimeout(() => {
198
+ window.removeEventListener('popstate', onPopState);
199
+
179
200
  const foundIndex = pending.findIndex((it) => it.ref === done);
180
201
 
181
202
  if (foundIndex > -1) {
182
- pending[foundIndex].cb();
203
+ pending[foundIndex]?.cb();
183
204
  pending.splice(foundIndex, 1);
184
205
  }
185
206