react-native-screen-transitions 2.4.1 → 2.4.2-beta.1
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/__configs__/presets.js.map +1 -1
- package/lib/commonjs/components/controllers/screen-lifecycle.blank.js +59 -0
- package/lib/commonjs/components/controllers/screen-lifecycle.blank.js.map +1 -0
- package/lib/commonjs/components/root-transition-aware.js.map +1 -1
- package/lib/commonjs/constants.js.map +1 -1
- package/lib/commonjs/hooks/animation/use-screen-animation.js +9 -5
- package/lib/commonjs/hooks/animation/use-screen-animation.js.map +1 -1
- package/lib/commonjs/index.js +7 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/integrations/blank-stack/components/Header.js +135 -0
- package/lib/commonjs/integrations/blank-stack/components/Header.js.map +1 -0
- package/lib/commonjs/integrations/blank-stack/components/Screens.js +64 -0
- package/lib/commonjs/integrations/blank-stack/components/Screens.js.map +1 -0
- package/lib/commonjs/integrations/blank-stack/components/StackView.js +85 -0
- package/lib/commonjs/integrations/blank-stack/components/StackView.js.map +1 -0
- package/lib/commonjs/integrations/blank-stack/navigators/createBlankStackNavigator.js +68 -0
- package/lib/commonjs/integrations/blank-stack/navigators/createBlankStackNavigator.js.map +1 -0
- package/lib/commonjs/integrations/blank-stack/providers/screen-transition-provider.js +10 -0
- package/lib/commonjs/integrations/blank-stack/providers/screen-transition-provider.js.map +1 -0
- package/lib/commonjs/integrations/blank-stack/utils/with-stack-navigation/_hooks/use-closing-route-keys.js +66 -0
- package/lib/commonjs/integrations/blank-stack/utils/with-stack-navigation/_hooks/use-closing-route-keys.js.map +1 -0
- package/lib/commonjs/integrations/blank-stack/utils/with-stack-navigation/_hooks/use-previous.js +16 -0
- package/lib/commonjs/integrations/blank-stack/utils/with-stack-navigation/_hooks/use-previous.js.map +1 -0
- package/lib/commonjs/integrations/blank-stack/utils/with-stack-navigation/_hooks/use-stack-navigation-state.js +208 -0
- package/lib/commonjs/integrations/blank-stack/utils/with-stack-navigation/_hooks/use-stack-navigation-state.js.map +1 -0
- package/lib/commonjs/{types/navigator.js → integrations/blank-stack/utils/with-stack-navigation/_types.js} +1 -1
- package/lib/commonjs/integrations/blank-stack/utils/with-stack-navigation/_types.js.map +1 -0
- package/lib/commonjs/integrations/blank-stack/utils/with-stack-navigation/_utils/are-descriptors-equal.js +15 -0
- package/lib/commonjs/integrations/blank-stack/utils/with-stack-navigation/_utils/are-descriptors-equal.js.map +1 -0
- package/lib/commonjs/integrations/blank-stack/utils/with-stack-navigation/_utils/calculate-active-screens-limit.js +23 -0
- package/lib/commonjs/integrations/blank-stack/utils/with-stack-navigation/_utils/calculate-active-screens-limit.js.map +1 -0
- package/lib/commonjs/integrations/blank-stack/utils/with-stack-navigation/_utils/compose-descriptors.js +15 -0
- package/lib/commonjs/integrations/blank-stack/utils/with-stack-navigation/_utils/compose-descriptors.js.map +1 -0
- package/lib/commonjs/integrations/blank-stack/utils/with-stack-navigation/_utils/have-same-route-keys.js +14 -0
- package/lib/commonjs/integrations/blank-stack/utils/with-stack-navigation/_utils/have-same-route-keys.js.map +1 -0
- package/lib/commonjs/integrations/blank-stack/utils/with-stack-navigation/_utils/routes-are-identical.js +13 -0
- package/lib/commonjs/integrations/blank-stack/utils/with-stack-navigation/_utils/routes-are-identical.js.map +1 -0
- package/lib/commonjs/integrations/blank-stack/utils/with-stack-navigation/index.js +71 -0
- package/lib/commonjs/integrations/blank-stack/utils/with-stack-navigation/index.js.map +1 -0
- package/lib/commonjs/integrations/native-stack/navigators/createNativeStackNavigator.js.map +1 -1
- package/lib/commonjs/integrations/native-stack/providers/screen-transition-provider.js +10 -0
- package/lib/commonjs/integrations/native-stack/providers/screen-transition-provider.js.map +1 -0
- package/lib/commonjs/integrations/native-stack/utils/getModalRoutesKeys.js.map +1 -1
- package/lib/commonjs/integrations/native-stack/utils/useInvalidPreventRemoveError.js.map +1 -1
- package/lib/commonjs/integrations/native-stack/views/NativeStackView.js.map +1 -1
- package/lib/commonjs/integrations/native-stack/views/NativeStackView.native.js +1 -1
- package/lib/commonjs/integrations/native-stack/views/NativeStackView.native.js.map +1 -1
- package/lib/commonjs/integrations/native-stack/views/useHeaderConfigProps.js.map +1 -1
- package/lib/commonjs/providers/create-screen-transition-provider.js +35 -0
- package/lib/commonjs/providers/create-screen-transition-provider.js.map +1 -0
- package/lib/commonjs/providers/keys.js.map +1 -1
- package/lib/commonjs/providers/transition-styles.js +18 -4
- package/lib/commonjs/providers/transition-styles.js.map +1 -1
- package/lib/commonjs/stores/animations.js.map +1 -1
- package/lib/commonjs/stores/bounds/index.js.map +1 -1
- package/lib/commonjs/stores/gestures.js.map +1 -1
- package/lib/commonjs/stores/utils/reset-stores-for-screen.js.map +1 -1
- package/lib/commonjs/types/blank-stack.navigator.js +6 -0
- package/lib/{module/types/navigator.js.map → commonjs/types/blank-stack.navigator.js.map} +1 -1
- package/lib/commonjs/types/native-stack.navigator.js +6 -0
- package/lib/commonjs/types/native-stack.navigator.js.map +1 -0
- package/lib/commonjs/utils/animation/derivations.js +1 -14
- package/lib/commonjs/utils/animation/derivations.js.map +1 -1
- package/lib/commonjs/utils/bounds/constants.js.map +1 -1
- package/lib/commonjs/utils/bounds/index.js +23 -90
- package/lib/commonjs/utils/bounds/index.js.map +1 -1
- package/lib/commonjs/utils/gesture/apply-offset-rules.js.map +1 -1
- package/lib/commonjs/utils/gesture/check-gesture-activation.js.map +1 -1
- package/lib/module/__configs__/presets.js.map +1 -1
- package/lib/module/components/controllers/screen-lifecycle.blank.js +53 -0
- package/lib/module/components/controllers/screen-lifecycle.blank.js.map +1 -0
- package/lib/module/components/root-transition-aware.js.map +1 -1
- package/lib/module/constants.js.map +1 -1
- package/lib/module/hooks/animation/use-screen-animation.js +9 -5
- package/lib/module/hooks/animation/use-screen-animation.js.map +1 -1
- package/lib/module/index.js +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/integrations/blank-stack/components/Header.js +131 -0
- package/lib/module/integrations/blank-stack/components/Header.js.map +1 -0
- package/lib/module/integrations/blank-stack/components/Screens.js +58 -0
- package/lib/module/integrations/blank-stack/components/Screens.js.map +1 -0
- package/lib/module/integrations/blank-stack/components/StackView.js +81 -0
- package/lib/module/integrations/blank-stack/components/StackView.js.map +1 -0
- package/lib/module/integrations/blank-stack/navigators/createBlankStackNavigator.js +63 -0
- package/lib/module/integrations/blank-stack/navigators/createBlankStackNavigator.js.map +1 -0
- package/lib/module/integrations/blank-stack/providers/screen-transition-provider.js +6 -0
- package/lib/module/integrations/blank-stack/providers/screen-transition-provider.js.map +1 -0
- package/lib/module/integrations/blank-stack/utils/with-stack-navigation/_hooks/use-closing-route-keys.js +60 -0
- package/lib/module/integrations/blank-stack/utils/with-stack-navigation/_hooks/use-closing-route-keys.js.map +1 -0
- package/lib/module/integrations/blank-stack/utils/with-stack-navigation/_hooks/use-previous.js +11 -0
- package/lib/module/integrations/blank-stack/utils/with-stack-navigation/_hooks/use-previous.js.map +1 -0
- package/lib/module/integrations/blank-stack/utils/with-stack-navigation/_hooks/use-stack-navigation-state.js +202 -0
- package/lib/module/integrations/blank-stack/utils/with-stack-navigation/_hooks/use-stack-navigation-state.js.map +1 -0
- package/lib/module/integrations/blank-stack/utils/with-stack-navigation/_types.js +4 -0
- package/lib/module/integrations/blank-stack/utils/with-stack-navigation/_types.js.map +1 -0
- package/lib/module/integrations/blank-stack/utils/with-stack-navigation/_utils/are-descriptors-equal.js +10 -0
- package/lib/module/integrations/blank-stack/utils/with-stack-navigation/_utils/are-descriptors-equal.js.map +1 -0
- package/lib/module/integrations/blank-stack/utils/with-stack-navigation/_utils/calculate-active-screens-limit.js +19 -0
- package/lib/module/integrations/blank-stack/utils/with-stack-navigation/_utils/calculate-active-screens-limit.js.map +1 -0
- package/lib/module/integrations/blank-stack/utils/with-stack-navigation/_utils/compose-descriptors.js +10 -0
- package/lib/module/integrations/blank-stack/utils/with-stack-navigation/_utils/compose-descriptors.js.map +1 -0
- package/lib/module/integrations/blank-stack/utils/with-stack-navigation/_utils/have-same-route-keys.js +9 -0
- package/lib/module/integrations/blank-stack/utils/with-stack-navigation/_utils/have-same-route-keys.js.map +1 -0
- package/lib/module/integrations/blank-stack/utils/with-stack-navigation/_utils/routes-are-identical.js +8 -0
- package/lib/module/integrations/blank-stack/utils/with-stack-navigation/_utils/routes-are-identical.js.map +1 -0
- package/lib/module/integrations/blank-stack/utils/with-stack-navigation/index.js +65 -0
- package/lib/module/integrations/blank-stack/utils/with-stack-navigation/index.js.map +1 -0
- package/lib/module/integrations/native-stack/navigators/createNativeStackNavigator.js.map +1 -1
- package/lib/module/integrations/native-stack/providers/screen-transition-provider.js +6 -0
- package/lib/module/integrations/native-stack/providers/screen-transition-provider.js.map +1 -0
- package/lib/module/integrations/native-stack/utils/getModalRoutesKeys.js.map +1 -1
- package/lib/module/integrations/native-stack/utils/useInvalidPreventRemoveError.js.map +1 -1
- package/lib/module/integrations/native-stack/views/NativeStackView.js.map +1 -1
- package/lib/module/integrations/native-stack/views/NativeStackView.native.js +1 -1
- package/lib/module/integrations/native-stack/views/NativeStackView.native.js.map +1 -1
- package/lib/module/integrations/native-stack/views/useHeaderConfigProps.js.map +1 -1
- package/lib/module/providers/create-screen-transition-provider.js +31 -0
- package/lib/module/providers/create-screen-transition-provider.js.map +1 -0
- package/lib/module/providers/keys.js.map +1 -1
- package/lib/module/providers/transition-styles.js +19 -5
- package/lib/module/providers/transition-styles.js.map +1 -1
- package/lib/module/stores/animations.js.map +1 -1
- package/lib/module/stores/bounds/index.js.map +1 -1
- package/lib/module/stores/gestures.js.map +1 -1
- package/lib/module/stores/utils/reset-stores-for-screen.js.map +1 -1
- package/lib/module/types/blank-stack.navigator.js +4 -0
- package/lib/{commonjs/types/navigator.js.map → module/types/blank-stack.navigator.js.map} +1 -1
- package/lib/module/types/native-stack.navigator.js +4 -0
- package/lib/module/types/native-stack.navigator.js.map +1 -0
- package/lib/module/utils/animation/derivations.js +1 -14
- package/lib/module/utils/animation/derivations.js.map +1 -1
- package/lib/module/utils/bounds/constants.js.map +1 -1
- package/lib/module/utils/bounds/index.js +24 -91
- package/lib/module/utils/bounds/index.js.map +1 -1
- package/lib/module/utils/gesture/apply-offset-rules.js.map +1 -1
- package/lib/module/utils/gesture/check-gesture-activation.js.map +1 -1
- package/lib/typescript/__configs__/index.d.ts +9 -9
- package/lib/typescript/__configs__/index.d.ts.map +1 -1
- package/lib/typescript/__configs__/presets.d.ts +1 -1
- package/lib/typescript/__configs__/presets.d.ts.map +1 -1
- package/lib/typescript/components/controllers/screen-lifecycle.blank.d.ts +7 -0
- package/lib/typescript/components/controllers/screen-lifecycle.blank.d.ts.map +1 -0
- package/lib/typescript/components/root-transition-aware.d.ts.map +1 -1
- package/lib/typescript/constants.d.ts +2 -2
- package/lib/typescript/constants.d.ts.map +1 -1
- package/lib/typescript/hooks/animation/use-screen-animation.d.ts +1 -1
- package/lib/typescript/hooks/animation/use-screen-animation.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +20 -18
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/integrations/blank-stack/components/Header.d.ts +5 -0
- package/lib/typescript/integrations/blank-stack/components/Header.d.ts.map +1 -0
- package/lib/typescript/integrations/blank-stack/components/Screens.d.ts +15 -0
- package/lib/typescript/integrations/blank-stack/components/Screens.d.ts.map +1 -0
- package/lib/typescript/integrations/blank-stack/components/StackView.d.ts +2 -0
- package/lib/typescript/integrations/blank-stack/components/StackView.d.ts.map +1 -0
- package/lib/typescript/integrations/blank-stack/navigators/createBlankStackNavigator.d.ts +16 -0
- package/lib/typescript/integrations/blank-stack/navigators/createBlankStackNavigator.d.ts.map +1 -0
- package/lib/typescript/integrations/blank-stack/providers/screen-transition-provider.d.ts +8 -0
- package/lib/typescript/integrations/blank-stack/providers/screen-transition-provider.d.ts.map +1 -0
- package/lib/typescript/integrations/blank-stack/utils/with-stack-navigation/_hooks/use-closing-route-keys.d.ts +8 -0
- package/lib/typescript/integrations/blank-stack/utils/with-stack-navigation/_hooks/use-closing-route-keys.d.ts.map +1 -0
- package/lib/typescript/integrations/blank-stack/utils/with-stack-navigation/_hooks/use-previous.d.ts +2 -0
- package/lib/typescript/integrations/blank-stack/utils/with-stack-navigation/_hooks/use-previous.d.ts.map +1 -0
- package/lib/typescript/integrations/blank-stack/utils/with-stack-navigation/_hooks/use-stack-navigation-state.d.ts +20 -0
- package/lib/typescript/integrations/blank-stack/utils/with-stack-navigation/_hooks/use-stack-navigation-state.d.ts.map +1 -0
- package/lib/typescript/integrations/blank-stack/utils/with-stack-navigation/_types.d.ts +23 -0
- package/lib/typescript/integrations/blank-stack/utils/with-stack-navigation/_types.d.ts.map +1 -0
- package/lib/typescript/integrations/blank-stack/utils/with-stack-navigation/_utils/are-descriptors-equal.d.ts +3 -0
- package/lib/typescript/integrations/blank-stack/utils/with-stack-navigation/_utils/are-descriptors-equal.d.ts.map +1 -0
- package/lib/typescript/integrations/blank-stack/utils/with-stack-navigation/_utils/calculate-active-screens-limit.d.ts +4 -0
- package/lib/typescript/integrations/blank-stack/utils/with-stack-navigation/_utils/calculate-active-screens-limit.d.ts.map +1 -0
- package/lib/typescript/integrations/blank-stack/utils/with-stack-navigation/_utils/compose-descriptors.d.ts +4 -0
- package/lib/typescript/integrations/blank-stack/utils/with-stack-navigation/_utils/compose-descriptors.d.ts.map +1 -0
- package/lib/typescript/integrations/blank-stack/utils/with-stack-navigation/_utils/have-same-route-keys.d.ts +3 -0
- package/lib/typescript/integrations/blank-stack/utils/with-stack-navigation/_utils/have-same-route-keys.d.ts.map +1 -0
- package/lib/typescript/integrations/blank-stack/utils/with-stack-navigation/_utils/routes-are-identical.d.ts +3 -0
- package/lib/typescript/integrations/blank-stack/utils/with-stack-navigation/_utils/routes-are-identical.d.ts.map +1 -0
- package/lib/typescript/integrations/blank-stack/utils/with-stack-navigation/index.d.ts +6 -0
- package/lib/typescript/integrations/blank-stack/utils/with-stack-navigation/index.d.ts.map +1 -0
- package/lib/typescript/integrations/native-stack/navigators/createNativeStackNavigator.d.ts +1 -1
- package/lib/typescript/integrations/native-stack/navigators/createNativeStackNavigator.d.ts.map +1 -1
- package/lib/typescript/integrations/native-stack/providers/screen-transition-provider.d.ts +8 -0
- package/lib/typescript/integrations/native-stack/providers/screen-transition-provider.d.ts.map +1 -0
- package/lib/typescript/integrations/native-stack/utils/getModalRoutesKeys.d.ts +1 -1
- package/lib/typescript/integrations/native-stack/utils/getModalRoutesKeys.d.ts.map +1 -1
- package/lib/typescript/integrations/native-stack/utils/useInvalidPreventRemoveError.d.ts +1 -1
- package/lib/typescript/integrations/native-stack/utils/useInvalidPreventRemoveError.d.ts.map +1 -1
- package/lib/typescript/integrations/native-stack/views/NativeStackView.d.ts +1 -1
- package/lib/typescript/integrations/native-stack/views/NativeStackView.d.ts.map +1 -1
- package/lib/typescript/integrations/native-stack/views/NativeStackView.native.d.ts +1 -1
- package/lib/typescript/integrations/native-stack/views/NativeStackView.native.d.ts.map +1 -1
- package/lib/typescript/integrations/native-stack/views/useHeaderConfigProps.d.ts +1 -1
- package/lib/typescript/integrations/native-stack/views/useHeaderConfigProps.d.ts.map +1 -1
- package/lib/typescript/providers/create-screen-transition-provider.d.ts +15 -0
- package/lib/typescript/providers/create-screen-transition-provider.d.ts.map +1 -0
- package/lib/typescript/providers/keys.d.ts +15 -13
- package/lib/typescript/providers/keys.d.ts.map +1 -1
- package/lib/typescript/providers/transition-styles.d.ts.map +1 -1
- package/lib/typescript/stores/animations.d.ts +1 -1
- package/lib/typescript/stores/animations.d.ts.map +1 -1
- package/lib/typescript/stores/bounds/index.d.ts +1 -1
- package/lib/typescript/stores/bounds/index.d.ts.map +1 -1
- package/lib/typescript/stores/gestures.d.ts +1 -1
- package/lib/typescript/stores/gestures.d.ts.map +1 -1
- package/lib/typescript/stores/utils/reset-stores-for-screen.d.ts +1 -1
- package/lib/typescript/stores/utils/reset-stores-for-screen.d.ts.map +1 -1
- package/lib/typescript/types/animation.d.ts +2 -4
- package/lib/typescript/types/animation.d.ts.map +1 -1
- package/lib/typescript/types/blank-stack.navigator.d.ts +214 -0
- package/lib/typescript/types/blank-stack.navigator.d.ts.map +1 -0
- package/lib/typescript/types/bounds.d.ts +0 -57
- package/lib/typescript/types/bounds.d.ts.map +1 -1
- package/lib/typescript/types/{navigator.d.ts → native-stack.navigator.d.ts} +5 -1
- package/lib/typescript/types/native-stack.navigator.d.ts.map +1 -0
- package/lib/typescript/utils/animation/derivations.d.ts +1 -4
- package/lib/typescript/utils/animation/derivations.d.ts.map +1 -1
- package/lib/typescript/utils/bounds/_types/builder.d.ts +2 -2
- package/lib/typescript/utils/bounds/_types/builder.d.ts.map +1 -1
- package/lib/typescript/utils/bounds/_utils/geometry.d.ts +2 -2
- package/lib/typescript/utils/bounds/_utils/geometry.d.ts.map +1 -1
- package/lib/typescript/utils/bounds/constants.d.ts +2 -2
- package/lib/typescript/utils/bounds/constants.d.ts.map +1 -1
- package/lib/typescript/utils/bounds/index.d.ts +4 -4
- package/lib/typescript/utils/bounds/index.d.ts.map +1 -1
- package/lib/typescript/utils/gesture/apply-offset-rules.d.ts +2 -2
- package/lib/typescript/utils/gesture/apply-offset-rules.d.ts.map +1 -1
- package/lib/typescript/utils/gesture/check-gesture-activation.d.ts +2 -2
- package/lib/typescript/utils/gesture/check-gesture-activation.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/__configs__/presets.ts +590 -590
- package/src/components/controllers/screen-lifecycle.blank.ts +62 -0
- package/src/components/root-transition-aware.tsx +27 -27
- package/src/constants.ts +47 -47
- package/src/hooks/animation/use-screen-animation.tsx +52 -47
- package/src/index.ts +33 -22
- package/src/integrations/blank-stack/components/Header.tsx +141 -0
- package/src/integrations/blank-stack/components/Screens.tsx +96 -0
- package/src/integrations/blank-stack/components/StackView.tsx +100 -0
- package/src/integrations/blank-stack/navigators/createBlankStackNavigator.tsx +111 -0
- package/src/integrations/blank-stack/providers/screen-transition-provider.tsx +8 -0
- package/src/integrations/blank-stack/utils/with-stack-navigation/_hooks/use-closing-route-keys.tsx +62 -0
- package/src/integrations/blank-stack/utils/with-stack-navigation/_hooks/use-previous.tsx +11 -0
- package/src/integrations/blank-stack/utils/with-stack-navigation/_hooks/use-stack-navigation-state.tsx +280 -0
- package/src/integrations/blank-stack/utils/with-stack-navigation/_types.ts +36 -0
- package/src/integrations/blank-stack/utils/with-stack-navigation/_utils/are-descriptors-equal.ts +15 -0
- package/src/integrations/blank-stack/utils/with-stack-navigation/_utils/calculate-active-screens-limit.ts +29 -0
- package/src/integrations/blank-stack/utils/with-stack-navigation/_utils/compose-descriptors.ts +17 -0
- package/src/integrations/blank-stack/utils/with-stack-navigation/_utils/have-same-route-keys.ts +12 -0
- package/src/integrations/blank-stack/utils/with-stack-navigation/_utils/routes-are-identical.ts +11 -0
- package/src/integrations/blank-stack/utils/with-stack-navigation/index.tsx +93 -0
- package/src/integrations/native-stack/navigators/createNativeStackNavigator.tsx +95 -95
- package/src/integrations/native-stack/providers/screen-transition-provider.tsx +8 -0
- package/src/integrations/native-stack/utils/getModalRoutesKeys.ts +14 -14
- package/src/integrations/native-stack/utils/useInvalidPreventRemoveError.tsx +23 -23
- package/src/integrations/native-stack/views/NativeStackView.native.tsx +609 -609
- package/src/integrations/native-stack/views/NativeStackView.tsx +188 -188
- package/src/integrations/native-stack/views/useHeaderConfigProps.tsx +260 -260
- package/src/providers/create-screen-transition-provider.tsx +46 -0
- package/src/providers/keys.tsx +46 -34
- package/src/providers/transition-styles.tsx +24 -11
- package/src/stores/animations.ts +23 -23
- package/src/stores/bounds/index.ts +82 -82
- package/src/stores/gestures.ts +36 -36
- package/src/stores/utils/reset-stores-for-screen.ts +4 -4
- package/src/types/animation.ts +2 -4
- package/src/types/blank-stack.navigator.ts +266 -0
- package/src/types/bounds.ts +0 -64
- package/src/types/{navigator.ts → native-stack.navigator.ts} +5 -0
- package/src/utils/animation/derivations.ts +3 -20
- package/src/utils/bounds/_types/builder.ts +111 -111
- package/src/utils/bounds/_utils/geometry.ts +2 -2
- package/src/utils/bounds/constants.ts +29 -29
- package/src/utils/bounds/index.ts +35 -105
- package/src/utils/gesture/apply-offset-rules.ts +271 -271
- package/src/utils/gesture/check-gesture-activation.ts +260 -260
- package/lib/commonjs/providers/screen-transition-provider.js +0 -34
- package/lib/commonjs/providers/screen-transition-provider.js.map +0 -1
- package/lib/module/providers/screen-transition-provider.js +0 -30
- package/lib/module/providers/screen-transition-provider.js.map +0 -1
- package/lib/module/types/navigator.js +0 -4
- package/lib/typescript/providers/screen-transition-provider.d.ts +0 -11
- package/lib/typescript/providers/screen-transition-provider.d.ts.map +0 -1
- package/lib/typescript/types/navigator.d.ts.map +0 -1
- package/src/providers/screen-transition-provider.tsx +0 -33
|
@@ -1,214 +1,214 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
getHeaderTitle,
|
|
3
|
+
Header,
|
|
4
|
+
HeaderBackButton,
|
|
5
|
+
HeaderBackContext,
|
|
6
|
+
SafeAreaProviderCompat,
|
|
7
|
+
Screen,
|
|
8
|
+
useHeaderHeight,
|
|
9
9
|
} from "@react-navigation/elements";
|
|
10
10
|
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
type ParamListBase,
|
|
12
|
+
type RouteProp,
|
|
13
|
+
type StackNavigationState,
|
|
14
|
+
useLinkBuilder,
|
|
15
15
|
} from "@react-navigation/native";
|
|
16
16
|
import * as React from "react";
|
|
17
17
|
import { Animated, Image, StyleSheet, View } from "react-native";
|
|
18
18
|
|
|
19
19
|
import type {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
} from "../../../types/navigator";
|
|
20
|
+
NativeStackDescriptor,
|
|
21
|
+
NativeStackDescriptorMap,
|
|
22
|
+
NativeStackNavigationHelpers,
|
|
23
|
+
} from "../../../types/native-stack.navigator";
|
|
24
24
|
import { AnimatedHeaderHeightContext } from "../utils/useAnimatedHeaderHeight";
|
|
25
25
|
|
|
26
26
|
type Props = {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
27
|
+
state: StackNavigationState<ParamListBase>;
|
|
28
|
+
// This is used for the native implementation of the stack.
|
|
29
|
+
navigation: NativeStackNavigationHelpers;
|
|
30
|
+
descriptors: NativeStackDescriptorMap;
|
|
31
|
+
describe: (
|
|
32
|
+
route: RouteProp<ParamListBase>,
|
|
33
|
+
placeholder: boolean
|
|
34
|
+
) => NativeStackDescriptor;
|
|
35
35
|
};
|
|
36
36
|
|
|
37
37
|
const TRANSPARENT_PRESENTATIONS = [
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
"transparentModal",
|
|
39
|
+
"containedTransparentModal",
|
|
40
40
|
];
|
|
41
41
|
|
|
42
42
|
export function NativeStackView({ state, descriptors, describe }: Props) {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
43
|
+
const parentHeaderBack = React.useContext(HeaderBackContext);
|
|
44
|
+
const { buildHref } = useLinkBuilder();
|
|
45
|
+
|
|
46
|
+
const preloadedDescriptors =
|
|
47
|
+
state.preloadedRoutes.reduce<NativeStackDescriptorMap>((acc, route) => {
|
|
48
|
+
acc[route.key] = acc[route.key] || describe(route, true);
|
|
49
|
+
return acc;
|
|
50
|
+
}, {});
|
|
51
|
+
|
|
52
|
+
return (
|
|
53
|
+
<SafeAreaProviderCompat>
|
|
54
|
+
{state.routes.concat(state.preloadedRoutes).map((route, i) => {
|
|
55
|
+
const isFocused = state.index === i;
|
|
56
|
+
const previousKey = state.routes[i - 1]?.key;
|
|
57
|
+
const nextKey = state.routes[i + 1]?.key;
|
|
58
|
+
const previousDescriptor = previousKey
|
|
59
|
+
? descriptors[previousKey]
|
|
60
|
+
: undefined;
|
|
61
|
+
const nextDescriptor = nextKey ? descriptors[nextKey] : undefined;
|
|
62
|
+
const { options, navigation, render } =
|
|
63
|
+
descriptors[route.key] ?? preloadedDescriptors[route.key];
|
|
64
|
+
|
|
65
|
+
const headerBack = previousDescriptor
|
|
66
|
+
? {
|
|
67
|
+
title: getHeaderTitle(
|
|
68
|
+
previousDescriptor.options,
|
|
69
|
+
previousDescriptor.route.name
|
|
70
|
+
),
|
|
71
|
+
href: buildHref(
|
|
72
|
+
previousDescriptor.route.name,
|
|
73
|
+
previousDescriptor.route.params
|
|
74
|
+
),
|
|
75
|
+
}
|
|
76
|
+
: parentHeaderBack;
|
|
77
|
+
|
|
78
|
+
const canGoBack = headerBack != null;
|
|
79
|
+
|
|
80
|
+
const {
|
|
81
|
+
header,
|
|
82
|
+
headerShown,
|
|
83
|
+
headerBackImageSource,
|
|
84
|
+
headerLeft,
|
|
85
|
+
headerTransparent,
|
|
86
|
+
headerBackTitle,
|
|
87
|
+
presentation,
|
|
88
|
+
contentStyle,
|
|
89
|
+
...rest
|
|
90
|
+
} = options;
|
|
91
|
+
|
|
92
|
+
const nextPresentation = nextDescriptor?.options.presentation;
|
|
93
|
+
|
|
94
|
+
const isPreloaded =
|
|
95
|
+
preloadedDescriptors[route.key] !== undefined &&
|
|
96
|
+
descriptors[route.key] === undefined;
|
|
97
|
+
|
|
98
|
+
return (
|
|
99
|
+
<Screen
|
|
100
|
+
key={route.key}
|
|
101
|
+
focused={isFocused}
|
|
102
|
+
route={route}
|
|
103
|
+
navigation={navigation}
|
|
104
|
+
headerShown={headerShown}
|
|
105
|
+
headerTransparent={headerTransparent}
|
|
106
|
+
header={
|
|
107
|
+
header !== undefined ? (
|
|
108
|
+
header({
|
|
109
|
+
back: headerBack,
|
|
110
|
+
options,
|
|
111
|
+
route,
|
|
112
|
+
navigation,
|
|
113
|
+
})
|
|
114
|
+
) : (
|
|
115
|
+
<Header
|
|
116
|
+
{...rest}
|
|
117
|
+
back={headerBack}
|
|
118
|
+
title={getHeaderTitle(options, route.name)}
|
|
119
|
+
headerLeft={
|
|
120
|
+
typeof headerLeft === "function"
|
|
121
|
+
? ({ label, ...rest }) =>
|
|
122
|
+
headerLeft({
|
|
123
|
+
...rest,
|
|
124
|
+
label: headerBackTitle ?? label,
|
|
125
|
+
})
|
|
126
|
+
: headerLeft === undefined && canGoBack
|
|
127
|
+
? ({ tintColor, label, ...rest }) => (
|
|
128
|
+
<HeaderBackButton
|
|
129
|
+
{...rest}
|
|
130
|
+
label={headerBackTitle ?? label}
|
|
131
|
+
tintColor={tintColor}
|
|
132
|
+
backImage={
|
|
133
|
+
headerBackImageSource !== undefined
|
|
134
|
+
? () => (
|
|
135
|
+
<Image
|
|
136
|
+
source={headerBackImageSource}
|
|
137
|
+
resizeMode="contain"
|
|
138
|
+
tintColor={tintColor}
|
|
139
|
+
style={styles.backImage}
|
|
140
|
+
/>
|
|
141
|
+
)
|
|
142
|
+
: undefined
|
|
143
|
+
}
|
|
144
|
+
onPress={navigation.goBack}
|
|
145
|
+
/>
|
|
146
|
+
)
|
|
147
|
+
: headerLeft
|
|
148
|
+
}
|
|
149
|
+
headerTransparent={headerTransparent}
|
|
150
|
+
/>
|
|
151
|
+
)
|
|
152
|
+
}
|
|
153
|
+
style={[
|
|
154
|
+
StyleSheet.absoluteFill,
|
|
155
|
+
{
|
|
156
|
+
display:
|
|
157
|
+
(isFocused ||
|
|
158
|
+
(nextPresentation != null &&
|
|
159
|
+
TRANSPARENT_PRESENTATIONS.includes(nextPresentation))) &&
|
|
160
|
+
!isPreloaded
|
|
161
|
+
? "flex"
|
|
162
|
+
: "none",
|
|
163
|
+
},
|
|
164
|
+
presentation != null &&
|
|
165
|
+
TRANSPARENT_PRESENTATIONS.includes(presentation)
|
|
166
|
+
? { backgroundColor: "transparent" }
|
|
167
|
+
: null,
|
|
168
|
+
]}
|
|
169
|
+
>
|
|
170
|
+
<HeaderBackContext.Provider value={headerBack}>
|
|
171
|
+
<AnimatedHeaderHeightProvider>
|
|
172
|
+
<View style={[styles.contentContainer, contentStyle]}>
|
|
173
|
+
{render()}
|
|
174
|
+
</View>
|
|
175
|
+
</AnimatedHeaderHeightProvider>
|
|
176
|
+
</HeaderBackContext.Provider>
|
|
177
|
+
</Screen>
|
|
178
|
+
);
|
|
179
|
+
})}
|
|
180
|
+
</SafeAreaProviderCompat>
|
|
181
|
+
);
|
|
182
182
|
}
|
|
183
183
|
|
|
184
184
|
const AnimatedHeaderHeightProvider = ({
|
|
185
|
-
|
|
185
|
+
children,
|
|
186
186
|
}: {
|
|
187
|
-
|
|
187
|
+
children: React.ReactNode;
|
|
188
188
|
}) => {
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
189
|
+
const headerHeight = useHeaderHeight();
|
|
190
|
+
const [animatedHeaderHeight] = React.useState(
|
|
191
|
+
() => new Animated.Value(headerHeight)
|
|
192
|
+
);
|
|
193
|
+
|
|
194
|
+
React.useEffect(() => {
|
|
195
|
+
animatedHeaderHeight.setValue(headerHeight);
|
|
196
|
+
}, [animatedHeaderHeight, headerHeight]);
|
|
197
|
+
|
|
198
|
+
return (
|
|
199
|
+
<AnimatedHeaderHeightContext.Provider value={animatedHeaderHeight}>
|
|
200
|
+
{children}
|
|
201
|
+
</AnimatedHeaderHeightContext.Provider>
|
|
202
|
+
);
|
|
203
203
|
};
|
|
204
204
|
|
|
205
205
|
const styles = StyleSheet.create({
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
206
|
+
contentContainer: {
|
|
207
|
+
flex: 1,
|
|
208
|
+
},
|
|
209
|
+
backImage: {
|
|
210
|
+
height: 24,
|
|
211
|
+
width: 24,
|
|
212
|
+
margin: 3,
|
|
213
|
+
},
|
|
214
214
|
});
|