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
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
} from "react";
|
|
9
9
|
import type { View } from "react-native";
|
|
10
10
|
import type { AnimatedRef } from "react-native-reanimated";
|
|
11
|
-
import { useAnimatedRef } from "react-native-reanimated";
|
|
11
|
+
import { useAnimatedRef, useSharedValue } from "react-native-reanimated";
|
|
12
12
|
import { useDescriptorsStore } from "../../../providers/screen/descriptors";
|
|
13
13
|
import {
|
|
14
14
|
useComposedSlotStyles,
|
|
@@ -19,7 +19,7 @@ import { createBoundTag } from "../../../stores/bounds/helpers/link-pairs.helper
|
|
|
19
19
|
import type { BoundTag } from "../../../stores/bounds/types";
|
|
20
20
|
import createProvider from "../../../utils/create-provider";
|
|
21
21
|
import { logger } from "../../../utils/logger";
|
|
22
|
-
import {
|
|
22
|
+
import { BoundaryLifecycle } from "../components/boundary-lifecycle";
|
|
23
23
|
import {
|
|
24
24
|
type BoundaryPortalRuntime,
|
|
25
25
|
resolveBoundaryPortal,
|
|
@@ -27,6 +27,8 @@ import {
|
|
|
27
27
|
import type {
|
|
28
28
|
BoundaryConfigProps,
|
|
29
29
|
BoundaryId,
|
|
30
|
+
BoundaryLocalMeasurement,
|
|
31
|
+
BoundaryLocalMeasurementValue,
|
|
30
32
|
BoundaryOwnProps,
|
|
31
33
|
} from "../types";
|
|
32
34
|
|
|
@@ -44,6 +46,7 @@ export type BoundaryRootRenderState = {
|
|
|
44
46
|
boundTag: BoundTag;
|
|
45
47
|
currentScreenKey: string;
|
|
46
48
|
handoffEnabled: boolean;
|
|
49
|
+
localMeasurement: BoundaryLocalMeasurementValue;
|
|
47
50
|
measurementRef: AnimatedRef<View>;
|
|
48
51
|
portalRuntime: BoundaryPortalRuntime;
|
|
49
52
|
ref: AnimatedRef<View>;
|
|
@@ -96,7 +99,9 @@ export const { BoundaryRootProvider, useBoundaryRootStore } = createProvider(
|
|
|
96
99
|
(s) => s.derivations.currentScreenKey,
|
|
97
100
|
);
|
|
98
101
|
const isCurrentScreenClosing = useBlankStackStore(
|
|
99
|
-
(store) =>
|
|
102
|
+
(store) =>
|
|
103
|
+
portalRuntime.handoff &&
|
|
104
|
+
store?.scenesByKey[currentScreenKey]?.activity === "closing",
|
|
100
105
|
);
|
|
101
106
|
const retainedBoundTagRef = useRef(requestedBoundTag);
|
|
102
107
|
const shouldRetainClosingBoundTag =
|
|
@@ -110,10 +115,6 @@ export const { BoundaryRootProvider, useBoundaryRootStore } = createProvider(
|
|
|
110
115
|
}
|
|
111
116
|
|
|
112
117
|
const boundTag = retainedBoundTagRef.current;
|
|
113
|
-
const hasConfiguredInterpolator = useDescriptorsStore(
|
|
114
|
-
(s) => s.derivations.hasConfiguredInterpolator,
|
|
115
|
-
);
|
|
116
|
-
const runtimeEnabled = enabled && hasConfiguredInterpolator;
|
|
117
118
|
// Associated slot styles attach whenever the boundary is enabled,
|
|
118
119
|
// independent of whether an interpolator is configured for this transition.
|
|
119
120
|
const shouldAttachAssociatedStyles = enabled;
|
|
@@ -123,6 +124,9 @@ export const { BoundaryRootProvider, useBoundaryRootStore } = createProvider(
|
|
|
123
124
|
const associatedStackingStyles = useSlotStackingStyles(boundTag.tag);
|
|
124
125
|
const rootRef = useAnimatedRef<View>();
|
|
125
126
|
const measurementRef = useAnimatedRef<View>();
|
|
127
|
+
const localMeasurement = useSharedValue<BoundaryLocalMeasurement | null>(
|
|
128
|
+
null,
|
|
129
|
+
);
|
|
126
130
|
|
|
127
131
|
useLayoutEffect(() => {
|
|
128
132
|
if (__DEV__ && targetCount > 1) {
|
|
@@ -137,18 +141,6 @@ export const { BoundaryRootProvider, useBoundaryRootStore } = createProvider(
|
|
|
137
141
|
|
|
138
142
|
useImperativeHandle(forwardedRef, () => rootRef.current as any, [rootRef]);
|
|
139
143
|
|
|
140
|
-
useBoundaryMeasurement({
|
|
141
|
-
boundTag,
|
|
142
|
-
enabled,
|
|
143
|
-
runtimeEnabled,
|
|
144
|
-
currentScreenKey,
|
|
145
|
-
measuredRef,
|
|
146
|
-
style: hasTarget ? targetStyle : style,
|
|
147
|
-
handoff: portalRuntime.handoff,
|
|
148
|
-
escapeClipping: portalRuntime.escapeClipping,
|
|
149
|
-
config,
|
|
150
|
-
});
|
|
151
|
-
|
|
152
144
|
const shouldRenderBoundaryRootThroughPortal =
|
|
153
145
|
shouldEscapeBoundaryRootToScreenHost && !hasTarget;
|
|
154
146
|
const handoffEnabled = enabled && portalRuntime.handoff;
|
|
@@ -173,6 +165,7 @@ export const { BoundaryRootProvider, useBoundaryRootStore } = createProvider(
|
|
|
173
165
|
boundTag,
|
|
174
166
|
currentScreenKey,
|
|
175
167
|
handoffEnabled,
|
|
168
|
+
localMeasurement,
|
|
176
169
|
measurementRef,
|
|
177
170
|
portalRuntime,
|
|
178
171
|
ref: rootRef,
|
|
@@ -185,6 +178,7 @@ export const { BoundaryRootProvider, useBoundaryRootStore } = createProvider(
|
|
|
185
178
|
currentScreenKey,
|
|
186
179
|
handoffEnabled,
|
|
187
180
|
hasTarget,
|
|
181
|
+
localMeasurement,
|
|
188
182
|
measurementRef,
|
|
189
183
|
portalRuntime,
|
|
190
184
|
rootRef,
|
|
@@ -194,7 +188,22 @@ export const { BoundaryRootProvider, useBoundaryRootStore } = createProvider(
|
|
|
194
188
|
|
|
195
189
|
return {
|
|
196
190
|
value,
|
|
197
|
-
children:
|
|
191
|
+
children: (
|
|
192
|
+
<>
|
|
193
|
+
{children(value)}
|
|
194
|
+
<BoundaryLifecycle
|
|
195
|
+
boundTag={boundTag}
|
|
196
|
+
config={config}
|
|
197
|
+
currentScreenKey={currentScreenKey}
|
|
198
|
+
enabled={enabled}
|
|
199
|
+
escapeClipping={portalRuntime.escapeClipping}
|
|
200
|
+
handoff={portalRuntime.handoff}
|
|
201
|
+
localMeasurement={localMeasurement}
|
|
202
|
+
measuredRef={measuredRef}
|
|
203
|
+
style={hasTarget ? targetStyle : style}
|
|
204
|
+
/>
|
|
205
|
+
</>
|
|
206
|
+
),
|
|
198
207
|
};
|
|
199
208
|
},
|
|
200
209
|
);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { MeasuredDimensions, SharedValue } from "react-native-reanimated";
|
|
1
2
|
import type { ScreenPairKey } from "../../stores/bounds/types";
|
|
2
3
|
import type { BoundsOptions } from "../../utils/bounds/types/options";
|
|
3
4
|
|
|
@@ -60,3 +61,11 @@ export type MeasureTarget =
|
|
|
60
61
|
};
|
|
61
62
|
|
|
62
63
|
export type MeasureBoundary = (target: MeasureTarget) => void;
|
|
64
|
+
|
|
65
|
+
export type BoundaryLocalMeasurement = {
|
|
66
|
+
bounds: MeasuredDimensions;
|
|
67
|
+
pairKey: ScreenPairKey;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
export type BoundaryLocalMeasurementValue =
|
|
71
|
+
SharedValue<BoundaryLocalMeasurement | null>;
|
|
@@ -34,6 +34,7 @@ export const getRefreshBoundarySignal = (params: {
|
|
|
34
34
|
linkId: string;
|
|
35
35
|
group?: string;
|
|
36
36
|
shouldRefresh: boolean;
|
|
37
|
+
settled?: boolean;
|
|
37
38
|
closing: boolean;
|
|
38
39
|
linkState?: LinkPairsState;
|
|
39
40
|
}): RefreshBoundarySignal | null => {
|
|
@@ -46,13 +47,14 @@ export const getRefreshBoundarySignal = (params: {
|
|
|
46
47
|
linkId,
|
|
47
48
|
group,
|
|
48
49
|
shouldRefresh,
|
|
50
|
+
settled = false,
|
|
49
51
|
closing,
|
|
50
52
|
linkState,
|
|
51
53
|
} = params;
|
|
52
54
|
|
|
53
55
|
if (!enabled) return null;
|
|
54
56
|
|
|
55
|
-
if (!shouldRefresh) {
|
|
57
|
+
if (!shouldRefresh && (!group || !settled)) {
|
|
56
58
|
return null;
|
|
57
59
|
}
|
|
58
60
|
|
|
@@ -95,16 +97,33 @@ export const getRefreshBoundarySignal = (params: {
|
|
|
95
97
|
// Source side:
|
|
96
98
|
// When the activeId changes, trigger a refresh to ensure the source bounds are captured.
|
|
97
99
|
if (sourcePairKey) {
|
|
98
|
-
const
|
|
100
|
+
const pair = linkState?.[sourcePairKey];
|
|
101
|
+
const groupState = pair?.groups?.[group];
|
|
102
|
+
const activeId = groupState?.activeId;
|
|
99
103
|
|
|
100
104
|
if (activeId !== linkId) {
|
|
101
105
|
return null;
|
|
102
106
|
}
|
|
103
107
|
|
|
108
|
+
// The opening member is captured by the initial handshake. A settled
|
|
109
|
+
// refresh is only needed after selection moves to another member.
|
|
110
|
+
if (
|
|
111
|
+
!shouldRefresh &&
|
|
112
|
+
(groupState?.initialId === undefined ||
|
|
113
|
+
activeId === groupState.initialId ||
|
|
114
|
+
!!pair?.links?.[linkId]?.source)
|
|
115
|
+
) {
|
|
116
|
+
return null;
|
|
117
|
+
}
|
|
118
|
+
|
|
104
119
|
return buildRefreshSignal(
|
|
105
120
|
"source",
|
|
106
121
|
sourcePairKey,
|
|
107
|
-
[
|
|
122
|
+
[
|
|
123
|
+
group,
|
|
124
|
+
linkId,
|
|
125
|
+
shouldRefresh ? (closing ? "closing" : "settled") : "retarget",
|
|
126
|
+
].join("|"),
|
|
108
127
|
);
|
|
109
128
|
}
|
|
110
129
|
|
|
@@ -114,8 +133,9 @@ export const getRefreshBoundarySignal = (params: {
|
|
|
114
133
|
|
|
115
134
|
// Destination side:
|
|
116
135
|
// When the activeId changes, trigger a refresh to ensure the destination bounds are captured.
|
|
117
|
-
const
|
|
118
|
-
|
|
136
|
+
const pair = linkState?.[refreshDestinationPairKey];
|
|
137
|
+
const groupState = pair?.groups?.[group];
|
|
138
|
+
const activeId = groupState?.activeId;
|
|
119
139
|
|
|
120
140
|
// Destination retargeting should only measure a concrete member that already
|
|
121
141
|
// participates in the pair. Missing members fall back to initialId at resolve.
|
|
@@ -123,9 +143,22 @@ export const getRefreshBoundarySignal = (params: {
|
|
|
123
143
|
return null;
|
|
124
144
|
}
|
|
125
145
|
|
|
146
|
+
if (
|
|
147
|
+
!shouldRefresh &&
|
|
148
|
+
(groupState?.initialId === undefined ||
|
|
149
|
+
activeId === groupState.initialId ||
|
|
150
|
+
!!pair?.links?.[linkId]?.destination)
|
|
151
|
+
) {
|
|
152
|
+
return null;
|
|
153
|
+
}
|
|
154
|
+
|
|
126
155
|
return buildRefreshSignal(
|
|
127
156
|
"destination",
|
|
128
157
|
refreshDestinationPairKey,
|
|
129
|
-
[
|
|
158
|
+
[
|
|
159
|
+
group,
|
|
160
|
+
linkId,
|
|
161
|
+
shouldRefresh ? (closing ? "closing" : "settled") : "retarget",
|
|
162
|
+
].join("|"),
|
|
130
163
|
);
|
|
131
164
|
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { updateDerivations } from "../../../providers/screen/animation/helpers/derivations";
|
|
2
|
+
import type { ScreenInterpolatorFrame } from "../../../providers/screen/animation/helpers/pipeline";
|
|
3
|
+
|
|
4
|
+
export const createOverlayInterpolatorFrame = ({
|
|
5
|
+
overlayFrame,
|
|
6
|
+
driverFrame,
|
|
7
|
+
previousOverlayFrame,
|
|
8
|
+
}: {
|
|
9
|
+
overlayFrame: ScreenInterpolatorFrame;
|
|
10
|
+
driverFrame: ScreenInterpolatorFrame;
|
|
11
|
+
previousOverlayFrame?: ScreenInterpolatorFrame;
|
|
12
|
+
}): ScreenInterpolatorFrame => {
|
|
13
|
+
"worklet";
|
|
14
|
+
const current = overlayFrame.current;
|
|
15
|
+
const driverIsCurrent = driverFrame.current.route.key === current.route.key;
|
|
16
|
+
const frame: ScreenInterpolatorFrame = {
|
|
17
|
+
...overlayFrame,
|
|
18
|
+
previous: previousOverlayFrame?.current,
|
|
19
|
+
current,
|
|
20
|
+
next: driverIsCurrent ? undefined : driverFrame.current,
|
|
21
|
+
layouts: current.layouts,
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
updateDerivations(frame);
|
|
25
|
+
frame.stackProgress = frame.progress;
|
|
26
|
+
frame.logicallySettled = frame.active.settled;
|
|
27
|
+
|
|
28
|
+
return frame;
|
|
29
|
+
};
|
|
@@ -1,39 +1,81 @@
|
|
|
1
1
|
import type { StackScene } from "../../../hooks/navigation/use-stack";
|
|
2
2
|
import { isOverlayVisible } from "../../../utils/overlay/visibility";
|
|
3
3
|
|
|
4
|
+
export type FloatOverlayActivity = "active" | "inert" | "inactive" | "closing";
|
|
5
|
+
|
|
6
|
+
export type FloatOverlayEntry = {
|
|
7
|
+
scene: StackScene;
|
|
8
|
+
overlayIndex: number;
|
|
9
|
+
activity: FloatOverlayActivity;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export type FloatOverlayTransitionEntry = FloatOverlayEntry & {
|
|
13
|
+
driverScene: StackScene;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
type OverlayCandidate = Omit<FloatOverlayEntry, "activity">;
|
|
17
|
+
|
|
18
|
+
const resolveOverlayActivity = (
|
|
19
|
+
scene: StackScene,
|
|
20
|
+
distanceFromTop: number,
|
|
21
|
+
): FloatOverlayActivity => {
|
|
22
|
+
if (distanceFromTop === 0 && scene.activity === "closing") {
|
|
23
|
+
return "closing";
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
if (distanceFromTop === 0) {
|
|
27
|
+
return "active";
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
if (distanceFromTop === 1) {
|
|
31
|
+
return "inert";
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return "inactive";
|
|
35
|
+
};
|
|
36
|
+
|
|
4
37
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
38
|
+
* Finds every visible floating-overlay checkpoint in stack order.
|
|
39
|
+
*
|
|
40
|
+
* The newest checkpoint owns the active overlay. Its immediate predecessor
|
|
41
|
+
* remains visible and inert; all older checkpoints are retained but inactive.
|
|
42
|
+
* This mirrors the screen activity window without making plain screens create
|
|
43
|
+
* a new overlay checkpoint.
|
|
8
44
|
*/
|
|
9
|
-
export function
|
|
45
|
+
export function getFloatOverlayStack(
|
|
10
46
|
scenes: StackScene[],
|
|
11
|
-
index: number,
|
|
12
47
|
transitionsAlwaysOn: boolean,
|
|
13
|
-
):
|
|
14
|
-
|
|
15
|
-
return null;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
// When navigating back, closing scenes are kept at the top of the local stack
|
|
19
|
-
// while the focused index already points to the destination screen. We need to
|
|
20
|
-
// start scanning from the actual top of the stack so the overlay can animate
|
|
21
|
-
// out together with its closing screen instead of disappearing immediately.
|
|
22
|
-
const startIndex = Math.max(index, scenes.length - 1);
|
|
48
|
+
): FloatOverlayEntry[] {
|
|
49
|
+
const candidates: OverlayCandidate[] = [];
|
|
23
50
|
|
|
24
|
-
for (let
|
|
25
|
-
const scene = scenes[
|
|
51
|
+
for (let index = 0; index < scenes.length; index += 1) {
|
|
52
|
+
const scene = scenes[index];
|
|
26
53
|
const options = scene?.descriptor?.options;
|
|
27
54
|
|
|
28
|
-
// Skip screens without enableTransitions (native-stack only)
|
|
29
55
|
if (!transitionsAlwaysOn && !options?.enableTransitions) {
|
|
30
56
|
continue;
|
|
31
57
|
}
|
|
32
58
|
|
|
33
59
|
if (isOverlayVisible(options)) {
|
|
34
|
-
|
|
60
|
+
candidates.push({ scene, overlayIndex: index });
|
|
35
61
|
}
|
|
36
62
|
}
|
|
37
63
|
|
|
38
|
-
|
|
64
|
+
const topIndex = candidates.length - 1;
|
|
65
|
+
return candidates.map((candidate, index) => ({
|
|
66
|
+
...candidate,
|
|
67
|
+
activity: resolveOverlayActivity(candidate.scene, topIndex - index),
|
|
68
|
+
}));
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export function getFloatOverlayTransitions(
|
|
72
|
+
overlayStack: FloatOverlayEntry[],
|
|
73
|
+
scenes: StackScene[],
|
|
74
|
+
): FloatOverlayTransitionEntry[] {
|
|
75
|
+
const topScene = scenes[scenes.length - 1];
|
|
76
|
+
|
|
77
|
+
return overlayStack.map((entry, index) => ({
|
|
78
|
+
...entry,
|
|
79
|
+
driverScene: overlayStack[index + 1]?.scene ?? topScene ?? entry.scene,
|
|
80
|
+
}));
|
|
39
81
|
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { ScreenAnimationContextValue } from "../../../providers/screen/animation/animation.provider";
|
|
2
|
+
import type { ScreenSlotContextValue } from "../../../providers/screen/styles/slot.provider";
|
|
3
|
+
import type { FloatOverlayEntry } from "./get-active-overlay";
|
|
4
|
+
|
|
5
|
+
export type ReadyOverlayResources = {
|
|
6
|
+
overlayAnimationStore: ScreenAnimationContextValue;
|
|
7
|
+
driverScene: FloatOverlayEntry["scene"];
|
|
8
|
+
driverAnimationStore: ScreenAnimationContextValue;
|
|
9
|
+
driverSlots: ScreenSlotContextValue;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export function retainReadyOverlayResources(
|
|
13
|
+
previous: ReadyOverlayResources | null,
|
|
14
|
+
overlayAnimationStore: ScreenAnimationContextValue | null,
|
|
15
|
+
driverScene: FloatOverlayEntry["scene"],
|
|
16
|
+
driverAnimationStore: ScreenAnimationContextValue | null,
|
|
17
|
+
driverSlots: ScreenSlotContextValue | null,
|
|
18
|
+
): ReadyOverlayResources | null {
|
|
19
|
+
if (!overlayAnimationStore || !driverAnimationStore || !driverSlots) {
|
|
20
|
+
return previous;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
if (
|
|
24
|
+
previous?.overlayAnimationStore === overlayAnimationStore &&
|
|
25
|
+
previous.driverScene === driverScene &&
|
|
26
|
+
previous.driverAnimationStore === driverAnimationStore &&
|
|
27
|
+
previous.driverSlots === driverSlots
|
|
28
|
+
) {
|
|
29
|
+
return previous;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return {
|
|
33
|
+
overlayAnimationStore,
|
|
34
|
+
driverScene,
|
|
35
|
+
driverAnimationStore,
|
|
36
|
+
driverSlots,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { ScreenInterpolatorFrame } from "../../../providers/screen/animation/helpers/pipeline";
|
|
2
|
+
import { createInterpolatorScope } from "../../../providers/screen/styles/helpers/create-interpolator-scope";
|
|
3
|
+
import { normalizeSlots } from "../../../providers/screen/styles/helpers/normalize-slots";
|
|
4
|
+
import { selectInterpolatorFrame } from "../../../providers/screen/styles/helpers/select-interpolator-frame";
|
|
5
|
+
import type {
|
|
6
|
+
NormalizedTransitionSlotStyle,
|
|
7
|
+
ScreenStyleInterpolator,
|
|
8
|
+
ScreenTransitionAccessor,
|
|
9
|
+
} from "../../../types/animation.types";
|
|
10
|
+
import { logger } from "../../../utils/logger";
|
|
11
|
+
|
|
12
|
+
export const runOverlaySlotInterpolator = ({
|
|
13
|
+
frame,
|
|
14
|
+
interpolator,
|
|
15
|
+
transition,
|
|
16
|
+
}: {
|
|
17
|
+
frame: ScreenInterpolatorFrame;
|
|
18
|
+
interpolator: ScreenStyleInterpolator | undefined;
|
|
19
|
+
transition: ScreenTransitionAccessor;
|
|
20
|
+
}): NormalizedTransitionSlotStyle | undefined => {
|
|
21
|
+
"worklet";
|
|
22
|
+
|
|
23
|
+
if (!interpolator) {
|
|
24
|
+
return undefined;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
try {
|
|
28
|
+
const raw = interpolator(
|
|
29
|
+
createInterpolatorScope({
|
|
30
|
+
frame,
|
|
31
|
+
selectedFrame: selectInterpolatorFrame(frame, false),
|
|
32
|
+
transition,
|
|
33
|
+
}),
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
if (!raw?.overlay) {
|
|
37
|
+
return undefined;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return normalizeSlots({ overlay: raw.overlay }).overlay;
|
|
41
|
+
} catch (_) {
|
|
42
|
+
if (__DEV__) {
|
|
43
|
+
logger.warn("screenStyleInterpolator must be a worklet");
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return undefined;
|
|
47
|
+
}
|
|
48
|
+
};
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { useMemo } from "react";
|
|
2
|
+
import { useWindowDimensions } from "react-native";
|
|
3
|
+
import {
|
|
4
|
+
type SharedValue,
|
|
5
|
+
useAnimatedProps,
|
|
6
|
+
useAnimatedStyle,
|
|
7
|
+
useDerivedValue,
|
|
8
|
+
} from "react-native-reanimated";
|
|
9
|
+
import { NO_PROPS, NO_STYLES } from "../../../constants";
|
|
10
|
+
import type { ScreenAnimationContextValue } from "../../../providers/screen/animation/animation.provider";
|
|
11
|
+
import { useBuildTransitionAccessor } from "../../../providers/screen/animation/helpers/accessors/use-build-transition-accessor";
|
|
12
|
+
import { collectInterpolatorSharedValues } from "../../../providers/screen/styles/helpers/collect-interpolator-shared-values";
|
|
13
|
+
import type {
|
|
14
|
+
NormalizedTransitionSlotStyle,
|
|
15
|
+
ScreenStyleInterpolator,
|
|
16
|
+
} from "../../../types/animation.types";
|
|
17
|
+
import { getVisibilityBlockOffset } from "../../../utils/visibility-block-offset";
|
|
18
|
+
import { createOverlayInterpolatorFrame } from "../helpers/create-overlay-interpolator-frame";
|
|
19
|
+
import { runOverlaySlotInterpolator } from "../helpers/run-overlay-slot-interpolator";
|
|
20
|
+
|
|
21
|
+
export const useOverlaySlot = ({
|
|
22
|
+
overlayAnimationStore,
|
|
23
|
+
driverAnimationStore,
|
|
24
|
+
previousOverlayAnimationStore,
|
|
25
|
+
driverInterpolator,
|
|
26
|
+
interpolatorReady,
|
|
27
|
+
isIncoming,
|
|
28
|
+
}: {
|
|
29
|
+
overlayAnimationStore: ScreenAnimationContextValue;
|
|
30
|
+
driverAnimationStore: ScreenAnimationContextValue;
|
|
31
|
+
previousOverlayAnimationStore?: ScreenAnimationContextValue;
|
|
32
|
+
driverInterpolator: ScreenStyleInterpolator | undefined;
|
|
33
|
+
interpolatorReady: SharedValue<number>;
|
|
34
|
+
isIncoming: boolean;
|
|
35
|
+
}) => {
|
|
36
|
+
const { height } = useWindowDimensions();
|
|
37
|
+
const transition = useBuildTransitionAccessor(driverAnimationStore);
|
|
38
|
+
|
|
39
|
+
const interpolatorSharedValues = useMemo(
|
|
40
|
+
() => collectInterpolatorSharedValues([driverInterpolator]),
|
|
41
|
+
[driverInterpolator],
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
const overlaySlot = useDerivedValue<
|
|
45
|
+
NormalizedTransitionSlotStyle | undefined
|
|
46
|
+
>(() => {
|
|
47
|
+
"worklet";
|
|
48
|
+
overlayAnimationStore.screenInterpolatorPropsRevision.get();
|
|
49
|
+
driverAnimationStore.screenInterpolatorPropsRevision.get();
|
|
50
|
+
previousOverlayAnimationStore?.screenInterpolatorPropsRevision.get();
|
|
51
|
+
|
|
52
|
+
for (let index = 0; index < interpolatorSharedValues.length; index++) {
|
|
53
|
+
interpolatorSharedValues[index]?.get();
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const frame = createOverlayInterpolatorFrame({
|
|
57
|
+
overlayFrame: overlayAnimationStore.screenInterpolatorProps.get(),
|
|
58
|
+
driverFrame: driverAnimationStore.screenInterpolatorProps.get(),
|
|
59
|
+
previousOverlayFrame:
|
|
60
|
+
previousOverlayAnimationStore?.screenInterpolatorProps.get(),
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
return runOverlaySlotInterpolator({
|
|
64
|
+
frame,
|
|
65
|
+
interpolator: driverInterpolator,
|
|
66
|
+
transition,
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
const animatedStyle = useAnimatedStyle(() => {
|
|
71
|
+
"worklet";
|
|
72
|
+
const slot = overlaySlot.get();
|
|
73
|
+
if (!slot) {
|
|
74
|
+
return NO_STYLES;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
if (isIncoming && !interpolatorReady.get()) {
|
|
78
|
+
return {
|
|
79
|
+
transform: [{ translateY: getVisibilityBlockOffset(height) }],
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
return slot.style ?? NO_STYLES;
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
const animatedProps = useAnimatedProps(() => {
|
|
87
|
+
"worklet";
|
|
88
|
+
const slotProps = overlaySlot.get()?.props;
|
|
89
|
+
if (!slotProps) {
|
|
90
|
+
return NO_PROPS;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
const {
|
|
94
|
+
pointerEvents: _pointerEvents,
|
|
95
|
+
teleport: _teleport,
|
|
96
|
+
...props
|
|
97
|
+
} = slotProps;
|
|
98
|
+
|
|
99
|
+
return props;
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
return { animatedProps, animatedStyle };
|
|
103
|
+
};
|
|
@@ -1,14 +1,9 @@
|
|
|
1
|
-
import { useMemo } from "react";
|
|
2
|
-
import { snapDescriptorToIndex } from "../../../animation/snap-to";
|
|
3
1
|
import { useStack } from "../../../hooks/navigation/use-stack";
|
|
4
|
-
import { ScreenAnimationProvider } from "../../../providers/screen/animation";
|
|
5
|
-
import type { BaseDescriptor } from "../../../providers/screen/descriptors";
|
|
6
|
-
import { DescriptorsProvider } from "../../../providers/screen/descriptors";
|
|
7
|
-
import { ScreenOptionsProvider } from "../../../providers/screen/options";
|
|
8
|
-
import { ScreenSlotProvider } from "../../../providers/screen/styles";
|
|
9
|
-
import type { OverlayScreenState } from "../../../types/overlay.types";
|
|
10
2
|
|
|
11
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
getFloatOverlayStack,
|
|
5
|
+
getFloatOverlayTransitions,
|
|
6
|
+
} from "../helpers/get-active-overlay";
|
|
12
7
|
import { OverlayHost } from "./overlay-host";
|
|
13
8
|
|
|
14
9
|
/**
|
|
@@ -16,65 +11,28 @@ import { OverlayHost } from "./overlay-host";
|
|
|
16
11
|
* Gets routes and descriptors from stack context.
|
|
17
12
|
*/
|
|
18
13
|
export function FloatOverlay() {
|
|
19
|
-
const { scenes,
|
|
14
|
+
const { scenes, flags } = useStack();
|
|
20
15
|
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
[scenes, focusedIndex, flags.TRANSITIONS_ALWAYS_ON],
|
|
16
|
+
const overlayStack = getFloatOverlayStack(
|
|
17
|
+
scenes,
|
|
18
|
+
flags.TRANSITIONS_ALWAYS_ON,
|
|
25
19
|
);
|
|
26
|
-
|
|
27
|
-
const overlayData = useMemo(() => {
|
|
28
|
-
if (!activeOverlay) return null;
|
|
29
|
-
|
|
30
|
-
const { scene, overlayIndex } = activeOverlay;
|
|
31
|
-
const previous = scenes[overlayIndex - 1]?.descriptor;
|
|
32
|
-
const current = scene.descriptor;
|
|
33
|
-
const next = scenes[overlayIndex + 1]?.descriptor;
|
|
34
|
-
const focusedScene = scenes[focusedIndex] ?? scenes[scenes.length - 1];
|
|
35
|
-
const focusedDescriptor = focusedScene?.descriptor;
|
|
36
|
-
|
|
37
|
-
const overlayScreenState: OverlayScreenState<BaseDescriptor["navigation"]> =
|
|
38
|
-
{
|
|
39
|
-
index: routeKeys.indexOf(current.route.key),
|
|
40
|
-
options: focusedDescriptor?.options ?? {},
|
|
41
|
-
routes,
|
|
42
|
-
focusedRoute: focusedScene?.route ?? current.route,
|
|
43
|
-
focusedIndex,
|
|
44
|
-
meta: focusedDescriptor?.options?.meta,
|
|
45
|
-
navigation: current.navigation,
|
|
46
|
-
snapTo: (index: number) => {
|
|
47
|
-
snapDescriptorToIndex(current, index);
|
|
48
|
-
},
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
return {
|
|
52
|
-
scene,
|
|
53
|
-
previous,
|
|
54
|
-
current,
|
|
55
|
-
next,
|
|
56
|
-
overlayScreenState,
|
|
57
|
-
};
|
|
58
|
-
}, [activeOverlay, scenes, focusedIndex, routeKeys, routes]);
|
|
59
|
-
|
|
60
|
-
if (!overlayData) {
|
|
20
|
+
if (overlayStack.length === 0) {
|
|
61
21
|
return null;
|
|
62
22
|
}
|
|
63
23
|
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
return (
|
|
67
|
-
|
|
68
|
-
<
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
</ScreenOptionsProvider>
|
|
78
|
-
</DescriptorsProvider>
|
|
24
|
+
const overlayTransitions = getFloatOverlayTransitions(overlayStack, scenes);
|
|
25
|
+
|
|
26
|
+
return overlayTransitions.map(
|
|
27
|
+
({ scene, activity, driverScene }, layerIndex) => (
|
|
28
|
+
<OverlayHost
|
|
29
|
+
key={scene.route.key}
|
|
30
|
+
scene={scene}
|
|
31
|
+
driverScene={driverScene}
|
|
32
|
+
previousOverlayScene={overlayTransitions[layerIndex - 1]?.scene}
|
|
33
|
+
activity={activity}
|
|
34
|
+
layerIndex={layerIndex}
|
|
35
|
+
/>
|
|
36
|
+
),
|
|
79
37
|
);
|
|
80
38
|
}
|