react-native-screen-transitions 3.4.0-alpha.0 → 3.4.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -1046
- package/lib/commonjs/blank-stack/navigators/create-blank-stack-navigator.js +69 -2
- package/lib/commonjs/blank-stack/navigators/create-blank-stack-navigator.js.map +1 -1
- package/lib/commonjs/component-stack/navigators/create-component-stack-navigator.js +9 -0
- package/lib/commonjs/component-stack/navigators/create-component-stack-navigator.js.map +1 -1
- package/lib/commonjs/shared/animation/snap-to.js +5 -1
- package/lib/commonjs/shared/animation/snap-to.js.map +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js +195 -0
- package/lib/commonjs/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js.map +1 -0
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-auto-source-measurement.js +7 -14
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-auto-source-measurement.js.map +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.js +19 -18
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.js.map +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.js +54 -0
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.js.map +1 -0
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-group-active-measurement.js +40 -8
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-group-active-measurement.js.map +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.js +72 -0
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.js.map +1 -0
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-initial-layout-handler.js +16 -7
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-initial-layout-handler.js.map +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-pending-destination-measurement.js +7 -4
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-pending-destination-measurement.js.map +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.js +14 -15
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.js.map +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.js +27 -9
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.js.map +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/index.js +22 -8
- package/lib/commonjs/shared/components/create-boundary-component/index.js.map +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/utils/build-boundary-match-key.js +5 -10
- package/lib/commonjs/shared/components/create-boundary-component/utils/build-boundary-match-key.js.map +1 -1
- package/lib/commonjs/shared/components/create-transition-aware-component.js +3 -2
- package/lib/commonjs/shared/components/create-transition-aware-component.js.map +1 -1
- package/lib/commonjs/shared/components/native-screen-container.js +12 -6
- package/lib/commonjs/shared/components/native-screen-container.js.map +1 -1
- package/lib/commonjs/shared/components/native-screen.js +35 -8
- package/lib/commonjs/shared/components/native-screen.js.map +1 -1
- package/lib/commonjs/shared/components/overlay/helpers/get-active-overlay.js +2 -2
- package/lib/commonjs/shared/components/overlay/helpers/get-active-overlay.js.map +1 -1
- package/lib/commonjs/shared/components/overlay/index.js +1 -3
- package/lib/commonjs/shared/components/overlay/index.js.map +1 -1
- package/lib/commonjs/shared/components/overlay/variations/overlay-host.js +2 -16
- package/lib/commonjs/shared/components/overlay/variations/overlay-host.js.map +1 -1
- package/lib/commonjs/shared/components/scene-view.js +2 -4
- package/lib/commonjs/shared/components/scene-view.js.map +1 -1
- package/lib/commonjs/shared/components/screen-container/hooks/use-content-layout.js +60 -0
- package/lib/commonjs/shared/components/screen-container/hooks/use-content-layout.js.map +1 -0
- package/lib/commonjs/shared/components/screen-container/layers/backdrop.js +9 -6
- package/lib/commonjs/shared/components/screen-container/layers/backdrop.js.map +1 -1
- package/lib/commonjs/shared/components/screen-container/layers/content.js +16 -56
- package/lib/commonjs/shared/components/screen-container/layers/content.js.map +1 -1
- package/lib/commonjs/shared/components/screen-container/layers/maybe-masked-navigation-container.js +86 -0
- package/lib/commonjs/shared/components/screen-container/layers/maybe-masked-navigation-container.js.map +1 -0
- package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-close-transition/index.js.map +1 -1
- package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-open-transition.js +17 -4
- package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-open-transition.js.map +1 -1
- package/lib/commonjs/shared/constants.js +6 -2
- package/lib/commonjs/shared/constants.js.map +1 -1
- package/lib/commonjs/shared/hooks/gestures/resolve-screen-gesture-target.js +49 -0
- package/lib/commonjs/shared/hooks/gestures/resolve-screen-gesture-target.js.map +1 -0
- package/lib/commonjs/shared/hooks/gestures/types.js +2 -0
- package/lib/commonjs/shared/hooks/gestures/types.js.map +1 -0
- package/lib/commonjs/shared/hooks/gestures/use-screen-gesture.js +7 -3
- package/lib/commonjs/shared/hooks/gestures/use-screen-gesture.js.map +1 -1
- package/lib/commonjs/shared/hooks/navigation/use-stack.js.map +1 -1
- package/lib/commonjs/shared/index.js +15 -3
- package/lib/commonjs/shared/index.js.map +1 -1
- package/lib/commonjs/shared/providers/gestures/handlers/use-handlers.js +61 -25
- package/lib/commonjs/shared/providers/gestures/handlers/use-handlers.js.map +1 -1
- package/lib/commonjs/shared/providers/gestures/helpers/gesture-activation.js +11 -6
- package/lib/commonjs/shared/providers/gestures/helpers/gesture-activation.js.map +1 -1
- package/lib/commonjs/shared/providers/gestures/helpers/gesture-snap-points.js +44 -0
- package/lib/commonjs/shared/providers/gestures/helpers/gesture-snap-points.js.map +1 -0
- package/lib/commonjs/shared/providers/layout-anchor.provider.js +4 -6
- package/lib/commonjs/shared/providers/layout-anchor.provider.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/animation/animation.provider.js +31 -17
- package/lib/commonjs/shared/providers/screen/animation/animation.provider.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/animation/helpers/derivations.js +1 -9
- package/lib/commonjs/shared/providers/screen/animation/helpers/derivations.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/animation/helpers/pipeline.js +25 -13
- package/lib/commonjs/shared/providers/screen/animation/helpers/pipeline.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/animation/helpers/resolve-screen-animation-target.js +33 -0
- package/lib/commonjs/shared/providers/screen/animation/helpers/resolve-screen-animation-target.js.map +1 -0
- package/lib/commonjs/shared/providers/screen/animation/types.js +2 -0
- package/lib/commonjs/shared/providers/screen/animation/types.js.map +1 -0
- package/lib/commonjs/shared/providers/screen/animation/use-screen-animation.js +9 -3
- package/lib/commonjs/shared/providers/screen/animation/use-screen-animation.js.map +1 -1
- package/lib/commonjs/shared/providers/stack/core.provider.js +14 -21
- package/lib/commonjs/shared/providers/stack/core.provider.js.map +1 -1
- package/lib/commonjs/shared/providers/stack/direct.provider.js +1 -1
- package/lib/commonjs/shared/providers/stack/direct.provider.js.map +1 -1
- package/lib/commonjs/shared/providers/stack/helpers/use-processed-routes.js +1 -1
- package/lib/commonjs/shared/providers/stack/helpers/use-processed-routes.js.map +1 -1
- package/lib/commonjs/shared/stores/animation.store.js +10 -2
- package/lib/commonjs/shared/stores/animation.store.js.map +1 -1
- package/lib/commonjs/shared/stores/bounds/internals/presence.js.map +1 -1
- package/lib/commonjs/shared/stores/bounds/internals/resolver.js +7 -0
- package/lib/commonjs/shared/stores/bounds/internals/resolver.js.map +1 -1
- package/lib/commonjs/shared/utils/animation/animate-to-progress.js +6 -0
- package/lib/commonjs/shared/utils/animation/animate-to-progress.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/helpers/compute-bounds-styles.js +33 -9
- package/lib/commonjs/shared/utils/bounds/helpers/compute-bounds-styles.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/helpers/geometry.js +3 -2
- package/lib/commonjs/shared/utils/bounds/helpers/geometry.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/helpers/interpolators.js +3 -2
- package/lib/commonjs/shared/utils/bounds/helpers/interpolators.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/helpers/link-accessor.js +2 -2
- package/lib/commonjs/shared/utils/bounds/helpers/link-accessor.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/helpers/resolve-bound-tag.js +4 -8
- package/lib/commonjs/shared/utils/bounds/helpers/resolve-bound-tag.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/helpers/style-composers.js +4 -3
- package/lib/commonjs/shared/utils/bounds/helpers/style-composers.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/index.js +13 -3
- package/lib/commonjs/shared/utils/bounds/index.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/types/frame-props.js +6 -0
- package/lib/commonjs/shared/utils/bounds/types/frame-props.js.map +1 -0
- package/lib/commonjs/shared/utils/bounds/zoom/accessor.js +54 -0
- package/lib/commonjs/shared/utils/bounds/zoom/accessor.js.map +1 -0
- package/lib/commonjs/shared/utils/bounds/zoom/build.js +548 -0
- package/lib/commonjs/shared/utils/bounds/zoom/build.js.map +1 -0
- package/lib/commonjs/shared/utils/bounds/zoom/config.js +118 -0
- package/lib/commonjs/shared/utils/bounds/zoom/config.js.map +1 -0
- package/lib/commonjs/shared/utils/bounds/zoom/index.js +20 -0
- package/lib/commonjs/shared/utils/bounds/zoom/index.js.map +1 -0
- package/lib/commonjs/shared/utils/bounds/zoom/types.js.map +1 -0
- package/lib/commonjs/shared/utils/gesture/validate-snap-points.js +11 -5
- package/lib/commonjs/shared/utils/gesture/validate-snap-points.js.map +1 -1
- package/lib/commonjs/shared/utils/overlay/visibility.js +2 -9
- package/lib/commonjs/shared/utils/overlay/visibility.js.map +1 -1
- package/lib/commonjs/shared/utils/resolve-screen-transition-options.js +25 -0
- package/lib/commonjs/shared/utils/resolve-screen-transition-options.js.map +1 -0
- package/lib/module/blank-stack/navigators/create-blank-stack-navigator.js +69 -3
- package/lib/module/blank-stack/navigators/create-blank-stack-navigator.js.map +1 -1
- package/lib/module/component-stack/navigators/create-component-stack-navigator.js +9 -0
- package/lib/module/component-stack/navigators/create-component-stack-navigator.js.map +1 -1
- package/lib/module/shared/animation/snap-to.js +5 -1
- package/lib/module/shared/animation/snap-to.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js +182 -0
- package/lib/module/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js.map +1 -0
- package/lib/module/shared/components/create-boundary-component/hooks/use-auto-source-measurement.js +7 -14
- package/lib/module/shared/components/create-boundary-component/hooks/use-auto-source-measurement.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.js +19 -18
- package/lib/module/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.js +49 -0
- package/lib/module/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.js.map +1 -0
- package/lib/module/shared/components/create-boundary-component/hooks/use-group-active-measurement.js +41 -8
- package/lib/module/shared/components/create-boundary-component/hooks/use-group-active-measurement.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.js +67 -0
- package/lib/module/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.js.map +1 -0
- package/lib/module/shared/components/create-boundary-component/hooks/use-initial-layout-handler.js +16 -7
- package/lib/module/shared/components/create-boundary-component/hooks/use-initial-layout-handler.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-pending-destination-measurement.js +7 -4
- package/lib/module/shared/components/create-boundary-component/hooks/use-pending-destination-measurement.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.js +14 -15
- package/lib/module/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.js +27 -9
- package/lib/module/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/index.js +22 -8
- package/lib/module/shared/components/create-boundary-component/index.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/utils/build-boundary-match-key.js +5 -10
- package/lib/module/shared/components/create-boundary-component/utils/build-boundary-match-key.js.map +1 -1
- package/lib/module/shared/components/create-transition-aware-component.js +3 -2
- package/lib/module/shared/components/create-transition-aware-component.js.map +1 -1
- package/lib/module/shared/components/native-screen-container.js +12 -6
- package/lib/module/shared/components/native-screen-container.js.map +1 -1
- package/lib/module/shared/components/native-screen.js +35 -8
- package/lib/module/shared/components/native-screen.js.map +1 -1
- package/lib/module/shared/components/overlay/helpers/get-active-overlay.js +3 -3
- package/lib/module/shared/components/overlay/helpers/get-active-overlay.js.map +1 -1
- package/lib/module/shared/components/overlay/index.js +1 -3
- package/lib/module/shared/components/overlay/index.js.map +1 -1
- package/lib/module/shared/components/overlay/variations/overlay-host.js +3 -17
- package/lib/module/shared/components/overlay/variations/overlay-host.js.map +1 -1
- package/lib/module/shared/components/scene-view.js +3 -5
- package/lib/module/shared/components/scene-view.js.map +1 -1
- package/lib/module/shared/components/screen-container/hooks/use-content-layout.js +56 -0
- package/lib/module/shared/components/screen-container/hooks/use-content-layout.js.map +1 -0
- package/lib/module/shared/components/screen-container/layers/backdrop.js +9 -6
- package/lib/module/shared/components/screen-container/layers/backdrop.js.map +1 -1
- package/lib/module/shared/components/screen-container/layers/content.js +18 -58
- package/lib/module/shared/components/screen-container/layers/content.js.map +1 -1
- package/lib/module/shared/components/screen-container/layers/maybe-masked-navigation-container.js +81 -0
- package/lib/module/shared/components/screen-container/layers/maybe-masked-navigation-container.js.map +1 -0
- package/lib/module/shared/components/screen-lifecycle/hooks/use-close-transition/index.js.map +1 -1
- package/lib/module/shared/components/screen-lifecycle/hooks/use-open-transition.js +17 -4
- package/lib/module/shared/components/screen-lifecycle/hooks/use-open-transition.js.map +1 -1
- package/lib/module/shared/constants.js +6 -2
- package/lib/module/shared/constants.js.map +1 -1
- package/lib/module/shared/hooks/gestures/resolve-screen-gesture-target.js +45 -0
- package/lib/module/shared/hooks/gestures/resolve-screen-gesture-target.js.map +1 -0
- package/lib/module/shared/hooks/gestures/types.js +2 -0
- package/lib/module/shared/hooks/gestures/types.js.map +1 -0
- package/lib/module/shared/hooks/gestures/use-screen-gesture.js +7 -4
- package/lib/module/shared/hooks/gestures/use-screen-gesture.js.map +1 -1
- package/lib/module/shared/hooks/navigation/use-stack.js.map +1 -1
- package/lib/module/shared/index.js +1 -2
- package/lib/module/shared/index.js.map +1 -1
- package/lib/module/shared/providers/gestures/handlers/use-handlers.js +61 -25
- package/lib/module/shared/providers/gestures/handlers/use-handlers.js.map +1 -1
- package/lib/module/shared/providers/gestures/helpers/gesture-activation.js +11 -6
- package/lib/module/shared/providers/gestures/helpers/gesture-activation.js.map +1 -1
- package/lib/module/shared/providers/gestures/helpers/gesture-snap-points.js +38 -0
- package/lib/module/shared/providers/gestures/helpers/gesture-snap-points.js.map +1 -0
- package/lib/module/shared/providers/layout-anchor.provider.js +4 -6
- package/lib/module/shared/providers/layout-anchor.provider.js.map +1 -1
- package/lib/module/shared/providers/screen/animation/animation.provider.js +30 -15
- package/lib/module/shared/providers/screen/animation/animation.provider.js.map +1 -1
- package/lib/module/shared/providers/screen/animation/helpers/derivations.js +1 -9
- package/lib/module/shared/providers/screen/animation/helpers/derivations.js.map +1 -1
- package/lib/module/shared/providers/screen/animation/helpers/pipeline.js +25 -13
- package/lib/module/shared/providers/screen/animation/helpers/pipeline.js.map +1 -1
- package/lib/module/shared/providers/screen/animation/helpers/resolve-screen-animation-target.js +29 -0
- package/lib/module/shared/providers/screen/animation/helpers/resolve-screen-animation-target.js.map +1 -0
- package/lib/module/shared/providers/screen/animation/index.js.map +1 -1
- package/lib/module/shared/providers/screen/animation/types.js +2 -0
- package/lib/module/shared/providers/screen/animation/types.js.map +1 -0
- package/lib/module/shared/providers/screen/animation/use-screen-animation.js +9 -3
- package/lib/module/shared/providers/screen/animation/use-screen-animation.js.map +1 -1
- package/lib/module/shared/providers/stack/core.provider.js +14 -21
- package/lib/module/shared/providers/stack/core.provider.js.map +1 -1
- package/lib/module/shared/providers/stack/direct.provider.js +2 -2
- package/lib/module/shared/providers/stack/direct.provider.js.map +1 -1
- package/lib/module/shared/providers/stack/helpers/use-processed-routes.js +2 -2
- package/lib/module/shared/providers/stack/helpers/use-processed-routes.js.map +1 -1
- package/lib/module/shared/stores/animation.store.js +10 -2
- package/lib/module/shared/stores/animation.store.js.map +1 -1
- package/lib/module/shared/stores/bounds/internals/presence.js.map +1 -1
- package/lib/module/shared/stores/bounds/internals/resolver.js +7 -0
- package/lib/module/shared/stores/bounds/internals/resolver.js.map +1 -1
- package/lib/module/shared/utils/animation/animate-to-progress.js +6 -0
- package/lib/module/shared/utils/animation/animate-to-progress.js.map +1 -1
- package/lib/module/shared/utils/bounds/helpers/compute-bounds-styles.js +33 -9
- package/lib/module/shared/utils/bounds/helpers/compute-bounds-styles.js.map +1 -1
- package/lib/module/shared/utils/bounds/helpers/geometry.js +3 -2
- package/lib/module/shared/utils/bounds/helpers/geometry.js.map +1 -1
- package/lib/module/shared/utils/bounds/helpers/interpolators.js +3 -2
- package/lib/module/shared/utils/bounds/helpers/interpolators.js.map +1 -1
- package/lib/module/shared/utils/bounds/helpers/link-accessor.js +2 -2
- package/lib/module/shared/utils/bounds/helpers/link-accessor.js.map +1 -1
- package/lib/module/shared/utils/bounds/helpers/resolve-bound-tag.js +4 -8
- package/lib/module/shared/utils/bounds/helpers/resolve-bound-tag.js.map +1 -1
- package/lib/module/shared/utils/bounds/helpers/style-composers.js +4 -3
- package/lib/module/shared/utils/bounds/helpers/style-composers.js.map +1 -1
- package/lib/module/shared/utils/bounds/index.js +13 -3
- package/lib/module/shared/utils/bounds/index.js.map +1 -1
- package/lib/module/shared/utils/bounds/types/frame-props.js +4 -0
- package/lib/module/shared/utils/bounds/types/frame-props.js.map +1 -0
- package/lib/module/shared/utils/bounds/zoom/accessor.js +49 -0
- package/lib/module/shared/utils/bounds/zoom/accessor.js.map +1 -0
- package/lib/module/shared/utils/bounds/zoom/build.js +543 -0
- package/lib/module/shared/utils/bounds/zoom/build.js.map +1 -0
- package/lib/module/shared/utils/bounds/zoom/config.js +112 -0
- package/lib/module/shared/utils/bounds/zoom/config.js.map +1 -0
- package/lib/module/shared/utils/bounds/zoom/index.js +5 -0
- package/lib/module/shared/utils/bounds/zoom/index.js.map +1 -0
- package/lib/module/shared/utils/bounds/zoom/types.js.map +1 -0
- package/lib/module/shared/utils/gesture/validate-snap-points.js +11 -5
- package/lib/module/shared/utils/gesture/validate-snap-points.js.map +1 -1
- package/lib/module/shared/utils/overlay/visibility.js +1 -7
- package/lib/module/shared/utils/overlay/visibility.js.map +1 -1
- package/lib/module/shared/utils/resolve-screen-transition-options.js +19 -0
- package/lib/module/shared/utils/resolve-screen-transition-options.js.map +1 -0
- package/lib/typescript/blank-stack/index.d.ts +1 -1
- package/lib/typescript/blank-stack/index.d.ts.map +1 -1
- package/lib/typescript/blank-stack/navigators/create-blank-stack-navigator.d.ts +29 -4
- package/lib/typescript/blank-stack/navigators/create-blank-stack-navigator.d.ts.map +1 -1
- package/lib/typescript/blank-stack/types.d.ts +33 -4
- package/lib/typescript/blank-stack/types.d.ts.map +1 -1
- package/lib/typescript/component-stack/navigators/create-component-stack-navigator.d.ts +8 -0
- package/lib/typescript/component-stack/navigators/create-component-stack-navigator.d.ts.map +1 -1
- package/lib/typescript/shared/animation/snap-to.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/helpers/measurement-rules.d.ts +81 -0
- package/lib/typescript/shared/components/create-boundary-component/hooks/helpers/measurement-rules.d.ts.map +1 -0
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-auto-source-measurement.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.d.ts +2 -3
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.d.ts +11 -0
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.d.ts.map +1 -0
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-group-active-measurement.d.ts +2 -2
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-group-active-measurement.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.d.ts +11 -0
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.d.ts.map +1 -0
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-initial-layout-handler.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-pending-destination-measurement.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.d.ts +3 -3
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.d.ts +2 -2
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/index.d.ts +5 -3
- package/lib/typescript/shared/components/create-boundary-component/index.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/types.d.ts +2 -4
- package/lib/typescript/shared/components/create-boundary-component/types.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/utils/build-boundary-match-key.d.ts +0 -1
- package/lib/typescript/shared/components/create-boundary-component/utils/build-boundary-match-key.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-transition-aware-component.d.ts +1 -0
- package/lib/typescript/shared/components/create-transition-aware-component.d.ts.map +1 -1
- package/lib/typescript/shared/components/native-screen-container.d.ts.map +1 -1
- package/lib/typescript/shared/components/native-screen.d.ts.map +1 -1
- package/lib/typescript/shared/components/overlay/helpers/get-active-overlay.d.ts +1 -1
- package/lib/typescript/shared/components/overlay/index.d.ts +0 -2
- package/lib/typescript/shared/components/overlay/index.d.ts.map +1 -1
- package/lib/typescript/shared/components/overlay/variations/overlay-host.d.ts.map +1 -1
- package/lib/typescript/shared/components/scene-view.d.ts.map +1 -1
- package/lib/typescript/shared/components/screen-container/hooks/use-content-layout.d.ts +3 -0
- package/lib/typescript/shared/components/screen-container/hooks/use-content-layout.d.ts.map +1 -0
- package/lib/typescript/shared/components/screen-container/layers/backdrop.d.ts.map +1 -1
- package/lib/typescript/shared/components/screen-container/layers/content.d.ts.map +1 -1
- package/lib/typescript/shared/components/screen-container/layers/maybe-masked-navigation-container.d.ts +9 -0
- package/lib/typescript/shared/components/screen-container/layers/maybe-masked-navigation-container.d.ts.map +1 -0
- package/lib/typescript/shared/components/screen-lifecycle/hooks/use-close-transition/index.d.ts.map +1 -1
- package/lib/typescript/shared/components/screen-lifecycle/hooks/use-open-transition.d.ts.map +1 -1
- package/lib/typescript/shared/constants.d.ts +3 -0
- package/lib/typescript/shared/constants.d.ts.map +1 -1
- package/lib/typescript/shared/hooks/gestures/resolve-screen-gesture-target.d.ts +10 -0
- package/lib/typescript/shared/hooks/gestures/resolve-screen-gesture-target.d.ts.map +1 -0
- package/lib/typescript/shared/hooks/gestures/types.d.ts +4 -0
- package/lib/typescript/shared/hooks/gestures/types.d.ts.map +1 -0
- package/lib/typescript/shared/hooks/gestures/use-screen-gesture.d.ts +4 -2
- package/lib/typescript/shared/hooks/gestures/use-screen-gesture.d.ts.map +1 -1
- package/lib/typescript/shared/hooks/navigation/use-stack.d.ts +1 -2
- package/lib/typescript/shared/hooks/navigation/use-stack.d.ts.map +1 -1
- package/lib/typescript/shared/index.d.ts +16 -18
- package/lib/typescript/shared/index.d.ts.map +1 -1
- package/lib/typescript/shared/providers/gestures/handlers/use-handlers.d.ts +1 -1
- package/lib/typescript/shared/providers/gestures/handlers/use-handlers.d.ts.map +1 -1
- package/lib/typescript/shared/providers/gestures/helpers/gesture-activation.d.ts.map +1 -1
- package/lib/typescript/shared/providers/gestures/helpers/gesture-snap-points.d.ts +18 -0
- package/lib/typescript/shared/providers/gestures/helpers/gesture-snap-points.d.ts.map +1 -0
- package/lib/typescript/shared/providers/layout-anchor.provider.d.ts +1 -1
- package/lib/typescript/shared/providers/layout-anchor.provider.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/animation/animation.provider.d.ts +6 -3
- package/lib/typescript/shared/providers/screen/animation/animation.provider.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/animation/helpers/derivations.d.ts +0 -2
- package/lib/typescript/shared/providers/screen/animation/helpers/derivations.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/animation/helpers/pipeline.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/animation/helpers/resolve-screen-animation-target.d.ts +11 -0
- package/lib/typescript/shared/providers/screen/animation/helpers/resolve-screen-animation-target.d.ts.map +1 -0
- package/lib/typescript/shared/providers/screen/animation/index.d.ts +1 -1
- package/lib/typescript/shared/providers/screen/animation/index.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/animation/types.d.ts +4 -0
- package/lib/typescript/shared/providers/screen/animation/types.d.ts.map +1 -0
- package/lib/typescript/shared/providers/screen/animation/use-screen-animation.d.ts +5 -1
- package/lib/typescript/shared/providers/screen/animation/use-screen-animation.d.ts.map +1 -1
- package/lib/typescript/shared/providers/stack/core.provider.d.ts +2 -0
- package/lib/typescript/shared/providers/stack/core.provider.d.ts.map +1 -1
- package/lib/typescript/shared/providers/stack/direct.provider.d.ts.map +1 -1
- package/lib/typescript/shared/stores/animation.store.d.ts +8 -2
- package/lib/typescript/shared/stores/animation.store.d.ts.map +1 -1
- package/lib/typescript/shared/stores/bounds/internals/presence.d.ts.map +1 -1
- package/lib/typescript/shared/stores/bounds/internals/resolver.d.ts.map +1 -1
- package/lib/typescript/shared/stores/bounds/types.d.ts +2 -0
- package/lib/typescript/shared/stores/bounds/types.d.ts.map +1 -1
- package/lib/typescript/shared/types/animation.types.d.ts +33 -51
- package/lib/typescript/shared/types/animation.types.d.ts.map +1 -1
- package/lib/typescript/shared/types/bounds.types.d.ts +46 -9
- package/lib/typescript/shared/types/bounds.types.d.ts.map +1 -1
- package/lib/typescript/shared/types/index.d.ts +3 -3
- package/lib/typescript/shared/types/index.d.ts.map +1 -1
- package/lib/typescript/shared/types/overlay.types.d.ts +1 -22
- package/lib/typescript/shared/types/overlay.types.d.ts.map +1 -1
- package/lib/typescript/shared/types/screen.types.d.ts +62 -37
- package/lib/typescript/shared/types/screen.types.d.ts.map +1 -1
- package/lib/typescript/shared/utils/animation/animate-to-progress.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/helpers/build-bounds-options.d.ts +2 -2
- package/lib/typescript/shared/utils/bounds/helpers/build-bounds-options.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/helpers/compute-bounds-styles.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/helpers/geometry.d.ts +3 -2
- package/lib/typescript/shared/utils/bounds/helpers/geometry.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/helpers/interpolators.d.ts +3 -2
- package/lib/typescript/shared/utils/bounds/helpers/interpolators.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/helpers/link-accessor.d.ts +3 -2
- package/lib/typescript/shared/utils/bounds/helpers/link-accessor.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/helpers/resolve-bound-tag.d.ts +2 -1
- package/lib/typescript/shared/utils/bounds/helpers/resolve-bound-tag.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/helpers/style-composers.d.ts +4 -3
- package/lib/typescript/shared/utils/bounds/helpers/style-composers.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/index.d.ts +2 -2
- package/lib/typescript/shared/utils/bounds/index.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/types/frame-props.d.ts +5 -0
- package/lib/typescript/shared/utils/bounds/types/frame-props.d.ts.map +1 -0
- package/lib/typescript/shared/utils/bounds/types/options.d.ts +5 -4
- package/lib/typescript/shared/utils/bounds/types/options.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/zoom/accessor.d.ts +17 -0
- package/lib/typescript/shared/utils/bounds/zoom/accessor.d.ts.map +1 -0
- package/lib/typescript/shared/utils/bounds/zoom/build.d.ts +4 -0
- package/lib/typescript/shared/utils/bounds/zoom/build.d.ts.map +1 -0
- package/lib/typescript/shared/utils/bounds/zoom/config.d.ts +43 -0
- package/lib/typescript/shared/utils/bounds/zoom/config.d.ts.map +1 -0
- package/lib/typescript/shared/utils/bounds/zoom/index.d.ts +3 -0
- package/lib/typescript/shared/utils/bounds/zoom/index.d.ts.map +1 -0
- package/lib/typescript/shared/utils/bounds/zoom/types.d.ts +17 -0
- package/lib/typescript/shared/utils/bounds/zoom/types.d.ts.map +1 -0
- package/lib/typescript/shared/utils/gesture/validate-snap-points.d.ts +5 -3
- package/lib/typescript/shared/utils/gesture/validate-snap-points.d.ts.map +1 -1
- package/lib/typescript/shared/utils/overlay/visibility.d.ts +1 -4
- package/lib/typescript/shared/utils/overlay/visibility.d.ts.map +1 -1
- package/lib/typescript/shared/utils/resolve-screen-transition-options.d.ts +5 -0
- package/lib/typescript/shared/utils/resolve-screen-transition-options.d.ts.map +1 -0
- package/package.json +3 -2
- package/src/blank-stack/index.ts +1 -0
- package/src/blank-stack/navigators/create-blank-stack-navigator.tsx +138 -19
- package/src/blank-stack/types.ts +33 -5
- package/src/component-stack/navigators/create-component-stack-navigator.tsx +8 -0
- package/src/shared/animation/snap-to.ts +12 -1
- package/src/shared/components/create-boundary-component/hooks/helpers/measurement-rules.ts +258 -0
- package/src/shared/components/create-boundary-component/hooks/use-auto-source-measurement.ts +7 -17
- package/src/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.ts +38 -28
- package/src/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.ts +58 -0
- package/src/shared/components/create-boundary-component/hooks/use-group-active-measurement.ts +41 -10
- package/src/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.ts +82 -0
- package/src/shared/components/create-boundary-component/hooks/use-initial-layout-handler.ts +24 -12
- package/src/shared/components/create-boundary-component/hooks/use-pending-destination-measurement.ts +11 -9
- package/src/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.ts +29 -26
- package/src/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.ts +26 -17
- package/src/shared/components/create-boundary-component/index.tsx +25 -6
- package/src/shared/components/create-boundary-component/types.ts +8 -4
- package/src/shared/components/create-boundary-component/utils/build-boundary-match-key.ts +2 -14
- package/src/shared/components/create-transition-aware-component.tsx +5 -2
- package/src/shared/components/native-screen-container.tsx +11 -3
- package/src/shared/components/native-screen.tsx +65 -20
- package/src/shared/components/overlay/helpers/get-active-overlay.ts +3 -3
- package/src/shared/components/overlay/index.ts +0 -2
- package/src/shared/components/overlay/variations/overlay-host.tsx +2 -16
- package/src/shared/components/scene-view.tsx +0 -3
- package/src/shared/components/screen-container/hooks/use-content-layout.ts +82 -0
- package/src/shared/components/screen-container/layers/backdrop.tsx +25 -6
- package/src/shared/components/screen-container/layers/content.tsx +23 -82
- package/src/shared/components/screen-container/layers/maybe-masked-navigation-container.tsx +101 -0
- package/src/shared/components/screen-lifecycle/hooks/use-close-transition/index.ts +1 -2
- package/src/shared/components/screen-lifecycle/hooks/use-open-transition.ts +20 -6
- package/src/shared/constants.ts +6 -2
- package/src/shared/hooks/gestures/resolve-screen-gesture-target.ts +66 -0
- package/src/shared/hooks/gestures/types.ts +5 -0
- package/src/shared/hooks/gestures/use-screen-gesture.ts +10 -3
- package/src/shared/hooks/navigation/use-stack.tsx +1 -2
- package/src/shared/index.ts +14 -16
- package/src/shared/providers/gestures/handlers/use-handlers.ts +75 -29
- package/src/shared/providers/gestures/helpers/gesture-activation.ts +11 -6
- package/src/shared/providers/gestures/helpers/gesture-snap-points.ts +72 -0
- package/src/shared/providers/layout-anchor.provider.tsx +2 -5
- package/src/shared/providers/register-bounds.provider.tsx +1 -1
- package/src/shared/providers/screen/animation/animation.provider.tsx +46 -10
- package/src/shared/providers/screen/animation/helpers/derivations.ts +0 -8
- package/src/shared/providers/screen/animation/helpers/pipeline.ts +51 -14
- package/src/shared/providers/screen/animation/helpers/resolve-screen-animation-target.ts +44 -0
- package/src/shared/providers/screen/animation/index.tsx +4 -1
- package/src/shared/providers/screen/animation/types.ts +5 -0
- package/src/shared/providers/screen/animation/use-screen-animation.tsx +16 -3
- package/src/shared/providers/stack/core.provider.tsx +27 -14
- package/src/shared/providers/stack/direct.provider.tsx +2 -5
- package/src/shared/providers/stack/helpers/use-processed-routes.ts +2 -2
- package/src/shared/stores/animation.store.ts +21 -5
- package/src/shared/stores/bounds/internals/presence.ts +3 -1
- package/src/shared/stores/bounds/internals/resolver.ts +13 -1
- package/src/shared/stores/bounds/types.ts +2 -0
- package/src/shared/types/animation.types.ts +32 -58
- package/src/shared/types/bounds.types.ts +30 -10
- package/src/shared/types/index.ts +2 -15
- package/src/shared/types/overlay.types.ts +1 -28
- package/src/shared/types/screen.types.ts +67 -38
- package/src/shared/utils/animation/animate-to-progress.ts +7 -0
- package/src/shared/utils/bounds/helpers/build-bounds-options.ts +2 -2
- package/src/shared/utils/bounds/helpers/compute-bounds-styles.ts +47 -8
- package/src/shared/utils/bounds/helpers/geometry.ts +3 -2
- package/src/shared/utils/bounds/helpers/interpolators.ts +8 -6
- package/src/shared/utils/bounds/helpers/link-accessor.ts +10 -6
- package/src/shared/utils/bounds/helpers/resolve-bound-tag.ts +7 -10
- package/src/shared/utils/bounds/helpers/style-composers.ts +4 -3
- package/src/shared/utils/bounds/index.ts +22 -13
- package/src/shared/utils/bounds/types/frame-props.ts +5 -0
- package/src/shared/utils/bounds/types/options.ts +6 -4
- package/src/shared/utils/bounds/zoom/accessor.ts +69 -0
- package/src/shared/utils/bounds/zoom/build.ts +715 -0
- package/src/shared/utils/bounds/zoom/config.ts +179 -0
- package/src/shared/utils/bounds/zoom/index.ts +2 -0
- package/src/shared/utils/bounds/zoom/types.ts +22 -0
- package/src/shared/utils/gesture/validate-snap-points.ts +20 -8
- package/src/shared/utils/overlay/visibility.ts +1 -16
- package/src/shared/utils/resolve-screen-transition-options.ts +37 -0
- package/lib/commonjs/shared/components/overlay/variations/screen-overlay.js +0 -64
- package/lib/commonjs/shared/components/overlay/variations/screen-overlay.js.map +0 -1
- package/lib/commonjs/shared/providers/viewport.provider.js +0 -33
- package/lib/commonjs/shared/providers/viewport.provider.js.map +0 -1
- package/lib/commonjs/shared/utils/bounds/helpers/math.js +0 -132
- package/lib/commonjs/shared/utils/bounds/helpers/math.js.map +0 -1
- package/lib/commonjs/shared/utils/bounds/helpers/navigation-accessor.js +0 -45
- package/lib/commonjs/shared/utils/bounds/helpers/navigation-accessor.js.map +0 -1
- package/lib/commonjs/shared/utils/bounds/sugar/navigation/helpers.js +0 -60
- package/lib/commonjs/shared/utils/bounds/sugar/navigation/helpers.js.map +0 -1
- package/lib/commonjs/shared/utils/bounds/sugar/navigation/index.js +0 -20
- package/lib/commonjs/shared/utils/bounds/sugar/navigation/index.js.map +0 -1
- package/lib/commonjs/shared/utils/bounds/sugar/navigation/types.js.map +0 -1
- package/lib/commonjs/shared/utils/bounds/sugar/navigation/zoom.js +0 -295
- package/lib/commonjs/shared/utils/bounds/sugar/navigation/zoom.js.map +0 -1
- package/lib/module/shared/components/overlay/variations/screen-overlay.js +0 -61
- package/lib/module/shared/components/overlay/variations/screen-overlay.js.map +0 -1
- package/lib/module/shared/providers/viewport.provider.js +0 -27
- package/lib/module/shared/providers/viewport.provider.js.map +0 -1
- package/lib/module/shared/utils/bounds/helpers/math.js +0 -115
- package/lib/module/shared/utils/bounds/helpers/math.js.map +0 -1
- package/lib/module/shared/utils/bounds/helpers/navigation-accessor.js +0 -40
- package/lib/module/shared/utils/bounds/helpers/navigation-accessor.js.map +0 -1
- package/lib/module/shared/utils/bounds/sugar/navigation/helpers.js +0 -54
- package/lib/module/shared/utils/bounds/sugar/navigation/helpers.js.map +0 -1
- package/lib/module/shared/utils/bounds/sugar/navigation/index.js +0 -15
- package/lib/module/shared/utils/bounds/sugar/navigation/index.js.map +0 -1
- package/lib/module/shared/utils/bounds/sugar/navigation/types.js.map +0 -1
- package/lib/module/shared/utils/bounds/sugar/navigation/zoom.js +0 -290
- package/lib/module/shared/utils/bounds/sugar/navigation/zoom.js.map +0 -1
- package/lib/typescript/shared/components/overlay/variations/screen-overlay.d.ts +0 -10
- package/lib/typescript/shared/components/overlay/variations/screen-overlay.d.ts.map +0 -1
- package/lib/typescript/shared/providers/viewport.provider.d.ts +0 -13
- package/lib/typescript/shared/providers/viewport.provider.d.ts.map +0 -1
- package/lib/typescript/shared/utils/bounds/helpers/math.d.ts +0 -38
- package/lib/typescript/shared/utils/bounds/helpers/math.d.ts.map +0 -1
- package/lib/typescript/shared/utils/bounds/helpers/navigation-accessor.d.ts +0 -16
- package/lib/typescript/shared/utils/bounds/helpers/navigation-accessor.d.ts.map +0 -1
- package/lib/typescript/shared/utils/bounds/sugar/navigation/helpers.d.ts +0 -17
- package/lib/typescript/shared/utils/bounds/sugar/navigation/helpers.d.ts.map +0 -1
- package/lib/typescript/shared/utils/bounds/sugar/navigation/index.d.ts +0 -3
- package/lib/typescript/shared/utils/bounds/sugar/navigation/index.d.ts.map +0 -1
- package/lib/typescript/shared/utils/bounds/sugar/navigation/types.d.ts +0 -18
- package/lib/typescript/shared/utils/bounds/sugar/navigation/types.d.ts.map +0 -1
- package/lib/typescript/shared/utils/bounds/sugar/navigation/zoom.d.ts +0 -4
- package/lib/typescript/shared/utils/bounds/sugar/navigation/zoom.d.ts.map +0 -1
- package/src/shared/components/overlay/variations/screen-overlay.tsx +0 -68
- package/src/shared/providers/viewport.provider.tsx +0 -39
- package/src/shared/utils/bounds/helpers/math.ts +0 -161
- package/src/shared/utils/bounds/helpers/navigation-accessor.ts +0 -61
- package/src/shared/utils/bounds/sugar/navigation/helpers.ts +0 -74
- package/src/shared/utils/bounds/sugar/navigation/index.ts +0 -14
- package/src/shared/utils/bounds/sugar/navigation/types.ts +0 -26
- package/src/shared/utils/bounds/sugar/navigation/zoom.ts +0 -348
- /package/lib/commonjs/shared/utils/bounds/{sugar/navigation → zoom}/types.js +0 -0
- /package/lib/module/shared/utils/bounds/{sugar/navigation → zoom}/types.js +0 -0
package/src/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.ts
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { type SharedValue, useAnimatedReaction } from "react-native-reanimated";
|
|
2
|
+
import { BoundStore } from "../../../stores/bounds";
|
|
3
|
+
import type { BoundaryId, MaybeMeasureAndStoreParams } from "../types";
|
|
4
|
+
import {
|
|
5
|
+
canFlushGroupActiveMeasurement,
|
|
6
|
+
resolveGroupActiveMeasurementAction,
|
|
7
|
+
} from "./helpers/measurement-rules";
|
|
8
|
+
import { useDeferredMeasurementTrigger } from "./use-deferred-measurement-trigger";
|
|
9
|
+
|
|
10
|
+
export const useGroupActiveSourceMeasurement = (params: {
|
|
11
|
+
enabled: boolean;
|
|
12
|
+
group: string | undefined;
|
|
13
|
+
id: BoundaryId;
|
|
14
|
+
hasNextScreen: boolean;
|
|
15
|
+
isAnimating: SharedValue<number>;
|
|
16
|
+
maybeMeasureAndStore: (options: MaybeMeasureAndStoreParams) => void;
|
|
17
|
+
}) => {
|
|
18
|
+
const {
|
|
19
|
+
enabled,
|
|
20
|
+
group,
|
|
21
|
+
id,
|
|
22
|
+
hasNextScreen,
|
|
23
|
+
isAnimating,
|
|
24
|
+
maybeMeasureAndStore,
|
|
25
|
+
} = params;
|
|
26
|
+
const idStr = String(id);
|
|
27
|
+
const allGroups = BoundStore.getGroups();
|
|
28
|
+
const { clearPendingMeasurement, queueOrFlushMeasurement } =
|
|
29
|
+
useDeferredMeasurementTrigger({
|
|
30
|
+
enabled,
|
|
31
|
+
isAnimating,
|
|
32
|
+
canFlush: () => {
|
|
33
|
+
"worklet";
|
|
34
|
+
return canFlushGroupActiveMeasurement({
|
|
35
|
+
enabled,
|
|
36
|
+
isEligible: !!group && hasNextScreen,
|
|
37
|
+
memberId: idStr,
|
|
38
|
+
activeId: group ? (allGroups.value[group]?.activeId ?? null) : null,
|
|
39
|
+
});
|
|
40
|
+
},
|
|
41
|
+
onFlush: () => {
|
|
42
|
+
"worklet";
|
|
43
|
+
maybeMeasureAndStore({ intent: "refresh-source" });
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
useAnimatedReaction(
|
|
48
|
+
() => {
|
|
49
|
+
"worklet";
|
|
50
|
+
if (!enabled) return null;
|
|
51
|
+
if (!group) return null;
|
|
52
|
+
return allGroups.value[group]?.activeId ?? null;
|
|
53
|
+
},
|
|
54
|
+
(activeId, previousActiveId) => {
|
|
55
|
+
"worklet";
|
|
56
|
+
const action = resolveGroupActiveMeasurementAction({
|
|
57
|
+
enabled,
|
|
58
|
+
isEligible: !!group && hasNextScreen,
|
|
59
|
+
memberId: idStr,
|
|
60
|
+
activeId,
|
|
61
|
+
previousActiveId,
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
if (action === "clear-pending") {
|
|
65
|
+
clearPendingMeasurement();
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
if (action === "queue-or-flush") {
|
|
70
|
+
queueOrFlushMeasurement();
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
[
|
|
74
|
+
enabled,
|
|
75
|
+
group,
|
|
76
|
+
idStr,
|
|
77
|
+
hasNextScreen,
|
|
78
|
+
clearPendingMeasurement,
|
|
79
|
+
queueOrFlushMeasurement,
|
|
80
|
+
],
|
|
81
|
+
);
|
|
82
|
+
};
|
|
@@ -4,6 +4,7 @@ import { AnimationStore } from "../../../stores/animation.store";
|
|
|
4
4
|
import { BoundStore } from "../../../stores/bounds";
|
|
5
5
|
import { resolvePendingSourceKey } from "../helpers/resolve-pending-source-key";
|
|
6
6
|
import type { MaybeMeasureAndStoreParams } from "../types";
|
|
7
|
+
import { resolveInitialLayoutMeasurementIntent } from "./helpers/measurement-rules";
|
|
7
8
|
|
|
8
9
|
export const useInitialLayoutHandler = (params: {
|
|
9
10
|
enabled: boolean;
|
|
@@ -46,21 +47,32 @@ export const useInitialLayoutHandler = (params: {
|
|
|
46
47
|
}
|
|
47
48
|
}
|
|
48
49
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
50
|
+
let hasPendingLinkFromSource = false;
|
|
51
|
+
|
|
52
|
+
if (isAnyAnimating) {
|
|
53
|
+
const resolvedSourceKey = resolvePendingSourceKey(
|
|
54
|
+
sharedBoundTag,
|
|
55
|
+
expectedSourceScreenKey,
|
|
56
|
+
);
|
|
57
|
+
if (
|
|
58
|
+
resolvedSourceKey &&
|
|
59
|
+
BoundStore.hasPendingLinkFromSource(sharedBoundTag, resolvedSourceKey)
|
|
60
|
+
) {
|
|
61
|
+
hasPendingLinkFromSource = true;
|
|
62
|
+
}
|
|
59
63
|
}
|
|
60
64
|
|
|
65
|
+
const intent = resolveInitialLayoutMeasurementIntent({
|
|
66
|
+
enabled,
|
|
67
|
+
hasSharedBoundTag: !!sharedBoundTag,
|
|
68
|
+
hasMeasuredOnLayout: hasMeasuredOnLayout.get(),
|
|
69
|
+
isAnyAnimating: !!isAnyAnimating,
|
|
70
|
+
hasPendingLinkFromSource,
|
|
71
|
+
});
|
|
72
|
+
if (!intent) return;
|
|
73
|
+
|
|
61
74
|
maybeMeasureAndStore({
|
|
62
|
-
|
|
63
|
-
shouldSetDestination: true,
|
|
75
|
+
intent,
|
|
64
76
|
});
|
|
65
77
|
|
|
66
78
|
hasMeasuredOnLayout.set(true);
|
package/src/shared/components/create-boundary-component/hooks/use-pending-destination-measurement.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { useAnimatedReaction } from "react-native-reanimated";
|
|
|
2
2
|
import { BoundStore } from "../../../stores/bounds";
|
|
3
3
|
import { resolvePendingSourceKey } from "../helpers/resolve-pending-source-key";
|
|
4
4
|
import type { MaybeMeasureAndStoreParams } from "../types";
|
|
5
|
+
import { resolvePendingDestinationCaptureSignal } from "./helpers/measurement-rules";
|
|
5
6
|
|
|
6
7
|
export const usePendingDestinationMeasurement = (params: {
|
|
7
8
|
sharedBoundTag: string;
|
|
@@ -19,19 +20,20 @@ export const usePendingDestinationMeasurement = (params: {
|
|
|
19
20
|
useAnimatedReaction(
|
|
20
21
|
() => {
|
|
21
22
|
"worklet";
|
|
22
|
-
if (!enabled) return 0;
|
|
23
23
|
const resolvedSourceKey = resolvePendingSourceKey(
|
|
24
24
|
sharedBoundTag,
|
|
25
25
|
expectedSourceScreenKey,
|
|
26
26
|
);
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
return BoundStore.hasPendingLinkFromSource(
|
|
30
|
-
sharedBoundTag,
|
|
27
|
+
return resolvePendingDestinationCaptureSignal({
|
|
28
|
+
enabled,
|
|
31
29
|
resolvedSourceKey,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
hasPendingLinkFromSource: resolvedSourceKey
|
|
31
|
+
? BoundStore.hasPendingLinkFromSource(
|
|
32
|
+
sharedBoundTag,
|
|
33
|
+
resolvedSourceKey,
|
|
34
|
+
)
|
|
35
|
+
: false,
|
|
36
|
+
});
|
|
35
37
|
},
|
|
36
38
|
(captureSignal, previousCaptureSignal) => {
|
|
37
39
|
"worklet";
|
|
@@ -40,7 +42,7 @@ export const usePendingDestinationMeasurement = (params: {
|
|
|
40
42
|
return;
|
|
41
43
|
}
|
|
42
44
|
|
|
43
|
-
maybeMeasureAndStore({
|
|
45
|
+
maybeMeasureAndStore({ intent: "complete-destination" });
|
|
44
46
|
},
|
|
45
47
|
[enabled, sharedBoundTag, expectedSourceScreenKey, maybeMeasureAndStore],
|
|
46
48
|
);
|
|
@@ -1,16 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import {
|
|
2
|
+
type SharedValue,
|
|
3
|
+
useAnimatedReaction,
|
|
4
|
+
useSharedValue,
|
|
5
|
+
} from "react-native-reanimated";
|
|
3
6
|
import { BoundStore } from "../../../stores/bounds";
|
|
4
7
|
import { resolvePendingSourceKey } from "../helpers/resolve-pending-source-key";
|
|
5
8
|
import type { MaybeMeasureAndStoreParams } from "../types";
|
|
9
|
+
import { resolvePendingDestinationRetrySignal } from "./helpers/measurement-rules";
|
|
6
10
|
|
|
7
11
|
export const usePendingDestinationRetryMeasurement = (params: {
|
|
8
12
|
sharedBoundTag: string;
|
|
9
13
|
enabled: boolean;
|
|
10
14
|
currentScreenKey: string;
|
|
11
15
|
expectedSourceScreenKey?: string;
|
|
12
|
-
progress:
|
|
13
|
-
animating:
|
|
16
|
+
progress: SharedValue<number>;
|
|
17
|
+
animating: SharedValue<number>;
|
|
14
18
|
maybeMeasureAndStore: (options: MaybeMeasureAndStoreParams) => void;
|
|
15
19
|
}) => {
|
|
16
20
|
const {
|
|
@@ -31,31 +35,30 @@ export const usePendingDestinationRetryMeasurement = (params: {
|
|
|
31
35
|
useAnimatedReaction(
|
|
32
36
|
() => {
|
|
33
37
|
"worklet";
|
|
34
|
-
if (!enabled) return 0;
|
|
35
|
-
if (retryCount.get() >= MAX_RETRIES) return 0;
|
|
36
|
-
if (!animating.get()) return 0;
|
|
37
|
-
if (BoundStore.hasDestinationLink(sharedBoundTag, currentScreenKey))
|
|
38
|
-
return 0;
|
|
39
|
-
|
|
40
|
-
const currentProgress = progress.get();
|
|
41
|
-
if (currentProgress <= 0 || currentProgress >= RETRY_PROGRESS_MAX) {
|
|
42
|
-
return 0;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
38
|
const resolvedSourceKey = resolvePendingSourceKey(
|
|
46
39
|
sharedBoundTag,
|
|
47
40
|
expectedSourceScreenKey,
|
|
48
41
|
);
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
42
|
+
return resolvePendingDestinationRetrySignal({
|
|
43
|
+
enabled,
|
|
44
|
+
retryCount: retryCount.get(),
|
|
45
|
+
maxRetries: MAX_RETRIES,
|
|
46
|
+
isAnimating: !!animating.get(),
|
|
47
|
+
hasDestinationLink: BoundStore.hasDestinationLink(
|
|
48
|
+
sharedBoundTag,
|
|
49
|
+
currentScreenKey,
|
|
50
|
+
),
|
|
51
|
+
progress: progress.get(),
|
|
52
|
+
retryProgressMax: RETRY_PROGRESS_MAX,
|
|
53
|
+
retryProgressBuckets: RETRY_PROGRESS_BUCKETS,
|
|
54
|
+
resolvedSourceKey,
|
|
55
|
+
hasPendingLinkFromSource: resolvedSourceKey
|
|
56
|
+
? BoundStore.hasPendingLinkFromSource(
|
|
57
|
+
sharedBoundTag,
|
|
58
|
+
resolvedSourceKey,
|
|
59
|
+
)
|
|
60
|
+
: false,
|
|
61
|
+
});
|
|
59
62
|
},
|
|
60
63
|
(captureSignal) => {
|
|
61
64
|
"worklet";
|
|
@@ -67,7 +70,7 @@ export const usePendingDestinationRetryMeasurement = (params: {
|
|
|
67
70
|
|
|
68
71
|
if (retryCount.get() >= MAX_RETRIES) return;
|
|
69
72
|
retryCount.set(retryCount.get() + 1);
|
|
70
|
-
maybeMeasureAndStore({
|
|
73
|
+
maybeMeasureAndStore({ intent: "complete-destination" });
|
|
71
74
|
},
|
|
72
75
|
[
|
|
73
76
|
enabled,
|
package/src/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.ts
CHANGED
|
@@ -1,40 +1,49 @@
|
|
|
1
|
-
import { useAnimatedReaction } from "react-native-reanimated";
|
|
1
|
+
import { type SharedValue, useAnimatedReaction } from "react-native-reanimated";
|
|
2
2
|
import { useScrollSettleContext } from "../../../providers/scroll-settle.provider";
|
|
3
|
-
import type { AnimationStore } from "../../../stores/animation.store";
|
|
4
3
|
import type { MaybeMeasureAndStoreParams } from "../types";
|
|
4
|
+
import { shouldTriggerScrollSettledRefresh } from "./helpers/measurement-rules";
|
|
5
|
+
import { useDeferredMeasurementTrigger } from "./use-deferred-measurement-trigger";
|
|
5
6
|
|
|
6
7
|
export const useScrollSettledMeasurement = (params: {
|
|
7
8
|
enabled: boolean;
|
|
8
9
|
group: string | undefined;
|
|
9
10
|
hasNextScreen: boolean;
|
|
10
|
-
isAnimating:
|
|
11
|
+
isAnimating: SharedValue<number>;
|
|
11
12
|
maybeMeasureAndStore: (options: MaybeMeasureAndStoreParams) => void;
|
|
12
13
|
}) => {
|
|
13
14
|
const { enabled, group, hasNextScreen, isAnimating, maybeMeasureAndStore } =
|
|
14
15
|
params;
|
|
15
16
|
const scrollSettle = useScrollSettleContext();
|
|
16
17
|
const settledSignal = scrollSettle?.settledSignal;
|
|
18
|
+
const { queueOrFlushMeasurement } = useDeferredMeasurementTrigger({
|
|
19
|
+
enabled,
|
|
20
|
+
isAnimating,
|
|
21
|
+
onFlush: () => {
|
|
22
|
+
"worklet";
|
|
23
|
+
maybeMeasureAndStore({ intent: "refresh-source" });
|
|
24
|
+
},
|
|
25
|
+
});
|
|
17
26
|
|
|
18
27
|
useAnimatedReaction(
|
|
19
28
|
() => settledSignal?.value ?? 0,
|
|
20
29
|
(signal, previousSignal) => {
|
|
21
30
|
"worklet";
|
|
22
|
-
if (
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
31
|
+
if (
|
|
32
|
+
!shouldTriggerScrollSettledRefresh({
|
|
33
|
+
enabled,
|
|
34
|
+
group,
|
|
35
|
+
hasNextScreen,
|
|
36
|
+
hasSettledSignal: !!settledSignal,
|
|
37
|
+
signal,
|
|
38
|
+
previousSignal,
|
|
39
|
+
})
|
|
40
|
+
) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
27
43
|
// Re-measure source bounds after scroll settles while idle.
|
|
28
44
|
// This captures post-scroll positions before close transition starts.
|
|
29
|
-
|
|
45
|
+
queueOrFlushMeasurement();
|
|
30
46
|
},
|
|
31
|
-
[
|
|
32
|
-
enabled,
|
|
33
|
-
group,
|
|
34
|
-
hasNextScreen,
|
|
35
|
-
settledSignal,
|
|
36
|
-
isAnimating,
|
|
37
|
-
maybeMeasureAndStore,
|
|
38
|
-
],
|
|
47
|
+
[enabled, group, hasNextScreen, settledSignal, queueOrFlushMeasurement],
|
|
39
48
|
);
|
|
40
49
|
};
|
|
@@ -17,6 +17,7 @@ import { useAutoSourceMeasurement } from "./hooks/use-auto-source-measurement";
|
|
|
17
17
|
import { useBoundaryMeasureAndStore } from "./hooks/use-boundary-measure-and-store";
|
|
18
18
|
import { useBoundaryPresence } from "./hooks/use-boundary-presence";
|
|
19
19
|
import { useGroupActiveMeasurement } from "./hooks/use-group-active-measurement";
|
|
20
|
+
import { useGroupActiveSourceMeasurement } from "./hooks/use-group-active-source-measurement";
|
|
20
21
|
import { useInitialLayoutHandler } from "./hooks/use-initial-layout-handler";
|
|
21
22
|
import { usePendingDestinationMeasurement } from "./hooks/use-pending-destination-measurement";
|
|
22
23
|
import { usePendingDestinationRetryMeasurement } from "./hooks/use-pending-destination-retry-measurement";
|
|
@@ -24,15 +25,23 @@ import { useScrollSettledMeasurement } from "./hooks/use-scroll-settled-measurem
|
|
|
24
25
|
import type { BoundaryComponentProps, BoundaryConfigProps } from "./types";
|
|
25
26
|
import { buildBoundaryMatchKey } from "./utils/build-boundary-match-key";
|
|
26
27
|
|
|
27
|
-
const
|
|
28
|
+
const setGroupSelectionOnUI = (group: string, id: string) => {
|
|
28
29
|
"worklet";
|
|
29
30
|
BoundStore.setGroupActiveId(group, id);
|
|
30
31
|
};
|
|
31
32
|
|
|
33
|
+
interface CreateBoundaryComponentOptions {
|
|
34
|
+
alreadyAnimated?: boolean;
|
|
35
|
+
}
|
|
36
|
+
|
|
32
37
|
export function createBoundaryComponent<P extends object>(
|
|
33
38
|
Wrapped: ComponentType<P>,
|
|
39
|
+
options: CreateBoundaryComponentOptions = {},
|
|
34
40
|
) {
|
|
35
|
-
const
|
|
41
|
+
const { alreadyAnimated = false } = options;
|
|
42
|
+
const AnimatedComponent = alreadyAnimated
|
|
43
|
+
? Wrapped
|
|
44
|
+
: Animated.createAnimatedComponent(Wrapped);
|
|
36
45
|
|
|
37
46
|
const Inner = forwardRef<
|
|
38
47
|
React.ComponentRef<typeof AnimatedComponent>,
|
|
@@ -171,6 +180,18 @@ export function createBoundaryComponent<P extends object>(
|
|
|
171
180
|
maybeMeasureAndStore,
|
|
172
181
|
});
|
|
173
182
|
|
|
183
|
+
// Source-side analog for grouped retargeting: when an unfocused/source
|
|
184
|
+
// boundary becomes the active member, refresh its snapshot (and source
|
|
185
|
+
// link when one exists) so close transitions don't use stale geometry.
|
|
186
|
+
useGroupActiveSourceMeasurement({
|
|
187
|
+
enabled: runtimeEnabled,
|
|
188
|
+
group,
|
|
189
|
+
id,
|
|
190
|
+
hasNextScreen,
|
|
191
|
+
isAnimating,
|
|
192
|
+
maybeMeasureAndStore,
|
|
193
|
+
});
|
|
194
|
+
|
|
174
195
|
// While idle on source screens, re-measure after scroll settles so a later
|
|
175
196
|
// close transition starts from up-to-date source geometry.
|
|
176
197
|
useScrollSettledMeasurement({
|
|
@@ -196,9 +217,9 @@ export function createBoundaryComponent<P extends object>(
|
|
|
196
217
|
(...args: unknown[]) => {
|
|
197
218
|
// Press path has priority: capture source before user onPress/navigation.
|
|
198
219
|
if (group) {
|
|
199
|
-
runOnUI(
|
|
220
|
+
runOnUI(setGroupSelectionOnUI)(group, String(id));
|
|
200
221
|
}
|
|
201
|
-
runOnUI(maybeMeasureAndStore)({
|
|
222
|
+
runOnUI(maybeMeasureAndStore)({ intent: "capture-source" });
|
|
202
223
|
|
|
203
224
|
if (typeof onPress === "function") {
|
|
204
225
|
onPress(...args);
|
|
@@ -258,6 +279,4 @@ export const Boundary = {
|
|
|
258
279
|
View: BoundaryView,
|
|
259
280
|
/** Pressable boundary wrapper with press-priority source capture. */
|
|
260
281
|
Pressable: BoundaryPressable,
|
|
261
|
-
/** Factory for custom boundary wrappers. */
|
|
262
|
-
createBoundaryComponent,
|
|
263
282
|
};
|
|
@@ -39,9 +39,13 @@ export type BoundaryComponentProps<P extends object> = Omit<P, "id"> &
|
|
|
39
39
|
/** Convenience alias for a View-based boundary (the most common case). */
|
|
40
40
|
export type BoundaryProps = BoundaryComponentProps<ViewProps>;
|
|
41
41
|
|
|
42
|
+
export type MeasurementIntent =
|
|
43
|
+
| "capture-source"
|
|
44
|
+
| "complete-destination"
|
|
45
|
+
| "refresh-source"
|
|
46
|
+
| "refresh-destination"
|
|
47
|
+
| "snapshot-only";
|
|
48
|
+
|
|
42
49
|
export interface MaybeMeasureAndStoreParams {
|
|
43
|
-
|
|
44
|
-
shouldSetDestination?: boolean;
|
|
45
|
-
shouldUpdateSource?: boolean;
|
|
46
|
-
shouldUpdateDestination?: boolean;
|
|
50
|
+
intent?: MeasurementIntent | readonly MeasurementIntent[];
|
|
47
51
|
}
|
|
@@ -9,21 +9,9 @@ export function buildBoundaryMatchKey(
|
|
|
9
9
|
params: BuildBoundaryMatchKeyParams,
|
|
10
10
|
): string;
|
|
11
11
|
export function buildBoundaryMatchKey(
|
|
12
|
-
|
|
13
|
-
id: BoundaryId,
|
|
14
|
-
): string;
|
|
15
|
-
export function buildBoundaryMatchKey(
|
|
16
|
-
paramsOrGroup: BuildBoundaryMatchKeyParams | string | undefined,
|
|
17
|
-
legacyId?: BoundaryId,
|
|
12
|
+
params: BuildBoundaryMatchKeyParams,
|
|
18
13
|
): string {
|
|
19
14
|
"worklet";
|
|
20
|
-
|
|
21
|
-
if (typeof paramsOrGroup === "object" && paramsOrGroup !== null) {
|
|
22
|
-
const { group, id } = paramsOrGroup;
|
|
23
|
-
return group ? `${group}:${id}` : String(id);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
const group = paramsOrGroup;
|
|
27
|
-
const id = legacyId;
|
|
15
|
+
const { group, id } = params;
|
|
28
16
|
return group ? `${group}:${id}` : String(id);
|
|
29
17
|
}
|
|
@@ -17,15 +17,18 @@ import type { TransitionAwareProps } from "../types/screen.types";
|
|
|
17
17
|
|
|
18
18
|
interface CreateTransitionAwareComponentOptions {
|
|
19
19
|
isScrollable?: boolean;
|
|
20
|
+
alreadyAnimated?: boolean;
|
|
20
21
|
}
|
|
21
22
|
|
|
22
23
|
export function createTransitionAwareComponent<P extends object>(
|
|
23
24
|
Wrapped: ComponentType<P>,
|
|
24
25
|
options: CreateTransitionAwareComponentOptions = {},
|
|
25
26
|
) {
|
|
26
|
-
const { isScrollable = false } = options;
|
|
27
|
+
const { isScrollable = false, alreadyAnimated = false } = options;
|
|
27
28
|
|
|
28
|
-
const AnimatedComponent =
|
|
29
|
+
const AnimatedComponent = alreadyAnimated
|
|
30
|
+
? Wrapped
|
|
31
|
+
: Animated.createAnimatedComponent(Wrapped);
|
|
29
32
|
|
|
30
33
|
const ScrollableInner = forwardRef<
|
|
31
34
|
React.ComponentRef<typeof Wrapped>,
|
|
@@ -8,14 +8,22 @@ interface Props {
|
|
|
8
8
|
|
|
9
9
|
export const NativeScreenContainer = ({ children }: Props) => {
|
|
10
10
|
const {
|
|
11
|
-
flags: {
|
|
11
|
+
flags: {
|
|
12
|
+
DISABLE_NATIVE_SCREENS = false,
|
|
13
|
+
DISABLE_NATIVE_SCREEN_CONTAINER = false,
|
|
14
|
+
},
|
|
12
15
|
} = useStack();
|
|
13
|
-
if (!DISABLE_NATIVE_SCREENS) {
|
|
16
|
+
if (!DISABLE_NATIVE_SCREENS && !DISABLE_NATIVE_SCREEN_CONTAINER) {
|
|
14
17
|
return (
|
|
15
18
|
<ScreenContainer style={styles.container}>{children}</ScreenContainer>
|
|
16
19
|
);
|
|
17
20
|
}
|
|
18
|
-
return
|
|
21
|
+
return (
|
|
22
|
+
// Mirror ScreenContainer's native boundary when screens are disabled.
|
|
23
|
+
<View collapsable={false} style={styles.container}>
|
|
24
|
+
{children}
|
|
25
|
+
</View>
|
|
26
|
+
);
|
|
19
27
|
};
|
|
20
28
|
|
|
21
29
|
const styles = StyleSheet.create({
|
|
@@ -52,42 +52,74 @@ export const NativeScreen = ({
|
|
|
52
52
|
const { activeScreensLimit, backdropBehaviors } = useManagedStackContext();
|
|
53
53
|
|
|
54
54
|
const routesLength = routes.length;
|
|
55
|
+
const topIndex = routesLength - 1;
|
|
56
|
+
const topRouteKey = routes[topIndex]?.key ?? routeKey;
|
|
55
57
|
const screenRef = useAnimatedRef<View>();
|
|
56
58
|
|
|
57
|
-
const sceneProgress = AnimationStore.getRouteAnimation(routeKey, "progress");
|
|
58
59
|
const sceneClosing = AnimationStore.getRouteAnimation(routeKey, "closing");
|
|
60
|
+
const topSceneProgress = AnimationStore.getRouteAnimation(
|
|
61
|
+
topRouteKey,
|
|
62
|
+
"progress",
|
|
63
|
+
);
|
|
64
|
+
const topSceneClosing = AnimationStore.getRouteAnimation(
|
|
65
|
+
topRouteKey,
|
|
66
|
+
"closing",
|
|
67
|
+
);
|
|
59
68
|
const screenActivity = useSharedValue<ScreenActivity>(
|
|
60
69
|
ScreenActivity.TRANSITIONING_OR_BELOW_TOP,
|
|
61
70
|
);
|
|
62
71
|
|
|
63
72
|
useDerivedValue(() => {
|
|
64
|
-
if (!
|
|
73
|
+
if (!topSceneProgress) {
|
|
65
74
|
screenActivity.set(ScreenActivity.TRANSITIONING_OR_BELOW_TOP);
|
|
66
75
|
return;
|
|
67
76
|
}
|
|
68
77
|
|
|
69
78
|
if (index < routesLength - activeScreensLimit - 1 || isPreloaded) {
|
|
70
79
|
screenActivity.set(ScreenActivity.INACTIVE);
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
const focusedIndex = optimisticFocusedIndex.value;
|
|
84
|
+
const topIsClosing =
|
|
85
|
+
topSceneClosing.get() > 0 && focusedIndex >= 0 && focusedIndex < topIndex;
|
|
86
|
+
|
|
87
|
+
if (topIsClosing) {
|
|
88
|
+
const postCloseActiveStart = Math.max(
|
|
89
|
+
0,
|
|
90
|
+
focusedIndex - activeScreensLimit + 1,
|
|
91
|
+
);
|
|
92
|
+
const next =
|
|
93
|
+
index === topIndex
|
|
74
94
|
? ScreenActivity.ON_TOP
|
|
75
|
-
: index
|
|
95
|
+
: index > focusedIndex || index >= postCloseActiveStart
|
|
76
96
|
? ScreenActivity.TRANSITIONING_OR_BELOW_TOP
|
|
77
97
|
: ScreenActivity.INACTIVE;
|
|
78
98
|
|
|
79
|
-
const v = interpolate(
|
|
80
|
-
sceneProgress.get(),
|
|
81
|
-
[0, 1 - EPSILON, 1],
|
|
82
|
-
[1, 1, outputValue],
|
|
83
|
-
Extrapolation.CLAMP,
|
|
84
|
-
);
|
|
85
|
-
|
|
86
|
-
const next = Math.trunc(v) ?? ScreenActivity.TRANSITIONING_OR_BELOW_TOP;
|
|
87
|
-
|
|
88
99
|
if (next !== screenActivity.get()) {
|
|
89
100
|
screenActivity.set(next);
|
|
90
101
|
}
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
const outputValue =
|
|
106
|
+
index === topIndex
|
|
107
|
+
? ScreenActivity.ON_TOP
|
|
108
|
+
: index >= routesLength - activeScreensLimit
|
|
109
|
+
? ScreenActivity.TRANSITIONING_OR_BELOW_TOP
|
|
110
|
+
: ScreenActivity.INACTIVE;
|
|
111
|
+
|
|
112
|
+
const v = interpolate(
|
|
113
|
+
topSceneProgress.get(),
|
|
114
|
+
[0, 1 - EPSILON, 1],
|
|
115
|
+
[1, 1, outputValue],
|
|
116
|
+
Extrapolation.CLAMP,
|
|
117
|
+
);
|
|
118
|
+
|
|
119
|
+
const next = Math.trunc(v) ?? ScreenActivity.TRANSITIONING_OR_BELOW_TOP;
|
|
120
|
+
|
|
121
|
+
if (next !== screenActivity.get()) {
|
|
122
|
+
screenActivity.set(next);
|
|
91
123
|
}
|
|
92
124
|
});
|
|
93
125
|
|
|
@@ -126,12 +158,25 @@ export const NativeScreen = ({
|
|
|
126
158
|
};
|
|
127
159
|
});
|
|
128
160
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
161
|
+
if (DISABLE_NATIVE_SCREENS) {
|
|
162
|
+
return (
|
|
163
|
+
<Animated.View
|
|
164
|
+
ref={screenRef}
|
|
165
|
+
// Keep a native boundary per screen when falling back to plain views.
|
|
166
|
+
// Android release builds can otherwise flatten sibling screens together.
|
|
167
|
+
collapsable={false}
|
|
168
|
+
style={StyleSheet.absoluteFill}
|
|
169
|
+
animatedProps={animatedProps}
|
|
170
|
+
>
|
|
171
|
+
<LayoutAnchorProvider anchorRef={screenRef}>
|
|
172
|
+
{children}
|
|
173
|
+
</LayoutAnchorProvider>
|
|
174
|
+
</Animated.View>
|
|
175
|
+
);
|
|
176
|
+
}
|
|
132
177
|
|
|
133
178
|
return (
|
|
134
|
-
<
|
|
179
|
+
<AnimatedNativeScreen
|
|
135
180
|
enabled
|
|
136
181
|
ref={screenRef}
|
|
137
182
|
style={StyleSheet.absoluteFill}
|
|
@@ -141,6 +186,6 @@ export const NativeScreen = ({
|
|
|
141
186
|
<LayoutAnchorProvider anchorRef={screenRef}>
|
|
142
187
|
{children}
|
|
143
188
|
</LayoutAnchorProvider>
|
|
144
|
-
</
|
|
189
|
+
</AnimatedNativeScreen>
|
|
145
190
|
);
|
|
146
191
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { StackScene } from "../../../hooks/navigation/use-stack";
|
|
2
|
-
import {
|
|
2
|
+
import { isOverlayVisible } from "../../../utils/overlay/visibility";
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Find the active float overlay from scenes.
|
|
6
6
|
* Scans from the top of the stack downward to find the first screen
|
|
7
|
-
* with a visible overlay
|
|
7
|
+
* with a visible overlay.
|
|
8
8
|
*/
|
|
9
9
|
export function getActiveFloatOverlay(
|
|
10
10
|
scenes: StackScene[],
|
|
@@ -30,7 +30,7 @@ export function getActiveFloatOverlay(
|
|
|
30
30
|
continue;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
if (
|
|
33
|
+
if (isOverlayVisible(options)) {
|
|
34
34
|
return { scene, overlayIndex: i };
|
|
35
35
|
}
|
|
36
36
|
}
|