react-native-screen-transitions 3.11.1 → 3.11.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/native-stack/views/NativeStackView.native.js +1 -1
- package/lib/commonjs/native-stack/views/NativeStackView.native.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-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/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 +60 -86
- 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/gestures/hooks/use-screen-gesture-config.js +9 -2
- package/lib/commonjs/shared/providers/screen/gestures/hooks/use-screen-gesture-config.js.map +1 -1
- 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/helpers/create-interpolator-scope.js +40 -0
- package/lib/commonjs/shared/providers/screen/styles/helpers/create-interpolator-scope.js.map +1 -0
- package/lib/commonjs/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js +5 -10
- package/lib/commonjs/shared/providers/screen/styles/hooks/use-interpolated-style-maps.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/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/navigation/close-action-replay.js +22 -0
- package/lib/commonjs/shared/utils/navigation/close-action-replay.js.map +1 -0
- package/lib/module/native-stack/views/NativeStackView.native.js +1 -1
- package/lib/module/native-stack/views/NativeStackView.native.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-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/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 +60 -85
- 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/gestures/hooks/use-screen-gesture-config.js +9 -2
- package/lib/module/shared/providers/screen/gestures/hooks/use-screen-gesture-config.js.map +1 -1
- 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/helpers/create-interpolator-scope.js +35 -0
- package/lib/module/shared/providers/screen/styles/helpers/create-interpolator-scope.js.map +1 -0
- package/lib/module/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js +5 -10
- package/lib/module/shared/providers/screen/styles/hooks/use-interpolated-style-maps.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/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/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/navigation/close-action-replay.js +16 -0
- package/lib/module/shared/utils/navigation/close-action-replay.js.map +1 -0
- 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-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/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/providers/screen/gestures/hooks/use-screen-gesture-config.d.ts.map +1 -1
- 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/helpers/create-interpolator-scope.d.ts +9 -0
- package/lib/typescript/shared/providers/screen/styles/helpers/create-interpolator-scope.d.ts.map +1 -0
- package/lib/typescript/shared/providers/screen/styles/hooks/use-interpolated-style-maps.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/stores/system.store.d.ts +1 -2
- package/lib/typescript/shared/stores/system.store.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/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/native-stack/views/NativeStackView.native.tsx +3 -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-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/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 +67 -108
- 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/providers/helpers/measured-bounds-writes.ts +1 -1
- package/src/shared/providers/screen/gestures/hooks/use-screen-gesture-config.ts +9 -1
- 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/helpers/create-interpolator-scope.ts +45 -0
- package/src/shared/providers/screen/styles/hooks/use-interpolated-style-maps.tsx +8 -12
- package/src/shared/providers/stack/blank-stack-state/blank-stack-controller.ts +5 -1
- package/src/shared/stores/bounds/internals/links.ts +1 -1
- package/src/shared/stores/system.store.ts +1 -2
- package/src/shared/utils/animation/animate-to-progress.ts +1 -22
- 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/animation/helpers/accessors/use-build-bounds-accessor.js +0 -21
- package/lib/commonjs/shared/providers/screen/animation/helpers/accessors/use-build-bounds-accessor.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/animation/helpers/accessors/use-build-bounds-accessor.js +0 -16
- package/lib/module/shared/providers/screen/animation/helpers/accessors/use-build-bounds-accessor.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/animation/helpers/accessors/use-build-bounds-accessor.d.ts +0 -2
- package/lib/typescript/shared/providers/screen/animation/helpers/accessors/use-build-bounds-accessor.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/animation/helpers/accessors/use-build-bounds-accessor.tsx +0 -15
|
@@ -1,16 +1,23 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
StackActions,
|
|
3
|
+
usePreventRemoveContext,
|
|
4
|
+
} from "@react-navigation/native";
|
|
2
5
|
import { useCallback } from "react";
|
|
3
6
|
import { useDescriptorsStore } from "../../providers/screen/descriptors";
|
|
7
|
+
import { AnimationStore } from "../../stores/animation.store";
|
|
8
|
+
import {
|
|
9
|
+
LifecycleTransitionRequestKind,
|
|
10
|
+
SystemStore,
|
|
11
|
+
} from "../../stores/system.store";
|
|
12
|
+
import { dispatchCloseAction } from "../../utils/navigation/close-action-replay";
|
|
4
13
|
import { useStack } from "./use-stack";
|
|
5
14
|
|
|
6
15
|
export function useNavigationHelpers() {
|
|
7
16
|
const route = useDescriptorsStore((store) => store.current.route);
|
|
8
17
|
const navigation = useDescriptorsStore((store) => store.current.navigation);
|
|
9
18
|
const requestStackDismiss = useStack((stack) => stack.requestDismiss);
|
|
10
|
-
|
|
11
|
-
const
|
|
12
|
-
return requestStackDismiss?.({ route }) ?? false;
|
|
13
|
-
}, [route, requestStackDismiss]);
|
|
19
|
+
const { preventedRoutes } = usePreventRemoveContext();
|
|
20
|
+
const isRemovePrevented = preventedRoutes[route.key]?.preventRemove === true;
|
|
14
21
|
|
|
15
22
|
const dismissScreen = useCallback((): boolean => {
|
|
16
23
|
const state = navigation.getState();
|
|
@@ -20,13 +27,38 @@ export function useNavigationHelpers() {
|
|
|
20
27
|
const routeStillPresent = routeIndex !== -1;
|
|
21
28
|
if (!routeStillPresent || routeIndex === 0) return false;
|
|
22
29
|
|
|
23
|
-
|
|
30
|
+
const action = {
|
|
24
31
|
...StackActions.pop(),
|
|
25
32
|
source: route.key,
|
|
26
33
|
target: state.key,
|
|
34
|
+
};
|
|
35
|
+
dispatchCloseAction(action, (closeAction) => {
|
|
36
|
+
navigation.dispatch(closeAction);
|
|
27
37
|
});
|
|
28
38
|
return true;
|
|
29
39
|
}, [navigation, route.key]);
|
|
30
40
|
|
|
31
|
-
|
|
41
|
+
const requestDismiss = useCallback((): boolean => {
|
|
42
|
+
if (isRemovePrevented) return false;
|
|
43
|
+
|
|
44
|
+
if (requestStackDismiss) {
|
|
45
|
+
if (!requestStackDismiss({ route })) return false;
|
|
46
|
+
} else {
|
|
47
|
+
const state = navigation.getState();
|
|
48
|
+
const routeIndex = state.routes.findIndex(
|
|
49
|
+
(stateRoute) => stateRoute.key === route.key,
|
|
50
|
+
);
|
|
51
|
+
if (routeIndex <= 0) return false;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
if (!AnimationStore.getValue(route.key, "closing").get()) {
|
|
55
|
+
SystemStore.getBag(route.key).actions.requestLifecycleTransition(
|
|
56
|
+
LifecycleTransitionRequestKind.Close,
|
|
57
|
+
0,
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
return true;
|
|
61
|
+
}, [isRemovePrevented, navigation, route, requestStackDismiss]);
|
|
62
|
+
|
|
63
|
+
return { dismissScreen, isRemovePrevented, requestDismiss };
|
|
32
64
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { usePreventRemoveContext } from "@react-navigation/native";
|
|
1
2
|
import { useMemo } from "react";
|
|
2
3
|
import { useDescriptorsStore } from "../../descriptors";
|
|
3
4
|
import { useGestureStore } from "../gestures.provider";
|
|
@@ -10,6 +11,12 @@ export function useScreenGestureConfig(): ScreenGestureConfig {
|
|
|
10
11
|
const isFirstKey = useDescriptorsStore(
|
|
11
12
|
(store) => store.derivations.isFirstKey,
|
|
12
13
|
);
|
|
14
|
+
const currentScreenKey = useDescriptorsStore(
|
|
15
|
+
(store) => store.derivations.currentScreenKey,
|
|
16
|
+
);
|
|
17
|
+
const { preventedRoutes } = usePreventRemoveContext();
|
|
18
|
+
const isRemovePrevented =
|
|
19
|
+
preventedRoutes[currentScreenKey]?.preventRemove === true;
|
|
13
20
|
|
|
14
21
|
return useMemo(
|
|
15
22
|
() =>
|
|
@@ -17,7 +24,8 @@ export function useScreenGestureConfig(): ScreenGestureConfig {
|
|
|
17
24
|
options,
|
|
18
25
|
isFirstKey,
|
|
19
26
|
gestureContext,
|
|
27
|
+
isRemovePrevented,
|
|
20
28
|
}),
|
|
21
|
-
[isFirstKey, options, gestureContext],
|
|
29
|
+
[isFirstKey, options, gestureContext, isRemovePrevented],
|
|
22
30
|
);
|
|
23
31
|
}
|
|
@@ -89,7 +89,6 @@ export const trackPanGesture = (
|
|
|
89
89
|
export const finalizePanRelease = (
|
|
90
90
|
release: PanReleaseResult,
|
|
91
91
|
runtime: PanGestureRuntime,
|
|
92
|
-
dismissScreen: ((finished: boolean) => void) | undefined,
|
|
93
92
|
dimensions: GestureDimensions,
|
|
94
93
|
rawEvent: PanGestureEvent,
|
|
95
94
|
requestDismiss?: () => void,
|
|
@@ -150,13 +149,8 @@ export const finalizePanRelease = (
|
|
|
150
149
|
return;
|
|
151
150
|
}
|
|
152
151
|
|
|
153
|
-
if (plan.shouldDismiss && requestDismiss) {
|
|
154
|
-
runOnJS(requestDismiss)();
|
|
155
|
-
}
|
|
156
|
-
|
|
157
152
|
animateToProgress({
|
|
158
153
|
target: plan.target,
|
|
159
|
-
onAnimationFinish: plan.shouldDismiss ? dismissScreen : undefined,
|
|
160
154
|
spec: plan.transitionSpec,
|
|
161
155
|
emitWillAnimate: false,
|
|
162
156
|
markEntering: false,
|
|
@@ -165,4 +159,8 @@ export const finalizePanRelease = (
|
|
|
165
159
|
animations,
|
|
166
160
|
initialVelocity: plan.progressVelocity,
|
|
167
161
|
});
|
|
162
|
+
|
|
163
|
+
if (plan.shouldDismiss && requestDismiss) {
|
|
164
|
+
runOnJS(requestDismiss)();
|
|
165
|
+
}
|
|
168
166
|
};
|
|
@@ -31,7 +31,7 @@ export const usePanBehavior = (
|
|
|
31
31
|
gestureCompositionOwner: SharedValue<GestureCompositionOwner>,
|
|
32
32
|
pendingDirection: SharedValue<Direction | null>,
|
|
33
33
|
): PanBehavior => {
|
|
34
|
-
const {
|
|
34
|
+
const { requestDismiss } = useNavigationHelpers();
|
|
35
35
|
const { withSensitivity, resetSensitivity } =
|
|
36
36
|
usePanGestureSensitivity(screenOptions);
|
|
37
37
|
|
|
@@ -109,7 +109,6 @@ export const usePanBehavior = (
|
|
|
109
109
|
finalizePanRelease(
|
|
110
110
|
release,
|
|
111
111
|
latestRuntime,
|
|
112
|
-
dismissScreen,
|
|
113
112
|
dimensions,
|
|
114
113
|
rawEvent,
|
|
115
114
|
requestDismiss,
|
|
@@ -124,7 +123,6 @@ export const usePanBehavior = (
|
|
|
124
123
|
runtime,
|
|
125
124
|
screenOptions,
|
|
126
125
|
dimensions,
|
|
127
|
-
dismissScreen,
|
|
128
126
|
requestDismiss,
|
|
129
127
|
withSensitivity,
|
|
130
128
|
gestureCompositionOwner,
|
|
@@ -61,7 +61,6 @@ export const trackPinchGesture = (
|
|
|
61
61
|
export const finalizePinchRelease = (
|
|
62
62
|
release: PinchReleaseResult,
|
|
63
63
|
runtime: PinchGestureRuntime,
|
|
64
|
-
dismissScreen: ((finished: boolean) => void) | undefined,
|
|
65
64
|
requestDismiss?: () => void,
|
|
66
65
|
) => {
|
|
67
66
|
"worklet";
|
|
@@ -91,10 +90,6 @@ export const finalizePinchRelease = (
|
|
|
91
90
|
resetValuesImmediately: release.resetValuesImmediately,
|
|
92
91
|
});
|
|
93
92
|
|
|
94
|
-
if (release.shouldDismiss && requestDismiss) {
|
|
95
|
-
runOnJS(requestDismiss)();
|
|
96
|
-
}
|
|
97
|
-
|
|
98
93
|
if (!release.shouldDismiss && progressAlreadyAtTarget) {
|
|
99
94
|
system.targetProgress.set(release.target);
|
|
100
95
|
return;
|
|
@@ -102,7 +97,6 @@ export const finalizePinchRelease = (
|
|
|
102
97
|
|
|
103
98
|
animateToProgress({
|
|
104
99
|
target: release.target,
|
|
105
|
-
onAnimationFinish: release.shouldDismiss ? dismissScreen : undefined,
|
|
106
100
|
spec: release.transitionSpec,
|
|
107
101
|
emitWillAnimate: false,
|
|
108
102
|
markEntering: false,
|
|
@@ -111,4 +105,8 @@ export const finalizePinchRelease = (
|
|
|
111
105
|
animationProgress: system.animationProgress,
|
|
112
106
|
initialVelocity: release.initialVelocity,
|
|
113
107
|
});
|
|
108
|
+
|
|
109
|
+
if (release.shouldDismiss && requestDismiss) {
|
|
110
|
+
runOnJS(requestDismiss)();
|
|
111
|
+
}
|
|
114
112
|
};
|
|
@@ -26,7 +26,7 @@ export const usePinchBehavior = (
|
|
|
26
26
|
screenOptions: ScreenOptionsContextValue,
|
|
27
27
|
gestureCompositionOwner: SharedValue<GestureCompositionOwner>,
|
|
28
28
|
): PinchBehavior => {
|
|
29
|
-
const {
|
|
29
|
+
const { requestDismiss } = useNavigationHelpers();
|
|
30
30
|
const { withSensitivity, resetSensitivity } =
|
|
31
31
|
usePinchGestureSensitivity(screenOptions);
|
|
32
32
|
|
|
@@ -68,18 +68,12 @@ export const usePinchBehavior = (
|
|
|
68
68
|
.hasSnapPoints
|
|
69
69
|
? resolveSnapPinchRelease(event, latestRuntime)
|
|
70
70
|
: resolvePinchRelease(event, latestRuntime);
|
|
71
|
-
finalizePinchRelease(
|
|
72
|
-
release,
|
|
73
|
-
latestRuntime,
|
|
74
|
-
dismissScreen,
|
|
75
|
-
requestDismiss,
|
|
76
|
-
);
|
|
71
|
+
finalizePinchRelease(release, latestRuntime, requestDismiss);
|
|
77
72
|
gestureCompositionOwner.set(null);
|
|
78
73
|
},
|
|
79
74
|
[
|
|
80
75
|
runtime,
|
|
81
76
|
screenOptions,
|
|
82
|
-
dismissScreen,
|
|
83
77
|
requestDismiss,
|
|
84
78
|
withSensitivity,
|
|
85
79
|
gestureCompositionOwner,
|
|
@@ -306,15 +306,19 @@ const resolveGestureParticipation = ({
|
|
|
306
306
|
options,
|
|
307
307
|
isFirstKey,
|
|
308
308
|
gestureContext,
|
|
309
|
+
isRemovePrevented,
|
|
309
310
|
}: {
|
|
310
311
|
options: GesturePolicyOptions;
|
|
311
312
|
isFirstKey: boolean;
|
|
312
313
|
gestureContext: GestureContextType | null;
|
|
314
|
+
isRemovePrevented: boolean;
|
|
313
315
|
}): ScreenGestureParticipation => {
|
|
314
|
-
const canDismiss =
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
316
|
+
const canDismiss =
|
|
317
|
+
!isRemovePrevented &&
|
|
318
|
+
resolveGestureCanDismiss({
|
|
319
|
+
isFirstKey,
|
|
320
|
+
gestureEnabled: options.gestureEnabled,
|
|
321
|
+
});
|
|
318
322
|
const effectiveSnapPoints = validateSnapPoints({
|
|
319
323
|
snapPoints: options.snapPoints,
|
|
320
324
|
canDismiss,
|
|
@@ -333,6 +337,7 @@ const resolveGestureParticipation = ({
|
|
|
333
337
|
|
|
334
338
|
return {
|
|
335
339
|
isFirstKey,
|
|
340
|
+
isRemovePrevented,
|
|
336
341
|
canDismiss,
|
|
337
342
|
canTrackGesture,
|
|
338
343
|
effectiveSnapPoints,
|
|
@@ -345,15 +350,18 @@ export const resolveScreenGestureConfig = ({
|
|
|
345
350
|
options,
|
|
346
351
|
isFirstKey,
|
|
347
352
|
gestureContext,
|
|
353
|
+
isRemovePrevented = false,
|
|
348
354
|
}: {
|
|
349
355
|
options: ScreenTransitionConfig;
|
|
350
356
|
isFirstKey: boolean;
|
|
351
357
|
gestureContext: GestureContextType | null;
|
|
358
|
+
isRemovePrevented?: boolean;
|
|
352
359
|
}): ScreenGestureConfig => {
|
|
353
360
|
const participation = resolveGestureParticipation({
|
|
354
361
|
options,
|
|
355
362
|
isFirstKey,
|
|
356
363
|
gestureContext,
|
|
364
|
+
isRemovePrevented,
|
|
357
365
|
});
|
|
358
366
|
const hasSnapPoints = participation.effectiveSnapPoints.hasSnapPoints;
|
|
359
367
|
|
|
@@ -365,11 +373,14 @@ export const resolveScreenGestureConfig = ({
|
|
|
365
373
|
};
|
|
366
374
|
|
|
367
375
|
function resolveRuntimeCanDismiss(
|
|
368
|
-
participation: Pick<
|
|
376
|
+
participation: Pick<
|
|
377
|
+
ScreenGestureParticipation,
|
|
378
|
+
"isFirstKey" | "isRemovePrevented" | "canDismiss"
|
|
379
|
+
>,
|
|
369
380
|
options: GesturePolicyOptions,
|
|
370
381
|
) {
|
|
371
382
|
"worklet";
|
|
372
|
-
if (participation.isFirstKey) {
|
|
383
|
+
if (participation.isFirstKey || participation.isRemovePrevented) {
|
|
373
384
|
return false;
|
|
374
385
|
}
|
|
375
386
|
|
|
@@ -85,6 +85,8 @@ export interface GestureContextType {
|
|
|
85
85
|
export interface ScreenGestureParticipation {
|
|
86
86
|
/** Whether this route is the first route in its stack. First routes never track gestures. */
|
|
87
87
|
isFirstKey: boolean;
|
|
88
|
+
/** Whether React Navigation currently blocks removal of this route. */
|
|
89
|
+
isRemovePrevented: boolean;
|
|
88
90
|
/** Whether this route can dismiss to progress 0 from a gesture release. */
|
|
89
91
|
canDismiss: boolean;
|
|
90
92
|
/** Whether recognizers can activate to expose gesture values to interpolators. */
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
ScreenInterpolationProps,
|
|
3
|
+
ScreenTransitionAccessor,
|
|
4
|
+
} from "../../../../types/animation.types";
|
|
5
|
+
import { createBoundsAccessor } from "../../../../utils/bounds";
|
|
6
|
+
import type { ScreenInterpolatorFrame } from "../../animation/helpers/pipeline";
|
|
7
|
+
import type { SelectedInterpolatorFrame } from "./select-interpolator-frame";
|
|
8
|
+
|
|
9
|
+
export const createInterpolatorScope = ({
|
|
10
|
+
frame,
|
|
11
|
+
selectedFrame,
|
|
12
|
+
transition,
|
|
13
|
+
}: {
|
|
14
|
+
frame: ScreenInterpolatorFrame;
|
|
15
|
+
selectedFrame: SelectedInterpolatorFrame;
|
|
16
|
+
transition: ScreenTransitionAccessor;
|
|
17
|
+
}): ScreenInterpolationProps => {
|
|
18
|
+
"worklet";
|
|
19
|
+
|
|
20
|
+
const selectedProps = {
|
|
21
|
+
...frame,
|
|
22
|
+
...selectedFrame,
|
|
23
|
+
};
|
|
24
|
+
let scope: ScreenInterpolationProps;
|
|
25
|
+
const scopedTransition: ScreenTransitionAccessor = (target) => {
|
|
26
|
+
"worklet";
|
|
27
|
+
|
|
28
|
+
if ((target?.depth ?? 0) === 0) {
|
|
29
|
+
return scope;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return transition(target);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
scope = {
|
|
36
|
+
...selectedProps,
|
|
37
|
+
bounds: createBoundsAccessor(() => {
|
|
38
|
+
"worklet";
|
|
39
|
+
return selectedProps;
|
|
40
|
+
}),
|
|
41
|
+
transition: scopedTransition,
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
return scope;
|
|
45
|
+
};
|
|
@@ -18,7 +18,6 @@ import type {
|
|
|
18
18
|
} from "../../../../types/animation.types";
|
|
19
19
|
import { logger } from "../../../../utils/logger";
|
|
20
20
|
import { useScreenAnimationStore } from "../../animation";
|
|
21
|
-
import { useBuildBoundsAccessor } from "../../animation/helpers/accessors/use-build-bounds-accessor";
|
|
22
21
|
import { useBuildTransitionAccessor } from "../../animation/helpers/accessors/use-build-transition-accessor";
|
|
23
22
|
import type { ScreenInterpolatorFrame } from "../../animation/helpers/pipeline";
|
|
24
23
|
import { readScreenAnimationRevisions } from "../../animation/helpers/read-screen-animation-revisions";
|
|
@@ -29,6 +28,7 @@ import {
|
|
|
29
28
|
useScreenOptionsStore,
|
|
30
29
|
} from "../../options";
|
|
31
30
|
import { collectInterpolatorSharedValues } from "../helpers/collect-interpolator-shared-values";
|
|
31
|
+
import { createInterpolatorScope } from "../helpers/create-interpolator-scope";
|
|
32
32
|
import { normalizeSlots } from "../helpers/normalize-slots";
|
|
33
33
|
import { resolveInterpolatorStyleHandoff } from "../helpers/resolve-interpolator-style-handoff";
|
|
34
34
|
import type { LocalStyleLayers } from "../helpers/resolve-slot-styles";
|
|
@@ -54,7 +54,6 @@ type RunInterpolatorParams = {
|
|
|
54
54
|
interpolator: ScreenStyleInterpolator | undefined;
|
|
55
55
|
props: ScreenInterpolatorFrame;
|
|
56
56
|
selectedFrame: SelectedInterpolatorFrame;
|
|
57
|
-
bounds: Parameters<ScreenStyleInterpolator>[0]["bounds"];
|
|
58
57
|
transition: Parameters<ScreenStyleInterpolator>[0]["transition"];
|
|
59
58
|
};
|
|
60
59
|
|
|
@@ -76,7 +75,6 @@ const runInterpolator = ({
|
|
|
76
75
|
interpolator,
|
|
77
76
|
props,
|
|
78
77
|
selectedFrame,
|
|
79
|
-
bounds,
|
|
80
78
|
transition,
|
|
81
79
|
}: RunInterpolatorParams): InterpolatorResult | undefined => {
|
|
82
80
|
"worklet";
|
|
@@ -86,12 +84,13 @@ const runInterpolator = ({
|
|
|
86
84
|
}
|
|
87
85
|
|
|
88
86
|
try {
|
|
89
|
-
const raw = interpolator(
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
87
|
+
const raw = interpolator(
|
|
88
|
+
createInterpolatorScope({
|
|
89
|
+
frame: props,
|
|
90
|
+
selectedFrame,
|
|
91
|
+
transition,
|
|
92
|
+
}),
|
|
93
|
+
);
|
|
95
94
|
|
|
96
95
|
const rawStyleMap: TransitionInterpolatedStyle | undefined =
|
|
97
96
|
typeof raw === "object" && raw != null ? raw : undefined;
|
|
@@ -154,7 +153,6 @@ export const useInterpolatedStylesMap = ({
|
|
|
154
153
|
ancestorScreenAnimationSources,
|
|
155
154
|
descendantScreenAnimationSources,
|
|
156
155
|
} = useScreenAnimationStore();
|
|
157
|
-
const boundsAccessor = useBuildBoundsAccessor();
|
|
158
156
|
const transition = useBuildTransitionAccessor();
|
|
159
157
|
const nextInterpolatorReady = useSharedValue(0);
|
|
160
158
|
|
|
@@ -271,7 +269,6 @@ export const useInterpolatedStylesMap = ({
|
|
|
271
269
|
interpolator: currentInterpolator,
|
|
272
270
|
props,
|
|
273
271
|
selectedFrame: currentSelectedFrame,
|
|
274
|
-
bounds: boundsAccessor,
|
|
275
272
|
transition,
|
|
276
273
|
});
|
|
277
274
|
|
|
@@ -309,7 +306,6 @@ export const useInterpolatedStylesMap = ({
|
|
|
309
306
|
interpolator: nextInterpolator,
|
|
310
307
|
props,
|
|
311
308
|
selectedFrame: nextSelectedFrame,
|
|
312
|
-
bounds: boundsAccessor,
|
|
313
309
|
transition,
|
|
314
310
|
});
|
|
315
311
|
|
|
@@ -5,6 +5,7 @@ import type {
|
|
|
5
5
|
BaseStackNavigation,
|
|
6
6
|
BaseStackRoute,
|
|
7
7
|
} from "../../../types/stack.types";
|
|
8
|
+
import { dispatchCloseAction } from "../../../utils/navigation/close-action-replay";
|
|
8
9
|
import { buildBlankStackState } from "./helpers/build-blank-stack-state";
|
|
9
10
|
import { deriveBlankStackState } from "./helpers/derive-blank-stack-state";
|
|
10
11
|
import type {
|
|
@@ -86,10 +87,13 @@ export const createBlankStackController = <
|
|
|
86
87
|
const { state, navigation } = props;
|
|
87
88
|
|
|
88
89
|
if (state.routes.some((candidate) => candidate.key === route.key)) {
|
|
89
|
-
|
|
90
|
+
const action = {
|
|
90
91
|
...StackActions.pop(),
|
|
91
92
|
source: route.key,
|
|
92
93
|
target: state.key,
|
|
94
|
+
};
|
|
95
|
+
dispatchCloseAction(action, (closeAction) => {
|
|
96
|
+
navigation.dispatch(closeAction);
|
|
93
97
|
});
|
|
94
98
|
return;
|
|
95
99
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { SharedValue } from "react-native-reanimated";
|
|
2
2
|
import { FALSE, TRUE } from "../../constants";
|
|
3
3
|
import {
|
|
4
4
|
type AnimationStoreMap,
|
|
@@ -16,7 +16,6 @@ interface AnimateToProgressProps {
|
|
|
16
16
|
*/
|
|
17
17
|
target: "open" | "close" | number;
|
|
18
18
|
spec?: TransitionSpec;
|
|
19
|
-
onAnimationFinish?: (finished: boolean) => void;
|
|
20
19
|
animations: AnimationStoreMap;
|
|
21
20
|
targetProgress: SharedValue<number>;
|
|
22
21
|
animationProgress: SharedValue<number>;
|
|
@@ -61,7 +60,6 @@ export const resolveAnimationProgressRange = (
|
|
|
61
60
|
export const animateToProgress = ({
|
|
62
61
|
target,
|
|
63
62
|
spec,
|
|
64
|
-
onAnimationFinish,
|
|
65
63
|
animations,
|
|
66
64
|
targetProgress,
|
|
67
65
|
animationProgress,
|
|
@@ -112,9 +110,6 @@ export const animateToProgress = ({
|
|
|
112
110
|
entering.set(FALSE);
|
|
113
111
|
}
|
|
114
112
|
|
|
115
|
-
if (onAnimationFinish) {
|
|
116
|
-
runOnJS(onAnimationFinish)(true);
|
|
117
|
-
}
|
|
118
113
|
return;
|
|
119
114
|
}
|
|
120
115
|
|
|
@@ -141,23 +136,7 @@ export const animateToProgress = ({
|
|
|
141
136
|
|
|
142
137
|
if (isClosing) {
|
|
143
138
|
progressAnimating.set(FALSE);
|
|
144
|
-
|
|
145
|
-
if (onAnimationFinish) {
|
|
146
|
-
// Paint the terminal UI-thread host/style state before React
|
|
147
|
-
// removes the closing route and its native portal host.
|
|
148
|
-
requestAnimationFrame(() => {
|
|
149
|
-
"worklet";
|
|
150
|
-
requestAnimationFrame(() => {
|
|
151
|
-
"worklet";
|
|
152
|
-
runOnJS(onAnimationFinish)(state.finished);
|
|
153
|
-
});
|
|
154
|
-
});
|
|
155
|
-
}
|
|
156
139
|
} else {
|
|
157
|
-
if (onAnimationFinish) {
|
|
158
|
-
runOnJS(onAnimationFinish)(state.finished);
|
|
159
|
-
}
|
|
160
|
-
|
|
161
140
|
// Delay clearing progress animation by one frame to ensure final frame is painted
|
|
162
141
|
requestAnimationFrame(() => {
|
|
163
142
|
progressAnimating.set(FALSE);
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
const CLOSE_ACTION_REPLAY = Symbol("screen-transition-close-action-replay");
|
|
2
|
+
|
|
3
|
+
type MarkedCloseAction = {
|
|
4
|
+
[CLOSE_ACTION_REPLAY]?: true;
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
export const isCloseActionReplay = (action: unknown): boolean =>
|
|
8
|
+
typeof action === "object" &&
|
|
9
|
+
action !== null &&
|
|
10
|
+
(action as MarkedCloseAction)[CLOSE_ACTION_REPLAY] === true;
|
|
11
|
+
|
|
12
|
+
/** Carries the terminal-removal bypass through React Navigation's action clones. */
|
|
13
|
+
export const dispatchCloseAction = <TAction extends object>(
|
|
14
|
+
action: TAction,
|
|
15
|
+
dispatch: (action: TAction) => void,
|
|
16
|
+
) => {
|
|
17
|
+
const markedAction = action as TAction & MarkedCloseAction;
|
|
18
|
+
markedAction[CLOSE_ACTION_REPLAY] = true;
|
|
19
|
+
|
|
20
|
+
try {
|
|
21
|
+
dispatch(action);
|
|
22
|
+
} finally {
|
|
23
|
+
delete markedAction[CLOSE_ACTION_REPLAY];
|
|
24
|
+
}
|
|
25
|
+
};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.hasActiveBoundaryPortalLink = void 0;
|
|
7
|
-
var _linkPairs = require("../../../../../../stores/bounds/helpers/link-pairs.helpers");
|
|
8
|
-
const hasActiveBoundaryPortalLink = ({
|
|
9
|
-
boundaryId,
|
|
10
|
-
pairsState,
|
|
11
|
-
sourcePairKey
|
|
12
|
-
}) => {
|
|
13
|
-
"worklet";
|
|
14
|
-
|
|
15
|
-
if (!sourcePairKey) {
|
|
16
|
-
return false;
|
|
17
|
-
}
|
|
18
|
-
const pair = pairsState[sourcePairKey];
|
|
19
|
-
const linkKey = (0, _linkPairs.getLinkKeyFromTag)(boundaryId);
|
|
20
|
-
const link = pair?.links[linkKey];
|
|
21
|
-
if (!link?.source) {
|
|
22
|
-
return false;
|
|
23
|
-
}
|
|
24
|
-
if (link.group && pair.groups[link.group]?.activeId !== linkKey) {
|
|
25
|
-
return false;
|
|
26
|
-
}
|
|
27
|
-
return true;
|
|
28
|
-
};
|
|
29
|
-
exports.hasActiveBoundaryPortalLink = hasActiveBoundaryPortalLink;
|
|
30
|
-
//# sourceMappingURL=active-pair.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_linkPairs","require","hasActiveBoundaryPortalLink","boundaryId","pairsState","sourcePairKey","pair","linkKey","getLinkKeyFromTag","link","links","source","group","groups","activeId","exports"],"sourceRoot":"../../../../../../../../../src","sources":["shared/components/boundary/portal/components/boundary-portal/helpers/active-pair.ts"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAYO,MAAMC,2BAA2B,GAAGA,CAAC;EAC3CC,UAAU;EACVC,UAAU;EACVC;AACkC,CAAC,KAAc;EACjD,SAAS;;EACT,IAAI,CAACA,aAAa,EAAE;IACnB,OAAO,KAAK;EACb;EAEA,MAAMC,IAAI,GAAGF,UAAU,CAACC,aAAa,CAAC;EACtC,MAAME,OAAO,GAAG,IAAAC,4BAAiB,EAACL,UAAU,CAAC;EAC7C,MAAMM,IAAI,GAAGH,IAAI,EAAEI,KAAK,CAACH,OAAO,CAAC;EAEjC,IAAI,CAACE,IAAI,EAAEE,MAAM,EAAE;IAClB,OAAO,KAAK;EACb;EAEA,IAAIF,IAAI,CAACG,KAAK,IAAIN,IAAI,CAACO,MAAM,CAACJ,IAAI,CAACG,KAAK,CAAC,EAAEE,QAAQ,KAAKP,OAAO,EAAE;IAChE,OAAO,KAAK;EACb;EAEA,OAAO,IAAI;AACZ,CAAC;AAACQ,OAAA,CAAAb,2BAAA,GAAAA,2BAAA","ignoreList":[]}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.setPortalHostBounds = exports.getPortalHostBounds = exports.clearPortalHostBounds = void 0;
|
|
7
|
-
var _reactNativeReanimated = require("react-native-reanimated");
|
|
8
|
-
var _scroll = require("../../../../../../stores/scroll.store");
|
|
9
|
-
const portalHostBounds = (0, _reactNativeReanimated.makeMutable)({});
|
|
10
|
-
const getPortalHostBounds = hostKey => {
|
|
11
|
-
"worklet";
|
|
12
|
-
|
|
13
|
-
return portalHostBounds.get()[hostKey] ?? null;
|
|
14
|
-
};
|
|
15
|
-
exports.getPortalHostBounds = getPortalHostBounds;
|
|
16
|
-
const setPortalHostBounds = (hostKey, bounds) => {
|
|
17
|
-
"worklet";
|
|
18
|
-
|
|
19
|
-
const nextBounds = {
|
|
20
|
-
...bounds,
|
|
21
|
-
scroll: (0, _scroll.cloneScrollMetadataState)(bounds.scroll)
|
|
22
|
-
};
|
|
23
|
-
portalHostBounds.set(state => {
|
|
24
|
-
"worklet";
|
|
25
|
-
|
|
26
|
-
return {
|
|
27
|
-
...state,
|
|
28
|
-
[hostKey]: nextBounds
|
|
29
|
-
};
|
|
30
|
-
});
|
|
31
|
-
};
|
|
32
|
-
exports.setPortalHostBounds = setPortalHostBounds;
|
|
33
|
-
const clearPortalHostBounds = hostKey => {
|
|
34
|
-
"worklet";
|
|
35
|
-
|
|
36
|
-
portalHostBounds.set(state => {
|
|
37
|
-
"worklet";
|
|
38
|
-
|
|
39
|
-
const nextState = {
|
|
40
|
-
...state
|
|
41
|
-
};
|
|
42
|
-
delete nextState[hostKey];
|
|
43
|
-
return nextState;
|
|
44
|
-
});
|
|
45
|
-
};
|
|
46
|
-
exports.clearPortalHostBounds = clearPortalHostBounds;
|
|
47
|
-
//# sourceMappingURL=host-bounds.store.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNativeReanimated","require","_scroll","portalHostBounds","makeMutable","getPortalHostBounds","hostKey","get","exports","setPortalHostBounds","bounds","nextBounds","scroll","cloneScrollMetadataState","set","state","clearPortalHostBounds","nextState"],"sourceRoot":"../../../../../../../../../src","sources":["shared/components/boundary/portal/components/boundary-portal/stores/host-bounds.store.ts"],"mappings":";;;;;;AAAA,IAAAA,sBAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AASA,MAAME,gBAAgB,GAAG,IAAAC,kCAAW,EAAwB,CAAC,CAAC,CAAC;AAExD,MAAMC,mBAAmB,GAAIC,OAAe,IAAK;EACvD,SAAS;;EACT,OAAOH,gBAAgB,CAACI,GAAG,CAAC,CAAC,CAACD,OAAO,CAAC,IAAI,IAAI;AAC/C,CAAC;AAACE,OAAA,CAAAH,mBAAA,GAAAA,mBAAA;AAEK,MAAMI,mBAAmB,GAAGA,CAClCH,OAAe,EACfI,MAAwB,KACpB;EACJ,SAAS;;EACT,MAAMC,UAA4B,GAAG;IACpC,GAAGD,MAAM;IACTE,MAAM,EAAE,IAAAC,gCAAwB,EAACH,MAAM,CAACE,MAAM;EAC/C,CAAC;EAEDT,gBAAgB,CAACW,GAAG,CAAEC,KAAK,IAAK;IAC/B,SAAS;;IACT,OAAO;MACN,GAAGA,KAAK;MACR,CAACT,OAAO,GAAGK;IACZ,CAAC;EACF,CAAC,CAAC;AACH,CAAC;AAACH,OAAA,CAAAC,mBAAA,GAAAA,mBAAA;AAEK,MAAMO,qBAAqB,GAAIV,OAAe,IAAK;EACzD,SAAS;;EACTH,gBAAgB,CAACW,GAAG,CAAEC,KAAK,IAAK;IAC/B,SAAS;;IACT,MAAME,SAAgC,GAAG;MAAE,GAAGF;IAAM,CAAC;IACrD,OAAOE,SAAS,CAACX,OAAO,CAAC;IACzB,OAAOW,SAAS;EACjB,CAAC,CAAC;AACH,CAAC;AAACT,OAAA,CAAAQ,qBAAA,GAAAA,qBAAA","ignoreList":[]}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.useBuildBoundsAccessor = void 0;
|
|
7
|
-
var _react = require("react");
|
|
8
|
-
var _bounds = require("../../../../../utils/bounds");
|
|
9
|
-
var _animation = require("../../animation.provider");
|
|
10
|
-
const useBuildBoundsAccessor = () => {
|
|
11
|
-
const screenInterpolatorProps = (0, _animation.useScreenAnimationStore)(store => store.screenInterpolatorProps);
|
|
12
|
-
return (0, _react.useMemo)(() => {
|
|
13
|
-
return (0, _bounds.createBoundsAccessor)(() => {
|
|
14
|
-
"worklet";
|
|
15
|
-
|
|
16
|
-
return screenInterpolatorProps.get();
|
|
17
|
-
});
|
|
18
|
-
}, [screenInterpolatorProps]);
|
|
19
|
-
};
|
|
20
|
-
exports.useBuildBoundsAccessor = useBuildBoundsAccessor;
|
|
21
|
-
//# sourceMappingURL=use-build-bounds-accessor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_bounds","_animation","useBuildBoundsAccessor","screenInterpolatorProps","useScreenAnimationStore","store","useMemo","createBoundsAccessor","get","exports"],"sourceRoot":"../../../../../../../../src","sources":["shared/providers/screen/animation/helpers/accessors/use-build-bounds-accessor.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AAEO,MAAMG,sBAAsB,GAAGA,CAAA,KAAM;EAC3C,MAAMC,uBAAuB,GAAG,IAAAC,kCAAuB,EACrDC,KAAK,IAAKA,KAAK,CAACF,uBAClB,CAAC;EACD,OAAO,IAAAG,cAAO,EAAC,MAAM;IACpB,OAAO,IAAAC,4BAAoB,EAAC,MAAM;MACjC,SAAS;;MACT,OAAOJ,uBAAuB,CAACK,GAAG,CAAC,CAAC;IACrC,CAAC,CAAC;EACH,CAAC,EAAE,CAACL,uBAAuB,CAAC,CAAC;AAC9B,CAAC;AAACM,OAAA,CAAAP,sBAAA,GAAAA,sBAAA","ignoreList":[]}
|