react-native-screen-transitions 3.0.0-beta.9 → 3.0.0-rc.2
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 +60 -5
- package/lib/commonjs/blank-stack/components/Overlay.js +15 -15
- package/lib/commonjs/blank-stack/components/Overlay.js.map +1 -1
- package/lib/commonjs/blank-stack/components/Screens.js +2 -2
- package/lib/commonjs/blank-stack/components/Screens.js.map +1 -1
- package/lib/commonjs/blank-stack/components/StackView.js +9 -5
- package/lib/commonjs/blank-stack/components/StackView.js.map +1 -1
- package/lib/commonjs/blank-stack/hooks/use-overlay-animation.js +6 -7
- package/lib/commonjs/blank-stack/hooks/use-overlay-animation.js.map +1 -1
- package/lib/commonjs/blank-stack/index.js +1 -1
- package/lib/commonjs/blank-stack/index.js.map +1 -1
- 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.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/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 +2 -2
- package/lib/commonjs/blank-stack/utils/with-stack-navigation/index.js.map +1 -1
- package/lib/commonjs/native-stack/views/NativeStackView.native.js +4 -3
- package/lib/commonjs/native-stack/views/NativeStackView.native.js.map +1 -1
- package/lib/commonjs/shared/components/controllers/screen-lifecycle.js +9 -9
- package/lib/commonjs/shared/components/controllers/screen-lifecycle.js.map +1 -1
- package/lib/commonjs/shared/components/create-transition-aware-component.js +11 -14
- package/lib/commonjs/shared/components/create-transition-aware-component.js.map +1 -1
- package/lib/commonjs/shared/components/root-transition-aware.js +1 -1
- package/lib/commonjs/shared/components/root-transition-aware.js.map +1 -1
- package/lib/commonjs/shared/configs/presets.js +28 -11
- package/lib/commonjs/shared/configs/presets.js.map +1 -1
- package/lib/commonjs/shared/constants.js +0 -1
- package/lib/commonjs/shared/constants.js.map +1 -1
- package/lib/commonjs/shared/hooks/animation/use-associated-style.js +9 -10
- package/lib/commonjs/shared/hooks/animation/use-associated-style.js.map +1 -1
- package/lib/commonjs/shared/hooks/animation/use-screen-animation.js +16 -26
- package/lib/commonjs/shared/hooks/animation/use-screen-animation.js.map +1 -1
- package/lib/commonjs/shared/hooks/gestures/use-build-gestures.js +11 -11
- package/lib/commonjs/shared/hooks/gestures/use-build-gestures.js.map +1 -1
- package/lib/commonjs/shared/hooks/gestures/use-parent-gesture-registry.js +1 -1
- package/lib/commonjs/shared/hooks/gestures/use-scroll-registry.js +1 -1
- package/lib/commonjs/shared/hooks/reanimated/use-shared-value-state.js.map +1 -0
- package/lib/commonjs/shared/hooks/use-stable-callback-value.js.map +1 -1
- package/lib/commonjs/shared/hooks/use-stable-callback.js.map +1 -1
- package/lib/commonjs/shared/providers/{gestures.js → gestures.provider.js} +1 -1
- package/lib/commonjs/shared/providers/gestures.provider.js.map +1 -0
- package/lib/commonjs/shared/providers/{keys.js → keys.provider.js} +1 -1
- package/lib/commonjs/shared/providers/keys.provider.js.map +1 -0
- package/lib/commonjs/shared/providers/register-bounds.provider.js +211 -0
- package/lib/commonjs/shared/providers/register-bounds.provider.js.map +1 -0
- package/lib/commonjs/shared/providers/{screen-transition-provider.js → screen-transition.provider.js} +4 -4
- package/lib/commonjs/shared/providers/{screen-transition-provider.js.map → screen-transition.provider.js.map} +1 -1
- package/lib/commonjs/shared/providers/{transition-styles.js → transition-styles.provider.js} +9 -9
- package/lib/commonjs/shared/providers/transition-styles.provider.js.map +1 -0
- package/lib/commonjs/shared/stores/{animation-store.js → animation.store.js} +1 -1
- package/lib/commonjs/shared/stores/{animation-store.js.map → animation.store.js.map} +1 -1
- package/lib/commonjs/shared/stores/bounds.store.js +141 -0
- package/lib/commonjs/shared/stores/bounds.store.js.map +1 -0
- package/lib/commonjs/shared/stores/{gesture-store.js → gesture.store.js} +1 -1
- package/lib/commonjs/shared/stores/{gesture-store.js.map → gesture.store.js.map} +1 -1
- package/lib/commonjs/shared/types/{core.js → animation.types.js} +1 -1
- package/lib/commonjs/shared/types/animation.types.js.map +1 -0
- package/lib/commonjs/shared/types/{bounds.js → bounds.types.js} +1 -1
- package/lib/commonjs/shared/types/bounds.types.js.map +1 -0
- package/lib/commonjs/shared/types/{animation.js → core.types.js} +1 -1
- package/lib/commonjs/shared/types/{animation.js.map → core.types.js.map} +1 -1
- package/lib/commonjs/shared/types/{gesture.js → gesture.types.js} +1 -1
- package/lib/commonjs/shared/types/gesture.types.js.map +1 -0
- package/lib/commonjs/shared/types/utils.types.js +2 -0
- package/lib/commonjs/shared/types/{core.js.map → utils.types.js.map} +1 -1
- package/lib/commonjs/shared/utils/animation/derivations.js +1 -7
- package/lib/commonjs/shared/utils/animation/derivations.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/helpers/geometry.js.map +1 -0
- package/lib/commonjs/shared/utils/bounds/helpers/is-bounds-equal.js +19 -0
- package/lib/commonjs/shared/utils/bounds/helpers/is-bounds-equal.js.map +1 -0
- package/lib/commonjs/shared/utils/bounds/helpers/style-composers.js.map +1 -0
- package/lib/commonjs/shared/utils/bounds/helpers/styles.js.map +1 -0
- package/lib/commonjs/shared/utils/bounds/index.js +45 -35
- package/lib/commonjs/shared/utils/bounds/index.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/types/builder.js.map +1 -0
- package/lib/commonjs/shared/utils/bounds/{_types/builder.js.map → types/geometry.js.map} +1 -1
- package/lib/commonjs/shared/utils/create-provider.js.map +1 -0
- package/lib/commonjs/shared/utils/gesture/apply-offset-rules.js +1 -1
- package/lib/commonjs/shared/utils/gesture/check-gesture-activation.js +1 -1
- package/lib/commonjs/shared/utils/reset-stores-for-screen.js +17 -0
- package/lib/commonjs/shared/utils/reset-stores-for-screen.js.map +1 -0
- package/lib/module/blank-stack/components/Overlay.js +15 -15
- package/lib/module/blank-stack/components/Overlay.js.map +1 -1
- package/lib/module/blank-stack/components/Screens.js +1 -1
- package/lib/module/blank-stack/components/StackView.js +8 -4
- package/lib/module/blank-stack/components/StackView.js.map +1 -1
- package/lib/module/blank-stack/hooks/use-overlay-animation.js +5 -6
- package/lib/module/blank-stack/hooks/use-overlay-animation.js.map +1 -1
- package/lib/module/blank-stack/index.js +1 -1
- package/lib/module/blank-stack/index.js.map +1 -1
- 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.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/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 +2 -2
- package/lib/module/blank-stack/utils/with-stack-navigation/index.js.map +1 -1
- package/lib/module/native-stack/views/NativeStackView.native.js +3 -2
- package/lib/module/native-stack/views/NativeStackView.native.js.map +1 -1
- package/lib/module/shared/components/controllers/screen-lifecycle.js +8 -8
- package/lib/module/shared/components/controllers/screen-lifecycle.js.map +1 -1
- package/lib/module/shared/components/create-transition-aware-component.js +11 -14
- package/lib/module/shared/components/create-transition-aware-component.js.map +1 -1
- package/lib/module/shared/components/root-transition-aware.js +1 -1
- package/lib/module/shared/components/root-transition-aware.js.map +1 -1
- package/lib/module/shared/configs/presets.js +28 -11
- package/lib/module/shared/configs/presets.js.map +1 -1
- package/lib/module/shared/constants.js +0 -1
- package/lib/module/shared/constants.js.map +1 -1
- package/lib/module/shared/hooks/animation/use-associated-style.js +9 -10
- package/lib/module/shared/hooks/animation/use-associated-style.js.map +1 -1
- package/lib/module/shared/hooks/animation/use-screen-animation.js +13 -23
- package/lib/module/shared/hooks/animation/use-screen-animation.js.map +1 -1
- package/lib/module/shared/hooks/gestures/use-build-gestures.js +4 -4
- package/lib/module/shared/hooks/gestures/use-build-gestures.js.map +1 -1
- package/lib/module/shared/hooks/gestures/use-parent-gesture-registry.js +1 -1
- package/lib/module/shared/hooks/gestures/use-parent-gesture-registry.js.map +1 -1
- package/lib/module/shared/hooks/gestures/use-scroll-registry.js +1 -1
- package/lib/module/shared/hooks/gestures/use-scroll-registry.js.map +1 -1
- package/lib/module/shared/hooks/reanimated/use-shared-value-state.js.map +1 -0
- package/lib/module/shared/hooks/use-stable-callback-value.js.map +1 -1
- package/lib/module/shared/hooks/use-stable-callback.js.map +1 -1
- package/lib/module/shared/providers/{gestures.js → gestures.provider.js} +1 -1
- package/lib/module/shared/providers/gestures.provider.js.map +1 -0
- package/lib/module/shared/providers/{keys.js → keys.provider.js} +1 -1
- package/lib/module/shared/providers/keys.provider.js.map +1 -0
- package/lib/module/shared/providers/register-bounds.provider.js +206 -0
- package/lib/module/shared/providers/register-bounds.provider.js.map +1 -0
- package/lib/module/shared/providers/{screen-transition-provider.js → screen-transition.provider.js} +4 -4
- package/lib/module/shared/providers/{screen-transition-provider.js.map → screen-transition.provider.js.map} +1 -1
- package/lib/module/shared/providers/{transition-styles.js → transition-styles.provider.js} +8 -9
- package/lib/module/shared/providers/transition-styles.provider.js.map +1 -0
- package/lib/module/shared/stores/{animation-store.js → animation.store.js} +1 -1
- package/lib/module/shared/stores/{animation-store.js.map → animation.store.js.map} +1 -1
- package/lib/module/shared/stores/bounds.store.js +137 -0
- package/lib/module/shared/stores/bounds.store.js.map +1 -0
- package/lib/module/shared/stores/{gesture-store.js → gesture.store.js} +1 -1
- package/lib/module/shared/stores/{gesture-store.js.map → gesture.store.js.map} +1 -1
- package/lib/module/shared/types/animation.types.js +4 -0
- package/lib/module/shared/types/animation.types.js.map +1 -0
- package/lib/module/shared/types/bounds.types.js +4 -0
- package/lib/module/shared/types/bounds.types.js.map +1 -0
- package/lib/module/shared/types/core.types.js +4 -0
- package/lib/{commonjs/shared/types/bounds.js.map → module/shared/types/core.types.js.map} +1 -1
- package/lib/module/shared/types/{gesture.js → gesture.types.js} +1 -1
- package/lib/module/shared/types/gesture.types.js.map +1 -0
- package/lib/module/shared/types/utils.types.js +2 -0
- package/lib/{commonjs/shared/types/utils.js.map → module/shared/types/utils.types.js.map} +1 -1
- package/lib/module/shared/utils/animation/derivations.js +1 -7
- package/lib/module/shared/utils/animation/derivations.js.map +1 -1
- package/lib/module/shared/utils/bounds/helpers/geometry.js.map +1 -0
- package/lib/module/shared/utils/bounds/helpers/is-bounds-equal.js +14 -0
- package/lib/module/shared/utils/bounds/helpers/is-bounds-equal.js.map +1 -0
- package/lib/module/shared/utils/bounds/helpers/style-composers.js.map +1 -0
- package/lib/module/shared/utils/bounds/helpers/styles.js.map +1 -0
- package/lib/module/shared/utils/bounds/index.js +45 -35
- package/lib/module/shared/utils/bounds/index.js.map +1 -1
- package/lib/module/shared/utils/bounds/types/builder.js.map +1 -0
- package/lib/module/shared/utils/bounds/{_types/builder.js.map → types/geometry.js.map} +1 -1
- package/lib/module/shared/utils/create-provider.js.map +1 -0
- package/lib/module/shared/utils/gesture/apply-offset-rules.js +1 -1
- package/lib/module/shared/utils/gesture/apply-offset-rules.js.map +1 -1
- package/lib/module/shared/utils/gesture/check-gesture-activation.js +1 -1
- package/lib/module/shared/utils/gesture/check-gesture-activation.js.map +1 -1
- package/lib/module/shared/utils/reset-stores-for-screen.js +13 -0
- package/lib/module/shared/utils/reset-stores-for-screen.js.map +1 -0
- package/lib/typescript/blank-stack/components/Overlay.d.ts.map +1 -1
- package/lib/typescript/blank-stack/components/StackView.d.ts.map +1 -1
- package/lib/typescript/blank-stack/hooks/use-overlay-animation.d.ts +1 -1
- package/lib/typescript/blank-stack/hooks/use-overlay-animation.d.ts.map +1 -1
- package/lib/typescript/blank-stack/index.d.ts +1 -1
- package/lib/typescript/blank-stack/index.d.ts.map +1 -1
- package/lib/typescript/blank-stack/types.d.ts +19 -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/use-stack-navigation-state.d.ts.map +1 -0
- package/lib/typescript/native-stack/types.d.ts +8 -2
- package/lib/typescript/native-stack/types.d.ts.map +1 -1
- package/lib/typescript/native-stack/views/NativeStackView.native.d.ts.map +1 -1
- package/lib/typescript/shared/components/controllers/screen-lifecycle.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-transition-aware-component.d.ts.map +1 -1
- package/lib/typescript/shared/configs/index.d.ts +9 -3
- package/lib/typescript/shared/configs/index.d.ts.map +1 -1
- package/lib/typescript/shared/configs/presets.d.ts +10 -4
- package/lib/typescript/shared/configs/presets.d.ts.map +1 -1
- package/lib/typescript/shared/constants.d.ts +6 -6
- package/lib/typescript/shared/constants.d.ts.map +1 -1
- package/lib/typescript/shared/hooks/animation/use-associated-style.d.ts.map +1 -1
- package/lib/typescript/shared/hooks/animation/use-screen-animation.d.ts +2 -2
- 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 +2 -2
- package/lib/typescript/shared/hooks/gestures/use-build-gestures.d.ts.map +1 -1
- package/lib/typescript/shared/hooks/reanimated/use-shared-value-state.d.ts.map +1 -0
- package/lib/typescript/shared/hooks/use-stable-callback-value.d.ts.map +1 -1
- package/lib/typescript/shared/hooks/use-stable-callback.d.ts.map +1 -1
- package/lib/typescript/shared/index.d.ts +37 -31
- package/lib/typescript/shared/index.d.ts.map +1 -1
- package/lib/typescript/shared/providers/{gestures.d.ts → gestures.provider.d.ts} +2 -2
- package/lib/typescript/shared/providers/gestures.provider.d.ts.map +1 -0
- package/lib/typescript/shared/providers/{keys.d.ts → keys.provider.d.ts} +2 -2
- package/lib/typescript/shared/providers/keys.provider.d.ts.map +1 -0
- package/lib/typescript/shared/providers/register-bounds.provider.d.ts +17 -0
- package/lib/typescript/shared/providers/register-bounds.provider.d.ts.map +1 -0
- package/lib/typescript/shared/providers/{screen-transition-provider.d.ts → screen-transition.provider.d.ts} +2 -2
- package/lib/typescript/shared/providers/{screen-transition-provider.d.ts.map → screen-transition.provider.d.ts.map} +1 -1
- package/lib/typescript/shared/providers/transition-styles.provider.d.ts +14 -0
- package/lib/typescript/shared/providers/transition-styles.provider.d.ts.map +1 -0
- package/lib/typescript/shared/stores/{animation-store.d.ts → animation.store.d.ts} +2 -2
- package/lib/typescript/shared/stores/animation.store.d.ts.map +1 -0
- package/lib/typescript/shared/stores/bounds.store.d.ts +29 -0
- package/lib/typescript/shared/stores/bounds.store.d.ts.map +1 -0
- package/lib/typescript/shared/stores/{gesture-store.d.ts → gesture.store.d.ts} +3 -3
- package/lib/typescript/shared/stores/gesture.store.d.ts.map +1 -0
- package/lib/typescript/shared/types/{animation.d.ts → animation.types.d.ts} +48 -20
- package/lib/typescript/shared/types/animation.types.d.ts.map +1 -0
- package/lib/typescript/shared/types/{bounds.d.ts → bounds.types.d.ts} +4 -4
- package/lib/typescript/shared/types/bounds.types.d.ts.map +1 -0
- package/lib/typescript/shared/types/{core.d.ts → core.types.d.ts} +3 -7
- package/lib/typescript/shared/types/core.types.d.ts.map +1 -0
- package/lib/typescript/shared/types/{gesture.d.ts → gesture.types.d.ts} +1 -1
- package/lib/typescript/shared/types/gesture.types.d.ts.map +1 -0
- package/lib/typescript/shared/types/{utils.d.ts → utils.types.d.ts} +1 -1
- package/lib/typescript/shared/types/utils.types.d.ts.map +1 -0
- package/lib/typescript/shared/utils/animation/derivations.d.ts +2 -4
- package/lib/typescript/shared/utils/animation/derivations.d.ts.map +1 -1
- package/lib/typescript/shared/utils/animation/start-screen-transition.d.ts +2 -2
- package/lib/typescript/shared/utils/animation/start-screen-transition.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/constants.d.ts +3 -3
- package/lib/typescript/shared/utils/bounds/constants.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/{_utils → helpers}/geometry.d.ts +3 -3
- package/lib/typescript/shared/utils/bounds/helpers/geometry.d.ts.map +1 -0
- package/lib/typescript/shared/utils/bounds/helpers/is-bounds-equal.d.ts.map +1 -0
- package/lib/typescript/shared/utils/bounds/{_utils → helpers}/style-composers.d.ts +2 -2
- package/lib/typescript/shared/utils/bounds/helpers/style-composers.d.ts.map +1 -0
- package/lib/typescript/shared/utils/bounds/{_utils → helpers}/styles.d.ts +1 -1
- package/lib/typescript/shared/utils/bounds/helpers/styles.d.ts.map +1 -0
- package/lib/typescript/shared/utils/bounds/index.d.ts +3 -4
- package/lib/typescript/shared/utils/bounds/index.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/{_types → types}/builder.d.ts +13 -34
- package/lib/typescript/shared/utils/bounds/types/builder.d.ts.map +1 -0
- package/lib/typescript/shared/utils/bounds/types/geometry.d.ts.map +1 -0
- package/lib/typescript/shared/{providers/utils → utils}/create-provider.d.ts +2 -2
- package/lib/typescript/shared/utils/create-provider.d.ts.map +1 -0
- package/lib/typescript/shared/utils/gesture/apply-offset-rules.d.ts +2 -2
- package/lib/typescript/shared/utils/gesture/apply-offset-rules.d.ts.map +1 -1
- package/lib/typescript/shared/utils/gesture/check-gesture-activation.d.ts +2 -2
- package/lib/typescript/shared/utils/gesture/check-gesture-activation.d.ts.map +1 -1
- package/lib/typescript/shared/utils/gesture/reset-gesture-values.d.ts +2 -2
- package/lib/typescript/shared/utils/gesture/reset-gesture-values.d.ts.map +1 -1
- package/lib/typescript/shared/utils/gesture/velocity.d.ts +1 -1
- package/lib/typescript/shared/utils/reset-stores-for-screen.d.ts +6 -0
- package/lib/typescript/shared/utils/reset-stores-for-screen.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/blank-stack/components/Overlay.tsx +12 -13
- package/src/blank-stack/components/Screens.tsx +1 -1
- package/src/blank-stack/components/StackView.tsx +7 -2
- package/src/blank-stack/hooks/use-overlay-animation.tsx +15 -15
- package/src/blank-stack/index.ts +1 -1
- package/src/blank-stack/types.ts +28 -104
- package/src/blank-stack/utils/with-stack-navigation/{_hooks → hooks}/use-stack-navigation-state.tsx +4 -4
- package/src/blank-stack/utils/with-stack-navigation/index.tsx +2 -2
- package/src/native-stack/types.ts +9 -2
- package/src/native-stack/views/NativeStackView.native.tsx +4 -2
- package/src/shared/components/controllers/screen-lifecycle.tsx +12 -10
- package/src/shared/components/create-transition-aware-component.tsx +23 -27
- package/src/shared/components/root-transition-aware.tsx +1 -1
- package/src/shared/configs/presets.ts +39 -19
- package/src/shared/constants.ts +6 -7
- package/src/shared/hooks/animation/use-associated-style.tsx +12 -9
- package/src/shared/hooks/animation/use-screen-animation.tsx +17 -27
- package/src/shared/hooks/gestures/use-build-gestures.tsx +5 -5
- package/src/shared/hooks/gestures/use-parent-gesture-registry.tsx +1 -1
- package/src/shared/hooks/gestures/use-scroll-registry.tsx +2 -2
- package/src/shared/index.ts +2 -2
- package/src/shared/providers/{gestures.tsx → gestures.provider.tsx} +1 -1
- package/src/shared/providers/{keys.tsx → keys.provider.tsx} +1 -1
- package/src/shared/providers/register-bounds.provider.tsx +290 -0
- package/src/shared/providers/{screen-transition-provider.tsx → screen-transition.provider.tsx} +3 -3
- package/src/shared/providers/{transition-styles.tsx → transition-styles.provider.tsx} +18 -16
- package/src/shared/stores/{animation-store.ts → animation.store.ts} +1 -1
- package/src/shared/stores/bounds.store.ts +166 -0
- package/src/shared/stores/{gesture-store.ts → gesture.store.ts} +2 -2
- package/src/shared/types/{animation.ts → animation.types.ts} +60 -19
- package/src/shared/types/{bounds.ts → bounds.types.ts} +3 -3
- package/src/shared/types/{core.ts → core.types.ts} +12 -6
- package/src/shared/utils/animation/derivations.ts +2 -8
- package/src/shared/utils/animation/start-screen-transition.ts +2 -2
- package/src/shared/utils/bounds/constants.ts +3 -3
- package/src/shared/utils/bounds/{_utils → helpers}/geometry.ts +3 -3
- package/src/shared/utils/bounds/{_utils → helpers}/is-bounds-equal.ts +3 -3
- package/src/shared/utils/bounds/{_utils → helpers}/style-composers.ts +2 -2
- package/src/shared/utils/bounds/{_utils → helpers}/styles.ts +1 -1
- package/src/shared/utils/bounds/index.ts +53 -55
- package/src/shared/utils/bounds/{_types → types}/builder.ts +19 -37
- package/src/shared/{providers/utils → utils}/create-provider.tsx +3 -9
- package/src/shared/utils/gesture/apply-offset-rules.ts +2 -2
- package/src/shared/utils/gesture/check-gesture-activation.ts +2 -2
- package/src/shared/utils/gesture/reset-gesture-values.ts +2 -2
- package/src/shared/utils/gesture/velocity.ts +1 -1
- package/src/shared/utils/reset-stores-for-screen.ts +11 -0
- 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/_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.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/commonjs/shared/hooks/bounds/use-bound-registry.js +0 -152
- package/lib/commonjs/shared/hooks/bounds/use-bound-registry.js.map +0 -1
- package/lib/commonjs/shared/hooks/use-derived-value-state.js +0 -33
- package/lib/commonjs/shared/hooks/use-derived-value-state.js.map +0 -1
- package/lib/commonjs/shared/hooks/use-shared-value-state.js.map +0 -1
- package/lib/commonjs/shared/providers/gestures.js.map +0 -1
- package/lib/commonjs/shared/providers/keys.js.map +0 -1
- package/lib/commonjs/shared/providers/transition-styles.js.map +0 -1
- package/lib/commonjs/shared/providers/utils/create-provider.js.map +0 -1
- package/lib/commonjs/shared/stores/bound-store/_utils.js +0 -118
- package/lib/commonjs/shared/stores/bound-store/_utils.js.map +0 -1
- package/lib/commonjs/shared/stores/bound-store/index.js +0 -127
- package/lib/commonjs/shared/stores/bound-store/index.js.map +0 -1
- package/lib/commonjs/shared/stores/utils/reset-stores-for-screen.js +0 -19
- package/lib/commonjs/shared/stores/utils/reset-stores-for-screen.js.map +0 -1
- package/lib/commonjs/shared/types/gesture.js.map +0 -1
- package/lib/commonjs/shared/types/utils.js +0 -2
- package/lib/commonjs/shared/utils/bounds/_types/geometry.js.map +0 -1
- package/lib/commonjs/shared/utils/bounds/_types/get-bounds.js +0 -6
- package/lib/commonjs/shared/utils/bounds/_types/get-bounds.js.map +0 -1
- package/lib/commonjs/shared/utils/bounds/_utils/flatten-styles.js +0 -27
- package/lib/commonjs/shared/utils/bounds/_utils/flatten-styles.js.map +0 -1
- package/lib/commonjs/shared/utils/bounds/_utils/geometry.js.map +0 -1
- package/lib/commonjs/shared/utils/bounds/_utils/get-bounds.js +0 -49
- package/lib/commonjs/shared/utils/bounds/_utils/get-bounds.js.map +0 -1
- package/lib/commonjs/shared/utils/bounds/_utils/is-bounds-equal.js +0 -19
- package/lib/commonjs/shared/utils/bounds/_utils/is-bounds-equal.js.map +0 -1
- package/lib/commonjs/shared/utils/bounds/_utils/style-composers.js.map +0 -1
- package/lib/commonjs/shared/utils/bounds/_utils/styles.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/_utils/are-descriptors-equal.js.map +0 -1
- 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/module/shared/hooks/bounds/use-bound-registry.js +0 -146
- package/lib/module/shared/hooks/bounds/use-bound-registry.js.map +0 -1
- package/lib/module/shared/hooks/use-derived-value-state.js +0 -30
- package/lib/module/shared/hooks/use-derived-value-state.js.map +0 -1
- package/lib/module/shared/hooks/use-shared-value-state.js.map +0 -1
- package/lib/module/shared/providers/gestures.js.map +0 -1
- package/lib/module/shared/providers/keys.js.map +0 -1
- package/lib/module/shared/providers/transition-styles.js.map +0 -1
- package/lib/module/shared/providers/utils/create-provider.js.map +0 -1
- package/lib/module/shared/stores/bound-store/_utils.js +0 -113
- package/lib/module/shared/stores/bound-store/_utils.js.map +0 -1
- package/lib/module/shared/stores/bound-store/index.js +0 -123
- package/lib/module/shared/stores/bound-store/index.js.map +0 -1
- package/lib/module/shared/stores/utils/reset-stores-for-screen.js +0 -15
- package/lib/module/shared/stores/utils/reset-stores-for-screen.js.map +0 -1
- package/lib/module/shared/types/animation.js +0 -4
- package/lib/module/shared/types/animation.js.map +0 -1
- package/lib/module/shared/types/bounds.js +0 -4
- package/lib/module/shared/types/bounds.js.map +0 -1
- package/lib/module/shared/types/core.js +0 -4
- package/lib/module/shared/types/core.js.map +0 -1
- package/lib/module/shared/types/gesture.js.map +0 -1
- package/lib/module/shared/types/utils.js +0 -2
- package/lib/module/shared/types/utils.js.map +0 -1
- package/lib/module/shared/utils/bounds/_types/geometry.js.map +0 -1
- package/lib/module/shared/utils/bounds/_types/get-bounds.js +0 -4
- package/lib/module/shared/utils/bounds/_types/get-bounds.js.map +0 -1
- package/lib/module/shared/utils/bounds/_utils/flatten-styles.js +0 -23
- package/lib/module/shared/utils/bounds/_utils/flatten-styles.js.map +0 -1
- package/lib/module/shared/utils/bounds/_utils/geometry.js.map +0 -1
- package/lib/module/shared/utils/bounds/_utils/get-bounds.js +0 -44
- package/lib/module/shared/utils/bounds/_utils/get-bounds.js.map +0 -1
- package/lib/module/shared/utils/bounds/_utils/is-bounds-equal.js +0 -14
- package/lib/module/shared/utils/bounds/_utils/is-bounds-equal.js.map +0 -1
- package/lib/module/shared/utils/bounds/_utils/style-composers.js.map +0 -1
- package/lib/module/shared/utils/bounds/_utils/styles.js.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/_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/lib/typescript/shared/hooks/bounds/use-bound-registry.d.ts +0 -17
- package/lib/typescript/shared/hooks/bounds/use-bound-registry.d.ts.map +0 -1
- package/lib/typescript/shared/hooks/use-derived-value-state.d.ts +0 -9
- package/lib/typescript/shared/hooks/use-derived-value-state.d.ts.map +0 -1
- package/lib/typescript/shared/hooks/use-shared-value-state.d.ts.map +0 -1
- package/lib/typescript/shared/providers/gestures.d.ts.map +0 -1
- package/lib/typescript/shared/providers/keys.d.ts.map +0 -1
- package/lib/typescript/shared/providers/transition-styles.d.ts +0 -11
- package/lib/typescript/shared/providers/transition-styles.d.ts.map +0 -1
- package/lib/typescript/shared/providers/utils/create-provider.d.ts.map +0 -1
- package/lib/typescript/shared/stores/animation-store.d.ts.map +0 -1
- package/lib/typescript/shared/stores/bound-store/_utils.d.ts +0 -24
- package/lib/typescript/shared/stores/bound-store/_utils.d.ts.map +0 -1
- package/lib/typescript/shared/stores/bound-store/index.d.ts +0 -24
- package/lib/typescript/shared/stores/bound-store/index.d.ts.map +0 -1
- package/lib/typescript/shared/stores/gesture-store.d.ts.map +0 -1
- package/lib/typescript/shared/stores/utils/reset-stores-for-screen.d.ts +0 -6
- package/lib/typescript/shared/stores/utils/reset-stores-for-screen.d.ts.map +0 -1
- package/lib/typescript/shared/types/animation.d.ts.map +0 -1
- package/lib/typescript/shared/types/bounds.d.ts.map +0 -1
- package/lib/typescript/shared/types/core.d.ts.map +0 -1
- package/lib/typescript/shared/types/gesture.d.ts.map +0 -1
- package/lib/typescript/shared/types/utils.d.ts.map +0 -1
- package/lib/typescript/shared/utils/bounds/_types/builder.d.ts.map +0 -1
- package/lib/typescript/shared/utils/bounds/_types/geometry.d.ts.map +0 -1
- package/lib/typescript/shared/utils/bounds/_types/get-bounds.d.ts +0 -10
- package/lib/typescript/shared/utils/bounds/_types/get-bounds.d.ts.map +0 -1
- package/lib/typescript/shared/utils/bounds/_utils/flatten-styles.d.ts +0 -2
- package/lib/typescript/shared/utils/bounds/_utils/flatten-styles.d.ts.map +0 -1
- package/lib/typescript/shared/utils/bounds/_utils/geometry.d.ts.map +0 -1
- package/lib/typescript/shared/utils/bounds/_utils/get-bounds.d.ts +0 -4
- package/lib/typescript/shared/utils/bounds/_utils/get-bounds.d.ts.map +0 -1
- package/lib/typescript/shared/utils/bounds/_utils/is-bounds-equal.d.ts.map +0 -1
- package/lib/typescript/shared/utils/bounds/_utils/style-composers.d.ts.map +0 -1
- package/lib/typescript/shared/utils/bounds/_utils/styles.d.ts.map +0 -1
- package/src/shared/hooks/bounds/use-bound-registry.tsx +0 -184
- package/src/shared/hooks/use-derived-value-state.ts +0 -41
- package/src/shared/stores/bound-store/_utils.ts +0 -161
- package/src/shared/stores/bound-store/index.ts +0 -148
- package/src/shared/stores/utils/reset-stores-for-screen.ts +0 -13
- package/src/shared/utils/bounds/_types/get-bounds.ts +0 -10
- package/src/shared/utils/bounds/_utils/flatten-styles.ts +0 -21
- package/src/shared/utils/bounds/_utils/get-bounds.ts +0 -54
- /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}/compose-descriptors.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-closing-route-keys.js +0 -0
- /package/lib/commonjs/blank-stack/utils/with-stack-navigation/{_hooks → hooks}/use-previous.js +0 -0
- /package/lib/commonjs/shared/hooks/{use-shared-value-state.js → reanimated/use-shared-value-state.js} +0 -0
- /package/lib/commonjs/shared/utils/bounds/{_utils → helpers}/geometry.js +0 -0
- /package/lib/commonjs/shared/utils/bounds/{_utils → helpers}/style-composers.js +0 -0
- /package/lib/commonjs/shared/utils/bounds/{_utils → helpers}/styles.js +0 -0
- /package/lib/commonjs/shared/utils/bounds/{_types → types}/builder.js +0 -0
- /package/lib/commonjs/shared/utils/bounds/{_types → types}/geometry.js +0 -0
- /package/lib/commonjs/shared/{providers/utils → utils}/create-provider.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}/compose-descriptors.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-closing-route-keys.js +0 -0
- /package/lib/module/blank-stack/utils/with-stack-navigation/{_hooks → hooks}/use-previous.js +0 -0
- /package/lib/module/shared/hooks/{use-shared-value-state.js → reanimated/use-shared-value-state.js} +0 -0
- /package/lib/module/shared/utils/bounds/{_utils → helpers}/geometry.js +0 -0
- /package/lib/module/shared/utils/bounds/{_utils → helpers}/style-composers.js +0 -0
- /package/lib/module/shared/utils/bounds/{_utils → helpers}/styles.js +0 -0
- /package/lib/module/shared/utils/bounds/{_types → types}/builder.js +0 -0
- /package/lib/module/shared/utils/bounds/{_types → types}/geometry.js +0 -0
- /package/lib/module/shared/{providers/utils → utils}/create-provider.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/lib/typescript/blank-stack/utils/with-stack-navigation/{_hooks → hooks}/use-stack-navigation-state.d.ts +0 -0
- /package/lib/typescript/shared/hooks/{use-shared-value-state.d.ts → reanimated/use-shared-value-state.d.ts} +0 -0
- /package/lib/typescript/shared/utils/bounds/{_utils → helpers}/is-bounds-equal.d.ts +0 -0
- /package/lib/typescript/shared/utils/bounds/{_types → types}/geometry.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}/compose-descriptors.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-closing-route-keys.tsx +0 -0
- /package/src/blank-stack/utils/with-stack-navigation/{_hooks → hooks}/use-previous.tsx +0 -0
- /package/src/shared/hooks/{use-shared-value-state.ts → reanimated/use-shared-value-state.ts} +0 -0
- /package/src/shared/hooks/{use-stable-callback-value.tsx → use-stable-callback-value.ts} +0 -0
- /package/src/shared/hooks/{use-stable-callback.tsx → use-stable-callback.ts} +0 -0
- /package/src/shared/types/{gesture.ts → gesture.types.ts} +0 -0
- /package/src/shared/types/{utils.ts → utils.types.ts} +0 -0
- /package/src/shared/utils/bounds/{_types → types}/geometry.ts +0 -0
|
@@ -4,10 +4,11 @@ import {
|
|
|
4
4
|
NavigationRouteContext,
|
|
5
5
|
} from "@react-navigation/native";
|
|
6
6
|
import * as React from "react";
|
|
7
|
+
import { StyleSheet } from "react-native";
|
|
7
8
|
import { GestureHandlerRootView } from "react-native-gesture-handler";
|
|
8
9
|
import { ScreenContainer } from "react-native-screens";
|
|
9
10
|
import { BlankStackScreenLifecycleController } from "../../shared/components/controllers/screen-lifecycle";
|
|
10
|
-
import { ScreenTransitionProvider } from "../../shared/providers/screen-transition
|
|
11
|
+
import { ScreenTransitionProvider } from "../../shared/providers/screen-transition.provider";
|
|
11
12
|
import type { BlankStackDescriptor } from "../types";
|
|
12
13
|
import { withStackNavigationProvider } from "../utils/with-stack-navigation";
|
|
13
14
|
import { Overlay } from "./Overlay";
|
|
@@ -49,7 +50,7 @@ export const StackView = withStackNavigationProvider(
|
|
|
49
50
|
<GestureHandlerRootView>
|
|
50
51
|
<SafeAreaProviderCompat>
|
|
51
52
|
{shouldShowFloatOverlay ? <Overlay.Float /> : null}
|
|
52
|
-
<ScreenContainer style={
|
|
53
|
+
<ScreenContainer style={styles.container}>
|
|
53
54
|
{scenes.map((scene, sceneIndex) => {
|
|
54
55
|
const descriptor = scene.descriptor;
|
|
55
56
|
const route = scene.route;
|
|
@@ -101,3 +102,7 @@ export const StackView = withStackNavigationProvider(
|
|
|
101
102
|
);
|
|
102
103
|
},
|
|
103
104
|
);
|
|
105
|
+
|
|
106
|
+
const styles = StyleSheet.create({
|
|
107
|
+
container: { flex: 1 },
|
|
108
|
+
});
|
|
@@ -2,10 +2,10 @@ import { useMemo } from "react";
|
|
|
2
2
|
import { useWindowDimensions } from "react-native";
|
|
3
3
|
import { type DerivedValue, useDerivedValue } from "react-native-reanimated";
|
|
4
4
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
5
|
-
import { useSharedValueState } from "../../shared/hooks/use-shared-value-state";
|
|
6
|
-
import { useKeys } from "../../shared/providers/keys";
|
|
7
|
-
import { AnimationStore } from "../../shared/stores/animation
|
|
8
|
-
import type { OverlayInterpolationProps } from "../../shared/types/animation";
|
|
5
|
+
import { useSharedValueState } from "../../shared/hooks/reanimated/use-shared-value-state";
|
|
6
|
+
import { useKeys } from "../../shared/providers/keys.provider";
|
|
7
|
+
import { AnimationStore } from "../../shared/stores/animation.store";
|
|
8
|
+
import type { OverlayInterpolationProps } from "../../shared/types/animation.types";
|
|
9
9
|
import { useStackNavigationContext } from "../utils/with-stack-navigation";
|
|
10
10
|
|
|
11
11
|
/**
|
|
@@ -51,21 +51,21 @@ export const useOverlayAnimation = (): {
|
|
|
51
51
|
return total;
|
|
52
52
|
}, [progressValues]);
|
|
53
53
|
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
const activeIndex = progressValues.length - 1;
|
|
54
|
+
const optimisticActiveIndex = useSharedValueState(
|
|
55
|
+
useDerivedValue(() => {
|
|
56
|
+
"worklet";
|
|
58
57
|
|
|
59
|
-
|
|
60
|
-
progressValues.some((value) => value.closing.value > 0),
|
|
61
|
-
);
|
|
58
|
+
const activeIndex = progressValues.length - 1;
|
|
62
59
|
|
|
63
|
-
|
|
60
|
+
const isOneDismissing = Number(
|
|
61
|
+
progressValues.some((value) => value.closing.value > 0),
|
|
62
|
+
);
|
|
64
63
|
|
|
65
|
-
|
|
66
|
-
});
|
|
64
|
+
const optimisticIndex = activeIndex - isOneDismissing;
|
|
67
65
|
|
|
68
|
-
|
|
66
|
+
return optimisticIndex;
|
|
67
|
+
}),
|
|
68
|
+
);
|
|
69
69
|
|
|
70
70
|
const screen = useWindowDimensions();
|
|
71
71
|
|
package/src/blank-stack/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { createBlankStackNavigator } from "../blank-stack/navigators/createBlankStackNavigator";
|
|
2
1
|
export { useOverlayAnimation } from "../blank-stack/hooks/use-overlay-animation";
|
|
2
|
+
export { createBlankStackNavigator } from "../blank-stack/navigators/createBlankStackNavigator";
|
|
3
3
|
export type {
|
|
4
4
|
BlankStackNavigationEventMap,
|
|
5
5
|
BlankStackNavigationOptions,
|
package/src/blank-stack/types.ts
CHANGED
|
@@ -12,18 +12,18 @@ import type {
|
|
|
12
12
|
Theme,
|
|
13
13
|
} from "@react-navigation/native";
|
|
14
14
|
import type { DerivedValue } from "react-native-reanimated";
|
|
15
|
-
import type { EdgeInsets } from "react-native-safe-area-context";
|
|
16
15
|
import type { ScreenProps } from "react-native-screens";
|
|
16
|
+
import type { ScreenTransitionConfig } from "../shared";
|
|
17
17
|
import type {
|
|
18
18
|
OverlayInterpolationProps,
|
|
19
19
|
ScreenInterpolationProps,
|
|
20
20
|
ScreenStyleInterpolator,
|
|
21
21
|
TransitionSpec,
|
|
22
|
-
} from "../shared/types/animation";
|
|
22
|
+
} from "../shared/types/animation.types";
|
|
23
23
|
import type {
|
|
24
24
|
GestureActivationArea,
|
|
25
25
|
GestureDirection,
|
|
26
|
-
} from "../shared/types/gesture";
|
|
26
|
+
} from "../shared/types/gesture.types";
|
|
27
27
|
|
|
28
28
|
export type BlankStackNavigationEventMap = {
|
|
29
29
|
/**
|
|
@@ -95,65 +95,41 @@ export type BlankStackNavigationConfig = {};
|
|
|
95
95
|
|
|
96
96
|
export type BlankStackOverlayProps = {
|
|
97
97
|
/**
|
|
98
|
-
*
|
|
98
|
+
* Route of the currently focused screen in the stack.
|
|
99
99
|
*/
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
* Title of the previous screen.
|
|
103
|
-
*/
|
|
104
|
-
title: string;
|
|
105
|
-
};
|
|
100
|
+
focusedRoute: Route<string>;
|
|
101
|
+
|
|
106
102
|
/**
|
|
107
|
-
*
|
|
103
|
+
* Index of the focused route in the stack.
|
|
108
104
|
*/
|
|
109
|
-
|
|
105
|
+
focusedIndex: number;
|
|
106
|
+
|
|
110
107
|
/**
|
|
111
|
-
*
|
|
108
|
+
* Options passed to the overlay component.
|
|
112
109
|
*/
|
|
113
|
-
|
|
110
|
+
overlayOptions?: {
|
|
111
|
+
title?: string;
|
|
112
|
+
subtitle?: string;
|
|
113
|
+
[key: string]: unknown;
|
|
114
|
+
};
|
|
115
|
+
|
|
114
116
|
/**
|
|
115
117
|
* Navigation prop for the overlay.
|
|
116
118
|
*/
|
|
117
119
|
navigation: BlankStackNavigationProp<ParamListBase>;
|
|
118
|
-
|
|
119
|
-
* Safe area insets for the screen.
|
|
120
|
-
*/
|
|
121
|
-
insets: EdgeInsets;
|
|
120
|
+
|
|
122
121
|
/**
|
|
123
122
|
* Animation values for the overlay.
|
|
124
123
|
*/
|
|
125
124
|
overlayAnimation: DerivedValue<OverlayInterpolationProps>;
|
|
125
|
+
|
|
126
126
|
/**
|
|
127
127
|
* Animation values for the screen.
|
|
128
128
|
*/
|
|
129
129
|
screenAnimation: DerivedValue<ScreenInterpolationProps>;
|
|
130
|
-
/**
|
|
131
|
-
* Index of the active route
|
|
132
|
-
*/
|
|
133
|
-
focusedIndex: number;
|
|
134
130
|
};
|
|
135
131
|
|
|
136
|
-
export type BlankStackScreenTransitionConfig = {
|
|
137
|
-
/**
|
|
138
|
-
* The user-provided function to calculate styles based on animation progress.
|
|
139
|
-
*/
|
|
140
|
-
screenStyleInterpolator?: ScreenStyleInterpolator;
|
|
141
|
-
/**
|
|
142
|
-
* The Reanimated animation config for opening and closing transitions.
|
|
143
|
-
*/
|
|
144
|
-
transitionSpec?: TransitionSpec;
|
|
145
|
-
/**
|
|
146
|
-
* Whether the gesture is enabled.
|
|
147
|
-
*/
|
|
148
|
-
gestureEnabled?: boolean;
|
|
149
|
-
/**
|
|
150
|
-
* The direction of the swipe gesture used to dismiss the screen.
|
|
151
|
-
*/
|
|
152
|
-
gestureDirection?: GestureDirection | GestureDirection[];
|
|
153
|
-
/**
|
|
154
|
-
* How much the gesture's final velocity impacts the dismiss decision.
|
|
155
|
-
*/
|
|
156
|
-
gestureVelocityImpact?: number;
|
|
132
|
+
export type BlankStackScreenTransitionConfig = ScreenTransitionConfig & {
|
|
157
133
|
/**
|
|
158
134
|
* Whether to detach the previous screen from the view hierarchy to save memory.
|
|
159
135
|
* Set it to `false` if you need the previous screen to be seen through the active screen.
|
|
@@ -161,18 +137,6 @@ export type BlankStackScreenTransitionConfig = {
|
|
|
161
137
|
* Defaults to `false` for the last screen for modals, otherwise `true`.
|
|
162
138
|
*/
|
|
163
139
|
detachPreviousScreen?: boolean;
|
|
164
|
-
/**
|
|
165
|
-
* Distance threshold for gesture recognition throughout the screen.
|
|
166
|
-
*/
|
|
167
|
-
gestureResponseDistance?: number;
|
|
168
|
-
/**
|
|
169
|
-
* Whether the gesture drives the progress.
|
|
170
|
-
*/
|
|
171
|
-
gestureDrivesProgress?: boolean;
|
|
172
|
-
/**
|
|
173
|
-
* The area of the screen where the gesture is activated.
|
|
174
|
-
*/
|
|
175
|
-
gestureActivationArea?: GestureActivationArea;
|
|
176
140
|
};
|
|
177
141
|
|
|
178
142
|
export type BlankStackNavigationOptions = BlankStackScreenTransitionConfig & {
|
|
@@ -180,6 +144,7 @@ export type BlankStackNavigationOptions = BlankStackScreenTransitionConfig & {
|
|
|
180
144
|
* Function that given `OverlayProps` returns a React Element to display as a overlay.
|
|
181
145
|
*/
|
|
182
146
|
overlay?: (props: BlankStackOverlayProps) => React.ReactNode;
|
|
147
|
+
|
|
183
148
|
/**
|
|
184
149
|
* Layout: How the Overlay is positioned
|
|
185
150
|
* - 'float': Single persistent overlay above all screens (like iOS)
|
|
@@ -187,6 +152,7 @@ export type BlankStackNavigationOptions = BlankStackScreenTransitionConfig & {
|
|
|
187
152
|
* @default 'screen'
|
|
188
153
|
*/
|
|
189
154
|
overlayMode?: "float" | "screen";
|
|
155
|
+
|
|
190
156
|
/**
|
|
191
157
|
* Whether to show the overlay. The overlay is shown by default.
|
|
192
158
|
* Setting this to `false` hides the overlay.
|
|
@@ -194,56 +160,14 @@ export type BlankStackNavigationOptions = BlankStackScreenTransitionConfig & {
|
|
|
194
160
|
overlayShown?: boolean;
|
|
195
161
|
|
|
196
162
|
/**
|
|
197
|
-
*
|
|
198
|
-
*
|
|
199
|
-
* @platform ios
|
|
200
|
-
*/
|
|
201
|
-
autoHideHomeIndicator?: boolean;
|
|
202
|
-
/**
|
|
203
|
-
* Whether the keyboard should hide when swiping to the previous screen. Defaults to `false`.
|
|
204
|
-
*
|
|
205
|
-
* @platform ios
|
|
206
|
-
*/
|
|
207
|
-
keyboardHandlingEnabled?: boolean;
|
|
208
|
-
/**
|
|
209
|
-
* Sets the visibility of the navigation bar. Defaults to `false`.
|
|
210
|
-
*
|
|
211
|
-
* @platform android
|
|
212
|
-
*/
|
|
213
|
-
navigationBarHidden?: boolean;
|
|
214
|
-
/**
|
|
215
|
-
* Sets the status bar animation (similar to the `StatusBar` component).
|
|
216
|
-
* On Android, setting either `fade` or `slide` will set the transition of status bar color. On iOS, this option applies to appereance animation of the status bar.
|
|
217
|
-
* Requires setting `View controller-based status bar appearance -> YES` (or removing the config) in your `Info.plist` file.
|
|
218
|
-
*
|
|
219
|
-
* Defaults to `fade` on iOS and `none` on Android.
|
|
220
|
-
*
|
|
221
|
-
* Only supported on Android and iOS.
|
|
222
|
-
*
|
|
223
|
-
* @platform android, ios
|
|
224
|
-
*/
|
|
225
|
-
statusBarAnimation?: ScreenProps["statusBarAnimation"];
|
|
226
|
-
/**
|
|
227
|
-
* Whether the status bar should be hidden on this screen.
|
|
228
|
-
* Requires setting `View controller-based status bar appearance -> YES` in your Info.plist file.
|
|
229
|
-
*
|
|
230
|
-
* Only supported on Android and iOS.
|
|
231
|
-
*
|
|
232
|
-
* @platform android, ios
|
|
163
|
+
* Options passed to the overlay component.
|
|
233
164
|
*/
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
* Defaults to `auto` on iOS and `light` on Android.
|
|
241
|
-
*
|
|
242
|
-
* Only supported on Android and iOS.
|
|
243
|
-
*
|
|
244
|
-
* @platform android, ios
|
|
245
|
-
*/
|
|
246
|
-
statusBarStyle?: ScreenProps["statusBarStyle"];
|
|
165
|
+
overlayOptions?: {
|
|
166
|
+
title?: string;
|
|
167
|
+
subtitle?: string;
|
|
168
|
+
[key: string]: unknown;
|
|
169
|
+
};
|
|
170
|
+
|
|
247
171
|
/**
|
|
248
172
|
* Whether inactive screens should be suspended from re-rendering. Defaults to `false`.
|
|
249
173
|
* Defaults to `true` when `enableFreeze()` is run at the top of the application.
|
package/src/blank-stack/utils/with-stack-navigation/{_hooks → hooks}/use-stack-navigation-state.tsx
RENAMED
|
@@ -3,10 +3,10 @@ import { useLayoutEffect, useState } from "react";
|
|
|
3
3
|
import useStableCallback from "../../../../shared/hooks/use-stable-callback";
|
|
4
4
|
import type { BlankStackDescriptorMap } from "../../../types";
|
|
5
5
|
import type { StackNavigationContextProps } from "../_types";
|
|
6
|
-
import { areDescriptorsEqual } from "../
|
|
7
|
-
import { composeDescriptors } from "../
|
|
8
|
-
import { haveSameRouteKeys } from "../
|
|
9
|
-
import { routesAreIdentical } from "../
|
|
6
|
+
import { areDescriptorsEqual } from "../helpers/are-descriptors-equal";
|
|
7
|
+
import { composeDescriptors } from "../helpers/compose-descriptors";
|
|
8
|
+
import { haveSameRouteKeys } from "../helpers/have-same-route-keys";
|
|
9
|
+
import { routesAreIdentical } from "../helpers/routes-are-identical";
|
|
10
10
|
import { useClosingRouteKeys } from "./use-closing-route-keys";
|
|
11
11
|
import { usePrevious } from "./use-previous";
|
|
12
12
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { type ComponentType, createContext, useContext, useMemo } from "react";
|
|
2
2
|
import type { BlankStackScene } from "../../types";
|
|
3
|
-
import { useStackNavigationState } from "./
|
|
3
|
+
import { useStackNavigationState } from "./hooks/use-stack-navigation-state";
|
|
4
4
|
import type {
|
|
5
5
|
StackNavigationContextProps,
|
|
6
6
|
StackNavigationContextValue,
|
|
7
7
|
} from "./_types";
|
|
8
|
-
import { calculateActiveScreensLimit } from "./
|
|
8
|
+
import { calculateActiveScreensLimit } from "./helpers/calculate-active-screens-limit";
|
|
9
9
|
|
|
10
10
|
export const StackNavigationContext =
|
|
11
11
|
createContext<StackNavigationContextValue | null>(null);
|
|
@@ -22,7 +22,7 @@ import type {
|
|
|
22
22
|
ScreenStackHeaderConfigProps,
|
|
23
23
|
SearchBarProps,
|
|
24
24
|
} from "react-native-screens";
|
|
25
|
-
import type { ScreenTransitionConfig } from "../shared/types/core";
|
|
25
|
+
import type { ScreenTransitionConfig } from "../shared/types/core.types";
|
|
26
26
|
|
|
27
27
|
export type Layout = {
|
|
28
28
|
width: number;
|
|
@@ -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
|
*/
|
|
@@ -34,7 +34,7 @@ import {
|
|
|
34
34
|
ScreenStackItem,
|
|
35
35
|
} from "react-native-screens";
|
|
36
36
|
import { NativeStackScreenLifecycleController } from "../../shared/components/controllers/screen-lifecycle";
|
|
37
|
-
import { ScreenTransitionProvider } from "../../shared/providers/screen-transition
|
|
37
|
+
import { ScreenTransitionProvider } from "../../shared/providers/screen-transition.provider";
|
|
38
38
|
import type {
|
|
39
39
|
NativeStackDescriptor,
|
|
40
40
|
NativeStackDescriptorMap,
|
|
@@ -513,11 +513,13 @@ export function NativeStackView({
|
|
|
513
513
|
return acc;
|
|
514
514
|
}, {});
|
|
515
515
|
|
|
516
|
+
const routes = state.routes.concat(state.preloadedRoutes);
|
|
517
|
+
|
|
516
518
|
return (
|
|
517
519
|
<GestureHandlerRootView>
|
|
518
520
|
<SafeAreaProviderCompat>
|
|
519
521
|
<ScreenStack style={styles.container}>
|
|
520
|
-
{
|
|
522
|
+
{routes.map((route, index) => {
|
|
521
523
|
const descriptor =
|
|
522
524
|
descriptors[route.key] ?? preloadedDescriptors[route.key];
|
|
523
525
|
const isFocused = state.index === index;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { useEffect, useLayoutEffect } from "react";
|
|
2
|
-
import { useAnimatedReaction } from "react-native-reanimated";
|
|
2
|
+
import { useAnimatedReaction, useDerivedValue } from "react-native-reanimated";
|
|
3
3
|
import type { BlankStackDescriptor } from "../../../blank-stack/types";
|
|
4
4
|
import { useStackNavigationContext } from "../../../blank-stack/utils/with-stack-navigation";
|
|
5
5
|
import type { NativeStackDescriptor } from "../../../native-stack/types";
|
|
6
6
|
import { useParentGestureRegistry } from "../../hooks/gestures/use-parent-gesture-registry";
|
|
7
|
-
import {
|
|
7
|
+
import { useSharedValueState } from "../../hooks/reanimated/use-shared-value-state";
|
|
8
8
|
import useStableCallback from "../../hooks/use-stable-callback";
|
|
9
|
-
import { useGestureContext } from "../../providers/gestures";
|
|
10
|
-
import { useKeys } from "../../providers/keys";
|
|
11
|
-
import { AnimationStore } from "../../stores/animation
|
|
12
|
-
import { resetStoresForScreen } from "../../stores/utils/reset-stores-for-screen";
|
|
9
|
+
import { useGestureContext } from "../../providers/gestures.provider";
|
|
10
|
+
import { useKeys } from "../../providers/keys.provider";
|
|
11
|
+
import { AnimationStore } from "../../stores/animation.store";
|
|
13
12
|
import { startScreenTransition } from "../../utils/animation/start-screen-transition";
|
|
13
|
+
import { resetStoresForScreen } from "../../utils/reset-stores-for-screen";
|
|
14
14
|
|
|
15
15
|
export interface ScreenLifecycleProps {
|
|
16
16
|
children: React.ReactNode;
|
|
@@ -25,10 +25,12 @@ export const NativeStackScreenLifecycleController = ({
|
|
|
25
25
|
const { current } = useKeys<NativeStackDescriptor>();
|
|
26
26
|
const { parentContext } = useGestureContext();
|
|
27
27
|
|
|
28
|
-
const isParentDismissingViaGesture =
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
const isParentDismissingViaGesture = useSharedValueState(
|
|
29
|
+
useDerivedValue(() => {
|
|
30
|
+
"worklet";
|
|
31
|
+
return parentContext?.gestureAnimationValues.isDismissing?.value ?? false;
|
|
32
|
+
}),
|
|
33
|
+
);
|
|
32
34
|
|
|
33
35
|
const animations = AnimationStore.getAll(current.route.key);
|
|
34
36
|
|
|
@@ -4,11 +4,11 @@ import type { View } from "react-native";
|
|
|
4
4
|
import { GestureDetector } from "react-native-gesture-handler";
|
|
5
5
|
import Animated, { runOnUI, useAnimatedRef } from "react-native-reanimated";
|
|
6
6
|
import { useAssociatedStyles } from "../hooks/animation/use-associated-style";
|
|
7
|
-
import { useBoundsRegistry } from "../hooks/bounds/use-bound-registry";
|
|
8
7
|
import { useScrollRegistry } from "../hooks/gestures/use-scroll-registry";
|
|
9
|
-
import { useGestureContext } from "../providers/gestures";
|
|
10
|
-
import
|
|
11
|
-
import type {
|
|
8
|
+
import { useGestureContext } from "../providers/gestures.provider";
|
|
9
|
+
import { RegisterBoundsProvider } from "../providers/register-bounds.provider";
|
|
10
|
+
import type { TransitionAwareProps } from "../types/core.types";
|
|
11
|
+
import type { Any } from "../types/utils.types";
|
|
12
12
|
|
|
13
13
|
interface CreateTransitionAwareComponentOptions {
|
|
14
14
|
isScrollable?: boolean;
|
|
@@ -61,30 +61,26 @@ export function createTransitionAwareComponent<P extends object>(
|
|
|
61
61
|
style,
|
|
62
62
|
});
|
|
63
63
|
|
|
64
|
-
const {
|
|
65
|
-
handleInitialLayout,
|
|
66
|
-
captureActiveOnPress,
|
|
67
|
-
MeasurementSyncProvider,
|
|
68
|
-
} = useBoundsRegistry({
|
|
69
|
-
sharedBoundTag,
|
|
70
|
-
animatedRef,
|
|
71
|
-
style,
|
|
72
|
-
onPress,
|
|
73
|
-
});
|
|
74
|
-
|
|
75
64
|
return (
|
|
76
|
-
<
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
65
|
+
<RegisterBoundsProvider
|
|
66
|
+
animatedRef={animatedRef}
|
|
67
|
+
style={style}
|
|
68
|
+
onPress={onPress}
|
|
69
|
+
sharedBoundTag={sharedBoundTag}
|
|
70
|
+
>
|
|
71
|
+
{({ captureActiveOnPress, handleInitialLayout }) => (
|
|
72
|
+
<AnimatedComponent
|
|
73
|
+
{...(rest as Any)}
|
|
74
|
+
ref={animatedRef}
|
|
75
|
+
style={[style, associatedStyles]}
|
|
76
|
+
onPress={captureActiveOnPress}
|
|
77
|
+
onLayout={runOnUI(handleInitialLayout)}
|
|
78
|
+
collapsable={!sharedBoundTag}
|
|
79
|
+
>
|
|
80
|
+
{children}
|
|
81
|
+
</AnimatedComponent>
|
|
82
|
+
)}
|
|
83
|
+
</RegisterBoundsProvider>
|
|
88
84
|
);
|
|
89
85
|
});
|
|
90
86
|
|
|
@@ -2,7 +2,7 @@ import { memo } from "react";
|
|
|
2
2
|
import { StyleSheet, View } from "react-native";
|
|
3
3
|
import Animated, { useAnimatedStyle } from "react-native-reanimated";
|
|
4
4
|
import { NO_STYLES } from "../constants";
|
|
5
|
-
import { useTransitionStyles } from "../providers/transition-styles";
|
|
5
|
+
import { useTransitionStyles } from "../providers/transition-styles.provider";
|
|
6
6
|
|
|
7
7
|
type Props = {
|
|
8
8
|
children: React.ReactNode;
|