@react-navigation/core 7.0.0-rc.9 → 7.0.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 (855) hide show
  1. package/lib/commonjs/BaseNavigationContainer.js +356 -0
  2. package/lib/commonjs/BaseNavigationContainer.js.map +1 -0
  3. package/lib/commonjs/CurrentRenderContext.js +15 -0
  4. package/lib/commonjs/DeprecatedNavigationInChildContext.js +14 -0
  5. package/lib/commonjs/EnsureSingleNavigator.js +43 -0
  6. package/lib/commonjs/Group.js +14 -0
  7. package/lib/commonjs/NavigationBuilderContext.js +17 -0
  8. package/lib/commonjs/NavigationContainerRefContext.js +14 -0
  9. package/lib/commonjs/NavigationContext.js +14 -0
  10. package/lib/commonjs/NavigationHelpersContext.js +15 -0
  11. package/lib/commonjs/NavigationIndependentTree.js +35 -0
  12. package/lib/commonjs/NavigationIndependentTreeContext.js +14 -0
  13. package/lib/commonjs/NavigationRouteContext.js +14 -0
  14. package/lib/commonjs/NavigationStateContext.js +29 -0
  15. package/lib/commonjs/PreventRemoveContext.js +16 -0
  16. package/lib/commonjs/PreventRemoveProvider.js +91 -0
  17. package/lib/commonjs/SceneView.js +96 -0
  18. package/lib/commonjs/Screen.js +14 -0
  19. package/lib/commonjs/StaticContainer.js +31 -0
  20. package/lib/commonjs/StaticNavigation.js +256 -0
  21. package/lib/commonjs/StaticNavigation.js.map +1 -0
  22. package/lib/commonjs/UnhandledActionContext.js +11 -0
  23. package/lib/commonjs/checkDuplicateRouteNames.js +25 -0
  24. package/lib/commonjs/checkSerializable.js +50 -0
  25. package/lib/commonjs/createNavigationContainerRef.js +69 -0
  26. package/lib/commonjs/createNavigatorFactory.js +34 -0
  27. package/lib/commonjs/deepFreeze.js +37 -0
  28. package/lib/commonjs/findFocusedRoute.js +15 -0
  29. package/lib/commonjs/getActionFromState.js +86 -0
  30. package/lib/commonjs/getFocusedRouteNameFromRoute.js +22 -0
  31. package/lib/commonjs/getPathFromState.js +218 -0
  32. package/lib/commonjs/getPathFromState.js.map +1 -0
  33. package/lib/commonjs/getStateFromPath.js +475 -0
  34. package/lib/commonjs/getStateFromPath.js.map +1 -0
  35. package/lib/commonjs/index.js +287 -0
  36. package/lib/commonjs/isArrayEqual.js +20 -0
  37. package/lib/commonjs/isRecordEqual.js +21 -0
  38. package/lib/commonjs/package.json +1 -0
  39. package/lib/commonjs/theming/ThemeContext.js +12 -0
  40. package/lib/commonjs/theming/ThemeProvider.js +21 -0
  41. package/lib/commonjs/theming/useTheme.js +18 -0
  42. package/lib/commonjs/types.js +27 -0
  43. package/lib/commonjs/types.js.map +1 -0
  44. package/lib/commonjs/useChildListeners.js +36 -0
  45. package/lib/commonjs/useComponent.js +40 -0
  46. package/lib/commonjs/useCurrentRender.js +25 -0
  47. package/lib/commonjs/useDescriptors.js +188 -0
  48. package/lib/commonjs/useEventEmitter.js +105 -0
  49. package/lib/commonjs/useFocusEffect.js +80 -0
  50. package/lib/commonjs/useFocusEvents.js +70 -0
  51. package/lib/commonjs/useFocusedListenersChildrenAdapter.js +48 -0
  52. package/lib/commonjs/useIsFocused.js +28 -0
  53. package/lib/commonjs/useIsomorphicLayoutEffect.js +12 -0
  54. package/lib/commonjs/useIsomorphicLayoutEffect.native.js +9 -0
  55. package/lib/commonjs/useKeyedChildListeners.js +33 -0
  56. package/lib/commonjs/useLazyValue.js +17 -0
  57. package/lib/commonjs/useNavigation.js +27 -0
  58. package/lib/commonjs/useNavigationBuilder.js +478 -0
  59. package/lib/commonjs/useNavigationCache.js +162 -0
  60. package/lib/commonjs/useNavigationContainerRef.js +18 -0
  61. package/lib/commonjs/useNavigationHelpers.js +76 -0
  62. package/lib/commonjs/useNavigationIndependentTree.js +14 -0
  63. package/lib/commonjs/useNavigationState.js +26 -0
  64. package/lib/commonjs/useOnAction.js +106 -0
  65. package/lib/commonjs/useOnGetState.js +48 -0
  66. package/lib/commonjs/useOnPreventRemove.js +72 -0
  67. package/lib/commonjs/useOnRouteFocus.js +36 -0
  68. package/lib/commonjs/useOptionsGetters.js +78 -0
  69. package/lib/commonjs/usePreventRemove.js +48 -0
  70. package/lib/commonjs/usePreventRemoveContext.js +18 -0
  71. package/lib/commonjs/useRegisterNavigator.js +32 -0
  72. package/lib/commonjs/useRoute.js +23 -0
  73. package/lib/commonjs/useRouteCache.js +69 -0
  74. package/lib/commonjs/useSyncState.js +48 -0
  75. package/lib/commonjs/validatePathConfig.js +49 -0
  76. package/lib/commonjs/validatePathConfig.js.map +1 -0
  77. package/lib/module/BaseNavigationContainer.js +349 -0
  78. package/lib/module/BaseNavigationContainer.js.map +1 -0
  79. package/lib/module/CurrentRenderContext.js +10 -0
  80. package/lib/module/CurrentRenderContext.js.map +1 -0
  81. package/lib/module/DeprecatedNavigationInChildContext.js +9 -0
  82. package/lib/module/DeprecatedNavigationInChildContext.js.map +1 -0
  83. package/lib/module/EnsureSingleNavigator.js +36 -0
  84. package/lib/module/EnsureSingleNavigator.js.map +1 -0
  85. package/lib/module/Group.js +10 -0
  86. package/lib/module/Group.js.map +1 -0
  87. package/lib/module/NavigationBuilderContext.js +11 -0
  88. package/lib/module/NavigationBuilderContext.js.map +1 -0
  89. package/lib/module/NavigationContainerRefContext.js +8 -0
  90. package/lib/module/NavigationContainerRefContext.js.map +1 -0
  91. package/lib/module/NavigationContext.js +8 -0
  92. package/lib/module/NavigationContext.js.map +1 -0
  93. package/lib/module/NavigationHelpersContext.js +9 -0
  94. package/lib/module/NavigationHelpersContext.js.map +1 -0
  95. package/lib/module/NavigationIndependentTree.js +30 -0
  96. package/lib/module/NavigationIndependentTree.js.map +1 -0
  97. package/lib/module/NavigationIndependentTreeContext.js +9 -0
  98. package/lib/module/NavigationIndependentTreeContext.js.map +1 -0
  99. package/lib/module/NavigationRouteContext.js +9 -0
  100. package/lib/module/NavigationRouteContext.js.map +1 -0
  101. package/lib/module/NavigationStateContext.js +23 -0
  102. package/lib/module/NavigationStateContext.js.map +1 -0
  103. package/lib/module/PreventRemoveContext.js +11 -0
  104. package/lib/module/PreventRemoveContext.js.map +1 -0
  105. package/lib/module/PreventRemoveProvider.js +84 -0
  106. package/lib/module/PreventRemoveProvider.js.map +1 -0
  107. package/lib/module/SceneView.js +90 -0
  108. package/lib/module/SceneView.js.map +1 -0
  109. package/lib/module/Screen.js +10 -0
  110. package/lib/module/Screen.js.map +1 -0
  111. package/lib/module/StaticContainer.js +26 -0
  112. package/lib/module/StaticContainer.js.map +1 -0
  113. package/lib/module/StaticNavigation.js +249 -0
  114. package/lib/module/StaticNavigation.js.map +1 -0
  115. package/lib/module/UnhandledActionContext.js +5 -0
  116. package/lib/module/UnhandledActionContext.js.map +1 -0
  117. package/lib/module/checkDuplicateRouteNames.js +21 -0
  118. package/lib/module/checkDuplicateRouteNames.js.map +1 -0
  119. package/lib/module/checkSerializable.js +46 -0
  120. package/lib/module/checkSerializable.js.map +1 -0
  121. package/lib/module/createNavigationContainerRef.js +64 -0
  122. package/lib/module/createNavigationContainerRef.js.map +1 -0
  123. package/lib/module/createNavigatorFactory.js +31 -0
  124. package/lib/module/createNavigatorFactory.js.map +1 -0
  125. package/lib/module/deepFreeze.js +31 -0
  126. package/lib/module/deepFreeze.js.map +1 -0
  127. package/lib/module/findFocusedRoute.js +11 -0
  128. package/lib/module/findFocusedRoute.js.map +1 -0
  129. package/lib/module/getActionFromState.js +82 -0
  130. package/lib/module/getActionFromState.js.map +1 -0
  131. package/lib/module/getFocusedRouteNameFromRoute.js +18 -0
  132. package/lib/module/getFocusedRouteNameFromRoute.js.map +1 -0
  133. package/lib/module/getPathFromState.js +212 -0
  134. package/lib/module/getPathFromState.js.map +1 -0
  135. package/lib/module/getStateFromPath.js +468 -0
  136. package/lib/module/getStateFromPath.js.map +1 -0
  137. package/lib/module/index.js +36 -0
  138. package/lib/module/index.js.map +1 -0
  139. package/lib/module/isArrayEqual.js +16 -0
  140. package/lib/module/isArrayEqual.js.map +1 -0
  141. package/lib/module/isRecordEqual.js +17 -0
  142. package/lib/module/isRecordEqual.js.map +1 -0
  143. package/lib/module/package.json +1 -0
  144. package/lib/module/theming/ThemeContext.js +6 -0
  145. package/lib/module/theming/ThemeContext.js.map +1 -0
  146. package/lib/module/theming/ThemeProvider.js +15 -0
  147. package/lib/module/theming/ThemeProvider.js.map +1 -0
  148. package/lib/module/theming/useTheme.js +12 -0
  149. package/lib/module/theming/useTheme.js.map +1 -0
  150. package/lib/module/types.js +23 -0
  151. package/lib/module/types.js.map +1 -0
  152. package/lib/module/useChildListeners.js +30 -0
  153. package/lib/module/useChildListeners.js.map +1 -0
  154. package/lib/module/useComponent.js +34 -0
  155. package/lib/module/useComponent.js.map +1 -0
  156. package/lib/module/useCurrentRender.js +19 -0
  157. package/lib/module/useCurrentRender.js.map +1 -0
  158. package/lib/module/useDescriptors.js +182 -0
  159. package/lib/module/useDescriptors.js.map +1 -0
  160. package/lib/module/useEventEmitter.js +99 -0
  161. package/lib/module/useEventEmitter.js.map +1 -0
  162. package/lib/module/useFocusEffect.js +74 -0
  163. package/lib/module/useFocusEffect.js.map +1 -0
  164. package/lib/module/useFocusEvents.js +64 -0
  165. package/lib/module/useFocusEvents.js.map +1 -0
  166. package/lib/module/useFocusedListenersChildrenAdapter.js +42 -0
  167. package/lib/module/useFocusedListenersChildrenAdapter.js.map +1 -0
  168. package/lib/module/useIsFocused.js +23 -0
  169. package/lib/module/useIsFocused.js.map +1 -0
  170. package/lib/module/useIsomorphicLayoutEffect.js +9 -0
  171. package/lib/module/useIsomorphicLayoutEffect.js.map +1 -0
  172. package/lib/module/useIsomorphicLayoutEffect.native.js +5 -0
  173. package/lib/module/useIsomorphicLayoutEffect.native.js.map +1 -0
  174. package/lib/module/useKeyedChildListeners.js +27 -0
  175. package/lib/module/useKeyedChildListeners.js.map +1 -0
  176. package/lib/module/useLazyValue.js +11 -0
  177. package/lib/module/useLazyValue.js.map +1 -0
  178. package/lib/module/useNavigation.js +21 -0
  179. package/lib/module/useNavigation.js.map +1 -0
  180. package/lib/module/useNavigationBuilder.js +472 -0
  181. package/lib/module/useNavigationBuilder.js.map +1 -0
  182. package/lib/module/useNavigationCache.js +156 -0
  183. package/lib/module/useNavigationCache.js.map +1 -0
  184. package/lib/module/useNavigationContainerRef.js +12 -0
  185. package/lib/module/useNavigationContainerRef.js.map +1 -0
  186. package/lib/module/useNavigationHelpers.js +70 -0
  187. package/lib/module/useNavigationHelpers.js.map +1 -0
  188. package/lib/module/useNavigationIndependentTree.js +8 -0
  189. package/lib/module/useNavigationIndependentTree.js.map +1 -0
  190. package/lib/module/useNavigationState.js +20 -0
  191. package/lib/module/useNavigationState.js.map +1 -0
  192. package/lib/module/useOnAction.js +100 -0
  193. package/lib/module/useOnAction.js.map +1 -0
  194. package/lib/module/useOnGetState.js +42 -0
  195. package/lib/module/useOnGetState.js.map +1 -0
  196. package/lib/module/useOnPreventRemove.js +64 -0
  197. package/lib/module/useOnPreventRemove.js.map +1 -0
  198. package/lib/module/useOnRouteFocus.js +30 -0
  199. package/lib/module/useOnRouteFocus.js.map +1 -0
  200. package/lib/module/useOptionsGetters.js +72 -0
  201. package/lib/module/useOptionsGetters.js.map +1 -0
  202. package/lib/module/usePreventRemove.js +42 -0
  203. package/lib/module/usePreventRemove.js.map +1 -0
  204. package/lib/module/usePreventRemoveContext.js +12 -0
  205. package/lib/module/usePreventRemoveContext.js.map +1 -0
  206. package/lib/module/useRegisterNavigator.js +27 -0
  207. package/lib/module/useRegisterNavigator.js.map +1 -0
  208. package/lib/module/useRoute.js +17 -0
  209. package/lib/module/useRoute.js.map +1 -0
  210. package/lib/module/useRouteCache.js +62 -0
  211. package/lib/module/useRouteCache.js.map +1 -0
  212. package/lib/module/useSyncState.js +42 -0
  213. package/lib/module/useSyncState.js.map +1 -0
  214. package/lib/module/validatePathConfig.js +45 -0
  215. package/lib/module/validatePathConfig.js.map +1 -0
  216. package/lib/typescript/commonjs/package.json +1 -0
  217. package/lib/typescript/commonjs/src/BaseNavigationContainer.d.ts.map +1 -0
  218. package/lib/typescript/commonjs/src/CurrentRenderContext.d.ts.map +1 -0
  219. package/lib/typescript/commonjs/src/DeprecatedNavigationInChildContext.d.ts.map +1 -0
  220. package/lib/typescript/commonjs/src/EnsureSingleNavigator.d.ts.map +1 -0
  221. package/lib/typescript/commonjs/src/Group.d.ts.map +1 -0
  222. package/lib/typescript/commonjs/src/NavigationBuilderContext.d.ts.map +1 -0
  223. package/lib/typescript/commonjs/src/NavigationContainerRefContext.d.ts.map +1 -0
  224. package/lib/typescript/commonjs/src/NavigationContext.d.ts.map +1 -0
  225. package/lib/typescript/commonjs/src/NavigationHelpersContext.d.ts.map +1 -0
  226. package/lib/typescript/commonjs/src/NavigationIndependentTree.d.ts.map +1 -0
  227. package/lib/typescript/commonjs/src/NavigationIndependentTreeContext.d.ts.map +1 -0
  228. package/lib/typescript/commonjs/src/NavigationRouteContext.d.ts.map +1 -0
  229. package/lib/typescript/commonjs/src/NavigationStateContext.d.ts.map +1 -0
  230. package/lib/typescript/commonjs/src/PreventRemoveContext.d.ts.map +1 -0
  231. package/lib/typescript/commonjs/src/PreventRemoveProvider.d.ts.map +1 -0
  232. package/lib/typescript/commonjs/src/SceneView.d.ts.map +1 -0
  233. package/lib/typescript/commonjs/src/Screen.d.ts.map +1 -0
  234. package/lib/typescript/commonjs/src/StaticContainer.d.ts.map +1 -0
  235. package/lib/typescript/commonjs/src/StaticNavigation.d.ts.map +1 -0
  236. package/lib/typescript/commonjs/src/UnhandledActionContext.d.ts.map +1 -0
  237. package/lib/typescript/commonjs/src/checkDuplicateRouteNames.d.ts.map +1 -0
  238. package/lib/typescript/commonjs/src/checkSerializable.d.ts.map +1 -0
  239. package/lib/typescript/commonjs/src/createNavigationContainerRef.d.ts.map +1 -0
  240. package/lib/typescript/commonjs/src/createNavigatorFactory.d.ts.map +1 -0
  241. package/lib/typescript/commonjs/src/deepFreeze.d.ts.map +1 -0
  242. package/lib/typescript/commonjs/src/findFocusedRoute.d.ts.map +1 -0
  243. package/lib/typescript/commonjs/src/getActionFromState.d.ts.map +1 -0
  244. package/lib/typescript/commonjs/src/getFocusedRouteNameFromRoute.d.ts.map +1 -0
  245. package/lib/typescript/commonjs/src/getPathFromState.d.ts.map +1 -0
  246. package/lib/typescript/commonjs/src/getStateFromPath.d.ts.map +1 -0
  247. package/lib/typescript/commonjs/src/index.d.ts.map +1 -0
  248. package/lib/typescript/commonjs/src/isArrayEqual.d.ts.map +1 -0
  249. package/lib/typescript/commonjs/src/isRecordEqual.d.ts.map +1 -0
  250. package/lib/typescript/commonjs/src/theming/ThemeContext.d.ts.map +1 -0
  251. package/lib/typescript/commonjs/src/theming/ThemeProvider.d.ts.map +1 -0
  252. package/lib/typescript/commonjs/src/theming/useTheme.d.ts.map +1 -0
  253. package/lib/typescript/commonjs/src/types.d.ts +702 -0
  254. package/lib/typescript/commonjs/src/types.d.ts.map +1 -0
  255. package/lib/typescript/commonjs/src/useChildListeners.d.ts.map +1 -0
  256. package/lib/typescript/commonjs/src/useComponent.d.ts.map +1 -0
  257. package/lib/typescript/commonjs/src/useCurrentRender.d.ts.map +1 -0
  258. package/lib/typescript/commonjs/src/useDescriptors.d.ts +133 -0
  259. package/lib/typescript/commonjs/src/useDescriptors.d.ts.map +1 -0
  260. package/lib/typescript/commonjs/src/useEventEmitter.d.ts.map +1 -0
  261. package/lib/typescript/commonjs/src/useFocusEffect.d.ts.map +1 -0
  262. package/lib/typescript/commonjs/src/useFocusEvents.d.ts.map +1 -0
  263. package/lib/typescript/commonjs/src/useFocusedListenersChildrenAdapter.d.ts.map +1 -0
  264. package/lib/typescript/commonjs/src/useIsFocused.d.ts.map +1 -0
  265. package/lib/typescript/commonjs/src/useIsomorphicLayoutEffect.d.ts.map +1 -0
  266. package/lib/typescript/commonjs/src/useIsomorphicLayoutEffect.native.d.ts.map +1 -0
  267. package/lib/typescript/commonjs/src/useKeyedChildListeners.d.ts.map +1 -0
  268. package/lib/typescript/commonjs/src/useLazyValue.d.ts.map +1 -0
  269. package/lib/typescript/commonjs/src/useNavigation.d.ts.map +1 -0
  270. package/lib/typescript/commonjs/src/useNavigationBuilder.d.ts +181 -0
  271. package/lib/typescript/commonjs/src/useNavigationBuilder.d.ts.map +1 -0
  272. package/lib/typescript/commonjs/src/useNavigationCache.d.ts +65 -0
  273. package/lib/typescript/commonjs/src/useNavigationCache.d.ts.map +1 -0
  274. package/lib/typescript/commonjs/src/useNavigationContainerRef.d.ts.map +1 -0
  275. package/lib/typescript/commonjs/src/useNavigationHelpers.d.ts +96 -0
  276. package/lib/typescript/commonjs/src/useNavigationHelpers.d.ts.map +1 -0
  277. package/lib/typescript/commonjs/src/useNavigationIndependentTree.d.ts.map +1 -0
  278. package/lib/typescript/commonjs/src/useNavigationState.d.ts.map +1 -0
  279. package/lib/typescript/commonjs/src/useOnAction.d.ts.map +1 -0
  280. package/lib/typescript/commonjs/src/useOnGetState.d.ts.map +1 -0
  281. package/lib/typescript/commonjs/src/useOnPreventRemove.d.ts.map +1 -0
  282. package/lib/typescript/commonjs/src/useOnRouteFocus.d.ts.map +1 -0
  283. package/lib/typescript/commonjs/src/useOptionsGetters.d.ts.map +1 -0
  284. package/lib/typescript/commonjs/src/usePreventRemove.d.ts.map +1 -0
  285. package/lib/typescript/commonjs/src/usePreventRemoveContext.d.ts.map +1 -0
  286. package/lib/typescript/commonjs/src/useRegisterNavigator.d.ts.map +1 -0
  287. package/lib/typescript/commonjs/src/useRoute.d.ts.map +1 -0
  288. package/lib/typescript/commonjs/src/useRouteCache.d.ts.map +1 -0
  289. package/lib/typescript/commonjs/src/useSyncState.d.ts.map +1 -0
  290. package/lib/typescript/commonjs/src/validatePathConfig.d.ts.map +1 -0
  291. package/lib/typescript/commonjs/tsconfig.build.tsbuildinfo +1 -0
  292. package/lib/typescript/module/package.json +1 -0
  293. package/lib/typescript/module/src/BaseNavigationContainer.d.ts +17 -0
  294. package/lib/typescript/module/src/BaseNavigationContainer.d.ts.map +1 -0
  295. package/lib/typescript/module/src/CurrentRenderContext.d.ts +9 -0
  296. package/lib/typescript/module/src/CurrentRenderContext.d.ts.map +1 -0
  297. package/lib/typescript/module/src/DeprecatedNavigationInChildContext.d.ts +6 -0
  298. package/lib/typescript/module/src/DeprecatedNavigationInChildContext.d.ts.map +1 -0
  299. package/lib/typescript/module/src/EnsureSingleNavigator.d.ts +14 -0
  300. package/lib/typescript/module/src/EnsureSingleNavigator.d.ts.map +1 -0
  301. package/lib/typescript/module/src/Group.d.ts +7 -0
  302. package/lib/typescript/module/src/Group.d.ts.map +1 -0
  303. package/lib/typescript/module/src/NavigationBuilderContext.d.ts +34 -0
  304. package/lib/typescript/module/src/NavigationBuilderContext.d.ts.map +1 -0
  305. package/lib/typescript/module/src/NavigationContainerRefContext.d.ts +8 -0
  306. package/lib/typescript/module/src/NavigationContainerRefContext.d.ts.map +1 -0
  307. package/lib/typescript/module/src/NavigationContext.d.ts +8 -0
  308. package/lib/typescript/module/src/NavigationContext.d.ts.map +1 -0
  309. package/lib/typescript/module/src/NavigationHelpersContext.d.ts +9 -0
  310. package/lib/typescript/module/src/NavigationHelpersContext.d.ts.map +1 -0
  311. package/lib/typescript/module/src/NavigationIndependentTree.d.ts +8 -0
  312. package/lib/typescript/module/src/NavigationIndependentTree.d.ts.map +1 -0
  313. package/lib/typescript/module/src/NavigationIndependentTreeContext.d.ts +6 -0
  314. package/lib/typescript/module/src/NavigationIndependentTreeContext.d.ts.map +1 -0
  315. package/lib/typescript/module/src/NavigationRouteContext.d.ts +7 -0
  316. package/lib/typescript/module/src/NavigationRouteContext.d.ts.map +1 -0
  317. package/lib/typescript/module/src/NavigationStateContext.d.ts +13 -0
  318. package/lib/typescript/module/src/NavigationStateContext.d.ts.map +1 -0
  319. package/lib/typescript/module/src/PreventRemoveContext.d.ts +13 -0
  320. package/lib/typescript/module/src/PreventRemoveContext.d.ts.map +1 -0
  321. package/lib/typescript/module/src/PreventRemoveProvider.d.ts +10 -0
  322. package/lib/typescript/module/src/PreventRemoveProvider.d.ts.map +1 -0
  323. package/lib/typescript/module/src/SceneView.d.ts +21 -0
  324. package/lib/typescript/module/src/SceneView.d.ts.map +1 -0
  325. package/lib/typescript/module/src/Screen.d.ts +7 -0
  326. package/lib/typescript/module/src/Screen.d.ts.map +1 -0
  327. package/lib/typescript/module/src/StaticContainer.d.ts +6 -0
  328. package/lib/typescript/module/src/StaticContainer.d.ts.map +1 -0
  329. package/lib/typescript/module/src/StaticNavigation.d.ts +188 -0
  330. package/lib/typescript/module/src/StaticNavigation.d.ts.map +1 -0
  331. package/lib/typescript/module/src/UnhandledActionContext.d.ts +4 -0
  332. package/lib/typescript/module/src/UnhandledActionContext.d.ts.map +1 -0
  333. package/lib/typescript/module/src/checkDuplicateRouteNames.d.ts +3 -0
  334. package/lib/typescript/module/src/checkDuplicateRouteNames.d.ts.map +1 -0
  335. package/lib/typescript/module/src/checkSerializable.d.ts +10 -0
  336. package/lib/typescript/module/src/checkSerializable.d.ts.map +1 -0
  337. package/lib/typescript/module/src/createNavigationContainerRef.d.ts +4 -0
  338. package/lib/typescript/module/src/createNavigationContainerRef.d.ts.map +1 -0
  339. package/lib/typescript/module/src/createNavigatorFactory.d.ts +10 -0
  340. package/lib/typescript/module/src/createNavigatorFactory.d.ts.map +1 -0
  341. package/lib/typescript/module/src/deepFreeze.d.ts +3 -0
  342. package/lib/typescript/module/src/deepFreeze.d.ts.map +1 -0
  343. package/lib/typescript/module/src/findFocusedRoute.d.ts +5 -0
  344. package/lib/typescript/module/src/findFocusedRoute.d.ts.map +1 -0
  345. package/lib/typescript/module/src/getActionFromState.d.ts +17 -0
  346. package/lib/typescript/module/src/getActionFromState.d.ts.map +1 -0
  347. package/lib/typescript/module/src/getFocusedRouteNameFromRoute.d.ts +3 -0
  348. package/lib/typescript/module/src/getFocusedRouteNameFromRoute.d.ts.map +1 -0
  349. package/lib/typescript/module/src/getPathFromState.d.ts +40 -0
  350. package/lib/typescript/module/src/getPathFromState.d.ts.map +1 -0
  351. package/lib/typescript/module/src/getStateFromPath.d.ts +34 -0
  352. package/lib/typescript/module/src/getStateFromPath.d.ts.map +1 -0
  353. package/lib/typescript/module/src/index.d.ts +34 -0
  354. package/lib/typescript/module/src/index.d.ts.map +1 -0
  355. package/lib/typescript/module/src/isArrayEqual.d.ts +6 -0
  356. package/lib/typescript/module/src/isArrayEqual.d.ts.map +1 -0
  357. package/lib/typescript/module/src/isRecordEqual.d.ts +5 -0
  358. package/lib/typescript/module/src/isRecordEqual.d.ts.map +1 -0
  359. package/lib/typescript/module/src/theming/ThemeContext.d.ts +3 -0
  360. package/lib/typescript/module/src/theming/ThemeContext.d.ts.map +1 -0
  361. package/lib/typescript/module/src/theming/ThemeProvider.d.ts +8 -0
  362. package/lib/typescript/module/src/theming/ThemeProvider.d.ts.map +1 -0
  363. package/lib/typescript/module/src/theming/useTheme.d.ts +2 -0
  364. package/lib/typescript/module/src/theming/useTheme.d.ts.map +1 -0
  365. package/lib/typescript/module/src/types.d.ts +702 -0
  366. package/lib/typescript/module/src/types.d.ts.map +1 -0
  367. package/lib/typescript/module/src/useChildListeners.d.ts +12 -0
  368. package/lib/typescript/module/src/useChildListeners.d.ts.map +1 -0
  369. package/lib/typescript/module/src/useComponent.d.ts +7 -0
  370. package/lib/typescript/module/src/useComponent.d.ts.map +1 -0
  371. package/lib/typescript/module/src/useCurrentRender.d.ts +14 -0
  372. package/lib/typescript/module/src/useCurrentRender.d.ts.map +1 -0
  373. package/lib/typescript/module/src/useDescriptors.d.ts +133 -0
  374. package/lib/typescript/module/src/useDescriptors.d.ts.map +1 -0
  375. package/lib/typescript/module/src/useEventEmitter.d.ts +9 -0
  376. package/lib/typescript/module/src/useEventEmitter.d.ts.map +1 -0
  377. package/lib/typescript/module/src/useFocusEffect.d.ts +11 -0
  378. package/lib/typescript/module/src/useFocusEffect.d.ts.map +1 -0
  379. package/lib/typescript/module/src/useFocusEvents.d.ts +13 -0
  380. package/lib/typescript/module/src/useFocusEvents.d.ts.map +1 -0
  381. package/lib/typescript/module/src/useFocusedListenersChildrenAdapter.d.ts +13 -0
  382. package/lib/typescript/module/src/useFocusedListenersChildrenAdapter.d.ts.map +1 -0
  383. package/lib/typescript/module/src/useIsFocused.d.ts +6 -0
  384. package/lib/typescript/module/src/useIsFocused.d.ts.map +1 -0
  385. package/lib/typescript/module/src/useIsomorphicLayoutEffect.d.ts +6 -0
  386. package/lib/typescript/module/src/useIsomorphicLayoutEffect.d.ts.map +1 -0
  387. package/lib/typescript/module/src/useIsomorphicLayoutEffect.native.d.ts +3 -0
  388. package/lib/typescript/module/src/useIsomorphicLayoutEffect.native.d.ts.map +1 -0
  389. package/lib/typescript/module/src/useKeyedChildListeners.d.ts +12 -0
  390. package/lib/typescript/module/src/useKeyedChildListeners.d.ts.map +1 -0
  391. package/lib/typescript/module/src/useLazyValue.d.ts +2 -0
  392. package/lib/typescript/module/src/useLazyValue.d.ts.map +1 -0
  393. package/lib/typescript/module/src/useNavigation.d.ts +11 -0
  394. package/lib/typescript/module/src/useNavigation.d.ts.map +1 -0
  395. package/lib/typescript/module/src/useNavigationBuilder.d.ts +181 -0
  396. package/lib/typescript/module/src/useNavigationBuilder.d.ts.map +1 -0
  397. package/lib/typescript/module/src/useNavigationCache.d.ts +65 -0
  398. package/lib/typescript/module/src/useNavigationCache.d.ts.map +1 -0
  399. package/lib/typescript/module/src/useNavigationContainerRef.d.ts +3 -0
  400. package/lib/typescript/module/src/useNavigationContainerRef.d.ts.map +1 -0
  401. package/lib/typescript/module/src/useNavigationHelpers.d.ts +96 -0
  402. package/lib/typescript/module/src/useNavigationHelpers.d.ts.map +1 -0
  403. package/lib/typescript/module/src/useNavigationIndependentTree.d.ts +2 -0
  404. package/lib/typescript/module/src/useNavigationIndependentTree.d.ts.map +1 -0
  405. package/lib/typescript/module/src/useNavigationState.d.ts +10 -0
  406. package/lib/typescript/module/src/useNavigationState.d.ts.map +1 -0
  407. package/lib/typescript/module/src/useOnAction.d.ts +26 -0
  408. package/lib/typescript/module/src/useOnAction.d.ts.map +1 -0
  409. package/lib/typescript/module/src/useOnGetState.d.ts +9 -0
  410. package/lib/typescript/module/src/useOnGetState.d.ts.map +1 -0
  411. package/lib/typescript/module/src/useOnPreventRemove.d.ts +17 -0
  412. package/lib/typescript/module/src/useOnPreventRemove.d.ts.map +1 -0
  413. package/lib/typescript/module/src/useOnRouteFocus.d.ts +15 -0
  414. package/lib/typescript/module/src/useOnRouteFocus.d.ts.map +1 -0
  415. package/lib/typescript/module/src/useOptionsGetters.d.ts +13 -0
  416. package/lib/typescript/module/src/useOptionsGetters.d.ts.map +1 -0
  417. package/lib/typescript/module/src/usePreventRemove.d.ts +13 -0
  418. package/lib/typescript/module/src/usePreventRemove.d.ts.map +1 -0
  419. package/lib/typescript/module/src/usePreventRemoveContext.d.ts +5 -0
  420. package/lib/typescript/module/src/usePreventRemoveContext.d.ts.map +1 -0
  421. package/lib/typescript/module/src/useRegisterNavigator.d.ts +6 -0
  422. package/lib/typescript/module/src/useRegisterNavigator.d.ts.map +1 -0
  423. package/lib/typescript/module/src/useRoute.d.ts +9 -0
  424. package/lib/typescript/module/src/useRoute.d.ts.map +1 -0
  425. package/lib/typescript/module/src/useRouteCache.d.ts +14 -0
  426. package/lib/typescript/module/src/useRouteCache.d.ts.map +1 -0
  427. package/lib/typescript/module/src/useSyncState.d.ts +2 -0
  428. package/lib/typescript/module/src/useSyncState.d.ts.map +1 -0
  429. package/lib/typescript/module/src/validatePathConfig.d.ts +2 -0
  430. package/lib/typescript/module/src/validatePathConfig.d.ts.map +1 -0
  431. package/lib/typescript/module/tsconfig.build.tsbuildinfo +1 -0
  432. package/package.json +18 -11
  433. package/src/BaseNavigationContainer.tsx +1 -1
  434. package/src/StaticNavigation.tsx +2 -0
  435. package/src/getPathFromState.tsx +20 -4
  436. package/src/getStateFromPath.tsx +124 -63
  437. package/src/types.tsx +33 -46
  438. package/src/useNavigationBuilder.tsx +1 -1
  439. package/src/validatePathConfig.tsx +1 -1
  440. package/lib/commonjs/BaseNavigationContainer.cjs +0 -356
  441. package/lib/commonjs/BaseNavigationContainer.cjs.map +0 -1
  442. package/lib/commonjs/CurrentRenderContext.cjs +0 -15
  443. package/lib/commonjs/DeprecatedNavigationInChildContext.cjs +0 -14
  444. package/lib/commonjs/EnsureSingleNavigator.cjs +0 -43
  445. package/lib/commonjs/Group.cjs +0 -14
  446. package/lib/commonjs/NavigationBuilderContext.cjs +0 -17
  447. package/lib/commonjs/NavigationContainerRefContext.cjs +0 -14
  448. package/lib/commonjs/NavigationContext.cjs +0 -14
  449. package/lib/commonjs/NavigationHelpersContext.cjs +0 -15
  450. package/lib/commonjs/NavigationIndependentTree.cjs +0 -35
  451. package/lib/commonjs/NavigationIndependentTreeContext.cjs +0 -14
  452. package/lib/commonjs/NavigationRouteContext.cjs +0 -14
  453. package/lib/commonjs/NavigationStateContext.cjs +0 -29
  454. package/lib/commonjs/PreventRemoveContext.cjs +0 -16
  455. package/lib/commonjs/PreventRemoveProvider.cjs +0 -91
  456. package/lib/commonjs/SceneView.cjs +0 -96
  457. package/lib/commonjs/Screen.cjs +0 -14
  458. package/lib/commonjs/StaticContainer.cjs +0 -31
  459. package/lib/commonjs/StaticNavigation.cjs +0 -255
  460. package/lib/commonjs/StaticNavigation.cjs.map +0 -1
  461. package/lib/commonjs/UnhandledActionContext.cjs +0 -11
  462. package/lib/commonjs/checkDuplicateRouteNames.cjs +0 -25
  463. package/lib/commonjs/checkSerializable.cjs +0 -50
  464. package/lib/commonjs/createNavigationContainerRef.cjs +0 -69
  465. package/lib/commonjs/createNavigatorFactory.cjs +0 -34
  466. package/lib/commonjs/deepFreeze.cjs +0 -37
  467. package/lib/commonjs/findFocusedRoute.cjs +0 -15
  468. package/lib/commonjs/getActionFromState.cjs +0 -86
  469. package/lib/commonjs/getFocusedRouteNameFromRoute.cjs +0 -22
  470. package/lib/commonjs/getPathFromState.cjs +0 -211
  471. package/lib/commonjs/getPathFromState.cjs.map +0 -1
  472. package/lib/commonjs/getStateFromPath.cjs +0 -438
  473. package/lib/commonjs/getStateFromPath.cjs.map +0 -1
  474. package/lib/commonjs/index.cjs +0 -287
  475. package/lib/commonjs/isArrayEqual.cjs +0 -20
  476. package/lib/commonjs/isRecordEqual.cjs +0 -21
  477. package/lib/commonjs/theming/ThemeContext.cjs +0 -12
  478. package/lib/commonjs/theming/ThemeProvider.cjs +0 -21
  479. package/lib/commonjs/theming/useTheme.cjs +0 -18
  480. package/lib/commonjs/types.cjs +0 -9
  481. package/lib/commonjs/types.cjs.map +0 -1
  482. package/lib/commonjs/useChildListeners.cjs +0 -36
  483. package/lib/commonjs/useComponent.cjs +0 -40
  484. package/lib/commonjs/useCurrentRender.cjs +0 -25
  485. package/lib/commonjs/useDescriptors.cjs +0 -188
  486. package/lib/commonjs/useEventEmitter.cjs +0 -105
  487. package/lib/commonjs/useFocusEffect.cjs +0 -80
  488. package/lib/commonjs/useFocusEvents.cjs +0 -70
  489. package/lib/commonjs/useFocusedListenersChildrenAdapter.cjs +0 -48
  490. package/lib/commonjs/useIsFocused.cjs +0 -28
  491. package/lib/commonjs/useIsomorphicLayoutEffect.cjs +0 -12
  492. package/lib/commonjs/useIsomorphicLayoutEffect.native.cjs +0 -9
  493. package/lib/commonjs/useKeyedChildListeners.cjs +0 -33
  494. package/lib/commonjs/useLazyValue.cjs +0 -17
  495. package/lib/commonjs/useNavigation.cjs +0 -27
  496. package/lib/commonjs/useNavigationBuilder.cjs +0 -478
  497. package/lib/commonjs/useNavigationCache.cjs +0 -162
  498. package/lib/commonjs/useNavigationContainerRef.cjs +0 -18
  499. package/lib/commonjs/useNavigationHelpers.cjs +0 -76
  500. package/lib/commonjs/useNavigationIndependentTree.cjs +0 -14
  501. package/lib/commonjs/useNavigationState.cjs +0 -26
  502. package/lib/commonjs/useOnAction.cjs +0 -106
  503. package/lib/commonjs/useOnGetState.cjs +0 -48
  504. package/lib/commonjs/useOnPreventRemove.cjs +0 -72
  505. package/lib/commonjs/useOnRouteFocus.cjs +0 -36
  506. package/lib/commonjs/useOptionsGetters.cjs +0 -78
  507. package/lib/commonjs/usePreventRemove.cjs +0 -48
  508. package/lib/commonjs/usePreventRemoveContext.cjs +0 -18
  509. package/lib/commonjs/useRegisterNavigator.cjs +0 -32
  510. package/lib/commonjs/useRoute.cjs +0 -23
  511. package/lib/commonjs/useRouteCache.cjs +0 -69
  512. package/lib/commonjs/useSyncState.cjs +0 -48
  513. package/lib/commonjs/validatePathConfig.cjs +0 -49
  514. package/lib/commonjs/validatePathConfig.cjs.map +0 -1
  515. package/lib/module/BaseNavigationContainer.mjs +0 -347
  516. package/lib/module/BaseNavigationContainer.mjs.map +0 -1
  517. package/lib/module/CurrentRenderContext.mjs +0 -8
  518. package/lib/module/CurrentRenderContext.mjs.map +0 -1
  519. package/lib/module/DeprecatedNavigationInChildContext.mjs +0 -7
  520. package/lib/module/DeprecatedNavigationInChildContext.mjs.map +0 -1
  521. package/lib/module/EnsureSingleNavigator.mjs +0 -34
  522. package/lib/module/EnsureSingleNavigator.mjs.map +0 -1
  523. package/lib/module/Group.mjs +0 -8
  524. package/lib/module/Group.mjs.map +0 -1
  525. package/lib/module/NavigationBuilderContext.mjs +0 -9
  526. package/lib/module/NavigationBuilderContext.mjs.map +0 -1
  527. package/lib/module/NavigationContainerRefContext.mjs +0 -6
  528. package/lib/module/NavigationContainerRefContext.mjs.map +0 -1
  529. package/lib/module/NavigationContext.mjs +0 -6
  530. package/lib/module/NavigationContext.mjs.map +0 -1
  531. package/lib/module/NavigationHelpersContext.mjs +0 -7
  532. package/lib/module/NavigationHelpersContext.mjs.map +0 -1
  533. package/lib/module/NavigationIndependentTree.mjs +0 -28
  534. package/lib/module/NavigationIndependentTree.mjs.map +0 -1
  535. package/lib/module/NavigationIndependentTreeContext.mjs +0 -7
  536. package/lib/module/NavigationIndependentTreeContext.mjs.map +0 -1
  537. package/lib/module/NavigationRouteContext.mjs +0 -7
  538. package/lib/module/NavigationRouteContext.mjs.map +0 -1
  539. package/lib/module/NavigationStateContext.mjs +0 -21
  540. package/lib/module/NavigationStateContext.mjs.map +0 -1
  541. package/lib/module/PreventRemoveContext.mjs +0 -9
  542. package/lib/module/PreventRemoveContext.mjs.map +0 -1
  543. package/lib/module/PreventRemoveProvider.mjs +0 -82
  544. package/lib/module/PreventRemoveProvider.mjs.map +0 -1
  545. package/lib/module/SceneView.mjs +0 -88
  546. package/lib/module/SceneView.mjs.map +0 -1
  547. package/lib/module/Screen.mjs +0 -8
  548. package/lib/module/Screen.mjs.map +0 -1
  549. package/lib/module/StaticContainer.mjs +0 -24
  550. package/lib/module/StaticContainer.mjs.map +0 -1
  551. package/lib/module/StaticNavigation.mjs +0 -246
  552. package/lib/module/StaticNavigation.mjs.map +0 -1
  553. package/lib/module/UnhandledActionContext.mjs +0 -3
  554. package/lib/module/UnhandledActionContext.mjs.map +0 -1
  555. package/lib/module/checkDuplicateRouteNames.mjs +0 -19
  556. package/lib/module/checkDuplicateRouteNames.mjs.map +0 -1
  557. package/lib/module/checkSerializable.mjs +0 -44
  558. package/lib/module/checkSerializable.mjs.map +0 -1
  559. package/lib/module/createNavigationContainerRef.mjs +0 -62
  560. package/lib/module/createNavigationContainerRef.mjs.map +0 -1
  561. package/lib/module/createNavigatorFactory.mjs +0 -29
  562. package/lib/module/createNavigatorFactory.mjs.map +0 -1
  563. package/lib/module/deepFreeze.mjs +0 -29
  564. package/lib/module/deepFreeze.mjs.map +0 -1
  565. package/lib/module/findFocusedRoute.mjs +0 -9
  566. package/lib/module/findFocusedRoute.mjs.map +0 -1
  567. package/lib/module/getActionFromState.mjs +0 -80
  568. package/lib/module/getActionFromState.mjs.map +0 -1
  569. package/lib/module/getFocusedRouteNameFromRoute.mjs +0 -16
  570. package/lib/module/getFocusedRouteNameFromRoute.mjs.map +0 -1
  571. package/lib/module/getPathFromState.mjs +0 -203
  572. package/lib/module/getPathFromState.mjs.map +0 -1
  573. package/lib/module/getStateFromPath.mjs +0 -429
  574. package/lib/module/getStateFromPath.mjs.map +0 -1
  575. package/lib/module/index.mjs +0 -34
  576. package/lib/module/index.mjs.map +0 -1
  577. package/lib/module/isArrayEqual.mjs +0 -14
  578. package/lib/module/isArrayEqual.mjs.map +0 -1
  579. package/lib/module/isRecordEqual.mjs +0 -15
  580. package/lib/module/isRecordEqual.mjs.map +0 -1
  581. package/lib/module/theming/ThemeContext.mjs +0 -4
  582. package/lib/module/theming/ThemeContext.mjs.map +0 -1
  583. package/lib/module/theming/ThemeProvider.mjs +0 -13
  584. package/lib/module/theming/ThemeProvider.mjs.map +0 -1
  585. package/lib/module/theming/useTheme.mjs +0 -10
  586. package/lib/module/theming/useTheme.mjs.map +0 -1
  587. package/lib/module/types.mjs +0 -2
  588. package/lib/module/types.mjs.map +0 -1
  589. package/lib/module/useChildListeners.mjs +0 -28
  590. package/lib/module/useChildListeners.mjs.map +0 -1
  591. package/lib/module/useComponent.mjs +0 -32
  592. package/lib/module/useComponent.mjs.map +0 -1
  593. package/lib/module/useCurrentRender.mjs +0 -17
  594. package/lib/module/useCurrentRender.mjs.map +0 -1
  595. package/lib/module/useDescriptors.mjs +0 -180
  596. package/lib/module/useDescriptors.mjs.map +0 -1
  597. package/lib/module/useEventEmitter.mjs +0 -97
  598. package/lib/module/useEventEmitter.mjs.map +0 -1
  599. package/lib/module/useFocusEffect.mjs +0 -72
  600. package/lib/module/useFocusEffect.mjs.map +0 -1
  601. package/lib/module/useFocusEvents.mjs +0 -62
  602. package/lib/module/useFocusEvents.mjs.map +0 -1
  603. package/lib/module/useFocusedListenersChildrenAdapter.mjs +0 -40
  604. package/lib/module/useFocusedListenersChildrenAdapter.mjs.map +0 -1
  605. package/lib/module/useIsFocused.mjs +0 -21
  606. package/lib/module/useIsFocused.mjs.map +0 -1
  607. package/lib/module/useIsomorphicLayoutEffect.mjs +0 -7
  608. package/lib/module/useIsomorphicLayoutEffect.mjs.map +0 -1
  609. package/lib/module/useIsomorphicLayoutEffect.native.mjs +0 -3
  610. package/lib/module/useIsomorphicLayoutEffect.native.mjs.map +0 -1
  611. package/lib/module/useKeyedChildListeners.mjs +0 -25
  612. package/lib/module/useKeyedChildListeners.mjs.map +0 -1
  613. package/lib/module/useLazyValue.mjs +0 -9
  614. package/lib/module/useLazyValue.mjs.map +0 -1
  615. package/lib/module/useNavigation.mjs +0 -19
  616. package/lib/module/useNavigation.mjs.map +0 -1
  617. package/lib/module/useNavigationBuilder.mjs +0 -470
  618. package/lib/module/useNavigationBuilder.mjs.map +0 -1
  619. package/lib/module/useNavigationCache.mjs +0 -154
  620. package/lib/module/useNavigationCache.mjs.map +0 -1
  621. package/lib/module/useNavigationContainerRef.mjs +0 -10
  622. package/lib/module/useNavigationContainerRef.mjs.map +0 -1
  623. package/lib/module/useNavigationHelpers.mjs +0 -68
  624. package/lib/module/useNavigationHelpers.mjs.map +0 -1
  625. package/lib/module/useNavigationIndependentTree.mjs +0 -6
  626. package/lib/module/useNavigationIndependentTree.mjs.map +0 -1
  627. package/lib/module/useNavigationState.mjs +0 -18
  628. package/lib/module/useNavigationState.mjs.map +0 -1
  629. package/lib/module/useOnAction.mjs +0 -98
  630. package/lib/module/useOnAction.mjs.map +0 -1
  631. package/lib/module/useOnGetState.mjs +0 -40
  632. package/lib/module/useOnGetState.mjs.map +0 -1
  633. package/lib/module/useOnPreventRemove.mjs +0 -62
  634. package/lib/module/useOnPreventRemove.mjs.map +0 -1
  635. package/lib/module/useOnRouteFocus.mjs +0 -28
  636. package/lib/module/useOnRouteFocus.mjs.map +0 -1
  637. package/lib/module/useOptionsGetters.mjs +0 -70
  638. package/lib/module/useOptionsGetters.mjs.map +0 -1
  639. package/lib/module/usePreventRemove.mjs +0 -40
  640. package/lib/module/usePreventRemove.mjs.map +0 -1
  641. package/lib/module/usePreventRemoveContext.mjs +0 -10
  642. package/lib/module/usePreventRemoveContext.mjs.map +0 -1
  643. package/lib/module/useRegisterNavigator.mjs +0 -25
  644. package/lib/module/useRegisterNavigator.mjs.map +0 -1
  645. package/lib/module/useRoute.mjs +0 -15
  646. package/lib/module/useRoute.mjs.map +0 -1
  647. package/lib/module/useRouteCache.mjs +0 -60
  648. package/lib/module/useRouteCache.mjs.map +0 -1
  649. package/lib/module/useSyncState.mjs +0 -40
  650. package/lib/module/useSyncState.mjs.map +0 -1
  651. package/lib/module/validatePathConfig.mjs +0 -43
  652. package/lib/module/validatePathConfig.mjs.map +0 -1
  653. package/lib/typescript/src/BaseNavigationContainer.d.ts.map +0 -1
  654. package/lib/typescript/src/CurrentRenderContext.d.ts.map +0 -1
  655. package/lib/typescript/src/DeprecatedNavigationInChildContext.d.ts.map +0 -1
  656. package/lib/typescript/src/EnsureSingleNavigator.d.ts.map +0 -1
  657. package/lib/typescript/src/Group.d.ts.map +0 -1
  658. package/lib/typescript/src/NavigationBuilderContext.d.ts.map +0 -1
  659. package/lib/typescript/src/NavigationContainerRefContext.d.ts.map +0 -1
  660. package/lib/typescript/src/NavigationContext.d.ts.map +0 -1
  661. package/lib/typescript/src/NavigationHelpersContext.d.ts.map +0 -1
  662. package/lib/typescript/src/NavigationIndependentTree.d.ts.map +0 -1
  663. package/lib/typescript/src/NavigationIndependentTreeContext.d.ts.map +0 -1
  664. package/lib/typescript/src/NavigationRouteContext.d.ts.map +0 -1
  665. package/lib/typescript/src/NavigationStateContext.d.ts.map +0 -1
  666. package/lib/typescript/src/PreventRemoveContext.d.ts.map +0 -1
  667. package/lib/typescript/src/PreventRemoveProvider.d.ts.map +0 -1
  668. package/lib/typescript/src/SceneView.d.ts.map +0 -1
  669. package/lib/typescript/src/Screen.d.ts.map +0 -1
  670. package/lib/typescript/src/StaticContainer.d.ts.map +0 -1
  671. package/lib/typescript/src/StaticNavigation.d.ts.map +0 -1
  672. package/lib/typescript/src/UnhandledActionContext.d.ts.map +0 -1
  673. package/lib/typescript/src/checkDuplicateRouteNames.d.ts.map +0 -1
  674. package/lib/typescript/src/checkSerializable.d.ts.map +0 -1
  675. package/lib/typescript/src/createNavigationContainerRef.d.ts.map +0 -1
  676. package/lib/typescript/src/createNavigatorFactory.d.ts.map +0 -1
  677. package/lib/typescript/src/deepFreeze.d.ts.map +0 -1
  678. package/lib/typescript/src/findFocusedRoute.d.ts.map +0 -1
  679. package/lib/typescript/src/getActionFromState.d.ts.map +0 -1
  680. package/lib/typescript/src/getFocusedRouteNameFromRoute.d.ts.map +0 -1
  681. package/lib/typescript/src/getPathFromState.d.ts.map +0 -1
  682. package/lib/typescript/src/getStateFromPath.d.ts.map +0 -1
  683. package/lib/typescript/src/index.d.ts.map +0 -1
  684. package/lib/typescript/src/isArrayEqual.d.ts.map +0 -1
  685. package/lib/typescript/src/isRecordEqual.d.ts.map +0 -1
  686. package/lib/typescript/src/theming/ThemeContext.d.ts.map +0 -1
  687. package/lib/typescript/src/theming/ThemeProvider.d.ts.map +0 -1
  688. package/lib/typescript/src/theming/useTheme.d.ts.map +0 -1
  689. package/lib/typescript/src/types.d.ts +0 -695
  690. package/lib/typescript/src/types.d.ts.map +0 -1
  691. package/lib/typescript/src/useChildListeners.d.ts.map +0 -1
  692. package/lib/typescript/src/useComponent.d.ts.map +0 -1
  693. package/lib/typescript/src/useCurrentRender.d.ts.map +0 -1
  694. package/lib/typescript/src/useDescriptors.d.ts +0 -133
  695. package/lib/typescript/src/useDescriptors.d.ts.map +0 -1
  696. package/lib/typescript/src/useEventEmitter.d.ts.map +0 -1
  697. package/lib/typescript/src/useFocusEffect.d.ts.map +0 -1
  698. package/lib/typescript/src/useFocusEvents.d.ts.map +0 -1
  699. package/lib/typescript/src/useFocusedListenersChildrenAdapter.d.ts.map +0 -1
  700. package/lib/typescript/src/useIsFocused.d.ts.map +0 -1
  701. package/lib/typescript/src/useIsomorphicLayoutEffect.d.ts.map +0 -1
  702. package/lib/typescript/src/useIsomorphicLayoutEffect.native.d.ts.map +0 -1
  703. package/lib/typescript/src/useKeyedChildListeners.d.ts.map +0 -1
  704. package/lib/typescript/src/useLazyValue.d.ts.map +0 -1
  705. package/lib/typescript/src/useNavigation.d.ts.map +0 -1
  706. package/lib/typescript/src/useNavigationBuilder.d.ts +0 -181
  707. package/lib/typescript/src/useNavigationBuilder.d.ts.map +0 -1
  708. package/lib/typescript/src/useNavigationCache.d.ts +0 -65
  709. package/lib/typescript/src/useNavigationCache.d.ts.map +0 -1
  710. package/lib/typescript/src/useNavigationContainerRef.d.ts.map +0 -1
  711. package/lib/typescript/src/useNavigationHelpers.d.ts +0 -96
  712. package/lib/typescript/src/useNavigationHelpers.d.ts.map +0 -1
  713. package/lib/typescript/src/useNavigationIndependentTree.d.ts.map +0 -1
  714. package/lib/typescript/src/useNavigationState.d.ts.map +0 -1
  715. package/lib/typescript/src/useOnAction.d.ts.map +0 -1
  716. package/lib/typescript/src/useOnGetState.d.ts.map +0 -1
  717. package/lib/typescript/src/useOnPreventRemove.d.ts.map +0 -1
  718. package/lib/typescript/src/useOnRouteFocus.d.ts.map +0 -1
  719. package/lib/typescript/src/useOptionsGetters.d.ts.map +0 -1
  720. package/lib/typescript/src/usePreventRemove.d.ts.map +0 -1
  721. package/lib/typescript/src/usePreventRemoveContext.d.ts.map +0 -1
  722. package/lib/typescript/src/useRegisterNavigator.d.ts.map +0 -1
  723. package/lib/typescript/src/useRoute.d.ts.map +0 -1
  724. package/lib/typescript/src/useRouteCache.d.ts.map +0 -1
  725. package/lib/typescript/src/useSyncState.d.ts.map +0 -1
  726. package/lib/typescript/src/validatePathConfig.d.ts.map +0 -1
  727. package/lib/typescript/utils/usePrevious.d.ts +0 -6
  728. package/lib/typescript/utils/usePrevious.d.ts.map +0 -1
  729. /package/lib/commonjs/{CurrentRenderContext.cjs.map → CurrentRenderContext.js.map} +0 -0
  730. /package/lib/commonjs/{DeprecatedNavigationInChildContext.cjs.map → DeprecatedNavigationInChildContext.js.map} +0 -0
  731. /package/lib/commonjs/{EnsureSingleNavigator.cjs.map → EnsureSingleNavigator.js.map} +0 -0
  732. /package/lib/commonjs/{Group.cjs.map → Group.js.map} +0 -0
  733. /package/lib/commonjs/{NavigationBuilderContext.cjs.map → NavigationBuilderContext.js.map} +0 -0
  734. /package/lib/commonjs/{NavigationContainerRefContext.cjs.map → NavigationContainerRefContext.js.map} +0 -0
  735. /package/lib/commonjs/{NavigationContext.cjs.map → NavigationContext.js.map} +0 -0
  736. /package/lib/commonjs/{NavigationHelpersContext.cjs.map → NavigationHelpersContext.js.map} +0 -0
  737. /package/lib/commonjs/{NavigationIndependentTree.cjs.map → NavigationIndependentTree.js.map} +0 -0
  738. /package/lib/commonjs/{NavigationIndependentTreeContext.cjs.map → NavigationIndependentTreeContext.js.map} +0 -0
  739. /package/lib/commonjs/{NavigationRouteContext.cjs.map → NavigationRouteContext.js.map} +0 -0
  740. /package/lib/commonjs/{NavigationStateContext.cjs.map → NavigationStateContext.js.map} +0 -0
  741. /package/lib/commonjs/{PreventRemoveContext.cjs.map → PreventRemoveContext.js.map} +0 -0
  742. /package/lib/commonjs/{PreventRemoveProvider.cjs.map → PreventRemoveProvider.js.map} +0 -0
  743. /package/lib/commonjs/{SceneView.cjs.map → SceneView.js.map} +0 -0
  744. /package/lib/commonjs/{Screen.cjs.map → Screen.js.map} +0 -0
  745. /package/lib/commonjs/{StaticContainer.cjs.map → StaticContainer.js.map} +0 -0
  746. /package/lib/commonjs/{UnhandledActionContext.cjs.map → UnhandledActionContext.js.map} +0 -0
  747. /package/lib/commonjs/{checkDuplicateRouteNames.cjs.map → checkDuplicateRouteNames.js.map} +0 -0
  748. /package/lib/commonjs/{checkSerializable.cjs.map → checkSerializable.js.map} +0 -0
  749. /package/lib/commonjs/{createNavigationContainerRef.cjs.map → createNavigationContainerRef.js.map} +0 -0
  750. /package/lib/commonjs/{createNavigatorFactory.cjs.map → createNavigatorFactory.js.map} +0 -0
  751. /package/lib/commonjs/{deepFreeze.cjs.map → deepFreeze.js.map} +0 -0
  752. /package/lib/commonjs/{findFocusedRoute.cjs.map → findFocusedRoute.js.map} +0 -0
  753. /package/lib/commonjs/{getActionFromState.cjs.map → getActionFromState.js.map} +0 -0
  754. /package/lib/commonjs/{getFocusedRouteNameFromRoute.cjs.map → getFocusedRouteNameFromRoute.js.map} +0 -0
  755. /package/lib/commonjs/{index.cjs.map → index.js.map} +0 -0
  756. /package/lib/commonjs/{isArrayEqual.cjs.map → isArrayEqual.js.map} +0 -0
  757. /package/lib/commonjs/{isRecordEqual.cjs.map → isRecordEqual.js.map} +0 -0
  758. /package/lib/commonjs/theming/{ThemeContext.cjs.map → ThemeContext.js.map} +0 -0
  759. /package/lib/commonjs/theming/{ThemeProvider.cjs.map → ThemeProvider.js.map} +0 -0
  760. /package/lib/commonjs/theming/{useTheme.cjs.map → useTheme.js.map} +0 -0
  761. /package/lib/commonjs/{useChildListeners.cjs.map → useChildListeners.js.map} +0 -0
  762. /package/lib/commonjs/{useComponent.cjs.map → useComponent.js.map} +0 -0
  763. /package/lib/commonjs/{useCurrentRender.cjs.map → useCurrentRender.js.map} +0 -0
  764. /package/lib/commonjs/{useDescriptors.cjs.map → useDescriptors.js.map} +0 -0
  765. /package/lib/commonjs/{useEventEmitter.cjs.map → useEventEmitter.js.map} +0 -0
  766. /package/lib/commonjs/{useFocusEffect.cjs.map → useFocusEffect.js.map} +0 -0
  767. /package/lib/commonjs/{useFocusEvents.cjs.map → useFocusEvents.js.map} +0 -0
  768. /package/lib/commonjs/{useFocusedListenersChildrenAdapter.cjs.map → useFocusedListenersChildrenAdapter.js.map} +0 -0
  769. /package/lib/commonjs/{useIsFocused.cjs.map → useIsFocused.js.map} +0 -0
  770. /package/lib/commonjs/{useIsomorphicLayoutEffect.cjs.map → useIsomorphicLayoutEffect.js.map} +0 -0
  771. /package/lib/commonjs/{useIsomorphicLayoutEffect.native.cjs.map → useIsomorphicLayoutEffect.native.js.map} +0 -0
  772. /package/lib/commonjs/{useKeyedChildListeners.cjs.map → useKeyedChildListeners.js.map} +0 -0
  773. /package/lib/commonjs/{useLazyValue.cjs.map → useLazyValue.js.map} +0 -0
  774. /package/lib/commonjs/{useNavigation.cjs.map → useNavigation.js.map} +0 -0
  775. /package/lib/commonjs/{useNavigationBuilder.cjs.map → useNavigationBuilder.js.map} +0 -0
  776. /package/lib/commonjs/{useNavigationCache.cjs.map → useNavigationCache.js.map} +0 -0
  777. /package/lib/commonjs/{useNavigationContainerRef.cjs.map → useNavigationContainerRef.js.map} +0 -0
  778. /package/lib/commonjs/{useNavigationHelpers.cjs.map → useNavigationHelpers.js.map} +0 -0
  779. /package/lib/commonjs/{useNavigationIndependentTree.cjs.map → useNavigationIndependentTree.js.map} +0 -0
  780. /package/lib/commonjs/{useNavigationState.cjs.map → useNavigationState.js.map} +0 -0
  781. /package/lib/commonjs/{useOnAction.cjs.map → useOnAction.js.map} +0 -0
  782. /package/lib/commonjs/{useOnGetState.cjs.map → useOnGetState.js.map} +0 -0
  783. /package/lib/commonjs/{useOnPreventRemove.cjs.map → useOnPreventRemove.js.map} +0 -0
  784. /package/lib/commonjs/{useOnRouteFocus.cjs.map → useOnRouteFocus.js.map} +0 -0
  785. /package/lib/commonjs/{useOptionsGetters.cjs.map → useOptionsGetters.js.map} +0 -0
  786. /package/lib/commonjs/{usePreventRemove.cjs.map → usePreventRemove.js.map} +0 -0
  787. /package/lib/commonjs/{usePreventRemoveContext.cjs.map → usePreventRemoveContext.js.map} +0 -0
  788. /package/lib/commonjs/{useRegisterNavigator.cjs.map → useRegisterNavigator.js.map} +0 -0
  789. /package/lib/commonjs/{useRoute.cjs.map → useRoute.js.map} +0 -0
  790. /package/lib/commonjs/{useRouteCache.cjs.map → useRouteCache.js.map} +0 -0
  791. /package/lib/commonjs/{useSyncState.cjs.map → useSyncState.js.map} +0 -0
  792. /package/lib/typescript/{src → commonjs/src}/BaseNavigationContainer.d.ts +0 -0
  793. /package/lib/typescript/{src → commonjs/src}/CurrentRenderContext.d.ts +0 -0
  794. /package/lib/typescript/{src → commonjs/src}/DeprecatedNavigationInChildContext.d.ts +0 -0
  795. /package/lib/typescript/{src → commonjs/src}/EnsureSingleNavigator.d.ts +0 -0
  796. /package/lib/typescript/{src → commonjs/src}/Group.d.ts +0 -0
  797. /package/lib/typescript/{src → commonjs/src}/NavigationBuilderContext.d.ts +0 -0
  798. /package/lib/typescript/{src → commonjs/src}/NavigationContainerRefContext.d.ts +0 -0
  799. /package/lib/typescript/{src → commonjs/src}/NavigationContext.d.ts +0 -0
  800. /package/lib/typescript/{src → commonjs/src}/NavigationHelpersContext.d.ts +0 -0
  801. /package/lib/typescript/{src → commonjs/src}/NavigationIndependentTree.d.ts +0 -0
  802. /package/lib/typescript/{src → commonjs/src}/NavigationIndependentTreeContext.d.ts +0 -0
  803. /package/lib/typescript/{src → commonjs/src}/NavigationRouteContext.d.ts +0 -0
  804. /package/lib/typescript/{src → commonjs/src}/NavigationStateContext.d.ts +0 -0
  805. /package/lib/typescript/{src → commonjs/src}/PreventRemoveContext.d.ts +0 -0
  806. /package/lib/typescript/{src → commonjs/src}/PreventRemoveProvider.d.ts +0 -0
  807. /package/lib/typescript/{src → commonjs/src}/SceneView.d.ts +0 -0
  808. /package/lib/typescript/{src → commonjs/src}/Screen.d.ts +0 -0
  809. /package/lib/typescript/{src → commonjs/src}/StaticContainer.d.ts +0 -0
  810. /package/lib/typescript/{src → commonjs/src}/StaticNavigation.d.ts +0 -0
  811. /package/lib/typescript/{src → commonjs/src}/UnhandledActionContext.d.ts +0 -0
  812. /package/lib/typescript/{src → commonjs/src}/checkDuplicateRouteNames.d.ts +0 -0
  813. /package/lib/typescript/{src → commonjs/src}/checkSerializable.d.ts +0 -0
  814. /package/lib/typescript/{src → commonjs/src}/createNavigationContainerRef.d.ts +0 -0
  815. /package/lib/typescript/{src → commonjs/src}/createNavigatorFactory.d.ts +0 -0
  816. /package/lib/typescript/{src → commonjs/src}/deepFreeze.d.ts +0 -0
  817. /package/lib/typescript/{src → commonjs/src}/findFocusedRoute.d.ts +0 -0
  818. /package/lib/typescript/{src → commonjs/src}/getActionFromState.d.ts +0 -0
  819. /package/lib/typescript/{src → commonjs/src}/getFocusedRouteNameFromRoute.d.ts +0 -0
  820. /package/lib/typescript/{src → commonjs/src}/getPathFromState.d.ts +0 -0
  821. /package/lib/typescript/{src → commonjs/src}/getStateFromPath.d.ts +0 -0
  822. /package/lib/typescript/{src → commonjs/src}/index.d.ts +0 -0
  823. /package/lib/typescript/{src → commonjs/src}/isArrayEqual.d.ts +0 -0
  824. /package/lib/typescript/{src → commonjs/src}/isRecordEqual.d.ts +0 -0
  825. /package/lib/typescript/{src → commonjs/src}/theming/ThemeContext.d.ts +0 -0
  826. /package/lib/typescript/{src → commonjs/src}/theming/ThemeProvider.d.ts +0 -0
  827. /package/lib/typescript/{src → commonjs/src}/theming/useTheme.d.ts +0 -0
  828. /package/lib/typescript/{src → commonjs/src}/useChildListeners.d.ts +0 -0
  829. /package/lib/typescript/{src → commonjs/src}/useComponent.d.ts +0 -0
  830. /package/lib/typescript/{src → commonjs/src}/useCurrentRender.d.ts +0 -0
  831. /package/lib/typescript/{src → commonjs/src}/useEventEmitter.d.ts +0 -0
  832. /package/lib/typescript/{src → commonjs/src}/useFocusEffect.d.ts +0 -0
  833. /package/lib/typescript/{src → commonjs/src}/useFocusEvents.d.ts +0 -0
  834. /package/lib/typescript/{src → commonjs/src}/useFocusedListenersChildrenAdapter.d.ts +0 -0
  835. /package/lib/typescript/{src → commonjs/src}/useIsFocused.d.ts +0 -0
  836. /package/lib/typescript/{src → commonjs/src}/useIsomorphicLayoutEffect.d.ts +0 -0
  837. /package/lib/typescript/{src → commonjs/src}/useIsomorphicLayoutEffect.native.d.ts +0 -0
  838. /package/lib/typescript/{src → commonjs/src}/useKeyedChildListeners.d.ts +0 -0
  839. /package/lib/typescript/{src → commonjs/src}/useLazyValue.d.ts +0 -0
  840. /package/lib/typescript/{src → commonjs/src}/useNavigation.d.ts +0 -0
  841. /package/lib/typescript/{src → commonjs/src}/useNavigationContainerRef.d.ts +0 -0
  842. /package/lib/typescript/{src → commonjs/src}/useNavigationIndependentTree.d.ts +0 -0
  843. /package/lib/typescript/{src → commonjs/src}/useNavigationState.d.ts +0 -0
  844. /package/lib/typescript/{src → commonjs/src}/useOnAction.d.ts +0 -0
  845. /package/lib/typescript/{src → commonjs/src}/useOnGetState.d.ts +0 -0
  846. /package/lib/typescript/{src → commonjs/src}/useOnPreventRemove.d.ts +0 -0
  847. /package/lib/typescript/{src → commonjs/src}/useOnRouteFocus.d.ts +0 -0
  848. /package/lib/typescript/{src → commonjs/src}/useOptionsGetters.d.ts +0 -0
  849. /package/lib/typescript/{src → commonjs/src}/usePreventRemove.d.ts +0 -0
  850. /package/lib/typescript/{src → commonjs/src}/usePreventRemoveContext.d.ts +0 -0
  851. /package/lib/typescript/{src → commonjs/src}/useRegisterNavigator.d.ts +0 -0
  852. /package/lib/typescript/{src → commonjs/src}/useRoute.d.ts +0 -0
  853. /package/lib/typescript/{src → commonjs/src}/useRouteCache.d.ts +0 -0
  854. /package/lib/typescript/{src → commonjs/src}/useSyncState.d.ts +0 -0
  855. /package/lib/typescript/{src → commonjs/src}/validatePathConfig.d.ts +0 -0
