react-native-screen-transitions 3.11.2 → 3.12.0
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/blank-stack/components/stack-view.js +1 -2
- package/lib/commonjs/blank-stack/components/stack-view.js.map +1 -1
- package/lib/commonjs/component-stack/components/stack-view.js +1 -2
- package/lib/commonjs/component-stack/components/stack-view.js.map +1 -1
- package/lib/commonjs/native-stack/views/NativeStackView.native.js +3 -4
- package/lib/commonjs/native-stack/views/NativeStackView.native.js.map +1 -1
- package/lib/commonjs/shared/adapters/with-screen-transitions/stack-layout.js +1 -1
- package/lib/commonjs/shared/adapters/with-screen-transitions/stack-layout.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/components/boundary-lifecycle.js +36 -0
- package/lib/commonjs/shared/components/boundary/components/boundary-lifecycle.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js +1 -13
- package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-refresh-boundary.js +9 -2
- package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-refresh-boundary.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/hooks/use-boundary-measurement.js +3 -2
- package/lib/commonjs/shared/components/boundary/hooks/use-boundary-measurement.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/hooks/use-measurer.js +9 -2
- package/lib/commonjs/shared/components/boundary/hooks/use-measurer.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js +7 -4
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/components/host.js +5 -12
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/components/host.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.js +25 -43
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/helpers/local-measurement.js +13 -0
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/helpers/local-measurement.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/helpers/offset-style.js +8 -31
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/helpers/offset-style.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/hooks/use-active-portal-boundary-host.js +14 -19
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/hooks/use-active-portal-boundary-host.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js +8 -0
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/hooks/use-host-measurement.js +19 -47
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/hooks/use-host-measurement.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/index.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/stores/portal-boundary-host.store.js +1 -1
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/stores/portal-boundary-host.store.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/providers/boundary-root.provider.js +19 -17
- package/lib/commonjs/shared/components/boundary/providers/boundary-root.provider.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/utils/refresh-signals.js +19 -5
- package/lib/commonjs/shared/components/boundary/utils/refresh-signals.js.map +1 -1
- package/lib/commonjs/shared/components/overlay/helpers/create-overlay-interpolator-frame.js +30 -0
- package/lib/commonjs/shared/components/overlay/helpers/create-overlay-interpolator-frame.js.map +1 -0
- package/lib/commonjs/shared/components/overlay/helpers/get-active-overlay.js +40 -22
- package/lib/commonjs/shared/components/overlay/helpers/get-active-overlay.js.map +1 -1
- package/lib/commonjs/shared/components/overlay/helpers/retain-ready-overlay-resources.js +21 -0
- package/lib/commonjs/shared/components/overlay/helpers/retain-ready-overlay-resources.js.map +1 -0
- package/lib/commonjs/shared/components/overlay/helpers/run-overlay-slot-interpolator.js +41 -0
- package/lib/commonjs/shared/components/overlay/helpers/run-overlay-slot-interpolator.js.map +1 -0
- package/lib/commonjs/shared/components/overlay/hooks/use-overlay-slot.js +85 -0
- package/lib/commonjs/shared/components/overlay/hooks/use-overlay-slot.js.map +1 -0
- package/lib/commonjs/shared/components/overlay/variations/float-overlay.js +14 -65
- package/lib/commonjs/shared/components/overlay/variations/float-overlay.js.map +1 -1
- package/lib/commonjs/shared/components/overlay/variations/overlay-host.js +89 -16
- package/lib/commonjs/shared/components/overlay/variations/overlay-host.js.map +1 -1
- package/lib/commonjs/shared/components/screen-container/layers/backdrop.js +11 -7
- package/lib/commonjs/shared/components/screen-container/layers/backdrop.js.map +1 -1
- package/lib/commonjs/shared/components/screen-lifecycle/hooks/helpers/close-interception-rules.js +31 -0
- package/lib/commonjs/shared/components/screen-lifecycle/hooks/helpers/close-interception-rules.js.map +1 -0
- package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-close-completion.js +26 -0
- package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-close-completion.js.map +1 -0
- package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-close-transition-intent.js +64 -87
- package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-close-transition-intent.js.map +1 -1
- package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-transition-start-controller.js +1 -5
- package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-transition-start-controller.js.map +1 -1
- package/lib/commonjs/shared/components/screen-lifecycle/index.js +9 -6
- package/lib/commonjs/shared/components/screen-lifecycle/index.js.map +1 -1
- package/lib/commonjs/shared/hooks/navigation/use-navigation-helpers.js +28 -6
- package/lib/commonjs/shared/hooks/navigation/use-navigation-helpers.js.map +1 -1
- package/lib/commonjs/shared/providers/helpers/measured-bounds-writes.js +1 -2
- package/lib/commonjs/shared/providers/helpers/measured-bounds-writes.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/animation/animation.provider.js +10 -7
- package/lib/commonjs/shared/providers/screen/animation/animation.provider.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/animation/helpers/accessors/use-build-transition-accessor.js +6 -8
- package/lib/commonjs/shared/providers/screen/animation/helpers/accessors/use-build-transition-accessor.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/animation/use-screen-animation.js +8 -2
- package/lib/commonjs/shared/providers/screen/animation/use-screen-animation.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/gestures.provider.js +9 -5
- package/lib/commonjs/shared/providers/screen/gestures/gestures.provider.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/hooks/use-screen-gesture-config.js +10 -5
- package/lib/commonjs/shared/providers/screen/gestures/hooks/use-screen-gesture-config.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/ownership/{use-walk-up-and-register-shadowing-claims.js → gesture-ownership-bridge.js} +36 -50
- package/lib/commonjs/shared/providers/screen/gestures/ownership/gesture-ownership-bridge.js.map +1 -0
- package/lib/commonjs/shared/providers/screen/gestures/pan/behavior/pan-lifecycle.js +4 -5
- package/lib/commonjs/shared/providers/screen/gestures/pan/behavior/pan-lifecycle.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.js +2 -3
- package/lib/commonjs/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.js +4 -5
- package/lib/commonjs/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/pinch/behavior/use-pinch-behavior.js +2 -3
- package/lib/commonjs/shared/providers/screen/gestures/pinch/behavior/use-pinch-behavior.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/shared/policy.js +9 -5
- package/lib/commonjs/shared/providers/screen/gestures/shared/policy.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/styles/constants.js +1 -0
- package/lib/commonjs/shared/providers/screen/styles/constants.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/styles/helpers/transition-visual-state.js +20 -1
- package/lib/commonjs/shared/providers/screen/styles/helpers/transition-visual-state.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/styles/hooks/slot-resolvers.js +14 -15
- package/lib/commonjs/shared/providers/screen/styles/hooks/slot-resolvers.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js +34 -11
- package/lib/commonjs/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/styles/slot.provider.js +18 -29
- package/lib/commonjs/shared/providers/screen/styles/slot.provider.js.map +1 -1
- package/lib/commonjs/shared/providers/stack/blank-stack-state/blank-stack-controller.js +5 -1
- package/lib/commonjs/shared/providers/stack/blank-stack-state/blank-stack-controller.js.map +1 -1
- package/lib/commonjs/shared/providers/stack/blank-stack-state/helpers/resolve-presented-index.js +18 -0
- package/lib/commonjs/shared/providers/stack/blank-stack-state/helpers/resolve-presented-index.js.map +1 -0
- package/lib/commonjs/shared/providers/stack/blank-stack.provider.js +2 -1
- package/lib/commonjs/shared/providers/stack/blank-stack.provider.js.map +1 -1
- package/lib/commonjs/shared/stores/bounds/internals/links.js +1 -1
- package/lib/commonjs/shared/stores/bounds/internals/links.js.map +1 -1
- package/lib/commonjs/shared/stores/system.store.js +1 -2
- package/lib/commonjs/shared/stores/system.store.js.map +1 -1
- package/lib/commonjs/shared/utils/animation/animate-to-progress.js +0 -22
- package/lib/commonjs/shared/utils/animation/animate-to-progress.js.map +1 -1
- package/lib/commonjs/shared/utils/create-provider.js +119 -10
- package/lib/commonjs/shared/utils/create-provider.js.map +1 -1
- package/lib/commonjs/shared/utils/navigation/close-action-replay.js +22 -0
- package/lib/commonjs/shared/utils/navigation/close-action-replay.js.map +1 -0
- package/lib/module/blank-stack/components/stack-view.js +1 -2
- package/lib/module/blank-stack/components/stack-view.js.map +1 -1
- package/lib/module/component-stack/components/stack-view.js +1 -2
- package/lib/module/component-stack/components/stack-view.js.map +1 -1
- package/lib/module/native-stack/views/NativeStackView.native.js +3 -4
- package/lib/module/native-stack/views/NativeStackView.native.js.map +1 -1
- package/lib/module/shared/adapters/with-screen-transitions/stack-layout.js +1 -1
- package/lib/module/shared/adapters/with-screen-transitions/stack-layout.js.map +1 -1
- package/lib/module/shared/components/boundary/components/boundary-lifecycle.js +32 -0
- package/lib/module/shared/components/boundary/components/boundary-lifecycle.js.map +1 -0
- package/lib/module/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js +1 -13
- package/lib/module/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js.map +1 -1
- package/lib/module/shared/components/boundary/hooks/lifecycles/use-refresh-boundary.js +9 -2
- package/lib/module/shared/components/boundary/hooks/lifecycles/use-refresh-boundary.js.map +1 -1
- package/lib/module/shared/components/boundary/hooks/use-boundary-measurement.js +3 -2
- package/lib/module/shared/components/boundary/hooks/use-boundary-measurement.js.map +1 -1
- package/lib/module/shared/components/boundary/hooks/use-measurer.js +9 -2
- package/lib/module/shared/components/boundary/hooks/use-measurer.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js +7 -4
- package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/components/host.js +5 -12
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/components/host.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.js +27 -45
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/helpers/local-measurement.js +8 -0
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/helpers/local-measurement.js.map +1 -0
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/helpers/offset-style.js +8 -32
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/helpers/offset-style.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/hooks/use-active-portal-boundary-host.js +15 -20
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/hooks/use-active-portal-boundary-host.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js +8 -0
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/hooks/use-host-measurement.js +20 -48
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/hooks/use-host-measurement.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/index.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/stores/portal-boundary-host.store.js +1 -1
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/stores/portal-boundary-host.store.js.map +1 -1
- package/lib/module/shared/components/boundary/providers/boundary-root.provider.js +20 -18
- package/lib/module/shared/components/boundary/providers/boundary-root.provider.js.map +1 -1
- package/lib/module/shared/components/boundary/utils/refresh-signals.js +19 -5
- package/lib/module/shared/components/boundary/utils/refresh-signals.js.map +1 -1
- package/lib/module/shared/components/overlay/helpers/create-overlay-interpolator-frame.js +25 -0
- package/lib/module/shared/components/overlay/helpers/create-overlay-interpolator-frame.js.map +1 -0
- package/lib/module/shared/components/overlay/helpers/get-active-overlay.js +37 -21
- package/lib/module/shared/components/overlay/helpers/get-active-overlay.js.map +1 -1
- package/lib/module/shared/components/overlay/helpers/retain-ready-overlay-resources.js +17 -0
- package/lib/module/shared/components/overlay/helpers/retain-ready-overlay-resources.js.map +1 -0
- package/lib/module/shared/components/overlay/helpers/run-overlay-slot-interpolator.js +36 -0
- package/lib/module/shared/components/overlay/helpers/run-overlay-slot-interpolator.js.map +1 -0
- package/lib/module/shared/components/overlay/hooks/use-overlay-slot.js +80 -0
- package/lib/module/shared/components/overlay/hooks/use-overlay-slot.js.map +1 -0
- package/lib/module/shared/components/overlay/variations/float-overlay.js +15 -66
- package/lib/module/shared/components/overlay/variations/float-overlay.js.map +1 -1
- package/lib/module/shared/components/overlay/variations/overlay-host.js +90 -18
- package/lib/module/shared/components/overlay/variations/overlay-host.js.map +1 -1
- package/lib/module/shared/components/screen-container/layers/backdrop.js +12 -8
- package/lib/module/shared/components/screen-container/layers/backdrop.js.map +1 -1
- package/lib/module/shared/components/screen-lifecycle/hooks/helpers/close-interception-rules.js +25 -0
- package/lib/module/shared/components/screen-lifecycle/hooks/helpers/close-interception-rules.js.map +1 -0
- package/lib/module/shared/components/screen-lifecycle/hooks/use-close-completion.js +21 -0
- package/lib/module/shared/components/screen-lifecycle/hooks/use-close-completion.js.map +1 -0
- package/lib/module/shared/components/screen-lifecycle/hooks/use-close-transition-intent.js +64 -86
- package/lib/module/shared/components/screen-lifecycle/hooks/use-close-transition-intent.js.map +1 -1
- package/lib/module/shared/components/screen-lifecycle/hooks/use-transition-start-controller.js +1 -5
- package/lib/module/shared/components/screen-lifecycle/hooks/use-transition-start-controller.js.map +1 -1
- package/lib/module/shared/components/screen-lifecycle/index.js +9 -6
- package/lib/module/shared/components/screen-lifecycle/index.js.map +1 -1
- package/lib/module/shared/hooks/navigation/use-navigation-helpers.js +29 -7
- package/lib/module/shared/hooks/navigation/use-navigation-helpers.js.map +1 -1
- package/lib/module/shared/providers/helpers/measured-bounds-writes.js +1 -2
- package/lib/module/shared/providers/helpers/measured-bounds-writes.js.map +1 -1
- package/lib/module/shared/providers/screen/animation/animation.provider.js +10 -7
- package/lib/module/shared/providers/screen/animation/animation.provider.js.map +1 -1
- package/lib/module/shared/providers/screen/animation/helpers/accessors/use-build-transition-accessor.js +6 -8
- package/lib/module/shared/providers/screen/animation/helpers/accessors/use-build-transition-accessor.js.map +1 -1
- package/lib/module/shared/providers/screen/animation/use-screen-animation.js +8 -2
- package/lib/module/shared/providers/screen/animation/use-screen-animation.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/gestures.provider.js +10 -6
- package/lib/module/shared/providers/screen/gestures/gestures.provider.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/hooks/use-screen-gesture-config.js +10 -5
- package/lib/module/shared/providers/screen/gestures/hooks/use-screen-gesture-config.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/ownership/{use-walk-up-and-register-shadowing-claims.js → gesture-ownership-bridge.js} +35 -49
- package/lib/module/shared/providers/screen/gestures/ownership/gesture-ownership-bridge.js.map +1 -0
- package/lib/module/shared/providers/screen/gestures/pan/behavior/pan-lifecycle.js +4 -5
- package/lib/module/shared/providers/screen/gestures/pan/behavior/pan-lifecycle.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.js +2 -3
- package/lib/module/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.js +4 -5
- package/lib/module/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/pinch/behavior/use-pinch-behavior.js +2 -3
- package/lib/module/shared/providers/screen/gestures/pinch/behavior/use-pinch-behavior.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/shared/policy.js +9 -5
- package/lib/module/shared/providers/screen/gestures/shared/policy.js.map +1 -1
- package/lib/module/shared/providers/screen/styles/constants.js +1 -0
- package/lib/module/shared/providers/screen/styles/constants.js.map +1 -1
- package/lib/module/shared/providers/screen/styles/helpers/transition-visual-state.js +18 -0
- package/lib/module/shared/providers/screen/styles/helpers/transition-visual-state.js.map +1 -1
- package/lib/module/shared/providers/screen/styles/hooks/slot-resolvers.js +14 -15
- package/lib/module/shared/providers/screen/styles/hooks/slot-resolvers.js.map +1 -1
- package/lib/module/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js +35 -12
- package/lib/module/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js.map +1 -1
- package/lib/module/shared/providers/screen/styles/slot.provider.js +19 -30
- package/lib/module/shared/providers/screen/styles/slot.provider.js.map +1 -1
- package/lib/module/shared/providers/stack/blank-stack-state/blank-stack-controller.js +5 -1
- package/lib/module/shared/providers/stack/blank-stack-state/blank-stack-controller.js.map +1 -1
- package/lib/module/shared/providers/stack/blank-stack-state/helpers/resolve-presented-index.js +14 -0
- package/lib/module/shared/providers/stack/blank-stack-state/helpers/resolve-presented-index.js.map +1 -0
- package/lib/module/shared/providers/stack/blank-stack.provider.js +2 -1
- package/lib/module/shared/providers/stack/blank-stack.provider.js.map +1 -1
- package/lib/module/shared/stores/bounds/internals/links.js +1 -1
- package/lib/module/shared/stores/bounds/internals/links.js.map +1 -1
- package/lib/module/shared/stores/system.store.js +1 -2
- package/lib/module/shared/stores/system.store.js.map +1 -1
- package/lib/module/shared/types/animation.types.js.map +1 -1
- package/lib/module/shared/utils/animation/animate-to-progress.js +0 -22
- package/lib/module/shared/utils/animation/animate-to-progress.js.map +1 -1
- package/lib/module/shared/utils/create-provider.js +119 -10
- package/lib/module/shared/utils/create-provider.js.map +1 -1
- package/lib/module/shared/utils/navigation/close-action-replay.js +16 -0
- package/lib/module/shared/utils/navigation/close-action-replay.js.map +1 -0
- package/lib/typescript/blank-stack/components/stack-view.d.ts.map +1 -1
- package/lib/typescript/blank-stack/types.d.ts +1 -1
- package/lib/typescript/blank-stack/types.d.ts.map +1 -1
- package/lib/typescript/component-stack/components/stack-view.d.ts.map +1 -1
- package/lib/typescript/component-stack/types.d.ts +1 -1
- package/lib/typescript/component-stack/types.d.ts.map +1 -1
- package/lib/typescript/native-stack/types.d.ts +1 -1
- package/lib/typescript/native-stack/types.d.ts.map +1 -1
- package/lib/typescript/native-stack/views/NativeStackView.native.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/components/boundary-lifecycle.d.ts +18 -0
- package/lib/typescript/shared/components/boundary/components/boundary-lifecycle.d.ts.map +1 -0
- package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.d.ts +1 -2
- package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-refresh-boundary.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/hooks/use-boundary-measurement.d.ts +3 -2
- package/lib/typescript/shared/components/boundary/hooks/use-boundary-measurement.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/hooks/use-measurer.d.ts +3 -2
- package/lib/typescript/shared/components/boundary/hooks/use-measurer.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/components/host.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.d.ts +5 -1
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/helpers/local-measurement.d.ts +4 -0
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/helpers/local-measurement.d.ts.map +1 -0
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/helpers/offset-style.d.ts +4 -17
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/helpers/offset-style.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/hooks/use-active-portal-boundary-host.d.ts +3 -1
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/hooks/use-active-portal-boundary-host.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/hooks/use-host-measurement.d.ts +5 -9
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/hooks/use-host-measurement.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/stores/portal-boundary-host.store.d.ts +2 -1
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/stores/portal-boundary-host.store.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/providers/boundary-root.provider.d.ts +2 -1
- package/lib/typescript/shared/components/boundary/providers/boundary-root.provider.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/types.d.ts +6 -0
- package/lib/typescript/shared/components/boundary/types.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/utils/refresh-signals.d.ts +1 -0
- package/lib/typescript/shared/components/boundary/utils/refresh-signals.d.ts.map +1 -1
- package/lib/typescript/shared/components/overlay/helpers/create-overlay-interpolator-frame.d.ts +7 -0
- package/lib/typescript/shared/components/overlay/helpers/create-overlay-interpolator-frame.d.ts.map +1 -0
- package/lib/typescript/shared/components/overlay/helpers/get-active-overlay.d.ts +17 -7
- package/lib/typescript/shared/components/overlay/helpers/get-active-overlay.d.ts.map +1 -1
- package/lib/typescript/shared/components/overlay/helpers/retain-ready-overlay-resources.d.ts +11 -0
- package/lib/typescript/shared/components/overlay/helpers/retain-ready-overlay-resources.d.ts.map +1 -0
- package/lib/typescript/shared/components/overlay/helpers/run-overlay-slot-interpolator.d.ts +8 -0
- package/lib/typescript/shared/components/overlay/helpers/run-overlay-slot-interpolator.d.ts.map +1 -0
- package/lib/typescript/shared/components/overlay/hooks/use-overlay-slot.d.ts +15 -0
- package/lib/typescript/shared/components/overlay/hooks/use-overlay-slot.d.ts.map +1 -0
- package/lib/typescript/shared/components/overlay/variations/float-overlay.d.ts +1 -1
- package/lib/typescript/shared/components/overlay/variations/float-overlay.d.ts.map +1 -1
- package/lib/typescript/shared/components/overlay/variations/overlay-host.d.ts +7 -6
- package/lib/typescript/shared/components/overlay/variations/overlay-host.d.ts.map +1 -1
- package/lib/typescript/shared/components/screen-container/layers/backdrop.d.ts.map +1 -1
- package/lib/typescript/shared/components/screen-lifecycle/hooks/helpers/close-interception-rules.d.ts +27 -0
- package/lib/typescript/shared/components/screen-lifecycle/hooks/helpers/close-interception-rules.d.ts.map +1 -0
- package/lib/typescript/shared/components/screen-lifecycle/hooks/use-close-completion.d.ts +7 -0
- package/lib/typescript/shared/components/screen-lifecycle/hooks/use-close-completion.d.ts.map +1 -0
- package/lib/typescript/shared/components/screen-lifecycle/hooks/use-close-transition-intent.d.ts +2 -7
- package/lib/typescript/shared/components/screen-lifecycle/hooks/use-close-transition-intent.d.ts.map +1 -1
- package/lib/typescript/shared/components/screen-lifecycle/hooks/use-transition-start-controller.d.ts +1 -3
- package/lib/typescript/shared/components/screen-lifecycle/hooks/use-transition-start-controller.d.ts.map +1 -1
- package/lib/typescript/shared/components/screen-lifecycle/index.d.ts.map +1 -1
- package/lib/typescript/shared/hooks/navigation/use-navigation-helpers.d.ts +1 -0
- package/lib/typescript/shared/hooks/navigation/use-navigation-helpers.d.ts.map +1 -1
- package/lib/typescript/shared/index.d.ts +12 -12
- package/lib/typescript/shared/index.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/animation/animation.provider.d.ts +4 -0
- package/lib/typescript/shared/providers/screen/animation/animation.provider.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/animation/helpers/accessors/use-build-transition-accessor.d.ts +4 -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/use-screen-animation.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-screen-gesture-config.d.ts +2 -2
- package/lib/typescript/shared/providers/screen/gestures/hooks/use-screen-gesture-config.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/ownership/gesture-ownership-bridge.d.ts +3 -0
- package/lib/typescript/shared/providers/screen/gestures/ownership/gesture-ownership-bridge.d.ts.map +1 -0
- package/lib/typescript/shared/providers/screen/gestures/pan/behavior/pan-lifecycle.d.ts +1 -1
- 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/use-pan-behavior.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.d.ts +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/use-pinch-behavior.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/shared/policy.d.ts +2 -1
- 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/styles/constants.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/styles/helpers/transition-visual-state.d.ts +7 -0
- package/lib/typescript/shared/providers/screen/styles/helpers/transition-visual-state.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/styles/hooks/slot-resolvers.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/styles/hooks/use-interpolated-style-maps.d.ts +1 -1
- package/lib/typescript/shared/providers/screen/styles/hooks/use-interpolated-style-maps.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/styles/slot.provider.d.ts +5 -5
- package/lib/typescript/shared/providers/screen/styles/slot.provider.d.ts.map +1 -1
- package/lib/typescript/shared/providers/stack/blank-stack-state/blank-stack-controller.d.ts.map +1 -1
- package/lib/typescript/shared/providers/stack/blank-stack-state/helpers/resolve-presented-index.d.ts +3 -0
- package/lib/typescript/shared/providers/stack/blank-stack-state/helpers/resolve-presented-index.d.ts.map +1 -0
- package/lib/typescript/shared/providers/stack/blank-stack.provider.d.ts.map +1 -1
- package/lib/typescript/shared/stores/system.store.d.ts +1 -2
- package/lib/typescript/shared/stores/system.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/index.d.ts +1 -1
- package/lib/typescript/shared/types/index.d.ts.map +1 -1
- package/lib/typescript/shared/types/overlay.types.d.ts +26 -11
- package/lib/typescript/shared/types/overlay.types.d.ts.map +1 -1
- package/lib/typescript/shared/types/screen.types.d.ts +2 -2
- package/lib/typescript/shared/types/screen.types.d.ts.map +1 -1
- package/lib/typescript/shared/utils/animation/animate-to-progress.d.ts +2 -3
- package/lib/typescript/shared/utils/animation/animate-to-progress.d.ts.map +1 -1
- package/lib/typescript/shared/utils/create-provider.d.ts +21 -6
- package/lib/typescript/shared/utils/create-provider.d.ts.map +1 -1
- package/lib/typescript/shared/utils/navigation/close-action-replay.d.ts +4 -0
- package/lib/typescript/shared/utils/navigation/close-action-replay.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/blank-stack/components/stack-view.tsx +1 -4
- package/src/blank-stack/types.ts +8 -2
- package/src/component-stack/components/stack-view.tsx +1 -4
- package/src/component-stack/types.ts +8 -2
- package/src/native-stack/types.ts +8 -2
- package/src/native-stack/views/NativeStackView.native.tsx +6 -10
- package/src/shared/adapters/with-screen-transitions/stack-layout.tsx +1 -1
- package/src/shared/components/boundary/components/boundary-lifecycle.tsx +53 -0
- package/src/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.ts +0 -14
- package/src/shared/components/boundary/hooks/lifecycles/use-refresh-boundary.ts +13 -2
- package/src/shared/components/boundary/hooks/use-boundary-measurement.ts +7 -2
- package/src/shared/components/boundary/hooks/use-measurer.ts +11 -1
- package/src/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.ts +9 -4
- package/src/shared/components/boundary/portal/components/boundary-portal/components/host.tsx +13 -11
- package/src/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.tsx +44 -55
- package/src/shared/components/boundary/portal/components/boundary-portal/helpers/local-measurement.ts +10 -0
- package/src/shared/components/boundary/portal/components/boundary-portal/helpers/offset-style.ts +11 -55
- package/src/shared/components/boundary/portal/components/boundary-portal/hooks/use-active-portal-boundary-host.ts +20 -24
- package/src/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.ts +11 -0
- package/src/shared/components/boundary/portal/components/boundary-portal/hooks/use-host-measurement.ts +20 -67
- package/src/shared/components/boundary/portal/components/boundary-portal/index.tsx +1 -0
- package/src/shared/components/boundary/portal/components/boundary-portal/stores/portal-boundary-host.store.ts +3 -2
- package/src/shared/components/boundary/providers/boundary-root.provider.tsx +29 -20
- package/src/shared/components/boundary/types.ts +9 -0
- package/src/shared/components/boundary/utils/refresh-signals.ts +39 -6
- package/src/shared/components/overlay/helpers/create-overlay-interpolator-frame.ts +29 -0
- package/src/shared/components/overlay/helpers/get-active-overlay.ts +62 -20
- package/src/shared/components/overlay/helpers/retain-ready-overlay-resources.ts +38 -0
- package/src/shared/components/overlay/helpers/run-overlay-slot-interpolator.ts +48 -0
- package/src/shared/components/overlay/hooks/use-overlay-slot.ts +103 -0
- package/src/shared/components/overlay/variations/float-overlay.tsx +22 -64
- package/src/shared/components/overlay/variations/overlay-host.tsx +135 -28
- package/src/shared/components/screen-container/layers/backdrop.tsx +11 -7
- package/src/shared/components/screen-lifecycle/hooks/helpers/close-interception-rules.ts +64 -0
- package/src/shared/components/screen-lifecycle/hooks/use-close-completion.ts +28 -0
- package/src/shared/components/screen-lifecycle/hooks/use-close-transition-intent.ts +72 -109
- package/src/shared/components/screen-lifecycle/hooks/use-transition-start-controller.ts +0 -12
- package/src/shared/components/screen-lifecycle/index.tsx +8 -4
- package/src/shared/hooks/navigation/use-navigation-helpers.ts +39 -7
- package/src/shared/index.ts +1 -0
- package/src/shared/providers/helpers/measured-bounds-writes.ts +1 -1
- package/src/shared/providers/screen/animation/animation.provider.tsx +24 -11
- package/src/shared/providers/screen/animation/helpers/accessors/use-build-transition-accessor.ts +15 -9
- package/src/shared/providers/screen/animation/use-screen-animation.tsx +12 -2
- package/src/shared/providers/screen/gestures/gestures.provider.tsx +18 -7
- package/src/shared/providers/screen/gestures/hooks/use-screen-gesture-config.ts +13 -5
- package/src/shared/providers/screen/gestures/ownership/{use-walk-up-and-register-shadowing-claims.ts → gesture-ownership-bridge.tsx} +44 -54
- package/src/shared/providers/screen/gestures/pan/behavior/pan-lifecycle.ts +4 -6
- package/src/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.ts +1 -3
- package/src/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.ts +4 -6
- package/src/shared/providers/screen/gestures/pinch/behavior/use-pinch-behavior.ts +2 -8
- package/src/shared/providers/screen/gestures/shared/policy.ts +17 -6
- package/src/shared/providers/screen/gestures/types.ts +2 -0
- package/src/shared/providers/screen/styles/constants.ts +1 -0
- package/src/shared/providers/screen/styles/helpers/transition-visual-state.ts +26 -0
- package/src/shared/providers/screen/styles/hooks/slot-resolvers.tsx +17 -5
- package/src/shared/providers/screen/styles/hooks/use-interpolated-style-maps.tsx +51 -12
- package/src/shared/providers/screen/styles/slot.provider.tsx +46 -70
- package/src/shared/providers/stack/blank-stack-state/blank-stack-controller.ts +5 -1
- package/src/shared/providers/stack/blank-stack-state/helpers/resolve-presented-index.ts +22 -0
- package/src/shared/providers/stack/blank-stack.provider.tsx +6 -1
- package/src/shared/stores/bounds/internals/links.ts +1 -1
- package/src/shared/stores/system.store.ts +1 -2
- package/src/shared/types/animation.types.ts +8 -0
- package/src/shared/types/index.ts +1 -1
- package/src/shared/types/overlay.types.ts +41 -14
- package/src/shared/types/screen.types.ts +2 -2
- package/src/shared/utils/animation/animate-to-progress.ts +1 -22
- package/src/shared/utils/create-provider.tsx +221 -19
- package/src/shared/utils/navigation/close-action-replay.ts +25 -0
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/helpers/active-pair.js +0 -30
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/helpers/active-pair.js.map +0 -1
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/stores/host-bounds.store.js +0 -47
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/stores/host-bounds.store.js.map +0 -1
- package/lib/commonjs/shared/providers/screen/gestures/ownership/use-walk-up-and-register-shadowing-claims.js.map +0 -1
- package/lib/commonjs/shared/providers/screen/styles/components/floating-overlay-layer.js +0 -28
- package/lib/commonjs/shared/providers/screen/styles/components/floating-overlay-layer.js.map +0 -1
- package/lib/commonjs/shared/providers/screen/styles/stores/slot-references.store.js +0 -53
- package/lib/commonjs/shared/providers/screen/styles/stores/slot-references.store.js.map +0 -1
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/helpers/active-pair.js +0 -25
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/helpers/active-pair.js.map +0 -1
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/stores/host-bounds.store.js +0 -40
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/stores/host-bounds.store.js.map +0 -1
- package/lib/module/shared/providers/screen/gestures/ownership/use-walk-up-and-register-shadowing-claims.js.map +0 -1
- package/lib/module/shared/providers/screen/styles/components/floating-overlay-layer.js +0 -24
- package/lib/module/shared/providers/screen/styles/components/floating-overlay-layer.js.map +0 -1
- package/lib/module/shared/providers/screen/styles/stores/slot-references.store.js +0 -47
- package/lib/module/shared/providers/screen/styles/stores/slot-references.store.js.map +0 -1
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/helpers/active-pair.d.ts +0 -9
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/helpers/active-pair.d.ts.map +0 -1
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/stores/host-bounds.store.d.ts +0 -9
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/stores/host-bounds.store.d.ts.map +0 -1
- package/lib/typescript/shared/providers/screen/gestures/ownership/use-walk-up-and-register-shadowing-claims.d.ts +0 -14
- package/lib/typescript/shared/providers/screen/gestures/ownership/use-walk-up-and-register-shadowing-claims.d.ts.map +0 -1
- package/lib/typescript/shared/providers/screen/styles/components/floating-overlay-layer.d.ts +0 -7
- package/lib/typescript/shared/providers/screen/styles/components/floating-overlay-layer.d.ts.map +0 -1
- package/lib/typescript/shared/providers/screen/styles/stores/slot-references.store.d.ts +0 -6
- package/lib/typescript/shared/providers/screen/styles/stores/slot-references.store.d.ts.map +0 -1
- package/src/shared/components/boundary/portal/components/boundary-portal/helpers/active-pair.ts +0 -36
- package/src/shared/components/boundary/portal/components/boundary-portal/stores/host-bounds.store.ts +0 -45
- package/src/shared/providers/screen/styles/components/floating-overlay-layer.tsx +0 -29
- package/src/shared/providers/screen/styles/stores/slot-references.store.ts +0 -72
|
@@ -1,16 +1,23 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
StackActions,
|
|
3
|
+
usePreventRemoveContext,
|
|
4
|
+
} from "@react-navigation/native";
|
|
2
5
|
import { useCallback } from "react";
|
|
3
6
|
import { useDescriptorsStore } from "../../providers/screen/descriptors";
|
|
7
|
+
import { AnimationStore } from "../../stores/animation.store";
|
|
8
|
+
import {
|
|
9
|
+
LifecycleTransitionRequestKind,
|
|
10
|
+
SystemStore,
|
|
11
|
+
} from "../../stores/system.store";
|
|
12
|
+
import { dispatchCloseAction } from "../../utils/navigation/close-action-replay";
|
|
4
13
|
import { useStack } from "./use-stack";
|
|
5
14
|
|
|
6
15
|
export function useNavigationHelpers() {
|
|
7
16
|
const route = useDescriptorsStore((store) => store.current.route);
|
|
8
17
|
const navigation = useDescriptorsStore((store) => store.current.navigation);
|
|
9
18
|
const requestStackDismiss = useStack((stack) => stack.requestDismiss);
|
|
10
|
-
|
|
11
|
-
const
|
|
12
|
-
return requestStackDismiss?.({ route }) ?? false;
|
|
13
|
-
}, [route, requestStackDismiss]);
|
|
19
|
+
const { preventedRoutes } = usePreventRemoveContext();
|
|
20
|
+
const isRemovePrevented = preventedRoutes[route.key]?.preventRemove === true;
|
|
14
21
|
|
|
15
22
|
const dismissScreen = useCallback((): boolean => {
|
|
16
23
|
const state = navigation.getState();
|
|
@@ -20,13 +27,38 @@ export function useNavigationHelpers() {
|
|
|
20
27
|
const routeStillPresent = routeIndex !== -1;
|
|
21
28
|
if (!routeStillPresent || routeIndex === 0) return false;
|
|
22
29
|
|
|
23
|
-
|
|
30
|
+
const action = {
|
|
24
31
|
...StackActions.pop(),
|
|
25
32
|
source: route.key,
|
|
26
33
|
target: state.key,
|
|
34
|
+
};
|
|
35
|
+
dispatchCloseAction(action, (closeAction) => {
|
|
36
|
+
navigation.dispatch(closeAction);
|
|
27
37
|
});
|
|
28
38
|
return true;
|
|
29
39
|
}, [navigation, route.key]);
|
|
30
40
|
|
|
31
|
-
|
|
41
|
+
const requestDismiss = useCallback((): boolean => {
|
|
42
|
+
if (isRemovePrevented) return false;
|
|
43
|
+
|
|
44
|
+
if (requestStackDismiss) {
|
|
45
|
+
if (!requestStackDismiss({ route })) return false;
|
|
46
|
+
} else {
|
|
47
|
+
const state = navigation.getState();
|
|
48
|
+
const routeIndex = state.routes.findIndex(
|
|
49
|
+
(stateRoute) => stateRoute.key === route.key,
|
|
50
|
+
);
|
|
51
|
+
if (routeIndex <= 0) return false;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
if (!AnimationStore.getValue(route.key, "closing").get()) {
|
|
55
|
+
SystemStore.getBag(route.key).actions.requestLifecycleTransition(
|
|
56
|
+
LifecycleTransitionRequestKind.Close,
|
|
57
|
+
0,
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
return true;
|
|
61
|
+
}, [isRemovePrevented, navigation, route, requestStackDismiss]);
|
|
62
|
+
|
|
63
|
+
return { dismissScreen, isRemovePrevented, requestDismiss };
|
|
32
64
|
}
|
package/src/shared/index.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { type ReactNode, useCallback, useLayoutEffect, useMemo } from "react";
|
|
|
2
2
|
import { useSharedValue } from "react-native-reanimated";
|
|
3
3
|
import { createBoundsAccessor } from "../../../utils/bounds";
|
|
4
4
|
import createProvider from "../../../utils/create-provider";
|
|
5
|
+
import { useDescriptorsStore } from "../descriptors";
|
|
5
6
|
import { useScreenAnimationPipeline } from "./helpers/pipeline";
|
|
6
7
|
import type {
|
|
7
8
|
RegisterScreenAnimationDescendant,
|
|
@@ -25,25 +26,36 @@ export type ScreenAnimationContextValue = ReturnType<
|
|
|
25
26
|
};
|
|
26
27
|
|
|
27
28
|
export type ScreenAnimationContextResult = {
|
|
29
|
+
key: string;
|
|
28
30
|
value: ScreenAnimationContextValue;
|
|
29
31
|
};
|
|
30
32
|
|
|
31
33
|
export const { ScreenAnimationProvider, useScreenAnimationStore } =
|
|
32
34
|
createProvider("ScreenAnimation", {
|
|
33
35
|
guarded: true,
|
|
36
|
+
global: true,
|
|
34
37
|
})<Props, ScreenAnimationContextValue>(
|
|
35
38
|
(_props, { useParentStore }): ScreenAnimationContextResult => {
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
const
|
|
40
|
-
parentContext?.
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
const
|
|
46
|
-
parentContext?.
|
|
39
|
+
const currentScreenKey = useDescriptorsStore(
|
|
40
|
+
(store) => store.derivations.currentScreenKey,
|
|
41
|
+
);
|
|
42
|
+
const parentScreenInterpolatorProps = useParentStore(
|
|
43
|
+
(parentContext) => parentContext?.screenInterpolatorProps,
|
|
44
|
+
);
|
|
45
|
+
const parentScreenInterpolatorPropsRevision = useParentStore(
|
|
46
|
+
(parentContext) => parentContext?.screenInterpolatorPropsRevision,
|
|
47
|
+
);
|
|
48
|
+
const parentAncestorScreenAnimationSources = useParentStore(
|
|
49
|
+
(parentContext) => parentContext?.ancestorScreenAnimationSources,
|
|
50
|
+
);
|
|
51
|
+
const parentRegisterDescendantScreenAnimationSource = useParentStore(
|
|
52
|
+
(parentContext) =>
|
|
53
|
+
parentContext?.registerDescendantScreenAnimationSource,
|
|
54
|
+
);
|
|
55
|
+
const parentAncestorDescendantScreenAnimationRegistrars = useParentStore(
|
|
56
|
+
(parentContext) =>
|
|
57
|
+
parentContext?.ancestorDescendantScreenAnimationRegistrars,
|
|
58
|
+
);
|
|
47
59
|
|
|
48
60
|
const {
|
|
49
61
|
screenInterpolatorProps,
|
|
@@ -192,6 +204,7 @@ export const { ScreenAnimationProvider, useScreenAnimationStore } =
|
|
|
192
204
|
]);
|
|
193
205
|
|
|
194
206
|
return {
|
|
207
|
+
key: currentScreenKey,
|
|
195
208
|
value: {
|
|
196
209
|
screenInterpolatorProps,
|
|
197
210
|
screenInterpolatorPropsRevision,
|
package/src/shared/providers/screen/animation/helpers/accessors/use-build-transition-accessor.ts
CHANGED
|
@@ -4,7 +4,7 @@ import type {
|
|
|
4
4
|
ScreenTransitionTarget,
|
|
5
5
|
} from "../../../../../types/animation.types";
|
|
6
6
|
import { createBoundsAccessor } from "../../../../../utils/bounds";
|
|
7
|
-
import {
|
|
7
|
+
import type { ScreenAnimationContextValue } from "../../animation.provider";
|
|
8
8
|
import type {
|
|
9
9
|
ScreenAnimationDescendantSources,
|
|
10
10
|
ScreenAnimationSource,
|
|
@@ -15,6 +15,14 @@ type TransitionSourceIndex = number;
|
|
|
15
15
|
|
|
16
16
|
export type TransitionAccessorSource = ScreenAnimationTransitionSource;
|
|
17
17
|
|
|
18
|
+
type TransitionAccessorStore = Pick<
|
|
19
|
+
ScreenAnimationContextValue,
|
|
20
|
+
| "screenInterpolatorProps"
|
|
21
|
+
| "screenInterpolatorPropsRevision"
|
|
22
|
+
| "ancestorScreenAnimationSources"
|
|
23
|
+
| "descendantScreenAnimationSources"
|
|
24
|
+
>;
|
|
25
|
+
|
|
18
26
|
const resolveTargetIndex = (
|
|
19
27
|
target: ScreenTransitionTarget | undefined,
|
|
20
28
|
currentIndex: TransitionSourceIndex,
|
|
@@ -118,14 +126,12 @@ const buildSourceBoundsAccessor = (source: ScreenAnimationSource) => {
|
|
|
118
126
|
});
|
|
119
127
|
};
|
|
120
128
|
|
|
121
|
-
export const useBuildTransitionAccessor = (
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
} = useScreenAnimationStore();
|
|
128
|
-
|
|
129
|
+
export const useBuildTransitionAccessor = ({
|
|
130
|
+
screenInterpolatorProps,
|
|
131
|
+
screenInterpolatorPropsRevision,
|
|
132
|
+
ancestorScreenAnimationSources,
|
|
133
|
+
descendantScreenAnimationSources,
|
|
134
|
+
}: TransitionAccessorStore) => {
|
|
129
135
|
return useMemo(() => {
|
|
130
136
|
const selfSource = {
|
|
131
137
|
screenInterpolatorProps,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { useRoute } from "@react-navigation/native";
|
|
1
2
|
import { type DerivedValue, useDerivedValue } from "react-native-reanimated";
|
|
2
3
|
import type {
|
|
3
4
|
ScreenInterpolationProps,
|
|
@@ -33,12 +34,21 @@ export function useScreenAnimation(
|
|
|
33
34
|
):
|
|
34
35
|
| DerivedValue<ScreenInterpolationProps>
|
|
35
36
|
| DerivedValue<ScreenInterpolationProps | null> {
|
|
37
|
+
const route = useRoute();
|
|
38
|
+
const screenAnimationStore = useScreenAnimationStore(route.key);
|
|
39
|
+
|
|
40
|
+
if (!screenAnimationStore) {
|
|
41
|
+
throw new Error(
|
|
42
|
+
`ScreenAnimation store for route "${route.key}" was not found`,
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
|
|
36
46
|
const {
|
|
37
47
|
screenInterpolatorPropsRevision,
|
|
38
48
|
ancestorScreenAnimationSources,
|
|
39
49
|
descendantScreenAnimationSources,
|
|
40
|
-
} =
|
|
41
|
-
const transition = useBuildTransitionAccessor();
|
|
50
|
+
} = screenAnimationStore;
|
|
51
|
+
const transition = useBuildTransitionAccessor(screenAnimationStore);
|
|
42
52
|
const transitionTarget = normalizeScreenAnimationTarget(
|
|
43
53
|
target,
|
|
44
54
|
ancestorScreenAnimationSources.length,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { useMemo } from "react";
|
|
1
|
+
import { Fragment, useMemo } from "react";
|
|
2
2
|
import { Gesture } from "react-native-gesture-handler";
|
|
3
3
|
import { useSharedValue } from "react-native-reanimated";
|
|
4
4
|
import { ScrollStore } from "../../../stores/scroll.store";
|
|
5
5
|
import createProvider from "../../../utils/create-provider";
|
|
6
6
|
import { useDescriptorsStore } from "../descriptors";
|
|
7
7
|
import { useScreenGestureConfig } from "./hooks/use-screen-gesture-config";
|
|
8
|
-
import {
|
|
8
|
+
import { GestureOwnershipBridge } from "./ownership/gesture-ownership-bridge";
|
|
9
9
|
import { useBuildPanGesture } from "./pan/use-build-pan-gesture";
|
|
10
10
|
import { useBuildPinchGesture } from "./pinch/use-build-pinch-gesture";
|
|
11
11
|
import {
|
|
@@ -28,11 +28,16 @@ export const { ScreenGestureProvider, useScreenGestureStore: useGestureStore } =
|
|
|
28
28
|
{ children },
|
|
29
29
|
{ useParentStore },
|
|
30
30
|
): { value: GestureContextType; children: React.ReactNode } => {
|
|
31
|
-
const gestureContext = useParentStore();
|
|
32
|
-
const gestureConfig = useScreenGestureConfig();
|
|
33
31
|
const currentScreenKey = useDescriptorsStore(
|
|
34
32
|
(store) => store.derivations.currentScreenKey,
|
|
35
33
|
);
|
|
34
|
+
const isTopMostScreen = useDescriptorsStore(
|
|
35
|
+
(store) => store.derivations.isTopMostScreen,
|
|
36
|
+
);
|
|
37
|
+
const gestureContext = useParentStore((parentContext) =>
|
|
38
|
+
isTopMostScreen ? parentContext : null,
|
|
39
|
+
);
|
|
40
|
+
const gestureConfig = useScreenGestureConfig(gestureContext);
|
|
36
41
|
|
|
37
42
|
const scrollState = ScrollStore.getValue(
|
|
38
43
|
currentScreenKey,
|
|
@@ -89,13 +94,19 @@ export const { ScreenGestureProvider, useScreenGestureStore: useGestureStore } =
|
|
|
89
94
|
],
|
|
90
95
|
);
|
|
91
96
|
|
|
92
|
-
|
|
93
|
-
|
|
97
|
+
const content = useMemo(
|
|
98
|
+
() => (
|
|
99
|
+
<Fragment>
|
|
100
|
+
<GestureOwnershipBridge />
|
|
101
|
+
{children}
|
|
102
|
+
</Fragment>
|
|
103
|
+
),
|
|
104
|
+
[children],
|
|
94
105
|
);
|
|
95
106
|
|
|
96
107
|
return {
|
|
97
108
|
value,
|
|
98
|
-
children,
|
|
109
|
+
children: content,
|
|
99
110
|
};
|
|
100
111
|
},
|
|
101
112
|
);
|
|
@@ -1,15 +1,22 @@
|
|
|
1
|
+
import { usePreventRemoveContext } from "@react-navigation/native";
|
|
1
2
|
import { useMemo } from "react";
|
|
2
3
|
import { useDescriptorsStore } from "../../descriptors";
|
|
3
|
-
import { useGestureStore } from "../gestures.provider";
|
|
4
4
|
import { resolveScreenGestureConfig } from "../shared/policy";
|
|
5
|
-
import type { ScreenGestureConfig } from "../types";
|
|
5
|
+
import type { GestureContextType, ScreenGestureConfig } from "../types";
|
|
6
6
|
|
|
7
|
-
export function useScreenGestureConfig(
|
|
8
|
-
|
|
7
|
+
export function useScreenGestureConfig(
|
|
8
|
+
gestureContext: GestureContextType | null,
|
|
9
|
+
): ScreenGestureConfig {
|
|
9
10
|
const options = useDescriptorsStore((store) => store.options);
|
|
10
11
|
const isFirstKey = useDescriptorsStore(
|
|
11
12
|
(store) => store.derivations.isFirstKey,
|
|
12
13
|
);
|
|
14
|
+
const currentScreenKey = useDescriptorsStore(
|
|
15
|
+
(store) => store.derivations.currentScreenKey,
|
|
16
|
+
);
|
|
17
|
+
const { preventedRoutes } = usePreventRemoveContext();
|
|
18
|
+
const isRemovePrevented =
|
|
19
|
+
preventedRoutes[currentScreenKey]?.preventRemove === true;
|
|
13
20
|
|
|
14
21
|
return useMemo(
|
|
15
22
|
() =>
|
|
@@ -17,7 +24,8 @@ export function useScreenGestureConfig(): ScreenGestureConfig {
|
|
|
17
24
|
options,
|
|
18
25
|
isFirstKey,
|
|
19
26
|
gestureContext,
|
|
27
|
+
isRemovePrevented,
|
|
20
28
|
}),
|
|
21
|
-
[isFirstKey, options, gestureContext],
|
|
29
|
+
[isFirstKey, options, gestureContext, isRemovePrevented],
|
|
22
30
|
);
|
|
23
31
|
}
|
|
@@ -30,9 +30,9 @@ const findShadowedDirections = (
|
|
|
30
30
|
) => {
|
|
31
31
|
const shadowedDirections: Direction[] = [];
|
|
32
32
|
|
|
33
|
-
for (const
|
|
34
|
-
if (claimedDirections[
|
|
35
|
-
shadowedDirections.push(
|
|
33
|
+
for (const direction of DIRECTIONS) {
|
|
34
|
+
if (claimedDirections[direction] && ancestorDirections[direction]) {
|
|
35
|
+
shadowedDirections.push(direction);
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
|
|
@@ -70,8 +70,8 @@ const registerShadowingClaims = (
|
|
|
70
70
|
|
|
71
71
|
for (const { ancestor, directions } of shadowedAncestors) {
|
|
72
72
|
const newClaims = { ...ancestor.childDirectionClaims.get() };
|
|
73
|
-
for (const
|
|
74
|
-
newClaims[
|
|
73
|
+
for (const direction of directions) {
|
|
74
|
+
newClaims[direction] = { routeKey: currentScreenKey, isDismissing };
|
|
75
75
|
}
|
|
76
76
|
ancestor.childDirectionClaims.set(newClaims);
|
|
77
77
|
}
|
|
@@ -86,10 +86,9 @@ const clearShadowingClaims = (
|
|
|
86
86
|
const newClaims = { ...currentClaims };
|
|
87
87
|
let needsUpdate = false;
|
|
88
88
|
|
|
89
|
-
for (const
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
newClaims[dir] = null;
|
|
89
|
+
for (const direction of directions) {
|
|
90
|
+
if (currentClaims[direction]?.routeKey === currentScreenKey) {
|
|
91
|
+
newClaims[direction] = null;
|
|
93
92
|
needsUpdate = true;
|
|
94
93
|
}
|
|
95
94
|
}
|
|
@@ -121,51 +120,32 @@ const getDescriptorClaimedDirections = (
|
|
|
121
120
|
}).participation.claimedDirections;
|
|
122
121
|
};
|
|
123
122
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
const parentContext = useGestureStore();
|
|
123
|
+
const requireGestureContext = (
|
|
124
|
+
gestureContext: GestureContextType | null,
|
|
125
|
+
): GestureContextType => {
|
|
126
|
+
if (!gestureContext) {
|
|
127
|
+
throw new Error(
|
|
128
|
+
"GestureOwnershipBridge must be rendered within a ScreenGestureProvider",
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
return gestureContext;
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
function ActiveGestureOwnershipBridge() {
|
|
136
|
+
const gestureContext = requireGestureContext(useGestureStore());
|
|
139
137
|
const previous = useDescriptorsStore((store) => store.previous);
|
|
140
|
-
const isTopMostScreen = useDescriptorsStore(
|
|
141
|
-
(store) => store.derivations.isTopMostScreen,
|
|
142
|
-
);
|
|
143
|
-
const currentScreenKey = useDescriptorsStore(
|
|
144
|
-
(store) => store.derivations.currentScreenKey,
|
|
145
|
-
);
|
|
146
138
|
const isCurrentScreenClosing = useBlankStackStore(
|
|
147
|
-
(store) =>
|
|
139
|
+
(store) =>
|
|
140
|
+
store?.scenesByKey[gestureContext.routeKey]?.activity === "closing",
|
|
148
141
|
);
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
* └─ B claims horizontal (closing)
|
|
157
|
-
* └─ C claims horizontal (closing)
|
|
158
|
-
*
|
|
159
|
-
* Closing screens are still mounted, so they can still block parent gestures.
|
|
160
|
-
* But they cannot receive touches anymore.
|
|
161
|
-
*
|
|
162
|
-
* So when B/C are closing and the user is really touching A, B/C should not
|
|
163
|
-
* keep blocking the parent with their own gesture config.
|
|
164
|
-
*
|
|
165
|
-
* A closing screen should act like the visible screen underneath it:
|
|
166
|
-
* - if the screen underneath claims the gesture, keep blocking the parent
|
|
167
|
-
* - if the screen underneath does not claim it, let the parent handle it
|
|
168
|
-
*/
|
|
142
|
+
const {
|
|
143
|
+
claimedDirections,
|
|
144
|
+
gestureContext: parentContext,
|
|
145
|
+
routeKey: currentScreenKey,
|
|
146
|
+
} = gestureContext;
|
|
147
|
+
// A retained closing screen cannot receive touches, so its ownership must
|
|
148
|
+
// mirror the visible screen underneath instead of blocking an ancestor.
|
|
169
149
|
const effectiveClaimedDirections = useMemo(
|
|
170
150
|
() =>
|
|
171
151
|
resolveShadowingClaimDirections({
|
|
@@ -178,14 +158,13 @@ export function useWalkUpAndRegisterShadowingClaims(
|
|
|
178
158
|
}),
|
|
179
159
|
[isCurrentScreenClosing, claimedDirections, previous, parentContext],
|
|
180
160
|
);
|
|
181
|
-
|
|
182
161
|
const shadowedAncestors = useMemo(
|
|
183
162
|
() => findShadowedAncestors(parentContext, effectiveClaimedDirections),
|
|
184
163
|
[parentContext, effectiveClaimedDirections],
|
|
185
164
|
);
|
|
186
165
|
|
|
187
166
|
useLayoutEffect(() => {
|
|
188
|
-
if (!
|
|
167
|
+
if (!shadowedAncestors.length) {
|
|
189
168
|
return;
|
|
190
169
|
}
|
|
191
170
|
|
|
@@ -194,5 +173,16 @@ export function useWalkUpAndRegisterShadowingClaims(
|
|
|
194
173
|
return () => {
|
|
195
174
|
clearShadowingClaims(shadowedAncestors, currentScreenKey);
|
|
196
175
|
};
|
|
197
|
-
}, [shadowedAncestors, currentScreenKey
|
|
176
|
+
}, [shadowedAncestors, currentScreenKey]);
|
|
177
|
+
|
|
178
|
+
return null;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/** Keeps gesture ownership subscriptions attached only to participating screens. */
|
|
182
|
+
export function GestureOwnershipBridge() {
|
|
183
|
+
const isTopMostScreen = useDescriptorsStore(
|
|
184
|
+
(store) => store.derivations.isTopMostScreen,
|
|
185
|
+
);
|
|
186
|
+
|
|
187
|
+
return isTopMostScreen ? <ActiveGestureOwnershipBridge /> : null;
|
|
198
188
|
}
|
|
@@ -89,7 +89,6 @@ export const trackPanGesture = (
|
|
|
89
89
|
export const finalizePanRelease = (
|
|
90
90
|
release: PanReleaseResult,
|
|
91
91
|
runtime: PanGestureRuntime,
|
|
92
|
-
dismissScreen: ((finished: boolean) => void) | undefined,
|
|
93
92
|
dimensions: GestureDimensions,
|
|
94
93
|
rawEvent: PanGestureEvent,
|
|
95
94
|
requestDismiss?: () => void,
|
|
@@ -150,13 +149,8 @@ export const finalizePanRelease = (
|
|
|
150
149
|
return;
|
|
151
150
|
}
|
|
152
151
|
|
|
153
|
-
if (plan.shouldDismiss && requestDismiss) {
|
|
154
|
-
runOnJS(requestDismiss)();
|
|
155
|
-
}
|
|
156
|
-
|
|
157
152
|
animateToProgress({
|
|
158
153
|
target: plan.target,
|
|
159
|
-
onAnimationFinish: plan.shouldDismiss ? dismissScreen : undefined,
|
|
160
154
|
spec: plan.transitionSpec,
|
|
161
155
|
emitWillAnimate: false,
|
|
162
156
|
markEntering: false,
|
|
@@ -165,4 +159,8 @@ export const finalizePanRelease = (
|
|
|
165
159
|
animations,
|
|
166
160
|
initialVelocity: plan.progressVelocity,
|
|
167
161
|
});
|
|
162
|
+
|
|
163
|
+
if (plan.shouldDismiss && requestDismiss) {
|
|
164
|
+
runOnJS(requestDismiss)();
|
|
165
|
+
}
|
|
168
166
|
};
|
|
@@ -31,7 +31,7 @@ export const usePanBehavior = (
|
|
|
31
31
|
gestureCompositionOwner: SharedValue<GestureCompositionOwner>,
|
|
32
32
|
pendingDirection: SharedValue<Direction | null>,
|
|
33
33
|
): PanBehavior => {
|
|
34
|
-
const {
|
|
34
|
+
const { requestDismiss } = useNavigationHelpers();
|
|
35
35
|
const { withSensitivity, resetSensitivity } =
|
|
36
36
|
usePanGestureSensitivity(screenOptions);
|
|
37
37
|
|
|
@@ -109,7 +109,6 @@ export const usePanBehavior = (
|
|
|
109
109
|
finalizePanRelease(
|
|
110
110
|
release,
|
|
111
111
|
latestRuntime,
|
|
112
|
-
dismissScreen,
|
|
113
112
|
dimensions,
|
|
114
113
|
rawEvent,
|
|
115
114
|
requestDismiss,
|
|
@@ -124,7 +123,6 @@ export const usePanBehavior = (
|
|
|
124
123
|
runtime,
|
|
125
124
|
screenOptions,
|
|
126
125
|
dimensions,
|
|
127
|
-
dismissScreen,
|
|
128
126
|
requestDismiss,
|
|
129
127
|
withSensitivity,
|
|
130
128
|
gestureCompositionOwner,
|
|
@@ -61,7 +61,6 @@ export const trackPinchGesture = (
|
|
|
61
61
|
export const finalizePinchRelease = (
|
|
62
62
|
release: PinchReleaseResult,
|
|
63
63
|
runtime: PinchGestureRuntime,
|
|
64
|
-
dismissScreen: ((finished: boolean) => void) | undefined,
|
|
65
64
|
requestDismiss?: () => void,
|
|
66
65
|
) => {
|
|
67
66
|
"worklet";
|
|
@@ -91,10 +90,6 @@ export const finalizePinchRelease = (
|
|
|
91
90
|
resetValuesImmediately: release.resetValuesImmediately,
|
|
92
91
|
});
|
|
93
92
|
|
|
94
|
-
if (release.shouldDismiss && requestDismiss) {
|
|
95
|
-
runOnJS(requestDismiss)();
|
|
96
|
-
}
|
|
97
|
-
|
|
98
93
|
if (!release.shouldDismiss && progressAlreadyAtTarget) {
|
|
99
94
|
system.targetProgress.set(release.target);
|
|
100
95
|
return;
|
|
@@ -102,7 +97,6 @@ export const finalizePinchRelease = (
|
|
|
102
97
|
|
|
103
98
|
animateToProgress({
|
|
104
99
|
target: release.target,
|
|
105
|
-
onAnimationFinish: release.shouldDismiss ? dismissScreen : undefined,
|
|
106
100
|
spec: release.transitionSpec,
|
|
107
101
|
emitWillAnimate: false,
|
|
108
102
|
markEntering: false,
|
|
@@ -111,4 +105,8 @@ export const finalizePinchRelease = (
|
|
|
111
105
|
animationProgress: system.animationProgress,
|
|
112
106
|
initialVelocity: release.initialVelocity,
|
|
113
107
|
});
|
|
108
|
+
|
|
109
|
+
if (release.shouldDismiss && requestDismiss) {
|
|
110
|
+
runOnJS(requestDismiss)();
|
|
111
|
+
}
|
|
114
112
|
};
|
|
@@ -26,7 +26,7 @@ export const usePinchBehavior = (
|
|
|
26
26
|
screenOptions: ScreenOptionsContextValue,
|
|
27
27
|
gestureCompositionOwner: SharedValue<GestureCompositionOwner>,
|
|
28
28
|
): PinchBehavior => {
|
|
29
|
-
const {
|
|
29
|
+
const { requestDismiss } = useNavigationHelpers();
|
|
30
30
|
const { withSensitivity, resetSensitivity } =
|
|
31
31
|
usePinchGestureSensitivity(screenOptions);
|
|
32
32
|
|
|
@@ -68,18 +68,12 @@ export const usePinchBehavior = (
|
|
|
68
68
|
.hasSnapPoints
|
|
69
69
|
? resolveSnapPinchRelease(event, latestRuntime)
|
|
70
70
|
: resolvePinchRelease(event, latestRuntime);
|
|
71
|
-
finalizePinchRelease(
|
|
72
|
-
release,
|
|
73
|
-
latestRuntime,
|
|
74
|
-
dismissScreen,
|
|
75
|
-
requestDismiss,
|
|
76
|
-
);
|
|
71
|
+
finalizePinchRelease(release, latestRuntime, requestDismiss);
|
|
77
72
|
gestureCompositionOwner.set(null);
|
|
78
73
|
},
|
|
79
74
|
[
|
|
80
75
|
runtime,
|
|
81
76
|
screenOptions,
|
|
82
|
-
dismissScreen,
|
|
83
77
|
requestDismiss,
|
|
84
78
|
withSensitivity,
|
|
85
79
|
gestureCompositionOwner,
|
|
@@ -306,15 +306,19 @@ const resolveGestureParticipation = ({
|
|
|
306
306
|
options,
|
|
307
307
|
isFirstKey,
|
|
308
308
|
gestureContext,
|
|
309
|
+
isRemovePrevented,
|
|
309
310
|
}: {
|
|
310
311
|
options: GesturePolicyOptions;
|
|
311
312
|
isFirstKey: boolean;
|
|
312
313
|
gestureContext: GestureContextType | null;
|
|
314
|
+
isRemovePrevented: boolean;
|
|
313
315
|
}): ScreenGestureParticipation => {
|
|
314
|
-
const canDismiss =
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
316
|
+
const canDismiss =
|
|
317
|
+
!isRemovePrevented &&
|
|
318
|
+
resolveGestureCanDismiss({
|
|
319
|
+
isFirstKey,
|
|
320
|
+
gestureEnabled: options.gestureEnabled,
|
|
321
|
+
});
|
|
318
322
|
const effectiveSnapPoints = validateSnapPoints({
|
|
319
323
|
snapPoints: options.snapPoints,
|
|
320
324
|
canDismiss,
|
|
@@ -333,6 +337,7 @@ const resolveGestureParticipation = ({
|
|
|
333
337
|
|
|
334
338
|
return {
|
|
335
339
|
isFirstKey,
|
|
340
|
+
isRemovePrevented,
|
|
336
341
|
canDismiss,
|
|
337
342
|
canTrackGesture,
|
|
338
343
|
effectiveSnapPoints,
|
|
@@ -345,15 +350,18 @@ export const resolveScreenGestureConfig = ({
|
|
|
345
350
|
options,
|
|
346
351
|
isFirstKey,
|
|
347
352
|
gestureContext,
|
|
353
|
+
isRemovePrevented = false,
|
|
348
354
|
}: {
|
|
349
355
|
options: ScreenTransitionConfig;
|
|
350
356
|
isFirstKey: boolean;
|
|
351
357
|
gestureContext: GestureContextType | null;
|
|
358
|
+
isRemovePrevented?: boolean;
|
|
352
359
|
}): ScreenGestureConfig => {
|
|
353
360
|
const participation = resolveGestureParticipation({
|
|
354
361
|
options,
|
|
355
362
|
isFirstKey,
|
|
356
363
|
gestureContext,
|
|
364
|
+
isRemovePrevented,
|
|
357
365
|
});
|
|
358
366
|
const hasSnapPoints = participation.effectiveSnapPoints.hasSnapPoints;
|
|
359
367
|
|
|
@@ -365,11 +373,14 @@ export const resolveScreenGestureConfig = ({
|
|
|
365
373
|
};
|
|
366
374
|
|
|
367
375
|
function resolveRuntimeCanDismiss(
|
|
368
|
-
participation: Pick<
|
|
376
|
+
participation: Pick<
|
|
377
|
+
ScreenGestureParticipation,
|
|
378
|
+
"isFirstKey" | "isRemovePrevented" | "canDismiss"
|
|
379
|
+
>,
|
|
369
380
|
options: GesturePolicyOptions,
|
|
370
381
|
) {
|
|
371
382
|
"worklet";
|
|
372
|
-
if (participation.isFirstKey) {
|
|
383
|
+
if (participation.isFirstKey || participation.isRemovePrevented) {
|
|
373
384
|
return false;
|
|
374
385
|
}
|
|
375
386
|
|
|
@@ -85,6 +85,8 @@ export interface GestureContextType {
|
|
|
85
85
|
export interface ScreenGestureParticipation {
|
|
86
86
|
/** Whether this route is the first route in its stack. First routes never track gestures. */
|
|
87
87
|
isFirstKey: boolean;
|
|
88
|
+
/** Whether React Navigation currently blocks removal of this route. */
|
|
89
|
+
isRemovePrevented: boolean;
|
|
88
90
|
/** Whether this route can dismiss to progress 0 from a gesture release. */
|
|
89
91
|
canDismiss: boolean;
|
|
90
92
|
/** Whether recognizers can activate to expose gesture values to interpolators. */
|