react-native-screen-transitions 3.6.0-alpha.1 → 3.6.0-alpha.3
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/component-stack/components/component-screen.js +1 -7
- package/lib/commonjs/component-stack/components/component-screen.js.map +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/create-boundary-component.js +27 -34
- package/lib/commonjs/shared/components/create-boundary-component/create-boundary-component.js.map +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-boundary-presence.js +4 -4
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-boundary-presence.js.map +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-initial-destination-measurement.js +17 -19
- 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-initial-source-measurement.js +27 -7
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-initial-source-measurement.js.map +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-measurer.js +23 -51
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-measurer.js.map +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-refresh-boundary.js +33 -40
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-refresh-boundary.js.map +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/index.js +3 -1
- package/lib/commonjs/shared/components/create-boundary-component/index.js.map +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/utils/destination-signals.js +75 -0
- package/lib/commonjs/shared/components/create-boundary-component/utils/destination-signals.js.map +1 -0
- package/lib/commonjs/shared/components/create-boundary-component/{hooks/helpers/scroll-measurement.js → utils/measured-bounds.js} +15 -2
- package/lib/commonjs/shared/components/create-boundary-component/utils/measured-bounds.js.map +1 -0
- package/lib/commonjs/shared/components/create-boundary-component/utils/refresh-signals.js +103 -0
- package/lib/commonjs/shared/components/create-boundary-component/utils/refresh-signals.js.map +1 -0
- package/lib/commonjs/shared/components/create-boundary-component/utils/source-signals.js +52 -0
- package/lib/commonjs/shared/components/create-boundary-component/utils/source-signals.js.map +1 -0
- package/lib/commonjs/shared/components/native-screen.js +2 -13
- package/lib/commonjs/shared/components/native-screen.js.map +1 -1
- package/lib/commonjs/shared/components/screen-container/layers/content.js +11 -1
- package/lib/commonjs/shared/components/screen-container/layers/content.js.map +1 -1
- package/lib/commonjs/shared/constants.js +5 -12
- package/lib/commonjs/shared/constants.js.map +1 -1
- package/lib/commonjs/shared/providers/helpers/measured-bounds-writes.js +35 -0
- package/lib/commonjs/shared/providers/helpers/measured-bounds-writes.js.map +1 -0
- package/lib/commonjs/shared/providers/register-bounds.provider.js +48 -55
- package/lib/commonjs/shared/providers/register-bounds.provider.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/animation/helpers/accessors/use-build-transition-accessor.js +1 -10
- package/lib/commonjs/shared/providers/screen/animation/helpers/accessors/use-build-transition-accessor.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/animation/helpers/build-screen-transition-options.js +1 -0
- 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/index.js +26 -8
- 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 +1 -2
- package/lib/commonjs/shared/providers/screen/animation/helpers/pipeline.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/animation/helpers/selected-interpolator-options.js +1 -1
- package/lib/commonjs/shared/providers/screen/animation/helpers/selected-interpolator-options.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/animation/helpers/use-build-transition-state.js +3 -4
- package/lib/commonjs/shared/providers/screen/animation/helpers/use-build-transition-state.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/pan/pan-activation.js +2 -2
- package/lib/commonjs/shared/providers/screen/gestures/pan/pan-activation.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/pan/pan-lifecycle.js +9 -2
- package/lib/commonjs/shared/providers/screen/gestures/pan/pan-lifecycle.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/pan/pan-release.js +19 -0
- package/lib/commonjs/shared/providers/screen/gestures/pan/pan-release.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/pan/pan-reset.js +2 -0
- package/lib/commonjs/shared/providers/screen/gestures/pan/pan-reset.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/pan/use-pan-behavior.js +2 -2
- package/lib/commonjs/shared/providers/screen/gestures/pan/use-pan-behavior.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/pinch/pinch-activation.js +2 -2
- package/lib/commonjs/shared/providers/screen/gestures/pinch/pinch-activation.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/pinch/pinch-lifecycle.js +1 -0
- package/lib/commonjs/shared/providers/screen/gestures/pinch/pinch-lifecycle.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/pinch/use-pinch-behavior.js +2 -2
- package/lib/commonjs/shared/providers/screen/gestures/pinch/use-pinch-behavior.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/shared/physics.js +18 -2
- package/lib/commonjs/shared/providers/screen/gestures/shared/physics.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/shared/policy.js +1 -5
- package/lib/commonjs/shared/providers/screen/gestures/shared/policy.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/options/helpers.js +3 -1
- 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 +1 -4
- package/lib/commonjs/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js.map +1 -1
- package/lib/commonjs/shared/stores/bounds/helpers/link-pairs.helpers.js +125 -0
- package/lib/commonjs/shared/stores/bounds/helpers/link-pairs.helpers.js.map +1 -0
- package/lib/commonjs/shared/stores/bounds/index.js +6 -12
- package/lib/commonjs/shared/stores/bounds/index.js.map +1 -1
- package/lib/commonjs/shared/stores/bounds/internals/clear.js +13 -21
- package/lib/commonjs/shared/stores/bounds/internals/clear.js.map +1 -1
- package/lib/commonjs/shared/stores/bounds/internals/entries.js +49 -9
- package/lib/commonjs/shared/stores/bounds/internals/entries.js.map +1 -1
- package/lib/commonjs/shared/stores/bounds/internals/links.js +143 -82
- package/lib/commonjs/shared/stores/bounds/internals/links.js.map +1 -1
- package/lib/commonjs/shared/stores/bounds/internals/resolver.js +17 -43
- package/lib/commonjs/shared/stores/bounds/internals/resolver.js.map +1 -1
- package/lib/commonjs/shared/stores/bounds/internals/state.js +26 -3
- package/lib/commonjs/shared/stores/bounds/internals/state.js.map +1 -1
- package/lib/commonjs/shared/stores/gesture.store.js +2 -0
- package/lib/commonjs/shared/stores/gesture.store.js.map +1 -1
- package/lib/commonjs/shared/types/gesture.types.js +2 -2
- package/lib/commonjs/shared/types/gesture.types.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/helpers/create-bounds-accessor-core.js +2 -1
- package/lib/commonjs/shared/utils/bounds/helpers/create-bounds-accessor-core.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/helpers/create-link-accessor.js +6 -5
- package/lib/commonjs/shared/utils/bounds/helpers/create-link-accessor.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/helpers/prepare-bound-styles.js +21 -8
- package/lib/commonjs/shared/utils/bounds/helpers/prepare-bound-styles.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/helpers/resolve-bounds-pair-key.js +23 -0
- package/lib/commonjs/shared/utils/bounds/helpers/resolve-bounds-pair-key.js.map +1 -0
- package/lib/commonjs/shared/utils/bounds/index.js +3 -2
- package/lib/commonjs/shared/utils/bounds/index.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/navigation/reveal/build.js +120 -205
- package/lib/commonjs/shared/utils/bounds/navigation/reveal/build.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/navigation/reveal/config.js +15 -2
- package/lib/commonjs/shared/utils/bounds/navigation/reveal/config.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/navigation/reveal/math.js +175 -14
- package/lib/commonjs/shared/utils/bounds/navigation/reveal/math.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/build.js +2 -2
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/build.js.map +1 -1
- package/lib/commonjs/shared/utils/navigation/resolve-scene-neighbors.js +20 -19
- package/lib/commonjs/shared/utils/navigation/resolve-scene-neighbors.js.map +1 -1
- package/lib/module/component-stack/components/component-screen.js +2 -8
- package/lib/module/component-stack/components/component-screen.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/create-boundary-component.js +27 -34
- package/lib/module/shared/components/create-boundary-component/create-boundary-component.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-boundary-presence.js +4 -4
- package/lib/module/shared/components/create-boundary-component/hooks/use-boundary-presence.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-initial-destination-measurement.js +18 -20
- 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-initial-source-measurement.js +28 -8
- package/lib/module/shared/components/create-boundary-component/hooks/use-initial-source-measurement.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-measurer.js +22 -50
- package/lib/module/shared/components/create-boundary-component/hooks/use-measurer.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-refresh-boundary.js +33 -40
- package/lib/module/shared/components/create-boundary-component/hooks/use-refresh-boundary.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/index.js +3 -1
- package/lib/module/shared/components/create-boundary-component/index.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/utils/destination-signals.js +70 -0
- package/lib/module/shared/components/create-boundary-component/utils/destination-signals.js.map +1 -0
- package/lib/module/shared/components/create-boundary-component/{hooks/helpers/scroll-measurement.js → utils/measured-bounds.js} +13 -1
- package/lib/module/shared/components/create-boundary-component/utils/measured-bounds.js.map +1 -0
- package/lib/module/shared/components/create-boundary-component/utils/refresh-signals.js +98 -0
- package/lib/module/shared/components/create-boundary-component/utils/refresh-signals.js.map +1 -0
- package/lib/module/shared/components/create-boundary-component/utils/source-signals.js +47 -0
- package/lib/module/shared/components/create-boundary-component/utils/source-signals.js.map +1 -0
- package/lib/module/shared/components/native-screen.js +3 -14
- package/lib/module/shared/components/native-screen.js.map +1 -1
- package/lib/module/shared/components/screen-container/layers/content.js +13 -3
- package/lib/module/shared/components/screen-container/layers/content.js.map +1 -1
- package/lib/module/shared/constants.js +4 -11
- package/lib/module/shared/constants.js.map +1 -1
- package/lib/module/shared/providers/helpers/measured-bounds-writes.js +30 -0
- package/lib/module/shared/providers/helpers/measured-bounds-writes.js.map +1 -0
- package/lib/module/shared/providers/register-bounds.provider.js +48 -55
- package/lib/module/shared/providers/register-bounds.provider.js.map +1 -1
- package/lib/module/shared/providers/screen/animation/helpers/accessors/use-build-transition-accessor.js +1 -10
- package/lib/module/shared/providers/screen/animation/helpers/accessors/use-build-transition-accessor.js.map +1 -1
- package/lib/module/shared/providers/screen/animation/helpers/build-screen-transition-options.js +1 -0
- 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/index.js +26 -3
- 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 +1 -2
- package/lib/module/shared/providers/screen/animation/helpers/pipeline.js.map +1 -1
- package/lib/module/shared/providers/screen/animation/helpers/selected-interpolator-options.js +1 -1
- package/lib/module/shared/providers/screen/animation/helpers/selected-interpolator-options.js.map +1 -1
- package/lib/module/shared/providers/screen/animation/helpers/use-build-transition-state.js +3 -4
- package/lib/module/shared/providers/screen/animation/helpers/use-build-transition-state.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/pan/pan-activation.js +2 -2
- package/lib/module/shared/providers/screen/gestures/pan/pan-activation.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/pan/pan-lifecycle.js +10 -3
- package/lib/module/shared/providers/screen/gestures/pan/pan-lifecycle.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/pan/pan-release.js +20 -1
- package/lib/module/shared/providers/screen/gestures/pan/pan-release.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/pan/pan-reset.js +2 -0
- package/lib/module/shared/providers/screen/gestures/pan/pan-reset.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/pan/use-pan-behavior.js +3 -3
- package/lib/module/shared/providers/screen/gestures/pan/use-pan-behavior.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/pinch/pinch-activation.js +3 -3
- package/lib/module/shared/providers/screen/gestures/pinch/pinch-activation.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/pinch/pinch-lifecycle.js +1 -0
- package/lib/module/shared/providers/screen/gestures/pinch/pinch-lifecycle.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/pinch/use-pinch-behavior.js +3 -3
- package/lib/module/shared/providers/screen/gestures/pinch/use-pinch-behavior.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/shared/physics.js +15 -0
- package/lib/module/shared/providers/screen/gestures/shared/physics.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/shared/policy.js +3 -3
- package/lib/module/shared/providers/screen/gestures/shared/policy.js.map +1 -1
- package/lib/module/shared/providers/screen/options/helpers.js +3 -1
- 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 +1 -4
- package/lib/module/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js.map +1 -1
- package/lib/module/shared/providers/stack/direct.provider.js.map +1 -1
- package/lib/module/shared/providers/stack/managed.provider.js.map +1 -1
- package/lib/module/shared/stores/bounds/helpers/link-pairs.helpers.js +105 -0
- package/lib/module/shared/stores/bounds/helpers/link-pairs.helpers.js.map +1 -0
- package/lib/module/shared/stores/bounds/index.js +7 -13
- package/lib/module/shared/stores/bounds/index.js.map +1 -1
- package/lib/module/shared/stores/bounds/internals/clear.js +14 -22
- package/lib/module/shared/stores/bounds/internals/clear.js.map +1 -1
- package/lib/module/shared/stores/bounds/internals/entries.js +49 -9
- package/lib/module/shared/stores/bounds/internals/entries.js.map +1 -1
- package/lib/module/shared/stores/bounds/internals/links.js +139 -80
- package/lib/module/shared/stores/bounds/internals/links.js.map +1 -1
- package/lib/module/shared/stores/bounds/internals/resolver.js +17 -43
- package/lib/module/shared/stores/bounds/internals/resolver.js.map +1 -1
- package/lib/module/shared/stores/bounds/internals/state.js +25 -2
- package/lib/module/shared/stores/bounds/internals/state.js.map +1 -1
- package/lib/module/shared/stores/gesture.store.js +2 -0
- package/lib/module/shared/stores/gesture.store.js.map +1 -1
- package/lib/module/shared/types/animation.types.js +0 -4
- package/lib/module/shared/types/animation.types.js.map +1 -1
- package/lib/module/shared/types/bounds.types.js.map +1 -1
- package/lib/module/shared/types/gesture.types.js +0 -1
- package/lib/module/shared/types/gesture.types.js.map +1 -1
- package/lib/module/shared/utils/bounds/helpers/create-bounds-accessor-core.js +2 -1
- package/lib/module/shared/utils/bounds/helpers/create-bounds-accessor-core.js.map +1 -1
- package/lib/module/shared/utils/bounds/helpers/create-link-accessor.js +6 -5
- package/lib/module/shared/utils/bounds/helpers/create-link-accessor.js.map +1 -1
- package/lib/module/shared/utils/bounds/helpers/prepare-bound-styles.js +21 -8
- package/lib/module/shared/utils/bounds/helpers/prepare-bound-styles.js.map +1 -1
- package/lib/module/shared/utils/bounds/helpers/resolve-bounds-pair-key.js +18 -0
- package/lib/module/shared/utils/bounds/helpers/resolve-bounds-pair-key.js.map +1 -0
- package/lib/module/shared/utils/bounds/index.js +3 -2
- package/lib/module/shared/utils/bounds/index.js.map +1 -1
- package/lib/module/shared/utils/bounds/navigation/reveal/build.js +120 -205
- package/lib/module/shared/utils/bounds/navigation/reveal/build.js.map +1 -1
- package/lib/module/shared/utils/bounds/navigation/reveal/config.js +14 -1
- package/lib/module/shared/utils/bounds/navigation/reveal/config.js.map +1 -1
- package/lib/module/shared/utils/bounds/navigation/reveal/math.js +163 -12
- package/lib/module/shared/utils/bounds/navigation/reveal/math.js.map +1 -1
- package/lib/module/shared/utils/bounds/navigation/zoom/build.js +2 -2
- package/lib/module/shared/utils/bounds/navigation/zoom/build.js.map +1 -1
- package/lib/module/shared/utils/navigation/resolve-scene-neighbors.js +20 -19
- package/lib/module/shared/utils/navigation/resolve-scene-neighbors.js.map +1 -1
- package/lib/typescript/component-stack/components/component-screen.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/components/boundary-target.d.ts +4 -207
- package/lib/typescript/shared/components/create-boundary-component/components/boundary-target.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/create-boundary-component.d.ts +1 -0
- package/lib/typescript/shared/components/create-boundary-component/create-boundary-component.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-boundary-presence.d.ts +1 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-boundary-presence.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-initial-destination-measurement.d.ts +5 -4
- 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-initial-source-measurement.d.ts +6 -2
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-initial-source-measurement.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-measurer.d.ts +5 -4
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-measurer.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-refresh-boundary.d.ts +7 -7
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-refresh-boundary.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/index.d.ts +2 -2
- package/lib/typescript/shared/components/create-boundary-component/index.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/types.d.ts +11 -7
- package/lib/typescript/shared/components/create-boundary-component/types.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/utils/destination-signals.d.ts +10 -0
- package/lib/typescript/shared/components/create-boundary-component/utils/destination-signals.d.ts.map +1 -0
- package/lib/typescript/shared/components/create-boundary-component/{hooks/helpers/scroll-measurement.d.ts → utils/measured-bounds.d.ts} +3 -2
- package/lib/typescript/shared/components/create-boundary-component/utils/measured-bounds.d.ts.map +1 -0
- package/lib/typescript/shared/components/create-boundary-component/utils/refresh-signals.d.ts +22 -0
- package/lib/typescript/shared/components/create-boundary-component/utils/refresh-signals.d.ts.map +1 -0
- package/lib/typescript/shared/components/create-boundary-component/utils/source-signals.d.ts +16 -0
- package/lib/typescript/shared/components/create-boundary-component/utils/source-signals.d.ts.map +1 -0
- package/lib/typescript/shared/components/native-screen.d.ts.map +1 -1
- package/lib/typescript/shared/components/overlay/variations/overlay-host.d.ts +1 -1
- package/lib/typescript/shared/components/overlay/variations/overlay-host.d.ts.map +1 -1
- package/lib/typescript/shared/components/scene-view.d.ts +1 -1
- package/lib/typescript/shared/components/scene-view.d.ts.map +1 -1
- package/lib/typescript/shared/components/screen-container/layers/backdrop.d.ts +2 -2
- package/lib/typescript/shared/components/screen-container/layers/backdrop.d.ts.map +1 -1
- package/lib/typescript/shared/components/screen-container/layers/content.d.ts.map +1 -1
- package/lib/typescript/shared/constants.d.ts +1 -6
- package/lib/typescript/shared/constants.d.ts.map +1 -1
- package/lib/typescript/shared/index.d.ts +3 -3
- package/lib/typescript/shared/index.d.ts.map +1 -1
- package/lib/typescript/shared/providers/helpers/measured-bounds-writes.d.ts +21 -0
- package/lib/typescript/shared/providers/helpers/measured-bounds-writes.d.ts.map +1 -0
- package/lib/typescript/shared/providers/register-bounds.provider.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/animation/helpers/accessors/use-build-transition-accessor.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/index.d.ts +1 -2
- 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 +1 -1
- 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/pipeline.d.ts +1 -1
- package/lib/typescript/shared/providers/screen/animation/helpers/pipeline.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/animation/helpers/selected-interpolator-options.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/animation/helpers/use-build-transition-state.d.ts +1 -1
- package/lib/typescript/shared/providers/screen/animation/helpers/use-build-transition-state.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/pan/pan-activation.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/pan/pan-lifecycle.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/pan/pan-release.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/pan/pan-reset.d.ts +2 -1
- package/lib/typescript/shared/providers/screen/gestures/pan/pan-reset.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/pan/use-pan-behavior.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/pinch/pinch-activation.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/pinch/pinch-lifecycle.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/pinch/use-pinch-behavior.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/shared/physics.d.ts +7 -0
- 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 +0 -10
- package/lib/typescript/shared/providers/screen/gestures/shared/policy.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/types.d.ts +2 -0
- 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 +1 -0
- package/lib/typescript/shared/providers/screen/options/types.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/styles/components/maybe-floating-container.d.ts +1 -1
- package/lib/typescript/shared/providers/screen/styles/components/maybe-floating-container.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/styles/hooks/use-interpolated-style-maps.d.ts.map +1 -1
- package/lib/typescript/shared/providers/stack/direct.provider.d.ts +1 -1
- package/lib/typescript/shared/providers/stack/direct.provider.d.ts.map +1 -1
- package/lib/typescript/shared/providers/stack/managed.provider.d.ts +1 -1
- package/lib/typescript/shared/providers/stack/managed.provider.d.ts.map +1 -1
- package/lib/typescript/shared/stores/bounds/helpers/link-pairs.helpers.d.ts +18 -0
- package/lib/typescript/shared/stores/bounds/helpers/link-pairs.helpers.d.ts.map +1 -0
- package/lib/typescript/shared/stores/bounds/index.d.ts +6 -12
- package/lib/typescript/shared/stores/bounds/index.d.ts.map +1 -1
- package/lib/typescript/shared/stores/bounds/internals/clear.d.ts.map +1 -1
- package/lib/typescript/shared/stores/bounds/internals/entries.d.ts.map +1 -1
- package/lib/typescript/shared/stores/bounds/internals/links.d.ts +13 -10
- package/lib/typescript/shared/stores/bounds/internals/links.d.ts.map +1 -1
- package/lib/typescript/shared/stores/bounds/internals/resolver.d.ts.map +1 -1
- package/lib/typescript/shared/stores/bounds/internals/state.d.ts +26 -5
- package/lib/typescript/shared/stores/bounds/internals/state.d.ts.map +1 -1
- package/lib/typescript/shared/stores/bounds/types.d.ts +14 -7
- package/lib/typescript/shared/stores/bounds/types.d.ts.map +1 -1
- package/lib/typescript/shared/stores/gesture.store.d.ts +1 -0
- package/lib/typescript/shared/stores/gesture.store.d.ts.map +1 -1
- package/lib/typescript/shared/types/animation.types.d.ts +4 -19
- package/lib/typescript/shared/types/animation.types.d.ts.map +1 -1
- package/lib/typescript/shared/types/bounds.types.d.ts +69 -1
- package/lib/typescript/shared/types/bounds.types.d.ts.map +1 -1
- package/lib/typescript/shared/types/gesture.types.d.ts +8 -1
- package/lib/typescript/shared/types/gesture.types.d.ts.map +1 -1
- package/lib/typescript/shared/types/index.d.ts +2 -2
- package/lib/typescript/shared/types/index.d.ts.map +1 -1
- package/lib/typescript/shared/types/screen.types.d.ts +4 -14
- package/lib/typescript/shared/types/screen.types.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/helpers/create-bounds-accessor-core.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/helpers/create-link-accessor.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/helpers/prepare-bound-styles.d.ts +1 -1
- package/lib/typescript/shared/utils/bounds/helpers/prepare-bound-styles.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/helpers/resolve-bounds-pair-key.d.ts +4 -0
- package/lib/typescript/shared/utils/bounds/helpers/resolve-bounds-pair-key.d.ts.map +1 -0
- package/lib/typescript/shared/utils/bounds/index.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/navigation/reveal/build.d.ts +1 -1
- package/lib/typescript/shared/utils/bounds/navigation/reveal/build.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/navigation/reveal/config.d.ts +14 -1
- package/lib/typescript/shared/utils/bounds/navigation/reveal/config.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/navigation/reveal/math.d.ts +58 -7
- package/lib/typescript/shared/utils/bounds/navigation/reveal/math.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/navigation/reveal/types.d.ts +2 -1
- package/lib/typescript/shared/utils/bounds/navigation/reveal/types.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/types/options.d.ts +2 -3
- package/lib/typescript/shared/utils/bounds/types/options.d.ts.map +1 -1
- package/lib/typescript/shared/utils/navigation/resolve-scene-neighbors.d.ts +3 -2
- package/lib/typescript/shared/utils/navigation/resolve-scene-neighbors.d.ts.map +1 -1
- package/package.json +4 -3
- package/src/component-stack/components/component-screen.tsx +3 -11
- package/src/shared/components/create-boundary-component/create-boundary-component.tsx +30 -27
- package/src/shared/components/create-boundary-component/hooks/use-boundary-presence.ts +5 -5
- package/src/shared/components/create-boundary-component/hooks/use-initial-destination-measurement.ts +25 -24
- package/src/shared/components/create-boundary-component/hooks/use-initial-source-measurement.ts +41 -11
- package/src/shared/components/create-boundary-component/hooks/use-measurer.ts +49 -64
- package/src/shared/components/create-boundary-component/hooks/use-refresh-boundary.ts +44 -83
- package/src/shared/components/create-boundary-component/index.tsx +3 -1
- package/src/shared/components/create-boundary-component/types.ts +13 -11
- package/src/shared/components/create-boundary-component/utils/destination-signals.ts +129 -0
- package/src/shared/components/create-boundary-component/{hooks/helpers/scroll-measurement.ts → utils/measured-bounds.ts} +25 -1
- package/src/shared/components/create-boundary-component/utils/refresh-signals.ts +164 -0
- package/src/shared/components/create-boundary-component/utils/source-signals.ts +72 -0
- package/src/shared/components/native-screen.tsx +3 -12
- package/src/shared/components/screen-container/layers/content.tsx +21 -2
- package/src/shared/constants.ts +1 -9
- package/src/shared/index.ts +0 -3
- package/src/shared/providers/helpers/measured-bounds-writes.ts +67 -0
- package/src/shared/providers/register-bounds.provider.tsx +68 -91
- package/src/shared/providers/screen/animation/helpers/accessors/use-build-transition-accessor.ts +0 -14
- package/src/shared/providers/screen/animation/helpers/build-screen-transition-options.ts +1 -0
- package/src/shared/providers/screen/animation/helpers/hydrate-transition-state/index.ts +49 -4
- package/src/shared/providers/screen/animation/helpers/hydrate-transition-state/types.ts +1 -1
- package/src/shared/providers/screen/animation/helpers/pipeline.ts +2 -5
- package/src/shared/providers/screen/animation/helpers/selected-interpolator-options.ts +1 -0
- package/src/shared/providers/screen/animation/helpers/use-build-transition-state.ts +3 -12
- package/src/shared/providers/screen/gestures/pan/pan-activation.ts +4 -1
- package/src/shared/providers/screen/gestures/pan/pan-lifecycle.ts +18 -2
- package/src/shared/providers/screen/gestures/pan/pan-release.ts +33 -0
- package/src/shared/providers/screen/gestures/pan/pan-reset.ts +3 -0
- package/src/shared/providers/screen/gestures/pan/use-pan-behavior.ts +9 -6
- package/src/shared/providers/screen/gestures/pinch/pinch-activation.ts +5 -2
- package/src/shared/providers/screen/gestures/pinch/pinch-lifecycle.ts +1 -0
- package/src/shared/providers/screen/gestures/pinch/use-pinch-behavior.ts +9 -6
- package/src/shared/providers/screen/gestures/shared/physics.ts +25 -0
- package/src/shared/providers/screen/gestures/shared/policy.ts +3 -5
- package/src/shared/providers/screen/gestures/types.ts +2 -0
- package/src/shared/providers/screen/options/helpers.ts +9 -0
- package/src/shared/providers/screen/options/types.ts +1 -0
- package/src/shared/providers/screen/styles/hooks/use-interpolated-style-maps.tsx +0 -3
- package/src/shared/providers/stack/direct.provider.tsx +1 -1
- package/src/shared/providers/stack/managed.provider.tsx +1 -1
- package/src/shared/stores/bounds/helpers/link-pairs.helpers.ts +161 -0
- package/src/shared/stores/bounds/index.ts +10 -20
- package/src/shared/stores/bounds/internals/clear.ts +17 -41
- package/src/shared/stores/bounds/internals/entries.ts +56 -13
- package/src/shared/stores/bounds/internals/links.ts +222 -113
- package/src/shared/stores/bounds/internals/resolver.ts +23 -87
- package/src/shared/stores/bounds/internals/state.ts +27 -5
- package/src/shared/stores/bounds/types.ts +17 -7
- package/src/shared/stores/gesture.store.ts +3 -0
- package/src/shared/types/animation.types.ts +4 -23
- package/src/shared/types/bounds.types.ts +72 -1
- package/src/shared/types/gesture.types.ts +8 -2
- package/src/shared/types/index.ts +1 -4
- package/src/shared/types/screen.types.ts +4 -14
- package/src/shared/utils/bounds/helpers/create-bounds-accessor-core.ts +1 -0
- package/src/shared/utils/bounds/helpers/create-link-accessor.ts +6 -6
- package/src/shared/utils/bounds/helpers/prepare-bound-styles.ts +20 -11
- package/src/shared/utils/bounds/helpers/resolve-bounds-pair-key.ts +22 -0
- package/src/shared/utils/bounds/index.ts +3 -1
- package/src/shared/utils/bounds/navigation/reveal/build.ts +198 -308
- package/src/shared/utils/bounds/navigation/reveal/config.ts +20 -1
- package/src/shared/utils/bounds/navigation/reveal/math.ts +264 -18
- package/src/shared/utils/bounds/navigation/reveal/types.ts +2 -0
- package/src/shared/utils/bounds/navigation/zoom/build.ts +2 -2
- package/src/shared/utils/bounds/types/options.ts +2 -3
- package/src/shared/utils/navigation/resolve-scene-neighbors.ts +36 -23
- package/lib/commonjs/shared/components/create-boundary-component/helpers/apply-measured-bounds-writes.js +0 -43
- package/lib/commonjs/shared/components/create-boundary-component/helpers/apply-measured-bounds-writes.js.map +0 -1
- package/lib/commonjs/shared/components/create-boundary-component/helpers/resolve-pending-source-key.js +0 -17
- package/lib/commonjs/shared/components/create-boundary-component/helpers/resolve-pending-source-key.js.map +0 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/helpers/boundary-link-context.js +0 -28
- package/lib/commonjs/shared/components/create-boundary-component/hooks/helpers/boundary-link-context.js.map +0 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js +0 -75
- package/lib/commonjs/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js.map +0 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/helpers/measurement.js +0 -20
- package/lib/commonjs/shared/components/create-boundary-component/hooks/helpers/measurement.js.map +0 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/helpers/scroll-measurement.js.map +0 -1
- package/lib/commonjs/shared/components/create-boundary-component/utils/build-boundary-match-key.js +0 -16
- package/lib/commonjs/shared/components/create-boundary-component/utils/build-boundary-match-key.js.map +0 -1
- package/lib/commonjs/shared/providers/layout-anchor.provider.js +0 -86
- package/lib/commonjs/shared/providers/layout-anchor.provider.js.map +0 -1
- package/lib/commonjs/shared/stores/bounds/helpers/entries.helpers.js +0 -49
- package/lib/commonjs/shared/stores/bounds/helpers/entries.helpers.js.map +0 -1
- package/lib/commonjs/shared/stores/bounds/helpers/find-latest.js +0 -25
- package/lib/commonjs/shared/stores/bounds/helpers/find-latest.js.map +0 -1
- package/lib/commonjs/shared/stores/bounds/helpers/groups.helpers.js +0 -30
- package/lib/commonjs/shared/stores/bounds/helpers/groups.helpers.js.map +0 -1
- package/lib/commonjs/shared/stores/bounds/helpers/link.helpers.js +0 -79
- package/lib/commonjs/shared/stores/bounds/helpers/link.helpers.js.map +0 -1
- package/lib/commonjs/shared/stores/bounds/helpers/matching.js +0 -13
- package/lib/commonjs/shared/stores/bounds/helpers/matching.js.map +0 -1
- package/lib/commonjs/shared/stores/bounds/helpers/tag-state.helpers.js +0 -30
- package/lib/commonjs/shared/stores/bounds/helpers/tag-state.helpers.js.map +0 -1
- package/lib/commonjs/shared/stores/bounds/internals/groups.js +0 -102
- package/lib/commonjs/shared/stores/bounds/internals/groups.js.map +0 -1
- package/lib/module/shared/components/create-boundary-component/helpers/apply-measured-bounds-writes.js +0 -38
- package/lib/module/shared/components/create-boundary-component/helpers/apply-measured-bounds-writes.js.map +0 -1
- package/lib/module/shared/components/create-boundary-component/helpers/resolve-pending-source-key.js +0 -12
- package/lib/module/shared/components/create-boundary-component/helpers/resolve-pending-source-key.js.map +0 -1
- package/lib/module/shared/components/create-boundary-component/hooks/helpers/boundary-link-context.js +0 -23
- package/lib/module/shared/components/create-boundary-component/hooks/helpers/boundary-link-context.js.map +0 -1
- package/lib/module/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js +0 -68
- package/lib/module/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js.map +0 -1
- package/lib/module/shared/components/create-boundary-component/hooks/helpers/measurement.js +0 -15
- package/lib/module/shared/components/create-boundary-component/hooks/helpers/measurement.js.map +0 -1
- package/lib/module/shared/components/create-boundary-component/hooks/helpers/scroll-measurement.js.map +0 -1
- package/lib/module/shared/components/create-boundary-component/utils/build-boundary-match-key.js +0 -12
- package/lib/module/shared/components/create-boundary-component/utils/build-boundary-match-key.js.map +0 -1
- package/lib/module/shared/providers/layout-anchor.provider.js +0 -80
- package/lib/module/shared/providers/layout-anchor.provider.js.map +0 -1
- package/lib/module/shared/stores/bounds/helpers/entries.helpers.js +0 -42
- package/lib/module/shared/stores/bounds/helpers/entries.helpers.js.map +0 -1
- package/lib/module/shared/stores/bounds/helpers/find-latest.js +0 -19
- package/lib/module/shared/stores/bounds/helpers/find-latest.js.map +0 -1
- package/lib/module/shared/stores/bounds/helpers/groups.helpers.js +0 -23
- package/lib/module/shared/stores/bounds/helpers/groups.helpers.js.map +0 -1
- package/lib/module/shared/stores/bounds/helpers/link.helpers.js +0 -69
- package/lib/module/shared/stores/bounds/helpers/link.helpers.js.map +0 -1
- package/lib/module/shared/stores/bounds/helpers/matching.js +0 -9
- package/lib/module/shared/stores/bounds/helpers/matching.js.map +0 -1
- package/lib/module/shared/stores/bounds/helpers/tag-state.helpers.js +0 -24
- package/lib/module/shared/stores/bounds/helpers/tag-state.helpers.js.map +0 -1
- package/lib/module/shared/stores/bounds/internals/groups.js +0 -95
- package/lib/module/shared/stores/bounds/internals/groups.js.map +0 -1
- package/lib/typescript/shared/components/create-boundary-component/helpers/apply-measured-bounds-writes.d.ts +0 -15
- package/lib/typescript/shared/components/create-boundary-component/helpers/apply-measured-bounds-writes.d.ts.map +0 -1
- package/lib/typescript/shared/components/create-boundary-component/helpers/resolve-pending-source-key.d.ts +0 -2
- package/lib/typescript/shared/components/create-boundary-component/helpers/resolve-pending-source-key.d.ts.map +0 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/helpers/boundary-link-context.d.ts +0 -22
- package/lib/typescript/shared/components/create-boundary-component/hooks/helpers/boundary-link-context.d.ts.map +0 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/helpers/measurement-rules.d.ts +0 -29
- package/lib/typescript/shared/components/create-boundary-component/hooks/helpers/measurement-rules.d.ts.map +0 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/helpers/measurement.d.ts +0 -3
- package/lib/typescript/shared/components/create-boundary-component/hooks/helpers/measurement.d.ts.map +0 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/helpers/scroll-measurement.d.ts.map +0 -1
- package/lib/typescript/shared/components/create-boundary-component/utils/build-boundary-match-key.d.ts +0 -8
- package/lib/typescript/shared/components/create-boundary-component/utils/build-boundary-match-key.d.ts.map +0 -1
- package/lib/typescript/shared/providers/layout-anchor.provider.d.ts +0 -39
- package/lib/typescript/shared/providers/layout-anchor.provider.d.ts.map +0 -1
- package/lib/typescript/shared/stores/bounds/helpers/entries.helpers.d.ts +0 -5
- package/lib/typescript/shared/stores/bounds/helpers/entries.helpers.d.ts.map +0 -1
- package/lib/typescript/shared/stores/bounds/helpers/find-latest.d.ts +0 -3
- package/lib/typescript/shared/stores/bounds/helpers/find-latest.d.ts.map +0 -1
- package/lib/typescript/shared/stores/bounds/helpers/groups.helpers.d.ts +0 -10
- package/lib/typescript/shared/stores/bounds/helpers/groups.helpers.d.ts.map +0 -1
- package/lib/typescript/shared/stores/bounds/helpers/link.helpers.d.ts +0 -14
- package/lib/typescript/shared/stores/bounds/helpers/link.helpers.d.ts.map +0 -1
- package/lib/typescript/shared/stores/bounds/helpers/matching.d.ts +0 -3
- package/lib/typescript/shared/stores/bounds/helpers/matching.d.ts.map +0 -1
- package/lib/typescript/shared/stores/bounds/helpers/tag-state.helpers.d.ts +0 -5
- package/lib/typescript/shared/stores/bounds/helpers/tag-state.helpers.d.ts.map +0 -1
- package/lib/typescript/shared/stores/bounds/internals/groups.d.ts +0 -16
- package/lib/typescript/shared/stores/bounds/internals/groups.d.ts.map +0 -1
- package/src/shared/components/create-boundary-component/helpers/apply-measured-bounds-writes.ts +0 -83
- package/src/shared/components/create-boundary-component/helpers/resolve-pending-source-key.ts +0 -20
- package/src/shared/components/create-boundary-component/hooks/helpers/boundary-link-context.ts +0 -48
- package/src/shared/components/create-boundary-component/hooks/helpers/measurement-rules.ts +0 -101
- package/src/shared/components/create-boundary-component/hooks/helpers/measurement.ts +0 -25
- package/src/shared/components/create-boundary-component/utils/build-boundary-match-key.ts +0 -14
- package/src/shared/providers/layout-anchor.provider.tsx +0 -112
- package/src/shared/stores/bounds/helpers/entries.helpers.ts +0 -55
- package/src/shared/stores/bounds/helpers/find-latest.ts +0 -22
- package/src/shared/stores/bounds/helpers/groups.helpers.ts +0 -27
- package/src/shared/stores/bounds/helpers/link.helpers.ts +0 -131
- package/src/shared/stores/bounds/helpers/matching.ts +0 -11
- package/src/shared/stores/bounds/helpers/tag-state.helpers.ts +0 -24
- package/src/shared/stores/bounds/internals/groups.ts +0 -116
|
@@ -11,25 +11,24 @@ import {
|
|
|
11
11
|
useSharedValue,
|
|
12
12
|
} from "react-native-reanimated";
|
|
13
13
|
import type { SharedValue } from "react-native-reanimated/lib/typescript/commonTypes";
|
|
14
|
-
import { applyMeasuredBoundsWrites } from "../components/create-boundary-component/helpers/apply-measured-bounds-writes";
|
|
15
14
|
import useStableCallback from "../hooks/use-stable-callback";
|
|
16
15
|
import useStableCallbackValue from "../hooks/use-stable-callback-value";
|
|
17
16
|
import { AnimationStore } from "../stores/animation.store";
|
|
18
|
-
import { getEntry } from "../stores/bounds/internals/entries";
|
|
19
17
|
import {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
} from "../stores/bounds/internals/
|
|
18
|
+
createPendingPairKey,
|
|
19
|
+
createScreenPairKey,
|
|
20
|
+
} from "../stores/bounds/helpers/link-pairs.helpers";
|
|
21
|
+
import { getEntry } from "../stores/bounds/internals/entries";
|
|
22
|
+
import { getDestination, getSource } from "../stores/bounds/internals/links";
|
|
24
23
|
import { prepareStyleForBounds } from "../utils/bounds/helpers/styles/styles";
|
|
25
24
|
import createProvider from "../utils/create-provider";
|
|
25
|
+
import { applyMeasuredBoundsWrites } from "./helpers/measured-bounds-writes";
|
|
26
26
|
import { useDescriptorDerivations, useDescriptors } from "./screen/descriptors";
|
|
27
27
|
|
|
28
28
|
interface MaybeMeasureAndStoreParams {
|
|
29
29
|
onPress?: ((...args: unknown[]) => void) | undefined;
|
|
30
30
|
shouldSetSource?: boolean;
|
|
31
31
|
shouldSetDestination?: boolean;
|
|
32
|
-
shouldUpdateSource?: boolean;
|
|
33
32
|
}
|
|
34
33
|
|
|
35
34
|
interface RegisterBoundsRenderProps {
|
|
@@ -208,48 +207,14 @@ const useParentSyncReaction = (params: {
|
|
|
208
207
|
);
|
|
209
208
|
};
|
|
210
209
|
|
|
211
|
-
const CloseRemeasureReactionEffect = (params: {
|
|
212
|
-
sharedBoundTag: string;
|
|
213
|
-
remeasureOnFocus: boolean;
|
|
214
|
-
nextClosing: SharedValue<number>;
|
|
215
|
-
maybeMeasureAndStore: (options: MaybeMeasureAndStoreParams) => void;
|
|
216
|
-
}) => {
|
|
217
|
-
const {
|
|
218
|
-
sharedBoundTag,
|
|
219
|
-
remeasureOnFocus,
|
|
220
|
-
nextClosing,
|
|
221
|
-
maybeMeasureAndStore,
|
|
222
|
-
} = params;
|
|
223
|
-
|
|
224
|
-
useAnimatedReaction(
|
|
225
|
-
() => nextClosing.get(),
|
|
226
|
-
(closing, prevClosing) => {
|
|
227
|
-
"worklet";
|
|
228
|
-
if (closing === 1 && (prevClosing === 0 || prevClosing === null)) {
|
|
229
|
-
maybeMeasureAndStore({ shouldUpdateSource: true });
|
|
230
|
-
}
|
|
231
|
-
},
|
|
232
|
-
[sharedBoundTag, remeasureOnFocus, nextClosing],
|
|
233
|
-
);
|
|
234
|
-
|
|
235
|
-
return null;
|
|
236
|
-
};
|
|
237
|
-
|
|
238
210
|
let useRegisterBoundsContext: () => RegisterBoundsContextValue | null;
|
|
239
211
|
|
|
240
212
|
const registerBoundsBundle = createProvider("RegisterBounds", {
|
|
241
213
|
guarded: false,
|
|
242
214
|
})<RegisterBoundsProviderProps, RegisterBoundsContextValue>(
|
|
243
|
-
({
|
|
244
|
-
style,
|
|
245
|
-
onPress,
|
|
246
|
-
sharedBoundTag,
|
|
247
|
-
animatedRef,
|
|
248
|
-
remeasureOnFocus,
|
|
249
|
-
children,
|
|
250
|
-
}) => {
|
|
215
|
+
({ style, onPress, sharedBoundTag, animatedRef, children }) => {
|
|
251
216
|
const { current, next } = useDescriptors();
|
|
252
|
-
const { ancestorKeys } = useDescriptorDerivations();
|
|
217
|
+
const { ancestorKeys, previousScreenKey } = useDescriptorDerivations();
|
|
253
218
|
const currentScreenKey = current.route.key;
|
|
254
219
|
const selectedNextRouteId = getRouteParamId(next?.route);
|
|
255
220
|
|
|
@@ -277,7 +242,6 @@ const registerBoundsBundle = createProvider("RegisterBounds", {
|
|
|
277
242
|
onPress,
|
|
278
243
|
shouldSetSource,
|
|
279
244
|
shouldSetDestination,
|
|
280
|
-
shouldUpdateSource,
|
|
281
245
|
}: MaybeMeasureAndStoreParams = {}) => {
|
|
282
246
|
"worklet";
|
|
283
247
|
if (!sharedBoundTag) {
|
|
@@ -285,15 +249,27 @@ const registerBoundsBundle = createProvider("RegisterBounds", {
|
|
|
285
249
|
return;
|
|
286
250
|
}
|
|
287
251
|
|
|
252
|
+
const sourcePairKey = createPendingPairKey(currentScreenKey);
|
|
253
|
+
const destinationPairKey = previousScreenKey
|
|
254
|
+
? createScreenPairKey(previousScreenKey, currentScreenKey)
|
|
255
|
+
: undefined;
|
|
256
|
+
const pendingSourcePairKey = previousScreenKey
|
|
257
|
+
? createPendingPairKey(previousScreenKey)
|
|
258
|
+
: undefined;
|
|
259
|
+
|
|
288
260
|
if (shouldSetSource && isAnimating.get()) {
|
|
289
261
|
const existing = getEntry(sharedBoundTag, currentScreenKey);
|
|
290
262
|
if (existing?.bounds) {
|
|
291
263
|
applyMeasuredBoundsWrites({
|
|
292
|
-
sharedBoundTag,
|
|
264
|
+
entryTag: sharedBoundTag,
|
|
265
|
+
linkId: sharedBoundTag,
|
|
293
266
|
currentScreenKey,
|
|
294
267
|
measured: existing.bounds,
|
|
295
268
|
preparedStyles,
|
|
296
|
-
|
|
269
|
+
linkWrite: {
|
|
270
|
+
type: "source",
|
|
271
|
+
pairKey: sourcePairKey,
|
|
272
|
+
},
|
|
297
273
|
});
|
|
298
274
|
}
|
|
299
275
|
|
|
@@ -301,31 +277,30 @@ const registerBoundsBundle = createProvider("RegisterBounds", {
|
|
|
301
277
|
return;
|
|
302
278
|
}
|
|
303
279
|
|
|
304
|
-
const
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
280
|
+
const hasPendingSource = pendingSourcePairKey
|
|
281
|
+
? getSource(pendingSourcePairKey, sharedBoundTag) !== null
|
|
282
|
+
: false;
|
|
283
|
+
const hasSource =
|
|
284
|
+
getSource(sourcePairKey, sharedBoundTag) !== null ||
|
|
285
|
+
(destinationPairKey
|
|
286
|
+
? getSource(destinationPairKey, sharedBoundTag) !== null
|
|
287
|
+
: false);
|
|
288
|
+
const hasDestination = destinationPairKey
|
|
289
|
+
? getDestination(destinationPairKey, sharedBoundTag) !== null
|
|
290
|
+
: false;
|
|
310
291
|
|
|
311
292
|
const wantsSetSource = !!shouldSetSource;
|
|
312
293
|
const wantsSetDestination = !!shouldSetDestination;
|
|
313
|
-
const
|
|
314
|
-
const wantsSnapshotOnly =
|
|
315
|
-
!wantsSetSource && !wantsSetDestination && !wantsUpdateSource;
|
|
294
|
+
const wantsSnapshotOnly = !wantsSetSource && !wantsSetDestination;
|
|
316
295
|
|
|
317
296
|
const canSetSource = wantsSetSource;
|
|
318
|
-
const canSetDestination =
|
|
319
|
-
|
|
297
|
+
const canSetDestination =
|
|
298
|
+
wantsSetDestination && (hasPendingSource || hasSource);
|
|
320
299
|
const canSnapshotOnly =
|
|
321
|
-
wantsSnapshotOnly &&
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
!canSetDestination &&
|
|
326
|
-
!canUpdateSource &&
|
|
327
|
-
!canSnapshotOnly
|
|
328
|
-
) {
|
|
300
|
+
wantsSnapshotOnly &&
|
|
301
|
+
(hasPendingSource || hasSource || hasDestination);
|
|
302
|
+
|
|
303
|
+
if (!canSetSource && !canSetDestination && !canSnapshotOnly) {
|
|
329
304
|
if (onPress) runOnJS(onPress)();
|
|
330
305
|
return;
|
|
331
306
|
}
|
|
@@ -339,15 +314,38 @@ const registerBoundsBundle = createProvider("RegisterBounds", {
|
|
|
339
314
|
emitUpdate();
|
|
340
315
|
|
|
341
316
|
applyMeasuredBoundsWrites({
|
|
342
|
-
sharedBoundTag,
|
|
317
|
+
entryTag: sharedBoundTag,
|
|
318
|
+
linkId: sharedBoundTag,
|
|
343
319
|
currentScreenKey,
|
|
344
320
|
measured,
|
|
345
321
|
preparedStyles,
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
322
|
+
linkWrite: canSetSource
|
|
323
|
+
? {
|
|
324
|
+
type: "source",
|
|
325
|
+
pairKey: sourcePairKey,
|
|
326
|
+
}
|
|
327
|
+
: canSetDestination && destinationPairKey
|
|
328
|
+
? {
|
|
329
|
+
type: "destination",
|
|
330
|
+
pairKey: destinationPairKey,
|
|
331
|
+
}
|
|
332
|
+
: undefined,
|
|
349
333
|
});
|
|
350
334
|
|
|
335
|
+
if (canSetSource && canSetDestination && destinationPairKey) {
|
|
336
|
+
applyMeasuredBoundsWrites({
|
|
337
|
+
entryTag: sharedBoundTag,
|
|
338
|
+
linkId: sharedBoundTag,
|
|
339
|
+
currentScreenKey,
|
|
340
|
+
measured,
|
|
341
|
+
preparedStyles,
|
|
342
|
+
linkWrite: {
|
|
343
|
+
type: "destination",
|
|
344
|
+
pairKey: destinationPairKey,
|
|
345
|
+
},
|
|
346
|
+
});
|
|
347
|
+
}
|
|
348
|
+
|
|
351
349
|
if (onPress) runOnJS(onPress)();
|
|
352
350
|
},
|
|
353
351
|
);
|
|
@@ -368,15 +366,6 @@ const registerBoundsBundle = createProvider("RegisterBounds", {
|
|
|
368
366
|
ancestorKeys,
|
|
369
367
|
});
|
|
370
368
|
|
|
371
|
-
// Re-measure source bounds when the destination screen (next in stack)
|
|
372
|
-
// starts closing. This fires at the instant the back animation begins,
|
|
373
|
-
// unlike useFocusEffect which fires too late (after the screen is removed
|
|
374
|
-
// from state).
|
|
375
|
-
const nextScreenKey = next?.route.key;
|
|
376
|
-
const nextClosing = nextScreenKey
|
|
377
|
-
? AnimationStore.getValue(nextScreenKey, "closing")
|
|
378
|
-
: null;
|
|
379
|
-
|
|
380
369
|
useParentSyncReaction({ parentContext, maybeMeasureAndStore });
|
|
381
370
|
|
|
382
371
|
const captureActiveOnPress = useStableCallback(() => {
|
|
@@ -390,19 +379,7 @@ const registerBoundsBundle = createProvider("RegisterBounds", {
|
|
|
390
379
|
|
|
391
380
|
return {
|
|
392
381
|
value: { updateSignal },
|
|
393
|
-
children: (
|
|
394
|
-
<>
|
|
395
|
-
{sharedBoundTag && remeasureOnFocus && nextClosing ? (
|
|
396
|
-
<CloseRemeasureReactionEffect
|
|
397
|
-
sharedBoundTag={sharedBoundTag}
|
|
398
|
-
remeasureOnFocus={remeasureOnFocus}
|
|
399
|
-
nextClosing={nextClosing}
|
|
400
|
-
maybeMeasureAndStore={maybeMeasureAndStore}
|
|
401
|
-
/>
|
|
402
|
-
) : null}
|
|
403
|
-
{children({ handleInitialLayout, captureActiveOnPress })}
|
|
404
|
-
</>
|
|
405
|
-
),
|
|
382
|
+
children: <>{children({ handleInitialLayout, captureActiveOnPress })}</>,
|
|
406
383
|
};
|
|
407
384
|
},
|
|
408
385
|
);
|
package/src/shared/providers/screen/animation/helpers/accessors/use-build-transition-accessor.ts
CHANGED
|
@@ -72,20 +72,6 @@ export const createTransitionAccessor = (
|
|
|
72
72
|
return {
|
|
73
73
|
...frame,
|
|
74
74
|
bounds: source.boundsAccessor,
|
|
75
|
-
transition: (target?: ScreenTransitionTarget) => {
|
|
76
|
-
"worklet";
|
|
77
|
-
const targetIndex = resolveTargetIndex(
|
|
78
|
-
target,
|
|
79
|
-
sourceIndex,
|
|
80
|
-
currentSources.length,
|
|
81
|
-
);
|
|
82
|
-
|
|
83
|
-
if (targetIndex === -1) {
|
|
84
|
-
return null;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
return buildScope(targetIndex);
|
|
88
|
-
},
|
|
89
75
|
};
|
|
90
76
|
};
|
|
91
77
|
|
|
@@ -38,6 +38,7 @@ export const buildScreenTransitionOptions = (
|
|
|
38
38
|
: undefined;
|
|
39
39
|
|
|
40
40
|
return {
|
|
41
|
+
navigationMaskEnabled: options.navigationMaskEnabled,
|
|
41
42
|
gestureEnabled: options.gestureEnabled,
|
|
42
43
|
experimental_allowDisabledGestureTracking:
|
|
43
44
|
options.experimental_allowDisabledGestureTracking,
|
|
@@ -18,11 +18,51 @@ import {
|
|
|
18
18
|
} from "./snap-points";
|
|
19
19
|
import type { BuiltState } from "./types";
|
|
20
20
|
|
|
21
|
-
export { computeLogicallySettled } from "./settle";
|
|
22
|
-
|
|
23
21
|
const LOGICAL_SETTLE_STICKY_PROGRESS_THRESHOLD =
|
|
24
22
|
LOGICAL_SETTLE_PROGRESS_THRESHOLD * 10;
|
|
25
23
|
|
|
24
|
+
const mergeTransitionOptions = (
|
|
25
|
+
base: ScreenTransitionOptions,
|
|
26
|
+
effective: ScreenTransitionOptions | undefined,
|
|
27
|
+
slot: ScreenTransitionOptions,
|
|
28
|
+
): ScreenTransitionOptions => {
|
|
29
|
+
"worklet";
|
|
30
|
+
if (!effective) {
|
|
31
|
+
return base;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
slot.navigationMaskEnabled =
|
|
35
|
+
effective.navigationMaskEnabled ?? base.navigationMaskEnabled;
|
|
36
|
+
slot.gestureEnabled = effective.gestureEnabled ?? base.gestureEnabled;
|
|
37
|
+
slot.experimental_allowDisabledGestureTracking =
|
|
38
|
+
effective.experimental_allowDisabledGestureTracking ??
|
|
39
|
+
base.experimental_allowDisabledGestureTracking;
|
|
40
|
+
slot.gestureDirection = effective.gestureDirection ?? base.gestureDirection;
|
|
41
|
+
slot.gestureSensitivity =
|
|
42
|
+
effective.gestureSensitivity ?? base.gestureSensitivity;
|
|
43
|
+
slot.gestureVelocityImpact =
|
|
44
|
+
effective.gestureVelocityImpact ?? base.gestureVelocityImpact;
|
|
45
|
+
slot.gestureSnapVelocityImpact =
|
|
46
|
+
effective.gestureSnapVelocityImpact ?? base.gestureSnapVelocityImpact;
|
|
47
|
+
slot.gestureReleaseVelocityScale =
|
|
48
|
+
effective.gestureReleaseVelocityScale ?? base.gestureReleaseVelocityScale;
|
|
49
|
+
slot.gestureResponseDistance =
|
|
50
|
+
effective.gestureResponseDistance ?? base.gestureResponseDistance;
|
|
51
|
+
slot.gestureProgressMode =
|
|
52
|
+
effective.gestureProgressMode ?? base.gestureProgressMode;
|
|
53
|
+
slot.gestureDrivesProgress =
|
|
54
|
+
effective.gestureDrivesProgress ?? base.gestureDrivesProgress;
|
|
55
|
+
slot.gestureActivationArea =
|
|
56
|
+
effective.gestureActivationArea ?? base.gestureActivationArea;
|
|
57
|
+
slot.gestureSnapLocked =
|
|
58
|
+
effective.gestureSnapLocked ?? base.gestureSnapLocked;
|
|
59
|
+
slot.sheetScrollGestureBehavior =
|
|
60
|
+
effective.sheetScrollGestureBehavior ?? base.sheetScrollGestureBehavior;
|
|
61
|
+
slot.backdropBehavior = effective.backdropBehavior ?? base.backdropBehavior;
|
|
62
|
+
|
|
63
|
+
return slot;
|
|
64
|
+
};
|
|
65
|
+
|
|
26
66
|
export const hydrateTransitionState = (
|
|
27
67
|
s: BuiltState,
|
|
28
68
|
dimensions: Layout,
|
|
@@ -31,6 +71,11 @@ export const hydrateTransitionState = (
|
|
|
31
71
|
"worklet";
|
|
32
72
|
const out = s.unwrapped;
|
|
33
73
|
const baseProgress = s.progress.get();
|
|
74
|
+
const options = mergeTransitionOptions(
|
|
75
|
+
s.options,
|
|
76
|
+
effectiveOptions,
|
|
77
|
+
s.optionsSlot,
|
|
78
|
+
);
|
|
34
79
|
out.willAnimate = s.willAnimate.get();
|
|
35
80
|
out.closing = s.closing.get();
|
|
36
81
|
out.entering = s.entering.get();
|
|
@@ -38,6 +83,7 @@ export const hydrateTransitionState = (
|
|
|
38
83
|
out.gesture.y = s.gesture.y.get();
|
|
39
84
|
out.gesture.normX = s.gesture.normX.get();
|
|
40
85
|
out.gesture.normY = s.gesture.normY.get();
|
|
86
|
+
out.gesture.velocity = s.gesture.velocity.get();
|
|
41
87
|
out.gesture.scale = s.gesture.scale.get();
|
|
42
88
|
out.gesture.normScale = s.gesture.normScale.get();
|
|
43
89
|
out.gesture.focalX = s.gesture.focalX.get();
|
|
@@ -124,11 +170,10 @@ export const hydrateTransitionState = (
|
|
|
124
170
|
computedLogicallySettled || shouldPreserveLogicalSettle ? 1 : 0;
|
|
125
171
|
|
|
126
172
|
out.meta = s.meta;
|
|
127
|
-
out.options =
|
|
173
|
+
out.options = options;
|
|
128
174
|
out.route = s.route;
|
|
129
175
|
out.layouts.screen.width = dimensions.width;
|
|
130
176
|
out.layouts.screen.height = dimensions.height;
|
|
131
|
-
out.layouts.navigationMaskEnabled = s.navigationMaskEnabled;
|
|
132
177
|
|
|
133
178
|
const content = s.measuredContentLayout.get();
|
|
134
179
|
|
|
@@ -17,7 +17,7 @@ export type BuiltState = {
|
|
|
17
17
|
route: BaseStackRoute;
|
|
18
18
|
meta?: Record<string, unknown>;
|
|
19
19
|
options: ScreenTransitionOptions;
|
|
20
|
-
|
|
20
|
+
optionsSlot: ScreenTransitionOptions;
|
|
21
21
|
targetProgress: SharedValue<number>;
|
|
22
22
|
logicalSettleFrameCount: SharedValue<number>;
|
|
23
23
|
resolvedAutoSnapPoint: SharedValue<number>;
|
|
@@ -20,10 +20,7 @@ import { hydrateTransitionState } from "./hydrate-transition-state";
|
|
|
20
20
|
import type { SelectedInterpolatorOptions } from "./selected-interpolator-options";
|
|
21
21
|
import { useBuildTransitionState } from "./use-build-transition-state";
|
|
22
22
|
|
|
23
|
-
export type ScreenInterpolatorFrame = Omit<
|
|
24
|
-
ScreenInterpolationProps,
|
|
25
|
-
"bounds" | "transition"
|
|
26
|
-
>;
|
|
23
|
+
export type ScreenInterpolatorFrame = Omit<ScreenInterpolationProps, "bounds">;
|
|
27
24
|
|
|
28
25
|
interface ScreenAnimationPipeline {
|
|
29
26
|
screenInterpolatorProps: SharedValue<ScreenInterpolatorFrame>;
|
|
@@ -39,7 +36,7 @@ const createInitialBaseInterpolatorProps = (
|
|
|
39
36
|
): ScreenInterpolatorFrame => {
|
|
40
37
|
const current = {
|
|
41
38
|
...DEFAULT_SCREEN_TRANSITION_STATE,
|
|
42
|
-
layouts: { screen: dimensions
|
|
39
|
+
layouts: { screen: dimensions },
|
|
43
40
|
};
|
|
44
41
|
|
|
45
42
|
return {
|
|
@@ -59,6 +59,7 @@ const areInterpolatorOptionsEqual = (
|
|
|
59
59
|
if (!left || !right) return false;
|
|
60
60
|
|
|
61
61
|
return (
|
|
62
|
+
left.navigationMaskEnabled === right.navigationMaskEnabled &&
|
|
62
63
|
left.gestureEnabled === right.gestureEnabled &&
|
|
63
64
|
left.experimental_allowDisabledGestureTracking ===
|
|
64
65
|
right.experimental_allowDisabledGestureTracking &&
|
|
@@ -27,7 +27,7 @@ type BuiltState = {
|
|
|
27
27
|
route: BaseStackRoute;
|
|
28
28
|
meta?: Record<string, unknown>;
|
|
29
29
|
options: ScreenTransitionOptions;
|
|
30
|
-
|
|
30
|
+
optionsSlot: ScreenTransitionOptions;
|
|
31
31
|
targetProgress: SharedValue<number>;
|
|
32
32
|
logicalSettleFrameCount: SharedValue<number>;
|
|
33
33
|
resolvedAutoSnapPoint: SharedValue<number>;
|
|
@@ -44,7 +44,6 @@ export const useBuildTransitionState = (
|
|
|
44
44
|
const key = descriptor?.route?.key;
|
|
45
45
|
const meta = descriptor?.options?.meta;
|
|
46
46
|
const route = descriptor?.route;
|
|
47
|
-
const navigationMaskEnabled = !!descriptor?.options?.navigationMaskEnabled;
|
|
48
47
|
const snapPoints = descriptor?.options?.snapPoints;
|
|
49
48
|
|
|
50
49
|
return useMemo(() => {
|
|
@@ -81,20 +80,12 @@ export const useBuildTransitionState = (
|
|
|
81
80
|
route: plainRoute,
|
|
82
81
|
meta: plainMeta,
|
|
83
82
|
options: transitionOptions,
|
|
84
|
-
|
|
83
|
+
optionsSlot: {},
|
|
85
84
|
unwrapped: createScreenTransitionState(
|
|
86
85
|
plainRoute,
|
|
87
86
|
plainMeta,
|
|
88
|
-
navigationMaskEnabled,
|
|
89
87
|
transitionOptions,
|
|
90
88
|
),
|
|
91
89
|
};
|
|
92
|
-
}, [
|
|
93
|
-
key,
|
|
94
|
-
meta,
|
|
95
|
-
route,
|
|
96
|
-
snapPoints,
|
|
97
|
-
navigationMaskEnabled,
|
|
98
|
-
descriptor?.options,
|
|
99
|
-
]);
|
|
90
|
+
}, [key, meta, route, snapPoints, descriptor?.options]);
|
|
100
91
|
};
|
|
@@ -2,7 +2,10 @@ import { clamp } from "react-native-reanimated";
|
|
|
2
2
|
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
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
normalizeGestureTranslation,
|
|
7
|
+
resolveGestureVelocity,
|
|
8
|
+
} from "../shared/physics";
|
|
6
9
|
import type {
|
|
7
10
|
GestureDimensions,
|
|
8
11
|
PanGestureEvent,
|
|
@@ -36,6 +39,7 @@ export const startPanBase = (runtime: PanGestureRuntime) => {
|
|
|
36
39
|
gestures.y.set(0);
|
|
37
40
|
gestures.normX.set(0);
|
|
38
41
|
gestures.normY.set(0);
|
|
42
|
+
gestures.velocity.set(0);
|
|
39
43
|
gestures.raw.x.set(0);
|
|
40
44
|
gestures.raw.y.set(0);
|
|
41
45
|
gestures.raw.normX.set(0);
|
|
@@ -51,18 +55,28 @@ export const trackPanGesture = (
|
|
|
51
55
|
): PanTrackState => {
|
|
52
56
|
"worklet";
|
|
53
57
|
const { translationX: x, translationY: y } = event;
|
|
54
|
-
const {
|
|
58
|
+
const {
|
|
59
|
+
translationX: rawX,
|
|
60
|
+
translationY: rawY,
|
|
61
|
+
velocityX,
|
|
62
|
+
velocityY,
|
|
63
|
+
} = rawEvent;
|
|
55
64
|
const { width, height } = dimensions;
|
|
56
65
|
|
|
57
66
|
const normX = clamp(normalizeGestureTranslation(x, width), -1, 1);
|
|
58
67
|
const normY = clamp(normalizeGestureTranslation(y, height), -1, 1);
|
|
59
68
|
const rawNormX = clamp(normalizeGestureTranslation(rawX, width), -1, 1);
|
|
60
69
|
const rawNormY = clamp(normalizeGestureTranslation(rawY, height), -1, 1);
|
|
70
|
+
const velocity = resolveGestureVelocity(
|
|
71
|
+
velocityX / Math.max(1, width),
|
|
72
|
+
velocityY / Math.max(1, height),
|
|
73
|
+
);
|
|
61
74
|
|
|
62
75
|
gestures.x.set(x);
|
|
63
76
|
gestures.y.set(y);
|
|
64
77
|
gestures.normX.set(normX);
|
|
65
78
|
gestures.normY.set(normY);
|
|
79
|
+
gestures.velocity.set(velocity);
|
|
66
80
|
gestures.raw.x.set(rawX);
|
|
67
81
|
gestures.raw.y.set(rawY);
|
|
68
82
|
gestures.raw.normX.set(rawNormX);
|
|
@@ -73,6 +87,7 @@ export const trackPanGesture = (
|
|
|
73
87
|
y,
|
|
74
88
|
normX,
|
|
75
89
|
normY,
|
|
90
|
+
velocity,
|
|
76
91
|
};
|
|
77
92
|
};
|
|
78
93
|
|
|
@@ -102,6 +117,7 @@ export const finalizePanRelease = (
|
|
|
102
117
|
velocityY: plan.resetVelocityY,
|
|
103
118
|
velocityNormX: plan.resetVelocityNormX,
|
|
104
119
|
velocityNormY: plan.resetVelocityNormY,
|
|
120
|
+
releaseVelocity: plan.releaseVelocity,
|
|
105
121
|
resetNormalizedValues: plan.resetNormalizedValues,
|
|
106
122
|
resetNormalizedValuesImmediately: plan.resetNormalizedValuesImmediately,
|
|
107
123
|
preserveRawValues: plan.preserveRawValues,
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
import {
|
|
7
7
|
getPanReleaseHandoffVelocity,
|
|
8
8
|
getPanReleaseProgressVelocity,
|
|
9
|
+
resolveGestureVelocity,
|
|
9
10
|
} from "../shared/physics";
|
|
10
11
|
import {
|
|
11
12
|
getProgressVelocityTowardTarget,
|
|
@@ -24,6 +25,26 @@ import type {
|
|
|
24
25
|
PanReleaseResult,
|
|
25
26
|
} from "../types";
|
|
26
27
|
|
|
28
|
+
const resolvePanReleaseVelocity = (
|
|
29
|
+
runtime: PanGestureRuntime,
|
|
30
|
+
velocityNormX: number,
|
|
31
|
+
velocityNormY: number,
|
|
32
|
+
) => {
|
|
33
|
+
"worklet";
|
|
34
|
+
const activeGesture = runtime.stores.gestures.active.get();
|
|
35
|
+
|
|
36
|
+
switch (activeGesture) {
|
|
37
|
+
case "horizontal":
|
|
38
|
+
case "horizontal-inverted":
|
|
39
|
+
return resolveGestureVelocity(velocityNormX, 0);
|
|
40
|
+
case "vertical":
|
|
41
|
+
case "vertical-inverted":
|
|
42
|
+
return resolveGestureVelocity(0, velocityNormY);
|
|
43
|
+
default:
|
|
44
|
+
return resolveGestureVelocity(velocityNormX, velocityNormY);
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
|
|
27
48
|
const resolveActivePanSnapAxis = (runtime: PanGestureRuntime) => {
|
|
28
49
|
"worklet";
|
|
29
50
|
const activeGesture = runtime.stores.gestures.active.get();
|
|
@@ -226,6 +247,17 @@ export const buildPanReleasePlan = (
|
|
|
226
247
|
resetVelocityScale === 0 ? 0 : rawEvent.velocityX * resetVelocityScale;
|
|
227
248
|
const resetVelocityY =
|
|
228
249
|
resetVelocityScale === 0 ? 0 : rawEvent.velocityY * resetVelocityScale;
|
|
250
|
+
const releaseVelocityNormX =
|
|
251
|
+
rawEvent.velocityX / Math.max(1, dimensions.width);
|
|
252
|
+
const releaseVelocityNormY =
|
|
253
|
+
rawEvent.velocityY / Math.max(1, dimensions.height);
|
|
254
|
+
const releaseVelocity = release.shouldDismiss
|
|
255
|
+
? resolvePanReleaseVelocity(
|
|
256
|
+
runtime,
|
|
257
|
+
releaseVelocityNormX,
|
|
258
|
+
releaseVelocityNormY,
|
|
259
|
+
)
|
|
260
|
+
: 0;
|
|
229
261
|
|
|
230
262
|
return {
|
|
231
263
|
target: release.target,
|
|
@@ -235,6 +267,7 @@ export const buildPanReleasePlan = (
|
|
|
235
267
|
resetVelocityY,
|
|
236
268
|
resetVelocityNormX: resetVelocityX / Math.max(1, dimensions.width),
|
|
237
269
|
resetVelocityNormY: resetVelocityY / Math.max(1, dimensions.height),
|
|
270
|
+
releaseVelocity,
|
|
238
271
|
resetNormalizedValues: !release.shouldDismiss || progressDriven,
|
|
239
272
|
resetNormalizedValuesImmediately:
|
|
240
273
|
release.resetNormalizedValuesImmediately === true,
|
|
@@ -15,6 +15,7 @@ interface ResetPanGestureValuesProps {
|
|
|
15
15
|
velocityY?: number;
|
|
16
16
|
velocityNormX?: number;
|
|
17
17
|
velocityNormY?: number;
|
|
18
|
+
releaseVelocity?: number;
|
|
18
19
|
resetNormalizedValues?: boolean;
|
|
19
20
|
resetNormalizedValuesImmediately?: boolean;
|
|
20
21
|
preserveRawValues?: boolean;
|
|
@@ -42,6 +43,7 @@ export const resetPanGestureValues = ({
|
|
|
42
43
|
velocityY,
|
|
43
44
|
velocityNormX,
|
|
44
45
|
velocityNormY,
|
|
46
|
+
releaseVelocity,
|
|
45
47
|
resetNormalizedValues = true,
|
|
46
48
|
resetNormalizedValuesImmediately = false,
|
|
47
49
|
preserveRawValues = shouldDismiss,
|
|
@@ -58,6 +60,7 @@ export const resetPanGestureValues = ({
|
|
|
58
60
|
gestures.dragging.set(FALSE);
|
|
59
61
|
gestures.dismissing.set(shouldDismiss ? TRUE : FALSE);
|
|
60
62
|
gestures.settling.set(shouldDismiss ? FALSE : TRUE);
|
|
63
|
+
gestures.velocity.set(shouldDismiss ? (releaseVelocity ?? 0) : 0);
|
|
61
64
|
|
|
62
65
|
animateResetValue(gestures.x, 0, getGestureResetSpec(spec, velocityX), () =>
|
|
63
66
|
clearPanSettlingIfResting(gestures),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useCallback } from "react";
|
|
1
|
+
import { useCallback, useMemo } from "react";
|
|
2
2
|
import type { SharedValue } from "react-native-reanimated";
|
|
3
3
|
import { useNavigationHelpers } from "../../../../hooks/navigation/use-navigation-helpers";
|
|
4
4
|
import type { ScreenOptionsContextValue } from "../../options";
|
|
@@ -81,9 +81,12 @@ export const usePanBehavior = (
|
|
|
81
81
|
[runtime, screenOptions, dimensions, dismissScreen, withSensitivity],
|
|
82
82
|
);
|
|
83
83
|
|
|
84
|
-
return
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
84
|
+
return useMemo(
|
|
85
|
+
() => ({
|
|
86
|
+
onStart,
|
|
87
|
+
onUpdate,
|
|
88
|
+
onEnd,
|
|
89
|
+
}),
|
|
90
|
+
[onStart, onUpdate, onEnd],
|
|
91
|
+
);
|
|
89
92
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useCallback } from "react";
|
|
1
|
+
import { useCallback, useMemo } from "react";
|
|
2
2
|
import type {
|
|
3
3
|
GestureStateManager,
|
|
4
4
|
GestureTouchEvent,
|
|
@@ -68,5 +68,8 @@ export const usePinchActivation = ({
|
|
|
68
68
|
[runtime, screenOptions],
|
|
69
69
|
);
|
|
70
70
|
|
|
71
|
-
return
|
|
71
|
+
return useMemo(
|
|
72
|
+
() => ({ onTouchesDown, onTouchesMove }),
|
|
73
|
+
[onTouchesDown, onTouchesMove],
|
|
74
|
+
);
|
|
72
75
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useCallback } from "react";
|
|
1
|
+
import { useCallback, useMemo } from "react";
|
|
2
2
|
import type { SharedValue } from "react-native-reanimated";
|
|
3
3
|
import { useNavigationHelpers } from "../../../../hooks/navigation/use-navigation-helpers";
|
|
4
4
|
import type { ScreenOptionsContextValue } from "../../options";
|
|
@@ -74,9 +74,12 @@ export const usePinchBehavior = (
|
|
|
74
74
|
[runtime, screenOptions, dismissScreen, withSensitivity],
|
|
75
75
|
);
|
|
76
76
|
|
|
77
|
-
return
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
77
|
+
return useMemo(
|
|
78
|
+
() => ({
|
|
79
|
+
onStart,
|
|
80
|
+
onUpdate,
|
|
81
|
+
onEnd,
|
|
82
|
+
}),
|
|
83
|
+
[onStart, onUpdate, onEnd],
|
|
84
|
+
);
|
|
82
85
|
};
|