react-native-screen-transitions 3.4.0-alpha.0 → 3.4.0-alpha.1
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 +65 -2
- 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/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/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/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 +47 -55
- 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 +77 -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 +55 -18
- package/lib/commonjs/shared/providers/gestures/handlers/use-handlers.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/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 +11 -6
- 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/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 +8 -2
- package/lib/commonjs/shared/stores/animation.store.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 +24 -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 +6 -5
- 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 +3 -3
- package/lib/commonjs/shared/utils/bounds/index.js.map +1 -1
- 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 +541 -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/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/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/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/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 +52 -60
- 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 +72 -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 +55 -18
- package/lib/module/shared/providers/gestures/handlers/use-handlers.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/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 +11 -6
- 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/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 +8 -2
- package/lib/module/shared/stores/animation.store.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 +24 -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 +6 -5
- 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 +3 -3
- package/lib/module/shared/utils/bounds/index.js.map +1 -1
- 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 +536 -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/typescript/shared/animation/snap-to.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/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/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 +7 -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 -17
- package/lib/typescript/shared/index.d.ts.map +1 -1
- package/lib/typescript/shared/providers/gestures/handlers/use-handlers.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/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/direct.provider.d.ts.map +1 -1
- package/lib/typescript/shared/stores/animation.store.d.ts +4 -0
- package/lib/typescript/shared/stores/animation.store.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 +26 -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 +16 -15
- 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.map +1 -1
- 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/package.json +2 -2
- package/src/shared/animation/snap-to.ts +12 -1
- package/src/shared/components/create-boundary-component/utils/build-boundary-match-key.ts +2 -14
- 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/layers/backdrop.tsx +25 -6
- package/src/shared/components/screen-container/layers/content.tsx +80 -77
- package/src/shared/components/screen-container/layers/maybe-masked-navigation-container.tsx +93 -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 +67 -24
- package/src/shared/providers/gestures/helpers/gesture-snap-points.ts +72 -0
- 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 +26 -5
- 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/direct.provider.tsx +2 -5
- package/src/shared/providers/stack/helpers/use-processed-routes.ts +2 -2
- package/src/shared/stores/animation.store.ts +13 -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 +25 -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 +17 -16
- 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 +34 -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 +9 -6
- package/src/shared/utils/bounds/helpers/style-composers.ts +4 -3
- package/src/shared/utils/bounds/index.ts +6 -8
- 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 +705 -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/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/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/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/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/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
|
@@ -10,17 +10,6 @@ import type { GestureValues } from "./gesture.types";
|
|
|
10
10
|
import type { Layout } from "./screen.types";
|
|
11
11
|
import type { BaseStackRoute } from "./stack.types";
|
|
12
12
|
|
|
13
|
-
export interface OverlayInterpolationProps {
|
|
14
|
-
progress: number;
|
|
15
|
-
layouts: {
|
|
16
|
-
/**
|
|
17
|
-
* The `width` and `height` of the screen container.
|
|
18
|
-
*/
|
|
19
|
-
screen: Layout;
|
|
20
|
-
};
|
|
21
|
-
insets: EdgeInsets;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
13
|
export type ScreenTransitionState = {
|
|
25
14
|
/**
|
|
26
15
|
* Animation progress for this screen.
|
|
@@ -42,11 +31,11 @@ export type ScreenTransitionState = {
|
|
|
42
31
|
closing: number;
|
|
43
32
|
|
|
44
33
|
/**
|
|
45
|
-
* Whether this screen is in
|
|
46
|
-
* - `0`: Screen is
|
|
47
|
-
* - `1`: Screen is opening/entering
|
|
34
|
+
* Whether this screen is actively in its opening phase.
|
|
35
|
+
* - `0`: Screen is settled, inactive, or closing
|
|
36
|
+
* - `1`: Screen is currently opening/entering
|
|
48
37
|
*
|
|
49
|
-
*
|
|
38
|
+
* This flips back to `0` once the open animation finishes.
|
|
50
39
|
*/
|
|
51
40
|
entering: number;
|
|
52
41
|
|
|
@@ -169,18 +158,6 @@ export interface ScreenInterpolationProps {
|
|
|
169
158
|
* When focused, this is the previous screen. When not focused, this is the current screen.
|
|
170
159
|
*/
|
|
171
160
|
inactive: ScreenTransitionState | undefined;
|
|
172
|
-
|
|
173
|
-
/**
|
|
174
|
-
* Whether the active screen is currently transitioning (either being dragged or animating).
|
|
175
|
-
* @deprecated Use `active.animating` instead.
|
|
176
|
-
*/
|
|
177
|
-
isActiveTransitioning: boolean;
|
|
178
|
-
|
|
179
|
-
/**
|
|
180
|
-
* Whether the active screen is in the process of being dismissed/closed.
|
|
181
|
-
* @deprecated Use `active.closing` instead.
|
|
182
|
-
*/
|
|
183
|
-
isDismissing: boolean;
|
|
184
161
|
}
|
|
185
162
|
|
|
186
163
|
export type ScreenStyleInterpolator = (
|
|
@@ -195,17 +172,11 @@ export type ScreenStyleInterpolator = (
|
|
|
195
172
|
*/
|
|
196
173
|
export type AnimatedViewStyle = ViewStyle & TextStyle;
|
|
197
174
|
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
*
|
|
201
|
-
* - `style` is applied via `useAnimatedStyle` (transform, opacity, backgroundColor, etc.)
|
|
202
|
-
* - `props` is applied via `useAnimatedProps` (component-specific props like BlurView intensity)
|
|
203
|
-
*/
|
|
204
|
-
export type TransitionSlotExplicit = {
|
|
205
|
-
/** Animated styles applied via useAnimatedStyle. */
|
|
175
|
+
type TransitionSlotDefinition = {
|
|
176
|
+
/** Animated styles applied via `useAnimatedStyle`. */
|
|
206
177
|
style?: AnimatedViewStyle;
|
|
207
|
-
/** Animated props applied via useAnimatedProps
|
|
208
|
-
props?: Record<string,
|
|
178
|
+
/** Animated props applied via `useAnimatedProps`. */
|
|
179
|
+
props?: Record<string, unknown>;
|
|
209
180
|
};
|
|
210
181
|
|
|
211
182
|
/**
|
|
@@ -215,7 +186,7 @@ export type TransitionSlotExplicit = {
|
|
|
215
186
|
* - **Shorthand**: Write styles directly — `{ opacity: 0.5, transform: [...] }`
|
|
216
187
|
* - **Explicit**: Use `style` and/or `props` buckets — `{ style: { opacity: 0.5 }, props: { intensity: 80 } }`
|
|
217
188
|
*/
|
|
218
|
-
export type TransitionSlotStyle = AnimatedViewStyle |
|
|
189
|
+
export type TransitionSlotStyle = AnimatedViewStyle | TransitionSlotDefinition;
|
|
219
190
|
|
|
220
191
|
/**
|
|
221
192
|
* Internal normalized slot format used after the backward-compat shim.
|
|
@@ -223,7 +194,7 @@ export type TransitionSlotStyle = AnimatedViewStyle | TransitionSlotExplicit;
|
|
|
223
194
|
*/
|
|
224
195
|
export type NormalizedTransitionSlotStyle = {
|
|
225
196
|
style?: StyleProps;
|
|
226
|
-
props?: Record<string,
|
|
197
|
+
props?: Record<string, unknown>;
|
|
227
198
|
};
|
|
228
199
|
|
|
229
200
|
/**
|
|
@@ -242,10 +213,10 @@ export type NormalizedTransitionInterpolatedStyle = {
|
|
|
242
213
|
};
|
|
243
214
|
|
|
244
215
|
/**
|
|
245
|
-
*
|
|
246
|
-
* Uses
|
|
216
|
+
* The return type of `screenStyleInterpolator`.
|
|
217
|
+
* Uses the nested slot format, while still accepting deprecated flat keys.
|
|
247
218
|
*/
|
|
248
|
-
export type
|
|
219
|
+
export type TransitionInterpolatedStyle = {
|
|
249
220
|
/** Animated style and props for the main screen content view. */
|
|
250
221
|
content?: TransitionSlotStyle;
|
|
251
222
|
/** Animated style and props for the backdrop layer between screens. */
|
|
@@ -254,27 +225,23 @@ export type NewTransitionInterpolatedStyle = {
|
|
|
254
225
|
surface?: TransitionSlotStyle;
|
|
255
226
|
/** Custom styles/props by id for Transition.View components. */
|
|
256
227
|
[id: string]: TransitionSlotStyle | undefined;
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
* This flat format is auto-converted via a backward-compat shim.
|
|
262
|
-
*/
|
|
263
|
-
export type LegacyTransitionInterpolatedStyle = {
|
|
228
|
+
/**
|
|
229
|
+
* @deprecated Use `content` instead.
|
|
230
|
+
* This flat format is auto-converted via a backward-compat shim.
|
|
231
|
+
*/
|
|
264
232
|
contentStyle?: AnimatedViewStyle;
|
|
233
|
+
/**
|
|
234
|
+
* @deprecated Use `backdrop` instead.
|
|
235
|
+
* This flat format is auto-converted via a backward-compat shim.
|
|
236
|
+
*/
|
|
265
237
|
backdropStyle?: AnimatedViewStyle;
|
|
238
|
+
/**
|
|
239
|
+
* @deprecated Use `backdrop` instead.
|
|
240
|
+
* This flat format is auto-converted via a backward-compat shim.
|
|
241
|
+
*/
|
|
266
242
|
overlayStyle?: AnimatedViewStyle;
|
|
267
|
-
[id: string]: AnimatedViewStyle | undefined;
|
|
268
243
|
};
|
|
269
244
|
|
|
270
|
-
/**
|
|
271
|
-
* The return type of `screenStyleInterpolator`.
|
|
272
|
-
* Accepts both the new nested format and the legacy flat format (auto-converted).
|
|
273
|
-
*/
|
|
274
|
-
export type TransitionInterpolatedStyle =
|
|
275
|
-
| NewTransitionInterpolatedStyle
|
|
276
|
-
| LegacyTransitionInterpolatedStyle;
|
|
277
|
-
|
|
278
245
|
/**
|
|
279
246
|
* A Reanimated animation configuration object.
|
|
280
247
|
*/
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import type { MeasuredDimensions, StyleProps } from "react-native-reanimated";
|
|
2
2
|
import type { Snapshot } from "../stores/bounds";
|
|
3
3
|
import type {
|
|
4
|
+
BoundId,
|
|
5
|
+
BoundsAnchor,
|
|
4
6
|
BoundsOptions,
|
|
5
7
|
BoundsOptionsResult,
|
|
8
|
+
BoundsScaleMode,
|
|
6
9
|
} from "../utils/bounds/types/options";
|
|
7
10
|
import type { TransitionInterpolatedStyle } from "./animation.types";
|
|
8
11
|
|
|
@@ -25,16 +28,33 @@ export type BoundsLink = {
|
|
|
25
28
|
destination: BoundEntry | null;
|
|
26
29
|
};
|
|
27
30
|
|
|
28
|
-
export type
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
export type BoundsNavigationZoomOptions = {
|
|
32
|
+
anchor?: BoundsAnchor;
|
|
33
|
+
scaleMode?: BoundsScaleMode;
|
|
34
|
+
target?: "bound" | "fullscreen" | MeasuredDimensions;
|
|
35
|
+
mask?: {
|
|
36
|
+
borderRadius?: number | "auto" | { from?: number; to?: number };
|
|
37
|
+
borderTopLeftRadius?: number | "auto" | { from?: number; to?: number };
|
|
38
|
+
borderTopRightRadius?: number | "auto" | { from?: number; to?: number };
|
|
39
|
+
borderBottomLeftRadius?: number | "auto" | { from?: number; to?: number };
|
|
40
|
+
borderBottomRightRadius?: number | "auto" | { from?: number; to?: number };
|
|
41
|
+
borderCurve?: "circular" | "continuous";
|
|
42
|
+
outset?:
|
|
43
|
+
| number
|
|
44
|
+
| { top?: number; right?: number; bottom?: number; left?: number };
|
|
45
|
+
};
|
|
46
|
+
motion?: {
|
|
47
|
+
dragResistance?: number;
|
|
48
|
+
dragDirectionalScaleMin?: number;
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* @deprecated Use `mask.borderRadius` instead.
|
|
52
|
+
*/
|
|
33
53
|
maskBorderRadius?: number;
|
|
34
54
|
};
|
|
35
55
|
|
|
36
56
|
export type BoundsNavigationAccessor = {
|
|
37
|
-
zoom: () => TransitionInterpolatedStyle;
|
|
57
|
+
zoom: (options?: BoundsNavigationZoomOptions) => TransitionInterpolatedStyle;
|
|
38
58
|
};
|
|
39
59
|
|
|
40
60
|
type BoundsBoundNavigationAccessor = {
|
|
@@ -46,15 +66,15 @@ type BoundsCallResult<T extends BoundsOptions> = BoundsOptionsResult<T> &
|
|
|
46
66
|
|
|
47
67
|
export type BoundsAccessor = {
|
|
48
68
|
<T extends BoundsOptions>(options: T): BoundsCallResult<T>;
|
|
49
|
-
getSnapshot: (id:
|
|
50
|
-
getLink: (id:
|
|
69
|
+
getSnapshot: (id: BoundId, key?: string) => Snapshot | null;
|
|
70
|
+
getLink: (id: BoundId) => BoundsLink | null;
|
|
51
71
|
interpolateStyle: (
|
|
52
|
-
id:
|
|
72
|
+
id: BoundId,
|
|
53
73
|
property: keyof StyleProps,
|
|
54
74
|
fallback?: number,
|
|
55
75
|
) => number;
|
|
56
76
|
interpolateBounds: (
|
|
57
|
-
id:
|
|
77
|
+
id: BoundId,
|
|
58
78
|
property: keyof MeasuredDimensions,
|
|
59
79
|
fallbackOrTargetKey?: number | string,
|
|
60
80
|
fallback?: number,
|
|
@@ -2,28 +2,18 @@ export { FALSE, TRUE } from "../constants";
|
|
|
2
2
|
export type {
|
|
3
3
|
AnimatedViewStyle,
|
|
4
4
|
AnimationConfig,
|
|
5
|
-
LegacyTransitionInterpolatedStyle,
|
|
6
|
-
NewTransitionInterpolatedStyle,
|
|
7
|
-
NormalizedTransitionInterpolatedStyle,
|
|
8
|
-
NormalizedTransitionSlotStyle,
|
|
9
|
-
OverlayInterpolationProps,
|
|
10
5
|
ScreenInterpolationProps,
|
|
11
6
|
ScreenStyleInterpolator,
|
|
12
7
|
ScreenTransitionState,
|
|
13
8
|
TransitionInterpolatedStyle,
|
|
14
|
-
TransitionSlotExplicit,
|
|
15
9
|
TransitionSlotStyle,
|
|
16
10
|
TransitionSpec,
|
|
17
11
|
} from "./animation.types";
|
|
18
12
|
export type {
|
|
19
|
-
BoundEntry,
|
|
20
13
|
BoundsAccessor,
|
|
21
|
-
BoundsLink,
|
|
22
14
|
BoundsMethod,
|
|
23
15
|
BoundsNavigationAccessor,
|
|
24
|
-
|
|
25
|
-
BoundsNavigationPreset,
|
|
26
|
-
BoundsStyleOptions,
|
|
16
|
+
BoundsNavigationZoomOptions,
|
|
27
17
|
} from "./bounds.types";
|
|
28
18
|
export type {
|
|
29
19
|
ActivationArea,
|
|
@@ -32,10 +22,7 @@ export type {
|
|
|
32
22
|
GestureValues,
|
|
33
23
|
SideActivation,
|
|
34
24
|
} from "./gesture.types";
|
|
35
|
-
export type {
|
|
36
|
-
OverlayMode,
|
|
37
|
-
OverlayProps,
|
|
38
|
-
} from "./overlay.types";
|
|
25
|
+
export type { OverlayProps } from "./overlay.types";
|
|
39
26
|
export type {
|
|
40
27
|
Layout,
|
|
41
28
|
ScreenKey,
|
|
@@ -1,18 +1,7 @@
|
|
|
1
1
|
import type { Route } from "@react-navigation/native";
|
|
2
2
|
import type { DerivedValue } from "react-native-reanimated";
|
|
3
|
-
import type {
|
|
4
|
-
OverlayInterpolationProps,
|
|
5
|
-
ScreenInterpolationProps,
|
|
6
|
-
} from "./animation.types";
|
|
7
3
|
import type { ScreenTransitionConfig } from "./screen.types";
|
|
8
4
|
|
|
9
|
-
/**
|
|
10
|
-
* @deprecated Overlay mode is no longer needed. Overlays now always render as "float" mode.
|
|
11
|
-
* For per-screen overlays, render an absolute-positioned view directly in your screen component
|
|
12
|
-
* and use `useScreenAnimation()` to access animation values.
|
|
13
|
-
*/
|
|
14
|
-
export type OverlayMode = "float" | "screen";
|
|
15
|
-
|
|
16
5
|
/**
|
|
17
6
|
* Props passed to overlay components.
|
|
18
7
|
* Generic over the navigation type since different stacks have different navigation props.
|
|
@@ -23,7 +12,7 @@ export type OverlayMode = "float" | "screen";
|
|
|
23
12
|
*/
|
|
24
13
|
export type OverlayScreenState<TNavigation = unknown> = Omit<
|
|
25
14
|
OverlayProps<TNavigation>,
|
|
26
|
-
"progress"
|
|
15
|
+
"progress"
|
|
27
16
|
> & {
|
|
28
17
|
index: number;
|
|
29
18
|
snapTo: (index: number) => void;
|
|
@@ -65,20 +54,4 @@ export type OverlayProps<TNavigation = unknown> = {
|
|
|
65
54
|
* This is equivalent to `useScreenAnimation().stackProgress`.
|
|
66
55
|
*/
|
|
67
56
|
progress: DerivedValue<number>;
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* Animation values for the overlay.
|
|
71
|
-
*
|
|
72
|
-
* @deprecated Use `progress` prop or `useScreenAnimation()` instead.
|
|
73
|
-
* This prop will be removed in a future version.
|
|
74
|
-
*/
|
|
75
|
-
overlayAnimation: DerivedValue<OverlayInterpolationProps>;
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* Animation values for the screen.
|
|
79
|
-
*
|
|
80
|
-
* @deprecated Use `useScreenAnimation()` hook directly instead.
|
|
81
|
-
* This prop will be removed in a future version.
|
|
82
|
-
*/
|
|
83
|
-
screenAnimation: DerivedValue<ScreenInterpolationProps>;
|
|
84
57
|
};
|
|
@@ -4,7 +4,7 @@ import type {
|
|
|
4
4
|
TransitionSpec,
|
|
5
5
|
} from "./animation.types";
|
|
6
6
|
import type { GestureActivationArea, GestureDirection } from "./gesture.types";
|
|
7
|
-
import type {
|
|
7
|
+
import type { OverlayProps } from "./overlay.types";
|
|
8
8
|
|
|
9
9
|
export type Layout = {
|
|
10
10
|
width: number;
|
|
@@ -13,6 +13,12 @@ export type Layout = {
|
|
|
13
13
|
|
|
14
14
|
export type ScreenKey = string;
|
|
15
15
|
|
|
16
|
+
/**
|
|
17
|
+
* A single snap point value. Either a fraction of screen height (0–1) or
|
|
18
|
+
* `'auto'` to snap to the intrinsic height of the screen content.
|
|
19
|
+
*/
|
|
20
|
+
export type SnapPoint = number | "auto";
|
|
21
|
+
|
|
16
22
|
export type TransitionAwareProps<T extends object> = AnimatedProps<T> & {
|
|
17
23
|
/**
|
|
18
24
|
* Connects this component to custom animated styles defined in screenStyleInterpolator.
|
|
@@ -157,20 +163,9 @@ export type ScreenTransitionConfig = {
|
|
|
157
163
|
|
|
158
164
|
/**
|
|
159
165
|
* Function that returns a React Element to display as an overlay.
|
|
160
|
-
* For container overlays (overlayMode: 'container'), use ContainerOverlayProps which includes children.
|
|
161
166
|
*/
|
|
162
167
|
overlay?: (props: OverlayProps) => React.ReactNode;
|
|
163
168
|
|
|
164
|
-
/**
|
|
165
|
-
* How the overlay is positioned relative to screens.
|
|
166
|
-
*
|
|
167
|
-
* @deprecated This option is no longer needed. Overlays now always render as "float" mode
|
|
168
|
-
* (single persistent overlay above all screens). For per-screen overlays, render an
|
|
169
|
-
* absolute-positioned view directly in your screen component and use `useScreenAnimation()`
|
|
170
|
-
* to access animation values.
|
|
171
|
-
*/
|
|
172
|
-
overlayMode?: OverlayMode;
|
|
173
|
-
|
|
174
169
|
/**
|
|
175
170
|
* Whether to show the overlay. The overlay is shown by default when `overlay` is provided.
|
|
176
171
|
* Setting this to `false` hides the overlay.
|
|
@@ -190,15 +185,21 @@ export type ScreenTransitionConfig = {
|
|
|
190
185
|
experimental_enableHighRefreshRate?: boolean;
|
|
191
186
|
|
|
192
187
|
/**
|
|
193
|
-
* Describes heights where a screen can rest, as fractions of screen height
|
|
194
|
-
*
|
|
188
|
+
* Describes heights where a screen can rest, as fractions of screen height,
|
|
189
|
+
* or `'auto'` to snap to the intrinsic height of the screen content.
|
|
190
|
+
*
|
|
191
|
+
* Pass an array of ascending values from 0 to 1, or `'auto'`.
|
|
192
|
+
* The `'auto'` value measures the content's natural height after layout and
|
|
193
|
+
* converts it to the equivalent fraction of the screen height.
|
|
195
194
|
*
|
|
196
195
|
* @example
|
|
197
|
-
* snapPoints={[0.5, 1.0]}
|
|
196
|
+
* snapPoints={[0.5, 1.0]} // 50% and 100% of screen height
|
|
197
|
+
* snapPoints={['auto']} // snap to content height
|
|
198
|
+
* snapPoints={['auto', 1.0]} // content height or full screen
|
|
198
199
|
*
|
|
199
200
|
* @default [1.0]
|
|
200
201
|
*/
|
|
201
|
-
snapPoints?:
|
|
202
|
+
snapPoints?: SnapPoint[];
|
|
202
203
|
|
|
203
204
|
/**
|
|
204
205
|
* The initial snap point index when the screen opens.
|
|
@@ -58,6 +58,9 @@ export const animateToProgress = ({
|
|
|
58
58
|
if (!config) {
|
|
59
59
|
animating.set(FALSE);
|
|
60
60
|
progress.set(value);
|
|
61
|
+
if (!isClosing) {
|
|
62
|
+
entering.set(FALSE);
|
|
63
|
+
}
|
|
61
64
|
|
|
62
65
|
if (onAnimationFinish) {
|
|
63
66
|
runOnJS(onAnimationFinish)(true);
|
|
@@ -71,6 +74,10 @@ export const animateToProgress = ({
|
|
|
71
74
|
"worklet";
|
|
72
75
|
if (!finished) return;
|
|
73
76
|
|
|
77
|
+
if (!isClosing) {
|
|
78
|
+
entering.set(FALSE);
|
|
79
|
+
}
|
|
80
|
+
|
|
74
81
|
if (onAnimationFinish) {
|
|
75
82
|
runOnJS(onAnimationFinish)(finished);
|
|
76
83
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { BoundStore } from "../../../stores/bounds";
|
|
2
2
|
import type { ScreenInterpolationProps } from "../../../types/animation.types";
|
|
3
|
-
import type { BoundsOptions } from "../types/options";
|
|
3
|
+
import type { BoundId, BoundsOptions } from "../types/options";
|
|
4
4
|
import { DEFAULT_BOUNDS_OPTIONS } from "./constants";
|
|
5
5
|
import type { ResolveBoundTagParams } from "./resolve-bound-tag";
|
|
6
6
|
|
|
7
7
|
type BuildBoundsOptionsParams = {
|
|
8
8
|
props: Omit<ScreenInterpolationProps, "bounds">;
|
|
9
|
-
id?:
|
|
9
|
+
id?: BoundId;
|
|
10
10
|
group?: string;
|
|
11
11
|
overrides?: Partial<BoundsOptions>;
|
|
12
12
|
mode?: "style" | "navigation";
|
|
@@ -12,7 +12,11 @@ import {
|
|
|
12
12
|
} from "../../../stores/bounds";
|
|
13
13
|
import type { ScreenTransitionState } from "../../../types/animation.types";
|
|
14
14
|
import type { Layout } from "../../../types/screen.types";
|
|
15
|
-
import type {
|
|
15
|
+
import type {
|
|
16
|
+
BoundId,
|
|
17
|
+
BoundsComputeParams,
|
|
18
|
+
BoundsOptions,
|
|
19
|
+
} from "../types/options";
|
|
16
20
|
import {
|
|
17
21
|
computeContentTransformGeometry,
|
|
18
22
|
computeRelativeGeometry,
|
|
@@ -27,7 +31,7 @@ import {
|
|
|
27
31
|
} from "./style-composers";
|
|
28
32
|
|
|
29
33
|
const resolveBounds = (params: {
|
|
30
|
-
id:
|
|
34
|
+
id: BoundId;
|
|
31
35
|
previous?: ScreenTransitionState;
|
|
32
36
|
current?: ScreenTransitionState;
|
|
33
37
|
next?: ScreenTransitionState;
|
|
@@ -51,7 +55,7 @@ const resolveBounds = (params: {
|
|
|
51
55
|
|
|
52
56
|
const resolvedPair =
|
|
53
57
|
params.resolvedPair ??
|
|
54
|
-
BoundStore.resolveTransitionPair(params.id, {
|
|
58
|
+
BoundStore.resolveTransitionPair(String(params.id), {
|
|
55
59
|
currentScreenKey,
|
|
56
60
|
previousScreenKey,
|
|
57
61
|
nextScreenKey,
|
|
@@ -66,6 +70,9 @@ const resolveBounds = (params: {
|
|
|
66
70
|
start: null,
|
|
67
71
|
end: null,
|
|
68
72
|
entering,
|
|
73
|
+
currentScreenKey,
|
|
74
|
+
sourceScreenKey: resolvedPair.sourceScreenKey,
|
|
75
|
+
destinationScreenKey: resolvedPair.destinationScreenKey,
|
|
69
76
|
};
|
|
70
77
|
}
|
|
71
78
|
|
|
@@ -75,6 +82,9 @@ const resolveBounds = (params: {
|
|
|
75
82
|
start: null,
|
|
76
83
|
end: null,
|
|
77
84
|
entering,
|
|
85
|
+
currentScreenKey,
|
|
86
|
+
sourceScreenKey: resolvedPair.sourceScreenKey,
|
|
87
|
+
destinationScreenKey: resolvedPair.destinationScreenKey,
|
|
78
88
|
};
|
|
79
89
|
}
|
|
80
90
|
|
|
@@ -94,6 +104,9 @@ const resolveBounds = (params: {
|
|
|
94
104
|
start,
|
|
95
105
|
end,
|
|
96
106
|
entering,
|
|
107
|
+
currentScreenKey,
|
|
108
|
+
sourceScreenKey: resolvedPair.sourceScreenKey,
|
|
109
|
+
destinationScreenKey: resolvedPair.destinationScreenKey,
|
|
97
110
|
};
|
|
98
111
|
};
|
|
99
112
|
|
|
@@ -111,7 +124,14 @@ export const computeBoundStyles = (
|
|
|
111
124
|
return EMPTY_BOUND_HELPER_RESULT;
|
|
112
125
|
}
|
|
113
126
|
|
|
114
|
-
const {
|
|
127
|
+
const {
|
|
128
|
+
start,
|
|
129
|
+
end,
|
|
130
|
+
entering,
|
|
131
|
+
currentScreenKey,
|
|
132
|
+
sourceScreenKey,
|
|
133
|
+
destinationScreenKey,
|
|
134
|
+
} = resolveBounds({
|
|
115
135
|
id,
|
|
116
136
|
previous,
|
|
117
137
|
current,
|
|
@@ -131,9 +151,15 @@ export const computeBoundStyles = (
|
|
|
131
151
|
const ranges: readonly [number, number] = entering ? ENTER_RANGE : EXIT_RANGE;
|
|
132
152
|
|
|
133
153
|
if (computeOptions.method === "content") {
|
|
154
|
+
const currentOwnsSource =
|
|
155
|
+
!!currentScreenKey &&
|
|
156
|
+
currentScreenKey === sourceScreenKey &&
|
|
157
|
+
currentScreenKey !== destinationScreenKey;
|
|
158
|
+
const contentStart = currentOwnsSource ? end : start;
|
|
159
|
+
const contentEnd = currentOwnsSource ? start : end;
|
|
134
160
|
const geometry = computeContentTransformGeometry({
|
|
135
|
-
start,
|
|
136
|
-
end,
|
|
161
|
+
start: contentStart,
|
|
162
|
+
end: contentEnd,
|
|
137
163
|
entering,
|
|
138
164
|
dimensions,
|
|
139
165
|
anchor: computeOptions.anchor,
|
|
@@ -141,10 +167,10 @@ export const computeBoundStyles = (
|
|
|
141
167
|
});
|
|
142
168
|
|
|
143
169
|
return composeContentStyle({
|
|
144
|
-
start,
|
|
170
|
+
start: contentStart,
|
|
145
171
|
progress,
|
|
146
172
|
ranges,
|
|
147
|
-
end,
|
|
173
|
+
end: contentEnd,
|
|
148
174
|
geometry,
|
|
149
175
|
computeOptions,
|
|
150
176
|
});
|
|
@@ -95,8 +95,9 @@ export function computeRelativeGeometry({
|
|
|
95
95
|
return { dx, dy, scaleX, scaleY, entering };
|
|
96
96
|
}
|
|
97
97
|
/**
|
|
98
|
-
* Computes the transform to apply to the
|
|
99
|
-
*
|
|
98
|
+
* Computes the transform to apply to the current screen so that its owned
|
|
99
|
+
* bound (`end`) matches the paired target bound (`start`) at the aligned
|
|
100
|
+
* phase of the transition.
|
|
100
101
|
*/
|
|
101
102
|
export function computeContentTransformGeometry({
|
|
102
103
|
start,
|
|
@@ -2,6 +2,7 @@ import type { MeasuredDimensions } from "react-native-reanimated";
|
|
|
2
2
|
import { ENTER_RANGE, EXIT_RANGE } from "../../../constants";
|
|
3
3
|
import { BoundStore } from "../../../stores/bounds";
|
|
4
4
|
import type { ScreenInterpolationProps } from "../../../types/animation.types";
|
|
5
|
+
import type { BoundId } from "../types/options";
|
|
5
6
|
import { interpolateClamped } from "./interpolate";
|
|
6
7
|
import { interpolateLinkStyle } from "./interpolate-style";
|
|
7
8
|
import type { LinkAccessor } from "./link-accessor";
|
|
@@ -18,7 +19,7 @@ export const createInterpolators = ({
|
|
|
18
19
|
"worklet";
|
|
19
20
|
|
|
20
21
|
const interpolateStyle = (
|
|
21
|
-
tag:
|
|
22
|
+
tag: BoundId,
|
|
22
23
|
property: string,
|
|
23
24
|
fallback?: number,
|
|
24
25
|
): number => {
|
|
@@ -32,7 +33,7 @@ export const createInterpolators = ({
|
|
|
32
33
|
};
|
|
33
34
|
|
|
34
35
|
const interpolateBoundsFromSnapshot = (
|
|
35
|
-
tag:
|
|
36
|
+
tag: BoundId,
|
|
36
37
|
property: keyof MeasuredDimensions,
|
|
37
38
|
targetKey: string,
|
|
38
39
|
fallback?: number,
|
|
@@ -44,11 +45,12 @@ export const createInterpolators = ({
|
|
|
44
45
|
const range = entering ? ENTER_RANGE : EXIT_RANGE;
|
|
45
46
|
const currentKey = props.current?.route?.key;
|
|
46
47
|
const fb = fallback ?? 0;
|
|
48
|
+
const normalizedTag = String(tag);
|
|
47
49
|
|
|
48
50
|
const currentSnapshot = currentKey
|
|
49
|
-
? BoundStore.getSnapshot(
|
|
51
|
+
? BoundStore.getSnapshot(normalizedTag, currentKey)
|
|
50
52
|
: null;
|
|
51
|
-
const targetSnapshot = BoundStore.getSnapshot(
|
|
53
|
+
const targetSnapshot = BoundStore.getSnapshot(normalizedTag, targetKey);
|
|
52
54
|
|
|
53
55
|
const currentValue = currentSnapshot?.bounds?.[property] ?? fb;
|
|
54
56
|
const targetValue = targetSnapshot?.bounds?.[property] ?? fb;
|
|
@@ -60,7 +62,7 @@ export const createInterpolators = ({
|
|
|
60
62
|
};
|
|
61
63
|
|
|
62
64
|
const interpolateBoundsFromLink = (
|
|
63
|
-
tag:
|
|
65
|
+
tag: BoundId,
|
|
64
66
|
property: keyof MeasuredDimensions,
|
|
65
67
|
fallback?: number,
|
|
66
68
|
): number => {
|
|
@@ -82,7 +84,7 @@ export const createInterpolators = ({
|
|
|
82
84
|
};
|
|
83
85
|
|
|
84
86
|
const interpolateBounds = (
|
|
85
|
-
tag:
|
|
87
|
+
tag: BoundId,
|
|
86
88
|
property: keyof MeasuredDimensions,
|
|
87
89
|
fallbackOrTargetKey?: number | string,
|
|
88
90
|
fallback?: number,
|
|
@@ -1,27 +1,31 @@
|
|
|
1
1
|
import { BoundStore, type Snapshot } from "../../../stores/bounds";
|
|
2
2
|
import type { ScreenInterpolationProps } from "../../../types/animation.types";
|
|
3
3
|
import type { BoundsLink } from "../../../types/bounds.types";
|
|
4
|
+
import type { BoundId } from "../types/options";
|
|
4
5
|
|
|
5
6
|
type GetProps = () => Omit<ScreenInterpolationProps, "bounds">;
|
|
6
7
|
|
|
7
8
|
export type LinkAccessor = {
|
|
8
|
-
getSnapshot: (tag:
|
|
9
|
-
getLink: (tag:
|
|
9
|
+
getSnapshot: (tag: BoundId, key?: string) => Snapshot | null;
|
|
10
|
+
getLink: (tag: BoundId) => BoundsLink | null;
|
|
10
11
|
};
|
|
11
12
|
|
|
12
13
|
export const createLinkAccessor = (getProps: GetProps): LinkAccessor => {
|
|
13
14
|
"worklet";
|
|
14
15
|
|
|
15
|
-
const getSnapshot = (tag:
|
|
16
|
+
const getSnapshot = (tag: BoundId, key?: string): Snapshot | null => {
|
|
16
17
|
"worklet";
|
|
17
18
|
if (!key) return null;
|
|
18
|
-
return BoundStore.getSnapshot(tag, key);
|
|
19
|
+
return BoundStore.getSnapshot(String(tag), key);
|
|
19
20
|
};
|
|
20
21
|
|
|
21
|
-
const getLink = (tag:
|
|
22
|
+
const getLink = (tag: BoundId): BoundsLink | null => {
|
|
22
23
|
"worklet";
|
|
23
24
|
const props = getProps();
|
|
24
|
-
const link = BoundStore.getActiveLink(
|
|
25
|
+
const link = BoundStore.getActiveLink(
|
|
26
|
+
String(tag),
|
|
27
|
+
props.current?.route.key,
|
|
28
|
+
);
|
|
25
29
|
if (!link) return null;
|
|
26
30
|
return {
|
|
27
31
|
source: link.source
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { BoundStore } from "../../../stores/bounds";
|
|
2
|
+
import type { BoundId } from "../types/options";
|
|
2
3
|
|
|
3
4
|
export type ResolveBoundTagParams = {
|
|
4
|
-
id?:
|
|
5
|
+
id?: BoundId;
|
|
5
6
|
group?: string;
|
|
6
7
|
};
|
|
7
8
|
|
|
@@ -11,16 +12,18 @@ export const resolveBoundTag = ({
|
|
|
11
12
|
}: ResolveBoundTagParams): string | undefined => {
|
|
12
13
|
"worklet";
|
|
13
14
|
|
|
14
|
-
if (
|
|
15
|
+
if (id === undefined || id === null || id === "") return undefined;
|
|
16
|
+
|
|
17
|
+
const normalizedId = String(id);
|
|
15
18
|
|
|
16
19
|
if (!group) {
|
|
17
|
-
return
|
|
20
|
+
return normalizedId;
|
|
18
21
|
}
|
|
19
22
|
|
|
20
23
|
const currentActiveId = BoundStore.getGroupActiveId(group);
|
|
21
|
-
if (currentActiveId !==
|
|
22
|
-
BoundStore.setGroupActiveId(group,
|
|
24
|
+
if (currentActiveId !== normalizedId) {
|
|
25
|
+
BoundStore.setGroupActiveId(group, normalizedId);
|
|
23
26
|
}
|
|
24
27
|
|
|
25
|
-
return `${group}:${
|
|
28
|
+
return `${group}:${normalizedId}`;
|
|
26
29
|
};
|
|
@@ -22,9 +22,10 @@ export type ElementComposeParams = {
|
|
|
22
22
|
};
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
|
-
* Screen-level content transform params
|
|
26
|
-
* - start/end: absolute window bounds for the
|
|
27
|
-
*
|
|
25
|
+
* Screen-level content transform params.
|
|
26
|
+
* - start/end: absolute window bounds for the paired target and the current
|
|
27
|
+
* screen-owned bound
|
|
28
|
+
* - geometry: precomputed screen-level tx/ty/scale plus ranges/entering
|
|
28
29
|
* - interp: function to interpolate between numbers using the correct progress range
|
|
29
30
|
*/
|
|
30
31
|
type ContentComposeParams = {
|