@react-navigation/core 7.8.3 → 7.8.5

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 (522) hide show
  1. package/lib/typescript/src/BaseNavigationContainer.d.ts.map +1 -0
  2. package/lib/typescript/src/CurrentRenderContext.d.ts.map +1 -0
  3. package/lib/typescript/src/DeprecatedNavigationInChildContext.d.ts.map +1 -0
  4. package/lib/typescript/src/EnsureSingleNavigator.d.ts.map +1 -0
  5. package/lib/typescript/src/Group.d.ts.map +1 -0
  6. package/lib/typescript/src/NavigationBuilderContext.d.ts.map +1 -0
  7. package/lib/typescript/src/NavigationContainerRefContext.d.ts.map +1 -0
  8. package/lib/typescript/src/NavigationContext.d.ts.map +1 -0
  9. package/lib/typescript/src/NavigationFocusedRouteStateContext.d.ts.map +1 -0
  10. package/lib/typescript/src/NavigationHelpersContext.d.ts.map +1 -0
  11. package/lib/typescript/src/NavigationIndependentTree.d.ts.map +1 -0
  12. package/lib/typescript/src/NavigationIndependentTreeContext.d.ts.map +1 -0
  13. package/lib/typescript/src/NavigationRouteContext.d.ts.map +1 -0
  14. package/lib/typescript/src/NavigationStateContext.d.ts.map +1 -0
  15. package/lib/typescript/src/PreventRemoveContext.d.ts.map +1 -0
  16. package/lib/typescript/src/PreventRemoveProvider.d.ts.map +1 -0
  17. package/lib/typescript/src/SceneView.d.ts.map +1 -0
  18. package/lib/typescript/src/Screen.d.ts.map +1 -0
  19. package/lib/typescript/src/StaticContainer.d.ts.map +1 -0
  20. package/lib/typescript/src/StaticNavigation.d.ts.map +1 -0
  21. package/lib/typescript/src/UnhandledActionContext.d.ts.map +1 -0
  22. package/lib/typescript/src/arrayStartsWith.d.ts.map +1 -0
  23. package/lib/typescript/src/checkDuplicateRouteNames.d.ts.map +1 -0
  24. package/lib/typescript/src/checkSerializable.d.ts.map +1 -0
  25. package/lib/typescript/src/createNavigationContainerRef.d.ts.map +1 -0
  26. package/lib/typescript/src/createNavigatorFactory.d.ts.map +1 -0
  27. package/lib/typescript/src/deepFreeze.d.ts.map +1 -0
  28. package/lib/typescript/src/findFocusedRoute.d.ts.map +1 -0
  29. package/lib/typescript/src/getActionFromState.d.ts.map +1 -0
  30. package/lib/typescript/src/getFocusedRouteNameFromRoute.d.ts.map +1 -0
  31. package/lib/typescript/src/getPathFromState.d.ts.map +1 -0
  32. package/lib/typescript/src/getPatternParts.d.ts.map +1 -0
  33. package/lib/typescript/src/getStateFromPath.d.ts.map +1 -0
  34. package/lib/typescript/src/index.d.ts.map +1 -0
  35. package/lib/typescript/src/isArrayEqual.d.ts.map +1 -0
  36. package/lib/typescript/src/isRecordEqual.d.ts.map +1 -0
  37. package/lib/typescript/src/theming/ThemeContext.d.ts.map +1 -0
  38. package/lib/typescript/src/theming/ThemeProvider.d.ts.map +1 -0
  39. package/lib/typescript/src/theming/useTheme.d.ts.map +1 -0
  40. package/lib/typescript/src/types.d.ts.map +1 -0
  41. package/lib/typescript/src/useChildListeners.d.ts.map +1 -0
  42. package/lib/typescript/src/useComponent.d.ts.map +1 -0
  43. package/lib/typescript/src/useCurrentRender.d.ts.map +1 -0
  44. package/lib/typescript/src/useDescriptors.d.ts.map +1 -0
  45. package/lib/typescript/src/useEventEmitter.d.ts.map +1 -0
  46. package/lib/typescript/src/useFocusEffect.d.ts.map +1 -0
  47. package/lib/typescript/src/useFocusEvents.d.ts.map +1 -0
  48. package/lib/typescript/src/useFocusedListenersChildrenAdapter.d.ts.map +1 -0
  49. package/lib/typescript/src/useIsFocused.d.ts.map +1 -0
  50. package/lib/typescript/src/useIsomorphicLayoutEffect.d.ts.map +1 -0
  51. package/lib/typescript/src/useIsomorphicLayoutEffect.native.d.ts.map +1 -0
  52. package/lib/typescript/src/useKeyedChildListeners.d.ts.map +1 -0
  53. package/lib/typescript/src/useLazyValue.d.ts.map +1 -0
  54. package/lib/typescript/src/useNavigation.d.ts.map +1 -0
  55. package/lib/typescript/src/useNavigationBuilder.d.ts.map +1 -0
  56. package/lib/typescript/src/useNavigationCache.d.ts.map +1 -0
  57. package/lib/typescript/src/useNavigationContainerRef.d.ts.map +1 -0
  58. package/lib/typescript/src/useNavigationHelpers.d.ts.map +1 -0
  59. package/lib/typescript/src/useNavigationIndependentTree.d.ts.map +1 -0
  60. package/lib/typescript/src/useNavigationState.d.ts.map +1 -0
  61. package/lib/typescript/src/useOnAction.d.ts.map +1 -0
  62. package/lib/typescript/src/useOnGetState.d.ts.map +1 -0
  63. package/lib/typescript/src/useOnPreventRemove.d.ts.map +1 -0
  64. package/lib/typescript/src/useOnRouteFocus.d.ts.map +1 -0
  65. package/lib/typescript/src/useOptionsGetters.d.ts.map +1 -0
  66. package/lib/typescript/src/usePreventRemove.d.ts.map +1 -0
  67. package/lib/typescript/src/usePreventRemoveContext.d.ts.map +1 -0
  68. package/lib/typescript/src/useRegisterNavigator.d.ts.map +1 -0
  69. package/lib/typescript/src/useRoute.d.ts.map +1 -0
  70. package/lib/typescript/src/useRouteCache.d.ts.map +1 -0
  71. package/lib/typescript/src/useScheduleUpdate.d.ts.map +1 -0
  72. package/lib/typescript/src/useStateForPath.d.ts.map +1 -0
  73. package/lib/typescript/src/useSyncState.d.ts.map +1 -0
  74. package/lib/typescript/src/validatePathConfig.d.ts.map +1 -0
  75. package/package.json +11 -24
  76. package/lib/commonjs/BaseNavigationContainer.js +0 -368
  77. package/lib/commonjs/BaseNavigationContainer.js.map +0 -1
  78. package/lib/commonjs/CurrentRenderContext.js +0 -15
  79. package/lib/commonjs/CurrentRenderContext.js.map +0 -1
  80. package/lib/commonjs/DeprecatedNavigationInChildContext.js +0 -14
  81. package/lib/commonjs/DeprecatedNavigationInChildContext.js.map +0 -1
  82. package/lib/commonjs/EnsureSingleNavigator.js +0 -43
  83. package/lib/commonjs/EnsureSingleNavigator.js.map +0 -1
  84. package/lib/commonjs/Group.js +0 -14
  85. package/lib/commonjs/Group.js.map +0 -1
  86. package/lib/commonjs/NavigationBuilderContext.js +0 -23
  87. package/lib/commonjs/NavigationBuilderContext.js.map +0 -1
  88. package/lib/commonjs/NavigationContainerRefContext.js +0 -14
  89. package/lib/commonjs/NavigationContainerRefContext.js.map +0 -1
  90. package/lib/commonjs/NavigationContext.js +0 -14
  91. package/lib/commonjs/NavigationContext.js.map +0 -1
  92. package/lib/commonjs/NavigationFocusedRouteStateContext.js +0 -14
  93. package/lib/commonjs/NavigationFocusedRouteStateContext.js.map +0 -1
  94. package/lib/commonjs/NavigationHelpersContext.js +0 -15
  95. package/lib/commonjs/NavigationHelpersContext.js.map +0 -1
  96. package/lib/commonjs/NavigationIndependentTree.js +0 -35
  97. package/lib/commonjs/NavigationIndependentTree.js.map +0 -1
  98. package/lib/commonjs/NavigationIndependentTreeContext.js +0 -14
  99. package/lib/commonjs/NavigationIndependentTreeContext.js.map +0 -1
  100. package/lib/commonjs/NavigationRouteContext.js +0 -14
  101. package/lib/commonjs/NavigationRouteContext.js.map +0 -1
  102. package/lib/commonjs/NavigationStateContext.js +0 -29
  103. package/lib/commonjs/NavigationStateContext.js.map +0 -1
  104. package/lib/commonjs/PreventRemoveContext.js +0 -16
  105. package/lib/commonjs/PreventRemoveContext.js.map +0 -1
  106. package/lib/commonjs/PreventRemoveProvider.js +0 -91
  107. package/lib/commonjs/PreventRemoveProvider.js.map +0 -1
  108. package/lib/commonjs/SceneView.js +0 -151
  109. package/lib/commonjs/SceneView.js.map +0 -1
  110. package/lib/commonjs/Screen.js +0 -14
  111. package/lib/commonjs/Screen.js.map +0 -1
  112. package/lib/commonjs/StaticContainer.js +0 -31
  113. package/lib/commonjs/StaticContainer.js.map +0 -1
  114. package/lib/commonjs/StaticNavigation.js +0 -258
  115. package/lib/commonjs/StaticNavigation.js.map +0 -1
  116. package/lib/commonjs/UnhandledActionContext.js +0 -11
  117. package/lib/commonjs/UnhandledActionContext.js.map +0 -1
  118. package/lib/commonjs/arrayStartsWith.js +0 -16
  119. package/lib/commonjs/arrayStartsWith.js.map +0 -1
  120. package/lib/commonjs/checkDuplicateRouteNames.js +0 -25
  121. package/lib/commonjs/checkDuplicateRouteNames.js.map +0 -1
  122. package/lib/commonjs/checkSerializable.js +0 -50
  123. package/lib/commonjs/checkSerializable.js.map +0 -1
  124. package/lib/commonjs/createNavigationContainerRef.js +0 -69
  125. package/lib/commonjs/createNavigationContainerRef.js.map +0 -1
  126. package/lib/commonjs/createNavigatorFactory.js +0 -34
  127. package/lib/commonjs/createNavigatorFactory.js.map +0 -1
  128. package/lib/commonjs/deepFreeze.js +0 -40
  129. package/lib/commonjs/deepFreeze.js.map +0 -1
  130. package/lib/commonjs/findFocusedRoute.js +0 -15
  131. package/lib/commonjs/findFocusedRoute.js.map +0 -1
  132. package/lib/commonjs/getActionFromState.js +0 -111
  133. package/lib/commonjs/getActionFromState.js.map +0 -1
  134. package/lib/commonjs/getFocusedRouteNameFromRoute.js +0 -22
  135. package/lib/commonjs/getFocusedRouteNameFromRoute.js.map +0 -1
  136. package/lib/commonjs/getPathFromState.js +0 -241
  137. package/lib/commonjs/getPathFromState.js.map +0 -1
  138. package/lib/commonjs/getPatternParts.js +0 -105
  139. package/lib/commonjs/getPatternParts.js.map +0 -1
  140. package/lib/commonjs/getStateFromPath.js +0 -521
  141. package/lib/commonjs/getStateFromPath.js.map +0 -1
  142. package/lib/commonjs/index.js +0 -295
  143. package/lib/commonjs/index.js.map +0 -1
  144. package/lib/commonjs/isArrayEqual.js +0 -20
  145. package/lib/commonjs/isArrayEqual.js.map +0 -1
  146. package/lib/commonjs/isRecordEqual.js +0 -21
  147. package/lib/commonjs/isRecordEqual.js.map +0 -1
  148. package/lib/commonjs/package.json +0 -1
  149. package/lib/commonjs/theming/ThemeContext.js +0 -12
  150. package/lib/commonjs/theming/ThemeContext.js.map +0 -1
  151. package/lib/commonjs/theming/ThemeProvider.js +0 -21
  152. package/lib/commonjs/theming/ThemeProvider.js.map +0 -1
  153. package/lib/commonjs/theming/useTheme.js +0 -18
  154. package/lib/commonjs/theming/useTheme.js.map +0 -1
  155. package/lib/commonjs/types.js +0 -9
  156. package/lib/commonjs/types.js.map +0 -1
  157. package/lib/commonjs/useChildListeners.js +0 -36
  158. package/lib/commonjs/useChildListeners.js.map +0 -1
  159. package/lib/commonjs/useComponent.js +0 -40
  160. package/lib/commonjs/useComponent.js.map +0 -1
  161. package/lib/commonjs/useCurrentRender.js +0 -25
  162. package/lib/commonjs/useCurrentRender.js.map +0 -1
  163. package/lib/commonjs/useDescriptors.js +0 -192
  164. package/lib/commonjs/useDescriptors.js.map +0 -1
  165. package/lib/commonjs/useEventEmitter.js +0 -105
  166. package/lib/commonjs/useEventEmitter.js.map +0 -1
  167. package/lib/commonjs/useFocusEffect.js +0 -80
  168. package/lib/commonjs/useFocusEffect.js.map +0 -1
  169. package/lib/commonjs/useFocusEvents.js +0 -70
  170. package/lib/commonjs/useFocusEvents.js.map +0 -1
  171. package/lib/commonjs/useFocusedListenersChildrenAdapter.js +0 -48
  172. package/lib/commonjs/useFocusedListenersChildrenAdapter.js.map +0 -1
  173. package/lib/commonjs/useIsFocused.js +0 -28
  174. package/lib/commonjs/useIsFocused.js.map +0 -1
  175. package/lib/commonjs/useIsomorphicLayoutEffect.js +0 -12
  176. package/lib/commonjs/useIsomorphicLayoutEffect.js.map +0 -1
  177. package/lib/commonjs/useIsomorphicLayoutEffect.native.js +0 -9
  178. package/lib/commonjs/useIsomorphicLayoutEffect.native.js.map +0 -1
  179. package/lib/commonjs/useKeyedChildListeners.js +0 -33
  180. package/lib/commonjs/useKeyedChildListeners.js.map +0 -1
  181. package/lib/commonjs/useLazyValue.js +0 -17
  182. package/lib/commonjs/useLazyValue.js.map +0 -1
  183. package/lib/commonjs/useNavigation.js +0 -27
  184. package/lib/commonjs/useNavigation.js.map +0 -1
  185. package/lib/commonjs/useNavigationBuilder.js +0 -495
  186. package/lib/commonjs/useNavigationBuilder.js.map +0 -1
  187. package/lib/commonjs/useNavigationCache.js +0 -162
  188. package/lib/commonjs/useNavigationCache.js.map +0 -1
  189. package/lib/commonjs/useNavigationContainerRef.js +0 -18
  190. package/lib/commonjs/useNavigationContainerRef.js.map +0 -1
  191. package/lib/commonjs/useNavigationHelpers.js +0 -88
  192. package/lib/commonjs/useNavigationHelpers.js.map +0 -1
  193. package/lib/commonjs/useNavigationIndependentTree.js +0 -14
  194. package/lib/commonjs/useNavigationIndependentTree.js.map +0 -1
  195. package/lib/commonjs/useNavigationState.js +0 -26
  196. package/lib/commonjs/useNavigationState.js.map +0 -1
  197. package/lib/commonjs/useOnAction.js +0 -106
  198. package/lib/commonjs/useOnAction.js.map +0 -1
  199. package/lib/commonjs/useOnGetState.js +0 -48
  200. package/lib/commonjs/useOnGetState.js.map +0 -1
  201. package/lib/commonjs/useOnPreventRemove.js +0 -72
  202. package/lib/commonjs/useOnPreventRemove.js.map +0 -1
  203. package/lib/commonjs/useOnRouteFocus.js +0 -36
  204. package/lib/commonjs/useOnRouteFocus.js.map +0 -1
  205. package/lib/commonjs/useOptionsGetters.js +0 -78
  206. package/lib/commonjs/useOptionsGetters.js.map +0 -1
  207. package/lib/commonjs/usePreventRemove.js +0 -48
  208. package/lib/commonjs/usePreventRemove.js.map +0 -1
  209. package/lib/commonjs/usePreventRemoveContext.js +0 -18
  210. package/lib/commonjs/usePreventRemoveContext.js.map +0 -1
  211. package/lib/commonjs/useRegisterNavigator.js +0 -32
  212. package/lib/commonjs/useRegisterNavigator.js.map +0 -1
  213. package/lib/commonjs/useRoute.js +0 -23
  214. package/lib/commonjs/useRoute.js.map +0 -1
  215. package/lib/commonjs/useRouteCache.js +0 -69
  216. package/lib/commonjs/useRouteCache.js.map +0 -1
  217. package/lib/commonjs/useScheduleUpdate.js +0 -30
  218. package/lib/commonjs/useScheduleUpdate.js.map +0 -1
  219. package/lib/commonjs/useStateForPath.js +0 -21
  220. package/lib/commonjs/useStateForPath.js.map +0 -1
  221. package/lib/commonjs/useSyncState.js +0 -87
  222. package/lib/commonjs/useSyncState.js.map +0 -1
  223. package/lib/commonjs/validatePathConfig.js +0 -56
  224. package/lib/commonjs/validatePathConfig.js.map +0 -1
  225. package/lib/typescript/commonjs/package.json +0 -1
  226. package/lib/typescript/commonjs/src/BaseNavigationContainer.d.ts.map +0 -1
  227. package/lib/typescript/commonjs/src/CurrentRenderContext.d.ts.map +0 -1
  228. package/lib/typescript/commonjs/src/DeprecatedNavigationInChildContext.d.ts.map +0 -1
  229. package/lib/typescript/commonjs/src/EnsureSingleNavigator.d.ts.map +0 -1
  230. package/lib/typescript/commonjs/src/Group.d.ts.map +0 -1
  231. package/lib/typescript/commonjs/src/NavigationBuilderContext.d.ts.map +0 -1
  232. package/lib/typescript/commonjs/src/NavigationContainerRefContext.d.ts.map +0 -1
  233. package/lib/typescript/commonjs/src/NavigationContext.d.ts.map +0 -1
  234. package/lib/typescript/commonjs/src/NavigationFocusedRouteStateContext.d.ts.map +0 -1
  235. package/lib/typescript/commonjs/src/NavigationHelpersContext.d.ts.map +0 -1
  236. package/lib/typescript/commonjs/src/NavigationIndependentTree.d.ts.map +0 -1
  237. package/lib/typescript/commonjs/src/NavigationIndependentTreeContext.d.ts.map +0 -1
  238. package/lib/typescript/commonjs/src/NavigationRouteContext.d.ts.map +0 -1
  239. package/lib/typescript/commonjs/src/NavigationStateContext.d.ts.map +0 -1
  240. package/lib/typescript/commonjs/src/PreventRemoveContext.d.ts.map +0 -1
  241. package/lib/typescript/commonjs/src/PreventRemoveProvider.d.ts.map +0 -1
  242. package/lib/typescript/commonjs/src/SceneView.d.ts.map +0 -1
  243. package/lib/typescript/commonjs/src/Screen.d.ts.map +0 -1
  244. package/lib/typescript/commonjs/src/StaticContainer.d.ts.map +0 -1
  245. package/lib/typescript/commonjs/src/StaticNavigation.d.ts.map +0 -1
  246. package/lib/typescript/commonjs/src/UnhandledActionContext.d.ts.map +0 -1
  247. package/lib/typescript/commonjs/src/arrayStartsWith.d.ts.map +0 -1
  248. package/lib/typescript/commonjs/src/checkDuplicateRouteNames.d.ts.map +0 -1
  249. package/lib/typescript/commonjs/src/checkSerializable.d.ts.map +0 -1
  250. package/lib/typescript/commonjs/src/createNavigationContainerRef.d.ts.map +0 -1
  251. package/lib/typescript/commonjs/src/createNavigatorFactory.d.ts.map +0 -1
  252. package/lib/typescript/commonjs/src/deepFreeze.d.ts.map +0 -1
  253. package/lib/typescript/commonjs/src/findFocusedRoute.d.ts.map +0 -1
  254. package/lib/typescript/commonjs/src/getActionFromState.d.ts.map +0 -1
  255. package/lib/typescript/commonjs/src/getFocusedRouteNameFromRoute.d.ts.map +0 -1
  256. package/lib/typescript/commonjs/src/getPathFromState.d.ts.map +0 -1
  257. package/lib/typescript/commonjs/src/getPatternParts.d.ts.map +0 -1
  258. package/lib/typescript/commonjs/src/getStateFromPath.d.ts.map +0 -1
  259. package/lib/typescript/commonjs/src/index.d.ts.map +0 -1
  260. package/lib/typescript/commonjs/src/isArrayEqual.d.ts.map +0 -1
  261. package/lib/typescript/commonjs/src/isRecordEqual.d.ts.map +0 -1
  262. package/lib/typescript/commonjs/src/theming/ThemeContext.d.ts.map +0 -1
  263. package/lib/typescript/commonjs/src/theming/ThemeProvider.d.ts.map +0 -1
  264. package/lib/typescript/commonjs/src/theming/useTheme.d.ts.map +0 -1
  265. package/lib/typescript/commonjs/src/types.d.ts.map +0 -1
  266. package/lib/typescript/commonjs/src/useChildListeners.d.ts.map +0 -1
  267. package/lib/typescript/commonjs/src/useComponent.d.ts.map +0 -1
  268. package/lib/typescript/commonjs/src/useCurrentRender.d.ts.map +0 -1
  269. package/lib/typescript/commonjs/src/useDescriptors.d.ts.map +0 -1
  270. package/lib/typescript/commonjs/src/useEventEmitter.d.ts.map +0 -1
  271. package/lib/typescript/commonjs/src/useFocusEffect.d.ts.map +0 -1
  272. package/lib/typescript/commonjs/src/useFocusEvents.d.ts.map +0 -1
  273. package/lib/typescript/commonjs/src/useFocusedListenersChildrenAdapter.d.ts.map +0 -1
  274. package/lib/typescript/commonjs/src/useIsFocused.d.ts.map +0 -1
  275. package/lib/typescript/commonjs/src/useIsomorphicLayoutEffect.d.ts.map +0 -1
  276. package/lib/typescript/commonjs/src/useIsomorphicLayoutEffect.native.d.ts.map +0 -1
  277. package/lib/typescript/commonjs/src/useKeyedChildListeners.d.ts.map +0 -1
  278. package/lib/typescript/commonjs/src/useLazyValue.d.ts.map +0 -1
  279. package/lib/typescript/commonjs/src/useNavigation.d.ts.map +0 -1
  280. package/lib/typescript/commonjs/src/useNavigationBuilder.d.ts.map +0 -1
  281. package/lib/typescript/commonjs/src/useNavigationCache.d.ts.map +0 -1
  282. package/lib/typescript/commonjs/src/useNavigationContainerRef.d.ts.map +0 -1
  283. package/lib/typescript/commonjs/src/useNavigationHelpers.d.ts.map +0 -1
  284. package/lib/typescript/commonjs/src/useNavigationIndependentTree.d.ts.map +0 -1
  285. package/lib/typescript/commonjs/src/useNavigationState.d.ts.map +0 -1
  286. package/lib/typescript/commonjs/src/useOnAction.d.ts.map +0 -1
  287. package/lib/typescript/commonjs/src/useOnGetState.d.ts.map +0 -1
  288. package/lib/typescript/commonjs/src/useOnPreventRemove.d.ts.map +0 -1
  289. package/lib/typescript/commonjs/src/useOnRouteFocus.d.ts.map +0 -1
  290. package/lib/typescript/commonjs/src/useOptionsGetters.d.ts.map +0 -1
  291. package/lib/typescript/commonjs/src/usePreventRemove.d.ts.map +0 -1
  292. package/lib/typescript/commonjs/src/usePreventRemoveContext.d.ts.map +0 -1
  293. package/lib/typescript/commonjs/src/useRegisterNavigator.d.ts.map +0 -1
  294. package/lib/typescript/commonjs/src/useRoute.d.ts.map +0 -1
  295. package/lib/typescript/commonjs/src/useRouteCache.d.ts.map +0 -1
  296. package/lib/typescript/commonjs/src/useScheduleUpdate.d.ts.map +0 -1
  297. package/lib/typescript/commonjs/src/useStateForPath.d.ts.map +0 -1
  298. package/lib/typescript/commonjs/src/useSyncState.d.ts.map +0 -1
  299. package/lib/typescript/commonjs/src/validatePathConfig.d.ts.map +0 -1
  300. package/lib/typescript/module/src/BaseNavigationContainer.d.ts +0 -17
  301. package/lib/typescript/module/src/BaseNavigationContainer.d.ts.map +0 -1
  302. package/lib/typescript/module/src/CurrentRenderContext.d.ts +0 -9
  303. package/lib/typescript/module/src/CurrentRenderContext.d.ts.map +0 -1
  304. package/lib/typescript/module/src/DeprecatedNavigationInChildContext.d.ts +0 -6
  305. package/lib/typescript/module/src/DeprecatedNavigationInChildContext.d.ts.map +0 -1
  306. package/lib/typescript/module/src/EnsureSingleNavigator.d.ts +0 -14
  307. package/lib/typescript/module/src/EnsureSingleNavigator.d.ts.map +0 -1
  308. package/lib/typescript/module/src/Group.d.ts +0 -7
  309. package/lib/typescript/module/src/Group.d.ts.map +0 -1
  310. package/lib/typescript/module/src/NavigationBuilderContext.d.ts +0 -36
  311. package/lib/typescript/module/src/NavigationBuilderContext.d.ts.map +0 -1
  312. package/lib/typescript/module/src/NavigationContainerRefContext.d.ts +0 -8
  313. package/lib/typescript/module/src/NavigationContainerRefContext.d.ts.map +0 -1
  314. package/lib/typescript/module/src/NavigationContext.d.ts +0 -8
  315. package/lib/typescript/module/src/NavigationContext.d.ts.map +0 -1
  316. package/lib/typescript/module/src/NavigationFocusedRouteStateContext.d.ts +0 -17
  317. package/lib/typescript/module/src/NavigationFocusedRouteStateContext.d.ts.map +0 -1
  318. package/lib/typescript/module/src/NavigationHelpersContext.d.ts +0 -9
  319. package/lib/typescript/module/src/NavigationHelpersContext.d.ts.map +0 -1
  320. package/lib/typescript/module/src/NavigationIndependentTree.d.ts +0 -8
  321. package/lib/typescript/module/src/NavigationIndependentTree.d.ts.map +0 -1
  322. package/lib/typescript/module/src/NavigationIndependentTreeContext.d.ts +0 -6
  323. package/lib/typescript/module/src/NavigationIndependentTreeContext.d.ts.map +0 -1
  324. package/lib/typescript/module/src/NavigationRouteContext.d.ts +0 -7
  325. package/lib/typescript/module/src/NavigationRouteContext.d.ts.map +0 -1
  326. package/lib/typescript/module/src/NavigationStateContext.d.ts +0 -13
  327. package/lib/typescript/module/src/NavigationStateContext.d.ts.map +0 -1
  328. package/lib/typescript/module/src/PreventRemoveContext.d.ts +0 -13
  329. package/lib/typescript/module/src/PreventRemoveContext.d.ts.map +0 -1
  330. package/lib/typescript/module/src/PreventRemoveProvider.d.ts +0 -10
  331. package/lib/typescript/module/src/PreventRemoveProvider.d.ts.map +0 -1
  332. package/lib/typescript/module/src/SceneView.d.ts +0 -21
  333. package/lib/typescript/module/src/SceneView.d.ts.map +0 -1
  334. package/lib/typescript/module/src/Screen.d.ts +0 -7
  335. package/lib/typescript/module/src/Screen.d.ts.map +0 -1
  336. package/lib/typescript/module/src/StaticContainer.d.ts +0 -6
  337. package/lib/typescript/module/src/StaticContainer.d.ts.map +0 -1
  338. package/lib/typescript/module/src/StaticNavigation.d.ts +0 -188
  339. package/lib/typescript/module/src/StaticNavigation.d.ts.map +0 -1
  340. package/lib/typescript/module/src/UnhandledActionContext.d.ts +0 -4
  341. package/lib/typescript/module/src/UnhandledActionContext.d.ts.map +0 -1
  342. package/lib/typescript/module/src/arrayStartsWith.d.ts +0 -5
  343. package/lib/typescript/module/src/arrayStartsWith.d.ts.map +0 -1
  344. package/lib/typescript/module/src/checkDuplicateRouteNames.d.ts +0 -3
  345. package/lib/typescript/module/src/checkDuplicateRouteNames.d.ts.map +0 -1
  346. package/lib/typescript/module/src/checkSerializable.d.ts +0 -10
  347. package/lib/typescript/module/src/checkSerializable.d.ts.map +0 -1
  348. package/lib/typescript/module/src/createNavigationContainerRef.d.ts +0 -4
  349. package/lib/typescript/module/src/createNavigationContainerRef.d.ts.map +0 -1
  350. package/lib/typescript/module/src/createNavigatorFactory.d.ts +0 -10
  351. package/lib/typescript/module/src/createNavigatorFactory.d.ts.map +0 -1
  352. package/lib/typescript/module/src/deepFreeze.d.ts +0 -3
  353. package/lib/typescript/module/src/deepFreeze.d.ts.map +0 -1
  354. package/lib/typescript/module/src/findFocusedRoute.d.ts +0 -10
  355. package/lib/typescript/module/src/findFocusedRoute.d.ts.map +0 -1
  356. package/lib/typescript/module/src/getActionFromState.d.ts +0 -17
  357. package/lib/typescript/module/src/getActionFromState.d.ts.map +0 -1
  358. package/lib/typescript/module/src/getFocusedRouteNameFromRoute.d.ts +0 -3
  359. package/lib/typescript/module/src/getFocusedRouteNameFromRoute.d.ts.map +0 -1
  360. package/lib/typescript/module/src/getPathFromState.d.ts +0 -40
  361. package/lib/typescript/module/src/getPathFromState.d.ts.map +0 -1
  362. package/lib/typescript/module/src/getPatternParts.d.ts +0 -11
  363. package/lib/typescript/module/src/getPatternParts.d.ts.map +0 -1
  364. package/lib/typescript/module/src/getStateFromPath.d.ts +0 -34
  365. package/lib/typescript/module/src/getStateFromPath.d.ts.map +0 -1
  366. package/lib/typescript/module/src/index.d.ts +0 -35
  367. package/lib/typescript/module/src/index.d.ts.map +0 -1
  368. package/lib/typescript/module/src/isArrayEqual.d.ts +0 -6
  369. package/lib/typescript/module/src/isArrayEqual.d.ts.map +0 -1
  370. package/lib/typescript/module/src/isRecordEqual.d.ts +0 -5
  371. package/lib/typescript/module/src/isRecordEqual.d.ts.map +0 -1
  372. package/lib/typescript/module/src/theming/ThemeContext.d.ts +0 -3
  373. package/lib/typescript/module/src/theming/ThemeContext.d.ts.map +0 -1
  374. package/lib/typescript/module/src/theming/ThemeProvider.d.ts +0 -8
  375. package/lib/typescript/module/src/theming/ThemeProvider.d.ts.map +0 -1
  376. package/lib/typescript/module/src/theming/useTheme.d.ts +0 -2
  377. package/lib/typescript/module/src/theming/useTheme.d.ts.map +0 -1
  378. package/lib/typescript/module/src/types.d.ts +0 -732
  379. package/lib/typescript/module/src/types.d.ts.map +0 -1
  380. package/lib/typescript/module/src/useChildListeners.d.ts +0 -12
  381. package/lib/typescript/module/src/useChildListeners.d.ts.map +0 -1
  382. package/lib/typescript/module/src/useComponent.d.ts +0 -7
  383. package/lib/typescript/module/src/useComponent.d.ts.map +0 -1
  384. package/lib/typescript/module/src/useCurrentRender.d.ts +0 -14
  385. package/lib/typescript/module/src/useCurrentRender.d.ts.map +0 -1
  386. package/lib/typescript/module/src/useDescriptors.d.ts +0 -141
  387. package/lib/typescript/module/src/useDescriptors.d.ts.map +0 -1
  388. package/lib/typescript/module/src/useEventEmitter.d.ts +0 -9
  389. package/lib/typescript/module/src/useEventEmitter.d.ts.map +0 -1
  390. package/lib/typescript/module/src/useFocusEffect.d.ts +0 -11
  391. package/lib/typescript/module/src/useFocusEffect.d.ts.map +0 -1
  392. package/lib/typescript/module/src/useFocusEvents.d.ts +0 -13
  393. package/lib/typescript/module/src/useFocusEvents.d.ts.map +0 -1
  394. package/lib/typescript/module/src/useFocusedListenersChildrenAdapter.d.ts +0 -13
  395. package/lib/typescript/module/src/useFocusedListenersChildrenAdapter.d.ts.map +0 -1
  396. package/lib/typescript/module/src/useIsFocused.d.ts +0 -6
  397. package/lib/typescript/module/src/useIsFocused.d.ts.map +0 -1
  398. package/lib/typescript/module/src/useIsomorphicLayoutEffect.d.ts +0 -6
  399. package/lib/typescript/module/src/useIsomorphicLayoutEffect.d.ts.map +0 -1
  400. package/lib/typescript/module/src/useIsomorphicLayoutEffect.native.d.ts +0 -3
  401. package/lib/typescript/module/src/useIsomorphicLayoutEffect.native.d.ts.map +0 -1
  402. package/lib/typescript/module/src/useKeyedChildListeners.d.ts +0 -12
  403. package/lib/typescript/module/src/useKeyedChildListeners.d.ts.map +0 -1
  404. package/lib/typescript/module/src/useLazyValue.d.ts +0 -2
  405. package/lib/typescript/module/src/useLazyValue.d.ts.map +0 -1
  406. package/lib/typescript/module/src/useNavigation.d.ts +0 -11
  407. package/lib/typescript/module/src/useNavigation.d.ts.map +0 -1
  408. package/lib/typescript/module/src/useNavigationBuilder.d.ts +0 -193
  409. package/lib/typescript/module/src/useNavigationBuilder.d.ts.map +0 -1
  410. package/lib/typescript/module/src/useNavigationCache.d.ts +0 -69
  411. package/lib/typescript/module/src/useNavigationCache.d.ts.map +0 -1
  412. package/lib/typescript/module/src/useNavigationContainerRef.d.ts +0 -3
  413. package/lib/typescript/module/src/useNavigationContainerRef.d.ts.map +0 -1
  414. package/lib/typescript/module/src/useNavigationHelpers.d.ts +0 -102
  415. package/lib/typescript/module/src/useNavigationHelpers.d.ts.map +0 -1
  416. package/lib/typescript/module/src/useNavigationIndependentTree.d.ts +0 -2
  417. package/lib/typescript/module/src/useNavigationIndependentTree.d.ts.map +0 -1
  418. package/lib/typescript/module/src/useNavigationState.d.ts +0 -10
  419. package/lib/typescript/module/src/useNavigationState.d.ts.map +0 -1
  420. package/lib/typescript/module/src/useOnAction.d.ts +0 -26
  421. package/lib/typescript/module/src/useOnAction.d.ts.map +0 -1
  422. package/lib/typescript/module/src/useOnGetState.d.ts +0 -9
  423. package/lib/typescript/module/src/useOnGetState.d.ts.map +0 -1
  424. package/lib/typescript/module/src/useOnPreventRemove.d.ts +0 -17
  425. package/lib/typescript/module/src/useOnPreventRemove.d.ts.map +0 -1
  426. package/lib/typescript/module/src/useOnRouteFocus.d.ts +0 -15
  427. package/lib/typescript/module/src/useOnRouteFocus.d.ts.map +0 -1
  428. package/lib/typescript/module/src/useOptionsGetters.d.ts +0 -13
  429. package/lib/typescript/module/src/useOptionsGetters.d.ts.map +0 -1
  430. package/lib/typescript/module/src/usePreventRemove.d.ts +0 -13
  431. package/lib/typescript/module/src/usePreventRemove.d.ts.map +0 -1
  432. package/lib/typescript/module/src/usePreventRemoveContext.d.ts +0 -5
  433. package/lib/typescript/module/src/usePreventRemoveContext.d.ts.map +0 -1
  434. package/lib/typescript/module/src/useRegisterNavigator.d.ts +0 -6
  435. package/lib/typescript/module/src/useRegisterNavigator.d.ts.map +0 -1
  436. package/lib/typescript/module/src/useRoute.d.ts +0 -9
  437. package/lib/typescript/module/src/useRoute.d.ts.map +0 -1
  438. package/lib/typescript/module/src/useRouteCache.d.ts +0 -14
  439. package/lib/typescript/module/src/useRouteCache.d.ts.map +0 -1
  440. package/lib/typescript/module/src/useScheduleUpdate.d.ts +0 -9
  441. package/lib/typescript/module/src/useScheduleUpdate.d.ts.map +0 -1
  442. package/lib/typescript/module/src/useStateForPath.d.ts +0 -8
  443. package/lib/typescript/module/src/useStateForPath.d.ts.map +0 -1
  444. package/lib/typescript/module/src/useSyncState.d.ts +0 -8
  445. package/lib/typescript/module/src/useSyncState.d.ts.map +0 -1
  446. package/lib/typescript/module/src/validatePathConfig.d.ts +0 -2
  447. package/lib/typescript/module/src/validatePathConfig.d.ts.map +0 -1
  448. /package/lib/typescript/{module/package.json → package.json} +0 -0
  449. /package/lib/typescript/{commonjs/src → src}/BaseNavigationContainer.d.ts +0 -0
  450. /package/lib/typescript/{commonjs/src → src}/CurrentRenderContext.d.ts +0 -0
  451. /package/lib/typescript/{commonjs/src → src}/DeprecatedNavigationInChildContext.d.ts +0 -0
  452. /package/lib/typescript/{commonjs/src → src}/EnsureSingleNavigator.d.ts +0 -0
  453. /package/lib/typescript/{commonjs/src → src}/Group.d.ts +0 -0
  454. /package/lib/typescript/{commonjs/src → src}/NavigationBuilderContext.d.ts +0 -0
  455. /package/lib/typescript/{commonjs/src → src}/NavigationContainerRefContext.d.ts +0 -0
  456. /package/lib/typescript/{commonjs/src → src}/NavigationContext.d.ts +0 -0
  457. /package/lib/typescript/{commonjs/src → src}/NavigationFocusedRouteStateContext.d.ts +0 -0
  458. /package/lib/typescript/{commonjs/src → src}/NavigationHelpersContext.d.ts +0 -0
  459. /package/lib/typescript/{commonjs/src → src}/NavigationIndependentTree.d.ts +0 -0
  460. /package/lib/typescript/{commonjs/src → src}/NavigationIndependentTreeContext.d.ts +0 -0
  461. /package/lib/typescript/{commonjs/src → src}/NavigationRouteContext.d.ts +0 -0
  462. /package/lib/typescript/{commonjs/src → src}/NavigationStateContext.d.ts +0 -0
  463. /package/lib/typescript/{commonjs/src → src}/PreventRemoveContext.d.ts +0 -0
  464. /package/lib/typescript/{commonjs/src → src}/PreventRemoveProvider.d.ts +0 -0
  465. /package/lib/typescript/{commonjs/src → src}/SceneView.d.ts +0 -0
  466. /package/lib/typescript/{commonjs/src → src}/Screen.d.ts +0 -0
  467. /package/lib/typescript/{commonjs/src → src}/StaticContainer.d.ts +0 -0
  468. /package/lib/typescript/{commonjs/src → src}/StaticNavigation.d.ts +0 -0
  469. /package/lib/typescript/{commonjs/src → src}/UnhandledActionContext.d.ts +0 -0
  470. /package/lib/typescript/{commonjs/src → src}/arrayStartsWith.d.ts +0 -0
  471. /package/lib/typescript/{commonjs/src → src}/checkDuplicateRouteNames.d.ts +0 -0
  472. /package/lib/typescript/{commonjs/src → src}/checkSerializable.d.ts +0 -0
  473. /package/lib/typescript/{commonjs/src → src}/createNavigationContainerRef.d.ts +0 -0
  474. /package/lib/typescript/{commonjs/src → src}/createNavigatorFactory.d.ts +0 -0
  475. /package/lib/typescript/{commonjs/src → src}/deepFreeze.d.ts +0 -0
  476. /package/lib/typescript/{commonjs/src → src}/findFocusedRoute.d.ts +0 -0
  477. /package/lib/typescript/{commonjs/src → src}/getActionFromState.d.ts +0 -0
  478. /package/lib/typescript/{commonjs/src → src}/getFocusedRouteNameFromRoute.d.ts +0 -0
  479. /package/lib/typescript/{commonjs/src → src}/getPathFromState.d.ts +0 -0
  480. /package/lib/typescript/{commonjs/src → src}/getPatternParts.d.ts +0 -0
  481. /package/lib/typescript/{commonjs/src → src}/getStateFromPath.d.ts +0 -0
  482. /package/lib/typescript/{commonjs/src → src}/index.d.ts +0 -0
  483. /package/lib/typescript/{commonjs/src → src}/isArrayEqual.d.ts +0 -0
  484. /package/lib/typescript/{commonjs/src → src}/isRecordEqual.d.ts +0 -0
  485. /package/lib/typescript/{commonjs/src → src}/theming/ThemeContext.d.ts +0 -0
  486. /package/lib/typescript/{commonjs/src → src}/theming/ThemeProvider.d.ts +0 -0
  487. /package/lib/typescript/{commonjs/src → src}/theming/useTheme.d.ts +0 -0
  488. /package/lib/typescript/{commonjs/src → src}/types.d.ts +0 -0
  489. /package/lib/typescript/{commonjs/src → src}/useChildListeners.d.ts +0 -0
  490. /package/lib/typescript/{commonjs/src → src}/useComponent.d.ts +0 -0
  491. /package/lib/typescript/{commonjs/src → src}/useCurrentRender.d.ts +0 -0
  492. /package/lib/typescript/{commonjs/src → src}/useDescriptors.d.ts +0 -0
  493. /package/lib/typescript/{commonjs/src → src}/useEventEmitter.d.ts +0 -0
  494. /package/lib/typescript/{commonjs/src → src}/useFocusEffect.d.ts +0 -0
  495. /package/lib/typescript/{commonjs/src → src}/useFocusEvents.d.ts +0 -0
  496. /package/lib/typescript/{commonjs/src → src}/useFocusedListenersChildrenAdapter.d.ts +0 -0
  497. /package/lib/typescript/{commonjs/src → src}/useIsFocused.d.ts +0 -0
  498. /package/lib/typescript/{commonjs/src → src}/useIsomorphicLayoutEffect.d.ts +0 -0
  499. /package/lib/typescript/{commonjs/src → src}/useIsomorphicLayoutEffect.native.d.ts +0 -0
  500. /package/lib/typescript/{commonjs/src → src}/useKeyedChildListeners.d.ts +0 -0
  501. /package/lib/typescript/{commonjs/src → src}/useLazyValue.d.ts +0 -0
  502. /package/lib/typescript/{commonjs/src → src}/useNavigation.d.ts +0 -0
  503. /package/lib/typescript/{commonjs/src → src}/useNavigationBuilder.d.ts +0 -0
  504. /package/lib/typescript/{commonjs/src → src}/useNavigationCache.d.ts +0 -0
  505. /package/lib/typescript/{commonjs/src → src}/useNavigationContainerRef.d.ts +0 -0
  506. /package/lib/typescript/{commonjs/src → src}/useNavigationHelpers.d.ts +0 -0
  507. /package/lib/typescript/{commonjs/src → src}/useNavigationIndependentTree.d.ts +0 -0
  508. /package/lib/typescript/{commonjs/src → src}/useNavigationState.d.ts +0 -0
  509. /package/lib/typescript/{commonjs/src → src}/useOnAction.d.ts +0 -0
  510. /package/lib/typescript/{commonjs/src → src}/useOnGetState.d.ts +0 -0
  511. /package/lib/typescript/{commonjs/src → src}/useOnPreventRemove.d.ts +0 -0
  512. /package/lib/typescript/{commonjs/src → src}/useOnRouteFocus.d.ts +0 -0
  513. /package/lib/typescript/{commonjs/src → src}/useOptionsGetters.d.ts +0 -0
  514. /package/lib/typescript/{commonjs/src → src}/usePreventRemove.d.ts +0 -0
  515. /package/lib/typescript/{commonjs/src → src}/usePreventRemoveContext.d.ts +0 -0
  516. /package/lib/typescript/{commonjs/src → src}/useRegisterNavigator.d.ts +0 -0
  517. /package/lib/typescript/{commonjs/src → src}/useRoute.d.ts +0 -0
  518. /package/lib/typescript/{commonjs/src → src}/useRouteCache.d.ts +0 -0
  519. /package/lib/typescript/{commonjs/src → src}/useScheduleUpdate.d.ts +0 -0
  520. /package/lib/typescript/{commonjs/src → src}/useStateForPath.d.ts +0 -0
  521. /package/lib/typescript/{commonjs/src → src}/useSyncState.d.ts +0 -0
  522. /package/lib/typescript/{commonjs/src → src}/validatePathConfig.d.ts +0 -0
