@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.
- package/lib/commonjs/BaseNavigationContainer.js +356 -0
- package/lib/commonjs/BaseNavigationContainer.js.map +1 -0
- package/lib/commonjs/CurrentRenderContext.js +15 -0
- package/lib/commonjs/DeprecatedNavigationInChildContext.js +14 -0
- package/lib/commonjs/EnsureSingleNavigator.js +43 -0
- package/lib/commonjs/Group.js +14 -0
- package/lib/commonjs/NavigationBuilderContext.js +17 -0
- package/lib/commonjs/NavigationContainerRefContext.js +14 -0
- package/lib/commonjs/NavigationContext.js +14 -0
- package/lib/commonjs/NavigationHelpersContext.js +15 -0
- package/lib/commonjs/NavigationIndependentTree.js +35 -0
- package/lib/commonjs/NavigationIndependentTreeContext.js +14 -0
- package/lib/commonjs/NavigationRouteContext.js +14 -0
- package/lib/commonjs/NavigationStateContext.js +29 -0
- package/lib/commonjs/PreventRemoveContext.js +16 -0
- package/lib/commonjs/PreventRemoveProvider.js +91 -0
- package/lib/commonjs/SceneView.js +96 -0
- package/lib/commonjs/Screen.js +14 -0
- package/lib/commonjs/StaticContainer.js +31 -0
- package/lib/commonjs/StaticNavigation.js +256 -0
- package/lib/commonjs/StaticNavigation.js.map +1 -0
- package/lib/commonjs/UnhandledActionContext.js +11 -0
- package/lib/commonjs/checkDuplicateRouteNames.js +25 -0
- package/lib/commonjs/checkSerializable.js +50 -0
- package/lib/commonjs/createNavigationContainerRef.js +69 -0
- package/lib/commonjs/createNavigatorFactory.js +34 -0
- package/lib/commonjs/deepFreeze.js +37 -0
- package/lib/commonjs/findFocusedRoute.js +15 -0
- package/lib/commonjs/getActionFromState.js +86 -0
- package/lib/commonjs/getFocusedRouteNameFromRoute.js +22 -0
- package/lib/commonjs/getPathFromState.js +218 -0
- package/lib/commonjs/getPathFromState.js.map +1 -0
- package/lib/commonjs/getStateFromPath.js +475 -0
- package/lib/commonjs/getStateFromPath.js.map +1 -0
- package/lib/commonjs/index.js +287 -0
- package/lib/commonjs/isArrayEqual.js +20 -0
- package/lib/commonjs/isRecordEqual.js +21 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/theming/ThemeContext.js +12 -0
- package/lib/commonjs/theming/ThemeProvider.js +21 -0
- package/lib/commonjs/theming/useTheme.js +18 -0
- package/lib/commonjs/types.js +27 -0
- package/lib/commonjs/types.js.map +1 -0
- package/lib/commonjs/useChildListeners.js +36 -0
- package/lib/commonjs/useComponent.js +40 -0
- package/lib/commonjs/useCurrentRender.js +25 -0
- package/lib/commonjs/useDescriptors.js +188 -0
- package/lib/commonjs/useEventEmitter.js +105 -0
- package/lib/commonjs/useFocusEffect.js +80 -0
- package/lib/commonjs/useFocusEvents.js +70 -0
- package/lib/commonjs/useFocusedListenersChildrenAdapter.js +48 -0
- package/lib/commonjs/useIsFocused.js +28 -0
- package/lib/commonjs/useIsomorphicLayoutEffect.js +12 -0
- package/lib/commonjs/useIsomorphicLayoutEffect.native.js +9 -0
- package/lib/commonjs/useKeyedChildListeners.js +33 -0
- package/lib/commonjs/useLazyValue.js +17 -0
- package/lib/commonjs/useNavigation.js +27 -0
- package/lib/commonjs/useNavigationBuilder.js +478 -0
- package/lib/commonjs/useNavigationCache.js +162 -0
- package/lib/commonjs/useNavigationContainerRef.js +18 -0
- package/lib/commonjs/useNavigationHelpers.js +76 -0
- package/lib/commonjs/useNavigationIndependentTree.js +14 -0
- package/lib/commonjs/useNavigationState.js +26 -0
- package/lib/commonjs/useOnAction.js +106 -0
- package/lib/commonjs/useOnGetState.js +48 -0
- package/lib/commonjs/useOnPreventRemove.js +72 -0
- package/lib/commonjs/useOnRouteFocus.js +36 -0
- package/lib/commonjs/useOptionsGetters.js +78 -0
- package/lib/commonjs/usePreventRemove.js +48 -0
- package/lib/commonjs/usePreventRemoveContext.js +18 -0
- package/lib/commonjs/useRegisterNavigator.js +32 -0
- package/lib/commonjs/useRoute.js +23 -0
- package/lib/commonjs/useRouteCache.js +69 -0
- package/lib/commonjs/useSyncState.js +48 -0
- package/lib/commonjs/validatePathConfig.js +49 -0
- package/lib/commonjs/validatePathConfig.js.map +1 -0
- package/lib/module/BaseNavigationContainer.js +349 -0
- package/lib/module/BaseNavigationContainer.js.map +1 -0
- package/lib/module/CurrentRenderContext.js +10 -0
- package/lib/module/CurrentRenderContext.js.map +1 -0
- package/lib/module/DeprecatedNavigationInChildContext.js +9 -0
- package/lib/module/DeprecatedNavigationInChildContext.js.map +1 -0
- package/lib/module/EnsureSingleNavigator.js +36 -0
- package/lib/module/EnsureSingleNavigator.js.map +1 -0
- package/lib/module/Group.js +10 -0
- package/lib/module/Group.js.map +1 -0
- package/lib/module/NavigationBuilderContext.js +11 -0
- package/lib/module/NavigationBuilderContext.js.map +1 -0
- package/lib/module/NavigationContainerRefContext.js +8 -0
- package/lib/module/NavigationContainerRefContext.js.map +1 -0
- package/lib/module/NavigationContext.js +8 -0
- package/lib/module/NavigationContext.js.map +1 -0
- package/lib/module/NavigationHelpersContext.js +9 -0
- package/lib/module/NavigationHelpersContext.js.map +1 -0
- package/lib/module/NavigationIndependentTree.js +30 -0
- package/lib/module/NavigationIndependentTree.js.map +1 -0
- package/lib/module/NavigationIndependentTreeContext.js +9 -0
- package/lib/module/NavigationIndependentTreeContext.js.map +1 -0
- package/lib/module/NavigationRouteContext.js +9 -0
- package/lib/module/NavigationRouteContext.js.map +1 -0
- package/lib/module/NavigationStateContext.js +23 -0
- package/lib/module/NavigationStateContext.js.map +1 -0
- package/lib/module/PreventRemoveContext.js +11 -0
- package/lib/module/PreventRemoveContext.js.map +1 -0
- package/lib/module/PreventRemoveProvider.js +84 -0
- package/lib/module/PreventRemoveProvider.js.map +1 -0
- package/lib/module/SceneView.js +90 -0
- package/lib/module/SceneView.js.map +1 -0
- package/lib/module/Screen.js +10 -0
- package/lib/module/Screen.js.map +1 -0
- package/lib/module/StaticContainer.js +26 -0
- package/lib/module/StaticContainer.js.map +1 -0
- package/lib/module/StaticNavigation.js +249 -0
- package/lib/module/StaticNavigation.js.map +1 -0
- package/lib/module/UnhandledActionContext.js +5 -0
- package/lib/module/UnhandledActionContext.js.map +1 -0
- package/lib/module/checkDuplicateRouteNames.js +21 -0
- package/lib/module/checkDuplicateRouteNames.js.map +1 -0
- package/lib/module/checkSerializable.js +46 -0
- package/lib/module/checkSerializable.js.map +1 -0
- package/lib/module/createNavigationContainerRef.js +64 -0
- package/lib/module/createNavigationContainerRef.js.map +1 -0
- package/lib/module/createNavigatorFactory.js +31 -0
- package/lib/module/createNavigatorFactory.js.map +1 -0
- package/lib/module/deepFreeze.js +31 -0
- package/lib/module/deepFreeze.js.map +1 -0
- package/lib/module/findFocusedRoute.js +11 -0
- package/lib/module/findFocusedRoute.js.map +1 -0
- package/lib/module/getActionFromState.js +82 -0
- package/lib/module/getActionFromState.js.map +1 -0
- package/lib/module/getFocusedRouteNameFromRoute.js +18 -0
- package/lib/module/getFocusedRouteNameFromRoute.js.map +1 -0
- package/lib/module/getPathFromState.js +212 -0
- package/lib/module/getPathFromState.js.map +1 -0
- package/lib/module/getStateFromPath.js +468 -0
- package/lib/module/getStateFromPath.js.map +1 -0
- package/lib/module/index.js +36 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/isArrayEqual.js +16 -0
- package/lib/module/isArrayEqual.js.map +1 -0
- package/lib/module/isRecordEqual.js +17 -0
- package/lib/module/isRecordEqual.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/theming/ThemeContext.js +6 -0
- package/lib/module/theming/ThemeContext.js.map +1 -0
- package/lib/module/theming/ThemeProvider.js +15 -0
- package/lib/module/theming/ThemeProvider.js.map +1 -0
- package/lib/module/theming/useTheme.js +12 -0
- package/lib/module/theming/useTheme.js.map +1 -0
- package/lib/module/types.js +23 -0
- package/lib/module/types.js.map +1 -0
- package/lib/module/useChildListeners.js +30 -0
- package/lib/module/useChildListeners.js.map +1 -0
- package/lib/module/useComponent.js +34 -0
- package/lib/module/useComponent.js.map +1 -0
- package/lib/module/useCurrentRender.js +19 -0
- package/lib/module/useCurrentRender.js.map +1 -0
- package/lib/module/useDescriptors.js +182 -0
- package/lib/module/useDescriptors.js.map +1 -0
- package/lib/module/useEventEmitter.js +99 -0
- package/lib/module/useEventEmitter.js.map +1 -0
- package/lib/module/useFocusEffect.js +74 -0
- package/lib/module/useFocusEffect.js.map +1 -0
- package/lib/module/useFocusEvents.js +64 -0
- package/lib/module/useFocusEvents.js.map +1 -0
- package/lib/module/useFocusedListenersChildrenAdapter.js +42 -0
- package/lib/module/useFocusedListenersChildrenAdapter.js.map +1 -0
- package/lib/module/useIsFocused.js +23 -0
- package/lib/module/useIsFocused.js.map +1 -0
- package/lib/module/useIsomorphicLayoutEffect.js +9 -0
- package/lib/module/useIsomorphicLayoutEffect.js.map +1 -0
- package/lib/module/useIsomorphicLayoutEffect.native.js +5 -0
- package/lib/module/useIsomorphicLayoutEffect.native.js.map +1 -0
- package/lib/module/useKeyedChildListeners.js +27 -0
- package/lib/module/useKeyedChildListeners.js.map +1 -0
- package/lib/module/useLazyValue.js +11 -0
- package/lib/module/useLazyValue.js.map +1 -0
- package/lib/module/useNavigation.js +21 -0
- package/lib/module/useNavigation.js.map +1 -0
- package/lib/module/useNavigationBuilder.js +472 -0
- package/lib/module/useNavigationBuilder.js.map +1 -0
- package/lib/module/useNavigationCache.js +156 -0
- package/lib/module/useNavigationCache.js.map +1 -0
- package/lib/module/useNavigationContainerRef.js +12 -0
- package/lib/module/useNavigationContainerRef.js.map +1 -0
- package/lib/module/useNavigationHelpers.js +70 -0
- package/lib/module/useNavigationHelpers.js.map +1 -0
- package/lib/module/useNavigationIndependentTree.js +8 -0
- package/lib/module/useNavigationIndependentTree.js.map +1 -0
- package/lib/module/useNavigationState.js +20 -0
- package/lib/module/useNavigationState.js.map +1 -0
- package/lib/module/useOnAction.js +100 -0
- package/lib/module/useOnAction.js.map +1 -0
- package/lib/module/useOnGetState.js +42 -0
- package/lib/module/useOnGetState.js.map +1 -0
- package/lib/module/useOnPreventRemove.js +64 -0
- package/lib/module/useOnPreventRemove.js.map +1 -0
- package/lib/module/useOnRouteFocus.js +30 -0
- package/lib/module/useOnRouteFocus.js.map +1 -0
- package/lib/module/useOptionsGetters.js +72 -0
- package/lib/module/useOptionsGetters.js.map +1 -0
- package/lib/module/usePreventRemove.js +42 -0
- package/lib/module/usePreventRemove.js.map +1 -0
- package/lib/module/usePreventRemoveContext.js +12 -0
- package/lib/module/usePreventRemoveContext.js.map +1 -0
- package/lib/module/useRegisterNavigator.js +27 -0
- package/lib/module/useRegisterNavigator.js.map +1 -0
- package/lib/module/useRoute.js +17 -0
- package/lib/module/useRoute.js.map +1 -0
- package/lib/module/useRouteCache.js +62 -0
- package/lib/module/useRouteCache.js.map +1 -0
- package/lib/module/useSyncState.js +42 -0
- package/lib/module/useSyncState.js.map +1 -0
- package/lib/module/validatePathConfig.js +45 -0
- package/lib/module/validatePathConfig.js.map +1 -0
- package/lib/typescript/commonjs/package.json +1 -0
- package/lib/typescript/commonjs/src/BaseNavigationContainer.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/CurrentRenderContext.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/DeprecatedNavigationInChildContext.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/EnsureSingleNavigator.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/Group.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/NavigationBuilderContext.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/NavigationContainerRefContext.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/NavigationContext.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/NavigationHelpersContext.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/NavigationIndependentTree.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/NavigationIndependentTreeContext.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/NavigationRouteContext.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/NavigationStateContext.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/PreventRemoveContext.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/PreventRemoveProvider.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/SceneView.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/Screen.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/StaticContainer.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/StaticNavigation.d.ts +188 -0
- package/lib/typescript/commonjs/src/StaticNavigation.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/UnhandledActionContext.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/checkDuplicateRouteNames.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/checkSerializable.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/createNavigationContainerRef.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/createNavigatorFactory.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/deepFreeze.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/findFocusedRoute.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/getActionFromState.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/getFocusedRouteNameFromRoute.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/getPathFromState.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/getStateFromPath.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/isArrayEqual.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/isRecordEqual.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/theming/ThemeContext.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/theming/ThemeProvider.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/theming/useTheme.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/types.d.ts +702 -0
- package/lib/typescript/commonjs/src/types.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/useChildListeners.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/useComponent.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/useCurrentRender.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/useDescriptors.d.ts +133 -0
- package/lib/typescript/commonjs/src/useDescriptors.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/useEventEmitter.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/useFocusEffect.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/useFocusEvents.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/useFocusedListenersChildrenAdapter.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/useIsFocused.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/useIsomorphicLayoutEffect.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/useIsomorphicLayoutEffect.native.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/useKeyedChildListeners.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/useLazyValue.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/useNavigation.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/useNavigationBuilder.d.ts +181 -0
- package/lib/typescript/commonjs/src/useNavigationBuilder.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/useNavigationCache.d.ts +65 -0
- package/lib/typescript/commonjs/src/useNavigationCache.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/useNavigationContainerRef.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/useNavigationHelpers.d.ts +96 -0
- package/lib/typescript/commonjs/src/useNavigationHelpers.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/useNavigationIndependentTree.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/useNavigationState.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/useOnAction.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/useOnGetState.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/useOnPreventRemove.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/useOnRouteFocus.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/useOptionsGetters.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/usePreventRemove.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/usePreventRemoveContext.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/useRegisterNavigator.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/useRoute.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/useRouteCache.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/useSyncState.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/validatePathConfig.d.ts.map +1 -0
- package/lib/typescript/commonjs/tsconfig.build.tsbuildinfo +1 -0
- package/lib/typescript/module/package.json +1 -0
- package/lib/typescript/module/src/BaseNavigationContainer.d.ts +17 -0
- package/lib/typescript/module/src/BaseNavigationContainer.d.ts.map +1 -0
- package/lib/typescript/module/src/CurrentRenderContext.d.ts +9 -0
- package/lib/typescript/module/src/CurrentRenderContext.d.ts.map +1 -0
- package/lib/typescript/module/src/DeprecatedNavigationInChildContext.d.ts +6 -0
- package/lib/typescript/module/src/DeprecatedNavigationInChildContext.d.ts.map +1 -0
- package/lib/typescript/module/src/EnsureSingleNavigator.d.ts +14 -0
- package/lib/typescript/module/src/EnsureSingleNavigator.d.ts.map +1 -0
- package/lib/typescript/module/src/Group.d.ts +7 -0
- package/lib/typescript/module/src/Group.d.ts.map +1 -0
- package/lib/typescript/module/src/NavigationBuilderContext.d.ts +34 -0
- package/lib/typescript/module/src/NavigationBuilderContext.d.ts.map +1 -0
- package/lib/typescript/module/src/NavigationContainerRefContext.d.ts +8 -0
- package/lib/typescript/module/src/NavigationContainerRefContext.d.ts.map +1 -0
- package/lib/typescript/module/src/NavigationContext.d.ts +8 -0
- package/lib/typescript/module/src/NavigationContext.d.ts.map +1 -0
- package/lib/typescript/module/src/NavigationHelpersContext.d.ts +9 -0
- package/lib/typescript/module/src/NavigationHelpersContext.d.ts.map +1 -0
- package/lib/typescript/module/src/NavigationIndependentTree.d.ts +8 -0
- package/lib/typescript/module/src/NavigationIndependentTree.d.ts.map +1 -0
- package/lib/typescript/module/src/NavigationIndependentTreeContext.d.ts +6 -0
- package/lib/typescript/module/src/NavigationIndependentTreeContext.d.ts.map +1 -0
- package/lib/typescript/module/src/NavigationRouteContext.d.ts +7 -0
- package/lib/typescript/module/src/NavigationRouteContext.d.ts.map +1 -0
- package/lib/typescript/module/src/NavigationStateContext.d.ts +13 -0
- package/lib/typescript/module/src/NavigationStateContext.d.ts.map +1 -0
- package/lib/typescript/module/src/PreventRemoveContext.d.ts +13 -0
- package/lib/typescript/module/src/PreventRemoveContext.d.ts.map +1 -0
- package/lib/typescript/module/src/PreventRemoveProvider.d.ts +10 -0
- package/lib/typescript/module/src/PreventRemoveProvider.d.ts.map +1 -0
- package/lib/typescript/module/src/SceneView.d.ts +21 -0
- package/lib/typescript/module/src/SceneView.d.ts.map +1 -0
- package/lib/typescript/module/src/Screen.d.ts +7 -0
- package/lib/typescript/module/src/Screen.d.ts.map +1 -0
- package/lib/typescript/module/src/StaticContainer.d.ts +6 -0
- package/lib/typescript/module/src/StaticContainer.d.ts.map +1 -0
- package/lib/typescript/module/src/StaticNavigation.d.ts +188 -0
- package/lib/typescript/module/src/StaticNavigation.d.ts.map +1 -0
- package/lib/typescript/module/src/UnhandledActionContext.d.ts +4 -0
- package/lib/typescript/module/src/UnhandledActionContext.d.ts.map +1 -0
- package/lib/typescript/module/src/checkDuplicateRouteNames.d.ts +3 -0
- package/lib/typescript/module/src/checkDuplicateRouteNames.d.ts.map +1 -0
- package/lib/typescript/module/src/checkSerializable.d.ts +10 -0
- package/lib/typescript/module/src/checkSerializable.d.ts.map +1 -0
- package/lib/typescript/module/src/createNavigationContainerRef.d.ts +4 -0
- package/lib/typescript/module/src/createNavigationContainerRef.d.ts.map +1 -0
- package/lib/typescript/module/src/createNavigatorFactory.d.ts +10 -0
- package/lib/typescript/module/src/createNavigatorFactory.d.ts.map +1 -0
- package/lib/typescript/module/src/deepFreeze.d.ts +3 -0
- package/lib/typescript/module/src/deepFreeze.d.ts.map +1 -0
- package/lib/typescript/module/src/findFocusedRoute.d.ts +5 -0
- package/lib/typescript/module/src/findFocusedRoute.d.ts.map +1 -0
- package/lib/typescript/module/src/getActionFromState.d.ts +17 -0
- package/lib/typescript/module/src/getActionFromState.d.ts.map +1 -0
- package/lib/typescript/module/src/getFocusedRouteNameFromRoute.d.ts +3 -0
- package/lib/typescript/module/src/getFocusedRouteNameFromRoute.d.ts.map +1 -0
- package/lib/typescript/module/src/getPathFromState.d.ts +40 -0
- package/lib/typescript/module/src/getPathFromState.d.ts.map +1 -0
- package/lib/typescript/module/src/getStateFromPath.d.ts +34 -0
- package/lib/typescript/module/src/getStateFromPath.d.ts.map +1 -0
- package/lib/typescript/module/src/index.d.ts +34 -0
- package/lib/typescript/module/src/index.d.ts.map +1 -0
- package/lib/typescript/module/src/isArrayEqual.d.ts +6 -0
- package/lib/typescript/module/src/isArrayEqual.d.ts.map +1 -0
- package/lib/typescript/module/src/isRecordEqual.d.ts +5 -0
- package/lib/typescript/module/src/isRecordEqual.d.ts.map +1 -0
- package/lib/typescript/module/src/theming/ThemeContext.d.ts +3 -0
- package/lib/typescript/module/src/theming/ThemeContext.d.ts.map +1 -0
- package/lib/typescript/module/src/theming/ThemeProvider.d.ts +8 -0
- package/lib/typescript/module/src/theming/ThemeProvider.d.ts.map +1 -0
- package/lib/typescript/module/src/theming/useTheme.d.ts +2 -0
- package/lib/typescript/module/src/theming/useTheme.d.ts.map +1 -0
- package/lib/typescript/module/src/types.d.ts +702 -0
- package/lib/typescript/module/src/types.d.ts.map +1 -0
- package/lib/typescript/module/src/useChildListeners.d.ts +12 -0
- package/lib/typescript/module/src/useChildListeners.d.ts.map +1 -0
- package/lib/typescript/module/src/useComponent.d.ts +7 -0
- package/lib/typescript/module/src/useComponent.d.ts.map +1 -0
- package/lib/typescript/module/src/useCurrentRender.d.ts +14 -0
- package/lib/typescript/module/src/useCurrentRender.d.ts.map +1 -0
- package/lib/typescript/module/src/useDescriptors.d.ts +133 -0
- package/lib/typescript/module/src/useDescriptors.d.ts.map +1 -0
- package/lib/typescript/module/src/useEventEmitter.d.ts +9 -0
- package/lib/typescript/module/src/useEventEmitter.d.ts.map +1 -0
- package/lib/typescript/module/src/useFocusEffect.d.ts +11 -0
- package/lib/typescript/module/src/useFocusEffect.d.ts.map +1 -0
- package/lib/typescript/module/src/useFocusEvents.d.ts +13 -0
- package/lib/typescript/module/src/useFocusEvents.d.ts.map +1 -0
- package/lib/typescript/module/src/useFocusedListenersChildrenAdapter.d.ts +13 -0
- package/lib/typescript/module/src/useFocusedListenersChildrenAdapter.d.ts.map +1 -0
- package/lib/typescript/module/src/useIsFocused.d.ts +6 -0
- package/lib/typescript/module/src/useIsFocused.d.ts.map +1 -0
- package/lib/typescript/module/src/useIsomorphicLayoutEffect.d.ts +6 -0
- package/lib/typescript/module/src/useIsomorphicLayoutEffect.d.ts.map +1 -0
- package/lib/typescript/module/src/useIsomorphicLayoutEffect.native.d.ts +3 -0
- package/lib/typescript/module/src/useIsomorphicLayoutEffect.native.d.ts.map +1 -0
- package/lib/typescript/module/src/useKeyedChildListeners.d.ts +12 -0
- package/lib/typescript/module/src/useKeyedChildListeners.d.ts.map +1 -0
- package/lib/typescript/module/src/useLazyValue.d.ts +2 -0
- package/lib/typescript/module/src/useLazyValue.d.ts.map +1 -0
- package/lib/typescript/module/src/useNavigation.d.ts +11 -0
- package/lib/typescript/module/src/useNavigation.d.ts.map +1 -0
- package/lib/typescript/module/src/useNavigationBuilder.d.ts +181 -0
- package/lib/typescript/module/src/useNavigationBuilder.d.ts.map +1 -0
- package/lib/typescript/module/src/useNavigationCache.d.ts +65 -0
- package/lib/typescript/module/src/useNavigationCache.d.ts.map +1 -0
- package/lib/typescript/module/src/useNavigationContainerRef.d.ts +3 -0
- package/lib/typescript/module/src/useNavigationContainerRef.d.ts.map +1 -0
- package/lib/typescript/module/src/useNavigationHelpers.d.ts +96 -0
- package/lib/typescript/module/src/useNavigationHelpers.d.ts.map +1 -0
- package/lib/typescript/module/src/useNavigationIndependentTree.d.ts +2 -0
- package/lib/typescript/module/src/useNavigationIndependentTree.d.ts.map +1 -0
- package/lib/typescript/module/src/useNavigationState.d.ts +10 -0
- package/lib/typescript/module/src/useNavigationState.d.ts.map +1 -0
- package/lib/typescript/module/src/useOnAction.d.ts +26 -0
- package/lib/typescript/module/src/useOnAction.d.ts.map +1 -0
- package/lib/typescript/module/src/useOnGetState.d.ts +9 -0
- package/lib/typescript/module/src/useOnGetState.d.ts.map +1 -0
- package/lib/typescript/module/src/useOnPreventRemove.d.ts +17 -0
- package/lib/typescript/module/src/useOnPreventRemove.d.ts.map +1 -0
- package/lib/typescript/module/src/useOnRouteFocus.d.ts +15 -0
- package/lib/typescript/module/src/useOnRouteFocus.d.ts.map +1 -0
- package/lib/typescript/module/src/useOptionsGetters.d.ts +13 -0
- package/lib/typescript/module/src/useOptionsGetters.d.ts.map +1 -0
- package/lib/typescript/module/src/usePreventRemove.d.ts +13 -0
- package/lib/typescript/module/src/usePreventRemove.d.ts.map +1 -0
- package/lib/typescript/module/src/usePreventRemoveContext.d.ts +5 -0
- package/lib/typescript/module/src/usePreventRemoveContext.d.ts.map +1 -0
- package/lib/typescript/module/src/useRegisterNavigator.d.ts +6 -0
- package/lib/typescript/module/src/useRegisterNavigator.d.ts.map +1 -0
- package/lib/typescript/module/src/useRoute.d.ts +9 -0
- package/lib/typescript/module/src/useRoute.d.ts.map +1 -0
- package/lib/typescript/module/src/useRouteCache.d.ts +14 -0
- package/lib/typescript/module/src/useRouteCache.d.ts.map +1 -0
- package/lib/typescript/module/src/useSyncState.d.ts +2 -0
- package/lib/typescript/module/src/useSyncState.d.ts.map +1 -0
- package/lib/typescript/module/src/validatePathConfig.d.ts +2 -0
- package/lib/typescript/module/src/validatePathConfig.d.ts.map +1 -0
- package/lib/typescript/module/tsconfig.build.tsbuildinfo +1 -0
- package/package.json +18 -11
- package/src/BaseNavigationContainer.tsx +1 -1
- package/src/StaticNavigation.tsx +49 -30
- package/src/getPathFromState.tsx +20 -4
- package/src/getStateFromPath.tsx +124 -63
- package/src/types.tsx +33 -46
- package/src/useNavigationBuilder.tsx +1 -1
- package/src/validatePathConfig.tsx +1 -1
- package/lib/commonjs/BaseNavigationContainer.cjs +0 -356
- package/lib/commonjs/BaseNavigationContainer.cjs.map +0 -1
- package/lib/commonjs/CurrentRenderContext.cjs +0 -15
- package/lib/commonjs/DeprecatedNavigationInChildContext.cjs +0 -14
- package/lib/commonjs/EnsureSingleNavigator.cjs +0 -43
- package/lib/commonjs/Group.cjs +0 -14
- package/lib/commonjs/NavigationBuilderContext.cjs +0 -17
- package/lib/commonjs/NavigationContainerRefContext.cjs +0 -14
- package/lib/commonjs/NavigationContext.cjs +0 -14
- package/lib/commonjs/NavigationHelpersContext.cjs +0 -15
- package/lib/commonjs/NavigationIndependentTree.cjs +0 -35
- package/lib/commonjs/NavigationIndependentTreeContext.cjs +0 -14
- package/lib/commonjs/NavigationRouteContext.cjs +0 -14
- package/lib/commonjs/NavigationStateContext.cjs +0 -29
- package/lib/commonjs/PreventRemoveContext.cjs +0 -16
- package/lib/commonjs/PreventRemoveProvider.cjs +0 -91
- package/lib/commonjs/SceneView.cjs +0 -96
- package/lib/commonjs/Screen.cjs +0 -14
- package/lib/commonjs/StaticContainer.cjs +0 -31
- package/lib/commonjs/StaticNavigation.cjs +0 -239
- package/lib/commonjs/StaticNavigation.cjs.map +0 -1
- package/lib/commonjs/UnhandledActionContext.cjs +0 -11
- package/lib/commonjs/checkDuplicateRouteNames.cjs +0 -25
- package/lib/commonjs/checkSerializable.cjs +0 -50
- package/lib/commonjs/createNavigationContainerRef.cjs +0 -69
- package/lib/commonjs/createNavigatorFactory.cjs +0 -34
- package/lib/commonjs/deepFreeze.cjs +0 -37
- package/lib/commonjs/findFocusedRoute.cjs +0 -15
- package/lib/commonjs/getActionFromState.cjs +0 -86
- package/lib/commonjs/getFocusedRouteNameFromRoute.cjs +0 -22
- package/lib/commonjs/getPathFromState.cjs +0 -211
- package/lib/commonjs/getPathFromState.cjs.map +0 -1
- package/lib/commonjs/getStateFromPath.cjs +0 -438
- package/lib/commonjs/getStateFromPath.cjs.map +0 -1
- package/lib/commonjs/index.cjs +0 -287
- package/lib/commonjs/isArrayEqual.cjs +0 -20
- package/lib/commonjs/isRecordEqual.cjs +0 -21
- package/lib/commonjs/theming/ThemeContext.cjs +0 -12
- package/lib/commonjs/theming/ThemeProvider.cjs +0 -21
- package/lib/commonjs/theming/useTheme.cjs +0 -18
- package/lib/commonjs/types.cjs +0 -9
- package/lib/commonjs/types.cjs.map +0 -1
- package/lib/commonjs/useChildListeners.cjs +0 -36
- package/lib/commonjs/useComponent.cjs +0 -40
- package/lib/commonjs/useCurrentRender.cjs +0 -25
- package/lib/commonjs/useDescriptors.cjs +0 -188
- package/lib/commonjs/useEventEmitter.cjs +0 -105
- package/lib/commonjs/useFocusEffect.cjs +0 -80
- package/lib/commonjs/useFocusEvents.cjs +0 -70
- package/lib/commonjs/useFocusedListenersChildrenAdapter.cjs +0 -48
- package/lib/commonjs/useIsFocused.cjs +0 -28
- package/lib/commonjs/useIsomorphicLayoutEffect.cjs +0 -12
- package/lib/commonjs/useIsomorphicLayoutEffect.native.cjs +0 -9
- package/lib/commonjs/useKeyedChildListeners.cjs +0 -33
- package/lib/commonjs/useLazyValue.cjs +0 -17
- package/lib/commonjs/useNavigation.cjs +0 -27
- package/lib/commonjs/useNavigationBuilder.cjs +0 -478
- package/lib/commonjs/useNavigationCache.cjs +0 -162
- package/lib/commonjs/useNavigationContainerRef.cjs +0 -18
- package/lib/commonjs/useNavigationHelpers.cjs +0 -76
- package/lib/commonjs/useNavigationIndependentTree.cjs +0 -14
- package/lib/commonjs/useNavigationState.cjs +0 -26
- package/lib/commonjs/useOnAction.cjs +0 -106
- package/lib/commonjs/useOnGetState.cjs +0 -48
- package/lib/commonjs/useOnPreventRemove.cjs +0 -72
- package/lib/commonjs/useOnRouteFocus.cjs +0 -36
- package/lib/commonjs/useOptionsGetters.cjs +0 -78
- package/lib/commonjs/usePreventRemove.cjs +0 -48
- package/lib/commonjs/usePreventRemoveContext.cjs +0 -18
- package/lib/commonjs/useRegisterNavigator.cjs +0 -32
- package/lib/commonjs/useRoute.cjs +0 -23
- package/lib/commonjs/useRouteCache.cjs +0 -69
- package/lib/commonjs/useSyncState.cjs +0 -48
- package/lib/commonjs/validatePathConfig.cjs +0 -49
- package/lib/commonjs/validatePathConfig.cjs.map +0 -1
- package/lib/module/BaseNavigationContainer.mjs +0 -347
- package/lib/module/BaseNavigationContainer.mjs.map +0 -1
- package/lib/module/CurrentRenderContext.mjs +0 -8
- package/lib/module/CurrentRenderContext.mjs.map +0 -1
- package/lib/module/DeprecatedNavigationInChildContext.mjs +0 -7
- package/lib/module/DeprecatedNavigationInChildContext.mjs.map +0 -1
- package/lib/module/EnsureSingleNavigator.mjs +0 -34
- package/lib/module/EnsureSingleNavigator.mjs.map +0 -1
- package/lib/module/Group.mjs +0 -8
- package/lib/module/Group.mjs.map +0 -1
- package/lib/module/NavigationBuilderContext.mjs +0 -9
- package/lib/module/NavigationBuilderContext.mjs.map +0 -1
- package/lib/module/NavigationContainerRefContext.mjs +0 -6
- package/lib/module/NavigationContainerRefContext.mjs.map +0 -1
- package/lib/module/NavigationContext.mjs +0 -6
- package/lib/module/NavigationContext.mjs.map +0 -1
- package/lib/module/NavigationHelpersContext.mjs +0 -7
- package/lib/module/NavigationHelpersContext.mjs.map +0 -1
- package/lib/module/NavigationIndependentTree.mjs +0 -28
- package/lib/module/NavigationIndependentTree.mjs.map +0 -1
- package/lib/module/NavigationIndependentTreeContext.mjs +0 -7
- package/lib/module/NavigationIndependentTreeContext.mjs.map +0 -1
- package/lib/module/NavigationRouteContext.mjs +0 -7
- package/lib/module/NavigationRouteContext.mjs.map +0 -1
- package/lib/module/NavigationStateContext.mjs +0 -21
- package/lib/module/NavigationStateContext.mjs.map +0 -1
- package/lib/module/PreventRemoveContext.mjs +0 -9
- package/lib/module/PreventRemoveContext.mjs.map +0 -1
- package/lib/module/PreventRemoveProvider.mjs +0 -82
- package/lib/module/PreventRemoveProvider.mjs.map +0 -1
- package/lib/module/SceneView.mjs +0 -88
- package/lib/module/SceneView.mjs.map +0 -1
- package/lib/module/Screen.mjs +0 -8
- package/lib/module/Screen.mjs.map +0 -1
- package/lib/module/StaticContainer.mjs +0 -24
- package/lib/module/StaticContainer.mjs.map +0 -1
- package/lib/module/StaticNavigation.mjs +0 -230
- package/lib/module/StaticNavigation.mjs.map +0 -1
- package/lib/module/UnhandledActionContext.mjs +0 -3
- package/lib/module/UnhandledActionContext.mjs.map +0 -1
- package/lib/module/checkDuplicateRouteNames.mjs +0 -19
- package/lib/module/checkDuplicateRouteNames.mjs.map +0 -1
- package/lib/module/checkSerializable.mjs +0 -44
- package/lib/module/checkSerializable.mjs.map +0 -1
- package/lib/module/createNavigationContainerRef.mjs +0 -62
- package/lib/module/createNavigationContainerRef.mjs.map +0 -1
- package/lib/module/createNavigatorFactory.mjs +0 -29
- package/lib/module/createNavigatorFactory.mjs.map +0 -1
- package/lib/module/deepFreeze.mjs +0 -29
- package/lib/module/deepFreeze.mjs.map +0 -1
- package/lib/module/findFocusedRoute.mjs +0 -9
- package/lib/module/findFocusedRoute.mjs.map +0 -1
- package/lib/module/getActionFromState.mjs +0 -80
- package/lib/module/getActionFromState.mjs.map +0 -1
- package/lib/module/getFocusedRouteNameFromRoute.mjs +0 -16
- package/lib/module/getFocusedRouteNameFromRoute.mjs.map +0 -1
- package/lib/module/getPathFromState.mjs +0 -203
- package/lib/module/getPathFromState.mjs.map +0 -1
- package/lib/module/getStateFromPath.mjs +0 -429
- package/lib/module/getStateFromPath.mjs.map +0 -1
- package/lib/module/index.mjs +0 -34
- package/lib/module/index.mjs.map +0 -1
- package/lib/module/isArrayEqual.mjs +0 -14
- package/lib/module/isArrayEqual.mjs.map +0 -1
- package/lib/module/isRecordEqual.mjs +0 -15
- package/lib/module/isRecordEqual.mjs.map +0 -1
- package/lib/module/theming/ThemeContext.mjs +0 -4
- package/lib/module/theming/ThemeContext.mjs.map +0 -1
- package/lib/module/theming/ThemeProvider.mjs +0 -13
- package/lib/module/theming/ThemeProvider.mjs.map +0 -1
- package/lib/module/theming/useTheme.mjs +0 -10
- package/lib/module/theming/useTheme.mjs.map +0 -1
- package/lib/module/types.mjs +0 -2
- package/lib/module/types.mjs.map +0 -1
- package/lib/module/useChildListeners.mjs +0 -28
- package/lib/module/useChildListeners.mjs.map +0 -1
- package/lib/module/useComponent.mjs +0 -32
- package/lib/module/useComponent.mjs.map +0 -1
- package/lib/module/useCurrentRender.mjs +0 -17
- package/lib/module/useCurrentRender.mjs.map +0 -1
- package/lib/module/useDescriptors.mjs +0 -180
- package/lib/module/useDescriptors.mjs.map +0 -1
- package/lib/module/useEventEmitter.mjs +0 -97
- package/lib/module/useEventEmitter.mjs.map +0 -1
- package/lib/module/useFocusEffect.mjs +0 -72
- package/lib/module/useFocusEffect.mjs.map +0 -1
- package/lib/module/useFocusEvents.mjs +0 -62
- package/lib/module/useFocusEvents.mjs.map +0 -1
- package/lib/module/useFocusedListenersChildrenAdapter.mjs +0 -40
- package/lib/module/useFocusedListenersChildrenAdapter.mjs.map +0 -1
- package/lib/module/useIsFocused.mjs +0 -21
- package/lib/module/useIsFocused.mjs.map +0 -1
- package/lib/module/useIsomorphicLayoutEffect.mjs +0 -7
- package/lib/module/useIsomorphicLayoutEffect.mjs.map +0 -1
- package/lib/module/useIsomorphicLayoutEffect.native.mjs +0 -3
- package/lib/module/useIsomorphicLayoutEffect.native.mjs.map +0 -1
- package/lib/module/useKeyedChildListeners.mjs +0 -25
- package/lib/module/useKeyedChildListeners.mjs.map +0 -1
- package/lib/module/useLazyValue.mjs +0 -9
- package/lib/module/useLazyValue.mjs.map +0 -1
- package/lib/module/useNavigation.mjs +0 -19
- package/lib/module/useNavigation.mjs.map +0 -1
- package/lib/module/useNavigationBuilder.mjs +0 -470
- package/lib/module/useNavigationBuilder.mjs.map +0 -1
- package/lib/module/useNavigationCache.mjs +0 -154
- package/lib/module/useNavigationCache.mjs.map +0 -1
- package/lib/module/useNavigationContainerRef.mjs +0 -10
- package/lib/module/useNavigationContainerRef.mjs.map +0 -1
- package/lib/module/useNavigationHelpers.mjs +0 -68
- package/lib/module/useNavigationHelpers.mjs.map +0 -1
- package/lib/module/useNavigationIndependentTree.mjs +0 -6
- package/lib/module/useNavigationIndependentTree.mjs.map +0 -1
- package/lib/module/useNavigationState.mjs +0 -18
- package/lib/module/useNavigationState.mjs.map +0 -1
- package/lib/module/useOnAction.mjs +0 -98
- package/lib/module/useOnAction.mjs.map +0 -1
- package/lib/module/useOnGetState.mjs +0 -40
- package/lib/module/useOnGetState.mjs.map +0 -1
- package/lib/module/useOnPreventRemove.mjs +0 -62
- package/lib/module/useOnPreventRemove.mjs.map +0 -1
- package/lib/module/useOnRouteFocus.mjs +0 -28
- package/lib/module/useOnRouteFocus.mjs.map +0 -1
- package/lib/module/useOptionsGetters.mjs +0 -70
- package/lib/module/useOptionsGetters.mjs.map +0 -1
- package/lib/module/usePreventRemove.mjs +0 -40
- package/lib/module/usePreventRemove.mjs.map +0 -1
- package/lib/module/usePreventRemoveContext.mjs +0 -10
- package/lib/module/usePreventRemoveContext.mjs.map +0 -1
- package/lib/module/useRegisterNavigator.mjs +0 -25
- package/lib/module/useRegisterNavigator.mjs.map +0 -1
- package/lib/module/useRoute.mjs +0 -15
- package/lib/module/useRoute.mjs.map +0 -1
- package/lib/module/useRouteCache.mjs +0 -60
- package/lib/module/useRouteCache.mjs.map +0 -1
- package/lib/module/useSyncState.mjs +0 -40
- package/lib/module/useSyncState.mjs.map +0 -1
- package/lib/module/validatePathConfig.mjs +0 -43
- package/lib/module/validatePathConfig.mjs.map +0 -1
- package/lib/typescript/src/BaseNavigationContainer.d.ts.map +0 -1
- package/lib/typescript/src/CurrentRenderContext.d.ts.map +0 -1
- package/lib/typescript/src/DeprecatedNavigationInChildContext.d.ts.map +0 -1
- package/lib/typescript/src/EnsureSingleNavigator.d.ts.map +0 -1
- package/lib/typescript/src/Group.d.ts.map +0 -1
- package/lib/typescript/src/NavigationBuilderContext.d.ts.map +0 -1
- package/lib/typescript/src/NavigationContainerRefContext.d.ts.map +0 -1
- package/lib/typescript/src/NavigationContext.d.ts.map +0 -1
- package/lib/typescript/src/NavigationHelpersContext.d.ts.map +0 -1
- package/lib/typescript/src/NavigationIndependentTree.d.ts.map +0 -1
- package/lib/typescript/src/NavigationIndependentTreeContext.d.ts.map +0 -1
- package/lib/typescript/src/NavigationRouteContext.d.ts.map +0 -1
- package/lib/typescript/src/NavigationStateContext.d.ts.map +0 -1
- package/lib/typescript/src/PreventRemoveContext.d.ts.map +0 -1
- package/lib/typescript/src/PreventRemoveProvider.d.ts.map +0 -1
- package/lib/typescript/src/SceneView.d.ts.map +0 -1
- package/lib/typescript/src/Screen.d.ts.map +0 -1
- package/lib/typescript/src/StaticContainer.d.ts.map +0 -1
- package/lib/typescript/src/StaticNavigation.d.ts +0 -190
- package/lib/typescript/src/StaticNavigation.d.ts.map +0 -1
- package/lib/typescript/src/UnhandledActionContext.d.ts.map +0 -1
- package/lib/typescript/src/checkDuplicateRouteNames.d.ts.map +0 -1
- package/lib/typescript/src/checkSerializable.d.ts.map +0 -1
- package/lib/typescript/src/createNavigationContainerRef.d.ts.map +0 -1
- package/lib/typescript/src/createNavigatorFactory.d.ts.map +0 -1
- package/lib/typescript/src/deepFreeze.d.ts.map +0 -1
- package/lib/typescript/src/findFocusedRoute.d.ts.map +0 -1
- package/lib/typescript/src/getActionFromState.d.ts.map +0 -1
- package/lib/typescript/src/getFocusedRouteNameFromRoute.d.ts.map +0 -1
- package/lib/typescript/src/getPathFromState.d.ts.map +0 -1
- package/lib/typescript/src/getStateFromPath.d.ts.map +0 -1
- package/lib/typescript/src/index.d.ts.map +0 -1
- package/lib/typescript/src/isArrayEqual.d.ts.map +0 -1
- package/lib/typescript/src/isRecordEqual.d.ts.map +0 -1
- package/lib/typescript/src/theming/ThemeContext.d.ts.map +0 -1
- package/lib/typescript/src/theming/ThemeProvider.d.ts.map +0 -1
- package/lib/typescript/src/theming/useTheme.d.ts.map +0 -1
- package/lib/typescript/src/types.d.ts +0 -695
- package/lib/typescript/src/types.d.ts.map +0 -1
- package/lib/typescript/src/useChildListeners.d.ts.map +0 -1
- package/lib/typescript/src/useComponent.d.ts.map +0 -1
- package/lib/typescript/src/useCurrentRender.d.ts.map +0 -1
- package/lib/typescript/src/useDescriptors.d.ts +0 -133
- package/lib/typescript/src/useDescriptors.d.ts.map +0 -1
- package/lib/typescript/src/useEventEmitter.d.ts.map +0 -1
- package/lib/typescript/src/useFocusEffect.d.ts.map +0 -1
- package/lib/typescript/src/useFocusEvents.d.ts.map +0 -1
- package/lib/typescript/src/useFocusedListenersChildrenAdapter.d.ts.map +0 -1
- package/lib/typescript/src/useIsFocused.d.ts.map +0 -1
- package/lib/typescript/src/useIsomorphicLayoutEffect.d.ts.map +0 -1
- package/lib/typescript/src/useIsomorphicLayoutEffect.native.d.ts.map +0 -1
- package/lib/typescript/src/useKeyedChildListeners.d.ts.map +0 -1
- package/lib/typescript/src/useLazyValue.d.ts.map +0 -1
- package/lib/typescript/src/useNavigation.d.ts.map +0 -1
- package/lib/typescript/src/useNavigationBuilder.d.ts +0 -181
- package/lib/typescript/src/useNavigationBuilder.d.ts.map +0 -1
- package/lib/typescript/src/useNavigationCache.d.ts +0 -65
- package/lib/typescript/src/useNavigationCache.d.ts.map +0 -1
- package/lib/typescript/src/useNavigationContainerRef.d.ts.map +0 -1
- package/lib/typescript/src/useNavigationHelpers.d.ts +0 -96
- package/lib/typescript/src/useNavigationHelpers.d.ts.map +0 -1
- package/lib/typescript/src/useNavigationIndependentTree.d.ts.map +0 -1
- package/lib/typescript/src/useNavigationState.d.ts.map +0 -1
- package/lib/typescript/src/useOnAction.d.ts.map +0 -1
- package/lib/typescript/src/useOnGetState.d.ts.map +0 -1
- package/lib/typescript/src/useOnPreventRemove.d.ts.map +0 -1
- package/lib/typescript/src/useOnRouteFocus.d.ts.map +0 -1
- package/lib/typescript/src/useOptionsGetters.d.ts.map +0 -1
- package/lib/typescript/src/usePreventRemove.d.ts.map +0 -1
- package/lib/typescript/src/usePreventRemoveContext.d.ts.map +0 -1
- package/lib/typescript/src/useRegisterNavigator.d.ts.map +0 -1
- package/lib/typescript/src/useRoute.d.ts.map +0 -1
- package/lib/typescript/src/useRouteCache.d.ts.map +0 -1
- package/lib/typescript/src/useSyncState.d.ts.map +0 -1
- package/lib/typescript/src/validatePathConfig.d.ts.map +0 -1
- package/lib/typescript/utils/usePrevious.d.ts +0 -6
- package/lib/typescript/utils/usePrevious.d.ts.map +0 -1
- /package/lib/commonjs/{CurrentRenderContext.cjs.map → CurrentRenderContext.js.map} +0 -0
- /package/lib/commonjs/{DeprecatedNavigationInChildContext.cjs.map → DeprecatedNavigationInChildContext.js.map} +0 -0
- /package/lib/commonjs/{EnsureSingleNavigator.cjs.map → EnsureSingleNavigator.js.map} +0 -0
- /package/lib/commonjs/{Group.cjs.map → Group.js.map} +0 -0
- /package/lib/commonjs/{NavigationBuilderContext.cjs.map → NavigationBuilderContext.js.map} +0 -0
- /package/lib/commonjs/{NavigationContainerRefContext.cjs.map → NavigationContainerRefContext.js.map} +0 -0
- /package/lib/commonjs/{NavigationContext.cjs.map → NavigationContext.js.map} +0 -0
- /package/lib/commonjs/{NavigationHelpersContext.cjs.map → NavigationHelpersContext.js.map} +0 -0
- /package/lib/commonjs/{NavigationIndependentTree.cjs.map → NavigationIndependentTree.js.map} +0 -0
- /package/lib/commonjs/{NavigationIndependentTreeContext.cjs.map → NavigationIndependentTreeContext.js.map} +0 -0
- /package/lib/commonjs/{NavigationRouteContext.cjs.map → NavigationRouteContext.js.map} +0 -0
- /package/lib/commonjs/{NavigationStateContext.cjs.map → NavigationStateContext.js.map} +0 -0
- /package/lib/commonjs/{PreventRemoveContext.cjs.map → PreventRemoveContext.js.map} +0 -0
- /package/lib/commonjs/{PreventRemoveProvider.cjs.map → PreventRemoveProvider.js.map} +0 -0
- /package/lib/commonjs/{SceneView.cjs.map → SceneView.js.map} +0 -0
- /package/lib/commonjs/{Screen.cjs.map → Screen.js.map} +0 -0
- /package/lib/commonjs/{StaticContainer.cjs.map → StaticContainer.js.map} +0 -0
- /package/lib/commonjs/{UnhandledActionContext.cjs.map → UnhandledActionContext.js.map} +0 -0
- /package/lib/commonjs/{checkDuplicateRouteNames.cjs.map → checkDuplicateRouteNames.js.map} +0 -0
- /package/lib/commonjs/{checkSerializable.cjs.map → checkSerializable.js.map} +0 -0
- /package/lib/commonjs/{createNavigationContainerRef.cjs.map → createNavigationContainerRef.js.map} +0 -0
- /package/lib/commonjs/{createNavigatorFactory.cjs.map → createNavigatorFactory.js.map} +0 -0
- /package/lib/commonjs/{deepFreeze.cjs.map → deepFreeze.js.map} +0 -0
- /package/lib/commonjs/{findFocusedRoute.cjs.map → findFocusedRoute.js.map} +0 -0
- /package/lib/commonjs/{getActionFromState.cjs.map → getActionFromState.js.map} +0 -0
- /package/lib/commonjs/{getFocusedRouteNameFromRoute.cjs.map → getFocusedRouteNameFromRoute.js.map} +0 -0
- /package/lib/commonjs/{index.cjs.map → index.js.map} +0 -0
- /package/lib/commonjs/{isArrayEqual.cjs.map → isArrayEqual.js.map} +0 -0
- /package/lib/commonjs/{isRecordEqual.cjs.map → isRecordEqual.js.map} +0 -0
- /package/lib/commonjs/theming/{ThemeContext.cjs.map → ThemeContext.js.map} +0 -0
- /package/lib/commonjs/theming/{ThemeProvider.cjs.map → ThemeProvider.js.map} +0 -0
- /package/lib/commonjs/theming/{useTheme.cjs.map → useTheme.js.map} +0 -0
- /package/lib/commonjs/{useChildListeners.cjs.map → useChildListeners.js.map} +0 -0
- /package/lib/commonjs/{useComponent.cjs.map → useComponent.js.map} +0 -0
- /package/lib/commonjs/{useCurrentRender.cjs.map → useCurrentRender.js.map} +0 -0
- /package/lib/commonjs/{useDescriptors.cjs.map → useDescriptors.js.map} +0 -0
- /package/lib/commonjs/{useEventEmitter.cjs.map → useEventEmitter.js.map} +0 -0
- /package/lib/commonjs/{useFocusEffect.cjs.map → useFocusEffect.js.map} +0 -0
- /package/lib/commonjs/{useFocusEvents.cjs.map → useFocusEvents.js.map} +0 -0
- /package/lib/commonjs/{useFocusedListenersChildrenAdapter.cjs.map → useFocusedListenersChildrenAdapter.js.map} +0 -0
- /package/lib/commonjs/{useIsFocused.cjs.map → useIsFocused.js.map} +0 -0
- /package/lib/commonjs/{useIsomorphicLayoutEffect.cjs.map → useIsomorphicLayoutEffect.js.map} +0 -0
- /package/lib/commonjs/{useIsomorphicLayoutEffect.native.cjs.map → useIsomorphicLayoutEffect.native.js.map} +0 -0
- /package/lib/commonjs/{useKeyedChildListeners.cjs.map → useKeyedChildListeners.js.map} +0 -0
- /package/lib/commonjs/{useLazyValue.cjs.map → useLazyValue.js.map} +0 -0
- /package/lib/commonjs/{useNavigation.cjs.map → useNavigation.js.map} +0 -0
- /package/lib/commonjs/{useNavigationBuilder.cjs.map → useNavigationBuilder.js.map} +0 -0
- /package/lib/commonjs/{useNavigationCache.cjs.map → useNavigationCache.js.map} +0 -0
- /package/lib/commonjs/{useNavigationContainerRef.cjs.map → useNavigationContainerRef.js.map} +0 -0
- /package/lib/commonjs/{useNavigationHelpers.cjs.map → useNavigationHelpers.js.map} +0 -0
- /package/lib/commonjs/{useNavigationIndependentTree.cjs.map → useNavigationIndependentTree.js.map} +0 -0
- /package/lib/commonjs/{useNavigationState.cjs.map → useNavigationState.js.map} +0 -0
- /package/lib/commonjs/{useOnAction.cjs.map → useOnAction.js.map} +0 -0
- /package/lib/commonjs/{useOnGetState.cjs.map → useOnGetState.js.map} +0 -0
- /package/lib/commonjs/{useOnPreventRemove.cjs.map → useOnPreventRemove.js.map} +0 -0
- /package/lib/commonjs/{useOnRouteFocus.cjs.map → useOnRouteFocus.js.map} +0 -0
- /package/lib/commonjs/{useOptionsGetters.cjs.map → useOptionsGetters.js.map} +0 -0
- /package/lib/commonjs/{usePreventRemove.cjs.map → usePreventRemove.js.map} +0 -0
- /package/lib/commonjs/{usePreventRemoveContext.cjs.map → usePreventRemoveContext.js.map} +0 -0
- /package/lib/commonjs/{useRegisterNavigator.cjs.map → useRegisterNavigator.js.map} +0 -0
- /package/lib/commonjs/{useRoute.cjs.map → useRoute.js.map} +0 -0
- /package/lib/commonjs/{useRouteCache.cjs.map → useRouteCache.js.map} +0 -0
- /package/lib/commonjs/{useSyncState.cjs.map → useSyncState.js.map} +0 -0
- /package/lib/typescript/{src → commonjs/src}/BaseNavigationContainer.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/CurrentRenderContext.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/DeprecatedNavigationInChildContext.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/EnsureSingleNavigator.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/Group.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/NavigationBuilderContext.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/NavigationContainerRefContext.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/NavigationContext.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/NavigationHelpersContext.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/NavigationIndependentTree.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/NavigationIndependentTreeContext.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/NavigationRouteContext.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/NavigationStateContext.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/PreventRemoveContext.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/PreventRemoveProvider.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/SceneView.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/Screen.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/StaticContainer.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/UnhandledActionContext.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/checkDuplicateRouteNames.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/checkSerializable.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/createNavigationContainerRef.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/createNavigatorFactory.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/deepFreeze.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/findFocusedRoute.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/getActionFromState.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/getFocusedRouteNameFromRoute.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/getPathFromState.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/getStateFromPath.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/index.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/isArrayEqual.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/isRecordEqual.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/theming/ThemeContext.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/theming/ThemeProvider.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/theming/useTheme.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/useChildListeners.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/useComponent.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/useCurrentRender.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/useEventEmitter.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/useFocusEffect.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/useFocusEvents.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/useFocusedListenersChildrenAdapter.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/useIsFocused.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/useIsomorphicLayoutEffect.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/useIsomorphicLayoutEffect.native.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/useKeyedChildListeners.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/useLazyValue.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/useNavigation.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/useNavigationContainerRef.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/useNavigationIndependentTree.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/useNavigationState.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/useOnAction.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/useOnGetState.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/useOnPreventRemove.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/useOnRouteFocus.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/useOptionsGetters.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/usePreventRemove.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/usePreventRemoveContext.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/useRegisterNavigator.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/useRoute.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/useRouteCache.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/useSyncState.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/validatePathConfig.d.ts +0 -0
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { CommonActions } from '@react-navigation/routers';
|
|
2
|
-
export const NOT_INITIALIZED_ERROR = "The 'navigation' object hasn't been initialized yet. This might happen if you don't have a navigator mounted, or if the navigator hasn't finished mounting. See https://reactnavigation.org/docs/navigating-without-navigation-prop#handling-initialization for more details.";
|
|
3
|
-
export function createNavigationContainerRef() {
|
|
4
|
-
const methods = [...Object.keys(CommonActions), 'addListener', 'removeListener', 'resetRoot', 'dispatch', 'isFocused', 'canGoBack', 'getRootState', 'getState', 'getParent', 'getCurrentRoute', 'getCurrentOptions'];
|
|
5
|
-
const listeners = {};
|
|
6
|
-
const removeListener = (event, callback) => {
|
|
7
|
-
if (listeners[event]) {
|
|
8
|
-
listeners[event] = listeners[event].filter(cb => cb !== callback);
|
|
9
|
-
}
|
|
10
|
-
};
|
|
11
|
-
let current = null;
|
|
12
|
-
const ref = {
|
|
13
|
-
get current() {
|
|
14
|
-
return current;
|
|
15
|
-
},
|
|
16
|
-
set current(value) {
|
|
17
|
-
current = value;
|
|
18
|
-
if (value != null) {
|
|
19
|
-
Object.entries(listeners).forEach(([event, callbacks]) => {
|
|
20
|
-
callbacks.forEach(callback => {
|
|
21
|
-
value.addListener(event, callback);
|
|
22
|
-
});
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
isReady: () => {
|
|
27
|
-
if (current == null) {
|
|
28
|
-
return false;
|
|
29
|
-
}
|
|
30
|
-
return current.isReady();
|
|
31
|
-
},
|
|
32
|
-
...methods.reduce((acc, name) => {
|
|
33
|
-
acc[name] = (...args) => {
|
|
34
|
-
if (current == null) {
|
|
35
|
-
switch (name) {
|
|
36
|
-
case 'addListener':
|
|
37
|
-
{
|
|
38
|
-
const [event, callback] = args;
|
|
39
|
-
listeners[event] = listeners[event] || [];
|
|
40
|
-
listeners[event].push(callback);
|
|
41
|
-
return () => removeListener(event, callback);
|
|
42
|
-
}
|
|
43
|
-
case 'removeListener':
|
|
44
|
-
{
|
|
45
|
-
const [event, callback] = args;
|
|
46
|
-
removeListener(event, callback);
|
|
47
|
-
break;
|
|
48
|
-
}
|
|
49
|
-
default:
|
|
50
|
-
console.error(NOT_INITIALIZED_ERROR);
|
|
51
|
-
}
|
|
52
|
-
} else {
|
|
53
|
-
// @ts-expect-error: this is ok
|
|
54
|
-
return current[name](...args);
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
return acc;
|
|
58
|
-
}, {})
|
|
59
|
-
};
|
|
60
|
-
return ref;
|
|
61
|
-
}
|
|
62
|
-
//# sourceMappingURL=createNavigationContainerRef.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["CommonActions","NOT_INITIALIZED_ERROR","createNavigationContainerRef","methods","Object","keys","listeners","removeListener","event","callback","filter","cb","current","ref","value","entries","forEach","callbacks","addListener","isReady","reduce","acc","name","args","push","console","error"],"sourceRoot":"../../src","sources":["createNavigationContainerRef.tsx"],"mappings":"AAAA,SAASA,aAAa,QAAQ,2BAA2B;AAQzD,OAAO,MAAMC,qBAAqB,GAChC,+QAA+Q;AAEjR,OAAO,SAASC,4BAA4BA,CAAA,EAEM;EAChD,MAAMC,OAAO,GAAG,CACd,GAAGC,MAAM,CAACC,IAAI,CAACL,aAAa,CAAC,EAC7B,aAAa,EACb,gBAAgB,EAChB,WAAW,EACX,UAAU,EACV,WAAW,EACX,WAAW,EACX,cAAc,EACd,UAAU,EACV,WAAW,EACX,iBAAiB,EACjB,mBAAmB,CACX;EAEV,MAAMM,SAAuD,GAAG,CAAC,CAAC;EAElE,MAAMC,cAAc,GAAGA,CACrBC,KAAa,EACbC,QAAkC,KAC/B;IACH,IAAIH,SAAS,CAACE,KAAK,CAAC,EAAE;MACpBF,SAAS,CAACE,KAAK,CAAC,GAAGF,SAAS,CAACE,KAAK,CAAC,CAACE,MAAM,CAAEC,EAAE,IAAKA,EAAE,KAAKF,QAAQ,CAAC;IACrE;EACF,CAAC;EAED,IAAIG,OAAiD,GAAG,IAAI;EAE5D,MAAMC,GAAiD,GAAG;IACxD,IAAID,OAAOA,CAAA,EAAG;MACZ,OAAOA,OAAO;IAChB,CAAC;IACD,IAAIA,OAAOA,CAACE,KAA+C,EAAE;MAC3DF,OAAO,GAAGE,KAAK;MAEf,IAAIA,KAAK,IAAI,IAAI,EAAE;QACjBV,MAAM,CAACW,OAAO,CAACT,SAAS,CAAC,CAACU,OAAO,CAAC,CAAC,CAACR,KAAK,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
|
|
1
|
-
import { Group } from "./Group.mjs";
|
|
2
|
-
import { Screen } from "./Screen.mjs";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Higher order component to create a `Navigator` and `Screen` pair.
|
|
6
|
-
* Custom navigators should wrap the navigator component in `createNavigator` before exporting.
|
|
7
|
-
*
|
|
8
|
-
* @param Navigator The navigator component to wrap.
|
|
9
|
-
* @returns Factory method to create a `Navigator` and `Screen` pair.
|
|
10
|
-
*/
|
|
11
|
-
export function createNavigatorFactory(Navigator) {
|
|
12
|
-
function createNavigator(config) {
|
|
13
|
-
if (config != null) {
|
|
14
|
-
return {
|
|
15
|
-
Navigator,
|
|
16
|
-
Screen,
|
|
17
|
-
Group,
|
|
18
|
-
config
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
return {
|
|
22
|
-
Navigator,
|
|
23
|
-
Screen,
|
|
24
|
-
Group
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
return createNavigator;
|
|
28
|
-
}
|
|
29
|
-
//# sourceMappingURL=createNavigatorFactory.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["Group","Screen","createNavigatorFactory","Navigator","createNavigator","config"],"sourceRoot":"../../src","sources":["createNavigatorFactory.tsx"],"mappings":"AAEA,SAASA,KAAK,QAAQ,aAAS;AAC/B,SAASC,MAAM,QAAQ,cAAU;;AAEjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,sBAAsBA,CAACC,SAAmC,EAAE;EAC1E,SAASC,eAAeA,CAACC,MAAY,EAAO;IAC1C,IAAIA,MAAM,IAAI,IAAI,EAAE;MAClB,OAAO;QACLF,SAAS;QACTF,MAAM;QACND,KAAK;QACLK;MACF,CAAC;IACH;IAEA,OAAO;MACLF,SAAS;MACTF,MAAM;MACND;IACF,CAAC;EACH;EAEA,OAAOI,eAAe;AACxB","ignoreList":[]}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
export const isPlainObject = value => {
|
|
2
|
-
if (typeof value === 'object' && value !== null) {
|
|
3
|
-
return Object.getPrototypeOf(value) === Object.prototype;
|
|
4
|
-
}
|
|
5
|
-
return false;
|
|
6
|
-
};
|
|
7
|
-
export const deepFreeze = object => {
|
|
8
|
-
// We only freeze in development to catch issues early
|
|
9
|
-
// Don't freeze in production to avoid unnecessary performance overhead
|
|
10
|
-
if (process.env.NODE_ENV === 'production') {
|
|
11
|
-
return object;
|
|
12
|
-
}
|
|
13
|
-
if (Object.isFrozen(object)) {
|
|
14
|
-
return object;
|
|
15
|
-
}
|
|
16
|
-
if (!isPlainObject(object) && !Array.isArray(object)) {
|
|
17
|
-
return object;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
// Freeze properties before freezing self
|
|
21
|
-
for (const key in object) {
|
|
22
|
-
if (Object.getOwnPropertyDescriptor(object, key)?.configurable) {
|
|
23
|
-
const value = object[key];
|
|
24
|
-
deepFreeze(value);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
return Object.freeze(object);
|
|
28
|
-
};
|
|
29
|
-
//# sourceMappingURL=deepFreeze.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["isPlainObject","value","Object","getPrototypeOf","prototype","deepFreeze","object","process","env","NODE_ENV","isFrozen","Array","isArray","key","getOwnPropertyDescriptor","configurable","freeze"],"sourceRoot":"../../src","sources":["deepFreeze.tsx"],"mappings":"AAAA,OAAO,MAAMA,aAAa,GAAIC,KAAc,IAAsB;EAChE,IAAI,OAAOA,KAAK,KAAK,QAAQ,IAAIA,KAAK,KAAK,IAAI,EAAE;IAC/C,OAAOC,MAAM,CAACC,cAAc,CAACF,KAAK,CAAC,KAAKC,MAAM,CAACE,SAAS;EAC1D;EAEA,OAAO,KAAK;AACd,CAAC;AAED,OAAO,MAAMC,UAAU,GAAQC,MAAS,IAAkB;EACxD;EACA;EACA,IAAIC,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,YAAY,EAAE;IACzC,OAAOH,MAAM;EACf;EAEA,IAAIJ,MAAM,CAACQ,QAAQ,CAACJ,MAAM,CAAC,EAAE;IAC3B,OAAOA,MAAM;EACf;EAEA,IAAI,CAACN,aAAa,CAACM,MAAM,CAAC,IAAI,CAACK,KAAK,CAACC,OAAO,CAACN,MAAM,CAAC,EAAE;IACpD,OAAOA,MAAM;EACf;;EAEA;EACA,KAAK,MAAMO,GAAG,IAAIP,MAAM,EAAE;IACxB,IAAIJ,MAAM,CAACY,wBAAwB,CAACR,MAAM,EAAEO,GAAG,CAAC,EAAEE,YAAY,EAAE;MAC9D,MAAMd,KAAK,GAAGK,MAAM,CAACO,GAAG,CAAC;MAEzBR,UAAU,CAACJ,KAAK,CAAC;IACnB;EACF;EAEA,OAAOC,MAAM,CAACc,MAAM,CAACV,MAAM,CAAC;AAC9B,CAAC","ignoreList":[]}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export function findFocusedRoute(state) {
|
|
2
|
-
let current = state;
|
|
3
|
-
while (current?.routes[current.index ?? 0].state != null) {
|
|
4
|
-
current = current.routes[current.index ?? 0].state;
|
|
5
|
-
}
|
|
6
|
-
const route = current?.routes[current?.index ?? 0];
|
|
7
|
-
return route;
|
|
8
|
-
}
|
|
9
|
-
//# sourceMappingURL=findFocusedRoute.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["findFocusedRoute","state","current","routes","index","route"],"sourceRoot":"../../src","sources":["findFocusedRoute.tsx"],"mappings":"AAEA,OAAO,SAASA,gBAAgBA,CAACC,KAAmB,EAAE;EACpD,IAAIC,OAAiC,GAAGD,KAAK;EAE7C,OAAOC,OAAO,EAAEC,MAAM,CAACD,OAAO,CAACE,KAAK,IAAI,CAAC,CAAC,CAACH,KAAK,IAAI,IAAI,EAAE;IACxDC,OAAO,GAAGA,OAAO,CAACC,MAAM,CAACD,OAAO,CAACE,KAAK,IAAI,CAAC,CAAC,CAACH,KAAK;EACpD;EAEA,MAAMI,KAAK,GAAGH,OAAO,EAAEC,MAAM,CAACD,OAAO,EAAEE,KAAK,IAAI,CAAC,CAAC;EAElD,OAAOC,KAAK;AACd","ignoreList":[]}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
export function getActionFromState(state, options) {
|
|
2
|
-
// Create a normalized configs object which will be easier to use
|
|
3
|
-
const normalizedConfig = options ? createNormalizedConfigItem(options) : {};
|
|
4
|
-
const routes = state.index != null ? state.routes.slice(0, state.index + 1) : state.routes;
|
|
5
|
-
if (routes.length === 0) {
|
|
6
|
-
return undefined;
|
|
7
|
-
}
|
|
8
|
-
if (!(routes.length === 1 && routes[0].key === undefined || routes.length === 2 && routes[0].key === undefined && routes[0].name === normalizedConfig?.initialRouteName && routes[1].key === undefined)) {
|
|
9
|
-
return {
|
|
10
|
-
type: 'RESET',
|
|
11
|
-
payload: state
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
const route = state.routes[state.index ?? state.routes.length - 1];
|
|
15
|
-
let current = route?.state;
|
|
16
|
-
let config = normalizedConfig?.screens?.[route?.name];
|
|
17
|
-
let params = {
|
|
18
|
-
...route.params
|
|
19
|
-
};
|
|
20
|
-
const payload = route ? {
|
|
21
|
-
name: route.name,
|
|
22
|
-
path: route.path,
|
|
23
|
-
params
|
|
24
|
-
} : undefined;
|
|
25
|
-
while (current) {
|
|
26
|
-
if (current.routes.length === 0) {
|
|
27
|
-
return undefined;
|
|
28
|
-
}
|
|
29
|
-
const routes = current.index != null ? current.routes.slice(0, current.index + 1) : current.routes;
|
|
30
|
-
const route = routes[routes.length - 1];
|
|
31
|
-
|
|
32
|
-
// Explicitly set to override existing value when merging params
|
|
33
|
-
Object.assign(params, {
|
|
34
|
-
initial: undefined,
|
|
35
|
-
screen: undefined,
|
|
36
|
-
params: undefined,
|
|
37
|
-
state: undefined
|
|
38
|
-
});
|
|
39
|
-
if (routes.length === 1 && routes[0].key === undefined) {
|
|
40
|
-
params.initial = true;
|
|
41
|
-
params.screen = route.name;
|
|
42
|
-
} else if (routes.length === 2 && routes[0].key === undefined && routes[0].name === config?.initialRouteName && routes[1].key === undefined) {
|
|
43
|
-
params.initial = false;
|
|
44
|
-
params.screen = route.name;
|
|
45
|
-
} else {
|
|
46
|
-
params.state = current;
|
|
47
|
-
break;
|
|
48
|
-
}
|
|
49
|
-
if (route.state) {
|
|
50
|
-
params.params = {
|
|
51
|
-
...route.params
|
|
52
|
-
};
|
|
53
|
-
params = params.params;
|
|
54
|
-
} else {
|
|
55
|
-
params.path = route.path;
|
|
56
|
-
params.params = route.params;
|
|
57
|
-
}
|
|
58
|
-
current = route.state;
|
|
59
|
-
config = config?.screens?.[route.name];
|
|
60
|
-
}
|
|
61
|
-
if (!payload) {
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
// Try to construct payload for a `NAVIGATE` action from the state
|
|
66
|
-
// This lets us preserve the navigation state and not lose it
|
|
67
|
-
return {
|
|
68
|
-
type: 'NAVIGATE',
|
|
69
|
-
payload
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
const createNormalizedConfigItem = config => typeof config === 'object' && config != null ? {
|
|
73
|
-
initialRouteName: config.initialRouteName,
|
|
74
|
-
screens: config.screens != null ? createNormalizedConfigs(config.screens) : undefined
|
|
75
|
-
} : {};
|
|
76
|
-
const createNormalizedConfigs = options => Object.entries(options).reduce((acc, [k, v]) => {
|
|
77
|
-
acc[k] = createNormalizedConfigItem(v);
|
|
78
|
-
return acc;
|
|
79
|
-
}, {});
|
|
80
|
-
//# sourceMappingURL=getActionFromState.mjs.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","assign","initial","screen","createNormalizedConfigs","entries","reduce","acc","k","v"],"sourceRoot":"../../src","sources":["getActionFromState.tsx"],"mappings":"AA8BA,OAAO,SAASA,kBAAkBA,CAChC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AG;QAAE,GAAGJ,KAAK,CAACI;MAAO,CAAC;MACnCA,MAAM,GAAGA,MAAM,CAACA,MAA8C;IAChE,CAAC,MAAM;MACLA,MAAM,CAACC,IAAI,GAAGL,KAAK,CAACK,IAAI;MACxBD,MAAM,CAACA,MAAM,GAAGJ,KAAK,CAACI,MAAM;IAC9B;IAEAH,OAAO,GAAGD,KAAK,CAACd,KAAK;IACrBgB,MAAM,GAAGA,MAAM,EAAEC,OAAO,GAAGH,KAAK,CAACJ,IAAI,CAAC;EACxC;EAEA,IAAI,CAACG,OAAO,EAAE;IACZ;EACF;;EAEA;EACA;EACA,OAAO;IACLD,IAAI,EAAE,UAAU;IAChBC;EACF,CAAC;AACH;AAEA,MAAMV,0BAA0B,GAAIa,MAAmC,IACrE,OAAOA,MAAM,KAAK,QAAQ,IAAIA,MAAM,IAAI,IAAI,GACxC;EACEL,gBAAgB,EAAEK,MAAM,CAACL,gBAAgB;EACzCM,OAAO,EACLD,MAAM,CAACC,OAAO,IAAI,IAAI,GAClBO,uBAAuB,CAACR,MAAM,CAACC,OAAO,CAAC,GACvCT;AACR,CAAC,GACD,CAAC,CAAC;AAER,MAAMgB,uBAAuB,GAAIvB,OAA8B,IAC7DmB,MAAM,CAACK,OAAO,CAACxB,OAAO,CAAC,CAACyB,MAAM,CAA6B,CAACC,GAAG,EAAE,CAACC,CAAC,EAAEC,CAAC,CAAC,KAAK;EAC1EF,GAAG,CAACC,CAAC,CAAC,GAAGzB,0BAA0B,CAAC0B,CAAC,CAAC;EACtC,OAAOF,GAAG;AACZ,CAAC,EAAE,CAAC,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { CHILD_STATE } from "./useRouteCache.mjs";
|
|
2
|
-
export function getFocusedRouteNameFromRoute(route) {
|
|
3
|
-
// @ts-expect-error: this isn't in type definitions coz we want this private
|
|
4
|
-
const state = route[CHILD_STATE] ?? route.state;
|
|
5
|
-
const params = route.params;
|
|
6
|
-
const routeName = state ?
|
|
7
|
-
// Get the currently active route name in the nested navigator
|
|
8
|
-
state.routes[
|
|
9
|
-
// If we have a partial state without index, for tab/drawer, first screen will be focused one, and last for stack
|
|
10
|
-
// The type property will only exist for rehydrated state and not for state from deep link
|
|
11
|
-
state.index ?? (typeof state.type === 'string' && state.type !== 'stack' ? 0 : state.routes.length - 1)].name :
|
|
12
|
-
// If state doesn't exist, we need to default to `screen` param if available
|
|
13
|
-
typeof params?.screen === 'string' ? params.screen : undefined;
|
|
14
|
-
return routeName;
|
|
15
|
-
}
|
|
16
|
-
//# sourceMappingURL=getFocusedRouteNameFromRoute.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["CHILD_STATE","getFocusedRouteNameFromRoute","route","state","params","routeName","routes","index","type","length","name","screen","undefined"],"sourceRoot":"../../src","sources":["getFocusedRouteNameFromRoute.tsx"],"mappings":"AAEA,SAASA,WAAW,QAAQ,qBAAiB;AAE7C,OAAO,SAASC,4BAA4BA,CAC1CC,KAA6B,EACT;EACpB;EACA,MAAMC,KAAK,GAAGD,KAAK,CAACF,WAAW,CAAC,IAAIE,KAAK,CAACC,KAAK;EAC/C,MAAMC,MAAM,GAAGF,KAAK,CAACE,MAA0C;EAE/D,MAAMC,SAAS,GAAGF,KAAK;EACnB;EACAA,KAAK,CAACG,MAAM;EACV;EACA;EACAH,KAAK,CAACI,KAAK,KACR,OAAOJ,KAAK,CAACK,IAAI,KAAK,QAAQ,IAAIL,KAAK,CAACK,IAAI,KAAK,OAAO,GACrD,CAAC,GACDL,KAAK,CAACG,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,203 +0,0 @@
|
|
|
1
|
-
import * as queryString from 'query-string';
|
|
2
|
-
import { validatePathConfig } from "./validatePathConfig.mjs";
|
|
3
|
-
const getActiveRoute = state => {
|
|
4
|
-
const route = typeof state.index === 'number' ? state.routes[state.index] : state.routes[state.routes.length - 1];
|
|
5
|
-
if (route.state) {
|
|
6
|
-
return getActiveRoute(route.state);
|
|
7
|
-
}
|
|
8
|
-
return route;
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Utility to serialize a navigation state object to a path string.
|
|
13
|
-
*
|
|
14
|
-
* @example
|
|
15
|
-
* ```js
|
|
16
|
-
* getPathFromState(
|
|
17
|
-
* {
|
|
18
|
-
* routes: [
|
|
19
|
-
* {
|
|
20
|
-
* name: 'Chat',
|
|
21
|
-
* params: { author: 'Jane', id: 42 },
|
|
22
|
-
* },
|
|
23
|
-
* ],
|
|
24
|
-
* },
|
|
25
|
-
* {
|
|
26
|
-
* screens: {
|
|
27
|
-
* Chat: {
|
|
28
|
-
* path: 'chat/:author/:id',
|
|
29
|
-
* stringify: { author: author => author.toLowerCase() }
|
|
30
|
-
* }
|
|
31
|
-
* }
|
|
32
|
-
* }
|
|
33
|
-
* )
|
|
34
|
-
* ```
|
|
35
|
-
*
|
|
36
|
-
* @param state Navigation state to serialize.
|
|
37
|
-
* @param options Extra options to fine-tune how to serialize the path.
|
|
38
|
-
* @returns Path representing the state, e.g. /foo/bar?count=42.
|
|
39
|
-
*/
|
|
40
|
-
export function getPathFromState(state, options) {
|
|
41
|
-
if (state == null) {
|
|
42
|
-
throw Error("Got 'undefined' for the navigation state. You must pass a valid state object.");
|
|
43
|
-
}
|
|
44
|
-
if (options) {
|
|
45
|
-
validatePathConfig(options);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
// Create a normalized configs object which will be easier to use
|
|
49
|
-
const configs = options?.screens ? createNormalizedConfigs(options?.screens) : {};
|
|
50
|
-
let path = '/';
|
|
51
|
-
let current = state;
|
|
52
|
-
const allParams = {};
|
|
53
|
-
while (current) {
|
|
54
|
-
let index = typeof current.index === 'number' ? current.index : 0;
|
|
55
|
-
let route = current.routes[index];
|
|
56
|
-
let pattern;
|
|
57
|
-
let focusedParams;
|
|
58
|
-
const focusedRoute = getActiveRoute(state);
|
|
59
|
-
let currentOptions = configs;
|
|
60
|
-
|
|
61
|
-
// Keep all the route names that appeared during going deeper in config in case the pattern is resolved to undefined
|
|
62
|
-
const nestedRouteNames = [];
|
|
63
|
-
let hasNext = true;
|
|
64
|
-
while (route.name in currentOptions && hasNext) {
|
|
65
|
-
pattern = currentOptions[route.name].pattern;
|
|
66
|
-
nestedRouteNames.push(route.name);
|
|
67
|
-
if (route.params) {
|
|
68
|
-
const stringify = currentOptions[route.name]?.stringify;
|
|
69
|
-
const currentParams = Object.fromEntries(Object.entries(route.params).map(([key, value]) => [key, stringify?.[key] ? stringify[key](value) : String(value)]));
|
|
70
|
-
if (pattern) {
|
|
71
|
-
Object.assign(allParams, currentParams);
|
|
72
|
-
}
|
|
73
|
-
if (focusedRoute === route) {
|
|
74
|
-
// If this is the focused route, keep the params for later use
|
|
75
|
-
// We save it here since it's been stringified already
|
|
76
|
-
focusedParams = {
|
|
77
|
-
...currentParams
|
|
78
|
-
};
|
|
79
|
-
pattern?.split('/').filter(p => p.startsWith(':'))
|
|
80
|
-
// eslint-disable-next-line no-loop-func
|
|
81
|
-
.forEach(p => {
|
|
82
|
-
const name = getParamName(p);
|
|
83
|
-
|
|
84
|
-
// Remove the params present in the pattern since we'll only use the rest for query string
|
|
85
|
-
if (focusedParams) {
|
|
86
|
-
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete
|
|
87
|
-
delete focusedParams[name];
|
|
88
|
-
}
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
// If there is no `screens` property or no nested state, we return pattern
|
|
94
|
-
if (!currentOptions[route.name].screens || route.state === undefined) {
|
|
95
|
-
hasNext = false;
|
|
96
|
-
} else {
|
|
97
|
-
index = typeof route.state.index === 'number' ? route.state.index : route.state.routes.length - 1;
|
|
98
|
-
const nextRoute = route.state.routes[index];
|
|
99
|
-
const nestedConfig = currentOptions[route.name].screens;
|
|
100
|
-
|
|
101
|
-
// if there is config for next route name, we go deeper
|
|
102
|
-
if (nestedConfig && nextRoute.name in nestedConfig) {
|
|
103
|
-
route = nextRoute;
|
|
104
|
-
currentOptions = nestedConfig;
|
|
105
|
-
} else {
|
|
106
|
-
// If not, there is no sense in going deeper in config
|
|
107
|
-
hasNext = false;
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
if (pattern === undefined) {
|
|
112
|
-
pattern = nestedRouteNames.join('/');
|
|
113
|
-
}
|
|
114
|
-
if (currentOptions[route.name] !== undefined) {
|
|
115
|
-
path += pattern.split('/').map(p => {
|
|
116
|
-
const name = getParamName(p);
|
|
117
|
-
|
|
118
|
-
// We don't know what to show for wildcard patterns
|
|
119
|
-
// Showing the route name seems ok, though whatever we show here will be incorrect
|
|
120
|
-
// Since the page doesn't actually exist
|
|
121
|
-
if (p === '*') {
|
|
122
|
-
return route.name;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
// If the path has a pattern for a param, put the param in the path
|
|
126
|
-
if (p.startsWith(':')) {
|
|
127
|
-
const value = allParams[name];
|
|
128
|
-
if (value === undefined && p.endsWith('?')) {
|
|
129
|
-
// Optional params without value assigned in route.params should be ignored
|
|
130
|
-
return '';
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
// Valid characters according to
|
|
134
|
-
// https://datatracker.ietf.org/doc/html/rfc3986#section-3.3 (see pchar definition)
|
|
135
|
-
return String(value).replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]/g, char => encodeURIComponent(char));
|
|
136
|
-
}
|
|
137
|
-
return encodeURIComponent(p);
|
|
138
|
-
}).join('/');
|
|
139
|
-
} else {
|
|
140
|
-
path += encodeURIComponent(route.name);
|
|
141
|
-
}
|
|
142
|
-
if (!focusedParams) {
|
|
143
|
-
focusedParams = focusedRoute.params;
|
|
144
|
-
}
|
|
145
|
-
if (route.state) {
|
|
146
|
-
path += '/';
|
|
147
|
-
} else if (focusedParams) {
|
|
148
|
-
for (const param in focusedParams) {
|
|
149
|
-
if (focusedParams[param] === 'undefined') {
|
|
150
|
-
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete
|
|
151
|
-
delete focusedParams[param];
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
const query = queryString.stringify(focusedParams, {
|
|
155
|
-
sort: false
|
|
156
|
-
});
|
|
157
|
-
if (query) {
|
|
158
|
-
path += `?${query}`;
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
current = route.state;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
// Remove multiple as well as trailing slashes
|
|
165
|
-
path = path.replace(/\/+/g, '/');
|
|
166
|
-
path = path.length > 1 ? path.replace(/\/$/, '') : path;
|
|
167
|
-
|
|
168
|
-
// Include the root path if specified
|
|
169
|
-
if (options?.path) {
|
|
170
|
-
path = joinPaths(options.path, path);
|
|
171
|
-
}
|
|
172
|
-
return path;
|
|
173
|
-
}
|
|
174
|
-
const getParamName = pattern => pattern.replace(/^:/, '').replace(/\?$/, '');
|
|
175
|
-
const joinPaths = (...paths) => [].concat(...paths.map(p => p.split('/'))).filter(Boolean).join('/');
|
|
176
|
-
const createConfigItem = (config, parentPattern) => {
|
|
177
|
-
if (typeof config === 'string') {
|
|
178
|
-
// If a string is specified as the value of the key(e.g. Foo: '/path'), use it as the pattern
|
|
179
|
-
const pattern = parentPattern ? joinPaths(parentPattern, config) : config;
|
|
180
|
-
return {
|
|
181
|
-
pattern
|
|
182
|
-
};
|
|
183
|
-
}
|
|
184
|
-
if (config.exact && config.path === undefined) {
|
|
185
|
-
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: ''`.");
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
// If an object is specified as the value (e.g. Foo: { ... }),
|
|
189
|
-
// It can have `path` property and `screens` prop which has nested configs
|
|
190
|
-
const pattern = config.exact !== true ? joinPaths(parentPattern || '', config.path || '') : config.path || '';
|
|
191
|
-
const screens = config.screens ? createNormalizedConfigs(config.screens, pattern) : undefined;
|
|
192
|
-
return {
|
|
193
|
-
// Normalize pattern to remove any leading, trailing slashes, duplicate slashes etc.
|
|
194
|
-
pattern: pattern?.split('/').filter(Boolean).join('/'),
|
|
195
|
-
stringify: config.stringify,
|
|
196
|
-
screens
|
|
197
|
-
};
|
|
198
|
-
};
|
|
199
|
-
const createNormalizedConfigs = (options, pattern) => Object.fromEntries(Object.entries(options).map(([name, c]) => {
|
|
200
|
-
const result = createConfigItem(c, pattern);
|
|
201
|
-
return [name, result];
|
|
202
|
-
}));
|
|
203
|
-
//# sourceMappingURL=getPathFromState.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["queryString","validatePathConfig","getActiveRoute","state","route","index","routes","length","getPathFromState","options","Error","configs","screens","createNormalizedConfigs","path","current","allParams","pattern","focusedParams","focusedRoute","currentOptions","nestedRouteNames","hasNext","name","push","params","stringify","currentParams","Object","fromEntries","entries","map","key","value","String","assign","split","filter","p","startsWith","forEach","getParamName","undefined","nextRoute","nestedConfig","join","endsWith","replace","char","encodeURIComponent","param","query","sort","joinPaths","paths","concat","Boolean","createConfigItem","config","parentPattern","exact","c","result"],"sourceRoot":"../../src","sources":["getPathFromState.tsx"],"mappings":"AAKA,OAAO,KAAKA,WAAW,MAAM,cAAc;AAG3C,SAASC,kBAAkB,QAAQ,0BAAsB;AAkBzD,MAAMC,cAAc,GAAIC,KAAY,IAAwC;EAC1E,MAAMC,KAAK,GACT,OAAOD,KAAK,CAACE,KAAK,KAAK,QAAQ,GAC3BF,KAAK,CAACG,MAAM,CAACH,KAAK,CAACE,KAAK,CAAC,GACzBF,KAAK,CAACG,MAAM,CAACH,KAAK,CAACG,MAAM,CAACC,MAAM,GAAG,CAAC,CAAC;EAE3C,IAAIH,KAAK,CAACD,K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