@react-navigation/core 6.4.3 → 6.4.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.
- package/lib/commonjs/BaseNavigationContainer.js +17 -69
- package/lib/commonjs/BaseNavigationContainer.js.map +1 -1
- package/lib/commonjs/CurrentRenderContext.js +0 -4
- package/lib/commonjs/CurrentRenderContext.js.map +1 -1
- package/lib/commonjs/EnsureSingleNavigator.js +1 -12
- package/lib/commonjs/EnsureSingleNavigator.js.map +1 -1
- package/lib/commonjs/Group.js +0 -1
- package/lib/commonjs/Group.js.map +1 -1
- package/lib/commonjs/NavigationBuilderContext.js +0 -4
- package/lib/commonjs/NavigationBuilderContext.js.map +1 -1
- package/lib/commonjs/NavigationContainerRefContext.js +0 -4
- package/lib/commonjs/NavigationContainerRefContext.js.map +1 -1
- package/lib/commonjs/NavigationContext.js +0 -4
- package/lib/commonjs/NavigationContext.js.map +1 -1
- package/lib/commonjs/NavigationHelpersContext.js +0 -4
- package/lib/commonjs/NavigationHelpersContext.js.map +1 -1
- package/lib/commonjs/NavigationRouteContext.js +0 -4
- package/lib/commonjs/NavigationRouteContext.js.map +1 -1
- package/lib/commonjs/NavigationStateContext.js +0 -12
- package/lib/commonjs/NavigationStateContext.js.map +1 -1
- package/lib/commonjs/PreventRemoveContext.js +0 -4
- package/lib/commonjs/PreventRemoveContext.js.map +1 -1
- package/lib/commonjs/PreventRemoveProvider.js +3 -21
- package/lib/commonjs/PreventRemoveProvider.js.map +1 -1
- package/lib/commonjs/SceneView.js +8 -13
- package/lib/commonjs/SceneView.js.map +1 -1
- package/lib/commonjs/Screen.js +0 -1
- package/lib/commonjs/Screen.js.map +1 -1
- package/lib/commonjs/StaticContainer.js +0 -10
- package/lib/commonjs/StaticContainer.js.map +1 -1
- package/lib/commonjs/UnhandledActionContext.js +0 -4
- package/lib/commonjs/UnhandledActionContext.js.map +1 -1
- package/lib/commonjs/checkDuplicateRouteNames.js +0 -5
- package/lib/commonjs/checkDuplicateRouteNames.js.map +1 -1
- package/lib/commonjs/checkSerializable.js +0 -9
- package/lib/commonjs/checkSerializable.js.map +1 -1
- package/lib/commonjs/createNavigationContainerRef.js +0 -13
- package/lib/commonjs/createNavigationContainerRef.js.map +1 -1
- package/lib/commonjs/createNavigatorFactory.js +0 -5
- package/lib/commonjs/createNavigatorFactory.js.map +1 -1
- package/lib/commonjs/findFocusedRoute.js +5 -10
- package/lib/commonjs/findFocusedRoute.js.map +1 -1
- package/lib/commonjs/fromEntries.js +0 -3
- package/lib/commonjs/fromEntries.js.map +1 -1
- package/lib/commonjs/getActionFromState.js +11 -22
- package/lib/commonjs/getActionFromState.js.map +1 -1
- package/lib/commonjs/getFocusedRouteNameFromRoute.js +7 -8
- package/lib/commonjs/getFocusedRouteNameFromRoute.js.map +1 -1
- package/lib/commonjs/getPathFromState.js +25 -55
- package/lib/commonjs/getPathFromState.js.map +1 -1
- package/lib/commonjs/getStateFromPath.js +48 -105
- package/lib/commonjs/getStateFromPath.js.map +1 -1
- package/lib/commonjs/index.js +0 -30
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/isArrayEqual.js +0 -3
- package/lib/commonjs/isArrayEqual.js.map +1 -1
- package/lib/commonjs/isRecordEqual.js +0 -4
- package/lib/commonjs/isRecordEqual.js.map +1 -1
- package/lib/commonjs/types.js +3 -5
- package/lib/commonjs/types.js.map +1 -1
- package/lib/commonjs/useChildListeners.js +0 -5
- package/lib/commonjs/useChildListeners.js.map +1 -1
- package/lib/commonjs/useComponent.js +3 -9
- package/lib/commonjs/useComponent.js.map +1 -1
- package/lib/commonjs/useCurrentRender.js +0 -7
- package/lib/commonjs/useCurrentRender.js.map +1 -1
- package/lib/commonjs/useDescriptors.js +11 -21
- package/lib/commonjs/useDescriptors.js.map +1 -1
- package/lib/commonjs/useEventEmitter.js +2 -24
- package/lib/commonjs/useEventEmitter.js.map +1 -1
- package/lib/commonjs/useFocusEffect.js +2 -20
- package/lib/commonjs/useFocusEffect.js.map +1 -1
- package/lib/commonjs/useFocusEvents.js +9 -15
- package/lib/commonjs/useFocusEvents.js.map +1 -1
- package/lib/commonjs/useFocusedListenersChildrenAdapter.js +0 -8
- package/lib/commonjs/useFocusedListenersChildrenAdapter.js.map +1 -1
- package/lib/commonjs/useIsFocused.js +0 -8
- package/lib/commonjs/useIsFocused.js.map +1 -1
- package/lib/commonjs/useKeyedChildListeners.js +0 -4
- package/lib/commonjs/useKeyedChildListeners.js.map +1 -1
- package/lib/commonjs/useNavigation.js +3 -11
- package/lib/commonjs/useNavigation.js.map +1 -1
- package/lib/commonjs/useNavigationBuilder.js +34 -91
- package/lib/commonjs/useNavigationBuilder.js.map +1 -1
- package/lib/commonjs/useNavigationCache.js +18 -30
- package/lib/commonjs/useNavigationCache.js.map +1 -1
- package/lib/commonjs/useNavigationContainerRef.js +0 -8
- package/lib/commonjs/useNavigationContainerRef.js.map +1 -1
- package/lib/commonjs/useNavigationHelpers.js +4 -18
- package/lib/commonjs/useNavigationHelpers.js.map +1 -1
- package/lib/commonjs/useNavigationState.js +5 -9
- package/lib/commonjs/useNavigationState.js.map +1 -1
- package/lib/commonjs/useOnAction.js +8 -25
- package/lib/commonjs/useOnAction.js.map +1 -1
- package/lib/commonjs/useOnGetState.js +6 -16
- package/lib/commonjs/useOnGetState.js.map +1 -1
- package/lib/commonjs/useOnPreventRemove.js +9 -24
- package/lib/commonjs/useOnPreventRemove.js.map +1 -1
- package/lib/commonjs/useOnRouteFocus.js +0 -8
- package/lib/commonjs/useOnRouteFocus.js.map +1 -1
- package/lib/commonjs/useOptionsGetters.js +5 -24
- package/lib/commonjs/useOptionsGetters.js.map +1 -1
- package/lib/commonjs/usePreventRemove.js +0 -11
- package/lib/commonjs/usePreventRemove.js.map +1 -1
- package/lib/commonjs/usePreventRemoveContext.js +0 -8
- package/lib/commonjs/usePreventRemoveContext.js.map +1 -1
- package/lib/commonjs/useRegisterNavigator.js +0 -8
- package/lib/commonjs/useRegisterNavigator.js.map +1 -1
- package/lib/commonjs/useRoute.js +0 -8
- package/lib/commonjs/useRoute.js.map +1 -1
- package/lib/commonjs/useRouteCache.js +1 -10
- package/lib/commonjs/useRouteCache.js.map +1 -1
- package/lib/commonjs/useScheduleUpdate.js +1 -8
- package/lib/commonjs/useScheduleUpdate.js.map +1 -1
- package/lib/commonjs/useSyncState.js +9 -17
- package/lib/commonjs/useSyncState.js.map +1 -1
- package/lib/commonjs/validatePathConfig.js +0 -7
- package/lib/commonjs/validatePathConfig.js.map +1 -1
- package/lib/module/BaseNavigationContainer.js +17 -46
- package/lib/module/BaseNavigationContainer.js.map +1 -1
- package/lib/module/CurrentRenderContext.js +1 -1
- package/lib/module/CurrentRenderContext.js.map +1 -1
- package/lib/module/EnsureSingleNavigator.js +1 -7
- package/lib/module/EnsureSingleNavigator.js.map +1 -1
- package/lib/module/Group.js.map +1 -1
- package/lib/module/NavigationBuilderContext.js +0 -1
- package/lib/module/NavigationBuilderContext.js.map +1 -1
- package/lib/module/NavigationContainerRefContext.js +0 -1
- package/lib/module/NavigationContainerRefContext.js.map +1 -1
- package/lib/module/NavigationContext.js +0 -1
- package/lib/module/NavigationContext.js.map +1 -1
- package/lib/module/NavigationHelpersContext.js +0 -1
- package/lib/module/NavigationHelpersContext.js.map +1 -1
- package/lib/module/NavigationRouteContext.js +1 -1
- package/lib/module/NavigationRouteContext.js.map +1 -1
- package/lib/module/NavigationStateContext.js +0 -6
- package/lib/module/NavigationStateContext.js.map +1 -1
- package/lib/module/PreventRemoveContext.js +1 -0
- package/lib/module/PreventRemoveContext.js.map +1 -1
- package/lib/module/PreventRemoveProvider.js +3 -12
- package/lib/module/PreventRemoveProvider.js.map +1 -1
- package/lib/module/SceneView.js +8 -5
- package/lib/module/SceneView.js.map +1 -1
- package/lib/module/Screen.js.map +1 -1
- package/lib/module/StaticContainer.js +1 -6
- package/lib/module/StaticContainer.js.map +1 -1
- package/lib/module/UnhandledActionContext.js.map +1 -1
- package/lib/module/checkDuplicateRouteNames.js +0 -4
- package/lib/module/checkDuplicateRouteNames.js.map +1 -1
- package/lib/module/checkSerializable.js +0 -8
- package/lib/module/checkSerializable.js.map +1 -1
- package/lib/module/createNavigationContainerRef.js +0 -10
- package/lib/module/createNavigationContainerRef.js.map +1 -1
- package/lib/module/createNavigatorFactory.js +0 -2
- package/lib/module/createNavigatorFactory.js.map +1 -1
- package/lib/module/findFocusedRoute.js +5 -9
- package/lib/module/findFocusedRoute.js.map +1 -1
- package/lib/module/fromEntries.js +0 -2
- package/lib/module/fromEntries.js.map +1 -1
- package/lib/module/getActionFromState.js +11 -21
- package/lib/module/getActionFromState.js.map +1 -1
- package/lib/module/getFocusedRouteNameFromRoute.js +7 -6
- package/lib/module/getFocusedRouteNameFromRoute.js.map +1 -1
- package/lib/module/getPathFromState.js +25 -49
- package/lib/module/getPathFromState.js.map +1 -1
- package/lib/module/getStateFromPath.js +48 -98
- package/lib/module/getStateFromPath.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/isArrayEqual.js +0 -2
- package/lib/module/isArrayEqual.js.map +1 -1
- package/lib/module/isRecordEqual.js +0 -3
- package/lib/module/isRecordEqual.js.map +1 -1
- package/lib/module/types.js +3 -3
- package/lib/module/types.js.map +1 -1
- package/lib/module/useChildListeners.js +0 -2
- package/lib/module/useChildListeners.js.map +1 -1
- package/lib/module/useComponent.js +3 -6
- package/lib/module/useComponent.js.map +1 -1
- package/lib/module/useCurrentRender.js +0 -2
- package/lib/module/useCurrentRender.js.map +1 -1
- package/lib/module/useDescriptors.js +11 -11
- package/lib/module/useDescriptors.js.map +1 -1
- package/lib/module/useEventEmitter.js +2 -21
- package/lib/module/useEventEmitter.js.map +1 -1
- package/lib/module/useFocusEffect.js +2 -15
- package/lib/module/useFocusEffect.js.map +1 -1
- package/lib/module/useFocusEvents.js +9 -10
- package/lib/module/useFocusEvents.js.map +1 -1
- package/lib/module/useFocusedListenersChildrenAdapter.js +0 -3
- package/lib/module/useFocusedListenersChildrenAdapter.js.map +1 -1
- package/lib/module/useIsFocused.js +1 -3
- package/lib/module/useIsFocused.js.map +1 -1
- package/lib/module/useKeyedChildListeners.js +0 -1
- package/lib/module/useKeyedChildListeners.js.map +1 -1
- package/lib/module/useNavigation.js +3 -5
- package/lib/module/useNavigation.js.map +1 -1
- package/lib/module/useNavigationBuilder.js +37 -63
- package/lib/module/useNavigationBuilder.js.map +1 -1
- package/lib/module/useNavigationCache.js +18 -24
- package/lib/module/useNavigationCache.js.map +1 -1
- package/lib/module/useNavigationContainerRef.js +0 -2
- package/lib/module/useNavigationContainerRef.js.map +1 -1
- package/lib/module/useNavigationHelpers.js +4 -9
- package/lib/module/useNavigationHelpers.js.map +1 -1
- package/lib/module/useNavigationState.js +5 -4
- package/lib/module/useNavigationState.js.map +1 -1
- package/lib/module/useOnAction.js +8 -19
- package/lib/module/useOnAction.js.map +1 -1
- package/lib/module/useOnGetState.js +6 -8
- package/lib/module/useOnGetState.js.map +1 -1
- package/lib/module/useOnPreventRemove.js +9 -14
- package/lib/module/useOnPreventRemove.js.map +1 -1
- package/lib/module/useOnRouteFocus.js +0 -3
- package/lib/module/useOnRouteFocus.js.map +1 -1
- package/lib/module/useOptionsGetters.js +5 -17
- package/lib/module/useOptionsGetters.js.map +1 -1
- package/lib/module/usePreventRemove.js +1 -2
- package/lib/module/usePreventRemove.js.map +1 -1
- package/lib/module/usePreventRemoveContext.js +0 -2
- package/lib/module/usePreventRemoveContext.js.map +1 -1
- package/lib/module/useRegisterNavigator.js +1 -3
- package/lib/module/useRegisterNavigator.js.map +1 -1
- package/lib/module/useRoute.js +0 -3
- package/lib/module/useRoute.js.map +1 -1
- package/lib/module/useRouteCache.js +1 -6
- package/lib/module/useRouteCache.js.map +1 -1
- package/lib/module/useScheduleUpdate.js +1 -3
- package/lib/module/useScheduleUpdate.js.map +1 -1
- package/lib/module/useSyncState.js +9 -13
- package/lib/module/useSyncState.js.map +1 -1
- package/lib/module/validatePathConfig.js +0 -6
- package/lib/module/validatePathConfig.js.map +1 -1
- package/lib/typescript/src/BaseNavigationContainer.d.ts +1 -0
- package/lib/typescript/src/BaseNavigationContainer.d.ts.map +1 -0
- package/lib/typescript/src/CurrentRenderContext.d.ts +1 -0
- package/lib/typescript/src/CurrentRenderContext.d.ts.map +1 -0
- package/lib/typescript/src/EnsureSingleNavigator.d.ts +1 -0
- package/lib/typescript/src/EnsureSingleNavigator.d.ts.map +1 -0
- package/lib/typescript/src/Group.d.ts +1 -0
- package/lib/typescript/src/Group.d.ts.map +1 -0
- package/lib/typescript/src/NavigationBuilderContext.d.ts +1 -0
- package/lib/typescript/src/NavigationBuilderContext.d.ts.map +1 -0
- package/lib/typescript/src/NavigationContainerRefContext.d.ts +1 -0
- package/lib/typescript/src/NavigationContainerRefContext.d.ts.map +1 -0
- package/lib/typescript/src/NavigationContext.d.ts +1 -0
- package/lib/typescript/src/NavigationContext.d.ts.map +1 -0
- package/lib/typescript/src/NavigationHelpersContext.d.ts +1 -0
- package/lib/typescript/src/NavigationHelpersContext.d.ts.map +1 -0
- package/lib/typescript/src/NavigationRouteContext.d.ts +1 -0
- package/lib/typescript/src/NavigationRouteContext.d.ts.map +1 -0
- package/lib/typescript/src/NavigationStateContext.d.ts +1 -0
- package/lib/typescript/src/NavigationStateContext.d.ts.map +1 -0
- package/lib/typescript/src/PreventRemoveContext.d.ts +1 -0
- package/lib/typescript/src/PreventRemoveContext.d.ts.map +1 -0
- package/lib/typescript/src/PreventRemoveProvider.d.ts +1 -0
- package/lib/typescript/src/PreventRemoveProvider.d.ts.map +1 -0
- package/lib/typescript/src/SceneView.d.ts +1 -0
- package/lib/typescript/src/SceneView.d.ts.map +1 -0
- package/lib/typescript/src/Screen.d.ts +1 -0
- package/lib/typescript/src/Screen.d.ts.map +1 -0
- package/lib/typescript/src/StaticContainer.d.ts +1 -0
- package/lib/typescript/src/StaticContainer.d.ts.map +1 -0
- package/lib/typescript/src/UnhandledActionContext.d.ts +1 -0
- package/lib/typescript/src/UnhandledActionContext.d.ts.map +1 -0
- package/lib/typescript/src/checkDuplicateRouteNames.d.ts +1 -0
- package/lib/typescript/src/checkDuplicateRouteNames.d.ts.map +1 -0
- package/lib/typescript/src/checkSerializable.d.ts +1 -0
- package/lib/typescript/src/checkSerializable.d.ts.map +1 -0
- package/lib/typescript/src/createNavigationContainerRef.d.ts +1 -0
- package/lib/typescript/src/createNavigationContainerRef.d.ts.map +1 -0
- package/lib/typescript/src/createNavigatorFactory.d.ts +1 -0
- package/lib/typescript/src/createNavigatorFactory.d.ts.map +1 -0
- package/lib/typescript/src/findFocusedRoute.d.ts +1 -0
- package/lib/typescript/src/findFocusedRoute.d.ts.map +1 -0
- package/lib/typescript/src/fromEntries.d.ts +1 -0
- package/lib/typescript/src/fromEntries.d.ts.map +1 -0
- package/lib/typescript/src/getActionFromState.d.ts +1 -0
- package/lib/typescript/src/getActionFromState.d.ts.map +1 -0
- package/lib/typescript/src/getFocusedRouteNameFromRoute.d.ts +1 -0
- package/lib/typescript/src/getFocusedRouteNameFromRoute.d.ts.map +1 -0
- package/lib/typescript/src/getPathFromState.d.ts +1 -0
- package/lib/typescript/src/getPathFromState.d.ts.map +1 -0
- package/lib/typescript/src/getStateFromPath.d.ts +1 -0
- package/lib/typescript/src/getStateFromPath.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +1 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/isArrayEqual.d.ts +1 -0
- package/lib/typescript/src/isArrayEqual.d.ts.map +1 -0
- package/lib/typescript/src/isRecordEqual.d.ts +1 -0
- package/lib/typescript/src/isRecordEqual.d.ts.map +1 -0
- package/lib/typescript/src/types.d.ts +1 -0
- package/lib/typescript/src/types.d.ts.map +1 -0
- package/lib/typescript/src/useChildListeners.d.ts +1 -0
- package/lib/typescript/src/useChildListeners.d.ts.map +1 -0
- package/lib/typescript/src/useComponent.d.ts +1 -0
- package/lib/typescript/src/useComponent.d.ts.map +1 -0
- package/lib/typescript/src/useCurrentRender.d.ts +1 -0
- package/lib/typescript/src/useCurrentRender.d.ts.map +1 -0
- package/lib/typescript/src/useDescriptors.d.ts +1 -0
- package/lib/typescript/src/useDescriptors.d.ts.map +1 -0
- package/lib/typescript/src/useEventEmitter.d.ts +1 -0
- package/lib/typescript/src/useEventEmitter.d.ts.map +1 -0
- package/lib/typescript/src/useFocusEffect.d.ts +1 -0
- package/lib/typescript/src/useFocusEffect.d.ts.map +1 -0
- package/lib/typescript/src/useFocusEvents.d.ts +1 -0
- package/lib/typescript/src/useFocusEvents.d.ts.map +1 -0
- package/lib/typescript/src/useFocusedListenersChildrenAdapter.d.ts +1 -0
- package/lib/typescript/src/useFocusedListenersChildrenAdapter.d.ts.map +1 -0
- package/lib/typescript/src/useIsFocused.d.ts +1 -0
- package/lib/typescript/src/useIsFocused.d.ts.map +1 -0
- package/lib/typescript/src/useKeyedChildListeners.d.ts +1 -0
- package/lib/typescript/src/useKeyedChildListeners.d.ts.map +1 -0
- package/lib/typescript/src/useNavigation.d.ts +1 -0
- package/lib/typescript/src/useNavigation.d.ts.map +1 -0
- package/lib/typescript/src/useNavigationBuilder.d.ts +1 -0
- package/lib/typescript/src/useNavigationBuilder.d.ts.map +1 -0
- package/lib/typescript/src/useNavigationCache.d.ts +1 -0
- package/lib/typescript/src/useNavigationCache.d.ts.map +1 -0
- package/lib/typescript/src/useNavigationContainerRef.d.ts +1 -0
- package/lib/typescript/src/useNavigationContainerRef.d.ts.map +1 -0
- package/lib/typescript/src/useNavigationHelpers.d.ts +1 -0
- package/lib/typescript/src/useNavigationHelpers.d.ts.map +1 -0
- package/lib/typescript/src/useNavigationState.d.ts +1 -0
- package/lib/typescript/src/useNavigationState.d.ts.map +1 -0
- package/lib/typescript/src/useOnAction.d.ts +1 -0
- package/lib/typescript/src/useOnAction.d.ts.map +1 -0
- package/lib/typescript/src/useOnGetState.d.ts +1 -0
- package/lib/typescript/src/useOnGetState.d.ts.map +1 -0
- package/lib/typescript/src/useOnPreventRemove.d.ts +1 -0
- package/lib/typescript/src/useOnPreventRemove.d.ts.map +1 -0
- package/lib/typescript/src/useOnRouteFocus.d.ts +1 -0
- package/lib/typescript/src/useOnRouteFocus.d.ts.map +1 -0
- package/lib/typescript/src/useOptionsGetters.d.ts +1 -0
- package/lib/typescript/src/useOptionsGetters.d.ts.map +1 -0
- package/lib/typescript/src/usePreventRemove.d.ts +1 -0
- package/lib/typescript/src/usePreventRemove.d.ts.map +1 -0
- package/lib/typescript/src/usePreventRemoveContext.d.ts +1 -0
- package/lib/typescript/src/usePreventRemoveContext.d.ts.map +1 -0
- package/lib/typescript/src/useRegisterNavigator.d.ts +1 -0
- package/lib/typescript/src/useRegisterNavigator.d.ts.map +1 -0
- package/lib/typescript/src/useRoute.d.ts +1 -0
- package/lib/typescript/src/useRoute.d.ts.map +1 -0
- package/lib/typescript/src/useRouteCache.d.ts +1 -0
- package/lib/typescript/src/useRouteCache.d.ts.map +1 -0
- package/lib/typescript/src/useScheduleUpdate.d.ts +1 -0
- package/lib/typescript/src/useScheduleUpdate.d.ts.map +1 -0
- package/lib/typescript/src/useSyncState.d.ts +1 -0
- package/lib/typescript/src/useSyncState.d.ts.map +1 -0
- package/lib/typescript/src/validatePathConfig.d.ts +1 -0
- package/lib/typescript/src/validatePathConfig.d.ts.map +1 -0
- package/package.json +5 -5
|
@@ -4,19 +4,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = useNavigationCache;
|
|
7
|
-
|
|
8
7
|
var _routers = require("@react-navigation/routers");
|
|
9
|
-
|
|
10
8
|
var React = _interopRequireWildcard(require("react"));
|
|
11
|
-
|
|
12
9
|
var _NavigationBuilderContext = _interopRequireDefault(require("./NavigationBuilderContext"));
|
|
13
|
-
|
|
14
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
-
|
|
16
11
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
17
|
-
|
|
18
12
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
19
|
-
|
|
20
13
|
/**
|
|
21
14
|
* Hook to cache navigation objects for each screen in the navigator.
|
|
22
15
|
* It's important to cache them to make sure navigation objects don't change between renders.
|
|
@@ -33,20 +26,22 @@ function useNavigationCache(_ref) {
|
|
|
33
26
|
} = _ref;
|
|
34
27
|
const {
|
|
35
28
|
stackRef
|
|
36
|
-
} = React.useContext(_NavigationBuilderContext.default);
|
|
29
|
+
} = React.useContext(_NavigationBuilderContext.default);
|
|
30
|
+
|
|
31
|
+
// Cache object which holds navigation objects for each screen
|
|
37
32
|
// We use `React.useMemo` instead of `React.useRef` coz we want to invalidate it when deps change
|
|
38
33
|
// In reality, these deps will rarely change, if ever
|
|
39
|
-
|
|
40
34
|
const cache = React.useMemo(() => ({
|
|
41
35
|
current: {}
|
|
42
|
-
}),
|
|
36
|
+
}),
|
|
37
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
43
38
|
[getState, navigation, setOptions, router, emitter]);
|
|
44
|
-
const actions = {
|
|
39
|
+
const actions = {
|
|
40
|
+
...router.actionCreators,
|
|
45
41
|
..._routers.CommonActions
|
|
46
42
|
};
|
|
47
43
|
cache.current = state.routes.reduce((acc, route) => {
|
|
48
44
|
const previous = cache.current[route.key];
|
|
49
|
-
|
|
50
45
|
if (previous) {
|
|
51
46
|
// If a cached navigation object already exists, reuse it
|
|
52
47
|
acc[route.key] = previous;
|
|
@@ -56,10 +51,8 @@ function useNavigationCache(_ref) {
|
|
|
56
51
|
emit,
|
|
57
52
|
...rest
|
|
58
53
|
} = navigation;
|
|
59
|
-
|
|
60
54
|
const dispatch = thunk => {
|
|
61
55
|
const action = typeof thunk === 'function' ? thunk(getState()) : thunk;
|
|
62
|
-
|
|
63
56
|
if (action != null) {
|
|
64
57
|
navigation.dispatch({
|
|
65
58
|
source: route.key,
|
|
@@ -67,17 +60,14 @@ function useNavigationCache(_ref) {
|
|
|
67
60
|
});
|
|
68
61
|
}
|
|
69
62
|
};
|
|
70
|
-
|
|
71
63
|
const withStack = callback => {
|
|
72
64
|
let isStackSet = false;
|
|
73
|
-
|
|
74
65
|
try {
|
|
75
66
|
if (process.env.NODE_ENV !== 'production' && stackRef && !stackRef.current) {
|
|
76
67
|
// Capture the stack trace for devtools
|
|
77
68
|
stackRef.current = new Error().stack;
|
|
78
69
|
isStackSet = true;
|
|
79
70
|
}
|
|
80
|
-
|
|
81
71
|
callback();
|
|
82
72
|
} finally {
|
|
83
73
|
if (isStackSet && stackRef) {
|
|
@@ -85,20 +75,19 @@ function useNavigationCache(_ref) {
|
|
|
85
75
|
}
|
|
86
76
|
}
|
|
87
77
|
};
|
|
88
|
-
|
|
89
78
|
const helpers = Object.keys(actions).reduce((acc, name) => {
|
|
90
79
|
acc[name] = function () {
|
|
91
80
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
92
81
|
args[_key] = arguments[_key];
|
|
93
82
|
}
|
|
94
|
-
|
|
95
|
-
|
|
83
|
+
return withStack(() =>
|
|
84
|
+
// @ts-expect-error: name is a valid key, but TypeScript is dumb
|
|
96
85
|
dispatch(actions[name](...args)));
|
|
97
86
|
};
|
|
98
|
-
|
|
99
87
|
return acc;
|
|
100
88
|
}, {});
|
|
101
|
-
acc[route.key] = {
|
|
89
|
+
acc[route.key] = {
|
|
90
|
+
...rest,
|
|
102
91
|
...helpers,
|
|
103
92
|
// FIXME: too much work to fix the types for now
|
|
104
93
|
...emitter.create(route.key),
|
|
@@ -109,28 +98,27 @@ function useNavigationCache(_ref) {
|
|
|
109
98
|
// we return the cached navigation object for the relevant route
|
|
110
99
|
return acc[route.key];
|
|
111
100
|
}
|
|
112
|
-
|
|
113
101
|
return rest.getParent(id);
|
|
114
102
|
},
|
|
115
|
-
setOptions: options => setOptions(o => ({
|
|
116
|
-
|
|
103
|
+
setOptions: options => setOptions(o => ({
|
|
104
|
+
...o,
|
|
105
|
+
[route.key]: {
|
|
106
|
+
...o[route.key],
|
|
117
107
|
...options
|
|
118
108
|
}
|
|
119
109
|
})),
|
|
120
110
|
isFocused: () => {
|
|
121
111
|
const state = getState();
|
|
122
|
-
|
|
123
112
|
if (state.routes[state.index].key !== route.key) {
|
|
124
113
|
return false;
|
|
125
|
-
}
|
|
126
|
-
// This makes sure that we return the focus state in the whole tree, not just this navigator
|
|
127
|
-
|
|
114
|
+
}
|
|
128
115
|
|
|
116
|
+
// If the current screen is focused, we also need to check if parent navigator is focused
|
|
117
|
+
// This makes sure that we return the focus state in the whole tree, not just this navigator
|
|
129
118
|
return navigation ? navigation.isFocused() : true;
|
|
130
119
|
}
|
|
131
120
|
};
|
|
132
121
|
}
|
|
133
|
-
|
|
134
122
|
return acc;
|
|
135
123
|
}, {});
|
|
136
124
|
return cache.current;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useNavigationCache","state","getState","navigation","setOptions","router","emitter","stackRef","React","useContext","NavigationBuilderContext","cache","useMemo","current","actions","actionCreators","CommonActions","routes","reduce","acc","route","previous","key","emit","rest","dispatch","thunk","action","source","withStack","callback","isStackSet","process","env","NODE_ENV","Error","stack","undefined","helpers","Object","keys","name","args","create","getParent","id","getId","options","o","isFocused","index"],"
|
|
1
|
+
{"version":3,"names":["useNavigationCache","state","getState","navigation","setOptions","router","emitter","stackRef","React","useContext","NavigationBuilderContext","cache","useMemo","current","actions","actionCreators","CommonActions","routes","reduce","acc","route","previous","key","emit","rest","dispatch","thunk","action","source","withStack","callback","isStackSet","process","env","NODE_ENV","Error","stack","undefined","helpers","Object","keys","name","args","create","getParent","id","getId","options","o","isFocused","index"],"sourceRoot":"../../src","sources":["useNavigationCache.tsx"],"mappings":";;;;;;AAAA;AAOA;AAEA;AAAkE;AAAA;AAAA;AAmClE;AACA;AACA;AACA;AACA;AACe,SAASA,kBAAkB,OAWb;EAAA,IAP3B;IACAC,KAAK;IACLC,QAAQ;IACRC,UAAU;IACVC,UAAU;IACVC,MAAM;IACNC;EACwB,CAAC;EACzB,MAAM;IAAEC;EAAS,CAAC,GAAGC,KAAK,CAACC,UAAU,CAACC,iCAAwB,CAAC;;EAE/D;EACA;EACA;EACA,MAAMC,KAAK,GAAGH,KAAK,CAACI,OAAO,CACzB,OAAO;IAAEC,OAAO,EAAE,CAAC;EAAqD,CAAC,CAAC;EAC1E;EACA,CAACX,QAAQ,EAAEC,UAAU,EAAEC,UAAU,EAAEC,MAAM,EAAEC,OAAO,CAAC,CACpD;EAED,MAAMQ,OAAO,GAAG;IACd,GAAGT,MAAM,CAACU,cAAc;IACxB,GAAGC;EACL,CAAC;EAEDL,KAAK,CAACE,OAAO,GAAGZ,KAAK,CAACgB,MAAM,CAACC,MAAM,CAEjC,CAACC,GAAG,EAAEC,KAAK,KAAK;IAChB,MAAMC,QAAQ,GAAGV,KAAK,CAACE,OAAO,CAACO,KAAK,CAACE,GAAG,CAAC;IAMzC,IAAID,QAAQ,EAAE;MACZ;MACAF,GAAG,CAACC,KAAK,CAACE,GAAG,CAAC,GAAGD,QAAQ;IAC3B,CAAC,MAAM;MACL;MACA,MAAM;QAAEE,IAAI;QAAE,GAAGC;MAAK,CAAC,GAAG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AAM,CAACvB,KAAK,CAACE,GAAG,CAAS;QACrCG,QAAQ,EAAGC,KAAY,IAAKG,SAAS,CAAC,MAAMJ,QAAQ,CAACC,KAAK,CAAC,CAAC;QAC5DkB,SAAS,EAAGC,EAAW,IAAK;UAC1B,IAAIA,EAAE,KAAKR,SAAS,IAAIQ,EAAE,KAAKrB,IAAI,CAACsB,KAAK,EAAE,EAAE;YAC3C;YACA;YACA,OAAO3B,GAAG,CAACC,KAAK,CAACE,GAAG,CAAC;UACvB;UAEA,OAAOE,IAAI,CAACoB,SAAS,CAACC,EAAE,CAAC;QAC3B,CAAC;QACDzC,UAAU,EAAG2C,OAAe,IAC1B3C,UAAU,CAAE4C,CAAC,KAAM;UACjB,GAAGA,CAAC;UACJ,CAAC5B,KAAK,CAACE,GAAG,GAAG;YAAE,GAAG0B,CAAC,CAAC5B,KAAK,CAACE,GAAG,CAAC;YAAE,GAAGyB;UAAQ;QAC7C,CAAC,CAAC,CAAC;QACLE,SAAS,EAAE,MAAM;UACf,MAAMhD,KAAK,GAAGC,QAAQ,EAAE;UAExB,IAAID,KAAK,CAACgB,MAAM,CAAChB,KAAK,CAACiD,KAAK,CAAC,CAAC5B,GAAG,KAAKF,KAAK,CAACE,GAAG,EAAE;YAC/C,OAAO,KAAK;UACd;;UAEA;UACA;UACA,OAAOnB,UAAU,GAAGA,UAAU,CAAC8C,SAAS,EAAE,GAAG,IAAI;QACnD;MACF,CAAC;IACH;IAEA,OAAO9B,GAAG;EACZ,CAAC,EAAE,CAAC,CAAC,CAAC;EAEN,OAAOR,KAAK,CAACE,OAAO;AACtB"}
|
|
@@ -4,24 +4,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = useNavigationContainerRef;
|
|
7
|
-
|
|
8
7
|
var React = _interopRequireWildcard(require("react"));
|
|
9
|
-
|
|
10
8
|
var _createNavigationContainerRef = _interopRequireDefault(require("./createNavigationContainerRef"));
|
|
11
|
-
|
|
12
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
-
|
|
14
10
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
15
|
-
|
|
16
11
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
17
|
-
|
|
18
12
|
function useNavigationContainerRef() {
|
|
19
13
|
const navigation = React.useRef(null);
|
|
20
|
-
|
|
21
14
|
if (navigation.current == null) {
|
|
22
15
|
navigation.current = (0, _createNavigationContainerRef.default)();
|
|
23
16
|
}
|
|
24
|
-
|
|
25
17
|
return navigation.current;
|
|
26
18
|
}
|
|
27
19
|
//# sourceMappingURL=useNavigationContainerRef.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useNavigationContainerRef","navigation","React","useRef","current","createNavigationContainerRef"],"
|
|
1
|
+
{"version":3,"names":["useNavigationContainerRef","navigation","React","useRef","current","createNavigationContainerRef"],"sourceRoot":"../../src","sources":["useNavigationContainerRef.tsx"],"mappings":";;;;;;AAAA;AAEA;AAA0E;AAAA;AAAA;AAG3D,SAASA,yBAAyB,GAEC;EAChD,MAAMC,UAAU,GACdC,KAAK,CAACC,MAAM,CAAsD,IAAI,CAAC;EAEzE,IAAIF,UAAU,CAACG,OAAO,IAAI,IAAI,EAAE;IAC9BH,UAAU,CAACG,OAAO,GAAG,IAAAC,qCAA4B,GAAa;EAChE;EAEA,OAAOJ,UAAU,CAACG,OAAO;AAC3B"}
|
|
@@ -4,27 +4,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = useNavigationHelpers;
|
|
7
|
-
|
|
8
7
|
var _routers = require("@react-navigation/routers");
|
|
9
|
-
|
|
10
8
|
var React = _interopRequireWildcard(require("react"));
|
|
11
|
-
|
|
12
9
|
var _NavigationContext = _interopRequireDefault(require("./NavigationContext"));
|
|
13
|
-
|
|
14
10
|
var _types = require("./types");
|
|
15
|
-
|
|
16
11
|
var _UnhandledActionContext = _interopRequireDefault(require("./UnhandledActionContext"));
|
|
17
|
-
|
|
18
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
-
|
|
20
13
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
21
|
-
|
|
22
14
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
23
|
-
|
|
24
15
|
// This is to make TypeScript compiler happy
|
|
25
16
|
// eslint-disable-next-line babel/no-unused-expressions
|
|
26
17
|
_types.PrivateValueStore;
|
|
27
|
-
|
|
28
18
|
/**
|
|
29
19
|
* Navigation object with helper methods to be used by a navigator.
|
|
30
20
|
* This object includes methods for common actions as well as methods the parent screen's navigation object.
|
|
@@ -43,13 +33,12 @@ function useNavigationHelpers(_ref) {
|
|
|
43
33
|
const dispatch = op => {
|
|
44
34
|
const action = typeof op === 'function' ? op(getState()) : op;
|
|
45
35
|
const handled = onAction(action);
|
|
46
|
-
|
|
47
36
|
if (!handled) {
|
|
48
37
|
onUnhandledAction === null || onUnhandledAction === void 0 ? void 0 : onUnhandledAction(action);
|
|
49
38
|
}
|
|
50
39
|
};
|
|
51
|
-
|
|
52
|
-
|
|
40
|
+
const actions = {
|
|
41
|
+
...router.actionCreators,
|
|
53
42
|
..._routers.CommonActions
|
|
54
43
|
};
|
|
55
44
|
const helpers = Object.keys(actions).reduce((acc, name) => {
|
|
@@ -57,10 +46,10 @@ function useNavigationHelpers(_ref) {
|
|
|
57
46
|
acc[name] = function () {
|
|
58
47
|
return dispatch(actions[name](...arguments));
|
|
59
48
|
};
|
|
60
|
-
|
|
61
49
|
return acc;
|
|
62
50
|
}, {});
|
|
63
|
-
const navigationHelpers = {
|
|
51
|
+
const navigationHelpers = {
|
|
52
|
+
...parentNavigationHelpers,
|
|
64
53
|
...helpers,
|
|
65
54
|
dispatch,
|
|
66
55
|
emit: emitter.emit,
|
|
@@ -77,14 +66,11 @@ function useNavigationHelpers(_ref) {
|
|
|
77
66
|
getParent: id => {
|
|
78
67
|
if (id !== undefined) {
|
|
79
68
|
let current = navigationHelpers;
|
|
80
|
-
|
|
81
69
|
while (current && id !== current.getId()) {
|
|
82
70
|
current = current.getParent();
|
|
83
71
|
}
|
|
84
|
-
|
|
85
72
|
return current;
|
|
86
73
|
}
|
|
87
|
-
|
|
88
74
|
return parentNavigationHelpers;
|
|
89
75
|
},
|
|
90
76
|
getState
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["PrivateValueStore","useNavigationHelpers","id","navigatorId","onAction","getState","emitter","router","onUnhandledAction","React","useContext","UnhandledActionContext","parentNavigationHelpers","NavigationContext","useMemo","dispatch","op","action","handled","actions","actionCreators","CommonActions","helpers","Object","keys","reduce","acc","name","navigationHelpers","emit","isFocused","canGoBack","state","getStateForAction","goBack","routeNames","routeParamList","routeGetIdList","getId","getParent","undefined","current"],"
|
|
1
|
+
{"version":3,"names":["PrivateValueStore","useNavigationHelpers","id","navigatorId","onAction","getState","emitter","router","onUnhandledAction","React","useContext","UnhandledActionContext","parentNavigationHelpers","NavigationContext","useMemo","dispatch","op","action","handled","actions","actionCreators","CommonActions","helpers","Object","keys","reduce","acc","name","navigationHelpers","emit","isFocused","canGoBack","state","getStateForAction","goBack","routeNames","routeParamList","routeGetIdList","getId","getParent","undefined","current"],"sourceRoot":"../../src","sources":["useNavigationHelpers.tsx"],"mappings":";;;;;;AAAA;AAOA;AAEA;AACA;AACA;AAA8D;AAAA;AAAA;AAG9D;AACA;AACAA,wBAAiB;AAUjB;AACA;AACA;AACA;AACe,SAASC,oBAAoB,OAWjB;EAAA,IANzB;IACAC,EAAE,EAAEC,WAAW;IACfC,QAAQ;IACRC,QAAQ;IACRC,OAAO;IACPC;EACsB,CAAC;EACvB,MAAMC,iBAAiB,GAAGC,KAAK,CAACC,UAAU,CAACC,+BAAsB,CAAC;EAClE,MAAMC,uBAAuB,GAAGH,KAAK,CAACC,UAAU,CAACG,0BAAiB,CAAC;EAEnE,OAAOJ,KAAK,CAACK,OAAO,CAAC,MAAM;IACzB,MAAMC,QAAQ,GAAIC,EAAuC,IAAK;MAC5D,MAAMC,MAAM,GAAG,OAAOD,EAAE,KAAK,UAAU,GAAGA,EAAE,CAACX,QAAQ,E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,SAAS,EAAE;UACpB,IAAIC,OAAO,GAAGb,iBAAiB;UAE/B,OAAOa,OAAO,IAAIvC,EAAE,KAAKuC,OAAO,CAACH,KAAK,EAAE,EAAE;YACxCG,OAAO,GAAGA,OAAO,CAACF,SAAS,EAAE;UAC/B;UAEA,OAAOE,OAAO;QAChB;QAEA,OAAO7B,uBAAuB;MAChC,CAAC;MACDP;IACF,CAA+D;IAE/D,OAAOuB,iBAAiB;EAC1B,CAAC,EAAE,CACDzB,WAAW,EACXG,OAAO,CAACuB,IAAI,EACZxB,QAAQ,EACRD,QAAQ,EACRI,iBAAiB,EACjBI,uBAAuB,EACvBL,MAAM,CACP,CAAC;AACJ"}
|
|
@@ -4,28 +4,24 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = useNavigationState;
|
|
7
|
-
|
|
8
7
|
var React = _interopRequireWildcard(require("react"));
|
|
9
|
-
|
|
10
8
|
var _useNavigation = _interopRequireDefault(require("./useNavigation"));
|
|
11
|
-
|
|
12
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
-
|
|
14
10
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
15
|
-
|
|
16
11
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
17
|
-
|
|
18
12
|
/**
|
|
19
13
|
* Hook to get a value from the current navigation state using a selector.
|
|
20
14
|
*
|
|
21
15
|
* @param selector Selector function to get a value from the state.
|
|
22
16
|
*/
|
|
23
17
|
function useNavigationState(selector) {
|
|
24
|
-
const navigation = (0, _useNavigation.default)();
|
|
25
|
-
// The state is only to make sure that there's a re-render when we have a new value
|
|
18
|
+
const navigation = (0, _useNavigation.default)();
|
|
26
19
|
|
|
27
|
-
|
|
20
|
+
// We don't care about the state value, we run the selector again at the end
|
|
21
|
+
// The state is only to make sure that there's a re-render when we have a new value
|
|
22
|
+
const [, setResult] = React.useState(() => selector(navigation.getState()));
|
|
28
23
|
|
|
24
|
+
// We store the selector in a ref to avoid re-subscribing listeners every render
|
|
29
25
|
const selectorRef = React.useRef(selector);
|
|
30
26
|
React.useEffect(() => {
|
|
31
27
|
selectorRef.current = selector;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useNavigationState","selector","navigation","useNavigation","setResult","React","useState","getState","selectorRef","useRef","useEffect","current","unsubscribe","addListener","e","data","state"],"
|
|
1
|
+
{"version":3,"names":["useNavigationState","selector","navigation","useNavigation","setResult","React","useState","getState","selectorRef","useRef","useEffect","current","unsubscribe","addListener","e","data","state"],"sourceRoot":"../../src","sources":["useNavigationState.tsx"],"mappings":";;;;;;AACA;AAGA;AAA4C;AAAA;AAAA;AAM5C;AACA;AACA;AACA;AACA;AACe,SAASA,kBAAkB,CACxCC,QAAgC,EAC7B;EACH,MAAMC,UAAU,GAAG,IAAAC,sBAAa,GAA6B;;EAE7D;EACA;EACA,MAAM,GAAGC,SAAS,CAAC,GAAGC,KAAK,CAACC,QAAQ,CAAC,MAAML,QAAQ,CAACC,UAAU,CAACK,QAAQ,EAAE,CAAC,CAAC;;EAE3E;EACA,MAAMC,WAAW,GAAGH,KAAK,CAACI,MAAM,CAACR,QAAQ,CAAC;EAE1CI,KAAK,CAACK,SAAS,CAAC,MAAM;IACpBF,WAAW,CAACG,OAAO,GAAGV,QAAQ;EAChC,CAAC,CAAC;EAEFI,KAAK,CAACK,SAAS,CAAC,MAAM;IACpB,MAAME,WAAW,GAAGV,UAAU,CAACW,WAAW,CAAC,OAAO,EAAGC,CAAC,IAAK;MACzDV,SAAS,CAACI,WAAW,CAACG,OAAO,CAACG,CAAC,CAACC,IAAI,CAACC,KAAK,CAAC,CAAC;IAC9C,CAAC,CAAC;IAEF,OAAOJ,WAAW;EACpB,CAAC,EAAE,CAACV,UAAU,CAAC,CAAC;EAEhB,OAAOD,QAAQ,CAACC,UAAU,CAACK,QAAQ,EAAE,CAAC;AACxC"}
|
|
@@ -4,19 +4,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = useOnAction;
|
|
7
|
-
|
|
8
7
|
var React = _interopRequireWildcard(require("react"));
|
|
9
|
-
|
|
10
8
|
var _NavigationBuilderContext = _interopRequireDefault(require("./NavigationBuilderContext"));
|
|
11
|
-
|
|
12
9
|
var _useOnPreventRemove = _interopRequireWildcard(require("./useOnPreventRemove"));
|
|
13
|
-
|
|
14
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
-
|
|
16
11
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
17
|
-
|
|
18
12
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
19
|
-
|
|
20
13
|
/**
|
|
21
14
|
* Hook to handle actions for a navigator, including state updates and bubbling.
|
|
22
15
|
*
|
|
@@ -49,64 +42,54 @@ function useOnAction(_ref) {
|
|
|
49
42
|
});
|
|
50
43
|
const onAction = React.useCallback(function (action) {
|
|
51
44
|
let visitedNavigators = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : new Set();
|
|
52
|
-
const state = getState();
|
|
53
|
-
// We keep track of navigators which have already tried to handle the action and return if it's already visited
|
|
45
|
+
const state = getState();
|
|
54
46
|
|
|
47
|
+
// Since actions can bubble both up and down, they could come to the same navigator again
|
|
48
|
+
// We keep track of navigators which have already tried to handle the action and return if it's already visited
|
|
55
49
|
if (visitedNavigators.has(state.key)) {
|
|
56
50
|
return false;
|
|
57
51
|
}
|
|
58
|
-
|
|
59
52
|
visitedNavigators.add(state.key);
|
|
60
|
-
|
|
61
53
|
if (typeof action.target !== 'string' || action.target === state.key) {
|
|
62
|
-
let result = router.getStateForAction(state, action, routerConfigOptionsRef.current);
|
|
63
|
-
// So instead of `null`, we use the state object for such cases to signal that action was handled
|
|
54
|
+
let result = router.getStateForAction(state, action, routerConfigOptionsRef.current);
|
|
64
55
|
|
|
56
|
+
// If a target is specified and set to current navigator, the action shouldn't bubble
|
|
57
|
+
// So instead of `null`, we use the state object for such cases to signal that action was handled
|
|
65
58
|
result = result === null && action.target === state.key ? state : result;
|
|
66
|
-
|
|
67
59
|
if (result !== null) {
|
|
68
60
|
onDispatchAction(action, state === result);
|
|
69
|
-
|
|
70
61
|
if (state !== result) {
|
|
71
62
|
const isPrevented = (0, _useOnPreventRemove.shouldPreventRemove)(emitter, beforeRemoveListeners, state.routes, result.routes, action);
|
|
72
|
-
|
|
73
63
|
if (isPrevented) {
|
|
74
64
|
return true;
|
|
75
65
|
}
|
|
76
|
-
|
|
77
66
|
setState(result);
|
|
78
67
|
}
|
|
79
|
-
|
|
80
68
|
if (onRouteFocusParent !== undefined) {
|
|
81
69
|
// Some actions such as `NAVIGATE` also want to bring the navigated route to focus in the whole tree
|
|
82
70
|
// This means we need to focus all of the parent navigators of this navigator as well
|
|
83
71
|
const shouldFocus = router.shouldActionChangeFocus(action);
|
|
84
|
-
|
|
85
72
|
if (shouldFocus && key !== undefined) {
|
|
86
73
|
onRouteFocusParent(key);
|
|
87
74
|
}
|
|
88
75
|
}
|
|
89
|
-
|
|
90
76
|
return true;
|
|
91
77
|
}
|
|
92
78
|
}
|
|
93
|
-
|
|
94
79
|
if (onActionParent !== undefined) {
|
|
95
80
|
// Bubble action to the parent if the current navigator didn't handle it
|
|
96
81
|
if (onActionParent(action, visitedNavigators)) {
|
|
97
82
|
return true;
|
|
98
83
|
}
|
|
99
|
-
}
|
|
100
|
-
|
|
84
|
+
}
|
|
101
85
|
|
|
86
|
+
// If the action wasn't handled by current navigator or a parent navigator, let children handle it
|
|
102
87
|
for (let i = actionListeners.length - 1; i >= 0; i--) {
|
|
103
88
|
const listener = actionListeners[i];
|
|
104
|
-
|
|
105
89
|
if (listener(action, visitedNavigators)) {
|
|
106
90
|
return true;
|
|
107
91
|
}
|
|
108
92
|
}
|
|
109
|
-
|
|
110
93
|
return false;
|
|
111
94
|
}, [actionListeners, beforeRemoveListeners, emitter, getState, key, onActionParent, onDispatchAction, onRouteFocusParent, router, setState]);
|
|
112
95
|
(0, _useOnPreventRemove.default)({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useOnAction","router","getState","setState","key","actionListeners","beforeRemoveListeners","routerConfigOptions","emitter","onAction","onActionParent","onRouteFocus","onRouteFocusParent","addListener","addListenerParent","onDispatchAction","React","useContext","NavigationBuilderContext","routerConfigOptionsRef","useRef","useEffect","current","useCallback","action","visitedNavigators","Set","state","has","add","target","result","getStateForAction","isPrevented","shouldPreventRemove","routes","undefined","shouldFocus","shouldActionChangeFocus","i","length","listener","useOnPreventRemove"],"
|
|
1
|
+
{"version":3,"names":["useOnAction","router","getState","setState","key","actionListeners","beforeRemoveListeners","routerConfigOptions","emitter","onAction","onActionParent","onRouteFocus","onRouteFocusParent","addListener","addListenerParent","onDispatchAction","React","useContext","NavigationBuilderContext","routerConfigOptionsRef","useRef","useEffect","current","useCallback","action","visitedNavigators","Set","state","has","add","target","result","getStateForAction","isPrevented","shouldPreventRemove","routes","undefined","shouldFocus","shouldActionChangeFocus","i","length","listener","useOnPreventRemove"],"sourceRoot":"../../src","sources":["useOnAction.tsx"],"mappings":";;;;;;AAOA;AAEA;AAMA;AAA+E;AAAA;AAAA;AAa/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASA,WAAW,OASvB;EAAA,IATwB;IAClCC,MAAM;IACNC,QAAQ;IACRC,QAAQ;IACRC,GAAG;IACHC,eAAe;IACfC,qBAAqB;IACrBC,mBAAmB;IACnBC;EACO,CAAC;EACR,MAAM;IACJC,QAAQ,EAAEC,cAAc;IACxBC,YAAY,EAAEC,kBAAkB;IAChCC,WAAW,EAAEC,iBAAiB;IAC9BC;EACF,CAAC,GAAGC,KAAK,CAACC,UAAU,CAACC,iCAAwB,CAAC;EAE9C,MAAMC,sBAAsB,GAC1BH,KAAK,CAACI,MAAM,CAAsBb,mBAAmB,CAAC;EAExDS,KAAK,CAACK,SAAS,CAAC,MAAM;IACpBF,sBAAsB,CAACG,OAAO,GAAGf,mBAAmB;EACtD,CAAC,CAAC;EAEF,MAAME,QAAQ,GAAGO,KAAK,CAACO,WAAW,CAChC,UACEC,MAAwB,EAErB;IAAA,IADHC,iBAA8B,uE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;MAChC;MACA,IAAI1B,cAAc,CAACc,MAAM,EAAEC,iBAAiB,CAAC,EAAE;QAC7C,OAAO,IAAI;MACb;IACF;;IAEA;IACA,KAAK,IAAIc,CAAC,GAAGlC,eAAe,CAACmC,MAAM,GAAG,CAAC,EAAED,CAAC,IAAI,CAAC,EAAEA,CAAC,EAAE,EAAE;MACpD,MAAME,QAAQ,GAAGpC,eAAe,CAACkC,CAAC,CAAC;MAEnC,IAAIE,QAAQ,CAACjB,MAAM,EAAEC,iBAAiB,CAAC,EAAE;QACvC,OAAO,IAAI;MACb;IACF;IAEA,OAAO,KAAK;EACd,CAAC,EACD,CACEpB,eAAe,EACfC,qBAAqB,EACrBE,OAAO,EACPN,QAAQ,EACRE,GAAG,EACHM,cAAc,EACdK,gBAAgB,EAChBH,kBAAkB,EAClBX,MAAM,EACNE,QAAQ,CACT,CACF;EAED,IAAAuC,2BAAkB,EAAC;IACjBxC,QAAQ;IACRM,OAAO;IACPF;EACF,CAAC,CAAC;EAEFU,KAAK,CAACK,SAAS,CACb,MAAMP,iBAAiB,aAAjBA,iBAAiB,uBAAjBA,iBAAiB,CAAG,QAAQ,EAAEL,QAAQ,CAAC,EAC7C,CAACK,iBAAiB,EAAEL,QAAQ,CAAC,CAC9B;EAED,OAAOA,QAAQ;AACjB"}
|
|
@@ -4,21 +4,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = useOnGetState;
|
|
7
|
-
|
|
8
7
|
var React = _interopRequireWildcard(require("react"));
|
|
9
|
-
|
|
10
8
|
var _isArrayEqual = _interopRequireDefault(require("./isArrayEqual"));
|
|
11
|
-
|
|
12
9
|
var _NavigationBuilderContext = _interopRequireDefault(require("./NavigationBuilderContext"));
|
|
13
|
-
|
|
14
10
|
var _NavigationRouteContext = _interopRequireDefault(require("./NavigationRouteContext"));
|
|
15
|
-
|
|
16
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
-
|
|
18
12
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
19
|
-
|
|
20
13
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
21
|
-
|
|
22
14
|
function useOnGetState(_ref) {
|
|
23
15
|
let {
|
|
24
16
|
getState,
|
|
@@ -30,27 +22,25 @@ function useOnGetState(_ref) {
|
|
|
30
22
|
const route = React.useContext(_NavigationRouteContext.default);
|
|
31
23
|
const key = route ? route.key : 'root';
|
|
32
24
|
const getRehydratedState = React.useCallback(() => {
|
|
33
|
-
const state = getState();
|
|
25
|
+
const state = getState();
|
|
34
26
|
|
|
27
|
+
// Avoid returning new route objects if we don't need to
|
|
35
28
|
const routes = state.routes.map(route => {
|
|
36
29
|
var _getStateListeners$ro;
|
|
37
|
-
|
|
38
30
|
const childState = (_getStateListeners$ro = getStateListeners[route.key]) === null || _getStateListeners$ro === void 0 ? void 0 : _getStateListeners$ro.call(getStateListeners);
|
|
39
|
-
|
|
40
31
|
if (route.state === childState) {
|
|
41
32
|
return route;
|
|
42
33
|
}
|
|
43
|
-
|
|
44
|
-
|
|
34
|
+
return {
|
|
35
|
+
...route,
|
|
45
36
|
state: childState
|
|
46
37
|
};
|
|
47
38
|
});
|
|
48
|
-
|
|
49
39
|
if ((0, _isArrayEqual.default)(state.routes, routes)) {
|
|
50
40
|
return state;
|
|
51
41
|
}
|
|
52
|
-
|
|
53
|
-
|
|
42
|
+
return {
|
|
43
|
+
...state,
|
|
54
44
|
routes
|
|
55
45
|
};
|
|
56
46
|
}, [getState, getStateListeners]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useOnGetState","getState","getStateListeners","addKeyedListener","React","useContext","NavigationBuilderContext","route","NavigationRouteContext","key","getRehydratedState","useCallback","state","routes","map","childState","isArrayEqual","useEffect"],"
|
|
1
|
+
{"version":3,"names":["useOnGetState","getState","getStateListeners","addKeyedListener","React","useContext","NavigationBuilderContext","route","NavigationRouteContext","key","getRehydratedState","useCallback","state","routes","map","childState","isArrayEqual","useEffect"],"sourceRoot":"../../src","sources":["useOnGetState.tsx"],"mappings":";;;;;;AACA;AAEA;AACA;AAGA;AAA8D;AAAA;AAAA;AAO/C,SAASA,aAAa,OAGzB;EAAA,IAH0B;IACpCC,QAAQ;IACRC;EACO,CAAC;EACR,MAAM;IAAEC;EAAiB,CAAC,GAAGC,KAAK,CAACC,UAAU,CAACC,iCAAwB,CAAC;EACvE,MAAMC,KAAK,GAAGH,KAAK,CAACC,UAAU,CAACG,+BAAsB,CAAC;EACtD,MAAMC,GAAG,GAAGF,KAAK,GAAGA,KAAK,CAACE,GAAG,GAAG,MAAM;EAEtC,MAAMC,kBAAkB,GAAGN,KAAK,CAACO,WAAW,CAAC,MAAM;IACjD,MAAMC,KAAK,GAAGX,QAAQ,EAAE;;IAExB;IACA,MAAMY,MAAM,GAAGD,KAAK,CAACC,MAAM,CAACC,GAAG,CAAEP,KAAK,IAAK;MAAA;MACzC,MAAMQ,UAAU,4BAAGb,iBAAiB,CAACK,KAAK,CAACE,GAAG,CAAC,0DAA5B,2BAAAP,iBAAiB,CA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