react-native-screen-transitions 3.0.0-beta.10 → 3.0.0-beta.11
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 +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 +37 -40
- 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 +0 -7
- package/lib/commonjs/blank-stack/index.js.map +1 -1
- package/lib/commonjs/native-stack/views/NativeStackView.native.js +2 -2
- 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 +207 -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} +7 -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 +1 -1
- 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 +37 -40
- 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 +0 -1
- package/lib/module/blank-stack/index.js.map +1 -1
- package/lib/module/native-stack/views/NativeStackView.native.js +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 +202 -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} +6 -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/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 +0 -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/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 +17 -11
- 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 +1 -1
- package/src/blank-stack/components/Screens.tsx +1 -1
- package/src/blank-stack/components/StackView.tsx +45 -48
- package/src/blank-stack/hooks/use-overlay-animation.tsx +4 -4
- package/src/blank-stack/index.ts +0 -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 +1 -1
- 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 +8 -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 +284 -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} +13 -14
- 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/blank-stack/providers/blank-stack-state.js +0 -65
- package/lib/commonjs/blank-stack/providers/blank-stack-state.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/providers/blank-stack-state.js +0 -59
- package/lib/module/blank-stack/providers/blank-stack-state.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/providers/blank-stack-state.d.ts +0 -13
- package/lib/typescript/blank-stack/providers/blank-stack-state.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/blank-stack/providers/blank-stack-state.tsx +0 -90
- 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,161 +0,0 @@
|
|
|
1
|
-
import type { ScreenTransitionState } from "../../types/animation";
|
|
2
|
-
|
|
3
|
-
type GetCache = (fromKey: string, toKey: string) => string | null;
|
|
4
|
-
type SetCache = (fromKey: string, toKey: string, id: string) => void;
|
|
5
|
-
type GetRouteActive = (routeKey: string) => string | null;
|
|
6
|
-
|
|
7
|
-
interface ResolveActiveBoundParams {
|
|
8
|
-
current: ScreenTransitionState;
|
|
9
|
-
next?: ScreenTransitionState;
|
|
10
|
-
previous?: ScreenTransitionState;
|
|
11
|
-
getPairCache: GetCache;
|
|
12
|
-
setPairCache: SetCache;
|
|
13
|
-
getRouteActive: GetRouteActive;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export function pairKey(fromKey?: string, toKey?: string) {
|
|
17
|
-
"worklet";
|
|
18
|
-
return fromKey && toKey ? `${fromKey}|${toKey}` : "";
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
const hasBound = (s: ScreenTransitionState | undefined, id?: string | null) => {
|
|
22
|
-
"worklet";
|
|
23
|
-
return !!id && !!s && !!s.bounds && !!s.bounds[id];
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
const getRoutePair = (
|
|
27
|
-
current: ScreenTransitionState,
|
|
28
|
-
next: ScreenTransitionState | undefined,
|
|
29
|
-
previous: ScreenTransitionState | undefined,
|
|
30
|
-
) => {
|
|
31
|
-
"worklet";
|
|
32
|
-
const isClosing = !!next;
|
|
33
|
-
const fromKey = isClosing ? current.route.key : previous?.route.key;
|
|
34
|
-
const toKey = isClosing ? next?.route.key : current.route.key;
|
|
35
|
-
const other = next ?? previous;
|
|
36
|
-
return { fromKey, toKey, other } as const;
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
const resolveFromPairCache = (
|
|
40
|
-
fromKey: string | undefined,
|
|
41
|
-
toKey: string | undefined,
|
|
42
|
-
other: ScreenTransitionState | undefined,
|
|
43
|
-
getPairCache: GetCache,
|
|
44
|
-
) => {
|
|
45
|
-
"worklet";
|
|
46
|
-
if (fromKey && toKey) {
|
|
47
|
-
const cached = getPairCache(fromKey, toKey);
|
|
48
|
-
if (hasBound(other, cached)) return cached as string;
|
|
49
|
-
}
|
|
50
|
-
return "";
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
const resolveFromRequested = (
|
|
54
|
-
reqId: string | null,
|
|
55
|
-
current: ScreenTransitionState,
|
|
56
|
-
other: ScreenTransitionState | undefined,
|
|
57
|
-
) => {
|
|
58
|
-
"worklet";
|
|
59
|
-
if (hasBound(other, reqId)) return reqId as string;
|
|
60
|
-
if (hasBound(current, reqId)) return reqId as string;
|
|
61
|
-
return "";
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
const resolveFromInteresection = (
|
|
65
|
-
current: ScreenTransitionState,
|
|
66
|
-
other: ScreenTransitionState | undefined,
|
|
67
|
-
fromKey: string | undefined,
|
|
68
|
-
getRouteActive: GetRouteActive,
|
|
69
|
-
) => {
|
|
70
|
-
"worklet";
|
|
71
|
-
if (!other) return "";
|
|
72
|
-
const a = Object.keys(current.bounds);
|
|
73
|
-
const b = Object.keys(other.bounds);
|
|
74
|
-
const inter = a.filter((k) => b.includes(k));
|
|
75
|
-
const otherHasAny = b.length > 0;
|
|
76
|
-
const routeActive = fromKey ? getRouteActive(fromKey) : null;
|
|
77
|
-
|
|
78
|
-
if (inter.length > 0) {
|
|
79
|
-
if (routeActive && inter.includes(routeActive)) return routeActive;
|
|
80
|
-
return inter[0];
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
if (routeActive && hasBound(other, routeActive)) return routeActive;
|
|
84
|
-
if (b.length === 1) return b[0];
|
|
85
|
-
|
|
86
|
-
if (!otherHasAny) {
|
|
87
|
-
if (routeActive && hasBound(current, routeActive)) return routeActive;
|
|
88
|
-
if (a.length === 1) return a[0];
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
return "";
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
* Util function to get the active bound id for a given transition state.
|
|
96
|
-
*
|
|
97
|
-
* It will check by ( priority from highest to lowest ):
|
|
98
|
-
* 1. Requested id
|
|
99
|
-
* 2. Cache
|
|
100
|
-
* 3. Intersection
|
|
101
|
-
*/
|
|
102
|
-
export function resolveActiveBound({
|
|
103
|
-
current,
|
|
104
|
-
next,
|
|
105
|
-
previous,
|
|
106
|
-
getPairCache,
|
|
107
|
-
setPairCache,
|
|
108
|
-
getRouteActive,
|
|
109
|
-
}: ResolveActiveBoundParams) {
|
|
110
|
-
"worklet";
|
|
111
|
-
const { fromKey, toKey, other } = getRoutePair(current, next, previous);
|
|
112
|
-
|
|
113
|
-
// Resolve requested from per-route most recently used (last active bound by route)
|
|
114
|
-
const requestedId = fromKey ? getRouteActive(fromKey) : null;
|
|
115
|
-
const byRequested = resolveFromRequested(requestedId, current, other);
|
|
116
|
-
if (byRequested) {
|
|
117
|
-
if (
|
|
118
|
-
fromKey &&
|
|
119
|
-
toKey &&
|
|
120
|
-
hasBound(current, byRequested) &&
|
|
121
|
-
hasBound(other, byRequested)
|
|
122
|
-
) {
|
|
123
|
-
setPairCache(fromKey, toKey, byRequested);
|
|
124
|
-
}
|
|
125
|
-
return byRequested;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
const byPairCache = resolveFromPairCache(fromKey, toKey, other, getPairCache);
|
|
129
|
-
if (byPairCache) {
|
|
130
|
-
if (
|
|
131
|
-
fromKey &&
|
|
132
|
-
toKey &&
|
|
133
|
-
hasBound(current, byPairCache) &&
|
|
134
|
-
hasBound(other, byPairCache)
|
|
135
|
-
) {
|
|
136
|
-
setPairCache(fromKey, toKey, byPairCache);
|
|
137
|
-
}
|
|
138
|
-
return byPairCache;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
const byIntersection = resolveFromInteresection(
|
|
142
|
-
current,
|
|
143
|
-
other,
|
|
144
|
-
fromKey,
|
|
145
|
-
getRouteActive,
|
|
146
|
-
);
|
|
147
|
-
|
|
148
|
-
if (byIntersection) {
|
|
149
|
-
if (
|
|
150
|
-
fromKey &&
|
|
151
|
-
toKey &&
|
|
152
|
-
hasBound(current, byIntersection) &&
|
|
153
|
-
hasBound(other, byIntersection)
|
|
154
|
-
) {
|
|
155
|
-
setPairCache(fromKey, toKey, byIntersection);
|
|
156
|
-
}
|
|
157
|
-
return byIntersection;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
return "";
|
|
161
|
-
}
|
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
type MeasuredDimensions,
|
|
3
|
-
makeMutable,
|
|
4
|
-
type StyleProps,
|
|
5
|
-
} from "react-native-reanimated";
|
|
6
|
-
import type { ScreenTransitionState } from "../../types/animation";
|
|
7
|
-
import type { ScreenKey } from "../../types/core";
|
|
8
|
-
import type { Any } from "../../types/utils";
|
|
9
|
-
import { pairKey, resolveActiveBound } from "./_utils";
|
|
10
|
-
|
|
11
|
-
type BoundsDict = Record<
|
|
12
|
-
string,
|
|
13
|
-
Record<string, { bounds: MeasuredDimensions; styles: StyleProps }>
|
|
14
|
-
>;
|
|
15
|
-
|
|
16
|
-
const registry = makeMutable<BoundsDict>({});
|
|
17
|
-
const pairCache = makeMutable<Record<string, string>>({});
|
|
18
|
-
const lastActiveByRoute = makeMutable<Record<string, string>>({});
|
|
19
|
-
|
|
20
|
-
function setBounds(
|
|
21
|
-
screenId: string,
|
|
22
|
-
boundId: string,
|
|
23
|
-
bounds: MeasuredDimensions | null = null,
|
|
24
|
-
styles: StyleProps = {},
|
|
25
|
-
) {
|
|
26
|
-
"worklet";
|
|
27
|
-
registry.modify((state: Any) => {
|
|
28
|
-
"worklet";
|
|
29
|
-
if (!state[screenId]) {
|
|
30
|
-
state[screenId] = {};
|
|
31
|
-
}
|
|
32
|
-
state[screenId][boundId] = { bounds, styles };
|
|
33
|
-
|
|
34
|
-
return state;
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
function getBounds(screenId: string) {
|
|
39
|
-
"worklet";
|
|
40
|
-
return registry.value[screenId] ?? {};
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
function setRouteActive(routeKey: string, boundId: string) {
|
|
44
|
-
"worklet";
|
|
45
|
-
lastActiveByRoute.modify((state: Any) => {
|
|
46
|
-
"worklet";
|
|
47
|
-
state[routeKey] = boundId;
|
|
48
|
-
return state;
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
function getRouteActive(routeKey: string) {
|
|
53
|
-
"worklet";
|
|
54
|
-
return lastActiveByRoute.value[routeKey] ?? null;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
function setPairCache(fromKey: string, toKey: string, boundId: string) {
|
|
58
|
-
"worklet";
|
|
59
|
-
const key = pairKey(fromKey, toKey);
|
|
60
|
-
if (!key) return;
|
|
61
|
-
pairCache.modify((state: Any) => {
|
|
62
|
-
"worklet";
|
|
63
|
-
state[key] = boundId;
|
|
64
|
-
return state;
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
function getPairCache(fromKey: string, toKey: string) {
|
|
69
|
-
"worklet";
|
|
70
|
-
const key = pairKey(fromKey, toKey);
|
|
71
|
-
if (!key) return null;
|
|
72
|
-
return pairCache.value[key] ?? null;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
function clear(routeKey: ScreenKey) {
|
|
76
|
-
"worklet";
|
|
77
|
-
registry.modify((state) => {
|
|
78
|
-
"worklet";
|
|
79
|
-
delete state[routeKey];
|
|
80
|
-
return state;
|
|
81
|
-
});
|
|
82
|
-
lastActiveByRoute.modify((state) => {
|
|
83
|
-
"worklet";
|
|
84
|
-
if (state[routeKey]) delete state[routeKey];
|
|
85
|
-
return state;
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
pairCache.modify((state) => {
|
|
89
|
-
"worklet";
|
|
90
|
-
const keys = Object.keys(state);
|
|
91
|
-
for (let i = 0; i < keys.length; i++) {
|
|
92
|
-
const k = keys[i];
|
|
93
|
-
const [from, to] = k.split("|");
|
|
94
|
-
if (from === routeKey || to === routeKey) {
|
|
95
|
-
delete state[k];
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
return state;
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
function debugBoundStore() {
|
|
103
|
-
"worklet";
|
|
104
|
-
console.log("[BoundStore] registry keys:", Object.keys(registry.value));
|
|
105
|
-
console.log(
|
|
106
|
-
"[BoundStore] registry size:",
|
|
107
|
-
Object.keys(registry.value).length,
|
|
108
|
-
);
|
|
109
|
-
console.log("[BoundStore] pairCache keys:", Object.keys(pairCache.value));
|
|
110
|
-
console.log(
|
|
111
|
-
"[BoundStore] pairCache size:",
|
|
112
|
-
Object.keys(pairCache.value).length,
|
|
113
|
-
);
|
|
114
|
-
console.log(
|
|
115
|
-
"[BoundStore] lastActiveByRoute keys:",
|
|
116
|
-
Object.keys(lastActiveByRoute.value),
|
|
117
|
-
);
|
|
118
|
-
console.log(
|
|
119
|
-
"[BoundStore] lastActiveByRoute size:",
|
|
120
|
-
Object.keys(lastActiveByRoute.value).length,
|
|
121
|
-
);
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
function getActiveBound(
|
|
125
|
-
current: ScreenTransitionState,
|
|
126
|
-
next: ScreenTransitionState | undefined,
|
|
127
|
-
previous: ScreenTransitionState | undefined,
|
|
128
|
-
) {
|
|
129
|
-
"worklet";
|
|
130
|
-
return resolveActiveBound({
|
|
131
|
-
current,
|
|
132
|
-
next,
|
|
133
|
-
previous,
|
|
134
|
-
getPairCache,
|
|
135
|
-
setPairCache,
|
|
136
|
-
getRouteActive,
|
|
137
|
-
});
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
export const BoundStore = {
|
|
141
|
-
setBounds,
|
|
142
|
-
getBounds,
|
|
143
|
-
setRouteActive,
|
|
144
|
-
getRouteActive,
|
|
145
|
-
clear,
|
|
146
|
-
getActiveBound,
|
|
147
|
-
debugBoundStore,
|
|
148
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { NativeStackDescriptor } from "../../../native-stack/types";
|
|
2
|
-
import { AnimationStore } from "../animation-store";
|
|
3
|
-
import { BoundStore } from "../bound-store";
|
|
4
|
-
import { GestureStore } from "../gesture-store";
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Reset all stores for a given screen
|
|
8
|
-
*/
|
|
9
|
-
export const resetStoresForScreen = (current: NativeStackDescriptor) => {
|
|
10
|
-
AnimationStore.clear(current.route.key);
|
|
11
|
-
GestureStore.clear(current.route.key);
|
|
12
|
-
BoundStore.clear(current.route.key);
|
|
13
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { ScreenTransitionState } from "../../../types/animation";
|
|
2
|
-
import type { ScreenPhase } from "../../../types/core";
|
|
3
|
-
|
|
4
|
-
export type GetBoundsParams = {
|
|
5
|
-
id: string | null;
|
|
6
|
-
phase?: ScreenPhase;
|
|
7
|
-
previous?: ScreenTransitionState;
|
|
8
|
-
current: ScreenTransitionState;
|
|
9
|
-
next?: ScreenTransitionState;
|
|
10
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export function flattenStyle<TStyleProp>(style: TStyleProp): TStyleProp {
|
|
2
|
-
"worklet";
|
|
3
|
-
if (style === null || typeof style !== "object") {
|
|
4
|
-
return style;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
if (!Array.isArray(style)) {
|
|
8
|
-
return style;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
const result: { [key: string]: TStyleProp } = {};
|
|
12
|
-
for (let i = 0, styleLength = style.length; i < styleLength; ++i) {
|
|
13
|
-
const computedStyle = flattenStyle(style[i]);
|
|
14
|
-
if (computedStyle) {
|
|
15
|
-
for (const key in computedStyle) {
|
|
16
|
-
result[key] = computedStyle[key];
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
return result as TStyleProp;
|
|
21
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import type { BoundEntry } from "../../../types/bounds";
|
|
2
|
-
|
|
3
|
-
import type { GetBoundsParams } from "../_types/get-bounds";
|
|
4
|
-
|
|
5
|
-
const fallbackBounds = {
|
|
6
|
-
bounds: {
|
|
7
|
-
width: 0,
|
|
8
|
-
height: 0,
|
|
9
|
-
x: 0,
|
|
10
|
-
y: 0,
|
|
11
|
-
pageX: 0,
|
|
12
|
-
pageY: 0,
|
|
13
|
-
},
|
|
14
|
-
styles: {},
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export const getBounds = (props: GetBoundsParams): BoundEntry => {
|
|
18
|
-
"worklet";
|
|
19
|
-
const boundId = props.id;
|
|
20
|
-
const phase = props.phase;
|
|
21
|
-
|
|
22
|
-
if (phase && boundId) {
|
|
23
|
-
const phaseMap = {
|
|
24
|
-
current: props.current?.bounds[boundId],
|
|
25
|
-
next: props.next?.bounds[boundId],
|
|
26
|
-
previous: props.previous?.bounds[boundId],
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
const phaseBounds = phaseMap[phase];
|
|
30
|
-
|
|
31
|
-
if (!phaseBounds) {
|
|
32
|
-
return fallbackBounds;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
return {
|
|
36
|
-
bounds: phaseBounds.bounds,
|
|
37
|
-
styles: phaseBounds?.styles,
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
if (!props.next && boundId) {
|
|
42
|
-
const previousBounds = props.previous?.bounds[boundId];
|
|
43
|
-
|
|
44
|
-
return previousBounds || fallbackBounds;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
if (boundId) {
|
|
48
|
-
const nextBounds = props.next?.bounds[boundId];
|
|
49
|
-
|
|
50
|
-
return nextBounds || fallbackBounds;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
return fallbackBounds;
|
|
54
|
-
};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/lib/module/shared/hooks/{use-shared-value-state.js → reanimated/use-shared-value-state.js}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/src/shared/hooks/{use-shared-value-state.ts → reanimated/use-shared-value-state.ts}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|