react-native-screen-transitions 3.0.0-rc.1 → 3.0.0-rc.3
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/README.md +421 -371
- package/lib/commonjs/blank-stack/components/{Overlay.js → overlay.js} +11 -12
- package/lib/commonjs/blank-stack/components/overlay.js.map +1 -0
- package/lib/commonjs/blank-stack/components/{Screens.js → screens.js} +8 -10
- package/lib/commonjs/blank-stack/components/screens.js.map +1 -0
- package/lib/commonjs/blank-stack/components/stack-view.js +95 -0
- package/lib/commonjs/blank-stack/components/stack-view.js.map +1 -0
- package/lib/commonjs/blank-stack/hooks/use-overlay-animation.js +2 -3
- package/lib/commonjs/blank-stack/hooks/use-overlay-animation.js.map +1 -1
- package/lib/commonjs/blank-stack/index.js +1 -8
- package/lib/commonjs/blank-stack/index.js.map +1 -1
- package/lib/commonjs/blank-stack/navigators/{createBlankStackNavigator.js → create-blank-stack-navigator.js} +3 -3
- package/lib/commonjs/blank-stack/navigators/create-blank-stack-navigator.js.map +1 -0
- package/lib/commonjs/blank-stack/utils/with-stack-navigation/helpers/are-descriptors-equal.js.map +1 -0
- package/lib/{module/blank-stack/utils/with-stack-navigation/_utils → commonjs/blank-stack/utils/with-stack-navigation/helpers}/calculate-active-screens-limit.js.map +1 -1
- package/lib/commonjs/blank-stack/utils/with-stack-navigation/helpers/compose-descriptors.js +15 -0
- package/lib/commonjs/blank-stack/utils/with-stack-navigation/helpers/compose-descriptors.js.map +1 -0
- package/lib/commonjs/blank-stack/utils/with-stack-navigation/helpers/have-same-route-keys.js.map +1 -0
- package/lib/commonjs/blank-stack/utils/with-stack-navigation/helpers/routes-are-identical.js.map +1 -0
- package/lib/commonjs/blank-stack/utils/with-stack-navigation/{_hooks → hooks}/use-closing-route-keys.js +1 -12
- package/lib/commonjs/blank-stack/utils/with-stack-navigation/hooks/use-closing-route-keys.js.map +1 -0
- package/lib/commonjs/blank-stack/utils/with-stack-navigation/hooks/use-previous.js.map +1 -0
- package/lib/commonjs/blank-stack/utils/with-stack-navigation/{_hooks → hooks}/use-stack-navigation-state.js +4 -4
- package/lib/commonjs/blank-stack/utils/with-stack-navigation/hooks/use-stack-navigation-state.js.map +1 -0
- package/lib/commonjs/blank-stack/utils/with-stack-navigation/index.js +50 -56
- package/lib/commonjs/blank-stack/utils/with-stack-navigation/index.js.map +1 -1
- package/lib/commonjs/blank-stack/utils/with-stack-navigation/{_types.js → types.js} +1 -1
- package/lib/commonjs/blank-stack/utils/with-stack-navigation/types.js.map +1 -0
- package/lib/commonjs/shared/configs/presets.js +8 -2
- package/lib/commonjs/shared/configs/presets.js.map +1 -1
- package/lib/commonjs/shared/hooks/animation/use-screen-animation.js +42 -21
- package/lib/commonjs/shared/hooks/animation/use-screen-animation.js.map +1 -1
- package/lib/commonjs/shared/hooks/gestures/use-build-gestures.js.map +1 -1
- package/lib/commonjs/shared/providers/flags.provider.js +25 -0
- package/lib/commonjs/shared/providers/flags.provider.js.map +1 -0
- package/lib/commonjs/shared/providers/register-bounds.provider.js +71 -45
- package/lib/commonjs/shared/providers/register-bounds.provider.js.map +1 -1
- package/lib/commonjs/shared/stores/bounds.store.js +91 -47
- package/lib/commonjs/shared/stores/bounds.store.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/helpers/is-bounds-equal.js +1 -1
- package/lib/commonjs/shared/utils/bounds/helpers/is-bounds-equal.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/index.js +4 -5
- package/lib/commonjs/shared/utils/bounds/index.js.map +1 -1
- package/lib/commonjs/shared/utils/create-provider.js +20 -1
- package/lib/commonjs/shared/utils/create-provider.js.map +1 -1
- package/lib/commonjs/shared/utils/reset-stores-for-screen.js +2 -0
- package/lib/commonjs/shared/utils/reset-stores-for-screen.js.map +1 -1
- package/lib/module/blank-stack/components/{Overlay.js → overlay.js} +11 -12
- package/lib/module/blank-stack/components/overlay.js.map +1 -0
- package/lib/module/blank-stack/components/{Screens.js → screens.js} +8 -10
- package/lib/module/blank-stack/components/screens.js.map +1 -0
- package/lib/module/blank-stack/components/stack-view.js +90 -0
- package/lib/module/blank-stack/components/stack-view.js.map +1 -0
- package/lib/module/blank-stack/hooks/use-overlay-animation.js +2 -3
- package/lib/module/blank-stack/hooks/use-overlay-animation.js.map +1 -1
- package/lib/module/blank-stack/index.js +1 -2
- package/lib/module/blank-stack/index.js.map +1 -1
- package/lib/module/blank-stack/navigators/{createBlankStackNavigator.js → create-blank-stack-navigator.js} +2 -2
- package/lib/module/blank-stack/navigators/create-blank-stack-navigator.js.map +1 -0
- package/lib/module/blank-stack/utils/with-stack-navigation/helpers/are-descriptors-equal.js.map +1 -0
- package/lib/module/blank-stack/utils/with-stack-navigation/helpers/calculate-active-screens-limit.js.map +1 -0
- package/lib/module/blank-stack/utils/with-stack-navigation/helpers/compose-descriptors.js +10 -0
- package/lib/module/blank-stack/utils/with-stack-navigation/helpers/compose-descriptors.js.map +1 -0
- package/lib/module/blank-stack/utils/with-stack-navigation/helpers/have-same-route-keys.js.map +1 -0
- package/lib/module/blank-stack/utils/with-stack-navigation/helpers/routes-are-identical.js.map +1 -0
- package/lib/module/blank-stack/utils/with-stack-navigation/{_hooks → hooks}/use-closing-route-keys.js +1 -12
- package/lib/module/blank-stack/utils/with-stack-navigation/hooks/use-closing-route-keys.js.map +1 -0
- package/lib/module/blank-stack/utils/with-stack-navigation/hooks/use-previous.js.map +1 -0
- package/lib/module/blank-stack/utils/with-stack-navigation/{_hooks → hooks}/use-stack-navigation-state.js +4 -4
- package/lib/module/blank-stack/utils/with-stack-navigation/hooks/use-stack-navigation-state.js.map +1 -0
- package/lib/module/blank-stack/utils/with-stack-navigation/index.js +49 -55
- package/lib/module/blank-stack/utils/with-stack-navigation/index.js.map +1 -1
- package/lib/module/blank-stack/utils/with-stack-navigation/types.js +4 -0
- package/lib/module/blank-stack/utils/with-stack-navigation/types.js.map +1 -0
- package/lib/module/shared/configs/presets.js +8 -2
- package/lib/module/shared/configs/presets.js.map +1 -1
- package/lib/module/shared/hooks/animation/use-screen-animation.js +42 -21
- package/lib/module/shared/hooks/animation/use-screen-animation.js.map +1 -1
- package/lib/module/shared/hooks/gestures/use-build-gestures.js.map +1 -1
- package/lib/module/shared/providers/flags.provider.js +19 -0
- package/lib/module/shared/providers/flags.provider.js.map +1 -0
- package/lib/module/shared/providers/register-bounds.provider.js +71 -45
- package/lib/module/shared/providers/register-bounds.provider.js.map +1 -1
- package/lib/module/shared/stores/bounds.store.js +91 -47
- package/lib/module/shared/stores/bounds.store.js.map +1 -1
- package/lib/module/shared/utils/bounds/helpers/is-bounds-equal.js +1 -1
- package/lib/module/shared/utils/bounds/helpers/is-bounds-equal.js.map +1 -1
- package/lib/module/shared/utils/bounds/index.js +4 -5
- package/lib/module/shared/utils/bounds/index.js.map +1 -1
- package/lib/module/shared/utils/create-provider.js +20 -1
- package/lib/module/shared/utils/create-provider.js.map +1 -1
- package/lib/module/shared/utils/reset-stores-for-screen.js +2 -0
- package/lib/module/shared/utils/reset-stores-for-screen.js.map +1 -1
- package/lib/typescript/blank-stack/components/{Overlay.d.ts → overlay.d.ts} +1 -1
- package/lib/typescript/blank-stack/components/overlay.d.ts.map +1 -0
- package/lib/typescript/blank-stack/components/{Screens.d.ts → screens.d.ts} +1 -1
- package/lib/typescript/blank-stack/components/{Screens.d.ts.map → screens.d.ts.map} +1 -1
- package/lib/typescript/blank-stack/components/stack-view.d.ts +3 -0
- package/lib/typescript/blank-stack/components/stack-view.d.ts.map +1 -0
- package/lib/typescript/blank-stack/index.d.ts +1 -2
- package/lib/typescript/blank-stack/index.d.ts.map +1 -1
- package/lib/typescript/blank-stack/navigators/{createBlankStackNavigator.d.ts → create-blank-stack-navigator.d.ts} +1 -1
- package/lib/typescript/blank-stack/navigators/create-blank-stack-navigator.d.ts.map +1 -0
- package/lib/typescript/blank-stack/types.d.ts +23 -105
- package/lib/typescript/blank-stack/types.d.ts.map +1 -1
- package/lib/typescript/blank-stack/utils/with-stack-navigation/helpers/are-descriptors-equal.d.ts.map +1 -0
- package/lib/typescript/blank-stack/utils/with-stack-navigation/helpers/calculate-active-screens-limit.d.ts.map +1 -0
- package/lib/typescript/blank-stack/utils/with-stack-navigation/helpers/compose-descriptors.d.ts.map +1 -0
- package/lib/typescript/blank-stack/utils/with-stack-navigation/helpers/have-same-route-keys.d.ts.map +1 -0
- package/lib/typescript/blank-stack/utils/with-stack-navigation/helpers/routes-are-identical.d.ts.map +1 -0
- package/lib/typescript/blank-stack/utils/with-stack-navigation/{_hooks → hooks}/use-closing-route-keys.d.ts.map +1 -1
- package/lib/typescript/blank-stack/utils/with-stack-navigation/{_hooks → hooks}/use-previous.d.ts.map +1 -1
- package/lib/typescript/blank-stack/utils/with-stack-navigation/{_hooks → hooks}/use-stack-navigation-state.d.ts +1 -1
- package/lib/typescript/blank-stack/utils/with-stack-navigation/hooks/use-stack-navigation-state.d.ts.map +1 -0
- package/lib/typescript/blank-stack/utils/with-stack-navigation/index.d.ts +3 -5
- package/lib/typescript/blank-stack/utils/with-stack-navigation/index.d.ts.map +1 -1
- package/lib/typescript/blank-stack/utils/with-stack-navigation/{_types.d.ts → types.d.ts} +1 -1
- package/lib/typescript/blank-stack/utils/with-stack-navigation/types.d.ts.map +1 -0
- package/lib/typescript/native-stack/types.d.ts +7 -1
- package/lib/typescript/native-stack/types.d.ts.map +1 -1
- package/lib/typescript/shared/configs/index.d.ts.map +1 -1
- package/lib/typescript/shared/configs/presets.d.ts.map +1 -1
- package/lib/typescript/shared/hooks/animation/use-screen-animation.d.ts.map +1 -1
- package/lib/typescript/shared/hooks/gestures/use-build-gestures.d.ts.map +1 -1
- package/lib/typescript/shared/index.d.ts +32 -32
- package/lib/typescript/shared/index.d.ts.map +1 -1
- package/lib/typescript/shared/providers/flags.provider.d.ts +10 -0
- package/lib/typescript/shared/providers/flags.provider.d.ts.map +1 -0
- package/lib/typescript/shared/providers/register-bounds.provider.d.ts.map +1 -1
- package/lib/typescript/shared/stores/bounds.store.d.ts +23 -11
- package/lib/typescript/shared/stores/bounds.store.d.ts.map +1 -1
- package/lib/typescript/shared/types/bounds.types.d.ts +2 -2
- package/lib/typescript/shared/types/bounds.types.d.ts.map +1 -1
- package/lib/typescript/shared/types/core.types.d.ts +0 -4
- package/lib/typescript/shared/types/core.types.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/index.d.ts.map +1 -1
- package/lib/typescript/shared/utils/create-provider.d.ts +2 -2
- package/lib/typescript/shared/utils/create-provider.d.ts.map +1 -1
- package/lib/typescript/shared/utils/reset-stores-for-screen.d.ts.map +1 -1
- package/package.json +2 -1
- package/src/blank-stack/components/{Overlay.tsx → overlay.tsx} +9 -12
- package/src/blank-stack/components/{Screens.tsx → screens.tsx} +7 -9
- package/src/blank-stack/components/stack-view.tsx +104 -0
- package/src/blank-stack/hooks/use-overlay-animation.tsx +11 -11
- package/src/blank-stack/index.ts +1 -2
- package/src/blank-stack/navigators/{createBlankStackNavigator.tsx → create-blank-stack-navigator.tsx} +1 -1
- package/src/blank-stack/types.ts +31 -109
- package/src/blank-stack/utils/with-stack-navigation/{_utils → helpers}/compose-descriptors.ts +1 -8
- package/src/blank-stack/utils/with-stack-navigation/{_hooks → hooks}/use-closing-route-keys.tsx +1 -12
- package/src/blank-stack/utils/with-stack-navigation/{_hooks → hooks}/use-stack-navigation-state.tsx +5 -5
- package/src/blank-stack/utils/with-stack-navigation/index.tsx +43 -63
- package/src/native-stack/types.ts +8 -1
- package/src/shared/__tests__/bounds.store.test.ts +398 -167
- package/src/shared/__tests__/determine-dismissal.test.ts +2 -12
- package/src/shared/__tests__/geometry.test.ts +1 -1
- package/src/shared/__tests__/gesture.velocity.test.ts +2 -10
- package/src/shared/configs/presets.ts +8 -2
- package/src/shared/hooks/animation/use-screen-animation.tsx +65 -31
- package/src/shared/hooks/gestures/use-build-gestures.tsx +4 -1
- package/src/shared/providers/flags.provider.tsx +21 -0
- package/src/shared/providers/register-bounds.provider.tsx +85 -54
- package/src/shared/stores/bounds.store.ts +90 -54
- package/src/shared/types/bounds.types.ts +2 -2
- package/src/shared/types/core.types.ts +4 -6
- package/src/shared/utils/bounds/helpers/is-bounds-equal.ts +1 -1
- package/src/shared/utils/bounds/index.ts +7 -10
- package/src/shared/utils/create-provider.tsx +35 -1
- package/src/shared/utils/reset-stores-for-screen.ts +2 -0
- package/lib/commonjs/blank-stack/components/Overlay.js.map +0 -1
- package/lib/commonjs/blank-stack/components/Screens.js.map +0 -1
- package/lib/commonjs/blank-stack/components/StackView.js +0 -93
- package/lib/commonjs/blank-stack/components/StackView.js.map +0 -1
- package/lib/commonjs/blank-stack/navigators/createBlankStackNavigator.js.map +0 -1
- package/lib/commonjs/blank-stack/utils/with-stack-navigation/_hooks/use-closing-route-keys.js.map +0 -1
- package/lib/commonjs/blank-stack/utils/with-stack-navigation/_hooks/use-previous.js.map +0 -1
- package/lib/commonjs/blank-stack/utils/with-stack-navigation/_hooks/use-stack-navigation-state.js.map +0 -1
- package/lib/commonjs/blank-stack/utils/with-stack-navigation/_types.js.map +0 -1
- package/lib/commonjs/blank-stack/utils/with-stack-navigation/_utils/are-descriptors-equal.js.map +0 -1
- package/lib/commonjs/blank-stack/utils/with-stack-navigation/_utils/calculate-active-screens-limit.js.map +0 -1
- package/lib/commonjs/blank-stack/utils/with-stack-navigation/_utils/compose-descriptors.js +0 -25
- package/lib/commonjs/blank-stack/utils/with-stack-navigation/_utils/compose-descriptors.js.map +0 -1
- package/lib/commonjs/blank-stack/utils/with-stack-navigation/_utils/have-same-route-keys.js.map +0 -1
- package/lib/commonjs/blank-stack/utils/with-stack-navigation/_utils/routes-are-identical.js.map +0 -1
- package/lib/module/blank-stack/components/Overlay.js.map +0 -1
- package/lib/module/blank-stack/components/Screens.js.map +0 -1
- package/lib/module/blank-stack/components/StackView.js +0 -88
- package/lib/module/blank-stack/components/StackView.js.map +0 -1
- package/lib/module/blank-stack/navigators/createBlankStackNavigator.js.map +0 -1
- package/lib/module/blank-stack/utils/with-stack-navigation/_hooks/use-closing-route-keys.js.map +0 -1
- package/lib/module/blank-stack/utils/with-stack-navigation/_hooks/use-previous.js.map +0 -1
- package/lib/module/blank-stack/utils/with-stack-navigation/_hooks/use-stack-navigation-state.js.map +0 -1
- package/lib/module/blank-stack/utils/with-stack-navigation/_types.js +0 -4
- package/lib/module/blank-stack/utils/with-stack-navigation/_types.js.map +0 -1
- package/lib/module/blank-stack/utils/with-stack-navigation/_utils/are-descriptors-equal.js.map +0 -1
- package/lib/module/blank-stack/utils/with-stack-navigation/_utils/compose-descriptors.js +0 -20
- package/lib/module/blank-stack/utils/with-stack-navigation/_utils/compose-descriptors.js.map +0 -1
- package/lib/module/blank-stack/utils/with-stack-navigation/_utils/have-same-route-keys.js.map +0 -1
- package/lib/module/blank-stack/utils/with-stack-navigation/_utils/routes-are-identical.js.map +0 -1
- package/lib/typescript/blank-stack/components/Overlay.d.ts.map +0 -1
- package/lib/typescript/blank-stack/components/StackView.d.ts +0 -2
- package/lib/typescript/blank-stack/components/StackView.d.ts.map +0 -1
- package/lib/typescript/blank-stack/navigators/createBlankStackNavigator.d.ts.map +0 -1
- package/lib/typescript/blank-stack/utils/with-stack-navigation/_hooks/use-stack-navigation-state.d.ts.map +0 -1
- package/lib/typescript/blank-stack/utils/with-stack-navigation/_types.d.ts.map +0 -1
- package/lib/typescript/blank-stack/utils/with-stack-navigation/_utils/are-descriptors-equal.d.ts.map +0 -1
- package/lib/typescript/blank-stack/utils/with-stack-navigation/_utils/calculate-active-screens-limit.d.ts.map +0 -1
- package/lib/typescript/blank-stack/utils/with-stack-navigation/_utils/compose-descriptors.d.ts.map +0 -1
- package/lib/typescript/blank-stack/utils/with-stack-navigation/_utils/have-same-route-keys.d.ts.map +0 -1
- package/lib/typescript/blank-stack/utils/with-stack-navigation/_utils/routes-are-identical.d.ts.map +0 -1
- package/src/blank-stack/components/StackView.tsx +0 -108
- /package/lib/commonjs/blank-stack/utils/with-stack-navigation/{_utils → helpers}/are-descriptors-equal.js +0 -0
- /package/lib/commonjs/blank-stack/utils/with-stack-navigation/{_utils → helpers}/calculate-active-screens-limit.js +0 -0
- /package/lib/commonjs/blank-stack/utils/with-stack-navigation/{_utils → helpers}/have-same-route-keys.js +0 -0
- /package/lib/commonjs/blank-stack/utils/with-stack-navigation/{_utils → helpers}/routes-are-identical.js +0 -0
- /package/lib/commonjs/blank-stack/utils/with-stack-navigation/{_hooks → hooks}/use-previous.js +0 -0
- /package/lib/module/blank-stack/utils/with-stack-navigation/{_utils → helpers}/are-descriptors-equal.js +0 -0
- /package/lib/module/blank-stack/utils/with-stack-navigation/{_utils → helpers}/calculate-active-screens-limit.js +0 -0
- /package/lib/module/blank-stack/utils/with-stack-navigation/{_utils → helpers}/have-same-route-keys.js +0 -0
- /package/lib/module/blank-stack/utils/with-stack-navigation/{_utils → helpers}/routes-are-identical.js +0 -0
- /package/lib/module/blank-stack/utils/with-stack-navigation/{_hooks → hooks}/use-previous.js +0 -0
- /package/lib/typescript/blank-stack/utils/with-stack-navigation/{_utils → helpers}/are-descriptors-equal.d.ts +0 -0
- /package/lib/typescript/blank-stack/utils/with-stack-navigation/{_utils → helpers}/calculate-active-screens-limit.d.ts +0 -0
- /package/lib/typescript/blank-stack/utils/with-stack-navigation/{_utils → helpers}/compose-descriptors.d.ts +0 -0
- /package/lib/typescript/blank-stack/utils/with-stack-navigation/{_utils → helpers}/have-same-route-keys.d.ts +0 -0
- /package/lib/typescript/blank-stack/utils/with-stack-navigation/{_utils → helpers}/routes-are-identical.d.ts +0 -0
- /package/lib/typescript/blank-stack/utils/with-stack-navigation/{_hooks → hooks}/use-closing-route-keys.d.ts +0 -0
- /package/lib/typescript/blank-stack/utils/with-stack-navigation/{_hooks → hooks}/use-previous.d.ts +0 -0
- /package/src/blank-stack/utils/with-stack-navigation/{_utils → helpers}/are-descriptors-equal.ts +0 -0
- /package/src/blank-stack/utils/with-stack-navigation/{_utils → helpers}/calculate-active-screens-limit.ts +0 -0
- /package/src/blank-stack/utils/with-stack-navigation/{_utils → helpers}/have-same-route-keys.ts +0 -0
- /package/src/blank-stack/utils/with-stack-navigation/{_utils → helpers}/routes-are-identical.ts +0 -0
- /package/src/blank-stack/utils/with-stack-navigation/{_hooks → hooks}/use-previous.tsx +0 -0
- /package/src/blank-stack/utils/with-stack-navigation/{_types.ts → types.ts} +0 -0
|
@@ -1,45 +1,50 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useMemo } from "react";
|
|
2
|
+
import createProvider from "../../../shared/utils/create-provider";
|
|
2
3
|
import type { BlankStackScene } from "../../types";
|
|
3
|
-
import {
|
|
4
|
+
import { calculateActiveScreensLimit } from "./helpers/calculate-active-screens-limit";
|
|
5
|
+
import { useStackNavigationState } from "./hooks/use-stack-navigation-state";
|
|
4
6
|
import type {
|
|
5
7
|
StackNavigationContextProps,
|
|
6
8
|
StackNavigationContextValue,
|
|
7
|
-
} from "./
|
|
8
|
-
import { calculateActiveScreensLimit } from "./_utils/calculate-active-screens-limit";
|
|
9
|
+
} from "./types";
|
|
9
10
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
) {
|
|
16
|
-
return function StackNavigationWrapper(props: StackNavigationContextProps) {
|
|
11
|
+
const { withStackNavigationProvider, useStackNavigationContext } =
|
|
12
|
+
createProvider("StackNavigation")<
|
|
13
|
+
StackNavigationContextProps,
|
|
14
|
+
StackNavigationContextValue
|
|
15
|
+
>((props) => {
|
|
17
16
|
const { state, handleCloseRoute, closingRouteKeys } =
|
|
18
17
|
useStackNavigationState(props);
|
|
19
18
|
|
|
20
|
-
const scenes
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
return
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
19
|
+
const { scenes, activeScreensLimit, shouldShowFloatOverlay } =
|
|
20
|
+
useMemo(() => {
|
|
21
|
+
const scenes: BlankStackScene[] = [];
|
|
22
|
+
let shouldShowFloatOverlay = false;
|
|
23
|
+
|
|
24
|
+
for (const route of state.routes) {
|
|
25
|
+
const descriptor = state.descriptors[route.key];
|
|
26
|
+
scenes.push({ route, descriptor });
|
|
27
|
+
|
|
28
|
+
if (!shouldShowFloatOverlay) {
|
|
29
|
+
const options = descriptor?.options;
|
|
30
|
+
shouldShowFloatOverlay =
|
|
31
|
+
options?.overlayMode === "float" &&
|
|
32
|
+
options?.overlayShown === true;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return {
|
|
37
|
+
scenes,
|
|
38
|
+
activeScreensLimit: calculateActiveScreensLimit(
|
|
39
|
+
state.routes,
|
|
40
|
+
state.descriptors,
|
|
41
|
+
),
|
|
42
|
+
shouldShowFloatOverlay,
|
|
43
|
+
};
|
|
44
|
+
}, [state.routes, state.descriptors]);
|
|
45
|
+
|
|
46
|
+
return {
|
|
47
|
+
value: {
|
|
43
48
|
routes: state.routes,
|
|
44
49
|
focusedIndex: props.state.index,
|
|
45
50
|
descriptors: state.descriptors,
|
|
@@ -48,33 +53,8 @@ export function withStackNavigationProvider(
|
|
|
48
53
|
handleCloseRoute,
|
|
49
54
|
scenes,
|
|
50
55
|
shouldShowFloatOverlay,
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
scenes,
|
|
55
|
-
activeScreensLimit,
|
|
56
|
-
closingRouteKeys,
|
|
57
|
-
handleCloseRoute,
|
|
58
|
-
props.state.index,
|
|
59
|
-
shouldShowFloatOverlay,
|
|
60
|
-
]);
|
|
61
|
-
|
|
62
|
-
return (
|
|
63
|
-
<StackNavigationContext.Provider value={contextValue}>
|
|
64
|
-
<Component {...contextValue} />
|
|
65
|
-
</StackNavigationContext.Provider>
|
|
66
|
-
);
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
export const useStackNavigationContext = () => {
|
|
71
|
-
const context = useContext(StackNavigationContext);
|
|
72
|
-
|
|
73
|
-
if (!context) {
|
|
74
|
-
throw new Error(
|
|
75
|
-
"StackNavigationContext.Provider is missing in the component tree.",
|
|
76
|
-
);
|
|
77
|
-
}
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
});
|
|
78
59
|
|
|
79
|
-
|
|
80
|
-
};
|
|
60
|
+
export { useStackNavigationContext, withStackNavigationProvider };
|
|
@@ -143,7 +143,14 @@ export type NativeStackHeaderLeftProps = NativeStackHeaderRightProps & {
|
|
|
143
143
|
href?: string;
|
|
144
144
|
};
|
|
145
145
|
|
|
146
|
-
export type
|
|
146
|
+
export type NativeStackScreenTransitionConfig = ScreenTransitionConfig & {
|
|
147
|
+
/**
|
|
148
|
+
* Whether to enable transitions. It sets the presentation to containedTransparentModal, animation none, and headerShown to false.
|
|
149
|
+
*/
|
|
150
|
+
enableTransitions?: boolean;
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
export type NativeStackNavigationOptions = NativeStackScreenTransitionConfig & {
|
|
147
154
|
/**
|
|
148
155
|
* String that can be displayed in the header as a fallback for `headerTitle`.
|
|
149
156
|
*/
|