@react-navigation/core 7.0.0-rc.8 → 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 (856) 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 +188 -0
  236. package/lib/typescript/commonjs/src/StaticNavigation.d.ts.map +1 -0
  237. package/lib/typescript/commonjs/src/UnhandledActionContext.d.ts.map +1 -0
  238. package/lib/typescript/commonjs/src/checkDuplicateRouteNames.d.ts.map +1 -0
  239. package/lib/typescript/commonjs/src/checkSerializable.d.ts.map +1 -0
  240. package/lib/typescript/commonjs/src/createNavigationContainerRef.d.ts.map +1 -0
  241. package/lib/typescript/commonjs/src/createNavigatorFactory.d.ts.map +1 -0
  242. package/lib/typescript/commonjs/src/deepFreeze.d.ts.map +1 -0
  243. package/lib/typescript/commonjs/src/findFocusedRoute.d.ts.map +1 -0
  244. package/lib/typescript/commonjs/src/getActionFromState.d.ts.map +1 -0
  245. package/lib/typescript/commonjs/src/getFocusedRouteNameFromRoute.d.ts.map +1 -0
  246. package/lib/typescript/commonjs/src/getPathFromState.d.ts.map +1 -0
  247. package/lib/typescript/commonjs/src/getStateFromPath.d.ts.map +1 -0
  248. package/lib/typescript/commonjs/src/index.d.ts.map +1 -0
  249. package/lib/typescript/commonjs/src/isArrayEqual.d.ts.map +1 -0
  250. package/lib/typescript/commonjs/src/isRecordEqual.d.ts.map +1 -0
  251. package/lib/typescript/commonjs/src/theming/ThemeContext.d.ts.map +1 -0
  252. package/lib/typescript/commonjs/src/theming/ThemeProvider.d.ts.map +1 -0
  253. package/lib/typescript/commonjs/src/theming/useTheme.d.ts.map +1 -0
  254. package/lib/typescript/commonjs/src/types.d.ts +702 -0
  255. package/lib/typescript/commonjs/src/types.d.ts.map +1 -0
  256. package/lib/typescript/commonjs/src/useChildListeners.d.ts.map +1 -0
  257. package/lib/typescript/commonjs/src/useComponent.d.ts.map +1 -0
  258. package/lib/typescript/commonjs/src/useCurrentRender.d.ts.map +1 -0
  259. package/lib/typescript/commonjs/src/useDescriptors.d.ts +133 -0
  260. package/lib/typescript/commonjs/src/useDescriptors.d.ts.map +1 -0
  261. package/lib/typescript/commonjs/src/useEventEmitter.d.ts.map +1 -0
  262. package/lib/typescript/commonjs/src/useFocusEffect.d.ts.map +1 -0
  263. package/lib/typescript/commonjs/src/useFocusEvents.d.ts.map +1 -0
  264. package/lib/typescript/commonjs/src/useFocusedListenersChildrenAdapter.d.ts.map +1 -0
  265. package/lib/typescript/commonjs/src/useIsFocused.d.ts.map +1 -0
  266. package/lib/typescript/commonjs/src/useIsomorphicLayoutEffect.d.ts.map +1 -0
  267. package/lib/typescript/commonjs/src/useIsomorphicLayoutEffect.native.d.ts.map +1 -0
  268. package/lib/typescript/commonjs/src/useKeyedChildListeners.d.ts.map +1 -0
  269. package/lib/typescript/commonjs/src/useLazyValue.d.ts.map +1 -0
  270. package/lib/typescript/commonjs/src/useNavigation.d.ts.map +1 -0
  271. package/lib/typescript/commonjs/src/useNavigationBuilder.d.ts +181 -0
  272. package/lib/typescript/commonjs/src/useNavigationBuilder.d.ts.map +1 -0
  273. package/lib/typescript/commonjs/src/useNavigationCache.d.ts +65 -0
  274. package/lib/typescript/commonjs/src/useNavigationCache.d.ts.map +1 -0
  275. package/lib/typescript/commonjs/src/useNavigationContainerRef.d.ts.map +1 -0
  276. package/lib/typescript/commonjs/src/useNavigationHelpers.d.ts +96 -0
  277. package/lib/typescript/commonjs/src/useNavigationHelpers.d.ts.map +1 -0
  278. package/lib/typescript/commonjs/src/useNavigationIndependentTree.d.ts.map +1 -0
  279. package/lib/typescript/commonjs/src/useNavigationState.d.ts.map +1 -0
  280. package/lib/typescript/commonjs/src/useOnAction.d.ts.map +1 -0
  281. package/lib/typescript/commonjs/src/useOnGetState.d.ts.map +1 -0
  282. package/lib/typescript/commonjs/src/useOnPreventRemove.d.ts.map +1 -0
  283. package/lib/typescript/commonjs/src/useOnRouteFocus.d.ts.map +1 -0
  284. package/lib/typescript/commonjs/src/useOptionsGetters.d.ts.map +1 -0
  285. package/lib/typescript/commonjs/src/usePreventRemove.d.ts.map +1 -0
  286. package/lib/typescript/commonjs/src/usePreventRemoveContext.d.ts.map +1 -0
  287. package/lib/typescript/commonjs/src/useRegisterNavigator.d.ts.map +1 -0
  288. package/lib/typescript/commonjs/src/useRoute.d.ts.map +1 -0
  289. package/lib/typescript/commonjs/src/useRouteCache.d.ts.map +1 -0
  290. package/lib/typescript/commonjs/src/useSyncState.d.ts.map +1 -0
  291. package/lib/typescript/commonjs/src/validatePathConfig.d.ts.map +1 -0
  292. package/lib/typescript/commonjs/tsconfig.build.tsbuildinfo +1 -0
  293. package/lib/typescript/module/package.json +1 -0
  294. package/lib/typescript/module/src/BaseNavigationContainer.d.ts +17 -0
  295. package/lib/typescript/module/src/BaseNavigationContainer.d.ts.map +1 -0
  296. package/lib/typescript/module/src/CurrentRenderContext.d.ts +9 -0
  297. package/lib/typescript/module/src/CurrentRenderContext.d.ts.map +1 -0
  298. package/lib/typescript/module/src/DeprecatedNavigationInChildContext.d.ts +6 -0
  299. package/lib/typescript/module/src/DeprecatedNavigationInChildContext.d.ts.map +1 -0
  300. package/lib/typescript/module/src/EnsureSingleNavigator.d.ts +14 -0
  301. package/lib/typescript/module/src/EnsureSingleNavigator.d.ts.map +1 -0
  302. package/lib/typescript/module/src/Group.d.ts +7 -0
  303. package/lib/typescript/module/src/Group.d.ts.map +1 -0
  304. package/lib/typescript/module/src/NavigationBuilderContext.d.ts +34 -0
  305. package/lib/typescript/module/src/NavigationBuilderContext.d.ts.map +1 -0
  306. package/lib/typescript/module/src/NavigationContainerRefContext.d.ts +8 -0
  307. package/lib/typescript/module/src/NavigationContainerRefContext.d.ts.map +1 -0
  308. package/lib/typescript/module/src/NavigationContext.d.ts +8 -0
  309. package/lib/typescript/module/src/NavigationContext.d.ts.map +1 -0
  310. package/lib/typescript/module/src/NavigationHelpersContext.d.ts +9 -0
  311. package/lib/typescript/module/src/NavigationHelpersContext.d.ts.map +1 -0
  312. package/lib/typescript/module/src/NavigationIndependentTree.d.ts +8 -0
  313. package/lib/typescript/module/src/NavigationIndependentTree.d.ts.map +1 -0
  314. package/lib/typescript/module/src/NavigationIndependentTreeContext.d.ts +6 -0
  315. package/lib/typescript/module/src/NavigationIndependentTreeContext.d.ts.map +1 -0
  316. package/lib/typescript/module/src/NavigationRouteContext.d.ts +7 -0
  317. package/lib/typescript/module/src/NavigationRouteContext.d.ts.map +1 -0
  318. package/lib/typescript/module/src/NavigationStateContext.d.ts +13 -0
  319. package/lib/typescript/module/src/NavigationStateContext.d.ts.map +1 -0
  320. package/lib/typescript/module/src/PreventRemoveContext.d.ts +13 -0
  321. package/lib/typescript/module/src/PreventRemoveContext.d.ts.map +1 -0
  322. package/lib/typescript/module/src/PreventRemoveProvider.d.ts +10 -0
  323. package/lib/typescript/module/src/PreventRemoveProvider.d.ts.map +1 -0
  324. package/lib/typescript/module/src/SceneView.d.ts +21 -0
  325. package/lib/typescript/module/src/SceneView.d.ts.map +1 -0
  326. package/lib/typescript/module/src/Screen.d.ts +7 -0
  327. package/lib/typescript/module/src/Screen.d.ts.map +1 -0
  328. package/lib/typescript/module/src/StaticContainer.d.ts +6 -0
  329. package/lib/typescript/module/src/StaticContainer.d.ts.map +1 -0
  330. package/lib/typescript/module/src/StaticNavigation.d.ts +188 -0
  331. package/lib/typescript/module/src/StaticNavigation.d.ts.map +1 -0
  332. package/lib/typescript/module/src/UnhandledActionContext.d.ts +4 -0
  333. package/lib/typescript/module/src/UnhandledActionContext.d.ts.map +1 -0
  334. package/lib/typescript/module/src/checkDuplicateRouteNames.d.ts +3 -0
  335. package/lib/typescript/module/src/checkDuplicateRouteNames.d.ts.map +1 -0
  336. package/lib/typescript/module/src/checkSerializable.d.ts +10 -0
  337. package/lib/typescript/module/src/checkSerializable.d.ts.map +1 -0
  338. package/lib/typescript/module/src/createNavigationContainerRef.d.ts +4 -0
  339. package/lib/typescript/module/src/createNavigationContainerRef.d.ts.map +1 -0
  340. package/lib/typescript/module/src/createNavigatorFactory.d.ts +10 -0
  341. package/lib/typescript/module/src/createNavigatorFactory.d.ts.map +1 -0
  342. package/lib/typescript/module/src/deepFreeze.d.ts +3 -0
  343. package/lib/typescript/module/src/deepFreeze.d.ts.map +1 -0
  344. package/lib/typescript/module/src/findFocusedRoute.d.ts +5 -0
  345. package/lib/typescript/module/src/findFocusedRoute.d.ts.map +1 -0
  346. package/lib/typescript/module/src/getActionFromState.d.ts +17 -0
  347. package/lib/typescript/module/src/getActionFromState.d.ts.map +1 -0
  348. package/lib/typescript/module/src/getFocusedRouteNameFromRoute.d.ts +3 -0
  349. package/lib/typescript/module/src/getFocusedRouteNameFromRoute.d.ts.map +1 -0
  350. package/lib/typescript/module/src/getPathFromState.d.ts +40 -0
  351. package/lib/typescript/module/src/getPathFromState.d.ts.map +1 -0
  352. package/lib/typescript/module/src/getStateFromPath.d.ts +34 -0
  353. package/lib/typescript/module/src/getStateFromPath.d.ts.map +1 -0
  354. package/lib/typescript/module/src/index.d.ts +34 -0
  355. package/lib/typescript/module/src/index.d.ts.map +1 -0
  356. package/lib/typescript/module/src/isArrayEqual.d.ts +6 -0
  357. package/lib/typescript/module/src/isArrayEqual.d.ts.map +1 -0
  358. package/lib/typescript/module/src/isRecordEqual.d.ts +5 -0
  359. package/lib/typescript/module/src/isRecordEqual.d.ts.map +1 -0
  360. package/lib/typescript/module/src/theming/ThemeContext.d.ts +3 -0
  361. package/lib/typescript/module/src/theming/ThemeContext.d.ts.map +1 -0
  362. package/lib/typescript/module/src/theming/ThemeProvider.d.ts +8 -0
  363. package/lib/typescript/module/src/theming/ThemeProvider.d.ts.map +1 -0
  364. package/lib/typescript/module/src/theming/useTheme.d.ts +2 -0
  365. package/lib/typescript/module/src/theming/useTheme.d.ts.map +1 -0
  366. package/lib/typescript/module/src/types.d.ts +702 -0
  367. package/lib/typescript/module/src/types.d.ts.map +1 -0
  368. package/lib/typescript/module/src/useChildListeners.d.ts +12 -0
  369. package/lib/typescript/module/src/useChildListeners.d.ts.map +1 -0
  370. package/lib/typescript/module/src/useComponent.d.ts +7 -0
  371. package/lib/typescript/module/src/useComponent.d.ts.map +1 -0
  372. package/lib/typescript/module/src/useCurrentRender.d.ts +14 -0
  373. package/lib/typescript/module/src/useCurrentRender.d.ts.map +1 -0
  374. package/lib/typescript/module/src/useDescriptors.d.ts +133 -0
  375. package/lib/typescript/module/src/useDescriptors.d.ts.map +1 -0
  376. package/lib/typescript/module/src/useEventEmitter.d.ts +9 -0
  377. package/lib/typescript/module/src/useEventEmitter.d.ts.map +1 -0
  378. package/lib/typescript/module/src/useFocusEffect.d.ts +11 -0
  379. package/lib/typescript/module/src/useFocusEffect.d.ts.map +1 -0
  380. package/lib/typescript/module/src/useFocusEvents.d.ts +13 -0
  381. package/lib/typescript/module/src/useFocusEvents.d.ts.map +1 -0
  382. package/lib/typescript/module/src/useFocusedListenersChildrenAdapter.d.ts +13 -0
  383. package/lib/typescript/module/src/useFocusedListenersChildrenAdapter.d.ts.map +1 -0
  384. package/lib/typescript/module/src/useIsFocused.d.ts +6 -0
  385. package/lib/typescript/module/src/useIsFocused.d.ts.map +1 -0
  386. package/lib/typescript/module/src/useIsomorphicLayoutEffect.d.ts +6 -0
  387. package/lib/typescript/module/src/useIsomorphicLayoutEffect.d.ts.map +1 -0
  388. package/lib/typescript/module/src/useIsomorphicLayoutEffect.native.d.ts +3 -0
  389. package/lib/typescript/module/src/useIsomorphicLayoutEffect.native.d.ts.map +1 -0
  390. package/lib/typescript/module/src/useKeyedChildListeners.d.ts +12 -0
  391. package/lib/typescript/module/src/useKeyedChildListeners.d.ts.map +1 -0
  392. package/lib/typescript/module/src/useLazyValue.d.ts +2 -0
  393. package/lib/typescript/module/src/useLazyValue.d.ts.map +1 -0
  394. package/lib/typescript/module/src/useNavigation.d.ts +11 -0
  395. package/lib/typescript/module/src/useNavigation.d.ts.map +1 -0
  396. package/lib/typescript/module/src/useNavigationBuilder.d.ts +181 -0
  397. package/lib/typescript/module/src/useNavigationBuilder.d.ts.map +1 -0
  398. package/lib/typescript/module/src/useNavigationCache.d.ts +65 -0
  399. package/lib/typescript/module/src/useNavigationCache.d.ts.map +1 -0
  400. package/lib/typescript/module/src/useNavigationContainerRef.d.ts +3 -0
  401. package/lib/typescript/module/src/useNavigationContainerRef.d.ts.map +1 -0
  402. package/lib/typescript/module/src/useNavigationHelpers.d.ts +96 -0
  403. package/lib/typescript/module/src/useNavigationHelpers.d.ts.map +1 -0
  404. package/lib/typescript/module/src/useNavigationIndependentTree.d.ts +2 -0
  405. package/lib/typescript/module/src/useNavigationIndependentTree.d.ts.map +1 -0
  406. package/lib/typescript/module/src/useNavigationState.d.ts +10 -0
  407. package/lib/typescript/module/src/useNavigationState.d.ts.map +1 -0
  408. package/lib/typescript/module/src/useOnAction.d.ts +26 -0
  409. package/lib/typescript/module/src/useOnAction.d.ts.map +1 -0
  410. package/lib/typescript/module/src/useOnGetState.d.ts +9 -0
  411. package/lib/typescript/module/src/useOnGetState.d.ts.map +1 -0
  412. package/lib/typescript/module/src/useOnPreventRemove.d.ts +17 -0
  413. package/lib/typescript/module/src/useOnPreventRemove.d.ts.map +1 -0
  414. package/lib/typescript/module/src/useOnRouteFocus.d.ts +15 -0
  415. package/lib/typescript/module/src/useOnRouteFocus.d.ts.map +1 -0
  416. package/lib/typescript/module/src/useOptionsGetters.d.ts +13 -0
  417. package/lib/typescript/module/src/useOptionsGetters.d.ts.map +1 -0
  418. package/lib/typescript/module/src/usePreventRemove.d.ts +13 -0
  419. package/lib/typescript/module/src/usePreventRemove.d.ts.map +1 -0
  420. package/lib/typescript/module/src/usePreventRemoveContext.d.ts +5 -0
  421. package/lib/typescript/module/src/usePreventRemoveContext.d.ts.map +1 -0
  422. package/lib/typescript/module/src/useRegisterNavigator.d.ts +6 -0
  423. package/lib/typescript/module/src/useRegisterNavigator.d.ts.map +1 -0
  424. package/lib/typescript/module/src/useRoute.d.ts +9 -0
  425. package/lib/typescript/module/src/useRoute.d.ts.map +1 -0
  426. package/lib/typescript/module/src/useRouteCache.d.ts +14 -0
  427. package/lib/typescript/module/src/useRouteCache.d.ts.map +1 -0
  428. package/lib/typescript/module/src/useSyncState.d.ts +2 -0
  429. package/lib/typescript/module/src/useSyncState.d.ts.map +1 -0
  430. package/lib/typescript/module/src/validatePathConfig.d.ts +2 -0
  431. package/lib/typescript/module/src/validatePathConfig.d.ts.map +1 -0
  432. package/lib/typescript/module/tsconfig.build.tsbuildinfo +1 -0
  433. package/package.json +18 -11
  434. package/src/BaseNavigationContainer.tsx +1 -1
  435. package/src/StaticNavigation.tsx +49 -30
  436. package/src/getPathFromState.tsx +20 -4
  437. package/src/getStateFromPath.tsx +124 -63
  438. package/src/types.tsx +33 -46
  439. package/src/useNavigationBuilder.tsx +1 -1
  440. package/src/validatePathConfig.tsx +1 -1
  441. package/lib/commonjs/BaseNavigationContainer.cjs +0 -356
  442. package/lib/commonjs/BaseNavigationContainer.cjs.map +0 -1
  443. package/lib/commonjs/CurrentRenderContext.cjs +0 -15
  444. package/lib/commonjs/DeprecatedNavigationInChildContext.cjs +0 -14
  445. package/lib/commonjs/EnsureSingleNavigator.cjs +0 -43
  446. package/lib/commonjs/Group.cjs +0 -14
  447. package/lib/commonjs/NavigationBuilderContext.cjs +0 -17
  448. package/lib/commonjs/NavigationContainerRefContext.cjs +0 -14
  449. package/lib/commonjs/NavigationContext.cjs +0 -14
  450. package/lib/commonjs/NavigationHelpersContext.cjs +0 -15
  451. package/lib/commonjs/NavigationIndependentTree.cjs +0 -35
  452. package/lib/commonjs/NavigationIndependentTreeContext.cjs +0 -14
  453. package/lib/commonjs/NavigationRouteContext.cjs +0 -14
  454. package/lib/commonjs/NavigationStateContext.cjs +0 -29
  455. package/lib/commonjs/PreventRemoveContext.cjs +0 -16
  456. package/lib/commonjs/PreventRemoveProvider.cjs +0 -91
  457. package/lib/commonjs/SceneView.cjs +0 -96
  458. package/lib/commonjs/Screen.cjs +0 -14
  459. package/lib/commonjs/StaticContainer.cjs +0 -31
  460. package/lib/commonjs/StaticNavigation.cjs +0 -239
  461. package/lib/commonjs/StaticNavigation.cjs.map +0 -1
  462. package/lib/commonjs/UnhandledActionContext.cjs +0 -11
  463. package/lib/commonjs/checkDuplicateRouteNames.cjs +0 -25
  464. package/lib/commonjs/checkSerializable.cjs +0 -50
  465. package/lib/commonjs/createNavigationContainerRef.cjs +0 -69
  466. package/lib/commonjs/createNavigatorFactory.cjs +0 -34
  467. package/lib/commonjs/deepFreeze.cjs +0 -37
  468. package/lib/commonjs/findFocusedRoute.cjs +0 -15
  469. package/lib/commonjs/getActionFromState.cjs +0 -86
  470. package/lib/commonjs/getFocusedRouteNameFromRoute.cjs +0 -22
  471. package/lib/commonjs/getPathFromState.cjs +0 -211
  472. package/lib/commonjs/getPathFromState.cjs.map +0 -1
  473. package/lib/commonjs/getStateFromPath.cjs +0 -438
  474. package/lib/commonjs/getStateFromPath.cjs.map +0 -1
  475. package/lib/commonjs/index.cjs +0 -287
  476. package/lib/commonjs/isArrayEqual.cjs +0 -20
  477. package/lib/commonjs/isRecordEqual.cjs +0 -21
  478. package/lib/commonjs/theming/ThemeContext.cjs +0 -12
  479. package/lib/commonjs/theming/ThemeProvider.cjs +0 -21
  480. package/lib/commonjs/theming/useTheme.cjs +0 -18
  481. package/lib/commonjs/types.cjs +0 -9
  482. package/lib/commonjs/types.cjs.map +0 -1
  483. package/lib/commonjs/useChildListeners.cjs +0 -36
  484. package/lib/commonjs/useComponent.cjs +0 -40
  485. package/lib/commonjs/useCurrentRender.cjs +0 -25
  486. package/lib/commonjs/useDescriptors.cjs +0 -188
  487. package/lib/commonjs/useEventEmitter.cjs +0 -105
  488. package/lib/commonjs/useFocusEffect.cjs +0 -80
  489. package/lib/commonjs/useFocusEvents.cjs +0 -70
  490. package/lib/commonjs/useFocusedListenersChildrenAdapter.cjs +0 -48
  491. package/lib/commonjs/useIsFocused.cjs +0 -28
  492. package/lib/commonjs/useIsomorphicLayoutEffect.cjs +0 -12
  493. package/lib/commonjs/useIsomorphicLayoutEffect.native.cjs +0 -9
  494. package/lib/commonjs/useKeyedChildListeners.cjs +0 -33
  495. package/lib/commonjs/useLazyValue.cjs +0 -17
  496. package/lib/commonjs/useNavigation.cjs +0 -27
  497. package/lib/commonjs/useNavigationBuilder.cjs +0 -478
  498. package/lib/commonjs/useNavigationCache.cjs +0 -162
  499. package/lib/commonjs/useNavigationContainerRef.cjs +0 -18
  500. package/lib/commonjs/useNavigationHelpers.cjs +0 -76
  501. package/lib/commonjs/useNavigationIndependentTree.cjs +0 -14
  502. package/lib/commonjs/useNavigationState.cjs +0 -26
  503. package/lib/commonjs/useOnAction.cjs +0 -106
  504. package/lib/commonjs/useOnGetState.cjs +0 -48
  505. package/lib/commonjs/useOnPreventRemove.cjs +0 -72
  506. package/lib/commonjs/useOnRouteFocus.cjs +0 -36
  507. package/lib/commonjs/useOptionsGetters.cjs +0 -78
  508. package/lib/commonjs/usePreventRemove.cjs +0 -48
  509. package/lib/commonjs/usePreventRemoveContext.cjs +0 -18
  510. package/lib/commonjs/useRegisterNavigator.cjs +0 -32
  511. package/lib/commonjs/useRoute.cjs +0 -23
  512. package/lib/commonjs/useRouteCache.cjs +0 -69
  513. package/lib/commonjs/useSyncState.cjs +0 -48
  514. package/lib/commonjs/validatePathConfig.cjs +0 -49
  515. package/lib/commonjs/validatePathConfig.cjs.map +0 -1
  516. package/lib/module/BaseNavigationContainer.mjs +0 -347
  517. package/lib/module/BaseNavigationContainer.mjs.map +0 -1
  518. package/lib/module/CurrentRenderContext.mjs +0 -8
  519. package/lib/module/CurrentRenderContext.mjs.map +0 -1
  520. package/lib/module/DeprecatedNavigationInChildContext.mjs +0 -7
  521. package/lib/module/DeprecatedNavigationInChildContext.mjs.map +0 -1
  522. package/lib/module/EnsureSingleNavigator.mjs +0 -34
  523. package/lib/module/EnsureSingleNavigator.mjs.map +0 -1
  524. package/lib/module/Group.mjs +0 -8
  525. package/lib/module/Group.mjs.map +0 -1
  526. package/lib/module/NavigationBuilderContext.mjs +0 -9
  527. package/lib/module/NavigationBuilderContext.mjs.map +0 -1
  528. package/lib/module/NavigationContainerRefContext.mjs +0 -6
  529. package/lib/module/NavigationContainerRefContext.mjs.map +0 -1
  530. package/lib/module/NavigationContext.mjs +0 -6
  531. package/lib/module/NavigationContext.mjs.map +0 -1
  532. package/lib/module/NavigationHelpersContext.mjs +0 -7
  533. package/lib/module/NavigationHelpersContext.mjs.map +0 -1
  534. package/lib/module/NavigationIndependentTree.mjs +0 -28
  535. package/lib/module/NavigationIndependentTree.mjs.map +0 -1
  536. package/lib/module/NavigationIndependentTreeContext.mjs +0 -7
  537. package/lib/module/NavigationIndependentTreeContext.mjs.map +0 -1
  538. package/lib/module/NavigationRouteContext.mjs +0 -7
  539. package/lib/module/NavigationRouteContext.mjs.map +0 -1
  540. package/lib/module/NavigationStateContext.mjs +0 -21
  541. package/lib/module/NavigationStateContext.mjs.map +0 -1
  542. package/lib/module/PreventRemoveContext.mjs +0 -9
  543. package/lib/module/PreventRemoveContext.mjs.map +0 -1
  544. package/lib/module/PreventRemoveProvider.mjs +0 -82
  545. package/lib/module/PreventRemoveProvider.mjs.map +0 -1
  546. package/lib/module/SceneView.mjs +0 -88
  547. package/lib/module/SceneView.mjs.map +0 -1
  548. package/lib/module/Screen.mjs +0 -8
  549. package/lib/module/Screen.mjs.map +0 -1
  550. package/lib/module/StaticContainer.mjs +0 -24
  551. package/lib/module/StaticContainer.mjs.map +0 -1
  552. package/lib/module/StaticNavigation.mjs +0 -230
  553. package/lib/module/StaticNavigation.mjs.map +0 -1
  554. package/lib/module/UnhandledActionContext.mjs +0 -3
  555. package/lib/module/UnhandledActionContext.mjs.map +0 -1
  556. package/lib/module/checkDuplicateRouteNames.mjs +0 -19
  557. package/lib/module/checkDuplicateRouteNames.mjs.map +0 -1
  558. package/lib/module/checkSerializable.mjs +0 -44
  559. package/lib/module/checkSerializable.mjs.map +0 -1
  560. package/lib/module/createNavigationContainerRef.mjs +0 -62
  561. package/lib/module/createNavigationContainerRef.mjs.map +0 -1
  562. package/lib/module/createNavigatorFactory.mjs +0 -29
  563. package/lib/module/createNavigatorFactory.mjs.map +0 -1
  564. package/lib/module/deepFreeze.mjs +0 -29
  565. package/lib/module/deepFreeze.mjs.map +0 -1
  566. package/lib/module/findFocusedRoute.mjs +0 -9
  567. package/lib/module/findFocusedRoute.mjs.map +0 -1
  568. package/lib/module/getActionFromState.mjs +0 -80
  569. package/lib/module/getActionFromState.mjs.map +0 -1
  570. package/lib/module/getFocusedRouteNameFromRoute.mjs +0 -16
  571. package/lib/module/getFocusedRouteNameFromRoute.mjs.map +0 -1
  572. package/lib/module/getPathFromState.mjs +0 -203
  573. package/lib/module/getPathFromState.mjs.map +0 -1
  574. package/lib/module/getStateFromPath.mjs +0 -429
  575. package/lib/module/getStateFromPath.mjs.map +0 -1
  576. package/lib/module/index.mjs +0 -34
  577. package/lib/module/index.mjs.map +0 -1
  578. package/lib/module/isArrayEqual.mjs +0 -14
  579. package/lib/module/isArrayEqual.mjs.map +0 -1
  580. package/lib/module/isRecordEqual.mjs +0 -15
  581. package/lib/module/isRecordEqual.mjs.map +0 -1
  582. package/lib/module/theming/ThemeContext.mjs +0 -4
  583. package/lib/module/theming/ThemeContext.mjs.map +0 -1
  584. package/lib/module/theming/ThemeProvider.mjs +0 -13
  585. package/lib/module/theming/ThemeProvider.mjs.map +0 -1
  586. package/lib/module/theming/useTheme.mjs +0 -10
  587. package/lib/module/theming/useTheme.mjs.map +0 -1
  588. package/lib/module/types.mjs +0 -2
  589. package/lib/module/types.mjs.map +0 -1
  590. package/lib/module/useChildListeners.mjs +0 -28
  591. package/lib/module/useChildListeners.mjs.map +0 -1
  592. package/lib/module/useComponent.mjs +0 -32
  593. package/lib/module/useComponent.mjs.map +0 -1
  594. package/lib/module/useCurrentRender.mjs +0 -17
  595. package/lib/module/useCurrentRender.mjs.map +0 -1
  596. package/lib/module/useDescriptors.mjs +0 -180
  597. package/lib/module/useDescriptors.mjs.map +0 -1
  598. package/lib/module/useEventEmitter.mjs +0 -97
  599. package/lib/module/useEventEmitter.mjs.map +0 -1
  600. package/lib/module/useFocusEffect.mjs +0 -72
  601. package/lib/module/useFocusEffect.mjs.map +0 -1
  602. package/lib/module/useFocusEvents.mjs +0 -62
  603. package/lib/module/useFocusEvents.mjs.map +0 -1
  604. package/lib/module/useFocusedListenersChildrenAdapter.mjs +0 -40
  605. package/lib/module/useFocusedListenersChildrenAdapter.mjs.map +0 -1
  606. package/lib/module/useIsFocused.mjs +0 -21
  607. package/lib/module/useIsFocused.mjs.map +0 -1
  608. package/lib/module/useIsomorphicLayoutEffect.mjs +0 -7
  609. package/lib/module/useIsomorphicLayoutEffect.mjs.map +0 -1
  610. package/lib/module/useIsomorphicLayoutEffect.native.mjs +0 -3
  611. package/lib/module/useIsomorphicLayoutEffect.native.mjs.map +0 -1
  612. package/lib/module/useKeyedChildListeners.mjs +0 -25
  613. package/lib/module/useKeyedChildListeners.mjs.map +0 -1
  614. package/lib/module/useLazyValue.mjs +0 -9
  615. package/lib/module/useLazyValue.mjs.map +0 -1
  616. package/lib/module/useNavigation.mjs +0 -19
  617. package/lib/module/useNavigation.mjs.map +0 -1
  618. package/lib/module/useNavigationBuilder.mjs +0 -470
  619. package/lib/module/useNavigationBuilder.mjs.map +0 -1
  620. package/lib/module/useNavigationCache.mjs +0 -154
  621. package/lib/module/useNavigationCache.mjs.map +0 -1
  622. package/lib/module/useNavigationContainerRef.mjs +0 -10
  623. package/lib/module/useNavigationContainerRef.mjs.map +0 -1
  624. package/lib/module/useNavigationHelpers.mjs +0 -68
  625. package/lib/module/useNavigationHelpers.mjs.map +0 -1
  626. package/lib/module/useNavigationIndependentTree.mjs +0 -6
  627. package/lib/module/useNavigationIndependentTree.mjs.map +0 -1
  628. package/lib/module/useNavigationState.mjs +0 -18
  629. package/lib/module/useNavigationState.mjs.map +0 -1
  630. package/lib/module/useOnAction.mjs +0 -98
  631. package/lib/module/useOnAction.mjs.map +0 -1
  632. package/lib/module/useOnGetState.mjs +0 -40
  633. package/lib/module/useOnGetState.mjs.map +0 -1
  634. package/lib/module/useOnPreventRemove.mjs +0 -62
  635. package/lib/module/useOnPreventRemove.mjs.map +0 -1
  636. package/lib/module/useOnRouteFocus.mjs +0 -28
  637. package/lib/module/useOnRouteFocus.mjs.map +0 -1
  638. package/lib/module/useOptionsGetters.mjs +0 -70
  639. package/lib/module/useOptionsGetters.mjs.map +0 -1
  640. package/lib/module/usePreventRemove.mjs +0 -40
  641. package/lib/module/usePreventRemove.mjs.map +0 -1
  642. package/lib/module/usePreventRemoveContext.mjs +0 -10
  643. package/lib/module/usePreventRemoveContext.mjs.map +0 -1
  644. package/lib/module/useRegisterNavigator.mjs +0 -25
  645. package/lib/module/useRegisterNavigator.mjs.map +0 -1
  646. package/lib/module/useRoute.mjs +0 -15
  647. package/lib/module/useRoute.mjs.map +0 -1
  648. package/lib/module/useRouteCache.mjs +0 -60
  649. package/lib/module/useRouteCache.mjs.map +0 -1
  650. package/lib/module/useSyncState.mjs +0 -40
  651. package/lib/module/useSyncState.mjs.map +0 -1
  652. package/lib/module/validatePathConfig.mjs +0 -43
  653. package/lib/module/validatePathConfig.mjs.map +0 -1
  654. package/lib/typescript/src/BaseNavigationContainer.d.ts.map +0 -1
  655. package/lib/typescript/src/CurrentRenderContext.d.ts.map +0 -1
  656. package/lib/typescript/src/DeprecatedNavigationInChildContext.d.ts.map +0 -1
  657. package/lib/typescript/src/EnsureSingleNavigator.d.ts.map +0 -1
  658. package/lib/typescript/src/Group.d.ts.map +0 -1
  659. package/lib/typescript/src/NavigationBuilderContext.d.ts.map +0 -1
  660. package/lib/typescript/src/NavigationContainerRefContext.d.ts.map +0 -1
  661. package/lib/typescript/src/NavigationContext.d.ts.map +0 -1
  662. package/lib/typescript/src/NavigationHelpersContext.d.ts.map +0 -1
  663. package/lib/typescript/src/NavigationIndependentTree.d.ts.map +0 -1
  664. package/lib/typescript/src/NavigationIndependentTreeContext.d.ts.map +0 -1
  665. package/lib/typescript/src/NavigationRouteContext.d.ts.map +0 -1
  666. package/lib/typescript/src/NavigationStateContext.d.ts.map +0 -1
  667. package/lib/typescript/src/PreventRemoveContext.d.ts.map +0 -1
  668. package/lib/typescript/src/PreventRemoveProvider.d.ts.map +0 -1
  669. package/lib/typescript/src/SceneView.d.ts.map +0 -1
  670. package/lib/typescript/src/Screen.d.ts.map +0 -1
  671. package/lib/typescript/src/StaticContainer.d.ts.map +0 -1
  672. package/lib/typescript/src/StaticNavigation.d.ts +0 -190
  673. package/lib/typescript/src/StaticNavigation.d.ts.map +0 -1
  674. package/lib/typescript/src/UnhandledActionContext.d.ts.map +0 -1
  675. package/lib/typescript/src/checkDuplicateRouteNames.d.ts.map +0 -1
  676. package/lib/typescript/src/checkSerializable.d.ts.map +0 -1
  677. package/lib/typescript/src/createNavigationContainerRef.d.ts.map +0 -1
  678. package/lib/typescript/src/createNavigatorFactory.d.ts.map +0 -1
  679. package/lib/typescript/src/deepFreeze.d.ts.map +0 -1
  680. package/lib/typescript/src/findFocusedRoute.d.ts.map +0 -1
  681. package/lib/typescript/src/getActionFromState.d.ts.map +0 -1
  682. package/lib/typescript/src/getFocusedRouteNameFromRoute.d.ts.map +0 -1
  683. package/lib/typescript/src/getPathFromState.d.ts.map +0 -1
  684. package/lib/typescript/src/getStateFromPath.d.ts.map +0 -1
  685. package/lib/typescript/src/index.d.ts.map +0 -1
  686. package/lib/typescript/src/isArrayEqual.d.ts.map +0 -1
  687. package/lib/typescript/src/isRecordEqual.d.ts.map +0 -1
  688. package/lib/typescript/src/theming/ThemeContext.d.ts.map +0 -1
  689. package/lib/typescript/src/theming/ThemeProvider.d.ts.map +0 -1
  690. package/lib/typescript/src/theming/useTheme.d.ts.map +0 -1
  691. package/lib/typescript/src/types.d.ts +0 -695
  692. package/lib/typescript/src/types.d.ts.map +0 -1
  693. package/lib/typescript/src/useChildListeners.d.ts.map +0 -1
  694. package/lib/typescript/src/useComponent.d.ts.map +0 -1
  695. package/lib/typescript/src/useCurrentRender.d.ts.map +0 -1
  696. package/lib/typescript/src/useDescriptors.d.ts +0 -133
  697. package/lib/typescript/src/useDescriptors.d.ts.map +0 -1
  698. package/lib/typescript/src/useEventEmitter.d.ts.map +0 -1
  699. package/lib/typescript/src/useFocusEffect.d.ts.map +0 -1
  700. package/lib/typescript/src/useFocusEvents.d.ts.map +0 -1
  701. package/lib/typescript/src/useFocusedListenersChildrenAdapter.d.ts.map +0 -1
  702. package/lib/typescript/src/useIsFocused.d.ts.map +0 -1
  703. package/lib/typescript/src/useIsomorphicLayoutEffect.d.ts.map +0 -1
  704. package/lib/typescript/src/useIsomorphicLayoutEffect.native.d.ts.map +0 -1
  705. package/lib/typescript/src/useKeyedChildListeners.d.ts.map +0 -1
  706. package/lib/typescript/src/useLazyValue.d.ts.map +0 -1
  707. package/lib/typescript/src/useNavigation.d.ts.map +0 -1
  708. package/lib/typescript/src/useNavigationBuilder.d.ts +0 -181
  709. package/lib/typescript/src/useNavigationBuilder.d.ts.map +0 -1
  710. package/lib/typescript/src/useNavigationCache.d.ts +0 -65
  711. package/lib/typescript/src/useNavigationCache.d.ts.map +0 -1
  712. package/lib/typescript/src/useNavigationContainerRef.d.ts.map +0 -1
  713. package/lib/typescript/src/useNavigationHelpers.d.ts +0 -96
  714. package/lib/typescript/src/useNavigationHelpers.d.ts.map +0 -1
  715. package/lib/typescript/src/useNavigationIndependentTree.d.ts.map +0 -1
  716. package/lib/typescript/src/useNavigationState.d.ts.map +0 -1
  717. package/lib/typescript/src/useOnAction.d.ts.map +0 -1
  718. package/lib/typescript/src/useOnGetState.d.ts.map +0 -1
  719. package/lib/typescript/src/useOnPreventRemove.d.ts.map +0 -1
  720. package/lib/typescript/src/useOnRouteFocus.d.ts.map +0 -1
  721. package/lib/typescript/src/useOptionsGetters.d.ts.map +0 -1
  722. package/lib/typescript/src/usePreventRemove.d.ts.map +0 -1
  723. package/lib/typescript/src/usePreventRemoveContext.d.ts.map +0 -1
  724. package/lib/typescript/src/useRegisterNavigator.d.ts.map +0 -1
  725. package/lib/typescript/src/useRoute.d.ts.map +0 -1
  726. package/lib/typescript/src/useRouteCache.d.ts.map +0 -1
  727. package/lib/typescript/src/useSyncState.d.ts.map +0 -1
  728. package/lib/typescript/src/validatePathConfig.d.ts.map +0 -1
  729. package/lib/typescript/utils/usePrevious.d.ts +0 -6
  730. package/lib/typescript/utils/usePrevious.d.ts.map +0 -1
  731. /package/lib/commonjs/{CurrentRenderContext.cjs.map → CurrentRenderContext.js.map} +0 -0
  732. /package/lib/commonjs/{DeprecatedNavigationInChildContext.cjs.map → DeprecatedNavigationInChildContext.js.map} +0 -0
  733. /package/lib/commonjs/{EnsureSingleNavigator.cjs.map → EnsureSingleNavigator.js.map} +0 -0
  734. /package/lib/commonjs/{Group.cjs.map → Group.js.map} +0 -0
  735. /package/lib/commonjs/{NavigationBuilderContext.cjs.map → NavigationBuilderContext.js.map} +0 -0
  736. /package/lib/commonjs/{NavigationContainerRefContext.cjs.map → NavigationContainerRefContext.js.map} +0 -0
  737. /package/lib/commonjs/{NavigationContext.cjs.map → NavigationContext.js.map} +0 -0
  738. /package/lib/commonjs/{NavigationHelpersContext.cjs.map → NavigationHelpersContext.js.map} +0 -0
  739. /package/lib/commonjs/{NavigationIndependentTree.cjs.map → NavigationIndependentTree.js.map} +0 -0
  740. /package/lib/commonjs/{NavigationIndependentTreeContext.cjs.map → NavigationIndependentTreeContext.js.map} +0 -0
  741. /package/lib/commonjs/{NavigationRouteContext.cjs.map → NavigationRouteContext.js.map} +0 -0
  742. /package/lib/commonjs/{NavigationStateContext.cjs.map → NavigationStateContext.js.map} +0 -0
  743. /package/lib/commonjs/{PreventRemoveContext.cjs.map → PreventRemoveContext.js.map} +0 -0
  744. /package/lib/commonjs/{PreventRemoveProvider.cjs.map → PreventRemoveProvider.js.map} +0 -0
  745. /package/lib/commonjs/{SceneView.cjs.map → SceneView.js.map} +0 -0
  746. /package/lib/commonjs/{Screen.cjs.map → Screen.js.map} +0 -0
  747. /package/lib/commonjs/{StaticContainer.cjs.map → StaticContainer.js.map} +0 -0
  748. /package/lib/commonjs/{UnhandledActionContext.cjs.map → UnhandledActionContext.js.map} +0 -0
  749. /package/lib/commonjs/{checkDuplicateRouteNames.cjs.map → checkDuplicateRouteNames.js.map} +0 -0
  750. /package/lib/commonjs/{checkSerializable.cjs.map → checkSerializable.js.map} +0 -0
  751. /package/lib/commonjs/{createNavigationContainerRef.cjs.map → createNavigationContainerRef.js.map} +0 -0
  752. /package/lib/commonjs/{createNavigatorFactory.cjs.map → createNavigatorFactory.js.map} +0 -0
  753. /package/lib/commonjs/{deepFreeze.cjs.map → deepFreeze.js.map} +0 -0
  754. /package/lib/commonjs/{findFocusedRoute.cjs.map → findFocusedRoute.js.map} +0 -0
  755. /package/lib/commonjs/{getActionFromState.cjs.map → getActionFromState.js.map} +0 -0
  756. /package/lib/commonjs/{getFocusedRouteNameFromRoute.cjs.map → getFocusedRouteNameFromRoute.js.map} +0 -0
  757. /package/lib/commonjs/{index.cjs.map → index.js.map} +0 -0
  758. /package/lib/commonjs/{isArrayEqual.cjs.map → isArrayEqual.js.map} +0 -0
  759. /package/lib/commonjs/{isRecordEqual.cjs.map → isRecordEqual.js.map} +0 -0
  760. /package/lib/commonjs/theming/{ThemeContext.cjs.map → ThemeContext.js.map} +0 -0
  761. /package/lib/commonjs/theming/{ThemeProvider.cjs.map → ThemeProvider.js.map} +0 -0
  762. /package/lib/commonjs/theming/{useTheme.cjs.map → useTheme.js.map} +0 -0
  763. /package/lib/commonjs/{useChildListeners.cjs.map → useChildListeners.js.map} +0 -0
  764. /package/lib/commonjs/{useComponent.cjs.map → useComponent.js.map} +0 -0
  765. /package/lib/commonjs/{useCurrentRender.cjs.map → useCurrentRender.js.map} +0 -0
  766. /package/lib/commonjs/{useDescriptors.cjs.map → useDescriptors.js.map} +0 -0
  767. /package/lib/commonjs/{useEventEmitter.cjs.map → useEventEmitter.js.map} +0 -0
  768. /package/lib/commonjs/{useFocusEffect.cjs.map → useFocusEffect.js.map} +0 -0
  769. /package/lib/commonjs/{useFocusEvents.cjs.map → useFocusEvents.js.map} +0 -0
  770. /package/lib/commonjs/{useFocusedListenersChildrenAdapter.cjs.map → useFocusedListenersChildrenAdapter.js.map} +0 -0
  771. /package/lib/commonjs/{useIsFocused.cjs.map → useIsFocused.js.map} +0 -0
  772. /package/lib/commonjs/{useIsomorphicLayoutEffect.cjs.map → useIsomorphicLayoutEffect.js.map} +0 -0
  773. /package/lib/commonjs/{useIsomorphicLayoutEffect.native.cjs.map → useIsomorphicLayoutEffect.native.js.map} +0 -0
  774. /package/lib/commonjs/{useKeyedChildListeners.cjs.map → useKeyedChildListeners.js.map} +0 -0
  775. /package/lib/commonjs/{useLazyValue.cjs.map → useLazyValue.js.map} +0 -0
  776. /package/lib/commonjs/{useNavigation.cjs.map → useNavigation.js.map} +0 -0
  777. /package/lib/commonjs/{useNavigationBuilder.cjs.map → useNavigationBuilder.js.map} +0 -0
  778. /package/lib/commonjs/{useNavigationCache.cjs.map → useNavigationCache.js.map} +0 -0
  779. /package/lib/commonjs/{useNavigationContainerRef.cjs.map → useNavigationContainerRef.js.map} +0 -0
  780. /package/lib/commonjs/{useNavigationHelpers.cjs.map → useNavigationHelpers.js.map} +0 -0
  781. /package/lib/commonjs/{useNavigationIndependentTree.cjs.map → useNavigationIndependentTree.js.map} +0 -0
  782. /package/lib/commonjs/{useNavigationState.cjs.map → useNavigationState.js.map} +0 -0
  783. /package/lib/commonjs/{useOnAction.cjs.map → useOnAction.js.map} +0 -0
  784. /package/lib/commonjs/{useOnGetState.cjs.map → useOnGetState.js.map} +0 -0
  785. /package/lib/commonjs/{useOnPreventRemove.cjs.map → useOnPreventRemove.js.map} +0 -0
  786. /package/lib/commonjs/{useOnRouteFocus.cjs.map → useOnRouteFocus.js.map} +0 -0
  787. /package/lib/commonjs/{useOptionsGetters.cjs.map → useOptionsGetters.js.map} +0 -0
  788. /package/lib/commonjs/{usePreventRemove.cjs.map → usePreventRemove.js.map} +0 -0
  789. /package/lib/commonjs/{usePreventRemoveContext.cjs.map → usePreventRemoveContext.js.map} +0 -0
  790. /package/lib/commonjs/{useRegisterNavigator.cjs.map → useRegisterNavigator.js.map} +0 -0
  791. /package/lib/commonjs/{useRoute.cjs.map → useRoute.js.map} +0 -0
  792. /package/lib/commonjs/{useRouteCache.cjs.map → useRouteCache.js.map} +0 -0
  793. /package/lib/commonjs/{useSyncState.cjs.map → useSyncState.js.map} +0 -0
  794. /package/lib/typescript/{src → commonjs/src}/BaseNavigationContainer.d.ts +0 -0
  795. /package/lib/typescript/{src → commonjs/src}/CurrentRenderContext.d.ts +0 -0
  796. /package/lib/typescript/{src → commonjs/src}/DeprecatedNavigationInChildContext.d.ts +0 -0
  797. /package/lib/typescript/{src → commonjs/src}/EnsureSingleNavigator.d.ts +0 -0
  798. /package/lib/typescript/{src → commonjs/src}/Group.d.ts +0 -0
  799. /package/lib/typescript/{src → commonjs/src}/NavigationBuilderContext.d.ts +0 -0
  800. /package/lib/typescript/{src → commonjs/src}/NavigationContainerRefContext.d.ts +0 -0
  801. /package/lib/typescript/{src → commonjs/src}/NavigationContext.d.ts +0 -0
  802. /package/lib/typescript/{src → commonjs/src}/NavigationHelpersContext.d.ts +0 -0
  803. /package/lib/typescript/{src → commonjs/src}/NavigationIndependentTree.d.ts +0 -0
  804. /package/lib/typescript/{src → commonjs/src}/NavigationIndependentTreeContext.d.ts +0 -0
  805. /package/lib/typescript/{src → commonjs/src}/NavigationRouteContext.d.ts +0 -0
  806. /package/lib/typescript/{src → commonjs/src}/NavigationStateContext.d.ts +0 -0
  807. /package/lib/typescript/{src → commonjs/src}/PreventRemoveContext.d.ts +0 -0
  808. /package/lib/typescript/{src → commonjs/src}/PreventRemoveProvider.d.ts +0 -0
  809. /package/lib/typescript/{src → commonjs/src}/SceneView.d.ts +0 -0
  810. /package/lib/typescript/{src → commonjs/src}/Screen.d.ts +0 -0
  811. /package/lib/typescript/{src → commonjs/src}/StaticContainer.d.ts +0 -0
  812. /package/lib/typescript/{src → commonjs/src}/UnhandledActionContext.d.ts +0 -0
  813. /package/lib/typescript/{src → commonjs/src}/checkDuplicateRouteNames.d.ts +0 -0
  814. /package/lib/typescript/{src → commonjs/src}/checkSerializable.d.ts +0 -0
  815. /package/lib/typescript/{src → commonjs/src}/createNavigationContainerRef.d.ts +0 -0
  816. /package/lib/typescript/{src → commonjs/src}/createNavigatorFactory.d.ts +0 -0
  817. /package/lib/typescript/{src → commonjs/src}/deepFreeze.d.ts +0 -0
  818. /package/lib/typescript/{src → commonjs/src}/findFocusedRoute.d.ts +0 -0
  819. /package/lib/typescript/{src → commonjs/src}/getActionFromState.d.ts +0 -0
  820. /package/lib/typescript/{src → commonjs/src}/getFocusedRouteNameFromRoute.d.ts +0 -0
  821. /package/lib/typescript/{src → commonjs/src}/getPathFromState.d.ts +0 -0
  822. /package/lib/typescript/{src → commonjs/src}/getStateFromPath.d.ts +0 -0
  823. /package/lib/typescript/{src → commonjs/src}/index.d.ts +0 -0
  824. /package/lib/typescript/{src → commonjs/src}/isArrayEqual.d.ts +0 -0
  825. /package/lib/typescript/{src → commonjs/src}/isRecordEqual.d.ts +0 -0
  826. /package/lib/typescript/{src → commonjs/src}/theming/ThemeContext.d.ts +0 -0
  827. /package/lib/typescript/{src → commonjs/src}/theming/ThemeProvider.d.ts +0 -0
  828. /package/lib/typescript/{src → commonjs/src}/theming/useTheme.d.ts +0 -0
  829. /package/lib/typescript/{src → commonjs/src}/useChildListeners.d.ts +0 -0
  830. /package/lib/typescript/{src → commonjs/src}/useComponent.d.ts +0 -0
  831. /package/lib/typescript/{src → commonjs/src}/useCurrentRender.d.ts +0 -0
  832. /package/lib/typescript/{src → commonjs/src}/useEventEmitter.d.ts +0 -0
  833. /package/lib/typescript/{src → commonjs/src}/useFocusEffect.d.ts +0 -0
  834. /package/lib/typescript/{src → commonjs/src}/useFocusEvents.d.ts +0 -0
  835. /package/lib/typescript/{src → commonjs/src}/useFocusedListenersChildrenAdapter.d.ts +0 -0
  836. /package/lib/typescript/{src → commonjs/src}/useIsFocused.d.ts +0 -0
  837. /package/lib/typescript/{src → commonjs/src}/useIsomorphicLayoutEffect.d.ts +0 -0
  838. /package/lib/typescript/{src → commonjs/src}/useIsomorphicLayoutEffect.native.d.ts +0 -0
  839. /package/lib/typescript/{src → commonjs/src}/useKeyedChildListeners.d.ts +0 -0
  840. /package/lib/typescript/{src → commonjs/src}/useLazyValue.d.ts +0 -0
  841. /package/lib/typescript/{src → commonjs/src}/useNavigation.d.ts +0 -0
  842. /package/lib/typescript/{src → commonjs/src}/useNavigationContainerRef.d.ts +0 -0
  843. /package/lib/typescript/{src → commonjs/src}/useNavigationIndependentTree.d.ts +0 -0
  844. /package/lib/typescript/{src → commonjs/src}/useNavigationState.d.ts +0 -0
  845. /package/lib/typescript/{src → commonjs/src}/useOnAction.d.ts +0 -0
  846. /package/lib/typescript/{src → commonjs/src}/useOnGetState.d.ts +0 -0
  847. /package/lib/typescript/{src → commonjs/src}/useOnPreventRemove.d.ts +0 -0
  848. /package/lib/typescript/{src → commonjs/src}/useOnRouteFocus.d.ts +0 -0
  849. /package/lib/typescript/{src → commonjs/src}/useOptionsGetters.d.ts +0 -0
  850. /package/lib/typescript/{src → commonjs/src}/usePreventRemove.d.ts +0 -0
  851. /package/lib/typescript/{src → commonjs/src}/usePreventRemoveContext.d.ts +0 -0
  852. /package/lib/typescript/{src → commonjs/src}/useRegisterNavigator.d.ts +0 -0
  853. /package/lib/typescript/{src → commonjs/src}/useRoute.d.ts +0 -0
  854. /package/lib/typescript/{src → commonjs/src}/useRouteCache.d.ts +0 -0
  855. /package/lib/typescript/{src → commonjs/src}/useSyncState.d.ts +0 -0
  856. /package/lib/typescript/{src → commonjs/src}/validatePathConfig.d.ts +0 -0
