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
|
@@ -2,53 +2,160 @@ import {
|
|
|
2
2
|
NavigationContext,
|
|
3
3
|
NavigationRouteContext,
|
|
4
4
|
} from "@react-navigation/native";
|
|
5
|
-
import { memo, useMemo } from "react";
|
|
6
|
-
import {
|
|
7
|
-
import { useDerivedValue } from "react-native-reanimated";
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
5
|
+
import { memo, useMemo, useRef } from "react";
|
|
6
|
+
import { StyleSheet, View } from "react-native";
|
|
7
|
+
import Animated, { useDerivedValue } from "react-native-reanimated";
|
|
8
|
+
import { snapDescriptorToIndex } from "../../../animation/snap-to";
|
|
9
|
+
import { useStack } from "../../../hooks/navigation/use-stack";
|
|
10
|
+
import { useScreenAnimationStore } from "../../../providers/screen/animation";
|
|
11
|
+
import type { ScreenAnimationContextValue } from "../../../providers/screen/animation/animation.provider";
|
|
12
|
+
import {
|
|
13
|
+
type ScreenSlotContextValue,
|
|
14
|
+
useScreenSlots,
|
|
15
|
+
} from "../../../providers/screen/styles/slot.provider";
|
|
16
|
+
import type { OverlayProps } from "../../../types/overlay.types";
|
|
11
17
|
import type {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
} from "
|
|
18
|
+
FloatOverlayActivity,
|
|
19
|
+
FloatOverlayEntry,
|
|
20
|
+
} from "../helpers/get-active-overlay";
|
|
21
|
+
import {
|
|
22
|
+
type ReadyOverlayResources,
|
|
23
|
+
retainReadyOverlayResources,
|
|
24
|
+
} from "../helpers/retain-ready-overlay-resources";
|
|
25
|
+
import { useOverlaySlot } from "../hooks/use-overlay-slot";
|
|
15
26
|
|
|
16
27
|
type OverlayHostProps = {
|
|
17
|
-
scene:
|
|
18
|
-
|
|
28
|
+
scene: FloatOverlayEntry["scene"];
|
|
29
|
+
driverScene: FloatOverlayEntry["scene"];
|
|
30
|
+
previousOverlayScene?: FloatOverlayEntry["scene"];
|
|
31
|
+
activity: FloatOverlayActivity;
|
|
32
|
+
layerIndex: number;
|
|
19
33
|
};
|
|
20
34
|
|
|
21
35
|
export const OverlayHost = memo(function OverlayHost({
|
|
22
36
|
scene,
|
|
23
|
-
|
|
37
|
+
driverScene,
|
|
38
|
+
previousOverlayScene,
|
|
39
|
+
activity,
|
|
40
|
+
layerIndex,
|
|
24
41
|
}: OverlayHostProps) {
|
|
25
|
-
const
|
|
42
|
+
const overlayAnimationStore = useScreenAnimationStore(scene.route.key);
|
|
43
|
+
const driverAnimationStore = useScreenAnimationStore(driverScene.route.key);
|
|
44
|
+
const previousOverlayAnimationStore = useScreenAnimationStore(
|
|
45
|
+
previousOverlayScene?.route.key ?? scene.route.key,
|
|
46
|
+
);
|
|
47
|
+
const driverSlots = useScreenSlots(driverScene.route.key);
|
|
48
|
+
const overlayComponentRef = useRef(scene.descriptor.options.overlay);
|
|
49
|
+
const OverlayComponent = overlayComponentRef.current;
|
|
50
|
+
const readyResourcesRef = useRef<ReadyOverlayResources | null>(null);
|
|
51
|
+
readyResourcesRef.current = retainReadyOverlayResources(
|
|
52
|
+
readyResourcesRef.current,
|
|
53
|
+
overlayAnimationStore,
|
|
54
|
+
driverScene,
|
|
55
|
+
driverAnimationStore,
|
|
56
|
+
driverSlots,
|
|
57
|
+
);
|
|
58
|
+
const readyResources = readyResourcesRef.current;
|
|
59
|
+
|
|
60
|
+
if (!OverlayComponent || !readyResources) {
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
return (
|
|
65
|
+
<ReadyOverlayHost
|
|
66
|
+
scene={scene}
|
|
67
|
+
driverScene={readyResources.driverScene}
|
|
68
|
+
activity={activity}
|
|
69
|
+
layerIndex={layerIndex}
|
|
70
|
+
overlayAnimationStore={readyResources.overlayAnimationStore}
|
|
71
|
+
driverAnimationStore={readyResources.driverAnimationStore}
|
|
72
|
+
previousOverlayAnimationStore={
|
|
73
|
+
previousOverlayScene ? previousOverlayAnimationStore : undefined
|
|
74
|
+
}
|
|
75
|
+
driverSlots={readyResources.driverSlots}
|
|
76
|
+
OverlayComponent={OverlayComponent}
|
|
77
|
+
/>
|
|
78
|
+
);
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
type ReadyOverlayHostProps = OverlayHostProps & {
|
|
82
|
+
overlayAnimationStore: ScreenAnimationContextValue;
|
|
83
|
+
driverAnimationStore: ScreenAnimationContextValue;
|
|
84
|
+
previousOverlayAnimationStore?: ScreenAnimationContextValue | null;
|
|
85
|
+
driverSlots: ScreenSlotContextValue;
|
|
86
|
+
OverlayComponent: NonNullable<
|
|
87
|
+
FloatOverlayEntry["scene"]["descriptor"]["options"]["overlay"]
|
|
88
|
+
>;
|
|
89
|
+
};
|
|
26
90
|
|
|
27
|
-
|
|
91
|
+
function ReadyOverlayHost({
|
|
92
|
+
scene,
|
|
93
|
+
driverScene,
|
|
94
|
+
activity,
|
|
95
|
+
layerIndex,
|
|
96
|
+
overlayAnimationStore,
|
|
97
|
+
driverAnimationStore,
|
|
98
|
+
previousOverlayAnimationStore,
|
|
99
|
+
driverSlots,
|
|
100
|
+
OverlayComponent,
|
|
101
|
+
}: ReadyOverlayHostProps) {
|
|
102
|
+
const { scenes, focusedIndex, routeKeys, routes } = useStack();
|
|
103
|
+
const descriptor = scene.descriptor;
|
|
104
|
+
const focusedScene = scenes[focusedIndex] ?? scenes[scenes.length - 1];
|
|
105
|
+
const focusedDescriptor = focusedScene?.descriptor;
|
|
106
|
+
const { animatedProps, animatedStyle } = useOverlaySlot({
|
|
107
|
+
overlayAnimationStore,
|
|
108
|
+
driverAnimationStore,
|
|
109
|
+
previousOverlayAnimationStore: previousOverlayAnimationStore ?? undefined,
|
|
110
|
+
driverInterpolator: driverScene.descriptor.options.screenStyleInterpolator,
|
|
111
|
+
interpolatorReady: driverSlots.interpolatorReady,
|
|
112
|
+
isIncoming: scene.route.key === driverScene.route.key,
|
|
113
|
+
});
|
|
28
114
|
const relativeProgress = useDerivedValue(() => {
|
|
29
115
|
"worklet";
|
|
30
|
-
|
|
116
|
+
overlayAnimationStore.screenInterpolatorPropsRevision.get();
|
|
117
|
+
return overlayAnimationStore.screenInterpolatorProps.get().stackProgress;
|
|
31
118
|
});
|
|
32
119
|
|
|
33
|
-
const overlayProps: OverlayProps
|
|
120
|
+
const overlayProps: OverlayProps = useMemo(
|
|
34
121
|
() => ({
|
|
35
|
-
|
|
122
|
+
route: scene.route,
|
|
123
|
+
index: routeKeys.indexOf(scene.route.key),
|
|
124
|
+
options: focusedDescriptor?.options ?? {},
|
|
125
|
+
routes,
|
|
126
|
+
focusedRoute: focusedScene?.route ?? scene.route,
|
|
127
|
+
focusedIndex,
|
|
128
|
+
meta: focusedDescriptor?.options?.meta,
|
|
129
|
+
navigation: scene.descriptor.navigation,
|
|
130
|
+
snapTo: (index: number) => {
|
|
131
|
+
snapDescriptorToIndex(scene.descriptor, index);
|
|
132
|
+
},
|
|
36
133
|
progress: relativeProgress,
|
|
37
134
|
}),
|
|
38
|
-
[
|
|
135
|
+
[
|
|
136
|
+
scene,
|
|
137
|
+
focusedDescriptor?.options,
|
|
138
|
+
focusedIndex,
|
|
139
|
+
focusedScene?.route,
|
|
140
|
+
relativeProgress,
|
|
141
|
+
routeKeys,
|
|
142
|
+
routes,
|
|
143
|
+
],
|
|
39
144
|
);
|
|
40
|
-
|
|
41
|
-
if (!OverlayComponent) {
|
|
42
|
-
return null;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
145
|
return (
|
|
46
146
|
<Animated.View
|
|
47
|
-
|
|
48
|
-
|
|
147
|
+
animatedProps={animatedProps}
|
|
148
|
+
pointerEvents={activity === "active" ? "box-none" : "none"}
|
|
149
|
+
style={[
|
|
150
|
+
styles.container,
|
|
151
|
+
styles.floating,
|
|
152
|
+
StyleSheet.absoluteFill,
|
|
153
|
+
{ zIndex: 1000 + layerIndex },
|
|
154
|
+
animatedStyle,
|
|
155
|
+
]}
|
|
49
156
|
>
|
|
50
|
-
<NavigationContext.Provider value={
|
|
51
|
-
<NavigationRouteContext.Provider value={
|
|
157
|
+
<NavigationContext.Provider value={descriptor.navigation as any}>
|
|
158
|
+
<NavigationRouteContext.Provider value={descriptor.route}>
|
|
52
159
|
<View
|
|
53
160
|
pointerEvents="box-none"
|
|
54
161
|
style={[StyleSheet.absoluteFill, styles.overlay]}
|
|
@@ -59,7 +166,7 @@ export const OverlayHost = memo(function OverlayHost({
|
|
|
59
166
|
</NavigationContext.Provider>
|
|
60
167
|
</Animated.View>
|
|
61
168
|
);
|
|
62
|
-
}
|
|
169
|
+
}
|
|
63
170
|
|
|
64
171
|
const styles = StyleSheet.create({
|
|
65
172
|
overlay: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ComponentType, memo, useCallback, useMemo } from "react";
|
|
2
2
|
import { Pressable, StyleSheet } from "react-native";
|
|
3
|
-
import Animated, { runOnUI } from "react-native-reanimated";
|
|
3
|
+
import Animated, { runOnJS, runOnUI } from "react-native-reanimated";
|
|
4
4
|
import { DefaultSnapSpec } from "../../../configs/specs";
|
|
5
5
|
import { useNavigationHelpers } from "../../../hooks/navigation/use-navigation-helpers";
|
|
6
6
|
import { useDescriptorsStore } from "../../../providers/screen/descriptors";
|
|
@@ -23,7 +23,7 @@ export const BackdropLayer = memo(function BackdropLayer({
|
|
|
23
23
|
backdropBehavior: BackdropBehavior;
|
|
24
24
|
isBackdropActive: boolean;
|
|
25
25
|
}) {
|
|
26
|
-
const {
|
|
26
|
+
const { isRemovePrevented, requestDismiss } = useNavigationHelpers();
|
|
27
27
|
|
|
28
28
|
const routeKey = useDescriptorsStore(
|
|
29
29
|
(store) => store.derivations.currentScreenKey,
|
|
@@ -34,9 +34,10 @@ export const BackdropLayer = memo(function BackdropLayer({
|
|
|
34
34
|
const rawSnapPoints = useDescriptorsStore(
|
|
35
35
|
(store) => store.options.snapPoints,
|
|
36
36
|
);
|
|
37
|
-
const
|
|
37
|
+
const isGestureDismissEnabled = useDescriptorsStore(
|
|
38
38
|
(store) => store.options.gestureEnabled !== false,
|
|
39
39
|
);
|
|
40
|
+
const canDismiss = isGestureDismissEnabled && !isRemovePrevented;
|
|
40
41
|
const transitionSpec = useDescriptorsStore(
|
|
41
42
|
(store) => store.options.transitionSpec,
|
|
42
43
|
);
|
|
@@ -56,14 +57,14 @@ export const BackdropLayer = memo(function BackdropLayer({
|
|
|
56
57
|
|
|
57
58
|
const handleBackdropPress = useCallback(() => {
|
|
58
59
|
if (backdropBehavior === "dismiss") {
|
|
59
|
-
|
|
60
|
+
requestDismiss();
|
|
60
61
|
return;
|
|
61
62
|
}
|
|
62
63
|
|
|
63
64
|
if (backdropBehavior === "collapse") {
|
|
64
65
|
// No snap points → fallback to dismiss
|
|
65
66
|
if (!rawSnapPoints || rawSnapPoints.length === 0) {
|
|
66
|
-
|
|
67
|
+
requestDismiss();
|
|
67
68
|
return;
|
|
68
69
|
}
|
|
69
70
|
|
|
@@ -108,8 +109,11 @@ export const BackdropLayer = memo(function BackdropLayer({
|
|
|
108
109
|
animations,
|
|
109
110
|
targetProgress,
|
|
110
111
|
animationProgress,
|
|
111
|
-
onAnimationFinish: shouldDismiss ? dismissScreen : undefined,
|
|
112
112
|
});
|
|
113
|
+
|
|
114
|
+
if (shouldDismiss) {
|
|
115
|
+
runOnJS(requestDismiss)();
|
|
116
|
+
}
|
|
113
117
|
})();
|
|
114
118
|
}
|
|
115
119
|
}, [
|
|
@@ -121,7 +125,7 @@ export const BackdropLayer = memo(function BackdropLayer({
|
|
|
121
125
|
rawSnapPoints,
|
|
122
126
|
canDismiss,
|
|
123
127
|
transitionSpec,
|
|
124
|
-
|
|
128
|
+
requestDismiss,
|
|
125
129
|
routeKey,
|
|
126
130
|
]);
|
|
127
131
|
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
interface CloseInterceptionState {
|
|
2
|
+
enabled: boolean;
|
|
3
|
+
ownsAction: boolean;
|
|
4
|
+
ancestorDismissing: boolean;
|
|
5
|
+
routeIndex: number;
|
|
6
|
+
focusedIndex: number;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
interface NavigationRouteLike {
|
|
10
|
+
key: string;
|
|
11
|
+
state?: NavigationStateLike;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
interface NavigationStateLike {
|
|
15
|
+
key?: string;
|
|
16
|
+
routes: NavigationRouteLike[];
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
interface NavigationActionLike {
|
|
20
|
+
source?: unknown;
|
|
21
|
+
target?: unknown;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const containsRouteKey = (
|
|
25
|
+
routes: NavigationRouteLike[],
|
|
26
|
+
routeKey: string,
|
|
27
|
+
): boolean =>
|
|
28
|
+
routes.some(
|
|
29
|
+
(route) =>
|
|
30
|
+
route.key === routeKey ||
|
|
31
|
+
(route.state ? containsRouteKey(route.state.routes, routeKey) : false),
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
export const doesNavigatorOwnCloseAction = ({
|
|
35
|
+
state,
|
|
36
|
+
action,
|
|
37
|
+
}: {
|
|
38
|
+
state: NavigationStateLike;
|
|
39
|
+
action: NavigationActionLike;
|
|
40
|
+
}): boolean => {
|
|
41
|
+
if (typeof action.target === "string") {
|
|
42
|
+
return action.target === state.key;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if (typeof action.source === "string") {
|
|
46
|
+
return containsRouteKey(state.routes, action.source);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return true;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
/** Only the focused removable route owns a stack close transition. */
|
|
53
|
+
export const shouldInterceptClose = ({
|
|
54
|
+
enabled,
|
|
55
|
+
ownsAction,
|
|
56
|
+
ancestorDismissing,
|
|
57
|
+
routeIndex,
|
|
58
|
+
focusedIndex,
|
|
59
|
+
}: CloseInterceptionState) =>
|
|
60
|
+
enabled &&
|
|
61
|
+
ownsAction &&
|
|
62
|
+
!ancestorDismissing &&
|
|
63
|
+
routeIndex > 0 &&
|
|
64
|
+
routeIndex === focusedIndex;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import {
|
|
2
|
+
runOnJS,
|
|
3
|
+
type SharedValue,
|
|
4
|
+
useAnimatedReaction,
|
|
5
|
+
} from "react-native-reanimated";
|
|
6
|
+
|
|
7
|
+
export const useCloseCompletion = ({
|
|
8
|
+
closing,
|
|
9
|
+
animationProgress,
|
|
10
|
+
onComplete,
|
|
11
|
+
}: {
|
|
12
|
+
closing: SharedValue<number>;
|
|
13
|
+
animationProgress: SharedValue<number>;
|
|
14
|
+
onComplete: () => void;
|
|
15
|
+
}) => {
|
|
16
|
+
useAnimatedReaction(
|
|
17
|
+
() => {
|
|
18
|
+
"worklet";
|
|
19
|
+
return !!closing.get() && animationProgress.get() <= 0;
|
|
20
|
+
},
|
|
21
|
+
(complete, previouslyComplete) => {
|
|
22
|
+
"worklet";
|
|
23
|
+
if (complete && !previouslyComplete) {
|
|
24
|
+
runOnJS(onComplete)();
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
);
|
|
28
|
+
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
/** biome-ignore-all lint/correctness/useHookAtTopLevel: STACK_TYPE is stable per navigator */
|
|
2
1
|
import { useLayoutEffect, useMemo, useRef } from "react";
|
|
2
|
+
import { useNavigationHelpers } from "../../../hooks/navigation/use-navigation-helpers";
|
|
3
3
|
import useStableCallback from "../../../hooks/use-stable-callback";
|
|
4
|
+
import { hasTransitionsEnabled } from "../../../providers/screen/animation/helpers/has-transitions-enabled";
|
|
4
5
|
import {
|
|
5
6
|
type BaseDescriptor,
|
|
6
7
|
useDescriptorsStore,
|
|
@@ -8,68 +9,34 @@ import {
|
|
|
8
9
|
import { useBlankStackStore } from "../../../providers/stack/blank-stack.provider";
|
|
9
10
|
import { useStackCoreStore } from "../../../providers/stack/core.provider";
|
|
10
11
|
import { GestureStore } from "../../../stores/gesture.store";
|
|
11
|
-
import {
|
|
12
|
-
LifecycleTransitionRequestKind,
|
|
13
|
-
type SystemStoreActions,
|
|
14
|
-
type SystemStoreMap,
|
|
15
|
-
} from "../../../stores/system.store";
|
|
16
12
|
import { StackType } from "../../../types/stack.types";
|
|
13
|
+
import {
|
|
14
|
+
dispatchCloseAction,
|
|
15
|
+
isCloseActionReplay,
|
|
16
|
+
} from "../../../utils/navigation/close-action-replay";
|
|
17
|
+
import {
|
|
18
|
+
doesNavigatorOwnCloseAction,
|
|
19
|
+
shouldInterceptClose,
|
|
20
|
+
} from "./helpers/close-interception-rules";
|
|
17
21
|
import { resetStoresForScreen } from "./helpers/reset-stores-for-screen";
|
|
18
22
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const useBlankStackClose = ({
|
|
26
|
-
current,
|
|
27
|
-
requestLifecycleTransition,
|
|
28
|
-
resetStores,
|
|
29
|
-
}: CloseHookParams) => {
|
|
23
|
+
export function useCloseTransitionIntent(current: BaseDescriptor): {
|
|
24
|
+
completeClose: () => void;
|
|
25
|
+
} {
|
|
26
|
+
const routeKey = current.route.key;
|
|
27
|
+
const { STACK_TYPE: stackType, TRANSITIONS_ALWAYS_ON: transitionsAlwaysOn } =
|
|
28
|
+
useStackCoreStore((store) => store.flags);
|
|
30
29
|
const handleCloseRoute = useBlankStackStore(
|
|
31
30
|
(store) => store?.handleCloseRoute,
|
|
32
31
|
);
|
|
33
|
-
const
|
|
34
|
-
(store) => store?.scenesByKey[
|
|
32
|
+
const isBlankStackClosing = useBlankStackStore(
|
|
33
|
+
(store) => store?.scenesByKey[routeKey]?.activity === "closing",
|
|
35
34
|
);
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
if (!isClosing) {
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
requestLifecycleTransition(
|
|
43
|
-
LifecycleTransitionRequestKind.BlankStackClose,
|
|
44
|
-
0,
|
|
45
|
-
);
|
|
46
|
-
}, [isClosing, requestLifecycleTransition]);
|
|
47
|
-
|
|
48
|
-
const handleBlankStackCloseEnd = useStableCallback((finished: boolean) => {
|
|
49
|
-
if (!finished) return;
|
|
50
|
-
if (!handleCloseRoute) {
|
|
51
|
-
throw new Error("Blank stack close handler was not found.");
|
|
52
|
-
}
|
|
53
|
-
handleCloseRoute({ route: current.route });
|
|
54
|
-
requestAnimationFrame(() => {
|
|
55
|
-
resetStores();
|
|
56
|
-
});
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
return { handleBlankStackCloseEnd };
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* Native stack close - listens to beforeRemove navigation event.
|
|
64
|
-
*/
|
|
65
|
-
const useNativeStackClose = ({
|
|
66
|
-
current,
|
|
67
|
-
requestLifecycleTransition,
|
|
68
|
-
resetStores,
|
|
69
|
-
}: CloseHookParams) => {
|
|
70
|
-
const parentScreenKey = useDescriptorsStore(
|
|
71
|
-
(store) => store.derivations.parentScreenKey,
|
|
35
|
+
const ancestorKeys = useDescriptorsStore(
|
|
36
|
+
(store) => store.derivations.ancestorKeys,
|
|
72
37
|
);
|
|
38
|
+
const parentScreenKey = ancestorKeys[0];
|
|
39
|
+
const { dismissScreen, requestDismiss } = useNavigationHelpers();
|
|
73
40
|
const pendingActionRef = useRef<any>(null);
|
|
74
41
|
|
|
75
42
|
const nearestAncestorDismissing = useMemo(() => {
|
|
@@ -78,76 +45,72 @@ const useNativeStackClose = ({
|
|
|
78
45
|
return GestureStore.peekBag(parentScreenKey)?.dismissing ?? null;
|
|
79
46
|
}, [parentScreenKey]);
|
|
80
47
|
|
|
81
|
-
|
|
82
|
-
if (
|
|
83
|
-
|
|
84
|
-
return;
|
|
48
|
+
useLayoutEffect(() => {
|
|
49
|
+
if (isBlankStackClosing) {
|
|
50
|
+
requestDismiss();
|
|
85
51
|
}
|
|
52
|
+
}, [isBlankStackClosing, requestDismiss]);
|
|
86
53
|
|
|
87
|
-
|
|
54
|
+
const completeClose = useStableCallback(() => {
|
|
55
|
+
const pendingAction = pendingActionRef.current;
|
|
88
56
|
pendingActionRef.current = null;
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
57
|
+
|
|
58
|
+
if (pendingAction) {
|
|
59
|
+
dispatchCloseAction(pendingAction, (action) => {
|
|
60
|
+
current.navigation.dispatch(action);
|
|
61
|
+
});
|
|
62
|
+
} else if (stackType !== StackType.NATIVE && handleCloseRoute) {
|
|
63
|
+
handleCloseRoute({ route: current.route });
|
|
64
|
+
} else {
|
|
65
|
+
dismissScreen();
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
resetStoresForScreen(routeKey);
|
|
92
69
|
});
|
|
93
70
|
|
|
94
|
-
const handleBeforeRemove = useStableCallback((
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
const state = navigation.getState();
|
|
71
|
+
const handleBeforeRemove = useStableCallback((event: any) => {
|
|
72
|
+
if (isCloseActionReplay(event.data.action)) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const state = current.navigation.getState();
|
|
100
77
|
const routeIndex = state.routes.findIndex(
|
|
101
78
|
(route) => route.key === routeKey,
|
|
102
79
|
);
|
|
103
|
-
const
|
|
80
|
+
const action = event.data.action;
|
|
81
|
+
const ownsAction = doesNavigatorOwnCloseAction({
|
|
82
|
+
state,
|
|
83
|
+
action,
|
|
84
|
+
});
|
|
85
|
+
const shouldIntercept = shouldInterceptClose({
|
|
86
|
+
enabled: hasTransitionsEnabled(current.options, transitionsAlwaysOn),
|
|
87
|
+
ownsAction,
|
|
88
|
+
ancestorDismissing: !!nearestAncestorDismissing?.get(),
|
|
89
|
+
routeIndex,
|
|
90
|
+
focusedIndex: state.index,
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
if (!shouldIntercept) {
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
104
96
|
|
|
105
|
-
|
|
106
|
-
|
|
97
|
+
pendingActionRef.current ??= event.data.action;
|
|
98
|
+
if (!requestDismiss()) {
|
|
99
|
+
pendingActionRef.current = null;
|
|
107
100
|
return;
|
|
108
101
|
}
|
|
109
102
|
|
|
110
|
-
|
|
111
|
-
pendingActionRef.current = e.data.action;
|
|
112
|
-
requestLifecycleTransition(LifecycleTransitionRequestKind.NativeClose, 0);
|
|
103
|
+
event.preventDefault();
|
|
113
104
|
});
|
|
114
105
|
|
|
115
106
|
// biome-ignore lint/correctness/useExhaustiveDependencies: navigation listener should only rebind when the navigator instance changes
|
|
116
107
|
useLayoutEffect(() => {
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
return { handleNativeCloseEnd };
|
|
121
|
-
};
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
* Handles close transition intent and returns finish callbacks for cleanup.
|
|
125
|
-
*/
|
|
126
|
-
export function useCloseTransitionIntent(
|
|
127
|
-
current: BaseDescriptor,
|
|
128
|
-
system: SystemStoreMap,
|
|
129
|
-
): {
|
|
130
|
-
handleBlankStackCloseEnd?: (finished: boolean) => void;
|
|
131
|
-
handleNativeCloseEnd?: (finished: boolean) => void;
|
|
132
|
-
} {
|
|
133
|
-
const routeKey = current.route.key;
|
|
134
|
-
const stackType = useStackCoreStore((store) => store.flags.STACK_TYPE);
|
|
135
|
-
const isNativeStack = stackType === StackType.NATIVE;
|
|
136
|
-
const { requestLifecycleTransition } = system.actions;
|
|
137
|
-
|
|
138
|
-
const resetStores = useStableCallback(() => {
|
|
139
|
-
resetStoresForScreen(routeKey);
|
|
140
|
-
});
|
|
141
|
-
|
|
142
|
-
const closeParams: CloseHookParams = {
|
|
143
|
-
current,
|
|
144
|
-
requestLifecycleTransition,
|
|
145
|
-
resetStores,
|
|
146
|
-
};
|
|
108
|
+
if (stackType !== StackType.NATIVE) {
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
147
111
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
}
|
|
112
|
+
return current.navigation.addListener?.("beforeRemove", handleBeforeRemove);
|
|
113
|
+
}, [current.navigation, stackType]);
|
|
151
114
|
|
|
152
|
-
return
|
|
115
|
+
return { completeClose };
|
|
153
116
|
}
|
|
@@ -12,14 +12,10 @@ export const useTransitionStartController = ({
|
|
|
12
12
|
current,
|
|
13
13
|
animations,
|
|
14
14
|
system,
|
|
15
|
-
onBlankStackCloseFinish,
|
|
16
|
-
onNativeCloseFinish,
|
|
17
15
|
}: {
|
|
18
16
|
current: BaseDescriptor;
|
|
19
17
|
animations: AnimationStoreMap;
|
|
20
18
|
system: SystemStoreMap;
|
|
21
|
-
onBlankStackCloseFinish?: (finished: boolean) => void;
|
|
22
|
-
onNativeCloseFinish?: (finished: boolean) => void;
|
|
23
19
|
}) => {
|
|
24
20
|
const {
|
|
25
21
|
targetProgress,
|
|
@@ -53,13 +49,6 @@ export const useTransitionStartController = ({
|
|
|
53
49
|
return;
|
|
54
50
|
}
|
|
55
51
|
|
|
56
|
-
const onAnimationFinish =
|
|
57
|
-
kind === LifecycleTransitionRequestKind.BlankStackClose
|
|
58
|
-
? onBlankStackCloseFinish
|
|
59
|
-
: kind === LifecycleTransitionRequestKind.NativeClose
|
|
60
|
-
? onNativeCloseFinish
|
|
61
|
-
: undefined;
|
|
62
|
-
|
|
63
52
|
animateToProgress({
|
|
64
53
|
target,
|
|
65
54
|
spec: transitionSpec,
|
|
@@ -69,7 +58,6 @@ export const useTransitionStartController = ({
|
|
|
69
58
|
animations,
|
|
70
59
|
targetProgress,
|
|
71
60
|
animationProgress,
|
|
72
|
-
onAnimationFinish,
|
|
73
61
|
isDragging,
|
|
74
62
|
});
|
|
75
63
|
|
|
@@ -2,6 +2,7 @@ import { useDescriptorsStore } from "../../providers/screen/descriptors";
|
|
|
2
2
|
import { AnimationStore } from "../../stores/animation.store";
|
|
3
3
|
import { SystemStore } from "../../stores/system.store";
|
|
4
4
|
import { useScreenHistory } from "./hooks/history/use-screen-history";
|
|
5
|
+
import { useCloseCompletion } from "./hooks/use-close-completion";
|
|
5
6
|
import { useCloseTransitionIntent } from "./hooks/use-close-transition-intent";
|
|
6
7
|
import { useOpenTransitionIntent } from "./hooks/use-open-transition-intent";
|
|
7
8
|
import { useTransitionStartController } from "./hooks/use-transition-start-controller";
|
|
@@ -21,8 +22,7 @@ export const ScreenLifecycle = ({ children }: Props) => {
|
|
|
21
22
|
const animations = AnimationStore.getBag(current.route.key);
|
|
22
23
|
const system = SystemStore.getBag(current.route.key);
|
|
23
24
|
|
|
24
|
-
const {
|
|
25
|
-
useCloseTransitionIntent(current, system);
|
|
25
|
+
const { completeClose } = useCloseTransitionIntent(current);
|
|
26
26
|
|
|
27
27
|
useOpenTransitionIntent(current, animations, system);
|
|
28
28
|
|
|
@@ -30,8 +30,12 @@ export const ScreenLifecycle = ({ children }: Props) => {
|
|
|
30
30
|
current,
|
|
31
31
|
animations,
|
|
32
32
|
system,
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
useCloseCompletion({
|
|
36
|
+
closing: animations.closing,
|
|
37
|
+
animationProgress: system.animationProgress,
|
|
38
|
+
onComplete: completeClose,
|
|
35
39
|
});
|
|
36
40
|
|
|
37
41
|
useScreenHistory(current, previous, animations);
|