@@ -1,111 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.getActionFromState = getActionFromState;
7
- function getActionFromState(state, options) {
8
- // Create a normalized configs object which will be easier to use
9
- const normalizedConfig = options ? createNormalizedConfigItem(options) : {};
10
- const routes = state.index != null ? state.routes.slice(0, state.index + 1) : state.routes;
11
- if (routes.length === 0) {
12
- return undefined;
13
- }
14
- if (!(routes.length === 1 && routes[0].key === undefined || routes.length === 2 && routes[0].key === undefined && routes[0].name === normalizedConfig?.initialRouteName && routes[1].key === undefined)) {
15
- return {
16
- type: 'RESET',
17
- payload: state
18
- };
19
- }
20
- const route = state.routes[state.index ?? state.routes.length - 1];
21
- let current = route?.state;
22
- let config = normalizedConfig?.screens?.[route?.name];
23
- let params = {
24
- ...route.params
25
- };
26
- const payload = route ? {
27
- name: route.name,
28
- path: route.path,
29
- params
30
- } : undefined;
31
-
32
- // If the screen contains a navigator, pop other screens to navigate to it
33
- // This avoid pushing multiple instances of navigators onto a stack
34
- //
35
- // For example:
36
- // - RootStack
37
- // - BottomTabs
38
- // - SomeScreen
39
- //
40
- // In this case, if deep linking to `BottomTabs`, we should pop `SomeScreen`
41
- // Otherwise, we'll end up with 2 instances of `BottomTabs` in the stack
42
- //
43
- // There are 2 ways we can detect if a screen contains a navigator:
44
- // - The route contains nested state in `route.state`
45
- // - Nested screens are defined in the config
46
- if (payload && config?.screens && Object.keys(config.screens).length) {
47
- payload.pop = true;
48
- }
49
- while (current) {
50
- if (current.routes.length === 0) {
51
- return undefined;
52
- }
53
- const routes = current.index != null ? current.routes.slice(0, current.index + 1) : current.routes;
54
- const route = routes[routes.length - 1];
55
-
56
- // Explicitly set to override existing value when merging params
57
- Object.assign(params, {
58
- initial: undefined,
59
- screen: undefined,
60
- params: undefined,
61
- state: undefined
62
- });
63
- if (routes.length === 1 && routes[0].key === undefined) {
64
- params.initial = true;
65
- params.screen = route.name;
66
- } else if (routes.length === 2 && routes[0].key === undefined && routes[0].name === config?.initialRouteName && routes[1].key === undefined) {
67
- params.initial = false;
68
- params.screen = route.name;
69
- } else {
70
- params.state = current;
71
- break;
72
- }
73
- if (route.state) {
74
- params.params = {
75
- ...route.params
76
- };
77
- params.pop = true;
78
- params = params.params;
79
- } else {
80
- params.path = route.path;
81
- params.params = route.params;
82
- }
83
- current = route.state;
84
- config = config?.screens?.[route.name];
85
- if (config?.screens && Object.keys(config.screens).length) {
86
- params.pop = true;
87
- }
88
- }
89
- if (payload?.params.screen || payload?.params.state) {
90
- payload.pop = true;
91
- }
92
- if (!payload) {
93
- return;
94
- }
95
-
96
- // Try to construct payload for a `NAVIGATE` action from the state
97
- // This lets us preserve the navigation state and not lose it
98
- return {
99
- type: 'NAVIGATE',
100
- payload
101
- };
102
- }
103
- const createNormalizedConfigItem = config => typeof config === 'object' && config != null ? {
104
- initialRouteName: config.initialRouteName,
105
- screens: config.screens != null ? createNormalizedConfigs(config.screens) : undefined
106
- } : {};
107
- const createNormalizedConfigs = options => Object.entries(options).reduce((acc, [k, v]) => {
108
- acc[k] = createNormalizedConfigItem(v);
109
- return acc;
110
- }, {});
111
- //# sourceMappingURL=getActionFromState.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["getActionFromState","state","options","normalizedConfig","createNormalizedConfigItem","routes","index","slice","length","undefined","key","name","initialRouteName","type","payload","route","current","config","screens","params","path","Object","keys","pop","assign","initial","screen","createNormalizedConfigs","entries","reduce","acc","k","v"],"sourceRoot":"../../src","sources":["getActionFromState.tsx"],"mappings":";;;;;;AA8BO,SAASA,kBAAkBA,CAChCC,KAAoC,EACpCC,OAAiB,EACmD;EACpE;EACA,MAAMC,gBAAgB,GAAGD,OAAO,GAC5BE,0BAA0B,CAACF,OAAsC,CAAC,GAClE,CAAC,CAAC;EAEN,MAAMG,MAAM,GACVJ,KAAK,CAACK,KAAK,IAAI,IAAI,GAAGL,KAAK,CAACI,MAAM,CAACE,KAAK,CAAC,CAAC,EAAEN,KAAK,CAACK,KAAK,GAAG,CAAC,CAAC,GAAGL,KAAK,CAACI,MAAM;EAE7E,IAAIA,MAAM,CAACG,MAAM,KAAK,CAAC,EAAE;IACvB,OAAOC,SAAS;EAClB;EAEA,IACE,EACGJ,MAAM,CAACG,MAAM,KAAK,CAAC,IAAIH,MAAM,CAAC,CAAC,CAAC,CAACK,GAAG,KAAKD,SAAS,IAClDJ,MAAM,CAACG,MAAM,KAAK,CAAC,IAClBH,MAAM,CAAC,CAAC,CAAC,CAACK,GAAG,KAAKD,SAAS,IAC3BJ,MAAM,CAAC,CAAC,CAAC,CAACM,IAAI,KAAKR,gBAAgB,EAAES,gBAAgB,IACrDP,MAAM,CAAC,CAAC,CAAC,CAACK,GAAG,KAAKD,SAAU,CAC/B,EACD;IACA,OAAO;MACLI,IAAI,EAAE,OAAO;MACbC,OAAO,EAAEb;IACX,CAAC;EACH;EAEA,MAAMc,KAAK,GAAGd,KAAK,CAACI,MAAM,CAACJ,KAAK,CAACK,KAAK,IAAIL,KAAK,CAACI,MAAM,CAACG,MAAM,GAAG,CAAC,CAAC;EAElE,IAAIQ,OAAkD,GAAGD,KAAK,EAAEd,KAAK;EACrE,IAAIgB,MAA8B,GAAGd,gBAAgB,EAAEe,OAAO,GAAGH,KAAK,EAAEJ,IAAI,CAAC;EAC7E,IAAIQ,MAAM,GAAG;IAAE,GAAGJ,KAAK,CAACI;EAAO,CAAyC;EAExE,M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AACL,gBAAgB;EACzCM,OAAO,EACLD,MAAM,CAACC,OAAO,IAAI,IAAI,GAClBS,uBAAuB,CAACV,MAAM,CAACC,OAAO,CAAC,GACvCT;AACR,CAAC,GACD,CAAC,CAAC;AAER,MAAMkB,uBAAuB,GAAIzB,OAA8B,IAC7DmB,MAAM,CAACO,OAAO,CAAC1B,OAAO,CAAC,CAAC2B,MAAM,CAA6B,CAACC,GAAG,EAAE,CAACC,CAAC,EAAEC,CAAC,CAAC,KAAK;EAC1EF,GAAG,CAACC,CAAC,CAAC,GAAG3B,0BAA0B,CAAC4B,CAAC,CAAC;EACtC,OAAOF,GAAG;AACZ,CAAC,EAAE,CAAC,CAAC,CAAC","ignoreList":[]}
@@ -1,22 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.getFocusedRouteNameFromRoute = getFocusedRouteNameFromRoute;
7
- var _useRouteCache = require("./useRouteCache.js");
8
- function getFocusedRouteNameFromRoute(route) {
9
- // @ts-expect-error: this isn't in type definitions coz we want this private
10
- const state = route[_useRouteCache.CHILD_STATE] ?? route.state;
11
- const params = route.params;
12
- const routeName = state ?
13
- // Get the currently active route name in the nested navigator
14
- state.routes[
15
- // If we have a partial state without index, for tab/drawer, first screen will be focused one, and last for stack
16
- // The type property will only exist for rehydrated state and not for state from deep link
17
- state.index ?? (typeof state.type === 'string' && state.type !== 'stack' ? 0 : state.routes.length - 1)].name :
18
- // If state doesn't exist, we need to default to `screen` param if available
19
- typeof params?.screen === 'string' ? params.screen : undefined;
20
- return routeName;
21
- }
22
- //# sourceMappingURL=getFocusedRouteNameFromRoute.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_useRouteCache","require","getFocusedRouteNameFromRoute","route","state","CHILD_STATE","params","routeName","routes","index","type","length","name","screen","undefined"],"sourceRoot":"../../src","sources":["getFocusedRouteNameFromRoute.tsx"],"mappings":";;;;;;AAEA,IAAAA,cAAA,GAAAC,OAAA;AAEO,SAASC,4BAA4BA,CAC1CC,KAA6B,EACT;EACpB;EACA,MAAMC,KAAK,GAAGD,KAAK,CAACE,0BAAW,CAAC,IAAIF,KAAK,CAACC,KAAK;EAC/C,MAAME,MAAM,GAAGH,KAAK,CAACG,MAA0C;EAE/D,MAAMC,SAAS,GAAGH,KAAK;EACnB;EACAA,KAAK,CAACI,MAAM;EACV;EACA;EACAJ,KAAK,CAACK,KAAK,KACR,OAAOL,KAAK,CAACM,IAAI,KAAK,QAAQ,IAAIN,KAAK,CAACM,IAAI,KAAK,OAAO,GACrD,CAAC,GACDN,KAAK,CAACI,MAAM,CAACG,MAAM,GAAG,CAAC,CAAC,CAC/B,CAACC,IAAI;EACN;EACA,OAAON,MAAM,EAAEO,MAAM,KAAK,QAAQ,GAChCP,MAAM,CAACO,MAAM,GACbC,SAAS;EAEf,OAAOP,SAAS;AAClB","ignoreList":[]}
@@ -1,241 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.getPathFromState = getPathFromState;
7
- var queryString = _interopRequireWildcard(require("query-string"));
8
- var _getPatternParts = require("./getPatternParts.js");
9
- var _validatePathConfig = require("./validatePathConfig.js");
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
- const getActiveRoute = state => {
13
- const route = typeof state.index === 'number' ? state.routes[state.index] : state.routes[state.routes.length - 1];
14
- if (route.state) {
15
- return getActiveRoute(route.state);
16
- }
17
- return route;
18
- };
19
- const cachedNormalizedConfigs = new WeakMap();
20
- const getNormalizedConfigs = options => {
21
- if (!options?.screens) return {};
22
- const cached = cachedNormalizedConfigs.get(options?.screens);
23
- if (cached) return cached;
24
- const normalizedConfigs = createNormalizedConfigs(options.screens);
25
- cachedNormalizedConfigs.set(options.screens, normalizedConfigs);
26
- return normalizedConfigs;
27
- };
28
-
29
- /**
30
- * Utility to serialize a navigation state object to a path string.
31
- *
32
- * @example
33
- * ```js
34
- * getPathFromState(
35
- * {
36
- * routes: [
37
- * {
38
- * name: 'Chat',
39
- * params: { author: 'Jane', id: 42 },
40
- * },
41
- * ],
42
- * },
43
- * {
44
- * screens: {
45
- * Chat: {
46
- * path: 'chat/:author/:id',
47
- * stringify: { author: author => author.toLowerCase() }
48
- * }
49
- * }
50
- * }
51
- * )
52
- * ```
53
- *
54
- * @param state Navigation state to serialize.
55
- * @param options Extra options to fine-tune how to serialize the path.
56
- * @returns Path representing the state, e.g. /foo/bar?count=42.
57
- */
58
- function getPathFromState(state, options) {
59
- if (state == null) {
60
- throw Error(`Got '${String(state)}' for the navigation state. You must pass a valid state object.`);
61
- }
62
- if (options) {
63
- (0, _validatePathConfig.validatePathConfig)(options);
64
- }
65
- const configs = getNormalizedConfigs(options);
66
- let path = '/';
67
- let current = state;
68
- const allParams = {};
69
- while (current) {
70
- let index = typeof current.index === 'number' ? current.index : 0;
71
- let route = current.routes[index];
72
- let parts;
73
- let focusedParams;
74
- let currentOptions = configs;
75
- const focusedRoute = getActiveRoute(state);
76
-
77
- // Keep all the route names that appeared during going deeper in config in case the pattern is resolved to undefined
78
- const nestedRouteNames = [];
79
- let hasNext = true;
80
- while (route.name in currentOptions && hasNext) {
81
- parts = currentOptions[route.name].parts;
82
- nestedRouteNames.push(route.name);
83
- if (route.params) {
84
- const options = currentOptions[route.name];
85
- const currentParams = Object.fromEntries(Object.entries(route.params).map(([key, value]) => {
86
- if (value === undefined) {
87
- if (options) {
88
- const optional = options.parts?.find(part => part.param === key)?.optional;
89
- if (optional) {
90
- return null;
91
- }
92
- } else {
93
- return null;
94
- }
95
- }
96
- const stringify = options?.stringify?.[key] ?? String;
97
- return [key, stringify(value)];
98
- }).filter(entry => entry != null));
99
- if (parts?.length) {
100
- Object.assign(allParams, currentParams);
101
- }
102
- if (focusedRoute === route) {
103
- // If this is the focused route, keep the params for later use
104
- // We save it here since it's been stringified already
105
- focusedParams = {
106
- ...currentParams
107
- };
108
- parts
109
- // eslint-disable-next-line no-loop-func
110
- ?.forEach(({
111
- param
112
- }) => {
113
- if (param) {
114
- // Remove the params present in the pattern since we'll only use the rest for query string
115
- if (focusedParams) {
116
- // eslint-disable-next-line @typescript-eslint/no-dynamic-delete
117
- delete focusedParams[param];
118
- }
119
- }
120
- });
121
- }
122
- }
123
-
124
- // If there is no `screens` property or no nested state, we return pattern
125
- if (!currentOptions[route.name].screens || route.state === undefined) {
126
- hasNext = false;
127
- } else {
128
- index = typeof route.state.index === 'number' ? route.state.index : route.state.routes.length - 1;
129
- const nextRoute = route.state.routes[index];
130
- const nestedConfig = currentOptions[route.name].screens;
131
-
132
- // if there is config for next route name, we go deeper
133
- if (nestedConfig && nextRoute.name in nestedConfig) {
134
- route = nextRoute;
135
- currentOptions = nestedConfig;
136
- } else {
137
- // If not, there is no sense in going deeper in config
138
- hasNext = false;
139
- }
140
- }
141
- }
142
- if (currentOptions[route.name] !== undefined) {
143
- path += parts?.map(({
144
- segment,
145
- param,
146
- optional
147
- }) => {
148
- // We don't know what to show for wildcard patterns
149
- // Showing the route name seems ok, though whatever we show here will be incorrect
150
- // Since the page doesn't actually exist
151
- if (segment === '*') {
152
- return route.name;
153
- }
154
-
155
- // If the path has a pattern for a param, put the param in the path
156
- if (param) {
157
- const value = allParams[param];
158
- if (value === undefined && optional) {
159
- // Optional params without value assigned in route.params should be ignored
160
- return '';
161
- }
162
-
163
- // Valid characters according to
164
- // https://datatracker.ietf.org/doc/html/rfc3986#section-3.3 (see pchar definition)
165
- return String(value).replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]/g, char => encodeURIComponent(char));
166
- }
167
- return encodeURIComponent(segment);
168
- }).join('/');
169
- } else {
170
- path += encodeURIComponent(route.name);
171
- }
172
- if (!focusedParams && focusedRoute.params) {
173
- focusedParams = Object.fromEntries(Object.entries(focusedRoute.params).map(([key, value]) => [key, String(value)]));
174
- }
175
- if (route.state) {
176
- path += '/';
177
- } else if (focusedParams) {
178
- for (const param in focusedParams) {
179
- if (focusedParams[param] === 'undefined') {
180
- // eslint-disable-next-line @typescript-eslint/no-dynamic-delete
181
- delete focusedParams[param];
182
- }
183
- }
184
- const query = queryString.stringify(focusedParams, {
185
- sort: false
186
- });
187
- if (query) {
188
- path += `?${query}`;
189
- }
190
- }
191
- current = route.state;
192
- }
193
-
194
- // Include the root path if specified
195
- if (options?.path) {
196
- path = `${options.path}/${path}`;
197
- }
198
-
199
- // Remove multiple as well as trailing slashes
200
- path = path.replace(/\/+/g, '/');
201
- path = path.length > 1 ? path.replace(/\/$/, '') : path;
202
-
203
- // If path doesn't start with a slash, add it
204
- // This makes sure that history.pushState will update the path correctly instead of appending
205
- if (!path.startsWith('/')) {
206
- path = `/${path}`;
207
- }
208
- return path;
209
- }
210
- const createConfigItem = (config, parentParts) => {
211
- if (typeof config === 'string') {
212
- // If a string is specified as the value of the key(e.g. Foo: '/path'), use it as the pattern
213
- const parts = (0, _getPatternParts.getPatternParts)(config);
214
- if (parentParts) {
215
- return {
216
- parts: [...parentParts, ...parts]
217
- };
218
- }
219
- return {
220
- parts
221
- };
222
- }
223
- if (config.exact && config.path === undefined) {
224
- throw new Error("A 'path' needs to be specified when specifying 'exact: true'. If you don't want this screen in the URL, specify it as empty string, e.g. `path: ''`.");
225
- }
226
-
227
- // If an object is specified as the value (e.g. Foo: { ... }),
228
- // It can have `path` property and `screens` prop which has nested configs
229
- const parts = config.exact !== true ? [...(parentParts || []), ...(config.path ? (0, _getPatternParts.getPatternParts)(config.path) : [])] : config.path ? (0, _getPatternParts.getPatternParts)(config.path) : undefined;
230
- const screens = config.screens ? createNormalizedConfigs(config.screens, parts) : undefined;
231
- return {
232
- parts,
233
- stringify: config.stringify,
234
- screens
235
- };
236
- };
237
- const createNormalizedConfigs = (options, parts) => Object.fromEntries(Object.entries(options).map(([name, c]) => {
238
- const result = createConfigItem(c, parts);
239
- return [name, result];
240
- }));
241
- //# sourceMappingURL=getPathFromState.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["queryString","_interopRequireWildcard","require","_getPatternParts","_validatePathConfig","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","getActiveRoute","state","route","index","routes","length","cachedNormalizedConfigs","getNormalizedConfigs","options","screens","cached","normalizedConfigs","createNormalizedConfigs","getPathFromState","Error","String","validatePathConfig","configs","path","current","allParams","parts","focusedParams","currentOptions","focusedRoute","nestedRouteNames","hasNext","name","push","params","currentParams","fromEntries","entries","map","key","value","undefined","optional","find","part","param","stringify","filter","entry","assign","forEach","nextRoute","nestedConfig","segment","replace","char","encodeURIComponent","join","query","sort","startsWith","createConfigItem","config","parentParts","getPatternParts","exact","c","result"],"sourceRoot":"../../src","sources":["getPathFromState.tsx"],"mappings":";;;;;;AAKA,IAAAA,WAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,gBAAA,GAAAD,OAAA;AAEA,IAAAE,mBAAA,GAAAF,OAAA;AAA0D,SAAAG,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAL,wBAAAK,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAA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C,GAC5BkB,SAAS;EAEjB,MAAM3B,OAAO,GAAGgD,MAAM,CAAChD,OAAO,GAC1BG,uBAAuB,CAAC6C,MAAM,CAAChD,OAAO,EAAEY,KAAK,CAAC,GAC9Ce,SAAS;EAEb,OAAO;IACLf,KAAK;IACLoB,SAAS,EAAEgB,MAAM,CAAChB,SAAS;IAC3BhC;EACF,CAAC;AACH,CAAC;AAED,MAAMG,uBAAuB,GAAGA,CAC9BJ,OAA8B,EAC9Ba,KAAqB,KAErB7B,MAAM,CAACuC,WAAW,CAChBvC,MAAM,CAACwC,OAAO,CAACxB,OAAO,CAAC,CAACyB,GAAG,CAAC,CAAC,CAACN,IAAI,EAAEkC,CAAC,CAAC,KAAK;EACzC,MAAMC,MAAM,GAAGN,gBAAgB,CAACK,CAAC,EAAExC,KAAK,CAAC;EAEzC,OAAO,CAACM,IAAI,EAAEmC,MAAM,CAAC;AACvB,CAAC,CACH,CAAC","ignoreList":[]}
@@ -1,105 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.getPatternParts = getPatternParts;
7
- /**
8
- * Parse a path into an array of parts with information about each segment.
9
- */
10
- function getPatternParts(path) {
11
- const parts = [];
12
- let current = {
13
- segment: ''
14
- };
15
- let isRegex = false;
16
- let isParam = false;
17
- let regexInnerParens = 0;
18
-
19
- // One extra iteration to add the last character
20
- for (let i = 0; i <= path.length; i++) {
21
- const char = path[i];
22
- if (char != null) {
23
- current.segment += char;
24
- }
25
- if (char === ':') {
26
- // The segment must start with a colon if it's a param
27
- if (current.segment === ':') {
28
- isParam = true;
29
- } else if (!isRegex) {
30
- throw new Error(`Encountered ':' in the middle of a segment in path: ${path}`);
31
- }
32
- } else if (char === '(') {
33
- if (isParam) {
34
- if (isRegex) {
35
- // The '(' is part of the regex if we're already inside one
36
- regexInnerParens++;
37
- } else {
38
- isRegex = true;
39
- }
40
- } else {
41
- throw new Error(`Encountered '(' without preceding ':' in path: ${path}`);
42
- }
43
- } else if (char === ')') {
44
- if (isParam && isRegex) {
45
- if (regexInnerParens) {
46
- // The ')' is part of the regex if we're already inside one
47
- regexInnerParens--;
48
- current.regex += char;
49
- } else {
50
- isRegex = false;
51
- isParam = false;
52
- }
53
- } else {
54
- throw new Error(`Encountered ')' without preceding '(' in path: ${path}`);
55
- }
56
- } else if (char === '?') {
57
- if (current.param) {
58
- isParam = false;
59
- current.optional = true;
60
- } else {
61
- throw new Error(`Encountered '?' without preceding ':' in path: ${path}`);
62
- }
63
- } else if (char == null || char === '/' && !isRegex) {
64
- isParam = false;
65
-
66
- // Remove trailing slash from segment
67
- current.segment = current.segment.replace(/\/$/, '');
68
- if (current.segment === '') {
69
- continue;
70
- }
71
- if (current.param) {
72
- current.param = current.param.replace(/^:/, '');
73
- }
74
- if (current.regex) {
75
- current.regex = current.regex.replace(/^\(/, '').replace(/\)$/, '');
76
- }
77
- parts.push(current);
78
- if (char == null) {
79
- break;
80
- }
81
- current = {
82
- segment: ''
83
- };
84
- }
85
- if (isRegex) {
86
- current.regex = current.regex || '';
87
- current.regex += char;
88
- }
89
- if (isParam && !isRegex) {
90
- current.param = current.param || '';
91
- current.param += char;
92
- }
93
- }
94
- if (isRegex) {
95
- throw new Error(`Could not find closing ')' in path: ${path}`);
96
- }
97
- const params = parts.map(part => part.param).filter(Boolean);
98
- for (const [index, param] of params.entries()) {
99
- if (params.indexOf(param) !== index) {
100
- throw new Error(`Duplicate param name '${param}' found in path: ${path}`);
101
- }
102
- }
103
- return parts;
104
- }
105
- //# sourceMappingURL=getPatternParts.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["getPatternParts","path","parts","current","segment","isRegex","isParam","regexInnerParens","i","length","char","Error","regex","param","optional","replace","push","params","map","part","filter","Boolean","index","entries","indexOf"],"sourceRoot":"../../src","sources":["getPatternParts.tsx"],"mappings":";;;;;;AAOA;AACA;AACA;AACO,SAASA,eAAeA,CAACC,IAAY,EAAiB;EAC3D,MAAMC,KAAoB,GAAG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