@@ -1,76 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.useNavigationHelpers = useNavigationHelpers;
7
- var _routers = require("@react-navigation/routers");
8
- var React = _interopRequireWildcard(require("react"));
9
- var _NavigationContext = require("./NavigationContext.cjs");
10
- var _types = require("./types.cjs");
11
- var _UnhandledActionContext = require("./UnhandledActionContext.cjs");
12
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
13
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
14
- // This is to make TypeScript compiler happy
15
- _types.PrivateValueStore;
16
- /**
17
- * Navigation object with helper methods to be used by a navigator.
18
- * This object includes methods for common actions as well as methods the parent screen's navigation object.
19
- */
20
- function useNavigationHelpers({
21
- id: navigatorId,
22
- onAction,
23
- getState,
24
- emitter,
25
- router
26
- }) {
27
- const onUnhandledAction = React.useContext(_UnhandledActionContext.UnhandledActionContext);
28
- const parentNavigationHelpers = React.useContext(_NavigationContext.NavigationContext);
29
- return React.useMemo(() => {
30
- const dispatch = op => {
31
- const action = typeof op === 'function' ? op(getState()) : op;
32
- const handled = onAction(action);
33
- if (!handled) {
34
- onUnhandledAction?.(action);
35
- }
36
- };
37
- const actions = {
38
- ...router.actionCreators,
39
- ..._routers.CommonActions
40
- };
41
- const helpers = Object.keys(actions).reduce((acc, name) => {
42
- // @ts-expect-error: name is a valid key, but TypeScript is dumb
43
- acc[name] = (...args) => dispatch(actions[name](...args));
44
- return acc;
45
- }, {});
46
- const navigationHelpers = {
47
- ...parentNavigationHelpers,
48
- ...helpers,
49
- dispatch,
50
- emit: emitter.emit,
51
- isFocused: parentNavigationHelpers ? parentNavigationHelpers.isFocused : () => true,
52
- canGoBack: () => {
53
- const state = getState();
54
- return router.getStateForAction(state, _routers.CommonActions.goBack(), {
55
- routeNames: state.routeNames,
56
- routeParamList: {},
57
- routeGetIdList: {}
58
- }) !== null || parentNavigationHelpers?.canGoBack() || false;
59
- },
60
- getId: () => navigatorId,
61
- getParent: id => {
62
- if (id !== undefined) {
63
- let current = navigationHelpers;
64
- while (current && id !== current.getId()) {
65
- current = current.getParent();
66
- }
67
- return current;
68
- }
69
- return parentNavigationHelpers;
70
- },
71
- getState
72
- };
73
- return navigationHelpers;
74
- }, [navigatorId, emitter.emit, getState, onAction, onUnhandledAction, parentNavigationHelpers, router]);
75
- }
76
- //# sourceMappingURL=useNavigationHelpers.cjs.map
@@ -1,14 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.useNavigationIndependentTree = useNavigationIndependentTree;
7
- var React = _interopRequireWildcard(require("react"));
8
- var _NavigationIndependentTreeContext = require("./NavigationIndependentTreeContext.cjs");
9
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
10
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
11
- function useNavigationIndependentTree() {
12
- return React.useContext(_NavigationIndependentTreeContext.NavigationIndependentTreeContext);
13
- }
14
- //# sourceMappingURL=useNavigationIndependentTree.cjs.map
@@ -1,26 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.useNavigationState = useNavigationState;
7
- var React = _interopRequireWildcard(require("react"));
8
- var _withSelector = require("use-sync-external-store/with-selector");
9
- var _useNavigation = require("./useNavigation.cjs");
10
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
11
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
12
- /**
13
- * Hook to get a value from the current navigation state using a selector.
14
- *
15
- * @param selector Selector function to get a value from the state.
16
- */
17
- function useNavigationState(selector) {
18
- const navigation = (0, _useNavigation.useNavigation)();
19
- const subscribe = React.useCallback(callback => {
20
- const unsubscribe = navigation.addListener('state', callback);
21
- return unsubscribe;
22
- }, [navigation]);
23
- const value = (0, _withSelector.useSyncExternalStoreWithSelector)(subscribe, navigation.getState, navigation.getState, selector);
24
- return value;
25
- }
26
- //# sourceMappingURL=useNavigationState.cjs.map
@@ -1,106 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.useOnAction = useOnAction;
7
- var React = _interopRequireWildcard(require("react"));
8
- var _DeprecatedNavigationInChildContext = require("./DeprecatedNavigationInChildContext.cjs");
9
- var _NavigationBuilderContext = require("./NavigationBuilderContext.cjs");
10
- var _useOnPreventRemove = require("./useOnPreventRemove.cjs");
11
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
12
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
13
- /**
14
- * Hook to handle actions for a navigator, including state updates and bubbling.
15
- *
16
- * Bubbling an action is achieved in 2 ways:
17
- * 1. To bubble action to parent, we expose the action handler in context and then access the parent context
18
- * 2. To bubble action to child, child adds event listeners subscribing to actions from parent
19
- *
20
- * When the action handler handles as action, it returns `true`, otherwise `false`.
21
- */
22
- function useOnAction({
23
- router,
24
- getState,
25
- setState,
26
- key,
27
- actionListeners,
28
- beforeRemoveListeners,
29
- routerConfigOptions,
30
- emitter
31
- }) {
32
- const {
33
- onAction: onActionParent,
34
- onRouteFocus: onRouteFocusParent,
35
- addListener: addListenerParent,
36
- onDispatchAction
37
- } = React.useContext(_NavigationBuilderContext.NavigationBuilderContext);
38
- const navigationInChildEnabled = React.useContext(_DeprecatedNavigationInChildContext.DeprecatedNavigationInChildContext);
39
- const routerConfigOptionsRef = React.useRef(routerConfigOptions);
40
- React.useEffect(() => {
41
- routerConfigOptionsRef.current = routerConfigOptions;
42
- });
43
- const onAction = React.useCallback((action, visitedNavigators = new Set()) => {
44
- const state = getState();
45
-
46
- // Since actions can bubble both up and down, they could come to the same navigator again
47
- // We keep track of navigators which have already tried to handle the action and return if it's already visited
48
- if (visitedNavigators.has(state.key)) {
49
- return false;
50
- }
51
- visitedNavigators.add(state.key);
52
- if (typeof action.target !== 'string' || action.target === state.key) {
53
- let result = router.getStateForAction(state, action, routerConfigOptionsRef.current);
54
-
55
- // If a target is specified and set to current navigator, the action shouldn't bubble
56
- // So instead of `null`, we use the state object for such cases to signal that action was handled
57
- result = result === null && action.target === state.key ? state : result;
58
- if (result !== null) {
59
- onDispatchAction(action, state === result);
60
- if (state !== result) {
61
- const isPrevented = (0, _useOnPreventRemove.shouldPreventRemove)(emitter, beforeRemoveListeners, state.routes, result.routes, action);
62
- if (isPrevented) {
63
- return true;
64
- }
65
- setState(result);
66
- }
67
- if (onRouteFocusParent !== undefined) {
68
- // Some actions such as `NAVIGATE` also want to bring the navigated route to focus in the whole tree
69
- // This means we need to focus all of the parent navigators of this navigator as well
70
- const shouldFocus = router.shouldActionChangeFocus(action);
71
- if (shouldFocus && key !== undefined) {
72
- onRouteFocusParent(key);
73
- }
74
- }
75
- return true;
76
- }
77
- }
78
- if (onActionParent !== undefined) {
79
- // Bubble action to the parent if the current navigator didn't handle it
80
- if (onActionParent(action, visitedNavigators)) {
81
- return true;
82
- }
83
- }
84
- if (typeof action.target === 'string' ||
85
- // For backward compatibility
86
- action.type === 'NAVIGATE_DEPRECATED' || navigationInChildEnabled) {
87
- // If the action wasn't handled by current navigator or a parent navigator, let children handle it
88
- // Handling this when target isn't specified is deprecated and will be removed in the future
89
- for (let i = actionListeners.length - 1; i >= 0; i--) {
90
- const listener = actionListeners[i];
91
- if (listener(action, visitedNavigators)) {
92
- return true;
93
- }
94
- }
95
- }
96
- return false;
97
- }, [actionListeners, beforeRemoveListeners, emitter, getState, navigationInChildEnabled, key, onActionParent, onDispatchAction, onRouteFocusParent, router, setState]);
98
- (0, _useOnPreventRemove.useOnPreventRemove)({
99
- getState,
100
- emitter,
101
- beforeRemoveListeners
102
- });
103
- React.useEffect(() => addListenerParent?.('action', onAction), [addListenerParent, onAction]);
104
- return onAction;
105
- }
106
- //# sourceMappingURL=useOnAction.cjs.map
@@ -1,48 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.useOnGetState = useOnGetState;
7
- var React = _interopRequireWildcard(require("react"));
8
- var _isArrayEqual = require("./isArrayEqual.cjs");
9
- var _NavigationBuilderContext = require("./NavigationBuilderContext.cjs");
10
- var _NavigationRouteContext = require("./NavigationRouteContext.cjs");
11
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
12
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
13
- function useOnGetState({
14
- getState,
15
- getStateListeners
16
- }) {
17
- const {
18
- addKeyedListener
19
- } = React.useContext(_NavigationBuilderContext.NavigationBuilderContext);
20
- const route = React.useContext(_NavigationRouteContext.NavigationRouteContext);
21
- const key = route ? route.key : 'root';
22
- const getRehydratedState = React.useCallback(() => {
23
- const state = getState();
24
-
25
- // Avoid returning new route objects if we don't need to
26
- const routes = state.routes.map(route => {
27
- const childState = getStateListeners[route.key]?.();
28
- if (route.state === childState) {
29
- return route;
30
- }
31
- return {
32
- ...route,
33
- state: childState
34
- };
35
- });
36
- if ((0, _isArrayEqual.isArrayEqual)(state.routes, routes)) {
37
- return state;
38
- }
39
- return {
40
- ...state,
41
- routes
42
- };
43
- }, [getState, getStateListeners]);
44
- React.useEffect(() => {
45
- return addKeyedListener?.('getState', key, getRehydratedState);
46
- }, [addKeyedListener, getRehydratedState, key]);
47
- }
48
- //# sourceMappingURL=useOnGetState.cjs.map
@@ -1,72 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.shouldPreventRemove = void 0;
7
- exports.useOnPreventRemove = useOnPreventRemove;
8
- var React = _interopRequireWildcard(require("react"));
9
- var _NavigationBuilderContext = require("./NavigationBuilderContext.cjs");
10
- var _NavigationRouteContext = require("./NavigationRouteContext.cjs");
11
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
12
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
13
- const VISITED_ROUTE_KEYS = Symbol('VISITED_ROUTE_KEYS');
14
- const shouldPreventRemove = (emitter, beforeRemoveListeners, currentRoutes, nextRoutes, action) => {
15
- const nextRouteKeys = nextRoutes.map(route => route.key);
16
-
17
- // Call these in reverse order so last screens handle the event first
18
- const removedRoutes = currentRoutes.filter(route => !nextRouteKeys.includes(route.key)).reverse();
19
- const visitedRouteKeys =
20
- // @ts-expect-error: add this property to mark that we've already emitted this action
21
- action[VISITED_ROUTE_KEYS] ?? new Set();
22
- const beforeRemoveAction = {
23
- ...action,
24
- [VISITED_ROUTE_KEYS]: visitedRouteKeys
25
- };
26
- for (const route of removedRoutes) {
27
- if (visitedRouteKeys.has(route.key)) {
28
- // Skip if we've already emitted this action for this screen
29
- continue;
30
- }
31
-
32
- // First, we need to check if any child screens want to prevent it
33
- const isPrevented = beforeRemoveListeners[route.key]?.(beforeRemoveAction);
34
- if (isPrevented) {
35
- return true;
36
- }
37
- visitedRouteKeys.add(route.key);
38
- const event = emitter.emit({
39
- type: 'beforeRemove',
40
- target: route.key,
41
- data: {
42
- action: beforeRemoveAction
43
- },
44
- canPreventDefault: true
45
- });
46
- if (event.defaultPrevented) {
47
- return true;
48
- }
49
- }
50
- return false;
51
- };
52
- exports.shouldPreventRemove = shouldPreventRemove;
53
- function useOnPreventRemove({
54
- getState,
55
- emitter,
56
- beforeRemoveListeners
57
- }) {
58
- const {
59
- addKeyedListener
60
- } = React.useContext(_NavigationBuilderContext.NavigationBuilderContext);
61
- const route = React.useContext(_NavigationRouteContext.NavigationRouteContext);
62
- const routeKey = route?.key;
63
- React.useEffect(() => {
64
- if (routeKey) {
65
- return addKeyedListener?.('beforeRemove', routeKey, action => {
66
- const state = getState();
67
- return shouldPreventRemove(emitter, beforeRemoveListeners, state.routes, [], action);
68
- });
69
- }
70
- }, [addKeyedListener, beforeRemoveListeners, emitter, getState, routeKey]);
71
- }
72
- //# sourceMappingURL=useOnPreventRemove.cjs.map
@@ -1,36 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.useOnRouteFocus = useOnRouteFocus;
7
- var React = _interopRequireWildcard(require("react"));
8
- var _NavigationBuilderContext = require("./NavigationBuilderContext.cjs");
9
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
10
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
11
- /**
12
- * Hook to handle focus actions for a route.
13
- * Focus action needs to be treated specially, coz when a nested route is focused,
14
- * the parent navigators also needs to be focused.
15
- */
16
- function useOnRouteFocus({
17
- router,
18
- getState,
19
- key: sourceRouteKey,
20
- setState
21
- }) {
22
- const {
23
- onRouteFocus: onRouteFocusParent
24
- } = React.useContext(_NavigationBuilderContext.NavigationBuilderContext);
25
- return React.useCallback(key => {
26
- const state = getState();
27
- const result = router.getStateForRouteFocus(state, key);
28
- if (result !== state) {
29
- setState(result);
30
- }
31
- if (onRouteFocusParent !== undefined && sourceRouteKey !== undefined) {
32
- onRouteFocusParent(sourceRouteKey);
33
- }
34
- }, [getState, onRouteFocusParent, router, setState, sourceRouteKey]);
35
- }
36
- //# sourceMappingURL=useOnRouteFocus.cjs.map
@@ -1,78 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.useOptionsGetters = useOptionsGetters;
7
- var React = _interopRequireWildcard(require("react"));
8
- var _NavigationBuilderContext = require("./NavigationBuilderContext.cjs");
9
- var _NavigationStateContext = require("./NavigationStateContext.cjs");
10
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
11
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
12
- function useOptionsGetters({
13
- key,
14
- options,
15
- navigation
16
- }) {
17
- const optionsRef = React.useRef(options);
18
- const optionsGettersFromChildRef = React.useRef({});
19
- const {
20
- onOptionsChange
21
- } = React.useContext(_NavigationBuilderContext.NavigationBuilderContext);
22
- const {
23
- addOptionsGetter: parentAddOptionsGetter
24
- } = React.useContext(_NavigationStateContext.NavigationStateContext);
25
- const optionsChangeListener = React.useCallback(() => {
26
- const isFocused = navigation?.isFocused() ?? true;
27
- const hasChildren = Object.keys(optionsGettersFromChildRef.current).length;
28
- if (isFocused && !hasChildren) {
29
- onOptionsChange(optionsRef.current ?? {});
30
- }
31
- }, [navigation, onOptionsChange]);
32
- React.useEffect(() => {
33
- optionsRef.current = options;
34
- optionsChangeListener();
35
- return navigation?.addListener('focus', optionsChangeListener);
36
- }, [navigation, options, optionsChangeListener]);
37
- const getOptionsFromListener = React.useCallback(() => {
38
- for (const key in optionsGettersFromChildRef.current) {
39
- if (key in optionsGettersFromChildRef.current) {
40
- const result = optionsGettersFromChildRef.current[key]?.();
41
-
42
- // null means unfocused route
43
- if (result !== null) {
44
- return result;
45
- }
46
- }
47
- }
48
- return null;
49
- }, []);
50
- const getCurrentOptions = React.useCallback(() => {
51
- const isFocused = navigation?.isFocused() ?? true;
52
- if (!isFocused) {
53
- return null;
54
- }
55
- const optionsFromListener = getOptionsFromListener();
56
- if (optionsFromListener !== null) {
57
- return optionsFromListener;
58
- }
59
- return optionsRef.current;
60
- }, [navigation, getOptionsFromListener]);
61
- React.useEffect(() => {
62
- return parentAddOptionsGetter?.(key, getCurrentOptions);
63
- }, [getCurrentOptions, parentAddOptionsGetter, key]);
64
- const addOptionsGetter = React.useCallback((key, getter) => {
65
- optionsGettersFromChildRef.current[key] = getter;
66
- optionsChangeListener();
67
- return () => {
68
- // eslint-disable-next-line @typescript-eslint/no-dynamic-delete
69
- delete optionsGettersFromChildRef.current[key];
70
- optionsChangeListener();
71
- };
72
- }, [optionsChangeListener]);
73
- return {
74
- addOptionsGetter,
75
- getCurrentOptions
76
- };
77
- }
78
- //# sourceMappingURL=useOptionsGetters.cjs.map
@@ -1,48 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.usePreventRemove = usePreventRemove;
7
- var _nonSecure = require("nanoid/non-secure");
8
- var React = _interopRequireWildcard(require("react"));
9
- var _useLatestCallback = _interopRequireDefault(require("use-latest-callback"));
10
- var _useNavigation = require("./useNavigation.cjs");
11
- var _usePreventRemoveContext = require("./usePreventRemoveContext.cjs");
12
- var _useRoute = require("./useRoute.cjs");
13
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
14
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
15
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
16
- /**
17
- * Hook to prevent screen from being removed. Can be used to prevent users from leaving the screen.
18
- *
19
- * @param preventRemove Boolean indicating whether to prevent screen from being removed.
20
- * @param callback Function which is executed when screen was prevented from being removed.
21
- */
22
- function usePreventRemove(preventRemove, callback) {
23
- const [id] = React.useState(() => (0, _nonSecure.nanoid)());
24
- const navigation = (0, _useNavigation.useNavigation)();
25
- const {
26
- key: routeKey
27
- } = (0, _useRoute.useRoute)();
28
- const {
29
- setPreventRemove
30
- } = (0, _usePreventRemoveContext.usePreventRemoveContext)();
31
- React.useEffect(() => {
32
- setPreventRemove(id, routeKey, preventRemove);
33
- return () => {
34
- setPreventRemove(id, routeKey, false);
35
- };
36
- }, [setPreventRemove, id, routeKey, preventRemove]);
37
- const beforeRemoveListener = (0, _useLatestCallback.default)(e => {
38
- if (!preventRemove) {
39
- return;
40
- }
41
- e.preventDefault();
42
- callback({
43
- data: e.data
44
- });
45
- });
46
- React.useEffect(() => navigation?.addListener('beforeRemove', beforeRemoveListener), [navigation, beforeRemoveListener]);
47
- }
48
- //# sourceMappingURL=usePreventRemove.cjs.map
@@ -1,18 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.usePreventRemoveContext = usePreventRemoveContext;
7
- var React = _interopRequireWildcard(require("react"));
8
- var _PreventRemoveContext = require("./PreventRemoveContext.cjs");
9
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
10
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
11
- function usePreventRemoveContext() {
12
- const value = React.useContext(_PreventRemoveContext.PreventRemoveContext);
13
- if (value == null) {
14
- throw new Error("Couldn't find the prevent remove context. Is your component inside NavigationContent?");
15
- }
16
- return value;
17
- }
18
- //# sourceMappingURL=usePreventRemoveContext.cjs.map
@@ -1,32 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.useRegisterNavigator = useRegisterNavigator;
7
- var _nonSecure = require("nanoid/non-secure");
8
- var React = _interopRequireWildcard(require("react"));
9
- var _EnsureSingleNavigator = require("./EnsureSingleNavigator.cjs");
10
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
11
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
12
- /**
13
- * Register a navigator in the parent context (either a navigation container or a screen).
14
- * This is used to prevent multiple navigators under a single container or screen.
15
- */
16
- function useRegisterNavigator() {
17
- const [key] = React.useState(() => (0, _nonSecure.nanoid)());
18
- const container = React.useContext(_EnsureSingleNavigator.SingleNavigatorContext);
19
- if (container === undefined) {
20
- throw new Error("Couldn't register the navigator. Have you wrapped your app with 'NavigationContainer'?\n\nThis can also happen if there are multiple copies of '@react-navigation' packages installed.");
21
- }
22
- React.useEffect(() => {
23
- const {
24
- register,
25
- unregister
26
- } = container;
27
- register(key);
28
- return () => unregister(key);
29
- }, [container, key]);
30
- return key;
31
- }
32
- //# sourceMappingURL=useRegisterNavigator.cjs.map
@@ -1,23 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.useRoute = useRoute;
7
- var React = _interopRequireWildcard(require("react"));
8
- var _NavigationRouteContext = require("./NavigationRouteContext.cjs");
9
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
10
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
11
- /**
12
- * Hook to access the route prop of the parent screen anywhere.
13
- *
14
- * @returns Route prop of the parent screen.
15
- */
16
- function useRoute() {
17
- const route = React.useContext(_NavigationRouteContext.NavigationRouteContext);
18
- if (route === undefined) {
19
- throw new Error("Couldn't find a route object. Is your component inside a screen in a navigator?");
20
- }
21
- return route;
22
- }
23
- //# sourceMappingURL=useRoute.cjs.map
@@ -1,69 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.CHILD_STATE = void 0;
7
- exports.useRouteCache = useRouteCache;
8
- var React = _interopRequireWildcard(require("react"));
9
- var _isRecordEqual = require("./isRecordEqual.cjs");
10
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
11
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
12
- /**
13
- * Utilities such as `getFocusedRouteNameFromRoute` need to access state.
14
- * So we need a way to suppress the warning for those use cases.
15
- * This is fine since they are internal utilities and this is not public API.
16
- */
17
- const CHILD_STATE = exports.CHILD_STATE = Symbol('CHILD_STATE');
18
-
19
- /**
20
- * Hook to cache route props for each screen in the navigator.
21
- * This lets add warnings and modifications to the route object but keep references between renders.
22
- */
23
- function useRouteCache(routes) {
24
- // Cache object which holds route objects for each screen
25
- const cache = React.useMemo(() => ({
26
- current: new Map()
27
- }), []);
28
- if (process.env.NODE_ENV === 'production') {
29
- // We don't want the overhead of creating extra maps every render in prod
30
- return routes;
31
- }
32
- cache.current = routes.reduce((acc, route) => {
33
- const previous = cache.current.get(route.key);
34
- const {
35
- state,
36
- ...routeWithoutState
37
- } = route;
38
- let proxy;
39
- if (previous && (0, _isRecordEqual.isRecordEqual)(previous, routeWithoutState)) {
40
- // If a cached route object already exists, reuse it
41
- proxy = previous;
42
- } else {
43
- proxy = routeWithoutState;
44
- }
45
- if (process.env.NODE_ENV !== 'production') {
46
- // FIXME: since the state is updated with mutation, the route object cannot be frozen
47
- // As a workaround, loop through the object and make the properties readonly
48
- for (const key in proxy) {
49
- // @ts-expect-error: this is fine since we are looping through the object
50
- const value = proxy[key];
51
- Object.defineProperty(proxy, key, {
52
- enumerable: true,
53
- configurable: true,
54
- writable: false,
55
- value
56
- });
57
- }
58
- }
59
- Object.defineProperty(proxy, CHILD_STATE, {
60
- enumerable: false,
61
- configurable: true,
62
- value: state
63
- });
64
- acc.set(route.key, proxy);
65
- return acc;
66
- }, new Map());
67
- return Array.from(cache.current.values());
68
- }
69
- //# sourceMappingURL=useRouteCache.cjs.map