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,7 +4,7 @@ import {
|
|
|
4
4
|
interpolate,
|
|
5
5
|
interpolateColor,
|
|
6
6
|
} from "react-native-reanimated";
|
|
7
|
-
import type { ScreenTransitionConfig } from "../types/core";
|
|
7
|
+
import type { ScreenTransitionConfig } from "../types/core.types";
|
|
8
8
|
import { DefaultSpec } from "./specs";
|
|
9
9
|
|
|
10
10
|
const platform = Platform.OS;
|
|
@@ -13,6 +13,7 @@ export const SlideFromTop = (
|
|
|
13
13
|
config: Partial<ScreenTransitionConfig> = {},
|
|
14
14
|
): ScreenTransitionConfig => {
|
|
15
15
|
return {
|
|
16
|
+
//@ts-expect-error - Should not lead to any issues
|
|
16
17
|
enableTransitions: true,
|
|
17
18
|
gestureEnabled: true,
|
|
18
19
|
gestureDirection: "vertical-inverted",
|
|
@@ -45,6 +46,7 @@ export const ZoomIn = (
|
|
|
45
46
|
config: Partial<ScreenTransitionConfig> = {},
|
|
46
47
|
): ScreenTransitionConfig => {
|
|
47
48
|
return {
|
|
49
|
+
//@ts-expect-error - Should not lead to any issues
|
|
48
50
|
enableTransitions: true,
|
|
49
51
|
gestureEnabled: false,
|
|
50
52
|
screenStyleInterpolator: ({ progress }) => {
|
|
@@ -83,6 +85,7 @@ export const SlideFromBottom = (
|
|
|
83
85
|
config: Partial<ScreenTransitionConfig> = {},
|
|
84
86
|
): ScreenTransitionConfig => {
|
|
85
87
|
return {
|
|
88
|
+
//@ts-expect-error - Should not lead to any issues
|
|
86
89
|
enableTransitions: true,
|
|
87
90
|
gestureEnabled: true,
|
|
88
91
|
gestureDirection: "vertical",
|
|
@@ -114,6 +117,7 @@ export const DraggableCard = (
|
|
|
114
117
|
config: Partial<ScreenTransitionConfig> = {},
|
|
115
118
|
): ScreenTransitionConfig => {
|
|
116
119
|
return {
|
|
120
|
+
//@ts-expect-error - Should not lead to any issues
|
|
117
121
|
enableTransitions: true,
|
|
118
122
|
gestureEnabled: true,
|
|
119
123
|
gestureDirection: ["horizontal", "vertical"],
|
|
@@ -159,6 +163,7 @@ export const ElasticCard = (
|
|
|
159
163
|
} = { elasticFactor: 0.5 },
|
|
160
164
|
): ScreenTransitionConfig => {
|
|
161
165
|
return {
|
|
166
|
+
//@ts-expect-error - Should not lead to any issues
|
|
162
167
|
enableTransitions: true,
|
|
163
168
|
gestureEnabled: true,
|
|
164
169
|
gestureDirection: "bidirectional",
|
|
@@ -216,9 +221,12 @@ export const ElasticCard = (
|
|
|
216
221
|
};
|
|
217
222
|
};
|
|
218
223
|
|
|
219
|
-
export const SharedIGImage = (
|
|
220
|
-
|
|
221
|
-
|
|
224
|
+
export const SharedIGImage = ({
|
|
225
|
+
sharedBoundTag,
|
|
226
|
+
...config
|
|
227
|
+
}: Partial<ScreenTransitionConfig> & {
|
|
228
|
+
sharedBoundTag: string;
|
|
229
|
+
}): ScreenTransitionConfig => {
|
|
222
230
|
return {
|
|
223
231
|
gestureEnabled: true,
|
|
224
232
|
gestureDirection: ["vertical", "horizontal"],
|
|
@@ -232,7 +240,6 @@ export const SharedIGImage = (
|
|
|
232
240
|
bounds,
|
|
233
241
|
progress,
|
|
234
242
|
focused,
|
|
235
|
-
activeBoundId,
|
|
236
243
|
active,
|
|
237
244
|
}) => {
|
|
238
245
|
"worklet";
|
|
@@ -257,6 +264,7 @@ export const SharedIGImage = (
|
|
|
257
264
|
const dragYScale = interpolate(normY, [0, 1], [1, 0.8]);
|
|
258
265
|
|
|
259
266
|
const boundValues = bounds({
|
|
267
|
+
id: sharedBoundTag,
|
|
260
268
|
method: focused ? "content" : "transform",
|
|
261
269
|
scaleMode: "uniform",
|
|
262
270
|
raw: true,
|
|
@@ -265,6 +273,7 @@ export const SharedIGImage = (
|
|
|
265
273
|
// focused specific animations
|
|
266
274
|
if (focused) {
|
|
267
275
|
const maskedValues = bounds({
|
|
276
|
+
id: sharedBoundTag,
|
|
268
277
|
space: "absolute",
|
|
269
278
|
target: "fullscreen",
|
|
270
279
|
method: "size",
|
|
@@ -309,7 +318,7 @@ export const SharedIGImage = (
|
|
|
309
318
|
contentStyle: {
|
|
310
319
|
pointerEvents: current.gesture.isDismissing ? "none" : "auto",
|
|
311
320
|
},
|
|
312
|
-
[
|
|
321
|
+
[sharedBoundTag]: {
|
|
313
322
|
transform: [
|
|
314
323
|
{ translateX: dragX || 0 },
|
|
315
324
|
{ translateY: dragY || 0 },
|
|
@@ -345,9 +354,12 @@ export const SharedIGImage = (
|
|
|
345
354
|
};
|
|
346
355
|
};
|
|
347
356
|
|
|
348
|
-
export const SharedAppleMusic = (
|
|
349
|
-
|
|
350
|
-
|
|
357
|
+
export const SharedAppleMusic = ({
|
|
358
|
+
sharedBoundTag,
|
|
359
|
+
...config
|
|
360
|
+
}: Partial<ScreenTransitionConfig> & {
|
|
361
|
+
sharedBoundTag: string;
|
|
362
|
+
}): ScreenTransitionConfig => {
|
|
351
363
|
return {
|
|
352
364
|
enableTransitions: true,
|
|
353
365
|
gestureEnabled: true,
|
|
@@ -355,7 +367,6 @@ export const SharedAppleMusic = (
|
|
|
355
367
|
gestureDrivesProgress: false,
|
|
356
368
|
screenStyleInterpolator: ({
|
|
357
369
|
bounds,
|
|
358
|
-
activeBoundId,
|
|
359
370
|
focused,
|
|
360
371
|
progress,
|
|
361
372
|
layouts: { screen },
|
|
@@ -395,6 +406,7 @@ export const SharedAppleMusic = (
|
|
|
395
406
|
const dragYScale = interpolate(normY, [0, 1], yScaleOuput);
|
|
396
407
|
|
|
397
408
|
const boundValues = bounds({
|
|
409
|
+
id: sharedBoundTag,
|
|
398
410
|
method: focused ? "content" : "transform",
|
|
399
411
|
anchor: "top",
|
|
400
412
|
scaleMode: "uniform",
|
|
@@ -415,6 +427,7 @@ export const SharedAppleMusic = (
|
|
|
415
427
|
*/
|
|
416
428
|
if (focused) {
|
|
417
429
|
const maskedValues = bounds({
|
|
430
|
+
id: sharedBoundTag,
|
|
418
431
|
space: "absolute",
|
|
419
432
|
method: "size",
|
|
420
433
|
target: "fullscreen",
|
|
@@ -501,7 +514,7 @@ export const SharedAppleMusic = (
|
|
|
501
514
|
const contentScale = interpolate(progress, [1, 2], [1, 0.9], "clamp");
|
|
502
515
|
|
|
503
516
|
return {
|
|
504
|
-
[
|
|
517
|
+
[sharedBoundTag]: {
|
|
505
518
|
transform: [
|
|
506
519
|
{ translateX: dragX || 0 },
|
|
507
520
|
{ translateY: dragY || 0 },
|
|
@@ -527,7 +540,7 @@ export const SharedAppleMusic = (
|
|
|
527
540
|
damping: 500,
|
|
528
541
|
mass: 3,
|
|
529
542
|
overshootClamping: true,
|
|
530
|
-
//@ts-expect-error
|
|
543
|
+
//@ts-expect-error - Should not lead to any issues
|
|
531
544
|
restSpeedThreshold: 0.02,
|
|
532
545
|
},
|
|
533
546
|
close: {
|
|
@@ -535,7 +548,7 @@ export const SharedAppleMusic = (
|
|
|
535
548
|
damping: 60,
|
|
536
549
|
mass: 4,
|
|
537
550
|
overshootClamping: false,
|
|
538
|
-
//@ts-expect-error
|
|
551
|
+
//@ts-expect-error - Should not lead to any issues
|
|
539
552
|
restSpeedThreshold: 0.02,
|
|
540
553
|
restDisplacementThreshold: 0.002,
|
|
541
554
|
},
|
|
@@ -544,17 +557,20 @@ export const SharedAppleMusic = (
|
|
|
544
557
|
};
|
|
545
558
|
};
|
|
546
559
|
|
|
547
|
-
export const SharedXImage = (
|
|
548
|
-
|
|
549
|
-
|
|
560
|
+
export const SharedXImage = ({
|
|
561
|
+
sharedBoundTag,
|
|
562
|
+
...config
|
|
563
|
+
}: Partial<ScreenTransitionConfig> & {
|
|
564
|
+
sharedBoundTag: string;
|
|
565
|
+
}): ScreenTransitionConfig => {
|
|
550
566
|
return {
|
|
567
|
+
//@ts-expect-error - Should not lead to any issues
|
|
551
568
|
enableTransitions: true,
|
|
552
569
|
gestureEnabled: true,
|
|
553
570
|
gestureDirection: ["vertical", "vertical-inverted"],
|
|
554
571
|
gestureDrivesProgress: false,
|
|
555
572
|
screenStyleInterpolator: ({
|
|
556
573
|
focused,
|
|
557
|
-
activeBoundId,
|
|
558
574
|
bounds,
|
|
559
575
|
current,
|
|
560
576
|
layouts: { screen },
|
|
@@ -565,7 +581,11 @@ export const SharedXImage = (
|
|
|
565
581
|
// twitter doesn't animate the unfocused screen
|
|
566
582
|
if (!focused) return {};
|
|
567
583
|
|
|
568
|
-
const boundValues = bounds({
|
|
584
|
+
const boundValues = bounds({
|
|
585
|
+
id: sharedBoundTag,
|
|
586
|
+
method: "transform",
|
|
587
|
+
raw: true,
|
|
588
|
+
});
|
|
569
589
|
|
|
570
590
|
// content styles
|
|
571
591
|
const dragY = interpolate(
|
|
@@ -596,7 +616,7 @@ export const SharedXImage = (
|
|
|
596
616
|
const scaleY = !current.closing ? boundValues.scaleY : 1;
|
|
597
617
|
|
|
598
618
|
return {
|
|
599
|
-
[
|
|
619
|
+
[sharedBoundTag]: {
|
|
600
620
|
transform: [
|
|
601
621
|
{
|
|
602
622
|
translateX: x,
|
package/src/shared/constants.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { ParamListBase, RouteProp } from "@react-navigation/native";
|
|
2
2
|
import type { MeasuredDimensions } from "react-native-reanimated";
|
|
3
|
-
import type { ScreenTransitionState } from "./types/animation";
|
|
4
|
-
import type { BoundEntry } from "./types/bounds";
|
|
5
|
-
import type { Layout } from "./types/core";
|
|
6
|
-
import type { ActivationArea } from "./types/gesture";
|
|
7
|
-
import type { Complete } from "./types/utils";
|
|
8
|
-
import type { BoundsBuilderOptions } from "./utils/bounds/
|
|
3
|
+
import type { ScreenTransitionState } from "./types/animation.types";
|
|
4
|
+
import type { BoundEntry } from "./types/bounds.types";
|
|
5
|
+
import type { Layout } from "./types/core.types";
|
|
6
|
+
import type { ActivationArea } from "./types/gesture.types";
|
|
7
|
+
import type { Complete } from "./types/utils.types";
|
|
8
|
+
import type { BoundsBuilderOptions } from "./utils/bounds/types/builder";
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Masked view integration
|
|
@@ -35,7 +35,6 @@ export const DEFAULT_SCREEN_TRANSITION_STATE: ScreenTransitionState =
|
|
|
35
35
|
isDragging: 0,
|
|
36
36
|
direction: null,
|
|
37
37
|
},
|
|
38
|
-
bounds: {} as Record<string, BoundEntry>,
|
|
39
38
|
route: {} as RouteProp<ParamListBase>,
|
|
40
39
|
});
|
|
41
40
|
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
useSharedValue,
|
|
6
6
|
} from "react-native-reanimated";
|
|
7
7
|
import { NO_STYLES } from "../../constants";
|
|
8
|
-
import { useTransitionStyles } from "../../providers/transition-styles";
|
|
8
|
+
import { useTransitionStyles } from "../../providers/transition-styles.provider";
|
|
9
9
|
|
|
10
10
|
type Props = {
|
|
11
11
|
id?: string;
|
|
@@ -16,14 +16,12 @@ type Props = {
|
|
|
16
16
|
* This hook is used to get the associated styles for a given styleId / boundTag.
|
|
17
17
|
*/
|
|
18
18
|
export const useAssociatedStyles = ({ id }: Props = {}) => {
|
|
19
|
-
const { stylesMap } = useTransitionStyles();
|
|
19
|
+
const { stylesMap, ancestorStylesMaps } = useTransitionStyles();
|
|
20
20
|
const showAfterFirstFrame = useSharedValue(false);
|
|
21
21
|
|
|
22
22
|
useDerivedValue(() => {
|
|
23
23
|
"worklet";
|
|
24
24
|
|
|
25
|
-
// If the associated styles have already been shown, return.
|
|
26
|
-
|
|
27
25
|
if (!id) {
|
|
28
26
|
showAfterFirstFrame.value = true;
|
|
29
27
|
return;
|
|
@@ -39,10 +37,18 @@ export const useAssociatedStyles = ({ id }: Props = {}) => {
|
|
|
39
37
|
const associatedStyles = useAnimatedStyle(() => {
|
|
40
38
|
"worklet";
|
|
41
39
|
|
|
42
|
-
if (!id
|
|
40
|
+
if (!id) {
|
|
43
41
|
return NO_STYLES;
|
|
44
42
|
}
|
|
45
|
-
|
|
43
|
+
|
|
44
|
+
// Check local styles first, then fall back to parent
|
|
45
|
+
const ownStyle = stylesMap.value[id];
|
|
46
|
+
|
|
47
|
+
const ancestorStyle = ancestorStylesMaps.find(
|
|
48
|
+
(ancestorMap) => ancestorMap.value[id],
|
|
49
|
+
)?.value[id];
|
|
50
|
+
|
|
51
|
+
const base = ownStyle || ancestorStyle || NO_STYLES;
|
|
46
52
|
|
|
47
53
|
let opacity = 1;
|
|
48
54
|
|
|
@@ -50,13 +56,10 @@ export const useAssociatedStyles = ({ id }: Props = {}) => {
|
|
|
50
56
|
opacity = base.opacity as number;
|
|
51
57
|
}
|
|
52
58
|
|
|
53
|
-
// Only force opacity to 0 during the initial frame; once ready,
|
|
54
|
-
// return base unchanged so we never override user-provided opacity.
|
|
55
59
|
if (!showAfterFirstFrame.value) {
|
|
56
60
|
return { ...base, opacity: 0 };
|
|
57
61
|
}
|
|
58
62
|
|
|
59
|
-
// Since opacity exists on the base style, we don't need to override it.
|
|
60
63
|
if ("opacity" in base) {
|
|
61
64
|
return base;
|
|
62
65
|
}
|
|
@@ -3,19 +3,19 @@ import { useMemo } from "react";
|
|
|
3
3
|
import { useWindowDimensions } from "react-native";
|
|
4
4
|
import { type SharedValue, useDerivedValue } from "react-native-reanimated";
|
|
5
5
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
6
|
-
|
|
6
|
+
import type { NativeStackScreenTransitionConfig } from "../../../native-stack/types";
|
|
7
|
+
import { DEFAULT_SCREEN_TRANSITION_STATE } from "../../constants";
|
|
7
8
|
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
} from "../../
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import { BoundStore } from "../../stores/bound-store";
|
|
14
|
-
import { GestureStore, type GestureStoreMap } from "../../stores/gesture-store";
|
|
9
|
+
type TransitionDescriptor,
|
|
10
|
+
useKeys,
|
|
11
|
+
} from "../../providers/keys.provider";
|
|
12
|
+
import { AnimationStore } from "../../stores/animation.store";
|
|
13
|
+
import { GestureStore, type GestureStoreMap } from "../../stores/gesture.store";
|
|
15
14
|
import type {
|
|
16
15
|
ScreenInterpolationProps,
|
|
17
16
|
ScreenTransitionState,
|
|
18
|
-
} from "../../types/animation";
|
|
17
|
+
} from "../../types/animation.types";
|
|
18
|
+
import type { ScreenTransitionConfig } from "../../types/core.types";
|
|
19
19
|
import { derivations } from "../../utils/animation/derivations";
|
|
20
20
|
import { createBounds } from "../../utils/bounds";
|
|
21
21
|
|
|
@@ -47,7 +47,6 @@ const unwrap = (
|
|
|
47
47
|
isDragging: s.gesture.isDragging.value,
|
|
48
48
|
direction: s.gesture.direction.value,
|
|
49
49
|
},
|
|
50
|
-
bounds: BoundStore.getBounds(key) || NO_BOUNDS_MAP,
|
|
51
50
|
route: s.route,
|
|
52
51
|
};
|
|
53
52
|
};
|
|
@@ -70,6 +69,11 @@ const useBuildScreenTransitionState = (
|
|
|
70
69
|
}, [key, descriptor?.route]);
|
|
71
70
|
};
|
|
72
71
|
|
|
72
|
+
const hasTransitionsEnabled = (options?: ScreenTransitionConfig) => {
|
|
73
|
+
"worklet";
|
|
74
|
+
return !!(options as NativeStackScreenTransitionConfig)?.enableTransitions;
|
|
75
|
+
};
|
|
76
|
+
|
|
73
77
|
export function _useScreenAnimation() {
|
|
74
78
|
const dimensions = useWindowDimensions();
|
|
75
79
|
const insets = useSafeAreaInsets();
|
|
@@ -91,7 +95,7 @@ export function _useScreenAnimation() {
|
|
|
91
95
|
|
|
92
96
|
const previous = unwrap(prevAnimation, previousDescriptor?.route.key);
|
|
93
97
|
|
|
94
|
-
const next = nextDescriptor?.options
|
|
98
|
+
const next = hasTransitionsEnabled(nextDescriptor?.options)
|
|
95
99
|
? unwrap(nextAnimation, nextDescriptor?.route.key)
|
|
96
100
|
: undefined;
|
|
97
101
|
|
|
@@ -99,17 +103,9 @@ export function _useScreenAnimation() {
|
|
|
99
103
|
unwrap(currentAnimation, currentDescriptor?.route.key) ??
|
|
100
104
|
DEFAULT_SCREEN_TRANSITION_STATE;
|
|
101
105
|
|
|
102
|
-
const {
|
|
103
|
-
progress,
|
|
104
|
-
focused,
|
|
105
|
-
activeBoundId,
|
|
106
|
-
active,
|
|
107
|
-
isActiveTransitioning,
|
|
108
|
-
isDismissing,
|
|
109
|
-
} = derivations({
|
|
106
|
+
const helpers = derivations({
|
|
110
107
|
current,
|
|
111
108
|
next,
|
|
112
|
-
previous,
|
|
113
109
|
});
|
|
114
110
|
|
|
115
111
|
return {
|
|
@@ -118,13 +114,7 @@ export function _useScreenAnimation() {
|
|
|
118
114
|
previous,
|
|
119
115
|
current,
|
|
120
116
|
next,
|
|
121
|
-
|
|
122
|
-
activeBoundId,
|
|
123
|
-
progress,
|
|
124
|
-
|
|
125
|
-
active,
|
|
126
|
-
isActiveTransitioning,
|
|
127
|
-
isDismissing,
|
|
117
|
+
...helpers,
|
|
128
118
|
};
|
|
129
119
|
});
|
|
130
120
|
|
|
@@ -21,12 +21,12 @@ import {
|
|
|
21
21
|
import type {
|
|
22
22
|
GestureContextType,
|
|
23
23
|
ScrollConfig,
|
|
24
|
-
} from "../../providers/gestures";
|
|
25
|
-
import { useKeys } from "../../providers/keys";
|
|
26
|
-
import { AnimationStore } from "../../stores/animation
|
|
27
|
-
import { GestureStore, type GestureStoreMap } from "../../stores/gesture
|
|
24
|
+
} from "../../providers/gestures.provider";
|
|
25
|
+
import { useKeys } from "../../providers/keys.provider";
|
|
26
|
+
import { AnimationStore } from "../../stores/animation.store";
|
|
27
|
+
import { GestureStore, type GestureStoreMap } from "../../stores/gesture.store";
|
|
28
28
|
|
|
29
|
-
import { type GestureDirection, GestureOffsetState } from "../../types/gesture";
|
|
29
|
+
import { type GestureDirection, GestureOffsetState } from "../../types/gesture.types";
|
|
30
30
|
import { startScreenTransition } from "../../utils/animation/start-screen-transition";
|
|
31
31
|
import { applyOffsetRules } from "../../utils/gesture/check-gesture-activation";
|
|
32
32
|
import { determineDismissal } from "../../utils/gesture/determine-dismissal";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { LayoutChangeEvent } from "react-native";
|
|
2
2
|
import { useAnimatedScrollHandler } from "react-native-reanimated";
|
|
3
3
|
import type { ReanimatedScrollEvent } from "react-native-reanimated/lib/typescript/hook/commonTypes";
|
|
4
|
-
import { useGestureContext } from "../../providers/gestures";
|
|
5
|
-
import type { Any } from "../../types/utils";
|
|
4
|
+
import { useGestureContext } from "../../providers/gestures.provider";
|
|
5
|
+
import type { Any } from "../../types/utils.types";
|
|
6
6
|
import useStableCallback from "../use-stable-callback";
|
|
7
7
|
|
|
8
8
|
interface ScrollProgressHookProps {
|
package/src/shared/index.ts
CHANGED
|
@@ -25,5 +25,5 @@ export type {
|
|
|
25
25
|
OverlayInterpolationProps,
|
|
26
26
|
ScreenInterpolationProps,
|
|
27
27
|
ScreenStyleInterpolator,
|
|
28
|
-
} from "./types/animation";
|
|
29
|
-
export type { ScreenTransitionConfig } from "./types/core";
|
|
28
|
+
} from "./types/animation.types";
|
|
29
|
+
export type { ScreenTransitionConfig } from "./types/core.types";
|
|
@@ -5,7 +5,7 @@ import { GestureDetector } from "react-native-gesture-handler";
|
|
|
5
5
|
import type { SharedValue } from "react-native-reanimated";
|
|
6
6
|
import { useSharedValue } from "react-native-reanimated";
|
|
7
7
|
import { useBuildGestures } from "../hooks/gestures/use-build-gestures";
|
|
8
|
-
import type { GestureStoreMap } from "../stores/gesture
|
|
8
|
+
import type { GestureStoreMap } from "../stores/gesture.store";
|
|
9
9
|
|
|
10
10
|
export type ScrollConfig = {
|
|
11
11
|
x: number;
|
|
@@ -5,7 +5,7 @@ import type {
|
|
|
5
5
|
RouteProp,
|
|
6
6
|
} from "@react-navigation/native";
|
|
7
7
|
import { createContext, useContext, useMemo } from "react";
|
|
8
|
-
import type { ScreenTransitionConfig } from "../types/core";
|
|
8
|
+
import type { ScreenTransitionConfig } from "../types/core.types";
|
|
9
9
|
|
|
10
10
|
export type TransitionDescriptor = Descriptor<
|
|
11
11
|
ScreenTransitionConfig,
|