react-native-screen-transitions 3.0.0-beta.9 → 3.0.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +60 -5
- package/lib/commonjs/blank-stack/components/Overlay.js +7 -4
- 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 +4 -4
- 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/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 +20 -9
- 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 +10 -25
- 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 +7 -4
- 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 +3 -3
- 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/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 +20 -9
- 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 +7 -22
- 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 +2 -2
- package/lib/typescript/blank-stack/types.d.ts.map +1 -1
- package/lib/typescript/native-stack/types.d.ts +1 -1
- 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 +25 -19
- 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 -3
- 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 +5 -2
- 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 +4 -4
- package/src/blank-stack/index.ts +1 -1
- package/src/blank-stack/types.ts +2 -2
- package/src/native-stack/types.ts +1 -1
- 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 +31 -17
- 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 +8 -26
- 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} +10 -2
- 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/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/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/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/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/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/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/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
|
@@ -1,38 +1,34 @@
|
|
|
1
1
|
import { createContext, useContext, useMemo } from "react";
|
|
2
|
-
import { useDerivedValue } from "react-native-reanimated";
|
|
2
|
+
import { type SharedValue, useDerivedValue } from "react-native-reanimated";
|
|
3
3
|
import { NO_STYLES } from "../constants";
|
|
4
4
|
import { _useScreenAnimation } from "../hooks/animation/use-screen-animation";
|
|
5
|
-
import type { TransitionInterpolatedStyle } from "../types/animation";
|
|
5
|
+
import type { TransitionInterpolatedStyle } from "../types/animation.types";
|
|
6
6
|
import { createBounds } from "../utils/bounds";
|
|
7
7
|
|
|
8
8
|
type Props = {
|
|
9
9
|
children: React.ReactNode;
|
|
10
10
|
};
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
type TransitionStylesContextValue = {
|
|
13
|
+
stylesMap: SharedValue<TransitionInterpolatedStyle>;
|
|
14
|
+
ancestorStylesMaps: SharedValue<TransitionInterpolatedStyle>[];
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export const TransitionStylesContext =
|
|
18
|
+
createContext<TransitionStylesContextValue | null>(null);
|
|
17
19
|
|
|
18
20
|
export function TransitionStylesProvider({ children }: Props) {
|
|
21
|
+
const parentCtx = useContext(TransitionStylesContext);
|
|
22
|
+
|
|
19
23
|
const { screenInterpolatorProps, screenStyleInterpolator } =
|
|
20
24
|
_useScreenAnimation();
|
|
21
25
|
|
|
22
26
|
const stylesMap = useDerivedValue<TransitionInterpolatedStyle>(() => {
|
|
23
27
|
"worklet";
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* ### Maintainer note
|
|
27
|
-
*
|
|
28
|
-
* From my understanding, reanimated will serialize the DerivedValue result. Thus resulting in us receiving a `bounds is not a function, it is an object` error. We'll build the bounds function inside here (the final step) and pass it alongside the interpolator instead.
|
|
29
|
-
*/
|
|
30
28
|
const props = screenInterpolatorProps.value;
|
|
31
|
-
|
|
32
29
|
const bounds = createBounds(props);
|
|
33
30
|
try {
|
|
34
31
|
if (!screenStyleInterpolator) return NO_STYLES;
|
|
35
|
-
|
|
36
32
|
return screenStyleInterpolator({
|
|
37
33
|
...props,
|
|
38
34
|
bounds,
|
|
@@ -49,10 +45,16 @@ export function TransitionStylesProvider({ children }: Props) {
|
|
|
49
45
|
});
|
|
50
46
|
|
|
51
47
|
const value = useMemo(() => {
|
|
48
|
+
// Build ancestor chain: [parent, grandparent, great-grandparent, ...]
|
|
49
|
+
const ancestorStylesMaps = parentCtx
|
|
50
|
+
? [parentCtx.stylesMap, ...parentCtx.ancestorStylesMaps]
|
|
51
|
+
: [];
|
|
52
|
+
|
|
52
53
|
return {
|
|
53
54
|
stylesMap,
|
|
55
|
+
ancestorStylesMaps,
|
|
54
56
|
};
|
|
55
|
-
}, [stylesMap]);
|
|
57
|
+
}, [stylesMap, parentCtx]);
|
|
56
58
|
|
|
57
59
|
return (
|
|
58
60
|
<TransitionStylesContext.Provider value={value}>
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type MeasuredDimensions,
|
|
3
|
+
makeMutable,
|
|
4
|
+
type StyleProps,
|
|
5
|
+
} from "react-native-reanimated";
|
|
6
|
+
import type { Any } from "../types/utils.types";
|
|
7
|
+
|
|
8
|
+
type TagID = string;
|
|
9
|
+
type ScreenKey = string;
|
|
10
|
+
|
|
11
|
+
export type TagData = {
|
|
12
|
+
bounds: MeasuredDimensions;
|
|
13
|
+
styles: StyleProps;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
type ScreenIdentifier = {
|
|
17
|
+
screenKey: ScreenKey;
|
|
18
|
+
parentScreenKey?: ScreenKey;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
type TagLink = {
|
|
22
|
+
source: ScreenIdentifier & TagData;
|
|
23
|
+
destination: (ScreenIdentifier & TagData) | null;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
type TagState = {
|
|
27
|
+
occurrences: Record<ScreenKey, TagData>;
|
|
28
|
+
linkStack: TagLink[];
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Note on cleanup: We intentionally skip automatic cleanup of old links.
|
|
33
|
+
* The linkStack grows by one entry per navigation, but `getActiveLink`
|
|
34
|
+
* finds the correct link via screenKey matching regardless of stack size.
|
|
35
|
+
* This is unlikely to cause performance issues in typical apps, but if
|
|
36
|
+
* memory becomes a concern in apps with heavy navigation (hundreds of
|
|
37
|
+
* transitions), we should consider implementing cleanup on screen unmount using
|
|
38
|
+
* screenKey filtering.
|
|
39
|
+
*/
|
|
40
|
+
|
|
41
|
+
const registry = makeMutable<Record<TagID, TagState>>({});
|
|
42
|
+
|
|
43
|
+
function registerOccurrence(
|
|
44
|
+
tag: TagID,
|
|
45
|
+
screenKey: ScreenKey,
|
|
46
|
+
bounds: MeasuredDimensions,
|
|
47
|
+
styles: StyleProps = {},
|
|
48
|
+
) {
|
|
49
|
+
"worklet";
|
|
50
|
+
registry.modify((state: Any) => {
|
|
51
|
+
"worklet";
|
|
52
|
+
if (!state[tag]) {
|
|
53
|
+
state[tag] = { occurrences: {}, linkStack: [] };
|
|
54
|
+
}
|
|
55
|
+
state[tag].occurrences[screenKey] = { bounds, styles };
|
|
56
|
+
return state;
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function setLinkSource(
|
|
61
|
+
tag: TagID,
|
|
62
|
+
screenKey: ScreenKey,
|
|
63
|
+
bounds: MeasuredDimensions,
|
|
64
|
+
styles: StyleProps = {},
|
|
65
|
+
parentScreenKey?: ScreenKey,
|
|
66
|
+
) {
|
|
67
|
+
"worklet";
|
|
68
|
+
registry.modify((state: Any) => {
|
|
69
|
+
"worklet";
|
|
70
|
+
if (!state[tag]) state[tag] = { occurrences: {}, linkStack: [] };
|
|
71
|
+
|
|
72
|
+
// Push new link onto stack
|
|
73
|
+
state[tag].linkStack.push({
|
|
74
|
+
source: { screenKey, parentScreenKey, bounds, styles },
|
|
75
|
+
destination: null,
|
|
76
|
+
});
|
|
77
|
+
return state;
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function setLinkDestination(
|
|
82
|
+
tag: TagID,
|
|
83
|
+
screenKey: ScreenKey,
|
|
84
|
+
bounds: MeasuredDimensions,
|
|
85
|
+
styles: StyleProps = {},
|
|
86
|
+
parentScreenKey?: ScreenKey,
|
|
87
|
+
) {
|
|
88
|
+
"worklet";
|
|
89
|
+
registry.modify((state: Any) => {
|
|
90
|
+
"worklet";
|
|
91
|
+
const stack = state[tag]?.linkStack;
|
|
92
|
+
if (!stack || stack.length === 0) return state;
|
|
93
|
+
|
|
94
|
+
// Find the topmost link without a destination
|
|
95
|
+
for (let i = stack.length - 1; i >= 0; i--) {
|
|
96
|
+
if (stack[i].destination === null) {
|
|
97
|
+
stack[i].destination = { screenKey, parentScreenKey, bounds, styles };
|
|
98
|
+
break;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
return state;
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
function getOccurrence(tag: TagID, key: ScreenKey) {
|
|
106
|
+
"worklet";
|
|
107
|
+
return registry.value[tag]?.occurrences[key] ?? null;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// Helper to check if a screen identifier matches a given key
|
|
111
|
+
function matchesScreenKey(
|
|
112
|
+
identifier: ScreenIdentifier | null | undefined,
|
|
113
|
+
key: ScreenKey,
|
|
114
|
+
): boolean {
|
|
115
|
+
"worklet";
|
|
116
|
+
if (!identifier) return false;
|
|
117
|
+
return identifier.screenKey === key || identifier.parentScreenKey === key;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function getActiveLink(tag: TagID, screenKey?: ScreenKey, isClosing?: boolean) {
|
|
121
|
+
"worklet";
|
|
122
|
+
const stack = registry.value[tag]?.linkStack;
|
|
123
|
+
|
|
124
|
+
if (!stack || stack.length === 0) {
|
|
125
|
+
return null;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// If screenKey provided, find link involving that screen
|
|
129
|
+
if (screenKey) {
|
|
130
|
+
// When closing (backward nav), we want the link where this screen is the DESTINATION
|
|
131
|
+
// When opening (forward nav), we want the link where this screen is the DESTINATION too
|
|
132
|
+
// The source is always the "from" screen, destination is the "to" screen
|
|
133
|
+
|
|
134
|
+
if (isClosing) {
|
|
135
|
+
// Backward: find link where I am the destination (I'm going back to source)
|
|
136
|
+
for (let i = stack.length - 1; i >= 0; i--) {
|
|
137
|
+
const link = stack[i];
|
|
138
|
+
if (matchesScreenKey(link.destination, screenKey)) {
|
|
139
|
+
return link;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
// Forward or fallback: find any link involving this screen
|
|
145
|
+
for (let i = stack.length - 1; i >= 0; i--) {
|
|
146
|
+
const link = stack[i];
|
|
147
|
+
if (
|
|
148
|
+
matchesScreenKey(link.source, screenKey) ||
|
|
149
|
+
matchesScreenKey(link.destination, screenKey)
|
|
150
|
+
) {
|
|
151
|
+
return link;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
return null;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
return stack[stack.length - 1] ?? null;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
export const BoundStore = {
|
|
161
|
+
registerOccurrence,
|
|
162
|
+
setLinkSource,
|
|
163
|
+
setLinkDestination,
|
|
164
|
+
getActiveLink,
|
|
165
|
+
getOccurrence,
|
|
166
|
+
};
|
|
@@ -3,8 +3,8 @@ import {
|
|
|
3
3
|
makeMutable,
|
|
4
4
|
type SharedValue,
|
|
5
5
|
} from "react-native-reanimated";
|
|
6
|
-
import type { ScreenKey } from "../types/core";
|
|
7
|
-
import type { GestureDirection } from "../types/gesture";
|
|
6
|
+
import type { ScreenKey } from "../types/core.types";
|
|
7
|
+
import type { GestureDirection } from "../types/gesture.types";
|
|
8
8
|
|
|
9
9
|
export type GestureKey =
|
|
10
10
|
| "x"
|
|
@@ -5,14 +5,16 @@ import type {
|
|
|
5
5
|
WithTimingConfig,
|
|
6
6
|
} from "react-native-reanimated";
|
|
7
7
|
import type { EdgeInsets } from "react-native-safe-area-context";
|
|
8
|
-
import type {
|
|
9
|
-
import type { Layout } from "./core";
|
|
10
|
-
import type { GestureValues } from "./gesture";
|
|
8
|
+
import type { BoundsAccessor } from "./bounds.types";
|
|
9
|
+
import type { Layout } from "./core.types";
|
|
10
|
+
import type { GestureValues } from "./gesture.types";
|
|
11
11
|
|
|
12
12
|
export interface OverlayInterpolationProps {
|
|
13
13
|
progress: number;
|
|
14
14
|
layouts: {
|
|
15
|
-
/**
|
|
15
|
+
/**
|
|
16
|
+
* The `width` and `height` of the screen container.
|
|
17
|
+
*/
|
|
16
18
|
screen: Layout;
|
|
17
19
|
};
|
|
18
20
|
insets: EdgeInsets;
|
|
@@ -23,37 +25,74 @@ export type ScreenTransitionState = {
|
|
|
23
25
|
closing: number;
|
|
24
26
|
animating: number;
|
|
25
27
|
gesture: GestureValues;
|
|
26
|
-
bounds: Record<string, BoundEntry>;
|
|
27
28
|
route: RouteProp<ParamListBase>;
|
|
28
29
|
};
|
|
29
30
|
|
|
30
31
|
export interface ScreenInterpolationProps {
|
|
31
|
-
/**
|
|
32
|
+
/**
|
|
33
|
+
* Values for the screen that came before the current one in the navigation stack.
|
|
34
|
+
*/
|
|
32
35
|
previous: ScreenTransitionState | undefined;
|
|
33
|
-
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Values for the current screen being interpolated.
|
|
39
|
+
*/
|
|
34
40
|
current: ScreenTransitionState;
|
|
35
|
-
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Values for the screen that comes after the current one in the navigation stack.
|
|
44
|
+
*/
|
|
36
45
|
next: ScreenTransitionState | undefined;
|
|
37
|
-
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Layout measurements for the screen.
|
|
49
|
+
*/
|
|
38
50
|
layouts: {
|
|
39
|
-
/**
|
|
51
|
+
/**
|
|
52
|
+
* The `width` and `height` of the screen container.
|
|
53
|
+
*/
|
|
40
54
|
screen: Layout;
|
|
41
55
|
};
|
|
42
|
-
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* The safe area insets for the screen.
|
|
59
|
+
*/
|
|
43
60
|
insets: EdgeInsets;
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* The ID of the currently active shared bound (e.g., 'a' when Transition.Pressable has sharedBoundTag='a').
|
|
64
|
+
* @deprecated
|
|
65
|
+
*/
|
|
66
|
+
activeBoundId?: never;
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Whether the current screen is the focused (topmost) screen in the stack.
|
|
70
|
+
*/
|
|
47
71
|
focused: boolean;
|
|
48
|
-
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Combined progress of current and next screen transitions, ranging from 0-2.
|
|
75
|
+
*/
|
|
49
76
|
progress: number;
|
|
50
|
-
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Function that provides access to bounds builders for creating shared element transitions.
|
|
80
|
+
*/
|
|
51
81
|
bounds: BoundsAccessor;
|
|
52
|
-
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* The screen state that is currently driving the transition (either current or next, whichever is focused).
|
|
85
|
+
*/
|
|
53
86
|
active: ScreenTransitionState;
|
|
54
|
-
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Whether the active screen is currently transitioning (either being dragged or animating).
|
|
90
|
+
*/
|
|
55
91
|
isActiveTransitioning: boolean;
|
|
56
|
-
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Whether the active screen is in the process of being dismissed/closed.
|
|
95
|
+
*/
|
|
57
96
|
isDismissing: boolean;
|
|
58
97
|
}
|
|
59
98
|
|
|
@@ -66,10 +105,12 @@ export type TransitionInterpolatedStyle = {
|
|
|
66
105
|
* Animated style for the main screen view. Styles are only applied when Transition.View is present.
|
|
67
106
|
*/
|
|
68
107
|
contentStyle?: StyleProps;
|
|
108
|
+
|
|
69
109
|
/**
|
|
70
110
|
* Animated style for a semi-transparent overlay. Styles are only applied when Transition.View is present.
|
|
71
111
|
*/
|
|
72
112
|
overlayStyle?: StyleProps;
|
|
113
|
+
|
|
73
114
|
/**
|
|
74
115
|
* Define your own custom styles by using an id as the key: [id]: StyleProps
|
|
75
116
|
*/
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { MeasuredDimensions, StyleProps } from "react-native-reanimated";
|
|
2
|
+
import type { TagData } from "../stores/bounds.store";
|
|
2
3
|
import type {
|
|
3
4
|
BoundsBuilderOptions,
|
|
4
5
|
BoundsReturnType,
|
|
5
|
-
} from "../utils/bounds/
|
|
6
|
-
import type { ScreenPhase } from "./core";
|
|
6
|
+
} from "../utils/bounds/types/builder";
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Target style computation.
|
|
@@ -21,5 +21,5 @@ export type BoundEntry = {
|
|
|
21
21
|
|
|
22
22
|
export type BoundsAccessor = {
|
|
23
23
|
<T extends BoundsBuilderOptions>(options: T): BoundsReturnType<T>;
|
|
24
|
-
|
|
24
|
+
getOccurrence: (id: string, key: string) => TagData;
|
|
25
25
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AnimatedProps } from "react-native-reanimated";
|
|
2
|
-
import type { ScreenStyleInterpolator, TransitionSpec } from "./animation";
|
|
3
|
-
import type { GestureActivationArea, GestureDirection } from "./gesture";
|
|
2
|
+
import type { ScreenStyleInterpolator, TransitionSpec } from "./animation.types";
|
|
3
|
+
import type { GestureActivationArea, GestureDirection } from "./gesture.types";
|
|
4
4
|
|
|
5
5
|
export type Layout = {
|
|
6
6
|
width: number;
|
|
@@ -62,34 +62,42 @@ export type ScreenTransitionConfig = {
|
|
|
62
62
|
* The user-provided function to calculate styles based on animation progress.
|
|
63
63
|
*/
|
|
64
64
|
screenStyleInterpolator?: ScreenStyleInterpolator;
|
|
65
|
+
|
|
65
66
|
/**
|
|
66
67
|
* The Reanimated animation config for opening and closing transitions.
|
|
67
68
|
*/
|
|
68
69
|
transitionSpec?: TransitionSpec;
|
|
70
|
+
|
|
69
71
|
/**
|
|
70
72
|
* Whether the gesture is enabled.
|
|
71
73
|
*/
|
|
72
74
|
gestureEnabled?: boolean;
|
|
75
|
+
|
|
73
76
|
/**
|
|
74
77
|
* The direction of the swipe gesture used to dismiss the screen.
|
|
75
78
|
*/
|
|
76
79
|
gestureDirection?: GestureDirection | GestureDirection[];
|
|
80
|
+
|
|
77
81
|
/**
|
|
78
82
|
* How much the gesture's final velocity impacts the dismiss decision.
|
|
79
83
|
*/
|
|
80
84
|
gestureVelocityImpact?: number;
|
|
85
|
+
|
|
81
86
|
/**
|
|
82
87
|
* Distance threshold for gesture recognition throughout the screen.
|
|
83
88
|
*/
|
|
84
89
|
gestureResponseDistance?: number;
|
|
90
|
+
|
|
85
91
|
/**
|
|
86
92
|
* Whether the gesture drives the progress.
|
|
87
93
|
*/
|
|
88
94
|
gestureDrivesProgress?: boolean;
|
|
95
|
+
|
|
89
96
|
/**
|
|
90
97
|
* The area of the screen where the gesture is activated.
|
|
91
98
|
*/
|
|
92
99
|
gestureActivationArea?: GestureActivationArea;
|
|
100
|
+
|
|
93
101
|
/**
|
|
94
102
|
* Whether to enable transitions. It sets the presentation to containedTransparentModal, animation none, and headerShown to false.
|
|
95
103
|
*/
|
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { ScreenTransitionState } from "../../types/animation";
|
|
1
|
+
import type { ScreenTransitionState } from "../../types/animation.types";
|
|
3
2
|
|
|
4
3
|
interface DerivationsParams {
|
|
5
4
|
current: ScreenTransitionState;
|
|
6
5
|
next?: ScreenTransitionState;
|
|
7
|
-
previous?: ScreenTransitionState;
|
|
8
6
|
}
|
|
9
7
|
|
|
10
8
|
/**
|
|
11
9
|
* Additional values to help make defining animations easier.
|
|
12
10
|
*/
|
|
13
|
-
export const derivations = ({ current, next
|
|
11
|
+
export const derivations = ({ current, next }: DerivationsParams) => {
|
|
14
12
|
"worklet";
|
|
15
13
|
|
|
16
14
|
// The combined progress
|
|
@@ -26,13 +24,9 @@ export const derivations = ({ current, next, previous }: DerivationsParams) => {
|
|
|
26
24
|
|
|
27
25
|
const isDismissing = !!(active.gesture.isDismissing || active.closing);
|
|
28
26
|
|
|
29
|
-
// The active bound id
|
|
30
|
-
const activeBoundId = BoundStore.getActiveBound(current, next, previous);
|
|
31
|
-
|
|
32
27
|
return {
|
|
33
28
|
progress,
|
|
34
29
|
focused,
|
|
35
|
-
activeBoundId,
|
|
36
30
|
active,
|
|
37
31
|
isActiveTransitioning,
|
|
38
32
|
isDismissing,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { runOnJS } from "react-native-reanimated";
|
|
2
|
-
import type { AnimationStoreMap } from "../../stores/animation
|
|
3
|
-
import type { TransitionSpec } from "../../types/animation";
|
|
2
|
+
import type { AnimationStoreMap } from "../../stores/animation.store";
|
|
3
|
+
import type { TransitionSpec } from "../../types/animation.types";
|
|
4
4
|
import { animate } from "./animate";
|
|
5
5
|
|
|
6
6
|
interface StartScreenTransitionProps {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { MeasuredDimensions } from "react-native-reanimated";
|
|
2
|
-
import type { Layout } from "../../types/core";
|
|
3
|
-
import type { Complete } from "../../types/utils";
|
|
4
|
-
import type { BoundsBuilderOptions } from "./
|
|
2
|
+
import type { Layout } from "../../types/core.types";
|
|
3
|
+
import type { Complete } from "../../types/utils.types";
|
|
4
|
+
import type { BoundsBuilderOptions } from "./types/builder";
|
|
5
5
|
|
|
6
6
|
export const FULLSCREEN_DIMENSIONS = (
|
|
7
7
|
dimensions: Layout,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { MeasuredDimensions } from "react-native-reanimated";
|
|
2
|
-
import type { Layout } from "../../../types/core";
|
|
3
|
-
import type { BoundsAnchor, BoundsScaleMode } from "../
|
|
2
|
+
import type { Layout } from "../../../types/core.types";
|
|
3
|
+
import type { BoundsAnchor, BoundsScaleMode } from "../types/builder";
|
|
4
4
|
import type {
|
|
5
5
|
ContentTransformGeometry,
|
|
6
6
|
RelativeGeometry,
|
|
7
|
-
} from "../
|
|
7
|
+
} from "../types/geometry";
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Get the anchor point coordinates for a given bound
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { MeasuredDimensions } from "react-native-reanimated";
|
|
2
|
-
import { BoundStore } from "../../../stores/
|
|
2
|
+
import { BoundStore } from "../../../stores/bounds.store";
|
|
3
3
|
|
|
4
4
|
export const isBoundsEqual = ({
|
|
5
5
|
measured,
|
|
@@ -11,9 +11,9 @@ export const isBoundsEqual = ({
|
|
|
11
11
|
sharedBoundTag: string;
|
|
12
12
|
}) => {
|
|
13
13
|
"worklet";
|
|
14
|
-
const existing = BoundStore.
|
|
14
|
+
const existing = BoundStore.getOccurrence(sharedBoundTag, key)?.bounds;
|
|
15
15
|
return (
|
|
16
|
-
existing &&
|
|
16
|
+
!!existing &&
|
|
17
17
|
existing.width === measured.width &&
|
|
18
18
|
existing.height === measured.height &&
|
|
19
19
|
existing.pageX === measured.pageX &&
|
|
@@ -3,11 +3,11 @@ import {
|
|
|
3
3
|
type MeasuredDimensions,
|
|
4
4
|
type StyleProps,
|
|
5
5
|
} from "react-native-reanimated";
|
|
6
|
-
import type { BoundsBuilderOptions } from "../
|
|
6
|
+
import type { BoundsBuilderOptions } from "../types/builder";
|
|
7
7
|
import type {
|
|
8
8
|
ContentTransformGeometry,
|
|
9
9
|
RelativeGeometry,
|
|
10
|
-
} from "../
|
|
10
|
+
} from "../types/geometry";
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* Element-level (relative) params shared by size/transform composers.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ImageStyle, StyleProp, TextStyle, ViewStyle } from "react-native";
|
|
2
2
|
import { isSharedValue } from "react-native-reanimated";
|
|
3
|
-
import type { Any } from "../../../types/utils";
|
|
3
|
+
import type { Any } from "../../../types/utils.types";
|
|
4
4
|
|
|
5
5
|
type AnyStyle = ViewStyle | TextStyle | ImageStyle;
|
|
6
6
|
type StyleValue = StyleProp<AnyStyle>;
|