@@ -1,470 +0,0 @@
1
- import { CommonActions } from '@react-navigation/routers';
2
- import * as React from 'react';
3
- import { isValidElementType } from 'react-is';
4
- import useLatestCallback from 'use-latest-callback';
5
- import { deepFreeze } from "./deepFreeze.mjs";
6
- import { Group } from "./Group.mjs";
7
- import { isArrayEqual } from "./isArrayEqual.mjs";
8
- import { isRecordEqual } from "./isRecordEqual.mjs";
9
- import { NavigationHelpersContext } from "./NavigationHelpersContext.mjs";
10
- import { NavigationRouteContext } from "./NavigationRouteContext.mjs";
11
- import { NavigationStateContext } from "./NavigationStateContext.mjs";
12
- import { PreventRemoveProvider } from "./PreventRemoveProvider.mjs";
13
- import { Screen } from "./Screen.mjs";
14
- import { PrivateValueStore } from "./types.mjs";
15
- import { useChildListeners } from "./useChildListeners.mjs";
16
- import { useComponent } from "./useComponent.mjs";
17
- import { useCurrentRender } from "./useCurrentRender.mjs";
18
- import { useDescriptors } from "./useDescriptors.mjs";
19
- import { useEventEmitter } from "./useEventEmitter.mjs";
20
- import { useFocusedListenersChildrenAdapter } from "./useFocusedListenersChildrenAdapter.mjs";
21
- import { useFocusEvents } from "./useFocusEvents.mjs";
22
- import { useIsomorphicLayoutEffect } from './useIsomorphicLayoutEffect';
23
- import { useKeyedChildListeners } from "./useKeyedChildListeners.mjs";
24
- import { useLazyValue } from "./useLazyValue.mjs";
25
- import { useNavigationHelpers } from "./useNavigationHelpers.mjs";
26
- import { useOnAction } from "./useOnAction.mjs";
27
- import { useOnGetState } from "./useOnGetState.mjs";
28
- import { useOnRouteFocus } from "./useOnRouteFocus.mjs";
29
- import { useRegisterNavigator } from "./useRegisterNavigator.mjs";
30
-
31
- // This is to make TypeScript compiler happy
32
- import { jsx as _jsx } from "react/jsx-runtime";
33
- PrivateValueStore;
34
- const isValidKey = key => key === undefined || typeof key === 'string' && key !== '';
35
-
36
- /**
37
- * Extract route config object from React children elements.
38
- *
39
- * @param children React Elements to extract the config from.
40
- */
41
- const getRouteConfigsFromChildren = (children, groupKey, groupOptions, groupLayout) => {
42
- const configs = React.Children.toArray(children).reduce((acc, child) => {
43
- if ( /*#__PURE__*/React.isValidElement(child)) {
44
- if (child.type === Screen) {
45
- // We can only extract the config from `Screen` elements
46
- // If something else was rendered, it's probably a bug
47
-
48
- if (!isValidKey(child.props.navigationKey)) {
49
- throw new Error(`Got an invalid 'navigationKey' prop (${JSON.stringify(child.props.navigationKey)}) for the screen '${child.props.name}'. It must be a non-empty string or 'undefined'.`);
50
- }
51
- acc.push({
52
- keys: [groupKey, child.props.navigationKey],
53
- options: groupOptions,
54
- layout: groupLayout,
55
- props: child.props
56
- });
57
- return acc;
58
- }
59
- if (child.type === React.Fragment || child.type === Group) {
60
- if (!isValidKey(child.props.navigationKey)) {
61
- throw new Error(`Got an invalid 'navigationKey' prop (${JSON.stringify(child.props.navigationKey)}) for the group. It must be a non-empty string or 'undefined'.`);
62
- }
63
-
64
- // When we encounter a fragment or group, we need to dive into its children to extract the configs
65
- // This is handy to conditionally define a group of screens
66
- acc.push(...getRouteConfigsFromChildren(child.props.children, child.props.navigationKey, child.type !== Group ? groupOptions : groupOptions != null ? [...groupOptions, child.props.screenOptions] : [child.props.screenOptions], typeof child.props.screenLayout === 'function' ? child.props.screenLayout : groupLayout));
67
- return acc;
68
- }
69
- }
70
- throw new Error(`A navigator can only contain 'Screen', 'Group' or 'React.Fragment' as its direct children (found ${/*#__PURE__*/React.isValidElement(child) ? `'${typeof child.type === 'string' ? child.type : child.type?.name}'${child.props != null && typeof child.props === 'object' && 'name' in child.props && child.props?.name ? ` for the screen '${child.props.name}'` : ''}` : typeof child === 'object' ? JSON.stringify(child) : `'${String(child)}'`}). To render this component in the navigator, pass it in the 'component' prop to 'Screen'.`);
71
- }, []);
72
- if (process.env.NODE_ENV !== 'production') {
73
- configs.forEach(config => {
74
- const {
75
- name,
76
- children,
77
- component,
78
- getComponent
79
- } = config.props;
80
- if (typeof name !== 'string' || !name) {
81
- throw new Error(`Got an invalid name (${JSON.stringify(name)}) for the screen. It must be a non-empty string.`);
82
- }
83
- if (children != null || component !== undefined || getComponent !== undefined) {
84
- if (children != null && component !== undefined) {
85
- throw new Error(`Got both 'component' and 'children' props for the screen '${name}'. You must pass only one of them.`);
86
- }
87
- if (children != null && getComponent !== undefined) {
88
- throw new Error(`Got both 'getComponent' and 'children' props for the screen '${name}'. You must pass only one of them.`);
89
- }
90
- if (component !== undefined && getComponent !== undefined) {
91
- throw new Error(`Got both 'component' and 'getComponent' props for the screen '${name}'. You must pass only one of them.`);
92
- }
93
- if (children != null && typeof children !== 'function') {
94
- throw new Error(`Got an invalid value for 'children' prop for the screen '${name}'. It must be a function returning a React Element.`);
95
- }
96
- if (component !== undefined && !isValidElementType(component)) {
97
- throw new Error(`Got an invalid value for 'component' prop for the screen '${name}'. It must be a valid React Component.`);
98
- }
99
- if (getComponent !== undefined && typeof getComponent !== 'function') {
100
- throw new Error(`Got an invalid value for 'getComponent' prop for the screen '${name}'. It must be a function returning a React Component.`);
101
- }
102
- if (typeof component === 'function') {
103
- if (component.name === 'component') {
104
- // Inline anonymous functions passed in the `component` prop will have the name of the prop
105
- // It's relatively safe to assume that it's not a component since it should also have PascalCase name
106
- // We won't catch all scenarios here, but this should catch a good chunk of incorrect use.
107
- console.warn(`Looks like you're passing an inline function for 'component' prop for the screen '${name}' (e.g. component={() => <SomeComponent />}). Passing an inline function will cause the component state to be lost on re-render and cause perf issues since it's re-created every render. You can pass the function as children to 'Screen' instead to achieve the desired behaviour.`);
108
- } else if (/^[a-z]/.test(component.name)) {
109
- console.warn(`Got a component with the name '${component.name}' for the screen '${name}'. React Components must start with an uppercase letter. If you're passing a regular function and not a component, pass it as children to 'Screen' instead. Otherwise capitalize your component's name.`);
110
- }
111
- }
112
- } else {
113
- throw new Error(`Couldn't find a 'component', 'getComponent' or 'children' prop for the screen '${name}'. This can happen if you passed 'undefined'. You likely forgot to export your component from the file it's defined in, or mixed up default import and named import when importing.`);
114
- }
115
- });
116
- }
117
- return configs;
118
- };
119
-
120
- /**
121
- * Hook for building navigators.
122
- *
123
- * @param createRouter Factory method which returns router object.
124
- * @param options Options object containing `children` and additional options for the router.
125
- * @returns An object containing `state`, `navigation`, `descriptors` objects.
126
- */
127
- export function useNavigationBuilder(createRouter, options) {
128
- const navigatorKey = useRegisterNavigator();
129
- const route = React.useContext(NavigationRouteContext);
130
- const {
131
- children,
132
- layout,
133
- screenOptions,
134
- screenLayout,
135
- screenListeners,
136
- ...rest
137
- } = options;
138
- const routeConfigs = getRouteConfigsFromChildren(children);
139
- const router = useLazyValue(() => {
140
- if (rest.initialRouteName != null && routeConfigs.every(config => config.props.name !== rest.initialRouteName)) {
141
- throw new Error(`Couldn't find a screen named '${rest.initialRouteName}' to use as 'initialRouteName'.`);
142
- }
143
- return createRouter(rest);
144
- });
145
- const screens = routeConfigs.reduce((acc, config) => {
146
- if (config.props.name in acc) {
147
- throw new Error(`A navigator cannot contain multiple 'Screen' components with the same name (found duplicate screen named '${config.props.name}')`);
148
- }
149
- acc[config.props.name] = config;
150
- return acc;
151
- }, {});
152
- const routeNames = routeConfigs.map(config => config.props.name);
153
- const routeKeyList = routeNames.reduce((acc, curr) => {
154
- acc[curr] = screens[curr].keys.map(key => key ?? '').join(':');
155
- return acc;
156
- }, {});
157
- const routeParamList = routeNames.reduce((acc, curr) => {
158
- const {
159
- initialParams
160
- } = screens[curr].props;
161
- acc[curr] = initialParams;
162
- return acc;
163
- }, {});
164
- const routeGetIdList = routeNames.reduce((acc, curr) => Object.assign(acc, {
165
- [curr]: screens[curr].props.getId
166
- }), {});
167
- if (!routeNames.length) {
168
- throw new Error("Couldn't find any screens for the navigator. Have you defined any screens as its children?");
169
- }
170
- const isStateValid = React.useCallback(state => state.type === undefined || state.type === router.type, [router.type]);
171
- const isStateInitialized = React.useCallback(state => state !== undefined && state.stale === false && isStateValid(state), [isStateValid]);
172
- const {
173
- state: currentState,
174
- getState: getCurrentState,
175
- setState: setCurrentState,
176
- setKey,
177
- getKey,
178
- getIsInitial
179
- } = React.useContext(NavigationStateContext);
180
- const stateCleanedUp = React.useRef(false);
181
- const setState = useLatestCallback(state => {
182
- if (stateCleanedUp.current) {
183
- // State might have been already cleaned up due to unmount
184
- // We do not want to expose API allowing to override this
185
- // This would lead to old data preservation on main navigator unmount
186
- return;
187
- }
188
- setCurrentState(state);
189
- });
190
- const [initializedState, isFirstStateInitialization] = React.useMemo(() => {
191
- const initialRouteParamList = routeNames.reduce((acc, curr) => {
192
- const {
193
- initialParams
194
- } = screens[curr].props;
195
- const initialParamsFromParams = route?.params?.state == null && route?.params?.initial !== false && route?.params?.screen === curr ? route.params.params : undefined;
196
- acc[curr] = initialParams !== undefined || initialParamsFromParams !== undefined ? {
197
- ...initialParams,
198
- ...initialParamsFromParams
199
- } : undefined;
200
- return acc;
201
- }, {});
202
-
203
- // If the current state isn't initialized on first render, we initialize it
204
- // We also need to re-initialize it if the state passed from parent was changed (maybe due to reset)
205
- // Otherwise assume that the state was provided as initial state
206
- // So we need to rehydrate it to make it usable
207
- if ((currentState === undefined || !isStateValid(currentState)) && route?.params?.state == null && !(typeof route?.params?.screen === 'string' && route?.params?.initial !== false)) {
208
- return [router.getInitialState({
209
- routeNames,
210
- routeParamList: initialRouteParamList,
211
- routeGetIdList
212
- }), true];
213
- } else {
214
- let stateFromParams;
215
- if (route?.params?.state != null) {
216
- stateFromParams = route.params.state;
217
- } else if (typeof route?.params?.screen === 'string' && route?.params?.initial !== false) {
218
- stateFromParams = {
219
- index: 0,
220
- routes: [{
221
- name: route.params.screen,
222
- params: route.params.params,
223
- path: route.params.path
224
- }]
225
- };
226
- }
227
- return [router.getRehydratedState(stateFromParams ?? currentState, {
228
- routeNames,
229
- routeParamList: initialRouteParamList,
230
- routeGetIdList
231
- }), false];
232
- }
233
- // We explicitly don't include routeNames, route.params etc. in the dep list
234
- // below. We want to avoid forcing a new state to be calculated in those cases
235
- // Instead, we handle changes to these in the nextState code below. Note
236
- // that some changes to routeConfigs are explicitly ignored, such as changes
237
- // to initialParams
238
- // eslint-disable-next-line react-hooks/exhaustive-deps
239
- }, [currentState, router, isStateValid]);
240
- const previousRouteKeyListRef = React.useRef(routeKeyList);
241
- React.useEffect(() => {
242
- previousRouteKeyListRef.current = routeKeyList;
243
- });
244
- const previousRouteKeyList = previousRouteKeyListRef.current;
245
- let state =
246
- // If the state isn't initialized, or stale, use the state we initialized instead
247
- // The state won't update until there's a change needed in the state we have initialized locally
248
- // So it'll be `undefined` or stale until the first navigation event happens
249
- isStateInitialized(currentState) ? currentState : initializedState;
250
- let nextState = state;
251
- if (!isArrayEqual(state.routeNames, routeNames) || !isRecordEqual(routeKeyList, previousRouteKeyList)) {
252
- const navigatorStateForNextRouteNamesChange = options.UNSTABLE_getStateForRouteNamesChange?.(state);
253
- // When the list of route names change, the router should handle it to remove invalid routes
254
- nextState = navigatorStateForNextRouteNamesChange ?
255
- // @ts-expect-error this is ok
256
- router.getRehydratedState(navigatorStateForNextRouteNamesChange, {
257
- routeNames,
258
- routeParamList,
259
- routeGetIdList
260
- }) : router.getStateForRouteNamesChange(state, {
261
- routeNames,
262
- routeParamList,
263
- routeGetIdList,
264
- routeKeyChanges: Object.keys(routeKeyList).filter(name => name in previousRouteKeyList && routeKeyList[name] !== previousRouteKeyList[name])
265
- });
266
- }
267
- const previousNestedParamsRef = React.useRef(route?.params);
268
- React.useEffect(() => {
269
- previousNestedParamsRef.current = route?.params;
270
- }, [route?.params]);
271
- if (route?.params) {
272
- const previousParams = previousNestedParamsRef.current;
273
- let action;
274
- if (typeof route.params.state === 'object' && route.params.state != null && route.params !== previousParams) {
275
- // If the route was updated with new state, we should reset to it
276
- action = CommonActions.reset(route.params.state);
277
- } else if (typeof route.params.screen === 'string' && (route.params.initial === false && isFirstStateInitialization || route.params !== previousParams)) {
278
- // If the route was updated with new screen name and/or params, we should navigate there
279
- action = CommonActions.navigate({
280
- name: route.params.screen,
281
- params: route.params.params,
282
- path: route.params.path
283
- });
284
- }
285
-
286
- // The update should be limited to current navigator only, so we call the router manually
287
- const updatedState = action ? router.getStateForAction(nextState, action, {
288
- routeNames,
289
- routeParamList,
290
- routeGetIdList
291
- }) : null;
292
- nextState = updatedState !== null ? router.getRehydratedState(updatedState, {
293
- routeNames,
294
- routeParamList,
295
- routeGetIdList
296
- }) : nextState;
297
- }
298
- const shouldUpdate = state !== nextState;
299
- useIsomorphicLayoutEffect(() => {
300
- if (shouldUpdate) {
301
- // If the state needs to be updated, we'll schedule an update
302
- setState(nextState);
303
- }
304
- });
305
-
306
- // The up-to-date state will come in next render, but we don't need to wait for it
307
- // We can't use the outdated state since the screens have changed, which will cause error due to mismatched config
308
- // So we override the state object we return to use the latest state as soon as possible
309
- state = nextState;
310
- React.useEffect(() => {
311
- // In strict mode, React will double-invoke effects.
312
- // So we need to reset the flag if component was not unmounted
313
- stateCleanedUp.current = false;
314
- setKey(navigatorKey);
315
- if (!getIsInitial()) {
316
- // If it's not initial render, we need to update the state
317
- // This will make sure that our container gets notifier of state changes due to new mounts
318
- // This is necessary for proper screen tracking, URL updates etc.
319
- setState(nextState);
320
- }
321
- return () => {
322
- // We need to clean up state for this navigator on unmount
323
- if (getCurrentState() !== undefined && getKey() === navigatorKey) {
324
- setCurrentState(undefined);
325
- stateCleanedUp.current = true;
326
- }
327
- };
328
- // eslint-disable-next-line react-hooks/exhaustive-deps
329
- }, []);
330
- const getState = useLatestCallback(() => {
331
- const currentState = shouldUpdate ? nextState : getCurrentState();
332
- return deepFreeze(isStateInitialized(currentState) ? currentState : initializedState);
333
- });
334
- const emitter = useEventEmitter(e => {
335
- const routeNames = [];
336
- let route;
337
- if (e.target) {
338
- route = state.routes.find(route => route.key === e.target);
339
- if (route?.name) {
340
- routeNames.push(route.name);
341
- }
342
- } else {
343
- route = state.routes[state.index];
344
- routeNames.push(...Object.keys(screens).filter(name => route?.name === name));
345
- }
346
- if (route == null) {
347
- return;
348
- }
349
- const navigation = descriptors[route.key].navigation;
350
- const listeners = [].concat(
351
- // Get an array of listeners for all screens + common listeners on navigator
352
- ...[screenListeners, ...routeNames.map(name => {
353
- const {
354
- listeners
355
- } = screens[name].props;
356
- return listeners;
357
- })].map(listeners => {
358
- const map = typeof listeners === 'function' ? listeners({
359
- route: route,
360
- navigation
361
- }) : listeners;
362
- return map ? Object.keys(map).filter(type => type === e.type).map(type => map?.[type]) : undefined;
363
- }))
364
- // We don't want same listener to be called multiple times for same event
365
- // So we remove any duplicate functions from the array
366
- .filter((cb, i, self) => cb && self.lastIndexOf(cb) === i);
367
- listeners.forEach(listener => listener?.(e));
368
- });
369
- useFocusEvents({
370
- state,
371
- emitter
372
- });
373
- React.useEffect(() => {
374
- emitter.emit({
375
- type: 'state',
376
- data: {
377
- state
378
- }
379
- });
380
- }, [emitter, state]);
381
- const {
382
- listeners: childListeners,
383
- addListener
384
- } = useChildListeners();
385
- const {
386
- keyedListeners,
387
- addKeyedListener
388
- } = useKeyedChildListeners();
389
- const onAction = useOnAction({
390
- router,
391
- getState,
392
- setState,
393
- key: route?.key,
394
- actionListeners: childListeners.action,
395
- beforeRemoveListeners: keyedListeners.beforeRemove,
396
- routerConfigOptions: {
397
- routeNames,
398
- routeParamList,
399
- routeGetIdList
400
- },
401
- emitter
402
- });
403
- const onRouteFocus = useOnRouteFocus({
404
- router,
405
- key: route?.key,
406
- getState,
407
- setState
408
- });
409
- const navigation = useNavigationHelpers({
410
- id: options.id,
411
- onAction,
412
- getState,
413
- emitter,
414
- router
415
- });
416
- useFocusedListenersChildrenAdapter({
417
- navigation,
418
- focusedListeners: childListeners.focus
419
- });
420
- useOnGetState({
421
- getState,
422
- getStateListeners: keyedListeners.getState
423
- });
424
- const {
425
- describe,
426
- descriptors
427
- } = useDescriptors({
428
- state,
429
- screens,
430
- navigation,
431
- screenOptions,
432
- screenLayout,
433
- onAction,
434
- getState,
435
- setState,
436
- onRouteFocus,
437
- addListener,
438
- addKeyedListener,
439
- router,
440
- // @ts-expect-error: this should have both core and custom events, but too much work right now
441
- emitter
442
- });
443
- useCurrentRender({
444
- state,
445
- navigation,
446
- descriptors
447
- });
448
- const NavigationContent = useComponent(children => {
449
- const element = layout != null ? layout({
450
- state,
451
- descriptors,
452
- navigation,
453
- children
454
- }) : children;
455
- return /*#__PURE__*/_jsx(NavigationHelpersContext.Provider, {
456
- value: navigation,
457
- children: /*#__PURE__*/_jsx(PreventRemoveProvider, {
458
- children: element
459
- })
460
- });
461
- });
462
- return {
463
- state,
464
- navigation,
465
- describe,
466
- descriptors,
467
- NavigationContent
468
- };
469
- }
470
- //# sourceMappingURL=useNavigationBuilder.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["CommonActions","React","isValidElementType","useLatestCallback","deepFreeze","Group","isArrayEqual","isRecordEqual","NavigationHelpersContext","NavigationRouteContext","NavigationStateContext","PreventRemoveProvider","Screen","PrivateValueStore","useChildListeners","useComponent","useCurrentRender","useDescriptors","useEventEmitter","useFocusedListenersChildrenAdapter","useFocusEvents","useIsomorphicLayoutEffect","useKeyedChildListeners","useLazyValue","useNavigationHelpers","useOnAction","useOnGetState","useOnRouteFocus","useRegisterNavigator","jsx","_jsx","isValidKey","key","undefined","getRouteConfigsFromChildren","children","groupKey","groupOptions","groupLayout","configs","Children","toArray","reduce","acc","child","isValidElement","type","props","navigationKey","Error","JSON","stringify","name","push","keys","options","layout","Fragment","screenOptions","screenLayout","String","process","env","NODE_ENV","forEach","config","component","getComponent","console","warn","test","useNavigationBuilder","createRouter","navigatorKey","route","useContext","screenListeners","rest","routeConfigs","router","initialRouteName","every","screens","routeNames","map","routeKeyList","curr","join","routeParamList","initialParams","routeGetIdList","Object","assign","getId","length","isStateValid","useCallback","state","isStateInitialized","stale","currentState","getState","getCurrentState","setState","setCurrentState","setKey","getKey","getIsInitial","stateCleanedUp","useRef","current","initializedState","isFirstStateInitialization","useMemo","initialRouteParamList","initialParamsFromParams","params","initial","screen","getInitialState","stateFromParams","index","routes","path","getRehydratedState","previousRouteKeyListRef","useEffect","previousRouteKeyList","nextState","navigatorStateForNextRouteNamesChange","UNSTABLE_getStateForRouteNamesChange","getStateForRouteNamesChange","routeKeyChanges","filter","previousNestedParamsRef","previousParams","action","reset","navigate","updatedState","getStateForAction","shouldUpdate","emitter","e","target","find","navigation","descriptors","listeners","concat","cb","i","self","lastIndexOf","listener","emit","data","childListeners","addListener","keyedListeners","addKeyedListener","onAction","actionListeners","beforeRemoveListeners","beforeRemove","routerConfigOptions","onRouteFocus","id","focusedListeners","focus","getStateListeners","describe","NavigationContent","element","Provider","value"],"sourceRoot":"../../src","sources":["useNavigationBuilder.tsx"],"mappings":"AAAA,SACEA,aAAa,QAUR,2BAA2B;AAClC,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,SAASC,kBAAkB,QAAQ,UAAU;AAC7C,OAAOC,iBAAiB,MAAM,qBAAqB;AAEnD,SAASC,UAAU,QAAQ,kBAAc;AACzC,SAASC,KAAK,QAAQ,aAAS;AAC/B,SAASC,YAAY,QAAQ,oBAAgB;AAC7C,SAASC,aAAa,QAAQ,qBAAiB;AAC/C,SAASC,wBAAwB,QAAQ,gCAA4B;AACrE,SAASC,sBAAsB,QAAQ,8BAA0B;AACjE,SAASC,sBAAsB,QAAQ,8BAA0B;AACjE,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IACRE,QAAQ;IACR+D,YAAY;IACZR,WAAW;IACXE,gBAAgB;IAChBjF,MAAM;IACN;IACA+D;EACF,CAAC,CAAC;EAEF9H,gBAAgB,CAAC;IACfiF,KAAK;IACLiD,UAAU;IACVC;EACF,CAAC,CAAC;EAEF,MAAMyB,iBAAiB,GAAG7J,YAAY,CAAEoB,QAAyB,IAAK;IACpE,MAAM0I,OAAO,GACXrH,MAAM,IAAI,IAAI,GACVA,MAAM,CAAC;MACLyC,KAAK;MACLkD,WAAW;MACXD,UAAU;MACV/G;IACF,CAAC,CAAC,GACFA,QAAQ;IAEd,oBACEL,IAAA,CAACtB,wBAAwB,CAACsK,QAAQ;MAACC,KAAK,EAAE7B,UAAW;MAAA/G,QAAA,eACnDL,IAAA,CAACnB,qBAAqB;QAAAwB,QAAA,EAAE0I;MAAO,CAAwB;IAAC,CACvB,CAAC;EAExC,CAAC,CAAC;EAEF,OAAO;IACL5E,KAAK;IACLiD,UAAU;IACVyB,QAAQ;IACRxB,WAAW;IACXyB;EACF,CAAC;AACH","ignoreList":[]}
@@ -1,154 +0,0 @@
1
- import { CommonActions } from '@react-navigation/routers';
2
- import * as React from 'react';
3
- import { NavigationBuilderContext } from "./NavigationBuilderContext.mjs";
4
- /**
5
- * Hook to cache navigation objects for each screen in the navigator.
6
- * It's important to cache them to make sure navigation objects don't change between renders.
7
- * This lets us apply optimizations like `React.memo` to minimize re-rendering screens.
8
- */
9
- export function useNavigationCache({
10
- state,
11
- getState,
12
- navigation,
13
- setOptions,
14
- router,
15
- emitter
16
- }) {
17
- const {
18
- stackRef
19
- } = React.useContext(NavigationBuilderContext);
20
- const base = React.useMemo(() => {
21
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
22
- const {
23
- emit,
24
- ...rest
25
- } = navigation;
26
- const actions = {
27
- ...router.actionCreators,
28
- ...CommonActions
29
- };
30
- const dispatch = () => {
31
- throw new Error('Actions cannot be dispatched from a placeholder screen.');
32
- };
33
- const helpers = Object.keys(actions).reduce((acc, name) => {
34
- acc[name] = dispatch;
35
- return acc;
36
- }, {});
37
- return {
38
- ...rest,
39
- ...helpers,
40
- addListener: () => {
41
- // Event listeners are not supported for placeholder screens
42
-
43
- return () => {
44
- // Empty function
45
- };
46
- },
47
- removeListener: () => {
48
- // Event listeners are not supported for placeholder screens
49
- },
50
- dispatch,
51
- getParent: id => {
52
- if (id !== undefined && id === rest.getId()) {
53
- return base;
54
- }
55
- return rest.getParent(id);
56
- },
57
- setOptions: () => {
58
- throw new Error('Options cannot be set from a placeholder screen.');
59
- },
60
- isFocused: () => false
61
- };
62
- }, [navigation, router.actionCreators]);
63
-
64
- // Cache object which holds navigation objects for each screen
65
- // We use `React.useMemo` instead of `React.useRef` coz we want to invalidate it when deps change
66
- // In reality, these deps will rarely change, if ever
67
- const cache = React.useMemo(() => ({
68
- current: {}
69
- }),
70
- // eslint-disable-next-line react-hooks/exhaustive-deps
71
- [base, getState, navigation, setOptions, emitter]);
72
- cache.current = state.routes.reduce((acc, route) => {
73
- const previous = cache.current[route.key];
74
- if (previous) {
75
- // If a cached navigation object already exists, reuse it
76
- acc[route.key] = previous;
77
- } else {
78
- const dispatch = thunk => {
79
- const action = typeof thunk === 'function' ? thunk(getState()) : thunk;
80
- if (action != null) {
81
- navigation.dispatch({
82
- source: route.key,
83
- ...action
84
- });
85
- }
86
- };
87
- const withStack = callback => {
88
- let isStackSet = false;
89
- try {
90
- if (process.env.NODE_ENV !== 'production' && stackRef && !stackRef.current) {
91
- // Capture the stack trace for devtools
92
- stackRef.current = new Error().stack;
93
- isStackSet = true;
94
- }
95
- callback();
96
- } finally {
97
- if (isStackSet && stackRef) {
98
- stackRef.current = undefined;
99
- }
100
- }
101
- };
102
- const actions = {
103
- ...router.actionCreators,
104
- ...CommonActions
105
- };
106
- const helpers = Object.keys(actions).reduce((acc, name) => {
107
- acc[name] = (...args) => withStack(() =>
108
- // @ts-expect-error: name is a valid key, but TypeScript is dumb
109
- dispatch(actions[name](...args)));
110
- return acc;
111
- }, {});
112
- acc[route.key] = {
113
- ...base,
114
- ...helpers,
115
- // FIXME: too much work to fix the types for now
116
- ...emitter.create(route.key),
117
- dispatch: thunk => withStack(() => dispatch(thunk)),
118
- getParent: id => {
119
- if (id !== undefined && id === base.getId()) {
120
- // If the passed id is the same as the current navigation id,
121
- // we return the cached navigation object for the relevant route
122
- return acc[route.key];
123
- }
124
- return base.getParent(id);
125
- },
126
- setOptions: options => {
127
- setOptions(o => ({
128
- ...o,
129
- [route.key]: {
130
- ...o[route.key],
131
- ...options
132
- }
133
- }));
134
- },
135
- isFocused: () => {
136
- const state = getState();
137
- if (state.routes[state.index].key !== route.key) {
138
- return false;
139
- }
140
-
141
- // If the current screen is focused, we also need to check if parent navigator is focused
142
- // This makes sure that we return the focus state in the whole tree, not just this navigator
143
- return navigation ? navigation.isFocused() : true;
144
- }
145
- };
146
- }
147
- return acc;
148
- }, {});
149
- return {
150
- base,
151
- navigations: cache.current
152
- };
153
- }
154
- //# sourceMappingURL=useNavigationCache.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["CommonActions","React","NavigationBuilderContext","useNavigationCache","state","getState","navigation","setOptions","router","emitter","stackRef","useContext","base","useMemo","emit","rest","actions","actionCreators","dispatch","Error","helpers","Object","keys","reduce","acc","name","addListener","removeListener","getParent","id","undefined","getId","isFocused","cache","current","routes","route","previous","key","thunk","action","source","withStack","callback","isStackSet","process","env","NODE_ENV","stack","args","create","options","o","index","navigations"],"sourceRoot":"../../src","sources":["useNavigationCache.tsx"],"mappings":"AAAA,SACEA,aAAa,QAKR,2BAA2B;AAClC,OAAO,KAAKC,KAAK,MAAM,OAAO;AAE9B,SAASC,wBAAwB,QAAQ,gCAA4B;AAyCrE;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,kBAAkBA,CAKhC;EACAC,KAAK;EACLC,QAAQ;EACRC,UAAU;EACVC,UAAU;EACVC,MAAM;EACNC;AACuC,CAAC,EAAE;EAC1C,MAAM;IAAEC;EAAS,CAAC,G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