react-native-screen-transitions 3.11.2 → 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/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/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/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/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/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/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/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
|
@@ -24,12 +24,14 @@ const BackdropLayer = exports.BackdropLayer = /*#__PURE__*/(0, _react.memo)(func
|
|
|
24
24
|
isBackdropActive
|
|
25
25
|
}) {
|
|
26
26
|
const {
|
|
27
|
-
|
|
27
|
+
isRemovePrevented,
|
|
28
|
+
requestDismiss
|
|
28
29
|
} = (0, _useNavigationHelpers.useNavigationHelpers)();
|
|
29
30
|
const routeKey = (0, _descriptors.useDescriptorsStore)(store => store.derivations.currentScreenKey);
|
|
30
31
|
const BackdropComponent = (0, _descriptors.useDescriptorsStore)(store => store.options.backdropComponent);
|
|
31
32
|
const rawSnapPoints = (0, _descriptors.useDescriptorsStore)(store => store.options.snapPoints);
|
|
32
|
-
const
|
|
33
|
+
const isGestureDismissEnabled = (0, _descriptors.useDescriptorsStore)(store => store.options.gestureEnabled !== false);
|
|
34
|
+
const canDismiss = isGestureDismissEnabled && !isRemovePrevented;
|
|
33
35
|
const transitionSpec = (0, _descriptors.useDescriptorsStore)(store => store.options.transitionSpec);
|
|
34
36
|
const animations = _animation.AnimationStore.getBag(routeKey);
|
|
35
37
|
const {
|
|
@@ -40,13 +42,13 @@ const BackdropLayer = exports.BackdropLayer = /*#__PURE__*/(0, _react.memo)(func
|
|
|
40
42
|
const AnimatedBackdropComponent = (0, _react.useMemo)(() => BackdropComponent && !(0, _renderComponent.usesLayerRenderProps)(BackdropComponent) ? _reactNativeReanimated.default.createAnimatedComponent(BackdropComponent) : null, [BackdropComponent]);
|
|
41
43
|
const handleBackdropPress = (0, _react.useCallback)(() => {
|
|
42
44
|
if (backdropBehavior === "dismiss") {
|
|
43
|
-
|
|
45
|
+
requestDismiss();
|
|
44
46
|
return;
|
|
45
47
|
}
|
|
46
48
|
if (backdropBehavior === "collapse") {
|
|
47
49
|
// No snap points → fallback to dismiss
|
|
48
50
|
if (!rawSnapPoints || rawSnapPoints.length === 0) {
|
|
49
|
-
|
|
51
|
+
requestDismiss();
|
|
50
52
|
return;
|
|
51
53
|
}
|
|
52
54
|
const gestures = _gesture.GestureStore.getBag(routeKey);
|
|
@@ -79,12 +81,14 @@ const BackdropLayer = exports.BackdropLayer = /*#__PURE__*/(0, _react.memo)(func
|
|
|
79
81
|
spec,
|
|
80
82
|
animations,
|
|
81
83
|
targetProgress,
|
|
82
|
-
animationProgress
|
|
83
|
-
onAnimationFinish: shouldDismiss ? dismissScreen : undefined
|
|
84
|
+
animationProgress
|
|
84
85
|
});
|
|
86
|
+
if (shouldDismiss) {
|
|
87
|
+
(0, _reactNativeReanimated.runOnJS)(requestDismiss)();
|
|
88
|
+
}
|
|
85
89
|
})();
|
|
86
90
|
}
|
|
87
|
-
}, [animations, targetProgress, animationProgress, resolvedAutoSnapPoint, backdropBehavior, rawSnapPoints, canDismiss, transitionSpec,
|
|
91
|
+
}, [animations, targetProgress, animationProgress, resolvedAutoSnapPoint, backdropBehavior, rawSnapPoints, canDismiss, transitionSpec, requestDismiss, routeKey]);
|
|
88
92
|
const animatedBackdropStyle = (0, _styles.useSlotStyles)("backdrop");
|
|
89
93
|
const animatedBackdropProps = (0, _styles.useSlotProps)("backdrop");
|
|
90
94
|
const backdropPointerEvents = isBackdropActive ? "auto" : "none";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_reactNative","_reactNativeReanimated","_interopRequireWildcard","_specs","_useNavigationHelpers","_descriptors","_styles","_animation","_gesture","_system","_animateToProgress","_findCollapseTarget","_renderComponent","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","BackdropLayer","exports","memo","backdropBehavior","isBackdropActive","
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNative","_reactNativeReanimated","_interopRequireWildcard","_specs","_useNavigationHelpers","_descriptors","_styles","_animation","_gesture","_system","_animateToProgress","_findCollapseTarget","_renderComponent","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","BackdropLayer","exports","memo","backdropBehavior","isBackdropActive","isRemovePrevented","requestDismiss","useNavigationHelpers","routeKey","useDescriptorsStore","store","derivations","currentScreenKey","BackdropComponent","options","backdropComponent","rawSnapPoints","snapPoints","isGestureDismissEnabled","gestureEnabled","canDismiss","transitionSpec","animations","AnimationStore","getBag","targetProgress","animationProgress","resolvedAutoSnapPoint","SystemStore","AnimatedBackdropComponent","useMemo","usesLayerRenderProps","Animated","createAnimatedComponent","handleBackdropPress","useCallback","length","gestures","GestureStore","runOnUI","resolvedSnaps","point","resolvedPoint","push","target","shouldDismiss","findCollapseTarget","transitionProgress","dismissing","spec","open","expand","DefaultSnapSpec","close","collapse","animateToProgress","markEntering","runOnJS","animatedBackdropStyle","useSlotStyles","animatedBackdropProps","useSlotProps","backdropPointerEvents","backdropStyles","StyleSheet","absoluteFill","backdropProps","jsx","Pressable","style","pointerEvents","onPress","undefined","children","animatedProps","styles","props","View"],"sourceRoot":"../../../../../../src","sources":["shared/components/screen-container/layers/backdrop.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,sBAAA,GAAAC,uBAAA,CAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,qBAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AACA,IAAAO,OAAA,GAAAP,OAAA;AACA,IAAAQ,UAAA,GAAAR,OAAA;AACA,IAAAS,QAAA,GAAAT,OAAA;AACA,IAAAU,OAAA,GAAAV,OAAA;AAKA,IAAAW,kBAAA,GAAAX,OAAA;AACA,IAAAY,mBAAA,GAAAZ,OAAA;AACA,IAAAa,gBAAA,GAAAb,OAAA;AAA0D,IAAAc,WAAA,GAAAd,OAAA;AAAA,SAAAG,wBAAAY,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAd,uBAAA,YAAAA,CAAAY,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAA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ClBN,qBAA8D;EAE/D,oBACC,IAAAhF,WAAA,CAAAuF,GAAA,EAACpG,YAAA,CAAAqG,SAAS;IACTC,KAAK,EAAEL,uBAAU,CAACC,YAAa;IAC/BK,aAAa,EAAElE,gBAAgB,GAAG,MAAM,GAAG,MAAO;IAClDmE,OAAO,EAAEnE,gBAAgB,GAAG8B,mBAAmB,GAAGsC,SAAU;IAAAC,QAAA,EAE3D5C,yBAAyB,gBACzB,IAAAjD,WAAA,CAAAuF,GAAA,EAACtC,yBAAyB;MACzBwC,KAAK,EAAEN,cAAe;MACtBW,aAAa,EAAEd,qBAAsB;MACrCU,aAAa,EAAER;IAAsB,CACrC,CAAC,GACCjD,iBAAiB,gBACpB,IAAAjC,WAAA,CAAAuF,GAAA,EAACtD,iBAAiB;MACjB8D,MAAM,EAAEZ,cAAe;MACvBa,KAAK,EAAEV,aAAc;MACrBI,aAAa,EAAER;IAAsB,CACrC,CAAC,gBAEF,IAAAlF,WAAA,CAAAuF,GAAA,EAACnG,sBAAA,CAAAuB,OAAQ,CAACsF,IAAI;MACbR,KAAK,EAAEN,cAAe;MACtBO,aAAa,EAAER;IAAsB,CACrC;EACD,CACS,CAAC;AAEd,CAAC,CAAC","ignoreList":[]}
|
package/lib/commonjs/shared/components/screen-lifecycle/hooks/helpers/close-interception-rules.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.shouldInterceptClose = exports.doesNavigatorOwnCloseAction = void 0;
|
|
7
|
+
const containsRouteKey = (routes, routeKey) => routes.some(route => route.key === routeKey || (route.state ? containsRouteKey(route.state.routes, routeKey) : false));
|
|
8
|
+
const doesNavigatorOwnCloseAction = ({
|
|
9
|
+
state,
|
|
10
|
+
action
|
|
11
|
+
}) => {
|
|
12
|
+
if (typeof action.target === "string") {
|
|
13
|
+
return action.target === state.key;
|
|
14
|
+
}
|
|
15
|
+
if (typeof action.source === "string") {
|
|
16
|
+
return containsRouteKey(state.routes, action.source);
|
|
17
|
+
}
|
|
18
|
+
return true;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
/** Only the focused removable route owns a stack close transition. */
|
|
22
|
+
exports.doesNavigatorOwnCloseAction = doesNavigatorOwnCloseAction;
|
|
23
|
+
const shouldInterceptClose = ({
|
|
24
|
+
enabled,
|
|
25
|
+
ownsAction,
|
|
26
|
+
ancestorDismissing,
|
|
27
|
+
routeIndex,
|
|
28
|
+
focusedIndex
|
|
29
|
+
}) => enabled && ownsAction && !ancestorDismissing && routeIndex > 0 && routeIndex === focusedIndex;
|
|
30
|
+
exports.shouldInterceptClose = shouldInterceptClose;
|
|
31
|
+
//# sourceMappingURL=close-interception-rules.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["containsRouteKey","routes","routeKey","some","route","key","state","doesNavigatorOwnCloseAction","action","target","source","exports","shouldInterceptClose","enabled","ownsAction","ancestorDismissing","routeIndex","focusedIndex"],"sourceRoot":"../../../../../../../src","sources":["shared/components/screen-lifecycle/hooks/helpers/close-interception-rules.ts"],"mappings":";;;;;;AAuBA,MAAMA,gBAAgB,GAAGA,CACxBC,MAA6B,EAC7BC,QAAgB,KAEhBD,MAAM,CAACE,IAAI,CACTC,KAAK,IACLA,KAAK,CAACC,GAAG,KAAKH,QAAQ,KACrBE,KAAK,CAACE,KAAK,GAAGN,gBAAgB,CAACI,KAAK,CAACE,KAAK,CAACL,MAAM,EAAEC,QAAQ,CAAC,GAAG,KAAK,CACvE,CAAC;AAEK,MAAMK,2BAA2B,GAAGA,CAAC;EAC3CD,KAAK;EACLE;AAID,CAAC,KAAc;EACd,IAAI,OAAOA,MAAM,CAACC,MAAM,KAAK,QAAQ,EAAE;IACtC,OAAOD,MAAM,CAACC,MAAM,KAAKH,KAAK,CAACD,GAAG;EACnC;EAEA,IAAI,OAAOG,MAAM,CAACE,MAAM,KAAK,QAAQ,EAAE;IACtC,OAAOV,gBAAgB,CAACM,KAAK,CAACL,MAAM,EAAEO,MAAM,CAACE,MAAM,CAAC;EACrD;EAEA,OAAO,IAAI;AACZ,CAAC;;AAED;AAAAC,OAAA,CAAAJ,2BAAA,GAAAA,2BAAA;AACO,MAAMK,oBAAoB,GAAGA,CAAC;EACpCC,OAAO;EACPC,UAAU;EACVC,kBAAkB;EAClBC,UAAU;EACVC;AACuB,CAAC,KACxBJ,OAAO,IACPC,UAAU,IACV,CAACC,kBAAkB,IACnBC,UAAU,GAAG,CAAC,IACdA,UAAU,KAAKC,YAAY;AAACN,OAAA,CAAAC,oBAAA,GAAAA,oBAAA","ignoreList":[]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useCloseCompletion = void 0;
|
|
7
|
+
var _reactNativeReanimated = require("react-native-reanimated");
|
|
8
|
+
const useCloseCompletion = ({
|
|
9
|
+
closing,
|
|
10
|
+
animationProgress,
|
|
11
|
+
onComplete
|
|
12
|
+
}) => {
|
|
13
|
+
(0, _reactNativeReanimated.useAnimatedReaction)(() => {
|
|
14
|
+
"worklet";
|
|
15
|
+
|
|
16
|
+
return !!closing.get() && animationProgress.get() <= 0;
|
|
17
|
+
}, (complete, previouslyComplete) => {
|
|
18
|
+
"worklet";
|
|
19
|
+
|
|
20
|
+
if (complete && !previouslyComplete) {
|
|
21
|
+
(0, _reactNativeReanimated.runOnJS)(onComplete)();
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
exports.useCloseCompletion = useCloseCompletion;
|
|
26
|
+
//# sourceMappingURL=use-close-completion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_reactNativeReanimated","require","useCloseCompletion","closing","animationProgress","onComplete","useAnimatedReaction","get","complete","previouslyComplete","runOnJS","exports"],"sourceRoot":"../../../../../../src","sources":["shared/components/screen-lifecycle/hooks/use-close-completion.ts"],"mappings":";;;;;;AAAA,IAAAA,sBAAA,GAAAC,OAAA;AAMO,MAAMC,kBAAkB,GAAGA,CAAC;EAClCC,OAAO;EACPC,iBAAiB;EACjBC;AAKD,CAAC,KAAK;EACL,IAAAC,0CAAmB,EAClB,MAAM;IACL,SAAS;;IACT,OAAO,CAAC,CAACH,OAAO,CAACI,GAAG,CAAC,CAAC,IAAIH,iBAAiB,CAACG,GAAG,CAAC,CAAC,IAAI,CAAC;EACvD,CAAC,EACD,CAACC,QAAQ,EAAEC,kBAAkB,KAAK;IACjC,SAAS;;IACT,IAAID,QAAQ,IAAI,CAACC,kBAAkB,EAAE;MACpC,IAAAC,8BAAO,EAACL,UAAU,CAAC,CAAC,CAAC;IACtB;EACD,CACD,CAAC;AACF,CAAC;AAACM,OAAA,CAAAT,kBAAA,GAAAA,kBAAA","ignoreList":[]}
|
package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-close-transition-intent.js
CHANGED
|
@@ -5,87 +5,85 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.useCloseTransitionIntent = useCloseTransitionIntent;
|
|
7
7
|
var _react = require("react");
|
|
8
|
+
var _useNavigationHelpers = require("../../../hooks/navigation/use-navigation-helpers");
|
|
8
9
|
var _useStableCallback = _interopRequireDefault(require("../../../hooks/use-stable-callback"));
|
|
10
|
+
var _hasTransitionsEnabled = require("../../../providers/screen/animation/helpers/has-transitions-enabled");
|
|
9
11
|
var _descriptors = require("../../../providers/screen/descriptors");
|
|
10
12
|
var _blankStack = require("../../../providers/stack/blank-stack.provider");
|
|
11
13
|
var _core = require("../../../providers/stack/core.provider");
|
|
12
14
|
var _gesture = require("../../../stores/gesture.store");
|
|
13
|
-
var _system = require("../../../stores/system.store");
|
|
14
15
|
var _stack = require("../../../types/stack.types");
|
|
16
|
+
var _closeActionReplay = require("../../../utils/navigation/close-action-replay");
|
|
17
|
+
var _closeInterceptionRules = require("./helpers/close-interception-rules");
|
|
15
18
|
var _resetStoresForScreen = require("./helpers/reset-stores-for-screen");
|
|
16
19
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}) => {
|
|
20
|
+
function useCloseTransitionIntent(current) {
|
|
21
|
+
const routeKey = current.route.key;
|
|
22
|
+
const {
|
|
23
|
+
STACK_TYPE: stackType,
|
|
24
|
+
TRANSITIONS_ALWAYS_ON: transitionsAlwaysOn
|
|
25
|
+
} = (0, _core.useStackCoreStore)(store => store.flags);
|
|
24
26
|
const handleCloseRoute = (0, _blankStack.useBlankStackStore)(store => store?.handleCloseRoute);
|
|
25
|
-
const
|
|
26
|
-
(0,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
32
|
-
const handleBlankStackCloseEnd = (0, _useStableCallback.default)(finished => {
|
|
33
|
-
if (!finished) return;
|
|
34
|
-
if (!handleCloseRoute) {
|
|
35
|
-
throw new Error("Blank stack close handler was not found.");
|
|
36
|
-
}
|
|
37
|
-
handleCloseRoute({
|
|
38
|
-
route: current.route
|
|
39
|
-
});
|
|
40
|
-
requestAnimationFrame(() => {
|
|
41
|
-
resetStores();
|
|
42
|
-
});
|
|
43
|
-
});
|
|
44
|
-
return {
|
|
45
|
-
handleBlankStackCloseEnd
|
|
46
|
-
};
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* Native stack close - listens to beforeRemove navigation event.
|
|
51
|
-
*/
|
|
52
|
-
const useNativeStackClose = ({
|
|
53
|
-
current,
|
|
54
|
-
requestLifecycleTransition,
|
|
55
|
-
resetStores
|
|
56
|
-
}) => {
|
|
57
|
-
const parentScreenKey = (0, _descriptors.useDescriptorsStore)(store => store.derivations.parentScreenKey);
|
|
27
|
+
const isBlankStackClosing = (0, _blankStack.useBlankStackStore)(store => store?.scenesByKey[routeKey]?.activity === "closing");
|
|
28
|
+
const ancestorKeys = (0, _descriptors.useDescriptorsStore)(store => store.derivations.ancestorKeys);
|
|
29
|
+
const parentScreenKey = ancestorKeys[0];
|
|
30
|
+
const {
|
|
31
|
+
dismissScreen,
|
|
32
|
+
requestDismiss
|
|
33
|
+
} = (0, _useNavigationHelpers.useNavigationHelpers)();
|
|
58
34
|
const pendingActionRef = (0, _react.useRef)(null);
|
|
59
35
|
const nearestAncestorDismissing = (0, _react.useMemo)(() => {
|
|
60
36
|
if (!parentScreenKey) return null;
|
|
61
37
|
return _gesture.GestureStore.peekBag(parentScreenKey)?.dismissing ?? null;
|
|
62
38
|
}, [parentScreenKey]);
|
|
63
|
-
|
|
64
|
-
if (
|
|
65
|
-
|
|
66
|
-
return;
|
|
39
|
+
(0, _react.useLayoutEffect)(() => {
|
|
40
|
+
if (isBlankStackClosing) {
|
|
41
|
+
requestDismiss();
|
|
67
42
|
}
|
|
68
|
-
|
|
43
|
+
}, [isBlankStackClosing, requestDismiss]);
|
|
44
|
+
const completeClose = (0, _useStableCallback.default)(() => {
|
|
45
|
+
const pendingAction = pendingActionRef.current;
|
|
69
46
|
pendingActionRef.current = null;
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
47
|
+
if (pendingAction) {
|
|
48
|
+
(0, _closeActionReplay.dispatchCloseAction)(pendingAction, action => {
|
|
49
|
+
current.navigation.dispatch(action);
|
|
50
|
+
});
|
|
51
|
+
} else if (stackType !== _stack.StackType.NATIVE && handleCloseRoute) {
|
|
52
|
+
handleCloseRoute({
|
|
53
|
+
route: current.route
|
|
54
|
+
});
|
|
55
|
+
} else {
|
|
56
|
+
dismissScreen();
|
|
57
|
+
}
|
|
58
|
+
(0, _resetStoresForScreen.resetStoresForScreen)(routeKey);
|
|
73
59
|
});
|
|
74
|
-
const handleBeforeRemove = (0, _useStableCallback.default)(
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
const
|
|
79
|
-
const state = navigation.getState();
|
|
60
|
+
const handleBeforeRemove = (0, _useStableCallback.default)(event => {
|
|
61
|
+
if ((0, _closeActionReplay.isCloseActionReplay)(event.data.action)) {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
const state = current.navigation.getState();
|
|
80
65
|
const routeIndex = state.routes.findIndex(route => route.key === routeKey);
|
|
81
|
-
const
|
|
82
|
-
|
|
83
|
-
|
|
66
|
+
const action = event.data.action;
|
|
67
|
+
const ownsAction = (0, _closeInterceptionRules.doesNavigatorOwnCloseAction)({
|
|
68
|
+
state,
|
|
69
|
+
action
|
|
70
|
+
});
|
|
71
|
+
const shouldIntercept = (0, _closeInterceptionRules.shouldInterceptClose)({
|
|
72
|
+
enabled: (0, _hasTransitionsEnabled.hasTransitionsEnabled)(current.options, transitionsAlwaysOn),
|
|
73
|
+
ownsAction,
|
|
74
|
+
ancestorDismissing: !!nearestAncestorDismissing?.get(),
|
|
75
|
+
routeIndex,
|
|
76
|
+
focusedIndex: state.index
|
|
77
|
+
});
|
|
78
|
+
if (!shouldIntercept) {
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
pendingActionRef.current ??= event.data.action;
|
|
82
|
+
if (!requestDismiss()) {
|
|
83
|
+
pendingActionRef.current = null;
|
|
84
84
|
return;
|
|
85
85
|
}
|
|
86
|
-
|
|
87
|
-
pendingActionRef.current = e.data.action;
|
|
88
|
-
requestLifecycleTransition(_system.LifecycleTransitionRequestKind.NativeClose, 0);
|
|
86
|
+
event.preventDefault();
|
|
89
87
|
});
|
|
90
88
|
|
|
91
89
|
// biome-ignore lint/correctness/useExhaustiveDependencies: navigation listener should only rebind when the navigator instance changes
|
|
@@ -93,31 +91,7 @@ const useNativeStackClose = ({
|
|
|
93
91
|
return current.navigation.addListener?.("beforeRemove", handleBeforeRemove);
|
|
94
92
|
}, [current.navigation]);
|
|
95
93
|
return {
|
|
96
|
-
|
|
97
|
-
};
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
/**
|
|
101
|
-
* Handles close transition intent and returns finish callbacks for cleanup.
|
|
102
|
-
*/
|
|
103
|
-
function useCloseTransitionIntent(current, system) {
|
|
104
|
-
const routeKey = current.route.key;
|
|
105
|
-
const stackType = (0, _core.useStackCoreStore)(store => store.flags.STACK_TYPE);
|
|
106
|
-
const isNativeStack = stackType === _stack.StackType.NATIVE;
|
|
107
|
-
const {
|
|
108
|
-
requestLifecycleTransition
|
|
109
|
-
} = system.actions;
|
|
110
|
-
const resetStores = (0, _useStableCallback.default)(() => {
|
|
111
|
-
(0, _resetStoresForScreen.resetStoresForScreen)(routeKey);
|
|
112
|
-
});
|
|
113
|
-
const closeParams = {
|
|
114
|
-
current,
|
|
115
|
-
requestLifecycleTransition,
|
|
116
|
-
resetStores
|
|
94
|
+
completeClose
|
|
117
95
|
};
|
|
118
|
-
if (isNativeStack) {
|
|
119
|
-
return useNativeStackClose(closeParams);
|
|
120
|
-
}
|
|
121
|
-
return useBlankStackClose(closeParams);
|
|
122
96
|
}
|
|
123
97
|
//# sourceMappingURL=use-close-transition-intent.js.map
|
package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-close-transition-intent.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_useStableCallback","_interopRequireDefault","_descriptors","_blankStack","_core","_gesture","
|
|
1
|
+
{"version":3,"names":["_react","require","_useNavigationHelpers","_useStableCallback","_interopRequireDefault","_hasTransitionsEnabled","_descriptors","_blankStack","_core","_gesture","_stack","_closeActionReplay","_closeInterceptionRules","_resetStoresForScreen","e","__esModule","default","useCloseTransitionIntent","current","routeKey","route","key","STACK_TYPE","stackType","TRANSITIONS_ALWAYS_ON","transitionsAlwaysOn","useStackCoreStore","store","flags","handleCloseRoute","useBlankStackStore","isBlankStackClosing","scenesByKey","activity","ancestorKeys","useDescriptorsStore","derivations","parentScreenKey","dismissScreen","requestDismiss","useNavigationHelpers","pendingActionRef","useRef","nearestAncestorDismissing","useMemo","GestureStore","peekBag","dismissing","useLayoutEffect","completeClose","useStableCallback","pendingAction","dispatchCloseAction","action","navigation","dispatch","StackType","NATIVE","resetStoresForScreen","handleBeforeRemove","event","isCloseActionReplay","data","state","getState","routeIndex","routes","findIndex","ownsAction","doesNavigatorOwnCloseAction","shouldIntercept","shouldInterceptClose","enabled","hasTransitionsEnabled","options","ancestorDismissing","get","focusedIndex","index","preventDefault","addListener"],"sourceRoot":"../../../../../../src","sources":["shared/components/screen-lifecycle/hooks/use-close-transition-intent.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,qBAAA,GAAAD,OAAA;AACA,IAAAE,kBAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,sBAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AAIA,IAAAM,WAAA,GAAAN,OAAA;AACA,IAAAO,KAAA,GAAAP,OAAA;AACA,IAAAQ,QAAA,GAAAR,OAAA;AACA,IAAAS,MAAA,GAAAT,OAAA;AACA,IAAAU,kBAAA,GAAAV,OAAA;AAIA,IAAAW,uBAAA,GAAAX,OAAA;AAIA,IAAAY,qBAAA,GAAAZ,OAAA;AAAyE,SAAAG,uBAAAU,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAElE,SAASG,wBAAwBA,CAACC,OAAuB,EAE9D;EACD,MAAMC,QAAQ,GAAGD,OAAO,CAACE,KAAK,CAACC,GAAG;EAClC,MAAM;IAAEC,UAAU,EAAEC,SAAS;IAAEC,qBAAqB,EAAEC;EAAoB,CAAC,GAC1E,IAAAC,uBAAiB,EAAEC,KAAK,IAAKA,KAAK,CAACC,KAAK,CAAC;EAC1C,MAAMC,gBAAgB,GAAG,IAAAC,8BAAkB,EACzCH,KAAK,IAAKA,KAAK,EAAEE,gBACnB,CAAC;EACD,MAAME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AAG,cAAc,EAAErB,kBAAkB,CAAC;EAC5E,CAAC,EAAE,CAACzC,OAAO,CAACoC,UAAU,CAAC,CAAC;EAExB,OAAO;IAAEL;EAAc,CAAC;AACzB","ignoreList":[]}
|
package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-transition-start-controller.js
CHANGED
|
@@ -11,9 +11,7 @@ var _animateToProgress = require("../../../utils/animation/animate-to-progress")
|
|
|
11
11
|
const useTransitionStartController = ({
|
|
12
12
|
current,
|
|
13
13
|
animations,
|
|
14
|
-
system
|
|
15
|
-
onBlankStackCloseFinish,
|
|
16
|
-
onNativeCloseFinish
|
|
14
|
+
system
|
|
17
15
|
}) => {
|
|
18
16
|
const {
|
|
19
17
|
targetProgress,
|
|
@@ -41,7 +39,6 @@ const useTransitionStartController = ({
|
|
|
41
39
|
if (blockCount > 0) {
|
|
42
40
|
return;
|
|
43
41
|
}
|
|
44
|
-
const onAnimationFinish = kind === _system.LifecycleTransitionRequestKind.BlankStackClose ? onBlankStackCloseFinish : kind === _system.LifecycleTransitionRequestKind.NativeClose ? onNativeCloseFinish : undefined;
|
|
45
42
|
(0, _animateToProgress.animateToProgress)({
|
|
46
43
|
target,
|
|
47
44
|
spec: transitionSpec,
|
|
@@ -49,7 +46,6 @@ const useTransitionStartController = ({
|
|
|
49
46
|
animations,
|
|
50
47
|
targetProgress,
|
|
51
48
|
animationProgress,
|
|
52
|
-
onAnimationFinish,
|
|
53
49
|
isDragging
|
|
54
50
|
});
|
|
55
51
|
clearLifecycleTransitionRequest();
|
package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-transition-start-controller.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNativeReanimated","require","_gesture","_system","_animateToProgress","useTransitionStartController","current","animations","system","
|
|
1
|
+
{"version":3,"names":["_reactNativeReanimated","require","_gesture","_system","_animateToProgress","useTransitionStartController","current","animations","system","targetProgress","animationProgress","pendingLifecycleRequestKind","pendingLifecycleRequestTarget","pendingLifecycleStartBlockCount","clearLifecycleTransitionRequest","actions","transitionSpec","options","isDragging","GestureStore","getValue","route","key","useAnimatedReaction","get","next","kind","target","blockCount","LifecycleTransitionRequestKind","None","animateToProgress","spec","emitWillAnimate","Open","entering","exports"],"sourceRoot":"../../../../../../src","sources":["shared/components/screen-lifecycle/hooks/use-transition-start-controller.ts"],"mappings":";;;;;;AAAA,IAAAA,sBAAA,GAAAC,OAAA;AAGA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAIA,IAAAG,kBAAA,GAAAH,OAAA;AAEO,MAAMI,4BAA4B,GAAGA,CAAC;EAC5CC,OAAO;EACPC,UAAU;EACVC;AAKD,CAAC,KAAK;EACL,MAAM;IACLC,cAAc;IACdC,iBAAiB;IACjBC,2BAA2B;IAC3BC,6BAA6B;IAC7BC;EACD,CAAC,GAAGL,MAAM;EACV,MAAM;IAAEM;EAAgC,CAAC,GAAGN,MAAM,CAACO,OAAO;EAC1D,MAAMC,cAAc,GAAGV,OAAO,CAACW,OAAO,CAACD,cAAc;EACrD,MAAME,UAAU,GAAGC,qBAAY,CAACC,QAAQ,CAACd,OAAO,CAACe,KAAK,CAACC,GAAG,EAAE,UAAU,CAAC;EAEvE,IAAAC,0CAAmB,EAClB,MAAM;IACL,SAAS;;IACT,OAAO,CACNZ,2BAA2B,CAACa,GAAG,CAAC,CAAC,EACjCZ,6BAA6B,CAACY,GAAG,CAAC,CAAC,EACnCX,+BAA+B,CAACW,GAAG,CAAC,CAAC,CACrC;EACF,CAAC,EACAC,IAAI,IAAK;IACT,SAAS;;IACT,MAAM,CAACC,IAAI,EAAEC,MAAM,EAAEC,UAAU,CAAC,GAAGH,IAAI;IAEvC,IAAIC,IAAI,KAAKG,sCAA8B,CAACC,IAAI,EAAE;MACjD;IACD;IAEA,IAAIF,UAAU,GAAG,CAAC,EAAE;MACnB;IACD;IAEA,IAAAG,oCAAiB,EAAC;MACjBJ,MAAM;MACNK,IAAI,EAAEhB,cAAc;MACpBiB,eAAe,EACdP,IAAI,KAAKG,sCAA8B,CAACK,IAAI,IAC5C,CAAC3B,UAAU,CAAC4B,QAAQ,CAACX,GAAG,CAAC,CAAC;MAC3BjB,UAAU;MACVE,cAAc;MACdC,iBAAiB;MACjBQ;IACD,CAAC,CAAC;IAEFJ,+BAA+B,CAAC,CAAC;EAClC,CACD,CAAC;AACF,CAAC;AAACsB,OAAA,CAAA/B,4BAAA,GAAAA,4BAAA","ignoreList":[]}
|
|
@@ -8,6 +8,7 @@ var _descriptors = require("../../providers/screen/descriptors");
|
|
|
8
8
|
var _animation = require("../../stores/animation.store");
|
|
9
9
|
var _system = require("../../stores/system.store");
|
|
10
10
|
var _useScreenHistory = require("./hooks/history/use-screen-history");
|
|
11
|
+
var _useCloseCompletion = require("./hooks/use-close-completion");
|
|
11
12
|
var _useCloseTransitionIntent = require("./hooks/use-close-transition-intent");
|
|
12
13
|
var _useOpenTransitionIntent = require("./hooks/use-open-transition-intent");
|
|
13
14
|
var _useTransitionStartController = require("./hooks/use-transition-start-controller");
|
|
@@ -23,16 +24,18 @@ const ScreenLifecycle = ({
|
|
|
23
24
|
const animations = _animation.AnimationStore.getBag(current.route.key);
|
|
24
25
|
const system = _system.SystemStore.getBag(current.route.key);
|
|
25
26
|
const {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
} = (0, _useCloseTransitionIntent.useCloseTransitionIntent)(current, system);
|
|
27
|
+
completeClose
|
|
28
|
+
} = (0, _useCloseTransitionIntent.useCloseTransitionIntent)(current);
|
|
29
29
|
(0, _useOpenTransitionIntent.useOpenTransitionIntent)(current, animations, system);
|
|
30
30
|
(0, _useTransitionStartController.useTransitionStartController)({
|
|
31
31
|
current,
|
|
32
32
|
animations,
|
|
33
|
-
system
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
system
|
|
34
|
+
});
|
|
35
|
+
(0, _useCloseCompletion.useCloseCompletion)({
|
|
36
|
+
closing: animations.closing,
|
|
37
|
+
animationProgress: system.animationProgress,
|
|
38
|
+
onComplete: completeClose
|
|
36
39
|
});
|
|
37
40
|
(0, _useScreenHistory.useScreenHistory)(current, previous, animations);
|
|
38
41
|
return children;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_descriptors","require","_animation","_system","_useScreenHistory","_useCloseTransitionIntent","_useOpenTransitionIntent","_useTransitionStartController","ScreenLifecycle","children","current","useDescriptorsStore","store","previous","animations","AnimationStore","getBag","route","key","system","SystemStore","
|
|
1
|
+
{"version":3,"names":["_descriptors","require","_animation","_system","_useScreenHistory","_useCloseCompletion","_useCloseTransitionIntent","_useOpenTransitionIntent","_useTransitionStartController","ScreenLifecycle","children","current","useDescriptorsStore","store","previous","animations","AnimationStore","getBag","route","key","system","SystemStore","completeClose","useCloseTransitionIntent","useOpenTransitionIntent","useTransitionStartController","useCloseCompletion","closing","animationProgress","onComplete","useScreenHistory","exports"],"sourceRoot":"../../../../../src","sources":["shared/components/screen-lifecycle/index.tsx"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,iBAAA,GAAAH,OAAA;AACA,IAAAI,mBAAA,GAAAJ,OAAA;AACA,IAAAK,yBAAA,GAAAL,OAAA;AACA,IAAAM,wBAAA,GAAAN,OAAA;AACA,IAAAO,6BAAA,GAAAP,OAAA;AAMA;AACA;AACA;AACA;AACO,MAAMQ,eAAe,GAAGA,CAAC;EAAEC;AAAgB,CAAC,KAAK;EACvD,MAAMC,OAAO,GAAG,IAAAC,gCAAmB,EAAEC,KAAK,IAAKA,KAAK,CAACF,OAAO,CAAC;EAC7D,MAAMG,QAAQ,GAAG,IAAAF,gCAAmB,EAAEC,KAAK,IAAKA,KAAK,CAACC,QAAQ,CAAC;EAE/D,MAAMC,UAAU,GAAGC,yBAAc,CAACC,MAAM,CAACN,OAAO,CAACO,KAAK,CAACC,GAAG,CAAC;EAC3D,MAAMC,MAAM,GAAGC,mBAAW,CAACJ,MAAM,CAACN,OAAO,CAACO,KAAK,CAACC,GAAG,CAAC;EAEpD,MAAM;IAAEG;EAAc,CAAC,GAAG,IAAAC,kDAAwB,EAACZ,OAAO,CAAC;EAE3D,IAAAa,gDAAuB,EAACb,OAAO,EAAEI,UAAU,EAAEK,MAAM,CAAC;EAEpD,IAAAK,0DAA4B,EAAC;IAC5Bd,OAAO;IACPI,UAAU;IACVK;EACD,CAAC,CAAC;EAEF,IAAAM,sCAAkB,EAAC;IAClBC,OAAO,EAAEZ,UAAU,CAACY,OAAO;IAC3BC,iBAAiB,EAAER,MAAM,CAACQ,iBAAiB;IAC3CC,UAAU,EAAEP;EACb,CAAC,CAAC;EAEF,IAAAQ,kCAAgB,EAACnB,OAAO,EAAEG,QAAQ,EAAEC,UAAU,CAAC;EAE/C,OAAOL,QAAQ;AAChB,CAAC;AAACqB,OAAA,CAAAtB,eAAA,GAAAA,eAAA","ignoreList":[]}
|
|
@@ -7,30 +7,52 @@ exports.useNavigationHelpers = useNavigationHelpers;
|
|
|
7
7
|
var _native = require("@react-navigation/native");
|
|
8
8
|
var _react = require("react");
|
|
9
9
|
var _descriptors = require("../../providers/screen/descriptors");
|
|
10
|
+
var _animation = require("../../stores/animation.store");
|
|
11
|
+
var _system = require("../../stores/system.store");
|
|
12
|
+
var _closeActionReplay = require("../../utils/navigation/close-action-replay");
|
|
10
13
|
var _useStack = require("./use-stack");
|
|
11
14
|
function useNavigationHelpers() {
|
|
12
15
|
const route = (0, _descriptors.useDescriptorsStore)(store => store.current.route);
|
|
13
16
|
const navigation = (0, _descriptors.useDescriptorsStore)(store => store.current.navigation);
|
|
14
17
|
const requestStackDismiss = (0, _useStack.useStack)(stack => stack.requestDismiss);
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}, [route, requestStackDismiss]);
|
|
18
|
+
const {
|
|
19
|
+
preventedRoutes
|
|
20
|
+
} = (0, _native.usePreventRemoveContext)();
|
|
21
|
+
const isRemovePrevented = preventedRoutes[route.key]?.preventRemove === true;
|
|
20
22
|
const dismissScreen = (0, _react.useCallback)(() => {
|
|
21
23
|
const state = navigation.getState();
|
|
22
24
|
const routeIndex = state.routes.findIndex(stateRoute => stateRoute.key === route.key);
|
|
23
25
|
const routeStillPresent = routeIndex !== -1;
|
|
24
26
|
if (!routeStillPresent || routeIndex === 0) return false;
|
|
25
|
-
|
|
27
|
+
const action = {
|
|
26
28
|
..._native.StackActions.pop(),
|
|
27
29
|
source: route.key,
|
|
28
30
|
target: state.key
|
|
31
|
+
};
|
|
32
|
+
(0, _closeActionReplay.dispatchCloseAction)(action, closeAction => {
|
|
33
|
+
navigation.dispatch(closeAction);
|
|
29
34
|
});
|
|
30
35
|
return true;
|
|
31
36
|
}, [navigation, route.key]);
|
|
37
|
+
const requestDismiss = (0, _react.useCallback)(() => {
|
|
38
|
+
if (isRemovePrevented) return false;
|
|
39
|
+
if (requestStackDismiss) {
|
|
40
|
+
if (!requestStackDismiss({
|
|
41
|
+
route
|
|
42
|
+
})) return false;
|
|
43
|
+
} else {
|
|
44
|
+
const state = navigation.getState();
|
|
45
|
+
const routeIndex = state.routes.findIndex(stateRoute => stateRoute.key === route.key);
|
|
46
|
+
if (routeIndex <= 0) return false;
|
|
47
|
+
}
|
|
48
|
+
if (!_animation.AnimationStore.getValue(route.key, "closing").get()) {
|
|
49
|
+
_system.SystemStore.getBag(route.key).actions.requestLifecycleTransition(_system.LifecycleTransitionRequestKind.Close, 0);
|
|
50
|
+
}
|
|
51
|
+
return true;
|
|
52
|
+
}, [isRemovePrevented, navigation, route, requestStackDismiss]);
|
|
32
53
|
return {
|
|
33
54
|
dismissScreen,
|
|
55
|
+
isRemovePrevented,
|
|
34
56
|
requestDismiss
|
|
35
57
|
};
|
|
36
58
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_native","require","_react","_descriptors","_useStack","useNavigationHelpers","route","useDescriptorsStore","store","current","navigation","requestStackDismiss","useStack","stack","requestDismiss","
|
|
1
|
+
{"version":3,"names":["_native","require","_react","_descriptors","_animation","_system","_closeActionReplay","_useStack","useNavigationHelpers","route","useDescriptorsStore","store","current","navigation","requestStackDismiss","useStack","stack","requestDismiss","preventedRoutes","usePreventRemoveContext","isRemovePrevented","key","preventRemove","dismissScreen","useCallback","state","getState","routeIndex","routes","findIndex","stateRoute","routeStillPresent","action","StackActions","pop","source","target","dispatchCloseAction","closeAction","dispatch","AnimationStore","getValue","get","SystemStore","getBag","actions","requestLifecycleTransition","LifecycleTransitionRequestKind","Close"],"sourceRoot":"../../../../../src","sources":["shared/hooks/navigation/use-navigation-helpers.ts"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAIA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AAIA,IAAAK,kBAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AAEO,SAASO,oBAAoBA,CAAA,EAAG;EACtC,MAAMC,KAAK,GAAG,IAAAC,gCAAmB,EAAEC,KAAK,IAAKA,KAAK,CAACC,OAAO,CAACH,KAAK,CAAC;EACjE,MAAMI,UAAU,GAAG,IAAAH,gCAAmB,EAAEC,KAAK,IAAKA,KAAK,CAACC,OAAO,CAACC,UAAU,CAAC;EAC3E,MAAMC,mBAAmB,GAAG,IAAAC,kBAAQ,EAAEC,KAAK,IAAKA,KAAK,CAACC,cAAc,CAAC;EACrE,MAAM;IAAEC;EAAgB,CAAC,GAAG,IAAAC,+BAAuB,EAAC,CAAC;EACrD,MAAMC,iBAAiB,GAAGF,eAAe,CAACT,KAAK,CAACY,GAAG,CAAC,EAAEC,aAAa,KAAK,IAAI;EAE5E,MAAMC,aAAa,GAAG,IAAAC,kBAAW,EAAC,MAAe;IAChD,MAAMC,KAAK,GAAGZ,UAA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C,MAAM,CAACnC,KAAK,CAACY,GAAG,CAAC,CAACwB,OAAO,CAACC,0BAA0B,CAC/DC,sCAA8B,CAACC,KAAK,EACpC,CACD,CAAC;IACF;IACA,OAAO,IAAI;EACZ,CAAC,EAAE,CAAC5B,iBAAiB,EAAEP,UAAU,EAAEJ,KAAK,EAAEK,mBAAmB,CAAC,CAAC;EAE/D,OAAO;IAAES,aAAa;IAAEH,iBAAiB;IAAEH;EAAe,CAAC;AAC5D","ignoreList":[]}
|
|
@@ -34,8 +34,7 @@ const applyMeasuredBoundsWrites = params => {
|
|
|
34
34
|
}
|
|
35
35
|
if (linkWrite?.type === "destination") {
|
|
36
36
|
(0, _links.setDestination)(linkWrite.pairKey, linkId, currentScreenKey, measured, preparedStyles, group, {
|
|
37
|
-
handoff
|
|
38
|
-
escapeClipping
|
|
37
|
+
handoff
|
|
39
38
|
});
|
|
40
39
|
}
|
|
41
40
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_entries","require","_links","applyMeasuredBoundsWrites","params","entryTag","linkId","group","currentScreenKey","measured","preparedStyles","linkWrite","handoff","escapeClipping","setEntry","bounds","type","setSource","pairKey","setDestination","exports"],"sourceRoot":"../../../../../src","sources":["shared/providers/helpers/measured-bounds-writes.ts"],"mappings":";;;;;;AACA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAyBO,MAAME,yBAAyB,GACrCC,MAAuC,IACnC;EACJ,SAAS;;EACT,MAAM;IACLC,QAAQ;IACRC,MAAM;IACNC,KAAK;IACLC,gBAAgB;IAChBC,QAAQ;IACRC,cAAc;IACdC,SAAS;IACTC,OAAO;IACPC;EACD,CAAC,GAAGT,MAAM;;EAEV;EACA;EACA,IAAAU,iBAAQ,EAACT,QAAQ,EAAEG,gBAAgB,EAAE;IACpCO,MAAM,EAAEN;EACT,CAAC,CAAC;EAEF,IAAIE,SAAS,EAAEK,IAAI,KAAK,QAAQ,EAAE;IACjC,IAAAC,gBAAS,EACRN,SAAS,CAACO,OAAO,EACjBZ,MAAM,EACNE,gBAAgB,EAChBC,QAAQ,EACRC,cAAc,EACdH,KAAK,EACL;MAAEK,OAAO;MAAEC;IAAe,CAC3B,CAAC;EACF;EAEA,IAAIF,SAAS,EAAEK,IAAI,KAAK,aAAa,EAAE;IACtC,IAAAG,qBAAc,EACbR,SAAS,CAACO,OAAO,EACjBZ,MAAM,EACNE,gBAAgB,EAChBC,QAAQ,EACRC,cAAc,EACdH,KAAK,EACL;MAAEK
|
|
1
|
+
{"version":3,"names":["_entries","require","_links","applyMeasuredBoundsWrites","params","entryTag","linkId","group","currentScreenKey","measured","preparedStyles","linkWrite","handoff","escapeClipping","setEntry","bounds","type","setSource","pairKey","setDestination","exports"],"sourceRoot":"../../../../../src","sources":["shared/providers/helpers/measured-bounds-writes.ts"],"mappings":";;;;;;AACA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAyBO,MAAME,yBAAyB,GACrCC,MAAuC,IACnC;EACJ,SAAS;;EACT,MAAM;IACLC,QAAQ;IACRC,MAAM;IACNC,KAAK;IACLC,gBAAgB;IAChBC,QAAQ;IACRC,cAAc;IACdC,SAAS;IACTC,OAAO;IACPC;EACD,CAAC,GAAGT,MAAM;;EAEV;EACA;EACA,IAAAU,iBAAQ,EAACT,QAAQ,EAAEG,gBAAgB,EAAE;IACpCO,MAAM,EAAEN;EACT,CAAC,CAAC;EAEF,IAAIE,SAAS,EAAEK,IAAI,KAAK,QAAQ,EAAE;IACjC,IAAAC,gBAAS,EACRN,SAAS,CAACO,OAAO,EACjBZ,MAAM,EACNE,gBAAgB,EAChBC,QAAQ,EACRC,cAAc,EACdH,KAAK,EACL;MAAEK,OAAO;MAAEC;IAAe,CAC3B,CAAC;EACF;EAEA,IAAIF,SAAS,EAAEK,IAAI,KAAK,aAAa,EAAE;IACtC,IAAAG,qBAAc,EACbR,SAAS,CAACO,OAAO,EACjBZ,MAAM,EACNE,gBAAgB,EAChBC,QAAQ,EACRC,cAAc,EACdH,KAAK,EACL;MAAEK;IAAQ,CACX,CAAC;EACF;AACD,CAAC;AAACQ,OAAA,CAAAjB,yBAAA,GAAAA,yBAAA","ignoreList":[]}
|
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.useScreenGestureConfig = useScreenGestureConfig;
|
|
7
|
+
var _native = require("@react-navigation/native");
|
|
7
8
|
var _react = require("react");
|
|
8
9
|
var _descriptors = require("../../descriptors");
|
|
9
10
|
var _gestures = require("../gestures.provider");
|
|
@@ -12,10 +13,16 @@ function useScreenGestureConfig() {
|
|
|
12
13
|
const gestureContext = (0, _gestures.useGestureStore)();
|
|
13
14
|
const options = (0, _descriptors.useDescriptorsStore)(store => store.options);
|
|
14
15
|
const isFirstKey = (0, _descriptors.useDescriptorsStore)(store => store.derivations.isFirstKey);
|
|
16
|
+
const currentScreenKey = (0, _descriptors.useDescriptorsStore)(store => store.derivations.currentScreenKey);
|
|
17
|
+
const {
|
|
18
|
+
preventedRoutes
|
|
19
|
+
} = (0, _native.usePreventRemoveContext)();
|
|
20
|
+
const isRemovePrevented = preventedRoutes[currentScreenKey]?.preventRemove === true;
|
|
15
21
|
return (0, _react.useMemo)(() => (0, _policy.resolveScreenGestureConfig)({
|
|
16
22
|
options,
|
|
17
23
|
isFirstKey,
|
|
18
|
-
gestureContext
|
|
19
|
-
|
|
24
|
+
gestureContext,
|
|
25
|
+
isRemovePrevented
|
|
26
|
+
}), [isFirstKey, options, gestureContext, isRemovePrevented]);
|
|
20
27
|
}
|
|
21
28
|
//# sourceMappingURL=use-screen-gesture-config.js.map
|
package/lib/commonjs/shared/providers/screen/gestures/hooks/use-screen-gesture-config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_native","require","_react","_descriptors","_gestures","_policy","useScreenGestureConfig","gestureContext","useGestureStore","options","useDescriptorsStore","store","isFirstKey","derivations","currentScreenKey","preventedRoutes","usePreventRemoveContext","isRemovePrevented","preventRemove","useMemo","resolveScreenGestureConfig"],"sourceRoot":"../../../../../../../src","sources":["shared/providers/screen/gestures/hooks/use-screen-gesture-config.ts"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AAGO,SAASK,sBAAsBA,CAAA,EAAwB;EAC7D,MAAMC,cAAc,GAAG,IAAAC,yBAAe,EAAC,CAAC;EACxC,MAAMC,OAAO,GAAG,IAAAC,gCAAmB,EAAEC,KAAK,IAAKA,KAAK,CAACF,OAAO,CAAC;EAC7D,MAAMG,UAAU,GAAG,IAAAF,gCAAmB,EACpCC,KAAK,IAAKA,KAAK,CAACE,WAAW,CAACD,UAC9B,CAAC;EACD,MAAME,gBAAgB,GAAG,IAAAJ,gCAAmB,EAC1CC,KAAK,IAAKA,KAAK,CAACE,WAAW,CAACC,gBAC9B,CAAC;EACD,MAAM;IAAEC;EAAgB,CAAC,GAAG,IAAAC,+BAAuB,EAAC,CAAC;EACrD,MAAMC,iBAAiB,GACtBF,eAAe,CAACD,gBAAgB,CAAC,EAAEI,aAAa,KAAK,IAAI;EAE1D,OAAO,IAAAC,cAAO,EACb,MACC,IAAAC,kCAA0B,EAAC;IAC1BX,OAAO;IACPG,UAAU;IACVL,cAAc;IACdU;EACD,CAAC,CAAC,EACH,CAACL,UAAU,EAAEH,OAAO,EAAEF,cAAc,EAAEU,iBAAiB,CACxD,CAAC;AACF","ignoreList":[]}
|