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
|
@@ -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;
|
|
@@ -12,6 +12,15 @@ export type Layout = {
|
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
export type ScreenKey = string;
|
|
15
|
+
export type SheetScrollGestureBehavior =
|
|
16
|
+
| "expand-and-collapse"
|
|
17
|
+
| "collapse-only";
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* A single snap point value. Either a fraction of screen height (0–1) or
|
|
21
|
+
* `'auto'` to snap to the intrinsic height of the screen content.
|
|
22
|
+
*/
|
|
23
|
+
export type SnapPoint = number | "auto";
|
|
15
24
|
|
|
16
25
|
export type TransitionAwareProps<T extends object> = AnimatedProps<T> & {
|
|
17
26
|
/**
|
|
@@ -27,10 +36,13 @@ export type TransitionAwareProps<T extends object> = AnimatedProps<T> & {
|
|
|
27
36
|
* </Transition.View>
|
|
28
37
|
*
|
|
29
38
|
* // In your screenStyleInterpolator:
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
39
|
+
* screenStyleInterpolator: ({ progress }) => {
|
|
40
|
+
* "worklet";
|
|
41
|
+
* return {
|
|
42
|
+
* 'hero-image': {
|
|
43
|
+
* opacity: interpolate(progress, [0, 1], [0, 1]),
|
|
44
|
+
* transform: [{ scale: interpolate(progress, [0, 1], [0.8, 1]) }]
|
|
45
|
+
* }
|
|
34
46
|
* }
|
|
35
47
|
* }
|
|
36
48
|
*/
|
|
@@ -81,6 +93,13 @@ export type ScreenTransitionConfig = {
|
|
|
81
93
|
* (e.g. `bounds().navigation.zoom()`) is ready from the first frame.
|
|
82
94
|
*
|
|
83
95
|
* Requires `@react-native-masked-view/masked-view` to be installed.
|
|
96
|
+
*
|
|
97
|
+
* @default false
|
|
98
|
+
*/
|
|
99
|
+
navigationMaskEnabled?: boolean;
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* @deprecated Use `navigationMaskEnabled` instead.
|
|
84
103
|
*/
|
|
85
104
|
maskEnabled?: boolean;
|
|
86
105
|
|
|
@@ -157,20 +176,9 @@ export type ScreenTransitionConfig = {
|
|
|
157
176
|
|
|
158
177
|
/**
|
|
159
178
|
* Function that returns a React Element to display as an overlay.
|
|
160
|
-
* For container overlays (overlayMode: 'container'), use ContainerOverlayProps which includes children.
|
|
161
179
|
*/
|
|
162
180
|
overlay?: (props: OverlayProps) => React.ReactNode;
|
|
163
181
|
|
|
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
182
|
/**
|
|
175
183
|
* Whether to show the overlay. The overlay is shown by default when `overlay` is provided.
|
|
176
184
|
* Setting this to `false` hides the overlay.
|
|
@@ -190,15 +198,21 @@ export type ScreenTransitionConfig = {
|
|
|
190
198
|
experimental_enableHighRefreshRate?: boolean;
|
|
191
199
|
|
|
192
200
|
/**
|
|
193
|
-
* Describes heights where a screen can rest, as fractions of screen height
|
|
194
|
-
*
|
|
201
|
+
* Describes heights where a screen can rest, as fractions of screen height,
|
|
202
|
+
* or `'auto'` to snap to the intrinsic height of the screen content.
|
|
203
|
+
*
|
|
204
|
+
* Pass an array of ascending values from 0 to 1, or `'auto'`.
|
|
205
|
+
* The `'auto'` value measures the content's natural height after layout and
|
|
206
|
+
* converts it to the equivalent fraction of the screen height.
|
|
195
207
|
*
|
|
196
208
|
* @example
|
|
197
|
-
* snapPoints={[0.5, 1.0]}
|
|
209
|
+
* snapPoints={[0.5, 1.0]} // 50% and 100% of screen height
|
|
210
|
+
* snapPoints={['auto']} // snap to content height
|
|
211
|
+
* snapPoints={['auto', 1.0]} // content height or full screen
|
|
198
212
|
*
|
|
199
213
|
* @default [1.0]
|
|
200
214
|
*/
|
|
201
|
-
snapPoints?:
|
|
215
|
+
snapPoints?: SnapPoint[];
|
|
202
216
|
|
|
203
217
|
/**
|
|
204
218
|
* The initial snap point index when the screen opens.
|
|
@@ -208,16 +222,25 @@ export type ScreenTransitionConfig = {
|
|
|
208
222
|
initialSnapIndex?: number;
|
|
209
223
|
|
|
210
224
|
/**
|
|
211
|
-
* Controls
|
|
212
|
-
*
|
|
213
|
-
* - `true` (Apple Maps style): Swiping up at scroll top expands the sheet
|
|
214
|
-
* - `false` (Instagram style): Expand only works via deadspace (non-scrollable areas)
|
|
225
|
+
* Controls how nested scroll content hands gestures off to a snap sheet.
|
|
215
226
|
*
|
|
216
|
-
*
|
|
227
|
+
* - `"expand-and-collapse"` (Apple Maps style): Swiping up at scroll boundary expands the sheet,
|
|
228
|
+
* and swiping down at scroll boundary collapses or dismisses it
|
|
229
|
+
* - `"collapse-only"` (Instagram style): Expand only works via deadspace; collapse/dismiss via
|
|
230
|
+
* nested scroll content still works at boundary
|
|
217
231
|
*
|
|
218
232
|
* Only applies to screens with `snapPoints` configured.
|
|
219
233
|
*
|
|
220
|
-
* @default
|
|
234
|
+
* @default "expand-and-collapse"
|
|
235
|
+
*/
|
|
236
|
+
sheetScrollGestureBehavior?: SheetScrollGestureBehavior;
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* @deprecated Use `sheetScrollGestureBehavior` instead.
|
|
240
|
+
*
|
|
241
|
+
* Mapping:
|
|
242
|
+
* - `true` -> `"expand-and-collapse"`
|
|
243
|
+
* - `false` -> `"collapse-only"`
|
|
221
244
|
*/
|
|
222
245
|
expandViaScrollView?: boolean;
|
|
223
246
|
|
|
@@ -254,12 +277,15 @@ export type ScreenTransitionConfig = {
|
|
|
254
277
|
*
|
|
255
278
|
* @example
|
|
256
279
|
* backdropComponent: BlurView,
|
|
257
|
-
* screenStyleInterpolator: ({ progress }) =>
|
|
258
|
-
*
|
|
259
|
-
*
|
|
260
|
-
*
|
|
261
|
-
*
|
|
262
|
-
* }
|
|
280
|
+
* screenStyleInterpolator: ({ progress }) => {
|
|
281
|
+
* "worklet";
|
|
282
|
+
* return {
|
|
283
|
+
* backdrop: {
|
|
284
|
+
* style: { opacity: interpolate(progress, [0, 1], [0, 1]) },
|
|
285
|
+
* props: { intensity: interpolate(progress, [0, 1], [0, 80]) },
|
|
286
|
+
* },
|
|
287
|
+
* };
|
|
288
|
+
* }
|
|
263
289
|
*
|
|
264
290
|
* @default undefined
|
|
265
291
|
*/
|
|
@@ -276,12 +302,15 @@ export type ScreenTransitionConfig = {
|
|
|
276
302
|
*
|
|
277
303
|
* @example
|
|
278
304
|
* surfaceComponent: SquircleView,
|
|
279
|
-
* screenStyleInterpolator: ({ progress }) =>
|
|
280
|
-
*
|
|
281
|
-
*
|
|
282
|
-
*
|
|
283
|
-
*
|
|
284
|
-
* }
|
|
305
|
+
* screenStyleInterpolator: ({ progress }) => {
|
|
306
|
+
* "worklet";
|
|
307
|
+
* return {
|
|
308
|
+
* surface: {
|
|
309
|
+
* style: { opacity: interpolate(progress, [0, 1], [0, 1]) },
|
|
310
|
+
* props: { cornerRadius: 24, cornerSmoothing: 0.7 },
|
|
311
|
+
* },
|
|
312
|
+
* };
|
|
313
|
+
* }
|
|
285
314
|
*
|
|
286
315
|
* @default undefined
|
|
287
316
|
*/
|
|
@@ -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,11 @@ const resolveBounds = (params: {
|
|
|
66
70
|
start: null,
|
|
67
71
|
end: null,
|
|
68
72
|
entering,
|
|
73
|
+
currentScreenKey,
|
|
74
|
+
sourceScreenKey: resolvedPair.sourceScreenKey,
|
|
75
|
+
destinationScreenKey: resolvedPair.destinationScreenKey,
|
|
76
|
+
hasTargetOverride,
|
|
77
|
+
usedSnapshotDestination: resolvedPair.usedSnapshotDestination,
|
|
69
78
|
};
|
|
70
79
|
}
|
|
71
80
|
|
|
@@ -75,6 +84,11 @@ const resolveBounds = (params: {
|
|
|
75
84
|
start: null,
|
|
76
85
|
end: null,
|
|
77
86
|
entering,
|
|
87
|
+
currentScreenKey,
|
|
88
|
+
sourceScreenKey: resolvedPair.sourceScreenKey,
|
|
89
|
+
destinationScreenKey: resolvedPair.destinationScreenKey,
|
|
90
|
+
hasTargetOverride,
|
|
91
|
+
usedSnapshotDestination: resolvedPair.usedSnapshotDestination,
|
|
78
92
|
};
|
|
79
93
|
}
|
|
80
94
|
|
|
@@ -94,6 +108,11 @@ const resolveBounds = (params: {
|
|
|
94
108
|
start,
|
|
95
109
|
end,
|
|
96
110
|
entering,
|
|
111
|
+
currentScreenKey,
|
|
112
|
+
sourceScreenKey: resolvedPair.sourceScreenKey,
|
|
113
|
+
destinationScreenKey: resolvedPair.destinationScreenKey,
|
|
114
|
+
hasTargetOverride,
|
|
115
|
+
usedSnapshotDestination: resolvedPair.usedSnapshotDestination,
|
|
97
116
|
};
|
|
98
117
|
};
|
|
99
118
|
|
|
@@ -111,7 +130,16 @@ export const computeBoundStyles = (
|
|
|
111
130
|
return EMPTY_BOUND_HELPER_RESULT;
|
|
112
131
|
}
|
|
113
132
|
|
|
114
|
-
const {
|
|
133
|
+
const {
|
|
134
|
+
start,
|
|
135
|
+
end,
|
|
136
|
+
entering,
|
|
137
|
+
currentScreenKey,
|
|
138
|
+
sourceScreenKey,
|
|
139
|
+
destinationScreenKey,
|
|
140
|
+
hasTargetOverride,
|
|
141
|
+
usedSnapshotDestination,
|
|
142
|
+
} = resolveBounds({
|
|
115
143
|
id,
|
|
116
144
|
previous,
|
|
117
145
|
current,
|
|
@@ -131,9 +159,20 @@ export const computeBoundStyles = (
|
|
|
131
159
|
const ranges: readonly [number, number] = entering ? ENTER_RANGE : EXIT_RANGE;
|
|
132
160
|
|
|
133
161
|
if (computeOptions.method === "content") {
|
|
162
|
+
const ignoresSnapshotDestinationOwnership =
|
|
163
|
+
hasTargetOverride &&
|
|
164
|
+
usedSnapshotDestination &&
|
|
165
|
+
destinationScreenKey === sourceScreenKey;
|
|
166
|
+
const currentOwnsSource =
|
|
167
|
+
!!currentScreenKey &&
|
|
168
|
+
currentScreenKey === sourceScreenKey &&
|
|
169
|
+
(currentScreenKey !== destinationScreenKey ||
|
|
170
|
+
ignoresSnapshotDestinationOwnership);
|
|
171
|
+
const contentStart = currentOwnsSource ? end : start;
|
|
172
|
+
const contentEnd = currentOwnsSource ? start : end;
|
|
134
173
|
const geometry = computeContentTransformGeometry({
|
|
135
|
-
start,
|
|
136
|
-
end,
|
|
174
|
+
start: contentStart,
|
|
175
|
+
end: contentEnd,
|
|
137
176
|
entering,
|
|
138
177
|
dimensions,
|
|
139
178
|
anchor: computeOptions.anchor,
|
|
@@ -141,10 +180,10 @@ export const computeBoundStyles = (
|
|
|
141
180
|
});
|
|
142
181
|
|
|
143
182
|
return composeContentStyle({
|
|
144
|
-
start,
|
|
183
|
+
start: contentStart,
|
|
145
184
|
progress,
|
|
146
185
|
ranges,
|
|
147
|
-
end,
|
|
186
|
+
end: contentEnd,
|
|
148
187
|
geometry,
|
|
149
188
|
computeOptions,
|
|
150
189
|
});
|
|
@@ -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,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { BoundId } from "../types/options";
|
|
2
2
|
|
|
3
3
|
export type ResolveBoundTagParams = {
|
|
4
|
-
id?:
|
|
4
|
+
id?: BoundId;
|
|
5
5
|
group?: string;
|
|
6
6
|
};
|
|
7
7
|
|
|
@@ -11,16 +11,13 @@ export const resolveBoundTag = ({
|
|
|
11
11
|
}: ResolveBoundTagParams): string | undefined => {
|
|
12
12
|
"worklet";
|
|
13
13
|
|
|
14
|
-
if (
|
|
14
|
+
if (id === undefined || id === null || id === "") return undefined;
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
return id;
|
|
18
|
-
}
|
|
16
|
+
const normalizedId = String(id);
|
|
19
17
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
BoundStore.setGroupActiveId(group, id);
|
|
18
|
+
if (!group) {
|
|
19
|
+
return normalizedId;
|
|
23
20
|
}
|
|
24
21
|
|
|
25
|
-
return `${group}:${
|
|
22
|
+
return `${group}:${normalizedId}`;
|
|
26
23
|
};
|
|
@@ -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 = {
|
|
@@ -5,12 +5,24 @@ import { buildBoundsOptions } from "./helpers/build-bounds-options";
|
|
|
5
5
|
import { computeBoundStyles } from "./helpers/compute-bounds-styles";
|
|
6
6
|
import { createInterpolators } from "./helpers/interpolators";
|
|
7
7
|
import { createLinkAccessor } from "./helpers/link-accessor";
|
|
8
|
-
import { createNavigationAccessor } from "./helpers/navigation-accessor";
|
|
9
8
|
import { resolveBoundTag } from "./helpers/resolve-bound-tag";
|
|
9
|
+
import type { BoundsFrameProps } from "./types/frame-props";
|
|
10
10
|
import type { BoundsOptions } from "./types/options";
|
|
11
|
+
import { createZoomAccessor } from "./zoom";
|
|
12
|
+
|
|
13
|
+
const syncGroupActiveMember = (group?: string, id?: string | number) => {
|
|
14
|
+
"worklet";
|
|
15
|
+
if (!group) return;
|
|
16
|
+
if (id === undefined || id === null || id === "") return;
|
|
17
|
+
|
|
18
|
+
const normalizedId = String(id);
|
|
19
|
+
if (BoundStore.getGroupActiveId(group) === normalizedId) return;
|
|
20
|
+
|
|
21
|
+
BoundStore.setGroupActiveId(group, normalizedId);
|
|
22
|
+
};
|
|
11
23
|
|
|
12
24
|
export const createBoundsAccessor = (
|
|
13
|
-
getProps: () =>
|
|
25
|
+
getProps: () => BoundsFrameProps,
|
|
14
26
|
): BoundsAccessor => {
|
|
15
27
|
"worklet";
|
|
16
28
|
|
|
@@ -37,6 +49,7 @@ export const createBoundsAccessor = (
|
|
|
37
49
|
const computeElementBoundsStyles = (params?: BoundsOptions) => {
|
|
38
50
|
"worklet";
|
|
39
51
|
const props = getProps();
|
|
52
|
+
syncGroupActiveMember(params?.group, params?.id);
|
|
40
53
|
|
|
41
54
|
const resolved = buildBoundsOptions({
|
|
42
55
|
props,
|
|
@@ -47,24 +60,20 @@ export const createBoundsAccessor = (
|
|
|
47
60
|
resolveBoundTag,
|
|
48
61
|
});
|
|
49
62
|
|
|
50
|
-
const computed = computeForResolvedOptions(resolved, props)
|
|
51
|
-
|
|
52
|
-
unknown
|
|
53
|
-
>;
|
|
63
|
+
const computed = computeForResolvedOptions(resolved, props);
|
|
64
|
+
|
|
54
65
|
const zoomBaseOptions = {
|
|
55
66
|
anchor: params?.anchor,
|
|
56
67
|
scaleMode: params?.scaleMode,
|
|
57
68
|
target: params?.target,
|
|
58
69
|
};
|
|
59
|
-
let cachedNavigationPairProps:
|
|
60
|
-
| Omit<ScreenInterpolationProps, "bounds">
|
|
61
|
-
| undefined;
|
|
70
|
+
let cachedNavigationPairProps: BoundsFrameProps | undefined;
|
|
62
71
|
let cachedNavigationPairTag = "";
|
|
63
72
|
let cachedNavigationPair: ResolvedTransitionPair | undefined;
|
|
64
73
|
|
|
65
74
|
const resolveNavigationPair = (
|
|
66
75
|
tag: string,
|
|
67
|
-
frameProps:
|
|
76
|
+
frameProps: BoundsFrameProps,
|
|
68
77
|
): ResolvedTransitionPair | undefined => {
|
|
69
78
|
"worklet";
|
|
70
79
|
if (!tag) return undefined;
|
|
@@ -90,7 +99,7 @@ export const createBoundsAccessor = (
|
|
|
90
99
|
return nextPair;
|
|
91
100
|
};
|
|
92
101
|
|
|
93
|
-
const navigation =
|
|
102
|
+
const navigation = createZoomAccessor({
|
|
94
103
|
id: params?.id,
|
|
95
104
|
group: params?.group,
|
|
96
105
|
getProps,
|
|
@@ -108,7 +117,7 @@ export const createBoundsAccessor = (
|
|
|
108
117
|
resolveBoundTag,
|
|
109
118
|
});
|
|
110
119
|
const resolvedPair = resolveNavigationPair(
|
|
111
|
-
resolvedNavigationOptions.id,
|
|
120
|
+
String(resolvedNavigationOptions.id),
|
|
112
121
|
currentProps,
|
|
113
122
|
);
|
|
114
123
|
|
|
@@ -128,7 +137,7 @@ export const createBoundsAccessor = (
|
|
|
128
137
|
configurable: true,
|
|
129
138
|
});
|
|
130
139
|
|
|
131
|
-
return target
|
|
140
|
+
return target;
|
|
132
141
|
};
|
|
133
142
|
|
|
134
143
|
const { getSnapshot, getLink } = createLinkAccessor(getProps);
|
|
@@ -3,6 +3,8 @@ import type { ScreenTransitionState } from "../../../types/animation.types";
|
|
|
3
3
|
import type { BoundsMethod } from "../../../types/bounds.types";
|
|
4
4
|
import type { Layout } from "../../../types/screen.types";
|
|
5
5
|
|
|
6
|
+
export type BoundId = string | number;
|
|
7
|
+
|
|
6
8
|
export type BoundsAnchor =
|
|
7
9
|
| "topLeading"
|
|
8
10
|
| "top"
|
|
@@ -21,7 +23,7 @@ type BoundsTarget = "bound" | "fullscreen" | MeasuredDimensions;
|
|
|
21
23
|
type BoundsSpace = "relative" | "absolute";
|
|
22
24
|
|
|
23
25
|
export type BoundsComputeParams = {
|
|
24
|
-
id?:
|
|
26
|
+
id?: BoundId;
|
|
25
27
|
previous?: ScreenTransitionState;
|
|
26
28
|
current: ScreenTransitionState;
|
|
27
29
|
next?: ScreenTransitionState;
|
|
@@ -81,7 +83,7 @@ export type BoundsOptions = {
|
|
|
81
83
|
* The ID of the bound to compute bounds for.
|
|
82
84
|
* When `group` is also provided, this is the member id within the group (not the combined tag).
|
|
83
85
|
*/
|
|
84
|
-
id:
|
|
86
|
+
id: BoundId;
|
|
85
87
|
|
|
86
88
|
/**
|
|
87
89
|
* Optional group name for collection/list scenarios.
|
|
@@ -101,8 +103,8 @@ export type BoundsOptions = {
|
|
|
101
103
|
*
|
|
102
104
|
* - "transform": translates and scales (scaleX/scaleY), no width/height size
|
|
103
105
|
* - "size": translates and sizes (width/height), no scaleX/scaleY
|
|
104
|
-
* - "content": screen-level content transform that aligns the
|
|
105
|
-
* so
|
|
106
|
+
* - "content": screen-level content transform that aligns the current screen
|
|
107
|
+
* so its bound matches the paired target bound during the transition
|
|
106
108
|
* @default "transform"
|
|
107
109
|
*/
|
|
108
110
|
method?: BoundsMethod;
|