react-native-screen-transitions 3.8.0-beta.0 → 3.8.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/shared/animation/snap-to.js +1 -1
- package/lib/commonjs/shared/animation/snap-to.js.map +1 -1
- package/lib/commonjs/shared/components/activity/variants/activity-screen.js +10 -2
- package/lib/commonjs/shared/components/activity/variants/activity-screen.js.map +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-initial-destination-measurement.js +2 -2
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-initial-destination-measurement.js.map +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-refresh-boundary.js +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-refresh-boundary.js.map +1 -1
- package/lib/commonjs/shared/components/overlay/variations/float-overlay.js +9 -6
- package/lib/commonjs/shared/components/overlay/variations/float-overlay.js.map +1 -1
- package/lib/commonjs/shared/components/screen-container/hooks/use-content-layout.js +2 -2
- package/lib/commonjs/shared/components/screen-container/hooks/use-content-layout.js.map +1 -1
- package/lib/commonjs/shared/components/screen-container/layers/backdrop.js +1 -1
- package/lib/commonjs/shared/components/screen-container/layers/backdrop.js.map +1 -1
- package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-open-transition-intent.js +2 -2
- package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-open-transition-intent.js.map +1 -1
- package/lib/commonjs/shared/configs/presets.js +5 -8
- package/lib/commonjs/shared/configs/presets.js.map +1 -1
- package/lib/commonjs/shared/constants.js +18 -2
- package/lib/commonjs/shared/constants.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/animation/helpers/build-screen-transition-options.js +2 -8
- package/lib/commonjs/shared/providers/screen/animation/helpers/build-screen-transition-options.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/animation/helpers/hydrate-transition-state/gesture-progress.js +26 -31
- package/lib/commonjs/shared/providers/screen/animation/helpers/hydrate-transition-state/gesture-progress.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/animation/helpers/hydrate-transition-state/index.js +29 -4
- package/lib/commonjs/shared/providers/screen/animation/helpers/hydrate-transition-state/index.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/animation/helpers/pipeline.js +3 -3
- package/lib/commonjs/shared/providers/screen/animation/helpers/pipeline.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/animation/helpers/stack-progress.js +3 -3
- package/lib/commonjs/shared/providers/screen/animation/helpers/stack-progress.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/animation/helpers/use-build-transition-state.js +2 -2
- package/lib/commonjs/shared/providers/screen/animation/helpers/use-build-transition-state.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/gestures.provider.js +6 -7
- package/lib/commonjs/shared/providers/screen/gestures/gestures.provider.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/hooks/use-stable-runtime-config.js +3 -7
- package/lib/commonjs/shared/providers/screen/gestures/hooks/use-stable-runtime-config.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/pan/activation/pan-activation-decision.js +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/pan/activation/pan-activation-decision.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/pan/activation/use-pan-activation.js +7 -4
- package/lib/commonjs/shared/providers/screen/gestures/pan/activation/use-pan-activation.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/pan/behavior/pan-lifecycle.js +20 -36
- package/lib/commonjs/shared/providers/screen/gestures/pan/behavior/pan-lifecycle.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/pan/behavior/pan-release.js +12 -21
- package/lib/commonjs/shared/providers/screen/gestures/pan/behavior/pan-release.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/pan/behavior/pan-reset.js +40 -39
- package/lib/commonjs/shared/providers/screen/gestures/pan/behavior/pan-reset.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.js +11 -21
- package/lib/commonjs/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/pan/use-build-pan-gesture.js +4 -11
- package/lib/commonjs/shared/providers/screen/gestures/pan/use-build-pan-gesture.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/pinch/activation/use-pinch-activation.js +12 -10
- package/lib/commonjs/shared/providers/screen/gestures/pinch/activation/use-pinch-activation.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.js +13 -10
- package/lib/commonjs/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/pinch/behavior/pinch-release.js +15 -11
- package/lib/commonjs/shared/providers/screen/gestures/pinch/behavior/pinch-release.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/pinch/behavior/pinch-reset.js +28 -23
- package/lib/commonjs/shared/providers/screen/gestures/pinch/behavior/pinch-reset.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/pinch/behavior/use-pinch-behavior.js +3 -3
- package/lib/commonjs/shared/providers/screen/gestures/pinch/behavior/use-pinch-behavior.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/pinch/use-build-pinch-gesture.js +4 -11
- package/lib/commonjs/shared/providers/screen/gestures/pinch/use-build-pinch-gesture.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/rotation/activation/use-rotation-activation.js +12 -10
- package/lib/commonjs/shared/providers/screen/gestures/rotation/activation/use-rotation-activation.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/rotation/use-build-rotation-gesture.js +3 -10
- package/lib/commonjs/shared/providers/screen/gestures/rotation/use-build-rotation-gesture.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/shared/physics.js +23 -23
- package/lib/commonjs/shared/providers/screen/gestures/shared/physics.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/shared/policy.js +0 -11
- package/lib/commonjs/shared/providers/screen/gestures/shared/policy.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/shared/reset.js +17 -10
- package/lib/commonjs/shared/providers/screen/gestures/shared/reset.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/shared/snap-points.js +6 -7
- package/lib/commonjs/shared/providers/screen/gestures/shared/snap-points.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/shared/snapshot.js +32 -0
- package/lib/commonjs/shared/providers/screen/gestures/shared/snapshot.js.map +1 -0
- package/lib/commonjs/shared/providers/screen/gestures/shared/values.js +65 -0
- package/lib/commonjs/shared/providers/screen/gestures/shared/values.js.map +1 -0
- package/lib/commonjs/shared/providers/screen/gestures/types.js +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/types.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/options/helpers.js +1 -19
- package/lib/commonjs/shared/providers/screen/options/helpers.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js +8 -8
- package/lib/commonjs/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js +2 -2
- package/lib/commonjs/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js.map +1 -1
- package/lib/commonjs/shared/stores/animation.store.js +6 -6
- package/lib/commonjs/shared/stores/animation.store.js.map +1 -1
- package/lib/commonjs/shared/stores/gesture.store.js +56 -0
- package/lib/commonjs/shared/stores/gesture.store.js.map +1 -1
- package/lib/commonjs/shared/types/gesture.types.js +6 -0
- package/lib/commonjs/shared/types/gesture.types.js.map +1 -1
- package/lib/commonjs/shared/utils/animation/animate-to-progress.js +3 -3
- package/lib/commonjs/shared/utils/animation/animate-to-progress.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/helpers/prepare-bound-styles.js +1 -1
- package/lib/commonjs/shared/utils/bounds/helpers/prepare-bound-styles.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/navigation/reveal/build.js +39 -34
- package/lib/commonjs/shared/utils/bounds/navigation/reveal/build.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/build.js +37 -28
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/build.js.map +1 -1
- package/lib/module/shared/animation/snap-to.js +1 -1
- package/lib/module/shared/animation/snap-to.js.map +1 -1
- package/lib/module/shared/components/activity/variants/activity-screen.js +10 -2
- package/lib/module/shared/components/activity/variants/activity-screen.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-initial-destination-measurement.js +2 -2
- package/lib/module/shared/components/create-boundary-component/hooks/use-initial-destination-measurement.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-refresh-boundary.js +1 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-refresh-boundary.js.map +1 -1
- package/lib/module/shared/components/overlay/variations/float-overlay.js +9 -6
- package/lib/module/shared/components/overlay/variations/float-overlay.js.map +1 -1
- package/lib/module/shared/components/screen-container/hooks/use-content-layout.js +2 -2
- package/lib/module/shared/components/screen-container/hooks/use-content-layout.js.map +1 -1
- package/lib/module/shared/components/screen-container/layers/backdrop.js +1 -1
- package/lib/module/shared/components/screen-container/layers/backdrop.js.map +1 -1
- package/lib/module/shared/components/screen-lifecycle/hooks/use-open-transition-intent.js +2 -2
- package/lib/module/shared/components/screen-lifecycle/hooks/use-open-transition-intent.js.map +1 -1
- package/lib/module/shared/configs/presets.js +5 -8
- package/lib/module/shared/configs/presets.js.map +1 -1
- package/lib/module/shared/constants.js +17 -1
- package/lib/module/shared/constants.js.map +1 -1
- package/lib/module/shared/providers/screen/animation/helpers/build-screen-transition-options.js +2 -8
- package/lib/module/shared/providers/screen/animation/helpers/build-screen-transition-options.js.map +1 -1
- package/lib/module/shared/providers/screen/animation/helpers/hydrate-transition-state/gesture-progress.js +25 -30
- package/lib/module/shared/providers/screen/animation/helpers/hydrate-transition-state/gesture-progress.js.map +1 -1
- package/lib/module/shared/providers/screen/animation/helpers/hydrate-transition-state/index.js +30 -5
- package/lib/module/shared/providers/screen/animation/helpers/hydrate-transition-state/index.js.map +1 -1
- package/lib/module/shared/providers/screen/animation/helpers/pipeline.js +3 -3
- package/lib/module/shared/providers/screen/animation/helpers/pipeline.js.map +1 -1
- package/lib/module/shared/providers/screen/animation/helpers/stack-progress.js +3 -3
- package/lib/module/shared/providers/screen/animation/helpers/stack-progress.js.map +1 -1
- package/lib/module/shared/providers/screen/animation/helpers/use-build-transition-state.js +2 -2
- package/lib/module/shared/providers/screen/animation/helpers/use-build-transition-state.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/gestures.provider.js +6 -7
- package/lib/module/shared/providers/screen/gestures/gestures.provider.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/hooks/use-stable-runtime-config.js +3 -7
- package/lib/module/shared/providers/screen/gestures/hooks/use-stable-runtime-config.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/pan/activation/pan-activation-decision.js +1 -1
- package/lib/module/shared/providers/screen/gestures/pan/activation/pan-activation-decision.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/pan/activation/use-pan-activation.js +7 -4
- package/lib/module/shared/providers/screen/gestures/pan/activation/use-pan-activation.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/pan/behavior/pan-lifecycle.js +20 -36
- package/lib/module/shared/providers/screen/gestures/pan/behavior/pan-lifecycle.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/pan/behavior/pan-release.js +12 -21
- package/lib/module/shared/providers/screen/gestures/pan/behavior/pan-release.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/pan/behavior/pan-reset.js +42 -41
- package/lib/module/shared/providers/screen/gestures/pan/behavior/pan-reset.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.js +11 -21
- package/lib/module/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/pan/use-build-pan-gesture.js +4 -11
- package/lib/module/shared/providers/screen/gestures/pan/use-build-pan-gesture.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/pinch/activation/use-pinch-activation.js +12 -10
- package/lib/module/shared/providers/screen/gestures/pinch/activation/use-pinch-activation.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.js +13 -10
- package/lib/module/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/pinch/behavior/pinch-release.js +16 -12
- package/lib/module/shared/providers/screen/gestures/pinch/behavior/pinch-release.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/pinch/behavior/pinch-reset.js +30 -25
- package/lib/module/shared/providers/screen/gestures/pinch/behavior/pinch-reset.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/pinch/behavior/use-pinch-behavior.js +3 -3
- package/lib/module/shared/providers/screen/gestures/pinch/behavior/use-pinch-behavior.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/pinch/use-build-pinch-gesture.js +4 -11
- package/lib/module/shared/providers/screen/gestures/pinch/use-build-pinch-gesture.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/rotation/activation/use-rotation-activation.js +12 -10
- package/lib/module/shared/providers/screen/gestures/rotation/activation/use-rotation-activation.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/rotation/use-build-rotation-gesture.js +3 -10
- package/lib/module/shared/providers/screen/gestures/rotation/use-build-rotation-gesture.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/shared/physics.js +21 -22
- package/lib/module/shared/providers/screen/gestures/shared/physics.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/shared/policy.js +1 -12
- package/lib/module/shared/providers/screen/gestures/shared/policy.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/shared/reset.js +17 -8
- package/lib/module/shared/providers/screen/gestures/shared/reset.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/shared/snap-points.js +6 -7
- package/lib/module/shared/providers/screen/gestures/shared/snap-points.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/shared/snapshot.js +27 -0
- package/lib/module/shared/providers/screen/gestures/shared/snapshot.js.map +1 -0
- package/lib/module/shared/providers/screen/gestures/shared/values.js +54 -0
- package/lib/module/shared/providers/screen/gestures/shared/values.js.map +1 -0
- package/lib/module/shared/providers/screen/gestures/types.js +1 -1
- package/lib/module/shared/providers/screen/gestures/types.js.map +1 -1
- package/lib/module/shared/providers/screen/options/helpers.js +2 -20
- package/lib/module/shared/providers/screen/options/helpers.js.map +1 -1
- package/lib/module/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js +8 -8
- package/lib/module/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js.map +1 -1
- package/lib/module/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js +2 -2
- package/lib/module/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js.map +1 -1
- package/lib/module/shared/stores/animation.store.js +6 -6
- package/lib/module/shared/stores/animation.store.js.map +1 -1
- package/lib/module/shared/stores/gesture.store.js +56 -0
- package/lib/module/shared/stores/gesture.store.js.map +1 -1
- package/lib/module/shared/types/animation.types.js.map +1 -1
- package/lib/module/shared/types/gesture.types.js +7 -0
- package/lib/module/shared/types/gesture.types.js.map +1 -1
- package/lib/module/shared/utils/animation/animate-to-progress.js +3 -3
- package/lib/module/shared/utils/animation/animate-to-progress.js.map +1 -1
- package/lib/module/shared/utils/bounds/helpers/prepare-bound-styles.js +1 -1
- package/lib/module/shared/utils/bounds/helpers/prepare-bound-styles.js.map +1 -1
- package/lib/module/shared/utils/bounds/navigation/reveal/build.js +39 -34
- package/lib/module/shared/utils/bounds/navigation/reveal/build.js.map +1 -1
- package/lib/module/shared/utils/bounds/navigation/zoom/build.js +37 -28
- package/lib/module/shared/utils/bounds/navigation/zoom/build.js.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-initial-destination-measurement.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-refresh-boundary.d.ts.map +1 -1
- package/lib/typescript/shared/components/overlay/variations/float-overlay.d.ts.map +1 -1
- package/lib/typescript/shared/configs/presets.d.ts.map +1 -1
- package/lib/typescript/shared/constants.d.ts +1 -2
- package/lib/typescript/shared/constants.d.ts.map +1 -1
- package/lib/typescript/shared/index.d.ts +1 -1
- package/lib/typescript/shared/index.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/animation/helpers/build-screen-transition-options.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/animation/helpers/hydrate-transition-state/gesture-progress.d.ts +7 -3
- package/lib/typescript/shared/providers/screen/animation/helpers/hydrate-transition-state/gesture-progress.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/animation/helpers/hydrate-transition-state/index.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/animation/helpers/hydrate-transition-state/types.d.ts +2 -2
- package/lib/typescript/shared/providers/screen/animation/helpers/hydrate-transition-state/types.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/animation/helpers/stack-progress.d.ts +1 -1
- package/lib/typescript/shared/providers/screen/animation/helpers/stack-progress.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/animation/helpers/use-build-transition-state.d.ts +2 -2
- package/lib/typescript/shared/providers/screen/animation/helpers/use-build-transition-state.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/gestures.provider.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/hooks/use-stable-runtime-config.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/pan/activation/use-pan-activation.d.ts +3 -3
- package/lib/typescript/shared/providers/screen/gestures/pan/activation/use-pan-activation.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/pan/behavior/pan-lifecycle.d.ts +2 -2
- package/lib/typescript/shared/providers/screen/gestures/pan/behavior/pan-lifecycle.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/pan/behavior/pan-release.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/pan/behavior/pan-reset.d.ts +3 -12
- package/lib/typescript/shared/providers/screen/gestures/pan/behavior/pan-reset.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.d.ts +2 -2
- package/lib/typescript/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/pan/use-build-pan-gesture.d.ts +3 -3
- package/lib/typescript/shared/providers/screen/gestures/pan/use-build-pan-gesture.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/pinch/activation/use-pinch-activation.d.ts +3 -3
- package/lib/typescript/shared/providers/screen/gestures/pinch/activation/use-pinch-activation.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/pinch/behavior/pinch-release.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/pinch/behavior/pinch-reset.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/pinch/behavior/use-pinch-behavior.d.ts +2 -2
- package/lib/typescript/shared/providers/screen/gestures/pinch/behavior/use-pinch-behavior.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/pinch/use-build-pinch-gesture.d.ts +3 -3
- package/lib/typescript/shared/providers/screen/gestures/pinch/use-build-pinch-gesture.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/rotation/activation/use-rotation-activation.d.ts +3 -3
- package/lib/typescript/shared/providers/screen/gestures/rotation/activation/use-rotation-activation.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/rotation/use-build-rotation-gesture.d.ts +3 -3
- package/lib/typescript/shared/providers/screen/gestures/rotation/use-build-rotation-gesture.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/shared/physics.d.ts +3 -3
- package/lib/typescript/shared/providers/screen/gestures/shared/physics.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/shared/policy.d.ts +1 -3
- package/lib/typescript/shared/providers/screen/gestures/shared/policy.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/shared/reset.d.ts +7 -4
- package/lib/typescript/shared/providers/screen/gestures/shared/reset.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/shared/snap-points.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/shared/snapshot.d.ts +7 -0
- package/lib/typescript/shared/providers/screen/gestures/shared/snapshot.d.ts.map +1 -0
- package/lib/typescript/shared/providers/screen/gestures/shared/values.d.ts +9 -0
- package/lib/typescript/shared/providers/screen/gestures/shared/values.d.ts.map +1 -0
- package/lib/typescript/shared/providers/screen/gestures/types.d.ts +6 -13
- package/lib/typescript/shared/providers/screen/gestures/types.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/options/helpers.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/options/types.d.ts +0 -2
- package/lib/typescript/shared/providers/screen/options/types.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/styles/hooks/use-maybe-block-visibility.d.ts.map +1 -1
- package/lib/typescript/shared/stores/animation.store.d.ts +4 -4
- package/lib/typescript/shared/stores/animation.store.d.ts.map +1 -1
- package/lib/typescript/shared/stores/gesture.store.d.ts +23 -0
- package/lib/typescript/shared/stores/gesture.store.d.ts.map +1 -1
- package/lib/typescript/shared/types/animation.types.d.ts +8 -0
- package/lib/typescript/shared/types/animation.types.d.ts.map +1 -1
- package/lib/typescript/shared/types/bounds.types.d.ts +12 -8
- package/lib/typescript/shared/types/bounds.types.d.ts.map +1 -1
- package/lib/typescript/shared/types/gesture.types.d.ts +47 -13
- package/lib/typescript/shared/types/gesture.types.d.ts.map +1 -1
- package/lib/typescript/shared/types/index.d.ts +1 -1
- package/lib/typescript/shared/types/index.d.ts.map +1 -1
- package/lib/typescript/shared/types/screen.types.d.ts +25 -8
- package/lib/typescript/shared/types/screen.types.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/navigation/reveal/build.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/navigation/zoom/build.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/types/options.d.ts +8 -0
- package/lib/typescript/shared/utils/bounds/types/options.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/shared/animation/snap-to.ts +1 -1
- package/src/shared/components/activity/variants/activity-screen.tsx +8 -2
- package/src/shared/components/create-boundary-component/hooks/use-initial-destination-measurement.ts +5 -2
- package/src/shared/components/create-boundary-component/hooks/use-refresh-boundary.ts +4 -1
- package/src/shared/components/overlay/variations/float-overlay.tsx +11 -5
- package/src/shared/components/screen-container/hooks/use-content-layout.ts +2 -2
- package/src/shared/components/screen-container/layers/backdrop.tsx +1 -1
- package/src/shared/components/screen-lifecycle/hooks/use-open-transition-intent.ts +2 -2
- package/src/shared/configs/presets.ts +6 -8
- package/src/shared/constants.ts +16 -6
- package/src/shared/index.ts +2 -0
- package/src/shared/providers/screen/animation/helpers/build-screen-transition-options.ts +2 -17
- package/src/shared/providers/screen/animation/helpers/hydrate-transition-state/gesture-progress.ts +54 -53
- package/src/shared/providers/screen/animation/helpers/hydrate-transition-state/index.ts +72 -8
- package/src/shared/providers/screen/animation/helpers/hydrate-transition-state/types.ts +2 -2
- package/src/shared/providers/screen/animation/helpers/pipeline.ts +3 -3
- package/src/shared/providers/screen/animation/helpers/stack-progress.ts +3 -3
- package/src/shared/providers/screen/animation/helpers/use-build-transition-state.ts +4 -4
- package/src/shared/providers/screen/gestures/gestures.provider.tsx +7 -9
- package/src/shared/providers/screen/gestures/hooks/use-stable-runtime-config.ts +2 -5
- package/src/shared/providers/screen/gestures/pan/activation/pan-activation-decision.ts +1 -1
- package/src/shared/providers/screen/gestures/pan/activation/use-pan-activation.ts +9 -7
- package/src/shared/providers/screen/gestures/pan/behavior/pan-lifecycle.ts +25 -38
- package/src/shared/providers/screen/gestures/pan/behavior/pan-release.ts +23 -25
- package/src/shared/providers/screen/gestures/pan/behavior/pan-reset.ts +45 -77
- package/src/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.ts +12 -20
- package/src/shared/providers/screen/gestures/pan/use-build-pan-gesture.ts +5 -11
- package/src/shared/providers/screen/gestures/pinch/activation/use-pinch-activation.ts +14 -16
- package/src/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.ts +13 -9
- package/src/shared/providers/screen/gestures/pinch/behavior/pinch-release.ts +31 -16
- package/src/shared/providers/screen/gestures/pinch/behavior/pinch-reset.ts +32 -41
- package/src/shared/providers/screen/gestures/pinch/behavior/use-pinch-behavior.ts +4 -4
- package/src/shared/providers/screen/gestures/pinch/use-build-pinch-gesture.ts +5 -10
- package/src/shared/providers/screen/gestures/rotation/activation/use-rotation-activation.ts +14 -13
- package/src/shared/providers/screen/gestures/rotation/use-build-rotation-gesture.ts +4 -9
- package/src/shared/providers/screen/gestures/shared/physics.ts +15 -32
- package/src/shared/providers/screen/gestures/shared/policy.ts +0 -15
- package/src/shared/providers/screen/gestures/shared/reset.ts +33 -11
- package/src/shared/providers/screen/gestures/shared/snap-points.ts +8 -7
- package/src/shared/providers/screen/gestures/shared/snapshot.ts +33 -0
- package/src/shared/providers/screen/gestures/shared/values.ts +52 -0
- package/src/shared/providers/screen/gestures/types.ts +4 -13
- package/src/shared/providers/screen/options/helpers.ts +0 -44
- package/src/shared/providers/screen/options/types.ts +0 -2
- package/src/shared/providers/screen/styles/hooks/use-interpolated-style-maps.tsx +8 -8
- package/src/shared/providers/screen/styles/hooks/use-maybe-block-visibility.tsx +3 -2
- package/src/shared/stores/animation.store.ts +8 -8
- package/src/shared/stores/gesture.store.ts +81 -0
- package/src/shared/types/animation.types.ts +9 -0
- package/src/shared/types/bounds.types.ts +12 -8
- package/src/shared/types/gesture.types.ts +48 -14
- package/src/shared/types/index.ts +2 -0
- package/src/shared/types/screen.types.ts +25 -8
- package/src/shared/utils/animation/animate-to-progress.ts +3 -3
- package/src/shared/utils/bounds/helpers/prepare-bound-styles.ts +1 -1
- package/src/shared/utils/bounds/navigation/reveal/build.ts +42 -46
- package/src/shared/utils/bounds/navigation/zoom/build.ts +36 -33
- package/src/shared/utils/bounds/types/options.ts +9 -0
- package/lib/commonjs/shared/providers/screen/gestures/hooks/use-gesture-builder-state.js +0 -32
- package/lib/commonjs/shared/providers/screen/gestures/hooks/use-gesture-builder-state.js.map +0 -1
- package/lib/commonjs/shared/utils/gesture-progress-mode.js +0 -50
- package/lib/commonjs/shared/utils/gesture-progress-mode.js.map +0 -1
- package/lib/module/shared/providers/screen/gestures/hooks/use-gesture-builder-state.js +0 -27
- package/lib/module/shared/providers/screen/gestures/hooks/use-gesture-builder-state.js.map +0 -1
- package/lib/module/shared/utils/gesture-progress-mode.js +0 -42
- package/lib/module/shared/utils/gesture-progress-mode.js.map +0 -1
- package/lib/typescript/shared/providers/screen/gestures/hooks/use-gesture-builder-state.d.ts +0 -21
- package/lib/typescript/shared/providers/screen/gestures/hooks/use-gesture-builder-state.d.ts.map +0 -1
- package/lib/typescript/shared/utils/gesture-progress-mode.d.ts +0 -14
- package/lib/typescript/shared/utils/gesture-progress-mode.d.ts.map +0 -1
- package/src/shared/providers/screen/gestures/hooks/use-gesture-builder-state.ts +0 -31
- package/src/shared/utils/gesture-progress-mode.ts +0 -67
|
@@ -6,21 +6,18 @@ import type {
|
|
|
6
6
|
import type { SharedValue } from "react-native-reanimated";
|
|
7
7
|
import type { ScreenOptionsContextValue } from "../../../options";
|
|
8
8
|
import { resolvePinchRuntime } from "../../shared/runtime";
|
|
9
|
-
import type {
|
|
10
|
-
GestureCompositionActivation,
|
|
11
|
-
PinchGestureRuntime,
|
|
12
|
-
} from "../../types";
|
|
9
|
+
import type { GestureCompositionOwner, PinchGestureRuntime } from "../../types";
|
|
13
10
|
|
|
14
11
|
interface UsePinchActivationProps {
|
|
15
12
|
runtime: SharedValue<PinchGestureRuntime>;
|
|
16
13
|
screenOptions: ScreenOptionsContextValue;
|
|
17
|
-
|
|
14
|
+
gestureCompositionOwner: SharedValue<GestureCompositionOwner>;
|
|
18
15
|
}
|
|
19
16
|
|
|
20
17
|
export const usePinchActivation = ({
|
|
21
18
|
runtime,
|
|
22
19
|
screenOptions,
|
|
23
|
-
|
|
20
|
+
gestureCompositionOwner,
|
|
24
21
|
}: UsePinchActivationProps) => {
|
|
25
22
|
const onTouchesDown = useCallback(
|
|
26
23
|
(
|
|
@@ -33,18 +30,15 @@ export const usePinchActivation = ({
|
|
|
33
30
|
screenOptions.get(),
|
|
34
31
|
);
|
|
35
32
|
|
|
36
|
-
if (gestureCompositionActivation.get() === "pan") {
|
|
37
|
-
stateManager?.fail();
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
33
|
if (!participation.canTrackGesture || !policy.enabled) {
|
|
42
34
|
stateManager?.fail();
|
|
43
35
|
return;
|
|
44
36
|
}
|
|
45
37
|
|
|
46
38
|
if (event.numberOfTouches === 2) {
|
|
47
|
-
|
|
39
|
+
if (gestureCompositionOwner.get() === null) {
|
|
40
|
+
gestureCompositionOwner.set("pinch");
|
|
41
|
+
}
|
|
48
42
|
stateManager?.activate();
|
|
49
43
|
return;
|
|
50
44
|
}
|
|
@@ -53,7 +47,7 @@ export const usePinchActivation = ({
|
|
|
53
47
|
stateManager?.fail();
|
|
54
48
|
}
|
|
55
49
|
},
|
|
56
|
-
[runtime, screenOptions,
|
|
50
|
+
[runtime, screenOptions, gestureCompositionOwner],
|
|
57
51
|
);
|
|
58
52
|
|
|
59
53
|
const onTouchesMove = useCallback(
|
|
@@ -70,14 +64,18 @@ export const usePinchActivation = ({
|
|
|
70
64
|
}
|
|
71
65
|
|
|
72
66
|
if (event.numberOfTouches === 2) {
|
|
73
|
-
|
|
67
|
+
if (gestureCompositionOwner.get() === null) {
|
|
68
|
+
gestureCompositionOwner.set("pinch");
|
|
69
|
+
}
|
|
74
70
|
stateManager.activate();
|
|
75
71
|
return;
|
|
76
72
|
}
|
|
77
73
|
|
|
78
|
-
|
|
74
|
+
if (event.numberOfTouches > 2) {
|
|
75
|
+
stateManager.fail();
|
|
76
|
+
}
|
|
79
77
|
},
|
|
80
|
-
[runtime, screenOptions,
|
|
78
|
+
[runtime, screenOptions, gestureCompositionOwner],
|
|
81
79
|
);
|
|
82
80
|
|
|
83
81
|
return useMemo(
|
|
@@ -3,6 +3,8 @@ import { EPSILON, FALSE, TRUE } from "../../../../../constants";
|
|
|
3
3
|
import { animateToProgress } from "../../../../../utils/animation/animate-to-progress";
|
|
4
4
|
import { emit } from "../../../../../utils/animation/emit";
|
|
5
5
|
import { normalizePinchScale } from "../../shared/physics";
|
|
6
|
+
import { snapshotGestureHandoff } from "../../shared/snapshot";
|
|
7
|
+
import { clearTransformTrackingValues } from "../../shared/values";
|
|
6
8
|
import type {
|
|
7
9
|
PinchGestureEvent,
|
|
8
10
|
PinchGestureRuntime,
|
|
@@ -18,7 +20,6 @@ export const startPinchBase = (
|
|
|
18
20
|
"worklet";
|
|
19
21
|
const {
|
|
20
22
|
stores: { gestures, animations },
|
|
21
|
-
gestureProgressBaseline,
|
|
22
23
|
} = runtime;
|
|
23
24
|
|
|
24
25
|
const wasSettling = gestures.settling.get();
|
|
@@ -36,15 +37,10 @@ export const startPinchBase = (
|
|
|
36
37
|
gestures.active.set(null);
|
|
37
38
|
gestures.direction.set(null);
|
|
38
39
|
gestures.velocity.set(0);
|
|
39
|
-
gestures
|
|
40
|
-
gestures.normScale.set(0);
|
|
41
|
-
gestures.rotation.set(0);
|
|
42
|
-
gestures.raw.scale.set(1);
|
|
43
|
-
gestures.raw.normScale.set(0);
|
|
44
|
-
gestures.raw.rotation.set(0);
|
|
40
|
+
clearTransformTrackingValues(gestures);
|
|
45
41
|
gestures.focalX.set(event.focalX);
|
|
46
42
|
gestures.focalY.set(event.focalY);
|
|
47
|
-
|
|
43
|
+
gestures.internal.progressBaseline.set(animations.transitionProgress.get());
|
|
48
44
|
};
|
|
49
45
|
|
|
50
46
|
export const trackPinchGesture = (
|
|
@@ -60,6 +56,8 @@ export const trackPinchGesture = (
|
|
|
60
56
|
|
|
61
57
|
gestures.scale.set(scale);
|
|
62
58
|
gestures.normScale.set(normScale);
|
|
59
|
+
gestures.focalX.set(event.focalX);
|
|
60
|
+
gestures.focalY.set(event.focalY);
|
|
63
61
|
gestures.raw.scale.set(rawScale);
|
|
64
62
|
gestures.raw.normScale.set(rawNormScale);
|
|
65
63
|
gestures.active.set(
|
|
@@ -84,10 +82,16 @@ export const finalizePinchRelease = (
|
|
|
84
82
|
} = runtime;
|
|
85
83
|
|
|
86
84
|
if (typeof release.commitProgress === "number") {
|
|
87
|
-
animations.
|
|
85
|
+
animations.transitionProgress.set(release.commitProgress);
|
|
88
86
|
system.targetProgress.set(release.commitProgress);
|
|
89
87
|
}
|
|
90
88
|
|
|
89
|
+
if (release.shouldDismiss) {
|
|
90
|
+
snapshotGestureHandoff(gestures, {
|
|
91
|
+
velocity: release.handoffVelocity,
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
|
|
91
95
|
resetPinchGestureValues({
|
|
92
96
|
spec: release.resetSpec,
|
|
93
97
|
gestures,
|
|
@@ -2,6 +2,7 @@ import { clamp } from "react-native-reanimated";
|
|
|
2
2
|
import {
|
|
3
3
|
getPinchReleaseHandoffVelocity,
|
|
4
4
|
normalizePinchScale,
|
|
5
|
+
resolveGestureVelocityMagnitude,
|
|
5
6
|
shouldDismissFromPinch,
|
|
6
7
|
} from "../../shared/physics";
|
|
7
8
|
import {
|
|
@@ -66,7 +67,7 @@ const getPinchSnapReleaseProgress = ({
|
|
|
66
67
|
const snapDirections = runtime.policy.snapDirections;
|
|
67
68
|
|
|
68
69
|
if (!pinchDirection || !snapDirections) {
|
|
69
|
-
return runtime.stores.animations.
|
|
70
|
+
return runtime.stores.animations.transitionProgress.get();
|
|
70
71
|
}
|
|
71
72
|
|
|
72
73
|
const progressDelta =
|
|
@@ -75,7 +76,7 @@ const getPinchSnapReleaseProgress = ({
|
|
|
75
76
|
: Math.abs(normalizedScale);
|
|
76
77
|
|
|
77
78
|
return clamp(
|
|
78
|
-
runtime.
|
|
79
|
+
runtime.stores.gestures.internal.progressBaseline.get() + progressDelta,
|
|
79
80
|
minSnapPoint,
|
|
80
81
|
maxSnapPoint,
|
|
81
82
|
);
|
|
@@ -94,11 +95,10 @@ export const resolvePinchRelease = (
|
|
|
94
95
|
const {
|
|
95
96
|
participation,
|
|
96
97
|
policy,
|
|
97
|
-
gestureProgressBaseline,
|
|
98
98
|
stores: { animations },
|
|
99
99
|
} = runtime;
|
|
100
100
|
const normalizedScale = clamp(normalizePinchScale(event.scale), -1, 1);
|
|
101
|
-
const currentProgress = animations.
|
|
101
|
+
const currentProgress = animations.transitionProgress.get();
|
|
102
102
|
const shouldDismiss =
|
|
103
103
|
participation.canDismiss &&
|
|
104
104
|
shouldDismissFromPinch(
|
|
@@ -106,19 +106,26 @@ export const resolvePinchRelease = (
|
|
|
106
106
|
policy.pinchInEnabled,
|
|
107
107
|
policy.pinchOutEnabled,
|
|
108
108
|
);
|
|
109
|
-
const target = shouldDismiss
|
|
109
|
+
const target = shouldDismiss
|
|
110
|
+
? 0
|
|
111
|
+
: runtime.stores.gestures.internal.progressBaseline.get();
|
|
112
|
+
const progressVelocity = getPinchReleaseHandoffVelocity(event.velocity);
|
|
113
|
+
const handoffVelocity = getPinchReleaseHandoffVelocity(
|
|
114
|
+
event.velocity,
|
|
115
|
+
policy.gestureReleaseVelocityScale,
|
|
116
|
+
);
|
|
110
117
|
|
|
111
118
|
return {
|
|
112
119
|
target,
|
|
113
120
|
shouldDismiss,
|
|
114
121
|
initialVelocity: getProgressVelocityTowardTarget({
|
|
115
|
-
handoffVelocity:
|
|
116
|
-
event.velocity,
|
|
117
|
-
policy.gestureReleaseVelocityScale,
|
|
118
|
-
),
|
|
122
|
+
handoffVelocity: progressVelocity,
|
|
119
123
|
target,
|
|
120
124
|
currentProgress,
|
|
121
125
|
}),
|
|
126
|
+
handoffVelocity: shouldDismiss
|
|
127
|
+
? resolveGestureVelocityMagnitude(handoffVelocity)
|
|
128
|
+
: 0,
|
|
122
129
|
transitionSpec: policy.transitionSpec,
|
|
123
130
|
resetSpec: shouldDismiss
|
|
124
131
|
? policy.transitionSpec?.close
|
|
@@ -131,7 +138,7 @@ export const resolveSnapPinchRelease = (
|
|
|
131
138
|
runtime: PinchGestureRuntime,
|
|
132
139
|
): PinchReleaseResult => {
|
|
133
140
|
"worklet";
|
|
134
|
-
const { participation, policy
|
|
141
|
+
const { participation, policy } = runtime;
|
|
135
142
|
const normalizedScale = clamp(normalizePinchScale(event.scale), -1, 1);
|
|
136
143
|
|
|
137
144
|
const { resolvedSnapPoints, resolvedMinSnapPoint, resolvedMaxSnapPoint } =
|
|
@@ -146,7 +153,10 @@ export const resolveSnapPinchRelease = (
|
|
|
146
153
|
const result = determineSnapTarget({
|
|
147
154
|
currentProgress,
|
|
148
155
|
snapPoints: policy.gestureSnapLocked
|
|
149
|
-
? [
|
|
156
|
+
? [
|
|
157
|
+
runtime.stores.gestures.internal.lockedSnapPoint.get() ??
|
|
158
|
+
resolvedMaxSnapPoint,
|
|
159
|
+
]
|
|
150
160
|
: resolvedSnapPoints,
|
|
151
161
|
velocity: getPinchSnapVelocity(event, runtime, normalizedScale),
|
|
152
162
|
dimension: 1,
|
|
@@ -156,20 +166,25 @@ export const resolveSnapPinchRelease = (
|
|
|
156
166
|
|
|
157
167
|
const shouldDismiss = participation.canDismiss && result.shouldDismiss;
|
|
158
168
|
const target = shouldDismiss ? 0 : result.targetProgress;
|
|
169
|
+
const progressVelocity = getPinchReleaseHandoffVelocity(event.velocity);
|
|
170
|
+
const handoffVelocity = getPinchReleaseHandoffVelocity(
|
|
171
|
+
event.velocity,
|
|
172
|
+
policy.gestureReleaseVelocityScale,
|
|
173
|
+
);
|
|
159
174
|
|
|
160
175
|
return {
|
|
161
176
|
target,
|
|
162
177
|
shouldDismiss,
|
|
163
178
|
initialVelocity: getProgressVelocityTowardTarget({
|
|
164
|
-
handoffVelocity:
|
|
165
|
-
event.velocity,
|
|
166
|
-
policy.gestureReleaseVelocityScale,
|
|
167
|
-
),
|
|
179
|
+
handoffVelocity: progressVelocity,
|
|
168
180
|
target,
|
|
169
181
|
currentProgress,
|
|
170
182
|
}),
|
|
183
|
+
handoffVelocity: shouldDismiss
|
|
184
|
+
? resolveGestureVelocityMagnitude(handoffVelocity)
|
|
185
|
+
: 0,
|
|
171
186
|
commitProgress: currentProgress,
|
|
172
|
-
resetValuesImmediately:
|
|
187
|
+
resetValuesImmediately: true,
|
|
173
188
|
transitionSpec: resolveGestureSnapTransitionSpec({
|
|
174
189
|
transitionSpec: policy.transitionSpec,
|
|
175
190
|
shouldDismiss,
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FALSE, TRUE } from "../../../../../constants";
|
|
2
2
|
import type { GestureStoreMap } from "../../../../../stores/gesture.store";
|
|
3
3
|
import type { AnimationConfig } from "../../../../../types/animation.types";
|
|
4
|
+
import { animateMany } from "../../shared/reset";
|
|
4
5
|
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
} from "../../shared/
|
|
6
|
+
clearFocalPoint,
|
|
7
|
+
clearRawTransformValues,
|
|
8
|
+
clearTransformTrackingValues,
|
|
9
|
+
} from "../../shared/values";
|
|
9
10
|
|
|
10
11
|
interface ResetPinchGestureValuesProps {
|
|
11
12
|
spec?: AnimationConfig;
|
|
@@ -14,24 +15,6 @@ interface ResetPinchGestureValuesProps {
|
|
|
14
15
|
resetValuesImmediately?: boolean;
|
|
15
16
|
}
|
|
16
17
|
|
|
17
|
-
const clearPinchSettlingIfResting = (gestures: GestureStoreMap) => {
|
|
18
|
-
"worklet";
|
|
19
|
-
|
|
20
|
-
const isResting =
|
|
21
|
-
!gestures.dragging.get() &&
|
|
22
|
-
!gestures.dismissing.get() &&
|
|
23
|
-
Math.abs(gestures.scale.get() - 1) <= EPSILON &&
|
|
24
|
-
Math.abs(gestures.normScale.get()) <= EPSILON &&
|
|
25
|
-
Math.abs(gestures.rotation.get()) <= EPSILON;
|
|
26
|
-
|
|
27
|
-
if (isResting) {
|
|
28
|
-
gestures.focalX.set(0);
|
|
29
|
-
gestures.focalY.set(0);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
clearGestureSettlingIfResting(gestures, isResting);
|
|
33
|
-
};
|
|
34
|
-
|
|
35
18
|
export const resetPinchGestureValues = ({
|
|
36
19
|
spec,
|
|
37
20
|
gestures,
|
|
@@ -39,33 +22,41 @@ export const resetPinchGestureValues = ({
|
|
|
39
22
|
resetValuesImmediately = false,
|
|
40
23
|
}: ResetPinchGestureValuesProps) => {
|
|
41
24
|
"worklet";
|
|
42
|
-
const
|
|
25
|
+
const finishPinchReset = () => {
|
|
26
|
+
"worklet";
|
|
27
|
+
if (shouldDismiss) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
43
30
|
|
|
44
|
-
|
|
45
|
-
gestures.
|
|
46
|
-
gestures.
|
|
47
|
-
gestures.
|
|
48
|
-
}
|
|
31
|
+
clearFocalPoint(gestures);
|
|
32
|
+
gestures.active.set(null);
|
|
33
|
+
gestures.direction.set(null);
|
|
34
|
+
gestures.settling.set(FALSE);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
clearRawTransformValues(gestures);
|
|
49
38
|
|
|
50
39
|
gestures.dragging.set(FALSE);
|
|
51
40
|
gestures.dismissing.set(shouldDismiss ? TRUE : FALSE);
|
|
52
41
|
gestures.settling.set(shouldDismiss ? FALSE : TRUE);
|
|
53
42
|
|
|
43
|
+
if (shouldDismiss) {
|
|
44
|
+
clearFocalPoint(gestures);
|
|
45
|
+
}
|
|
46
|
+
|
|
54
47
|
if (resetValuesImmediately) {
|
|
55
|
-
gestures
|
|
56
|
-
|
|
57
|
-
gestures.rotation.set(0);
|
|
58
|
-
clearPinchSettlingIfResting(gestures);
|
|
48
|
+
clearTransformTrackingValues(gestures);
|
|
49
|
+
finishPinchReset();
|
|
59
50
|
return;
|
|
60
51
|
}
|
|
61
52
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
53
|
+
animateMany(
|
|
54
|
+
[
|
|
55
|
+
{ value: gestures.scale, toValue: 1 },
|
|
56
|
+
{ value: gestures.normScale, toValue: 0 },
|
|
57
|
+
{ value: gestures.rotation, toValue: 0 },
|
|
58
|
+
],
|
|
59
|
+
spec,
|
|
60
|
+
finishPinchReset,
|
|
70
61
|
);
|
|
71
62
|
};
|
|
@@ -5,7 +5,7 @@ import type { ScreenOptionsContextValue } from "../../../options";
|
|
|
5
5
|
import { usePinchGestureSensitivity } from "../../hooks/use-gesture-sensitivity";
|
|
6
6
|
import { resolvePinchRuntime } from "../../shared/runtime";
|
|
7
7
|
import type {
|
|
8
|
-
|
|
8
|
+
GestureCompositionOwner,
|
|
9
9
|
PinchBehavior,
|
|
10
10
|
PinchGestureEvent,
|
|
11
11
|
PinchGestureRuntime,
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
export const usePinchBehavior = (
|
|
25
25
|
runtime: SharedValue<PinchGestureRuntime>,
|
|
26
26
|
screenOptions: ScreenOptionsContextValue,
|
|
27
|
-
|
|
27
|
+
gestureCompositionOwner: SharedValue<GestureCompositionOwner>,
|
|
28
28
|
): PinchBehavior => {
|
|
29
29
|
const { dismissScreen, requestDismiss } = useNavigationHelpers();
|
|
30
30
|
const { withSensitivity, resetSensitivity } =
|
|
@@ -77,7 +77,7 @@ export const usePinchBehavior = (
|
|
|
77
77
|
dismissScreen,
|
|
78
78
|
requestDismiss,
|
|
79
79
|
);
|
|
80
|
-
|
|
80
|
+
gestureCompositionOwner.set(null);
|
|
81
81
|
},
|
|
82
82
|
[
|
|
83
83
|
runtime,
|
|
@@ -85,7 +85,7 @@ export const usePinchBehavior = (
|
|
|
85
85
|
dismissScreen,
|
|
86
86
|
requestDismiss,
|
|
87
87
|
withSensitivity,
|
|
88
|
-
|
|
88
|
+
gestureCompositionOwner,
|
|
89
89
|
],
|
|
90
90
|
);
|
|
91
91
|
|
|
@@ -2,10 +2,9 @@ import { useMemo } from "react";
|
|
|
2
2
|
import { Gesture } from "react-native-gesture-handler";
|
|
3
3
|
import type { SharedValue } from "react-native-reanimated";
|
|
4
4
|
import { useScreenOptionsContext } from "../../options";
|
|
5
|
-
import { useGestureBuilderState } from "../hooks/use-gesture-builder-state";
|
|
6
5
|
import { useStableRuntimeConfig } from "../hooks/use-stable-runtime-config";
|
|
7
6
|
import type {
|
|
8
|
-
|
|
7
|
+
GestureCompositionOwner,
|
|
9
8
|
PinchGesture,
|
|
10
9
|
ScreenGestureConfig,
|
|
11
10
|
} from "../types";
|
|
@@ -14,35 +13,31 @@ import { usePinchBehavior } from "./behavior/use-pinch-behavior";
|
|
|
14
13
|
|
|
15
14
|
interface UseBuildPinchGestureProps {
|
|
16
15
|
gestureConfig: ScreenGestureConfig;
|
|
17
|
-
|
|
16
|
+
gestureCompositionOwner: SharedValue<GestureCompositionOwner>;
|
|
18
17
|
}
|
|
19
18
|
|
|
20
19
|
export const useBuildPinchGesture = ({
|
|
21
20
|
gestureConfig,
|
|
22
|
-
|
|
21
|
+
gestureCompositionOwner,
|
|
23
22
|
}: UseBuildPinchGestureProps): PinchGesture => {
|
|
24
23
|
const { participation, pinch: policy } = gestureConfig;
|
|
25
24
|
const screenOptions = useScreenOptionsContext();
|
|
26
|
-
const { gestureProgressBaseline, lockedSnapPoint } =
|
|
27
|
-
useGestureBuilderState(participation);
|
|
28
25
|
|
|
29
26
|
const runtime = useStableRuntimeConfig({
|
|
30
27
|
participation,
|
|
31
28
|
policy,
|
|
32
|
-
gestureProgressBaseline,
|
|
33
|
-
lockedSnapPoint,
|
|
34
29
|
});
|
|
35
30
|
|
|
36
31
|
const activation = usePinchActivation({
|
|
37
32
|
runtime,
|
|
38
33
|
screenOptions,
|
|
39
|
-
|
|
34
|
+
gestureCompositionOwner,
|
|
40
35
|
});
|
|
41
36
|
|
|
42
37
|
const behavior = usePinchBehavior(
|
|
43
38
|
runtime,
|
|
44
39
|
screenOptions,
|
|
45
|
-
|
|
40
|
+
gestureCompositionOwner,
|
|
46
41
|
);
|
|
47
42
|
|
|
48
43
|
const pinchGesture = useMemo(() => {
|
|
@@ -7,20 +7,20 @@ import type { SharedValue } from "react-native-reanimated";
|
|
|
7
7
|
import type { ScreenOptionsContextValue } from "../../../options";
|
|
8
8
|
import { resolvePinchRuntime } from "../../shared/runtime";
|
|
9
9
|
import type {
|
|
10
|
-
|
|
10
|
+
GestureCompositionOwner,
|
|
11
11
|
RotationGestureRuntime,
|
|
12
12
|
} from "../../types";
|
|
13
13
|
|
|
14
14
|
interface UseRotationActivationProps {
|
|
15
15
|
runtime: SharedValue<RotationGestureRuntime>;
|
|
16
16
|
screenOptions: ScreenOptionsContextValue;
|
|
17
|
-
|
|
17
|
+
gestureCompositionOwner: SharedValue<GestureCompositionOwner>;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
export const useRotationActivation = ({
|
|
21
21
|
runtime,
|
|
22
22
|
screenOptions,
|
|
23
|
-
|
|
23
|
+
gestureCompositionOwner,
|
|
24
24
|
}: UseRotationActivationProps) => {
|
|
25
25
|
const onTouchesDown = useCallback(
|
|
26
26
|
(
|
|
@@ -33,18 +33,15 @@ export const useRotationActivation = ({
|
|
|
33
33
|
screenOptions.get(),
|
|
34
34
|
);
|
|
35
35
|
|
|
36
|
-
if (gestureCompositionActivation.get() === "pan") {
|
|
37
|
-
stateManager?.fail();
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
36
|
if (!participation.canTrackGesture || !policy.enabled) {
|
|
42
37
|
stateManager?.fail();
|
|
43
38
|
return;
|
|
44
39
|
}
|
|
45
40
|
|
|
46
41
|
if (event.numberOfTouches === 2) {
|
|
47
|
-
|
|
42
|
+
if (gestureCompositionOwner.get() === null) {
|
|
43
|
+
gestureCompositionOwner.set("pinch");
|
|
44
|
+
}
|
|
48
45
|
stateManager?.activate();
|
|
49
46
|
return;
|
|
50
47
|
}
|
|
@@ -53,7 +50,7 @@ export const useRotationActivation = ({
|
|
|
53
50
|
stateManager?.fail();
|
|
54
51
|
}
|
|
55
52
|
},
|
|
56
|
-
[runtime, screenOptions,
|
|
53
|
+
[runtime, screenOptions, gestureCompositionOwner],
|
|
57
54
|
);
|
|
58
55
|
|
|
59
56
|
const onTouchesMove = useCallback(
|
|
@@ -70,14 +67,18 @@ export const useRotationActivation = ({
|
|
|
70
67
|
}
|
|
71
68
|
|
|
72
69
|
if (event.numberOfTouches === 2) {
|
|
73
|
-
|
|
70
|
+
if (gestureCompositionOwner.get() === null) {
|
|
71
|
+
gestureCompositionOwner.set("pinch");
|
|
72
|
+
}
|
|
74
73
|
stateManager.activate();
|
|
75
74
|
return;
|
|
76
75
|
}
|
|
77
76
|
|
|
78
|
-
|
|
77
|
+
if (event.numberOfTouches > 2) {
|
|
78
|
+
stateManager.fail();
|
|
79
|
+
}
|
|
79
80
|
},
|
|
80
|
-
[runtime, screenOptions,
|
|
81
|
+
[runtime, screenOptions, gestureCompositionOwner],
|
|
81
82
|
);
|
|
82
83
|
|
|
83
84
|
return useMemo(
|
|
@@ -2,10 +2,9 @@ import { useMemo } from "react";
|
|
|
2
2
|
import { Gesture } from "react-native-gesture-handler";
|
|
3
3
|
import type { SharedValue } from "react-native-reanimated";
|
|
4
4
|
import { useScreenOptionsContext } from "../../options";
|
|
5
|
-
import { useGestureBuilderState } from "../hooks/use-gesture-builder-state";
|
|
6
5
|
import { useStableRuntimeConfig } from "../hooks/use-stable-runtime-config";
|
|
7
6
|
import type {
|
|
8
|
-
|
|
7
|
+
GestureCompositionOwner,
|
|
9
8
|
RotationGesture,
|
|
10
9
|
ScreenGestureConfig,
|
|
11
10
|
} from "../types";
|
|
@@ -14,29 +13,25 @@ import { useRotationBehavior } from "./behavior/use-rotation-behavior";
|
|
|
14
13
|
|
|
15
14
|
interface UseBuildRotationGestureProps {
|
|
16
15
|
gestureConfig: ScreenGestureConfig;
|
|
17
|
-
|
|
16
|
+
gestureCompositionOwner: SharedValue<GestureCompositionOwner>;
|
|
18
17
|
}
|
|
19
18
|
|
|
20
19
|
export const useBuildRotationGesture = ({
|
|
21
20
|
gestureConfig,
|
|
22
|
-
|
|
21
|
+
gestureCompositionOwner,
|
|
23
22
|
}: UseBuildRotationGestureProps): RotationGesture => {
|
|
24
23
|
const { participation, pinch: policy } = gestureConfig;
|
|
25
24
|
const screenOptions = useScreenOptionsContext();
|
|
26
|
-
const { gestureProgressBaseline, lockedSnapPoint } =
|
|
27
|
-
useGestureBuilderState(participation);
|
|
28
25
|
|
|
29
26
|
const runtime = useStableRuntimeConfig({
|
|
30
27
|
participation,
|
|
31
28
|
policy,
|
|
32
|
-
gestureProgressBaseline,
|
|
33
|
-
lockedSnapPoint,
|
|
34
29
|
});
|
|
35
30
|
|
|
36
31
|
const activation = useRotationActivation({
|
|
37
32
|
runtime,
|
|
38
33
|
screenOptions,
|
|
39
|
-
|
|
34
|
+
gestureCompositionOwner,
|
|
40
35
|
});
|
|
41
36
|
|
|
42
37
|
const behavior = useRotationBehavior(runtime, screenOptions);
|