react-native-screen-transitions 3.4.0-alpha.0 → 3.4.0-alpha.2
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/README.md +11 -1046
- package/lib/commonjs/blank-stack/navigators/create-blank-stack-navigator.js +69 -2
- package/lib/commonjs/blank-stack/navigators/create-blank-stack-navigator.js.map +1 -1
- package/lib/commonjs/component-stack/navigators/create-component-stack-navigator.js +9 -0
- package/lib/commonjs/component-stack/navigators/create-component-stack-navigator.js.map +1 -1
- package/lib/commonjs/shared/animation/snap-to.js +5 -1
- package/lib/commonjs/shared/animation/snap-to.js.map +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js +195 -0
- package/lib/commonjs/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js.map +1 -0
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-auto-source-measurement.js +7 -14
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-auto-source-measurement.js.map +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.js +19 -18
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.js.map +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.js +54 -0
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.js.map +1 -0
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-group-active-measurement.js +40 -8
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-group-active-measurement.js.map +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.js +72 -0
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.js.map +1 -0
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-initial-layout-handler.js +16 -7
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-initial-layout-handler.js.map +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-pending-destination-measurement.js +7 -4
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-pending-destination-measurement.js.map +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.js +14 -15
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.js.map +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.js +27 -9
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.js.map +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/index.js +22 -8
- package/lib/commonjs/shared/components/create-boundary-component/index.js.map +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/utils/build-boundary-match-key.js +5 -10
- package/lib/commonjs/shared/components/create-boundary-component/utils/build-boundary-match-key.js.map +1 -1
- package/lib/commonjs/shared/components/create-transition-aware-component.js +3 -2
- package/lib/commonjs/shared/components/create-transition-aware-component.js.map +1 -1
- package/lib/commonjs/shared/components/native-screen-container.js +12 -6
- package/lib/commonjs/shared/components/native-screen-container.js.map +1 -1
- package/lib/commonjs/shared/components/native-screen.js +35 -8
- package/lib/commonjs/shared/components/native-screen.js.map +1 -1
- package/lib/commonjs/shared/components/overlay/helpers/get-active-overlay.js +2 -2
- package/lib/commonjs/shared/components/overlay/helpers/get-active-overlay.js.map +1 -1
- package/lib/commonjs/shared/components/overlay/index.js +1 -3
- package/lib/commonjs/shared/components/overlay/index.js.map +1 -1
- package/lib/commonjs/shared/components/overlay/variations/overlay-host.js +2 -16
- package/lib/commonjs/shared/components/overlay/variations/overlay-host.js.map +1 -1
- package/lib/commonjs/shared/components/scene-view.js +2 -4
- package/lib/commonjs/shared/components/scene-view.js.map +1 -1
- package/lib/commonjs/shared/components/screen-container/hooks/use-content-layout.js +60 -0
- package/lib/commonjs/shared/components/screen-container/hooks/use-content-layout.js.map +1 -0
- package/lib/commonjs/shared/components/screen-container/layers/backdrop.js +9 -6
- package/lib/commonjs/shared/components/screen-container/layers/backdrop.js.map +1 -1
- package/lib/commonjs/shared/components/screen-container/layers/content.js +16 -56
- package/lib/commonjs/shared/components/screen-container/layers/content.js.map +1 -1
- package/lib/commonjs/shared/components/screen-container/layers/maybe-masked-navigation-container.js +86 -0
- package/lib/commonjs/shared/components/screen-container/layers/maybe-masked-navigation-container.js.map +1 -0
- package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-close-transition/index.js.map +1 -1
- package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-open-transition.js +17 -4
- package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-open-transition.js.map +1 -1
- package/lib/commonjs/shared/constants.js +6 -2
- package/lib/commonjs/shared/constants.js.map +1 -1
- package/lib/commonjs/shared/hooks/gestures/resolve-screen-gesture-target.js +49 -0
- package/lib/commonjs/shared/hooks/gestures/resolve-screen-gesture-target.js.map +1 -0
- package/lib/commonjs/shared/hooks/gestures/types.js +2 -0
- package/lib/commonjs/shared/hooks/gestures/types.js.map +1 -0
- package/lib/commonjs/shared/hooks/gestures/use-screen-gesture.js +7 -3
- package/lib/commonjs/shared/hooks/gestures/use-screen-gesture.js.map +1 -1
- package/lib/commonjs/shared/hooks/navigation/use-stack.js.map +1 -1
- package/lib/commonjs/shared/index.js +15 -3
- package/lib/commonjs/shared/index.js.map +1 -1
- package/lib/commonjs/shared/providers/gestures/handlers/use-handlers.js +61 -25
- package/lib/commonjs/shared/providers/gestures/handlers/use-handlers.js.map +1 -1
- package/lib/commonjs/shared/providers/gestures/helpers/gesture-activation.js +11 -6
- package/lib/commonjs/shared/providers/gestures/helpers/gesture-activation.js.map +1 -1
- package/lib/commonjs/shared/providers/gestures/helpers/gesture-snap-points.js +44 -0
- package/lib/commonjs/shared/providers/gestures/helpers/gesture-snap-points.js.map +1 -0
- package/lib/commonjs/shared/providers/layout-anchor.provider.js +4 -6
- package/lib/commonjs/shared/providers/layout-anchor.provider.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/animation/animation.provider.js +31 -17
- package/lib/commonjs/shared/providers/screen/animation/animation.provider.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/animation/helpers/derivations.js +1 -9
- package/lib/commonjs/shared/providers/screen/animation/helpers/derivations.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/animation/helpers/pipeline.js +25 -13
- package/lib/commonjs/shared/providers/screen/animation/helpers/pipeline.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/animation/helpers/resolve-screen-animation-target.js +33 -0
- package/lib/commonjs/shared/providers/screen/animation/helpers/resolve-screen-animation-target.js.map +1 -0
- package/lib/commonjs/shared/providers/screen/animation/types.js +2 -0
- package/lib/commonjs/shared/providers/screen/animation/types.js.map +1 -0
- package/lib/commonjs/shared/providers/screen/animation/use-screen-animation.js +9 -3
- package/lib/commonjs/shared/providers/screen/animation/use-screen-animation.js.map +1 -1
- package/lib/commonjs/shared/providers/stack/core.provider.js +14 -21
- package/lib/commonjs/shared/providers/stack/core.provider.js.map +1 -1
- package/lib/commonjs/shared/providers/stack/direct.provider.js +1 -1
- package/lib/commonjs/shared/providers/stack/direct.provider.js.map +1 -1
- package/lib/commonjs/shared/providers/stack/helpers/use-processed-routes.js +1 -1
- package/lib/commonjs/shared/providers/stack/helpers/use-processed-routes.js.map +1 -1
- package/lib/commonjs/shared/stores/animation.store.js +10 -2
- package/lib/commonjs/shared/stores/animation.store.js.map +1 -1
- package/lib/commonjs/shared/stores/bounds/internals/presence.js.map +1 -1
- package/lib/commonjs/shared/stores/bounds/internals/resolver.js +7 -0
- package/lib/commonjs/shared/stores/bounds/internals/resolver.js.map +1 -1
- package/lib/commonjs/shared/utils/animation/animate-to-progress.js +6 -0
- package/lib/commonjs/shared/utils/animation/animate-to-progress.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/helpers/compute-bounds-styles.js +33 -9
- package/lib/commonjs/shared/utils/bounds/helpers/compute-bounds-styles.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/helpers/geometry.js +3 -2
- package/lib/commonjs/shared/utils/bounds/helpers/geometry.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/helpers/interpolators.js +3 -2
- package/lib/commonjs/shared/utils/bounds/helpers/interpolators.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/helpers/link-accessor.js +2 -2
- package/lib/commonjs/shared/utils/bounds/helpers/link-accessor.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/helpers/resolve-bound-tag.js +4 -8
- package/lib/commonjs/shared/utils/bounds/helpers/resolve-bound-tag.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/helpers/style-composers.js +4 -3
- package/lib/commonjs/shared/utils/bounds/helpers/style-composers.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/index.js +13 -3
- package/lib/commonjs/shared/utils/bounds/index.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/types/frame-props.js +6 -0
- package/lib/commonjs/shared/utils/bounds/types/frame-props.js.map +1 -0
- package/lib/commonjs/shared/utils/bounds/zoom/accessor.js +54 -0
- package/lib/commonjs/shared/utils/bounds/zoom/accessor.js.map +1 -0
- package/lib/commonjs/shared/utils/bounds/zoom/build.js +548 -0
- package/lib/commonjs/shared/utils/bounds/zoom/build.js.map +1 -0
- package/lib/commonjs/shared/utils/bounds/zoom/config.js +118 -0
- package/lib/commonjs/shared/utils/bounds/zoom/config.js.map +1 -0
- package/lib/commonjs/shared/utils/bounds/zoom/index.js +20 -0
- package/lib/commonjs/shared/utils/bounds/zoom/index.js.map +1 -0
- package/lib/commonjs/shared/utils/bounds/zoom/types.js.map +1 -0
- package/lib/commonjs/shared/utils/gesture/validate-snap-points.js +11 -5
- package/lib/commonjs/shared/utils/gesture/validate-snap-points.js.map +1 -1
- package/lib/commonjs/shared/utils/overlay/visibility.js +2 -9
- package/lib/commonjs/shared/utils/overlay/visibility.js.map +1 -1
- package/lib/commonjs/shared/utils/resolve-screen-transition-options.js +25 -0
- package/lib/commonjs/shared/utils/resolve-screen-transition-options.js.map +1 -0
- package/lib/module/blank-stack/navigators/create-blank-stack-navigator.js +69 -3
- package/lib/module/blank-stack/navigators/create-blank-stack-navigator.js.map +1 -1
- package/lib/module/component-stack/navigators/create-component-stack-navigator.js +9 -0
- package/lib/module/component-stack/navigators/create-component-stack-navigator.js.map +1 -1
- package/lib/module/shared/animation/snap-to.js +5 -1
- package/lib/module/shared/animation/snap-to.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js +182 -0
- package/lib/module/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js.map +1 -0
- package/lib/module/shared/components/create-boundary-component/hooks/use-auto-source-measurement.js +7 -14
- package/lib/module/shared/components/create-boundary-component/hooks/use-auto-source-measurement.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.js +19 -18
- package/lib/module/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.js +49 -0
- package/lib/module/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.js.map +1 -0
- package/lib/module/shared/components/create-boundary-component/hooks/use-group-active-measurement.js +41 -8
- package/lib/module/shared/components/create-boundary-component/hooks/use-group-active-measurement.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.js +67 -0
- package/lib/module/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.js.map +1 -0
- package/lib/module/shared/components/create-boundary-component/hooks/use-initial-layout-handler.js +16 -7
- package/lib/module/shared/components/create-boundary-component/hooks/use-initial-layout-handler.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-pending-destination-measurement.js +7 -4
- package/lib/module/shared/components/create-boundary-component/hooks/use-pending-destination-measurement.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.js +14 -15
- package/lib/module/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.js +27 -9
- package/lib/module/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/index.js +22 -8
- package/lib/module/shared/components/create-boundary-component/index.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/utils/build-boundary-match-key.js +5 -10
- package/lib/module/shared/components/create-boundary-component/utils/build-boundary-match-key.js.map +1 -1
- package/lib/module/shared/components/create-transition-aware-component.js +3 -2
- package/lib/module/shared/components/create-transition-aware-component.js.map +1 -1
- package/lib/module/shared/components/native-screen-container.js +12 -6
- package/lib/module/shared/components/native-screen-container.js.map +1 -1
- package/lib/module/shared/components/native-screen.js +35 -8
- package/lib/module/shared/components/native-screen.js.map +1 -1
- package/lib/module/shared/components/overlay/helpers/get-active-overlay.js +3 -3
- package/lib/module/shared/components/overlay/helpers/get-active-overlay.js.map +1 -1
- package/lib/module/shared/components/overlay/index.js +1 -3
- package/lib/module/shared/components/overlay/index.js.map +1 -1
- package/lib/module/shared/components/overlay/variations/overlay-host.js +3 -17
- package/lib/module/shared/components/overlay/variations/overlay-host.js.map +1 -1
- package/lib/module/shared/components/scene-view.js +3 -5
- package/lib/module/shared/components/scene-view.js.map +1 -1
- package/lib/module/shared/components/screen-container/hooks/use-content-layout.js +56 -0
- package/lib/module/shared/components/screen-container/hooks/use-content-layout.js.map +1 -0
- package/lib/module/shared/components/screen-container/layers/backdrop.js +9 -6
- package/lib/module/shared/components/screen-container/layers/backdrop.js.map +1 -1
- package/lib/module/shared/components/screen-container/layers/content.js +18 -58
- package/lib/module/shared/components/screen-container/layers/content.js.map +1 -1
- package/lib/module/shared/components/screen-container/layers/maybe-masked-navigation-container.js +81 -0
- package/lib/module/shared/components/screen-container/layers/maybe-masked-navigation-container.js.map +1 -0
- package/lib/module/shared/components/screen-lifecycle/hooks/use-close-transition/index.js.map +1 -1
- package/lib/module/shared/components/screen-lifecycle/hooks/use-open-transition.js +17 -4
- package/lib/module/shared/components/screen-lifecycle/hooks/use-open-transition.js.map +1 -1
- package/lib/module/shared/constants.js +6 -2
- package/lib/module/shared/constants.js.map +1 -1
- package/lib/module/shared/hooks/gestures/resolve-screen-gesture-target.js +45 -0
- package/lib/module/shared/hooks/gestures/resolve-screen-gesture-target.js.map +1 -0
- package/lib/module/shared/hooks/gestures/types.js +2 -0
- package/lib/module/shared/hooks/gestures/types.js.map +1 -0
- package/lib/module/shared/hooks/gestures/use-screen-gesture.js +7 -4
- package/lib/module/shared/hooks/gestures/use-screen-gesture.js.map +1 -1
- package/lib/module/shared/hooks/navigation/use-stack.js.map +1 -1
- package/lib/module/shared/index.js +1 -2
- package/lib/module/shared/index.js.map +1 -1
- package/lib/module/shared/providers/gestures/handlers/use-handlers.js +61 -25
- package/lib/module/shared/providers/gestures/handlers/use-handlers.js.map +1 -1
- package/lib/module/shared/providers/gestures/helpers/gesture-activation.js +11 -6
- package/lib/module/shared/providers/gestures/helpers/gesture-activation.js.map +1 -1
- package/lib/module/shared/providers/gestures/helpers/gesture-snap-points.js +38 -0
- package/lib/module/shared/providers/gestures/helpers/gesture-snap-points.js.map +1 -0
- package/lib/module/shared/providers/layout-anchor.provider.js +4 -6
- package/lib/module/shared/providers/layout-anchor.provider.js.map +1 -1
- package/lib/module/shared/providers/screen/animation/animation.provider.js +30 -15
- package/lib/module/shared/providers/screen/animation/animation.provider.js.map +1 -1
- package/lib/module/shared/providers/screen/animation/helpers/derivations.js +1 -9
- package/lib/module/shared/providers/screen/animation/helpers/derivations.js.map +1 -1
- package/lib/module/shared/providers/screen/animation/helpers/pipeline.js +25 -13
- package/lib/module/shared/providers/screen/animation/helpers/pipeline.js.map +1 -1
- package/lib/module/shared/providers/screen/animation/helpers/resolve-screen-animation-target.js +29 -0
- package/lib/module/shared/providers/screen/animation/helpers/resolve-screen-animation-target.js.map +1 -0
- package/lib/module/shared/providers/screen/animation/index.js.map +1 -1
- package/lib/module/shared/providers/screen/animation/types.js +2 -0
- package/lib/module/shared/providers/screen/animation/types.js.map +1 -0
- package/lib/module/shared/providers/screen/animation/use-screen-animation.js +9 -3
- package/lib/module/shared/providers/screen/animation/use-screen-animation.js.map +1 -1
- package/lib/module/shared/providers/stack/core.provider.js +14 -21
- package/lib/module/shared/providers/stack/core.provider.js.map +1 -1
- package/lib/module/shared/providers/stack/direct.provider.js +2 -2
- package/lib/module/shared/providers/stack/direct.provider.js.map +1 -1
- package/lib/module/shared/providers/stack/helpers/use-processed-routes.js +2 -2
- package/lib/module/shared/providers/stack/helpers/use-processed-routes.js.map +1 -1
- package/lib/module/shared/stores/animation.store.js +10 -2
- package/lib/module/shared/stores/animation.store.js.map +1 -1
- package/lib/module/shared/stores/bounds/internals/presence.js.map +1 -1
- package/lib/module/shared/stores/bounds/internals/resolver.js +7 -0
- package/lib/module/shared/stores/bounds/internals/resolver.js.map +1 -1
- package/lib/module/shared/utils/animation/animate-to-progress.js +6 -0
- package/lib/module/shared/utils/animation/animate-to-progress.js.map +1 -1
- package/lib/module/shared/utils/bounds/helpers/compute-bounds-styles.js +33 -9
- package/lib/module/shared/utils/bounds/helpers/compute-bounds-styles.js.map +1 -1
- package/lib/module/shared/utils/bounds/helpers/geometry.js +3 -2
- package/lib/module/shared/utils/bounds/helpers/geometry.js.map +1 -1
- package/lib/module/shared/utils/bounds/helpers/interpolators.js +3 -2
- package/lib/module/shared/utils/bounds/helpers/interpolators.js.map +1 -1
- package/lib/module/shared/utils/bounds/helpers/link-accessor.js +2 -2
- package/lib/module/shared/utils/bounds/helpers/link-accessor.js.map +1 -1
- package/lib/module/shared/utils/bounds/helpers/resolve-bound-tag.js +4 -8
- package/lib/module/shared/utils/bounds/helpers/resolve-bound-tag.js.map +1 -1
- package/lib/module/shared/utils/bounds/helpers/style-composers.js +4 -3
- package/lib/module/shared/utils/bounds/helpers/style-composers.js.map +1 -1
- package/lib/module/shared/utils/bounds/index.js +13 -3
- package/lib/module/shared/utils/bounds/index.js.map +1 -1
- package/lib/module/shared/utils/bounds/types/frame-props.js +4 -0
- package/lib/module/shared/utils/bounds/types/frame-props.js.map +1 -0
- package/lib/module/shared/utils/bounds/zoom/accessor.js +49 -0
- package/lib/module/shared/utils/bounds/zoom/accessor.js.map +1 -0
- package/lib/module/shared/utils/bounds/zoom/build.js +543 -0
- package/lib/module/shared/utils/bounds/zoom/build.js.map +1 -0
- package/lib/module/shared/utils/bounds/zoom/config.js +112 -0
- package/lib/module/shared/utils/bounds/zoom/config.js.map +1 -0
- package/lib/module/shared/utils/bounds/zoom/index.js +5 -0
- package/lib/module/shared/utils/bounds/zoom/index.js.map +1 -0
- package/lib/module/shared/utils/bounds/zoom/types.js.map +1 -0
- package/lib/module/shared/utils/gesture/validate-snap-points.js +11 -5
- package/lib/module/shared/utils/gesture/validate-snap-points.js.map +1 -1
- package/lib/module/shared/utils/overlay/visibility.js +1 -7
- package/lib/module/shared/utils/overlay/visibility.js.map +1 -1
- package/lib/module/shared/utils/resolve-screen-transition-options.js +19 -0
- package/lib/module/shared/utils/resolve-screen-transition-options.js.map +1 -0
- package/lib/typescript/blank-stack/index.d.ts +1 -1
- package/lib/typescript/blank-stack/index.d.ts.map +1 -1
- package/lib/typescript/blank-stack/navigators/create-blank-stack-navigator.d.ts +29 -4
- package/lib/typescript/blank-stack/navigators/create-blank-stack-navigator.d.ts.map +1 -1
- package/lib/typescript/blank-stack/types.d.ts +33 -4
- package/lib/typescript/blank-stack/types.d.ts.map +1 -1
- package/lib/typescript/component-stack/navigators/create-component-stack-navigator.d.ts +8 -0
- package/lib/typescript/component-stack/navigators/create-component-stack-navigator.d.ts.map +1 -1
- package/lib/typescript/shared/animation/snap-to.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/helpers/measurement-rules.d.ts +81 -0
- package/lib/typescript/shared/components/create-boundary-component/hooks/helpers/measurement-rules.d.ts.map +1 -0
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-auto-source-measurement.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.d.ts +2 -3
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.d.ts +11 -0
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.d.ts.map +1 -0
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-group-active-measurement.d.ts +2 -2
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-group-active-measurement.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.d.ts +11 -0
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.d.ts.map +1 -0
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-initial-layout-handler.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-pending-destination-measurement.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.d.ts +3 -3
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.d.ts +2 -2
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/index.d.ts +5 -3
- package/lib/typescript/shared/components/create-boundary-component/index.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/types.d.ts +2 -4
- package/lib/typescript/shared/components/create-boundary-component/types.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/utils/build-boundary-match-key.d.ts +0 -1
- package/lib/typescript/shared/components/create-boundary-component/utils/build-boundary-match-key.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-transition-aware-component.d.ts +1 -0
- package/lib/typescript/shared/components/create-transition-aware-component.d.ts.map +1 -1
- package/lib/typescript/shared/components/native-screen-container.d.ts.map +1 -1
- package/lib/typescript/shared/components/native-screen.d.ts.map +1 -1
- package/lib/typescript/shared/components/overlay/helpers/get-active-overlay.d.ts +1 -1
- package/lib/typescript/shared/components/overlay/index.d.ts +0 -2
- package/lib/typescript/shared/components/overlay/index.d.ts.map +1 -1
- package/lib/typescript/shared/components/overlay/variations/overlay-host.d.ts.map +1 -1
- package/lib/typescript/shared/components/scene-view.d.ts.map +1 -1
- package/lib/typescript/shared/components/screen-container/hooks/use-content-layout.d.ts +3 -0
- package/lib/typescript/shared/components/screen-container/hooks/use-content-layout.d.ts.map +1 -0
- package/lib/typescript/shared/components/screen-container/layers/backdrop.d.ts.map +1 -1
- package/lib/typescript/shared/components/screen-container/layers/content.d.ts.map +1 -1
- package/lib/typescript/shared/components/screen-container/layers/maybe-masked-navigation-container.d.ts +9 -0
- package/lib/typescript/shared/components/screen-container/layers/maybe-masked-navigation-container.d.ts.map +1 -0
- package/lib/typescript/shared/components/screen-lifecycle/hooks/use-close-transition/index.d.ts.map +1 -1
- package/lib/typescript/shared/components/screen-lifecycle/hooks/use-open-transition.d.ts.map +1 -1
- package/lib/typescript/shared/constants.d.ts +3 -0
- package/lib/typescript/shared/constants.d.ts.map +1 -1
- package/lib/typescript/shared/hooks/gestures/resolve-screen-gesture-target.d.ts +10 -0
- package/lib/typescript/shared/hooks/gestures/resolve-screen-gesture-target.d.ts.map +1 -0
- package/lib/typescript/shared/hooks/gestures/types.d.ts +4 -0
- package/lib/typescript/shared/hooks/gestures/types.d.ts.map +1 -0
- package/lib/typescript/shared/hooks/gestures/use-screen-gesture.d.ts +4 -2
- package/lib/typescript/shared/hooks/gestures/use-screen-gesture.d.ts.map +1 -1
- package/lib/typescript/shared/hooks/navigation/use-stack.d.ts +1 -2
- package/lib/typescript/shared/hooks/navigation/use-stack.d.ts.map +1 -1
- package/lib/typescript/shared/index.d.ts +16 -18
- package/lib/typescript/shared/index.d.ts.map +1 -1
- package/lib/typescript/shared/providers/gestures/handlers/use-handlers.d.ts +1 -1
- package/lib/typescript/shared/providers/gestures/handlers/use-handlers.d.ts.map +1 -1
- package/lib/typescript/shared/providers/gestures/helpers/gesture-activation.d.ts.map +1 -1
- package/lib/typescript/shared/providers/gestures/helpers/gesture-snap-points.d.ts +18 -0
- package/lib/typescript/shared/providers/gestures/helpers/gesture-snap-points.d.ts.map +1 -0
- package/lib/typescript/shared/providers/layout-anchor.provider.d.ts +1 -1
- package/lib/typescript/shared/providers/layout-anchor.provider.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/animation/animation.provider.d.ts +6 -3
- package/lib/typescript/shared/providers/screen/animation/animation.provider.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/animation/helpers/derivations.d.ts +0 -2
- package/lib/typescript/shared/providers/screen/animation/helpers/derivations.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/animation/helpers/pipeline.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/animation/helpers/resolve-screen-animation-target.d.ts +11 -0
- package/lib/typescript/shared/providers/screen/animation/helpers/resolve-screen-animation-target.d.ts.map +1 -0
- package/lib/typescript/shared/providers/screen/animation/index.d.ts +1 -1
- package/lib/typescript/shared/providers/screen/animation/index.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/animation/types.d.ts +4 -0
- package/lib/typescript/shared/providers/screen/animation/types.d.ts.map +1 -0
- package/lib/typescript/shared/providers/screen/animation/use-screen-animation.d.ts +5 -1
- package/lib/typescript/shared/providers/screen/animation/use-screen-animation.d.ts.map +1 -1
- package/lib/typescript/shared/providers/stack/core.provider.d.ts +2 -0
- package/lib/typescript/shared/providers/stack/core.provider.d.ts.map +1 -1
- package/lib/typescript/shared/providers/stack/direct.provider.d.ts.map +1 -1
- package/lib/typescript/shared/stores/animation.store.d.ts +8 -2
- package/lib/typescript/shared/stores/animation.store.d.ts.map +1 -1
- package/lib/typescript/shared/stores/bounds/internals/presence.d.ts.map +1 -1
- package/lib/typescript/shared/stores/bounds/internals/resolver.d.ts.map +1 -1
- package/lib/typescript/shared/stores/bounds/types.d.ts +2 -0
- package/lib/typescript/shared/stores/bounds/types.d.ts.map +1 -1
- package/lib/typescript/shared/types/animation.types.d.ts +33 -51
- package/lib/typescript/shared/types/animation.types.d.ts.map +1 -1
- package/lib/typescript/shared/types/bounds.types.d.ts +46 -9
- package/lib/typescript/shared/types/bounds.types.d.ts.map +1 -1
- package/lib/typescript/shared/types/index.d.ts +3 -3
- package/lib/typescript/shared/types/index.d.ts.map +1 -1
- package/lib/typescript/shared/types/overlay.types.d.ts +1 -22
- package/lib/typescript/shared/types/overlay.types.d.ts.map +1 -1
- package/lib/typescript/shared/types/screen.types.d.ts +62 -37
- package/lib/typescript/shared/types/screen.types.d.ts.map +1 -1
- package/lib/typescript/shared/utils/animation/animate-to-progress.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/helpers/build-bounds-options.d.ts +2 -2
- package/lib/typescript/shared/utils/bounds/helpers/build-bounds-options.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/helpers/compute-bounds-styles.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/helpers/geometry.d.ts +3 -2
- package/lib/typescript/shared/utils/bounds/helpers/geometry.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/helpers/interpolators.d.ts +3 -2
- package/lib/typescript/shared/utils/bounds/helpers/interpolators.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/helpers/link-accessor.d.ts +3 -2
- package/lib/typescript/shared/utils/bounds/helpers/link-accessor.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/helpers/resolve-bound-tag.d.ts +2 -1
- package/lib/typescript/shared/utils/bounds/helpers/resolve-bound-tag.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/helpers/style-composers.d.ts +4 -3
- package/lib/typescript/shared/utils/bounds/helpers/style-composers.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/index.d.ts +2 -2
- package/lib/typescript/shared/utils/bounds/index.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/types/frame-props.d.ts +5 -0
- package/lib/typescript/shared/utils/bounds/types/frame-props.d.ts.map +1 -0
- package/lib/typescript/shared/utils/bounds/types/options.d.ts +5 -4
- package/lib/typescript/shared/utils/bounds/types/options.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/zoom/accessor.d.ts +17 -0
- package/lib/typescript/shared/utils/bounds/zoom/accessor.d.ts.map +1 -0
- package/lib/typescript/shared/utils/bounds/zoom/build.d.ts +4 -0
- package/lib/typescript/shared/utils/bounds/zoom/build.d.ts.map +1 -0
- package/lib/typescript/shared/utils/bounds/zoom/config.d.ts +43 -0
- package/lib/typescript/shared/utils/bounds/zoom/config.d.ts.map +1 -0
- package/lib/typescript/shared/utils/bounds/zoom/index.d.ts +3 -0
- package/lib/typescript/shared/utils/bounds/zoom/index.d.ts.map +1 -0
- package/lib/typescript/shared/utils/bounds/zoom/types.d.ts +17 -0
- package/lib/typescript/shared/utils/bounds/zoom/types.d.ts.map +1 -0
- package/lib/typescript/shared/utils/gesture/validate-snap-points.d.ts +5 -3
- package/lib/typescript/shared/utils/gesture/validate-snap-points.d.ts.map +1 -1
- package/lib/typescript/shared/utils/overlay/visibility.d.ts +1 -4
- package/lib/typescript/shared/utils/overlay/visibility.d.ts.map +1 -1
- package/lib/typescript/shared/utils/resolve-screen-transition-options.d.ts +5 -0
- package/lib/typescript/shared/utils/resolve-screen-transition-options.d.ts.map +1 -0
- package/package.json +3 -2
- package/src/blank-stack/index.ts +1 -0
- package/src/blank-stack/navigators/create-blank-stack-navigator.tsx +138 -19
- package/src/blank-stack/types.ts +33 -5
- package/src/component-stack/navigators/create-component-stack-navigator.tsx +8 -0
- package/src/shared/animation/snap-to.ts +12 -1
- package/src/shared/components/create-boundary-component/hooks/helpers/measurement-rules.ts +258 -0
- package/src/shared/components/create-boundary-component/hooks/use-auto-source-measurement.ts +7 -17
- package/src/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.ts +38 -28
- package/src/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.ts +58 -0
- package/src/shared/components/create-boundary-component/hooks/use-group-active-measurement.ts +41 -10
- package/src/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.ts +82 -0
- package/src/shared/components/create-boundary-component/hooks/use-initial-layout-handler.ts +24 -12
- package/src/shared/components/create-boundary-component/hooks/use-pending-destination-measurement.ts +11 -9
- package/src/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.ts +29 -26
- package/src/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.ts +26 -17
- package/src/shared/components/create-boundary-component/index.tsx +25 -6
- package/src/shared/components/create-boundary-component/types.ts +8 -4
- package/src/shared/components/create-boundary-component/utils/build-boundary-match-key.ts +2 -14
- package/src/shared/components/create-transition-aware-component.tsx +5 -2
- package/src/shared/components/native-screen-container.tsx +11 -3
- package/src/shared/components/native-screen.tsx +65 -20
- package/src/shared/components/overlay/helpers/get-active-overlay.ts +3 -3
- package/src/shared/components/overlay/index.ts +0 -2
- package/src/shared/components/overlay/variations/overlay-host.tsx +2 -16
- package/src/shared/components/scene-view.tsx +0 -3
- package/src/shared/components/screen-container/hooks/use-content-layout.ts +82 -0
- package/src/shared/components/screen-container/layers/backdrop.tsx +25 -6
- package/src/shared/components/screen-container/layers/content.tsx +23 -82
- package/src/shared/components/screen-container/layers/maybe-masked-navigation-container.tsx +101 -0
- package/src/shared/components/screen-lifecycle/hooks/use-close-transition/index.ts +1 -2
- package/src/shared/components/screen-lifecycle/hooks/use-open-transition.ts +20 -6
- package/src/shared/constants.ts +6 -2
- package/src/shared/hooks/gestures/resolve-screen-gesture-target.ts +66 -0
- package/src/shared/hooks/gestures/types.ts +5 -0
- package/src/shared/hooks/gestures/use-screen-gesture.ts +10 -3
- package/src/shared/hooks/navigation/use-stack.tsx +1 -2
- package/src/shared/index.ts +14 -16
- package/src/shared/providers/gestures/handlers/use-handlers.ts +75 -29
- package/src/shared/providers/gestures/helpers/gesture-activation.ts +11 -6
- package/src/shared/providers/gestures/helpers/gesture-snap-points.ts +72 -0
- package/src/shared/providers/layout-anchor.provider.tsx +2 -5
- package/src/shared/providers/register-bounds.provider.tsx +1 -1
- package/src/shared/providers/screen/animation/animation.provider.tsx +46 -10
- package/src/shared/providers/screen/animation/helpers/derivations.ts +0 -8
- package/src/shared/providers/screen/animation/helpers/pipeline.ts +51 -14
- package/src/shared/providers/screen/animation/helpers/resolve-screen-animation-target.ts +44 -0
- package/src/shared/providers/screen/animation/index.tsx +4 -1
- package/src/shared/providers/screen/animation/types.ts +5 -0
- package/src/shared/providers/screen/animation/use-screen-animation.tsx +16 -3
- package/src/shared/providers/stack/core.provider.tsx +27 -14
- package/src/shared/providers/stack/direct.provider.tsx +2 -5
- package/src/shared/providers/stack/helpers/use-processed-routes.ts +2 -2
- package/src/shared/stores/animation.store.ts +21 -5
- package/src/shared/stores/bounds/internals/presence.ts +3 -1
- package/src/shared/stores/bounds/internals/resolver.ts +13 -1
- package/src/shared/stores/bounds/types.ts +2 -0
- package/src/shared/types/animation.types.ts +32 -58
- package/src/shared/types/bounds.types.ts +30 -10
- package/src/shared/types/index.ts +2 -15
- package/src/shared/types/overlay.types.ts +1 -28
- package/src/shared/types/screen.types.ts +67 -38
- package/src/shared/utils/animation/animate-to-progress.ts +7 -0
- package/src/shared/utils/bounds/helpers/build-bounds-options.ts +2 -2
- package/src/shared/utils/bounds/helpers/compute-bounds-styles.ts +47 -8
- package/src/shared/utils/bounds/helpers/geometry.ts +3 -2
- package/src/shared/utils/bounds/helpers/interpolators.ts +8 -6
- package/src/shared/utils/bounds/helpers/link-accessor.ts +10 -6
- package/src/shared/utils/bounds/helpers/resolve-bound-tag.ts +7 -10
- package/src/shared/utils/bounds/helpers/style-composers.ts +4 -3
- package/src/shared/utils/bounds/index.ts +22 -13
- package/src/shared/utils/bounds/types/frame-props.ts +5 -0
- package/src/shared/utils/bounds/types/options.ts +6 -4
- package/src/shared/utils/bounds/zoom/accessor.ts +69 -0
- package/src/shared/utils/bounds/zoom/build.ts +715 -0
- package/src/shared/utils/bounds/zoom/config.ts +179 -0
- package/src/shared/utils/bounds/zoom/index.ts +2 -0
- package/src/shared/utils/bounds/zoom/types.ts +22 -0
- package/src/shared/utils/gesture/validate-snap-points.ts +20 -8
- package/src/shared/utils/overlay/visibility.ts +1 -16
- package/src/shared/utils/resolve-screen-transition-options.ts +37 -0
- package/lib/commonjs/shared/components/overlay/variations/screen-overlay.js +0 -64
- package/lib/commonjs/shared/components/overlay/variations/screen-overlay.js.map +0 -1
- package/lib/commonjs/shared/providers/viewport.provider.js +0 -33
- package/lib/commonjs/shared/providers/viewport.provider.js.map +0 -1
- package/lib/commonjs/shared/utils/bounds/helpers/math.js +0 -132
- package/lib/commonjs/shared/utils/bounds/helpers/math.js.map +0 -1
- package/lib/commonjs/shared/utils/bounds/helpers/navigation-accessor.js +0 -45
- package/lib/commonjs/shared/utils/bounds/helpers/navigation-accessor.js.map +0 -1
- package/lib/commonjs/shared/utils/bounds/sugar/navigation/helpers.js +0 -60
- package/lib/commonjs/shared/utils/bounds/sugar/navigation/helpers.js.map +0 -1
- package/lib/commonjs/shared/utils/bounds/sugar/navigation/index.js +0 -20
- package/lib/commonjs/shared/utils/bounds/sugar/navigation/index.js.map +0 -1
- package/lib/commonjs/shared/utils/bounds/sugar/navigation/types.js.map +0 -1
- package/lib/commonjs/shared/utils/bounds/sugar/navigation/zoom.js +0 -295
- package/lib/commonjs/shared/utils/bounds/sugar/navigation/zoom.js.map +0 -1
- package/lib/module/shared/components/overlay/variations/screen-overlay.js +0 -61
- package/lib/module/shared/components/overlay/variations/screen-overlay.js.map +0 -1
- package/lib/module/shared/providers/viewport.provider.js +0 -27
- package/lib/module/shared/providers/viewport.provider.js.map +0 -1
- package/lib/module/shared/utils/bounds/helpers/math.js +0 -115
- package/lib/module/shared/utils/bounds/helpers/math.js.map +0 -1
- package/lib/module/shared/utils/bounds/helpers/navigation-accessor.js +0 -40
- package/lib/module/shared/utils/bounds/helpers/navigation-accessor.js.map +0 -1
- package/lib/module/shared/utils/bounds/sugar/navigation/helpers.js +0 -54
- package/lib/module/shared/utils/bounds/sugar/navigation/helpers.js.map +0 -1
- package/lib/module/shared/utils/bounds/sugar/navigation/index.js +0 -15
- package/lib/module/shared/utils/bounds/sugar/navigation/index.js.map +0 -1
- package/lib/module/shared/utils/bounds/sugar/navigation/types.js.map +0 -1
- package/lib/module/shared/utils/bounds/sugar/navigation/zoom.js +0 -290
- package/lib/module/shared/utils/bounds/sugar/navigation/zoom.js.map +0 -1
- package/lib/typescript/shared/components/overlay/variations/screen-overlay.d.ts +0 -10
- package/lib/typescript/shared/components/overlay/variations/screen-overlay.d.ts.map +0 -1
- package/lib/typescript/shared/providers/viewport.provider.d.ts +0 -13
- package/lib/typescript/shared/providers/viewport.provider.d.ts.map +0 -1
- package/lib/typescript/shared/utils/bounds/helpers/math.d.ts +0 -38
- package/lib/typescript/shared/utils/bounds/helpers/math.d.ts.map +0 -1
- package/lib/typescript/shared/utils/bounds/helpers/navigation-accessor.d.ts +0 -16
- package/lib/typescript/shared/utils/bounds/helpers/navigation-accessor.d.ts.map +0 -1
- package/lib/typescript/shared/utils/bounds/sugar/navigation/helpers.d.ts +0 -17
- package/lib/typescript/shared/utils/bounds/sugar/navigation/helpers.d.ts.map +0 -1
- package/lib/typescript/shared/utils/bounds/sugar/navigation/index.d.ts +0 -3
- package/lib/typescript/shared/utils/bounds/sugar/navigation/index.d.ts.map +0 -1
- package/lib/typescript/shared/utils/bounds/sugar/navigation/types.d.ts +0 -18
- package/lib/typescript/shared/utils/bounds/sugar/navigation/types.d.ts.map +0 -1
- package/lib/typescript/shared/utils/bounds/sugar/navigation/zoom.d.ts +0 -4
- package/lib/typescript/shared/utils/bounds/sugar/navigation/zoom.d.ts.map +0 -1
- package/src/shared/components/overlay/variations/screen-overlay.tsx +0 -68
- package/src/shared/providers/viewport.provider.tsx +0 -39
- package/src/shared/utils/bounds/helpers/math.ts +0 -161
- package/src/shared/utils/bounds/helpers/navigation-accessor.ts +0 -61
- package/src/shared/utils/bounds/sugar/navigation/helpers.ts +0 -74
- package/src/shared/utils/bounds/sugar/navigation/index.ts +0 -14
- package/src/shared/utils/bounds/sugar/navigation/types.ts +0 -26
- package/src/shared/utils/bounds/sugar/navigation/zoom.ts +0 -348
- /package/lib/commonjs/shared/utils/bounds/{sugar/navigation → zoom}/types.js +0 -0
- /package/lib/module/shared/utils/bounds/{sugar/navigation → zoom}/types.js +0 -0
package/src/shared/index.ts
CHANGED
|
@@ -3,7 +3,6 @@ import {
|
|
|
3
3
|
Boundary,
|
|
4
4
|
createBoundaryComponent,
|
|
5
5
|
} from "./components/create-boundary-component";
|
|
6
|
-
import { buildBoundaryMatchKey } from "./components/create-boundary-component/utils/build-boundary-match-key";
|
|
7
6
|
import { createTransitionAwareComponent } from "./components/create-transition-aware-component";
|
|
8
7
|
import MaskedView from "./components/integrations/masked-view";
|
|
9
8
|
import { Presets, Specs } from "./configs";
|
|
@@ -26,36 +25,35 @@ export default {
|
|
|
26
25
|
};
|
|
27
26
|
|
|
28
27
|
export { snapTo } from "./animation/snap-to";
|
|
29
|
-
export {
|
|
28
|
+
export {
|
|
29
|
+
NAVIGATION_CONTAINER_STYLE_ID,
|
|
30
|
+
NAVIGATION_MASK_HOST_FLAG_STYLE_ID,
|
|
31
|
+
NAVIGATION_MASK_STYLE_ID,
|
|
32
|
+
} from "./constants";
|
|
33
|
+
export {
|
|
34
|
+
type ScreenGestureTarget,
|
|
35
|
+
useScreenGesture,
|
|
36
|
+
} from "./hooks/gestures/use-screen-gesture";
|
|
30
37
|
export { useHistory } from "./hooks/navigation/use-history";
|
|
31
38
|
export {
|
|
32
39
|
type ScreenState,
|
|
33
40
|
useScreenState,
|
|
34
41
|
} from "./hooks/navigation/use-screen-state";
|
|
35
|
-
export {
|
|
36
|
-
|
|
42
|
+
export {
|
|
43
|
+
type ScreenAnimationTarget,
|
|
44
|
+
useScreenAnimation,
|
|
45
|
+
} from "./providers/screen/animation";
|
|
37
46
|
|
|
38
47
|
export type {
|
|
39
48
|
AnimatedViewStyle,
|
|
40
49
|
AnimationConfig,
|
|
41
|
-
BoundEntry,
|
|
42
|
-
BoundsLink,
|
|
43
50
|
BoundsNavigationAccessor,
|
|
44
|
-
|
|
45
|
-
BoundsNavigationPreset,
|
|
46
|
-
BoundsStyleOptions,
|
|
47
|
-
LegacyTransitionInterpolatedStyle,
|
|
48
|
-
NewTransitionInterpolatedStyle,
|
|
49
|
-
NormalizedTransitionInterpolatedStyle,
|
|
50
|
-
NormalizedTransitionSlotStyle,
|
|
51
|
-
OverlayInterpolationProps,
|
|
52
|
-
OverlayMode,
|
|
51
|
+
BoundsNavigationZoomOptions,
|
|
53
52
|
OverlayProps,
|
|
54
53
|
ScreenInterpolationProps,
|
|
55
54
|
ScreenStyleInterpolator,
|
|
56
55
|
ScreenTransitionConfig,
|
|
57
56
|
TransitionInterpolatedStyle,
|
|
58
|
-
TransitionSlotExplicit,
|
|
59
57
|
TransitionSlotStyle,
|
|
60
58
|
TransitionSpec,
|
|
61
59
|
} from "./types";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { useMemo } from "react";
|
|
2
|
+
import { useWindowDimensions } from "react-native";
|
|
2
3
|
import type {
|
|
3
4
|
GestureStateChangeEvent,
|
|
4
5
|
GestureTouchEvent,
|
|
@@ -32,8 +33,8 @@ import type {
|
|
|
32
33
|
} from "../../../types/ownership.types";
|
|
33
34
|
import { animateToProgress } from "../../../utils/animation/animate-to-progress";
|
|
34
35
|
import type { EffectiveSnapPointsResult } from "../../../utils/gesture/validate-snap-points";
|
|
36
|
+
import { resolveSheetScrollGestureBehavior } from "../../../utils/resolve-screen-transition-options";
|
|
35
37
|
import { useDescriptors } from "../../screen/descriptors";
|
|
36
|
-
import { useViewportContext } from "../../viewport.provider";
|
|
37
38
|
import {
|
|
38
39
|
applyOffsetRules,
|
|
39
40
|
checkScrollBoundary,
|
|
@@ -53,6 +54,10 @@ import {
|
|
|
53
54
|
normalizeVelocity,
|
|
54
55
|
} from "../helpers/gesture-physics";
|
|
55
56
|
import { resetGestureValues } from "../helpers/gesture-reset";
|
|
57
|
+
import {
|
|
58
|
+
findNearestSnapPoint,
|
|
59
|
+
resolveRuntimeSnapPoints,
|
|
60
|
+
} from "../helpers/gesture-snap-points";
|
|
56
61
|
import {
|
|
57
62
|
determineDismissal,
|
|
58
63
|
determineSnapTarget,
|
|
@@ -95,7 +100,7 @@ interface UseScreenGestureHandlersProps {
|
|
|
95
100
|
* - No → continue
|
|
96
101
|
* 5. OFFSET THRESHOLD: Wait for sufficient touch movement
|
|
97
102
|
* 6. SCROLLVIEW CHECK: If touch is on ScrollView, is it at boundary?
|
|
98
|
-
* 7. EXPAND CHECK (snap sheets): If expanding
|
|
103
|
+
* 7. EXPAND CHECK (snap sheets): If expanding from nested scroll content, does sheetScrollGestureBehavior allow it?
|
|
99
104
|
* 8. ACTIVATE!
|
|
100
105
|
* ```
|
|
101
106
|
*
|
|
@@ -140,21 +145,31 @@ export const useHandlers = ({
|
|
|
140
145
|
gestureReleaseVelocityMax = DEFAULT_GESTURE_RELEASE_VELOCITY_MAX,
|
|
141
146
|
gestureActivationArea = DEFAULT_GESTURE_ACTIVATION_AREA,
|
|
142
147
|
gestureSnapLocked = DEFAULT_GESTURE_SNAP_LOCKED,
|
|
143
|
-
expandViaScrollView = true,
|
|
144
148
|
gestureResponseDistance,
|
|
145
149
|
transitionSpec,
|
|
146
150
|
} = current.options;
|
|
151
|
+
const sheetScrollGestureBehavior = resolveSheetScrollGestureBehavior(
|
|
152
|
+
current.options,
|
|
153
|
+
);
|
|
147
154
|
|
|
148
|
-
const
|
|
155
|
+
const dimensions = useWindowDimensions();
|
|
149
156
|
const routeKey = current.route.key;
|
|
150
|
-
const animations = AnimationStore.getRouteAnimations(
|
|
151
|
-
const gestureAnimationValues = GestureStore.getRouteGestures(
|
|
152
|
-
|
|
157
|
+
const animations = AnimationStore.getRouteAnimations(routeKey);
|
|
158
|
+
const gestureAnimationValues = GestureStore.getRouteGestures(routeKey);
|
|
159
|
+
const {
|
|
160
|
+
hasSnapPoints,
|
|
161
|
+
hasAutoSnapPoint,
|
|
162
|
+
snapPoints,
|
|
163
|
+
minSnapPoint,
|
|
164
|
+
maxSnapPoint,
|
|
165
|
+
} = effectiveSnapPoints;
|
|
166
|
+
|
|
167
|
+
// Read the measured "auto" snap point reactively inside worklets.
|
|
168
|
+
const autoSnapPointValue = AnimationStore.getAnimation(
|
|
169
|
+
routeKey,
|
|
170
|
+
"autoSnapPoint",
|
|
153
171
|
);
|
|
154
172
|
|
|
155
|
-
const { hasSnapPoints, snapPoints, minSnapPoint, maxSnapPoint } =
|
|
156
|
-
effectiveSnapPoints;
|
|
157
|
-
|
|
158
173
|
const directions = useMemo(() => {
|
|
159
174
|
warnOnSnapDirectionArray({ gestureDirection, hasSnapPoints });
|
|
160
175
|
return resolveGestureDirections({ gestureDirection, hasSnapPoints });
|
|
@@ -284,14 +299,22 @@ export const useHandlers = ({
|
|
|
284
299
|
directions.snapAxisInverted ?? false,
|
|
285
300
|
)
|
|
286
301
|
) {
|
|
287
|
-
if (
|
|
302
|
+
if (sheetScrollGestureBehavior === "collapse-only") {
|
|
288
303
|
manager.fail();
|
|
289
304
|
return;
|
|
290
305
|
}
|
|
291
306
|
|
|
307
|
+
const { resolvedMaxSnapPoint } = resolveRuntimeSnapPoints({
|
|
308
|
+
snapPoints,
|
|
309
|
+
hasAutoSnapPoint,
|
|
310
|
+
autoSnapPoint: autoSnapPointValue.value,
|
|
311
|
+
minSnapPoint,
|
|
312
|
+
maxSnapPoint,
|
|
313
|
+
canDismiss,
|
|
314
|
+
});
|
|
292
315
|
const effectiveMaxSnapPoint = gestureSnapLocked
|
|
293
316
|
? lockedSnapPoint.value
|
|
294
|
-
:
|
|
317
|
+
: resolvedMaxSnapPoint;
|
|
295
318
|
|
|
296
319
|
const canExpandMore =
|
|
297
320
|
animations.progress.value < effectiveMaxSnapPoint - EPSILON &&
|
|
@@ -312,22 +335,23 @@ export const useHandlers = ({
|
|
|
312
335
|
|
|
313
336
|
const onStart = useStableCallbackValue(() => {
|
|
314
337
|
"worklet";
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
nearest = point;
|
|
325
|
-
}
|
|
326
|
-
}
|
|
338
|
+
const { resolvedSnapPoints, resolvedMaxSnapPoint } =
|
|
339
|
+
resolveRuntimeSnapPoints({
|
|
340
|
+
snapPoints,
|
|
341
|
+
hasAutoSnapPoint,
|
|
342
|
+
autoSnapPoint: autoSnapPointValue.value,
|
|
343
|
+
minSnapPoint,
|
|
344
|
+
maxSnapPoint,
|
|
345
|
+
canDismiss,
|
|
346
|
+
});
|
|
327
347
|
|
|
328
|
-
|
|
348
|
+
if (hasSnapPoints && gestureSnapLocked) {
|
|
349
|
+
lockedSnapPoint.value = findNearestSnapPoint(
|
|
350
|
+
animations.progress.value,
|
|
351
|
+
resolvedSnapPoints,
|
|
352
|
+
);
|
|
329
353
|
} else {
|
|
330
|
-
lockedSnapPoint.value =
|
|
354
|
+
lockedSnapPoint.value = resolvedMaxSnapPoint;
|
|
331
355
|
}
|
|
332
356
|
|
|
333
357
|
gestureAnimationValues.dragging.value = TRUE;
|
|
@@ -363,14 +387,25 @@ export const useHandlers = ({
|
|
|
363
387
|
const baseSign = -1;
|
|
364
388
|
const sign = directions.snapAxisInverted ? -baseSign : baseSign;
|
|
365
389
|
const progressDelta = (sign * translation) / dimension;
|
|
390
|
+
|
|
391
|
+
const { resolvedMinSnapPoint, resolvedMaxSnapPoint } =
|
|
392
|
+
resolveRuntimeSnapPoints({
|
|
393
|
+
snapPoints,
|
|
394
|
+
hasAutoSnapPoint,
|
|
395
|
+
autoSnapPoint: autoSnapPointValue.value,
|
|
396
|
+
minSnapPoint,
|
|
397
|
+
maxSnapPoint,
|
|
398
|
+
canDismiss,
|
|
399
|
+
});
|
|
400
|
+
|
|
366
401
|
const maxProgressForGesture = gestureSnapLocked
|
|
367
402
|
? lockedSnapPoint.value
|
|
368
|
-
:
|
|
403
|
+
: resolvedMaxSnapPoint;
|
|
369
404
|
const minProgressForGesture = gestureSnapLocked
|
|
370
405
|
? canDismiss
|
|
371
406
|
? 0
|
|
372
407
|
: lockedSnapPoint.value
|
|
373
|
-
:
|
|
408
|
+
: resolvedMinSnapPoint;
|
|
374
409
|
|
|
375
410
|
animations.progress.value = Math.max(
|
|
376
411
|
minProgressForGesture,
|
|
@@ -430,9 +465,20 @@ export const useHandlers = ({
|
|
|
430
465
|
? -axisVelocity
|
|
431
466
|
: axisVelocity;
|
|
432
467
|
|
|
468
|
+
const { resolvedSnapPoints } = resolveRuntimeSnapPoints({
|
|
469
|
+
snapPoints,
|
|
470
|
+
hasAutoSnapPoint,
|
|
471
|
+
autoSnapPoint: autoSnapPointValue.value,
|
|
472
|
+
minSnapPoint,
|
|
473
|
+
maxSnapPoint,
|
|
474
|
+
canDismiss,
|
|
475
|
+
});
|
|
476
|
+
|
|
433
477
|
const result = determineSnapTarget({
|
|
434
478
|
currentProgress: animations.progress.value,
|
|
435
|
-
snapPoints: gestureSnapLocked
|
|
479
|
+
snapPoints: gestureSnapLocked
|
|
480
|
+
? [lockedSnapPoint.value]
|
|
481
|
+
: resolvedSnapPoints,
|
|
436
482
|
velocity: snapVelocity,
|
|
437
483
|
dimension: axisDimension,
|
|
438
484
|
velocityFactor: snapVelocityImpact,
|
|
@@ -67,6 +67,7 @@ const GESTURE_FAIL_TOLERANCE_Y = 20;
|
|
|
67
67
|
const DEFAULT_EDGE_DISTANCE_HORIZONTAL = 50;
|
|
68
68
|
const DEFAULT_EDGE_DISTANCE_VERTICAL = 135;
|
|
69
69
|
const DEFAULT_ACTIVATION_AREA = "screen" as const;
|
|
70
|
+
const SCROLL_EPILSON = 1;
|
|
70
71
|
|
|
71
72
|
export function normalizeSides(area?: GestureActivationArea): NormalizedSides {
|
|
72
73
|
"worklet";
|
|
@@ -352,6 +353,10 @@ export function checkScrollBoundary(
|
|
|
352
353
|
// Calculate max scroll values
|
|
353
354
|
const maxScrollX = Math.max(0, contentWidth - layoutWidth);
|
|
354
355
|
const maxScrollY = Math.max(0, contentHeight - layoutHeight);
|
|
356
|
+
const atTop = scrollY <= SCROLL_EPILSON;
|
|
357
|
+
const atBottom = scrollY >= maxScrollY - SCROLL_EPILSON;
|
|
358
|
+
const atLeft = scrollX <= SCROLL_EPILSON;
|
|
359
|
+
const atRight = scrollX >= maxScrollX - SCROLL_EPILSON;
|
|
355
360
|
|
|
356
361
|
// For snap point sheets (snapAxisInverted is defined), boundary depends on sheet origin
|
|
357
362
|
// Even if content isn't scrollable, respect bounce/overscroll state
|
|
@@ -362,12 +367,12 @@ export function checkScrollBoundary(
|
|
|
362
367
|
if (isVerticalDirection) {
|
|
363
368
|
// Bottom sheet (not inverted): boundary at scroll top
|
|
364
369
|
// Top sheet (inverted): boundary at scroll bottom
|
|
365
|
-
return snapAxisInverted ?
|
|
370
|
+
return snapAxisInverted ? atBottom : atTop;
|
|
366
371
|
}
|
|
367
372
|
// Horizontal direction
|
|
368
373
|
// Right drawer (not inverted): boundary at scroll left
|
|
369
374
|
// Left drawer (inverted): boundary at scroll right
|
|
370
|
-
return snapAxisInverted ?
|
|
375
|
+
return snapAxisInverted ? atRight : atLeft;
|
|
371
376
|
}
|
|
372
377
|
|
|
373
378
|
// Non-sheet screens: each direction has its own boundary
|
|
@@ -375,22 +380,22 @@ export function checkScrollBoundary(
|
|
|
375
380
|
case "vertical":
|
|
376
381
|
// Swipe down - check if at top of vertical scroll
|
|
377
382
|
// Even if content isn't scrollable, respect bounce/overscroll state
|
|
378
|
-
return
|
|
383
|
+
return atTop;
|
|
379
384
|
|
|
380
385
|
case "vertical-inverted":
|
|
381
386
|
// Swipe up - check if at bottom of vertical scroll
|
|
382
387
|
// Even if content isn't scrollable, respect bounce/overscroll state
|
|
383
|
-
return
|
|
388
|
+
return atBottom;
|
|
384
389
|
|
|
385
390
|
case "horizontal":
|
|
386
391
|
// Swipe right - check if at left of horizontal scroll
|
|
387
392
|
// Even if content isn't scrollable, respect bounce/overscroll state
|
|
388
|
-
return
|
|
393
|
+
return atLeft;
|
|
389
394
|
|
|
390
395
|
case "horizontal-inverted":
|
|
391
396
|
// Swipe left - check if at right of horizontal scroll
|
|
392
397
|
// Even if content isn't scrollable, respect bounce/overscroll state
|
|
393
|
-
return
|
|
398
|
+
return atRight;
|
|
394
399
|
|
|
395
400
|
default:
|
|
396
401
|
return true;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
interface ResolveRuntimeSnapPointsProps {
|
|
2
|
+
snapPoints: number[];
|
|
3
|
+
hasAutoSnapPoint: boolean;
|
|
4
|
+
autoSnapPoint: number;
|
|
5
|
+
minSnapPoint: number;
|
|
6
|
+
maxSnapPoint: number;
|
|
7
|
+
canDismiss: boolean;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
interface ResolvedRuntimeSnapPointsResult {
|
|
11
|
+
resolvedAutoSnapPoint: number | null;
|
|
12
|
+
resolvedSnapPoints: number[];
|
|
13
|
+
resolvedMinSnapPoint: number;
|
|
14
|
+
resolvedMaxSnapPoint: number;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const resolveRuntimeSnapPoints = ({
|
|
18
|
+
snapPoints,
|
|
19
|
+
hasAutoSnapPoint,
|
|
20
|
+
autoSnapPoint,
|
|
21
|
+
minSnapPoint,
|
|
22
|
+
maxSnapPoint,
|
|
23
|
+
canDismiss,
|
|
24
|
+
}: ResolveRuntimeSnapPointsProps): ResolvedRuntimeSnapPointsResult => {
|
|
25
|
+
"worklet";
|
|
26
|
+
|
|
27
|
+
const resolvedAutoSnapPoint =
|
|
28
|
+
hasAutoSnapPoint && autoSnapPoint > 0 ? autoSnapPoint : null;
|
|
29
|
+
|
|
30
|
+
const resolvedSnapPoints =
|
|
31
|
+
resolvedAutoSnapPoint === null
|
|
32
|
+
? snapPoints
|
|
33
|
+
: [...snapPoints, resolvedAutoSnapPoint].sort((a, b) => a - b);
|
|
34
|
+
|
|
35
|
+
const resolvedMinSnapPoint =
|
|
36
|
+
resolvedAutoSnapPoint !== null && !canDismiss
|
|
37
|
+
? Math.min(
|
|
38
|
+
minSnapPoint === -1 ? resolvedAutoSnapPoint : minSnapPoint,
|
|
39
|
+
resolvedAutoSnapPoint,
|
|
40
|
+
)
|
|
41
|
+
: minSnapPoint;
|
|
42
|
+
|
|
43
|
+
return {
|
|
44
|
+
resolvedAutoSnapPoint,
|
|
45
|
+
resolvedSnapPoints,
|
|
46
|
+
resolvedMinSnapPoint,
|
|
47
|
+
resolvedMaxSnapPoint:
|
|
48
|
+
resolvedSnapPoints[resolvedSnapPoints.length - 1] ?? maxSnapPoint,
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export const findNearestSnapPoint = (
|
|
53
|
+
progress: number,
|
|
54
|
+
snapPoints: number[],
|
|
55
|
+
): number => {
|
|
56
|
+
"worklet";
|
|
57
|
+
|
|
58
|
+
let nearest = snapPoints[0] ?? progress;
|
|
59
|
+
let smallestDistance = Math.abs(progress - nearest);
|
|
60
|
+
|
|
61
|
+
for (let i = 1; i < snapPoints.length; i++) {
|
|
62
|
+
const point = snapPoints[i];
|
|
63
|
+
const distance = Math.abs(progress - point);
|
|
64
|
+
|
|
65
|
+
if (distance < smallestDistance) {
|
|
66
|
+
smallestDistance = distance;
|
|
67
|
+
nearest = point;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
return nearest;
|
|
72
|
+
};
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { type ReactNode, useCallback, useMemo } from "react";
|
|
2
|
-
import type
|
|
2
|
+
import { useWindowDimensions, type View } from "react-native";
|
|
3
3
|
import {
|
|
4
4
|
type AnimatedRef,
|
|
5
5
|
type MeasuredDimensions,
|
|
6
6
|
measure,
|
|
7
7
|
} from "react-native-reanimated";
|
|
8
8
|
import createProvider from "../utils/create-provider";
|
|
9
|
-
import { useViewportContext } from "./viewport.provider";
|
|
10
9
|
|
|
11
10
|
interface LayoutAnchorProviderProps {
|
|
12
11
|
anchorRef: AnimatedRef<View>;
|
|
@@ -48,9 +47,7 @@ const { LayoutAnchorProvider, useLayoutAnchorContext } = createProvider(
|
|
|
48
47
|
{ guarded: false },
|
|
49
48
|
)<LayoutAnchorProviderProps, LayoutAnchorContextValue>(
|
|
50
49
|
({ anchorRef, children }) => {
|
|
51
|
-
const {
|
|
52
|
-
dimensions: { width: screenWidth, height: screenHeight },
|
|
53
|
-
} = useViewportContext();
|
|
50
|
+
const { width: screenWidth, height: screenHeight } = useWindowDimensions();
|
|
54
51
|
|
|
55
52
|
const correctMeasurement = useCallback(
|
|
56
53
|
(measured: MeasuredDimensions): MeasuredDimensions => {
|
|
@@ -207,7 +207,7 @@ const useParentSyncReaction = (params: {
|
|
|
207
207
|
const CloseRemeasureReactionEffect = (params: {
|
|
208
208
|
sharedBoundTag: string;
|
|
209
209
|
remeasureOnFocus: boolean;
|
|
210
|
-
nextClosing:
|
|
210
|
+
nextClosing: SharedValue<number>;
|
|
211
211
|
maybeMeasureAndStore: (options: MaybeMeasureAndStoreParams) => void;
|
|
212
212
|
}) => {
|
|
213
213
|
const {
|
|
@@ -1,23 +1,26 @@
|
|
|
1
|
-
import { type ReactNode, useMemo } from "react";
|
|
1
|
+
import { createContext, type ReactNode, useContext, useMemo } from "react";
|
|
2
2
|
import { type DerivedValue, useDerivedValue } from "react-native-reanimated";
|
|
3
3
|
import type { ScreenInterpolationProps } from "../../../types/animation.types";
|
|
4
|
-
import createProvider from "../../../utils/create-provider";
|
|
5
4
|
import { useScreenAnimationPipeline } from "./helpers/pipeline";
|
|
6
5
|
|
|
7
6
|
type Props = {
|
|
8
7
|
children: ReactNode;
|
|
9
8
|
};
|
|
10
9
|
|
|
11
|
-
type ScreenAnimationContextValue = ReturnType<
|
|
10
|
+
export type ScreenAnimationContextValue = ReturnType<
|
|
12
11
|
typeof useScreenAnimationPipeline
|
|
13
12
|
> & {
|
|
14
13
|
screenAnimation: DerivedValue<ScreenInterpolationProps>;
|
|
14
|
+
ancestorScreenAnimations: DerivedValue<ScreenInterpolationProps>[];
|
|
15
15
|
};
|
|
16
16
|
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
const ScreenAnimationContext =
|
|
18
|
+
createContext<ScreenAnimationContextValue | null>(null);
|
|
19
|
+
ScreenAnimationContext.displayName = "ScreenAnimation";
|
|
20
|
+
|
|
21
|
+
function ScreenAnimationProvider({ children }: Props) {
|
|
22
|
+
const parentContext = useContext(ScreenAnimationContext);
|
|
23
|
+
|
|
21
24
|
const {
|
|
22
25
|
screenInterpolatorProps,
|
|
23
26
|
nextInterpolator,
|
|
@@ -34,6 +37,17 @@ const { ScreenAnimationProvider, useScreenAnimationContext } = createProvider(
|
|
|
34
37
|
};
|
|
35
38
|
});
|
|
36
39
|
|
|
40
|
+
const ancestorScreenAnimations = useMemo(() => {
|
|
41
|
+
if (!parentContext) {
|
|
42
|
+
return [];
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return [
|
|
46
|
+
parentContext.screenAnimation,
|
|
47
|
+
...parentContext.ancestorScreenAnimations,
|
|
48
|
+
];
|
|
49
|
+
}, [parentContext]);
|
|
50
|
+
|
|
37
51
|
const value = useMemo(
|
|
38
52
|
() => ({
|
|
39
53
|
screenInterpolatorProps,
|
|
@@ -41,6 +55,7 @@ const { ScreenAnimationProvider, useScreenAnimationContext } = createProvider(
|
|
|
41
55
|
currentInterpolator,
|
|
42
56
|
boundsAccessor,
|
|
43
57
|
screenAnimation,
|
|
58
|
+
ancestorScreenAnimations,
|
|
44
59
|
}),
|
|
45
60
|
[
|
|
46
61
|
screenInterpolatorProps,
|
|
@@ -48,10 +63,31 @@ const { ScreenAnimationProvider, useScreenAnimationContext } = createProvider(
|
|
|
48
63
|
currentInterpolator,
|
|
49
64
|
boundsAccessor,
|
|
50
65
|
screenAnimation,
|
|
66
|
+
ancestorScreenAnimations,
|
|
51
67
|
],
|
|
52
68
|
);
|
|
53
69
|
|
|
54
|
-
return
|
|
55
|
-
}
|
|
70
|
+
return (
|
|
71
|
+
<ScreenAnimationContext.Provider value={value}>
|
|
72
|
+
{children}
|
|
73
|
+
</ScreenAnimationContext.Provider>
|
|
74
|
+
);
|
|
75
|
+
}
|
|
56
76
|
|
|
57
|
-
|
|
77
|
+
function useScreenAnimationContext(): ScreenAnimationContextValue {
|
|
78
|
+
const context = useContext(ScreenAnimationContext);
|
|
79
|
+
|
|
80
|
+
if (!context) {
|
|
81
|
+
throw new Error(
|
|
82
|
+
"ScreenAnimation context must be used within a ScreenAnimationProvider",
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
return context;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export {
|
|
90
|
+
ScreenAnimationContext,
|
|
91
|
+
ScreenAnimationProvider,
|
|
92
|
+
useScreenAnimationContext,
|
|
93
|
+
};
|
|
@@ -24,18 +24,10 @@ export const derivations = ({ previous, current, next }: DerivationsParams) => {
|
|
|
24
24
|
// The screen NOT driving the transition
|
|
25
25
|
const inactive = focused ? previous : current;
|
|
26
26
|
|
|
27
|
-
// deprecated
|
|
28
|
-
const isActiveTransitioning = !!(active.gesture.dragging || active.animating);
|
|
29
|
-
|
|
30
|
-
// deprecated
|
|
31
|
-
const isDismissing = !!(active.gesture.dismissing || active.closing);
|
|
32
|
-
|
|
33
27
|
return {
|
|
34
28
|
progress,
|
|
35
29
|
focused,
|
|
36
30
|
active,
|
|
37
31
|
inactive,
|
|
38
|
-
isActiveTransitioning,
|
|
39
|
-
isDismissing,
|
|
40
32
|
};
|
|
41
33
|
};
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { useMemo } from "react";
|
|
2
|
+
import { useWindowDimensions } from "react-native";
|
|
2
3
|
import {
|
|
3
4
|
type DerivedValue,
|
|
4
5
|
type SharedValue,
|
|
5
6
|
useDerivedValue,
|
|
6
7
|
useSharedValue,
|
|
7
8
|
} from "react-native-reanimated";
|
|
9
|
+
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
8
10
|
import type { NativeStackScreenTransitionConfig } from "../../../../../native-stack/types";
|
|
9
11
|
import {
|
|
10
12
|
createScreenTransitionState,
|
|
@@ -25,7 +27,8 @@ import type { BoundsAccessor } from "../../../../types/bounds.types";
|
|
|
25
27
|
import type { ScreenTransitionConfig } from "../../../../types/screen.types";
|
|
26
28
|
import type { BaseStackRoute } from "../../../../types/stack.types";
|
|
27
29
|
import { createBoundsAccessor } from "../../../../utils/bounds";
|
|
28
|
-
import {
|
|
30
|
+
import type { BoundsFrameProps } from "../../../../utils/bounds/types/frame-props";
|
|
31
|
+
import { resolveNavigationMaskEnabled } from "../../../../utils/resolve-screen-transition-options";
|
|
29
32
|
import { type BaseDescriptor, useDescriptors } from "../../descriptors";
|
|
30
33
|
import { derivations } from "./derivations";
|
|
31
34
|
import { toPlainRoute, toPlainValue } from "./worklet";
|
|
@@ -153,7 +156,8 @@ const hasTransitionsEnabled = (
|
|
|
153
156
|
|
|
154
157
|
export function useScreenAnimationPipeline(): ScreenAnimationPipeline {
|
|
155
158
|
const { flags, stackProgress: rootStackProgress, routeKeys } = useStack();
|
|
156
|
-
const
|
|
159
|
+
const dimensions = useWindowDimensions();
|
|
160
|
+
const insets = useSafeAreaInsets();
|
|
157
161
|
const transitionsAlwaysOn = flags.TRANSITIONS_ALWAYS_ON;
|
|
158
162
|
|
|
159
163
|
const {
|
|
@@ -175,19 +179,37 @@ export function useScreenAnimationPipeline(): ScreenAnimationPipeline {
|
|
|
175
179
|
const currentRouteKey = currentDescriptor?.route?.key;
|
|
176
180
|
const currentIndex = routeKeys.indexOf(currentRouteKey);
|
|
177
181
|
|
|
178
|
-
const
|
|
182
|
+
const sortedNumericSnapPoints = useMemo(() => {
|
|
179
183
|
const points = currentDescriptor?.options?.snapPoints;
|
|
180
|
-
|
|
184
|
+
if (!points) return [];
|
|
185
|
+
return points
|
|
186
|
+
.filter((p): p is number => typeof p === "number")
|
|
187
|
+
.sort((a, b) => a - b);
|
|
181
188
|
}, [currentDescriptor?.options?.snapPoints]);
|
|
182
189
|
|
|
190
|
+
const hasAutoSnapPoint = useMemo(
|
|
191
|
+
() => currentDescriptor?.options?.snapPoints?.includes("auto") ?? false,
|
|
192
|
+
[currentDescriptor?.options?.snapPoints],
|
|
193
|
+
);
|
|
194
|
+
|
|
195
|
+
const autoSnapPointValue = AnimationStore.getAnimation(
|
|
196
|
+
currentRouteKey ?? "_",
|
|
197
|
+
"autoSnapPoint",
|
|
198
|
+
);
|
|
199
|
+
const contentLayoutValue = AnimationStore.getAnimation(
|
|
200
|
+
currentRouteKey ?? "_",
|
|
201
|
+
"contentLayout",
|
|
202
|
+
);
|
|
203
|
+
|
|
183
204
|
const nextRouteKey = nextDescriptor?.route?.key;
|
|
184
205
|
const nextHasTransitions =
|
|
185
206
|
!!nextRouteKey &&
|
|
186
207
|
hasTransitionsEnabled(nextDescriptor?.options, transitionsAlwaysOn);
|
|
208
|
+
const currentNavigationMaskEnabled = resolveNavigationMaskEnabled(
|
|
209
|
+
currentDescriptor?.options ?? {},
|
|
210
|
+
);
|
|
187
211
|
|
|
188
|
-
const framePropsMutable = useSharedValue<
|
|
189
|
-
Omit<ScreenInterpolationProps, "bounds">
|
|
190
|
-
>({
|
|
212
|
+
const framePropsMutable = useSharedValue<BoundsFrameProps>({
|
|
191
213
|
layouts: { screen: dimensions },
|
|
192
214
|
insets,
|
|
193
215
|
previous: undefined,
|
|
@@ -196,11 +218,10 @@ export function useScreenAnimationPipeline(): ScreenAnimationPipeline {
|
|
|
196
218
|
progress: 0,
|
|
197
219
|
stackProgress: 0,
|
|
198
220
|
snapIndex: -1,
|
|
221
|
+
navigationMaskEnabled: false,
|
|
199
222
|
focused: true,
|
|
200
223
|
active: DEFAULT_SCREEN_TRANSITION_STATE,
|
|
201
224
|
inactive: undefined,
|
|
202
|
-
isActiveTransitioning: false,
|
|
203
|
-
isDismissing: false,
|
|
204
225
|
});
|
|
205
226
|
|
|
206
227
|
const boundsAccessor = useMemo(() => {
|
|
@@ -238,10 +259,23 @@ export function useScreenAnimationPipeline(): ScreenAnimationPipeline {
|
|
|
238
259
|
const stackProgress =
|
|
239
260
|
currentIndex >= 0 ? rootStackProgress.value - currentIndex : progress;
|
|
240
261
|
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
262
|
+
// Resolve 'auto' snap point reactively so computeSnapIndex stays accurate
|
|
263
|
+
const resolvedAutoSnap =
|
|
264
|
+
hasAutoSnapPoint && autoSnapPointValue.value > 0
|
|
265
|
+
? autoSnapPointValue.value
|
|
266
|
+
: null;
|
|
267
|
+
const resolvedSnapPoints =
|
|
268
|
+
resolvedAutoSnap !== null
|
|
269
|
+
? [...sortedNumericSnapPoints, resolvedAutoSnap].sort((a, b) => a - b)
|
|
270
|
+
: sortedNumericSnapPoints;
|
|
271
|
+
|
|
272
|
+
const snapIndex = computeSnapIndex(current.progress, resolvedSnapPoints);
|
|
273
|
+
|
|
274
|
+
const nextProps: Omit<ScreenInterpolationProps, "bounds"> = {
|
|
275
|
+
layouts: {
|
|
276
|
+
screen: dimensions,
|
|
277
|
+
content: contentLayoutValue.value ?? undefined,
|
|
278
|
+
},
|
|
245
279
|
insets,
|
|
246
280
|
previous,
|
|
247
281
|
current,
|
|
@@ -252,7 +286,10 @@ export function useScreenAnimationPipeline(): ScreenAnimationPipeline {
|
|
|
252
286
|
...helpers,
|
|
253
287
|
};
|
|
254
288
|
|
|
255
|
-
framePropsMutable.value =
|
|
289
|
+
framePropsMutable.value = {
|
|
290
|
+
...nextProps,
|
|
291
|
+
navigationMaskEnabled: currentNavigationMaskEnabled,
|
|
292
|
+
};
|
|
256
293
|
return nextProps;
|
|
257
294
|
});
|
|
258
295
|
|