react-native-screen-transitions 3.4.0-alpha.3 → 3.4.0-alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/component-stack/components/component-screen.js +1 -1
- package/lib/commonjs/component-stack/components/component-screen.js.map +1 -1
- package/lib/commonjs/shared/animation/snap-to.js +6 -3
- package/lib/commonjs/shared/animation/snap-to.js.map +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js.map +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-group-active-measurement.js +47 -4
- 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-initial-layout-handler.js +2 -2
- 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/index.js +6 -6
- package/lib/commonjs/shared/components/create-boundary-component/index.js.map +1 -1
- package/lib/commonjs/shared/components/native-screen.js +3 -3
- package/lib/commonjs/shared/components/native-screen.js.map +1 -1
- package/lib/commonjs/shared/components/screen-container/deferred-visibility-host.js +1 -1
- package/lib/commonjs/shared/components/screen-container/deferred-visibility-host.js.map +1 -1
- package/lib/commonjs/shared/components/screen-container/hooks/use-content-layout.js +18 -14
- package/lib/commonjs/shared/components/screen-container/hooks/use-content-layout.js.map +1 -1
- package/lib/commonjs/shared/components/screen-container/layers/backdrop.js +8 -5
- package/lib/commonjs/shared/components/screen-container/layers/backdrop.js.map +1 -1
- package/lib/commonjs/shared/components/screen-container/layers/content.js +12 -28
- 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 +17 -4
- package/lib/commonjs/shared/components/screen-container/layers/maybe-masked-navigation-container.js.map +1 -1
- package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-close-transition/helpers/reset-stores-for-screen.js +4 -2
- package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-close-transition/helpers/reset-stores-for-screen.js.map +1 -1
- package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-close-transition/index.js +6 -1
- 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 +13 -11
- package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-open-transition.js.map +1 -1
- package/lib/commonjs/shared/components/screen-lifecycle/index.js +5 -3
- package/lib/commonjs/shared/components/screen-lifecycle/index.js.map +1 -1
- package/lib/commonjs/shared/configs/presets.js +3 -4
- package/lib/commonjs/shared/configs/presets.js.map +1 -1
- package/lib/commonjs/shared/constants.js +16 -2
- package/lib/commonjs/shared/constants.js.map +1 -1
- package/lib/commonjs/shared/hooks/animation/use-associated-style.js +2 -2
- package/lib/commonjs/shared/hooks/animation/use-associated-style.js.map +1 -1
- package/lib/commonjs/shared/providers/gestures/handlers/use-handlers.js +12 -9
- package/lib/commonjs/shared/providers/gestures/handlers/use-handlers.js.map +1 -1
- package/lib/commonjs/shared/providers/gestures/helpers/gesture-physics.js +3 -2
- package/lib/commonjs/shared/providers/gestures/helpers/gesture-physics.js.map +1 -1
- package/lib/commonjs/shared/providers/gestures/helpers/gesture-reset.js +7 -5
- package/lib/commonjs/shared/providers/gestures/helpers/gesture-reset.js.map +1 -1
- package/lib/commonjs/shared/providers/gestures/helpers/gesture-snap-points.js +5 -5
- package/lib/commonjs/shared/providers/gestures/helpers/gesture-snap-points.js.map +1 -1
- package/lib/commonjs/shared/providers/gestures/helpers/gesture-targets.js +9 -6
- package/lib/commonjs/shared/providers/gestures/helpers/gesture-targets.js.map +1 -1
- package/lib/commonjs/shared/providers/gestures/helpers/register-direction-claims.js +1 -1
- package/lib/commonjs/shared/providers/gestures/helpers/register-direction-claims.js.map +1 -1
- package/lib/commonjs/shared/providers/gestures/use-build-gestures.js +1 -1
- package/lib/commonjs/shared/providers/gestures/use-build-gestures.js.map +1 -1
- package/lib/commonjs/shared/providers/register-bounds.provider.js +5 -5
- package/lib/commonjs/shared/providers/register-bounds.provider.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/animation/helpers/has-transitions-enabled.js +17 -0
- package/lib/commonjs/shared/providers/screen/animation/helpers/has-transitions-enabled.js.map +1 -0
- package/lib/commonjs/shared/providers/screen/animation/helpers/hydrate-transition-state.js +72 -0
- package/lib/commonjs/shared/providers/screen/animation/helpers/hydrate-transition-state.js.map +1 -0
- package/lib/commonjs/shared/providers/screen/animation/helpers/pipeline.js +22 -108
- package/lib/commonjs/shared/providers/screen/animation/helpers/pipeline.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/animation/helpers/use-build-transition-state.js +42 -0
- package/lib/commonjs/shared/providers/screen/animation/helpers/use-build-transition-state.js.map +1 -0
- package/lib/commonjs/shared/providers/screen/helpers/resolve-interpolated-style-output.js +17 -3
- package/lib/commonjs/shared/providers/screen/helpers/resolve-interpolated-style-output.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/styles.provider.js +4 -1
- package/lib/commonjs/shared/providers/screen/styles.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 +12 -40
- package/lib/commonjs/shared/stores/animation.store.js.map +1 -1
- package/lib/commonjs/shared/stores/gesture.store.js +13 -33
- package/lib/commonjs/shared/stores/gesture.store.js.map +1 -1
- package/lib/commonjs/shared/stores/system.store.js +31 -0
- package/lib/commonjs/shared/stores/system.store.js.map +1 -0
- package/lib/commonjs/shared/types/bounds.types.js +1 -3
- package/lib/commonjs/shared/types/bounds.types.js.map +1 -1
- package/lib/commonjs/shared/utils/animation/animate-to-progress.js +2 -2
- package/lib/commonjs/shared/utils/animation/animate-to-progress.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/helpers/compute-bounds-styles.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/index.js +23 -50
- package/lib/commonjs/shared/utils/bounds/index.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/zoom/build.js +108 -362
- package/lib/commonjs/shared/utils/bounds/zoom/build.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/zoom/config.js +15 -101
- package/lib/commonjs/shared/utils/bounds/zoom/config.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/zoom/math.js +154 -0
- package/lib/commonjs/shared/utils/bounds/zoom/math.js.map +1 -0
- package/lib/commonjs/shared/utils/bounds/zoom/types.js +1 -3
- package/lib/commonjs/shared/utils/bounds/zoom/types.js.map +1 -1
- package/lib/commonjs/shared/utils/create-store.js +54 -0
- package/lib/commonjs/shared/utils/create-store.js.map +1 -0
- package/lib/module/component-stack/components/component-screen.js +1 -1
- package/lib/module/component-stack/components/component-screen.js.map +1 -1
- package/lib/module/shared/animation/snap-to.js +6 -3
- package/lib/module/shared/animation/snap-to.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js +1 -1
- package/lib/module/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-group-active-measurement.js +48 -5
- 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-initial-layout-handler.js +2 -2
- 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/index.js +6 -6
- package/lib/module/shared/components/create-boundary-component/index.js.map +1 -1
- package/lib/module/shared/components/native-screen.js +3 -3
- package/lib/module/shared/components/native-screen.js.map +1 -1
- package/lib/module/shared/components/screen-container/deferred-visibility-host.js +2 -2
- package/lib/module/shared/components/screen-container/deferred-visibility-host.js.map +1 -1
- package/lib/module/shared/components/screen-container/hooks/use-content-layout.js +18 -14
- package/lib/module/shared/components/screen-container/hooks/use-content-layout.js.map +1 -1
- package/lib/module/shared/components/screen-container/layers/backdrop.js +8 -5
- package/lib/module/shared/components/screen-container/layers/backdrop.js.map +1 -1
- package/lib/module/shared/components/screen-container/layers/content.js +13 -29
- 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 +19 -6
- package/lib/module/shared/components/screen-container/layers/maybe-masked-navigation-container.js.map +1 -1
- package/lib/module/shared/components/screen-lifecycle/hooks/use-close-transition/helpers/reset-stores-for-screen.js +4 -2
- package/lib/module/shared/components/screen-lifecycle/hooks/use-close-transition/helpers/reset-stores-for-screen.js.map +1 -1
- package/lib/module/shared/components/screen-lifecycle/hooks/use-close-transition/index.js +6 -1
- 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 +13 -11
- package/lib/module/shared/components/screen-lifecycle/hooks/use-open-transition.js.map +1 -1
- package/lib/module/shared/components/screen-lifecycle/index.js +5 -3
- package/lib/module/shared/components/screen-lifecycle/index.js.map +1 -1
- package/lib/module/shared/configs/presets.js +3 -4
- package/lib/module/shared/configs/presets.js.map +1 -1
- package/lib/module/shared/constants.js +16 -2
- package/lib/module/shared/constants.js.map +1 -1
- package/lib/module/shared/hooks/animation/use-associated-style.js +2 -2
- package/lib/module/shared/hooks/animation/use-associated-style.js.map +1 -1
- package/lib/module/shared/providers/gestures/handlers/use-handlers.js +12 -9
- package/lib/module/shared/providers/gestures/handlers/use-handlers.js.map +1 -1
- package/lib/module/shared/providers/gestures/helpers/gesture-physics.js +3 -2
- package/lib/module/shared/providers/gestures/helpers/gesture-physics.js.map +1 -1
- package/lib/module/shared/providers/gestures/helpers/gesture-reset.js +7 -5
- package/lib/module/shared/providers/gestures/helpers/gesture-reset.js.map +1 -1
- package/lib/module/shared/providers/gestures/helpers/gesture-snap-points.js +5 -5
- package/lib/module/shared/providers/gestures/helpers/gesture-snap-points.js.map +1 -1
- package/lib/module/shared/providers/gestures/helpers/gesture-targets.js +9 -6
- package/lib/module/shared/providers/gestures/helpers/gesture-targets.js.map +1 -1
- package/lib/module/shared/providers/gestures/helpers/register-direction-claims.js +1 -1
- package/lib/module/shared/providers/gestures/helpers/register-direction-claims.js.map +1 -1
- package/lib/module/shared/providers/gestures/use-build-gestures.js +1 -1
- package/lib/module/shared/providers/gestures/use-build-gestures.js.map +1 -1
- package/lib/module/shared/providers/register-bounds.provider.js +5 -5
- package/lib/module/shared/providers/register-bounds.provider.js.map +1 -1
- package/lib/module/shared/providers/screen/animation/helpers/has-transitions-enabled.js +12 -0
- package/lib/module/shared/providers/screen/animation/helpers/has-transitions-enabled.js.map +1 -0
- package/lib/module/shared/providers/screen/animation/helpers/hydrate-transition-state.js +67 -0
- package/lib/module/shared/providers/screen/animation/helpers/hydrate-transition-state.js.map +1 -0
- package/lib/module/shared/providers/screen/animation/helpers/pipeline.js +22 -108
- package/lib/module/shared/providers/screen/animation/helpers/pipeline.js.map +1 -1
- package/lib/module/shared/providers/screen/animation/helpers/use-build-transition-state.js +37 -0
- package/lib/module/shared/providers/screen/animation/helpers/use-build-transition-state.js.map +1 -0
- package/lib/module/shared/providers/screen/helpers/resolve-interpolated-style-output.js +15 -2
- package/lib/module/shared/providers/screen/helpers/resolve-interpolated-style-output.js.map +1 -1
- package/lib/module/shared/providers/screen/styles.provider.js +5 -2
- package/lib/module/shared/providers/screen/styles.provider.js.map +1 -1
- package/lib/module/shared/providers/stack/direct.provider.js +1 -1
- package/lib/module/shared/providers/stack/direct.provider.js.map +1 -1
- package/lib/module/shared/providers/stack/helpers/use-processed-routes.js +1 -1
- package/lib/module/shared/providers/stack/helpers/use-processed-routes.js.map +1 -1
- package/lib/module/shared/stores/animation.store.js +12 -40
- package/lib/module/shared/stores/animation.store.js.map +1 -1
- package/lib/module/shared/stores/gesture.store.js +13 -33
- package/lib/module/shared/stores/gesture.store.js.map +1 -1
- package/lib/module/shared/stores/system.store.js +27 -0
- package/lib/module/shared/stores/system.store.js.map +1 -0
- package/lib/module/shared/types/bounds.types.js +9 -1
- package/lib/module/shared/types/bounds.types.js.map +1 -1
- package/lib/module/shared/utils/animation/animate-to-progress.js +2 -2
- package/lib/module/shared/utils/animation/animate-to-progress.js.map +1 -1
- package/lib/module/shared/utils/bounds/helpers/compute-bounds-styles.js.map +1 -1
- package/lib/module/shared/utils/bounds/index.js +23 -50
- package/lib/module/shared/utils/bounds/index.js.map +1 -1
- package/lib/module/shared/utils/bounds/zoom/build.js +101 -355
- package/lib/module/shared/utils/bounds/zoom/build.js.map +1 -1
- package/lib/module/shared/utils/bounds/zoom/config.js +12 -98
- package/lib/module/shared/utils/bounds/zoom/config.js.map +1 -1
- package/lib/module/shared/utils/bounds/zoom/math.js +136 -0
- package/lib/module/shared/utils/bounds/zoom/math.js.map +1 -0
- package/lib/module/shared/utils/bounds/zoom/types.js +1 -1
- package/lib/module/shared/utils/bounds/zoom/types.js.map +1 -1
- package/lib/module/shared/utils/create-store.js +50 -0
- package/lib/module/shared/utils/create-store.js.map +1 -0
- package/lib/typescript/shared/animation/snap-to.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-group-active-measurement.d.ts +1 -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-initial-layout-handler.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/index.d.ts.map +1 -1
- package/lib/typescript/shared/components/native-screen.d.ts.map +1 -1
- package/lib/typescript/shared/components/screen-container/hooks/use-content-layout.d.ts.map +1 -1
- package/lib/typescript/shared/components/screen-container/layers/backdrop.d.ts.map +1 -1
- package/lib/typescript/shared/components/screen-container/layers/content.d.ts.map +1 -1
- package/lib/typescript/shared/components/screen-container/layers/maybe-masked-navigation-container.d.ts.map +1 -1
- package/lib/typescript/shared/components/screen-lifecycle/hooks/use-close-transition/helpers/reset-stores-for-screen.d.ts.map +1 -1
- package/lib/typescript/shared/components/screen-lifecycle/hooks/use-close-transition/index.d.ts +2 -1
- 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 +2 -1
- package/lib/typescript/shared/components/screen-lifecycle/hooks/use-open-transition.d.ts.map +1 -1
- package/lib/typescript/shared/components/screen-lifecycle/index.d.ts.map +1 -1
- package/lib/typescript/shared/configs/presets.d.ts.map +1 -1
- package/lib/typescript/shared/constants.d.ts.map +1 -1
- package/lib/typescript/shared/hooks/animation/use-associated-style.d.ts.map +1 -1
- package/lib/typescript/shared/index.d.ts +3 -3
- package/lib/typescript/shared/index.d.ts.map +1 -1
- package/lib/typescript/shared/providers/gestures/handlers/use-handlers.d.ts.map +1 -1
- package/lib/typescript/shared/providers/gestures/helpers/gesture-physics.d.ts.map +1 -1
- package/lib/typescript/shared/providers/gestures/helpers/gesture-reset.d.ts.map +1 -1
- package/lib/typescript/shared/providers/gestures/helpers/gesture-snap-points.d.ts +2 -2
- package/lib/typescript/shared/providers/gestures/helpers/gesture-snap-points.d.ts.map +1 -1
- package/lib/typescript/shared/providers/gestures/helpers/gesture-targets.d.ts.map +1 -1
- package/lib/typescript/shared/providers/gestures/use-build-gestures.d.ts.map +1 -1
- package/lib/typescript/shared/providers/register-bounds.provider.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/animation/helpers/has-transitions-enabled.d.ts +8 -0
- package/lib/typescript/shared/providers/screen/animation/helpers/has-transitions-enabled.d.ts.map +1 -0
- package/lib/typescript/shared/providers/screen/animation/helpers/hydrate-transition-state.d.ts +22 -0
- package/lib/typescript/shared/providers/screen/animation/helpers/hydrate-transition-state.d.ts.map +1 -0
- package/lib/typescript/shared/providers/screen/animation/helpers/pipeline.d.ts +4 -2
- package/lib/typescript/shared/providers/screen/animation/helpers/pipeline.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/animation/helpers/use-build-transition-state.d.ts +21 -0
- package/lib/typescript/shared/providers/screen/animation/helpers/use-build-transition-state.d.ts.map +1 -0
- package/lib/typescript/shared/providers/screen/helpers/resolve-interpolated-style-output.d.ts +6 -2
- package/lib/typescript/shared/providers/screen/helpers/resolve-interpolated-style-output.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/styles.provider.d.ts.map +1 -1
- package/lib/typescript/shared/stores/animation.store.d.ts +10 -17
- package/lib/typescript/shared/stores/animation.store.d.ts.map +1 -1
- package/lib/typescript/shared/stores/gesture.store.d.ts +24 -14
- package/lib/typescript/shared/stores/gesture.store.d.ts.map +1 -1
- package/lib/typescript/shared/stores/system.store.d.ts +27 -0
- package/lib/typescript/shared/stores/system.store.d.ts.map +1 -0
- package/lib/typescript/shared/types/animation.types.d.ts +38 -9
- package/lib/typescript/shared/types/animation.types.d.ts.map +1 -1
- package/lib/typescript/shared/types/bounds.types.d.ts +14 -42
- package/lib/typescript/shared/types/bounds.types.d.ts.map +1 -1
- package/lib/typescript/shared/types/index.d.ts +2 -2
- package/lib/typescript/shared/types/index.d.ts.map +1 -1
- package/lib/typescript/shared/types/screen.types.d.ts +11 -0
- package/lib/typescript/shared/types/screen.types.d.ts.map +1 -1
- package/lib/typescript/shared/utils/animation/animate-to-progress.d.ts +3 -1
- package/lib/typescript/shared/utils/animation/animate-to-progress.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/index.d.ts +2 -3
- package/lib/typescript/shared/utils/bounds/index.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/zoom/build.d.ts +2 -3
- package/lib/typescript/shared/utils/bounds/zoom/build.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/zoom/config.d.ts +15 -41
- package/lib/typescript/shared/utils/bounds/zoom/config.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/zoom/math.d.ts +44 -0
- package/lib/typescript/shared/utils/bounds/zoom/math.d.ts.map +1 -0
- package/lib/typescript/shared/utils/bounds/zoom/types.d.ts +8 -13
- package/lib/typescript/shared/utils/bounds/zoom/types.d.ts.map +1 -1
- package/lib/typescript/shared/utils/create-store.d.ts +14 -0
- package/lib/typescript/shared/utils/create-store.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/component-stack/components/component-screen.tsx +1 -1
- package/src/shared/animation/snap-to.ts +10 -4
- package/src/shared/components/create-boundary-component/hooks/helpers/measurement-rules.ts +1 -1
- package/src/shared/components/create-boundary-component/hooks/use-group-active-measurement.ts +82 -10
- package/src/shared/components/create-boundary-component/hooks/use-initial-layout-handler.ts +2 -5
- package/src/shared/components/create-boundary-component/index.tsx +6 -12
- package/src/shared/components/native-screen.tsx +3 -9
- package/src/shared/components/screen-container/deferred-visibility-host.tsx +2 -2
- package/src/shared/components/screen-container/hooks/use-content-layout.ts +42 -43
- package/src/shared/components/screen-container/layers/backdrop.tsx +12 -6
- package/src/shared/components/screen-container/layers/content.tsx +17 -49
- package/src/shared/components/screen-container/layers/maybe-masked-navigation-container.tsx +26 -5
- package/src/shared/components/screen-lifecycle/hooks/use-close-transition/helpers/reset-stores-for-screen.ts +4 -2
- package/src/shared/components/screen-lifecycle/hooks/use-close-transition/index.ts +8 -0
- package/src/shared/components/screen-lifecycle/hooks/use-open-transition.ts +21 -10
- package/src/shared/components/screen-lifecycle/index.tsx +8 -2
- package/src/shared/configs/presets.ts +8 -7
- package/src/shared/constants.ts +14 -0
- package/src/shared/hooks/animation/use-associated-style.ts +2 -8
- package/src/shared/index.ts +2 -0
- package/src/shared/providers/gestures/handlers/use-handlers.ts +13 -10
- package/src/shared/providers/gestures/helpers/gesture-physics.ts +4 -2
- package/src/shared/providers/gestures/helpers/gesture-reset.ts +9 -5
- package/src/shared/providers/gestures/helpers/gesture-snap-points.ts +12 -10
- package/src/shared/providers/gestures/helpers/gesture-targets.ts +14 -6
- package/src/shared/providers/gestures/helpers/register-direction-claims.ts +1 -1
- package/src/shared/providers/gestures/use-build-gestures.ts +1 -3
- package/src/shared/providers/register-bounds.provider.tsx +5 -11
- package/src/shared/providers/screen/animation/helpers/has-transitions-enabled.ts +14 -0
- package/src/shared/providers/screen/animation/helpers/hydrate-transition-state.ts +108 -0
- package/src/shared/providers/screen/animation/helpers/pipeline.ts +37 -199
- package/src/shared/providers/screen/animation/helpers/use-build-transition-state.ts +77 -0
- package/src/shared/providers/screen/helpers/resolve-interpolated-style-output.ts +24 -4
- package/src/shared/providers/screen/styles.provider.tsx +5 -1
- package/src/shared/providers/stack/direct.provider.tsx +1 -1
- package/src/shared/providers/stack/helpers/use-processed-routes.ts +1 -1
- package/src/shared/stores/animation.store.ts +11 -61
- package/src/shared/stores/gesture.store.ts +25 -45
- package/src/shared/stores/system.store.ts +44 -0
- package/src/shared/types/animation.types.ts +41 -9
- package/src/shared/types/bounds.types.ts +25 -25
- package/src/shared/types/index.ts +2 -0
- package/src/shared/types/screen.types.ts +12 -0
- package/src/shared/utils/animation/animate-to-progress.ts +4 -2
- package/src/shared/utils/bounds/helpers/compute-bounds-styles.ts +0 -1
- package/src/shared/utils/bounds/index.ts +26 -75
- package/src/shared/utils/bounds/zoom/build.ts +179 -502
- package/src/shared/utils/bounds/zoom/config.ts +14 -164
- package/src/shared/utils/bounds/zoom/math.ts +193 -0
- package/src/shared/utils/bounds/zoom/types.ts +15 -17
- package/src/shared/utils/create-store.ts +62 -0
- package/lib/commonjs/shared/utils/bounds/types/frame-props.js +0 -6
- package/lib/commonjs/shared/utils/bounds/types/frame-props.js.map +0 -1
- package/lib/commonjs/shared/utils/bounds/zoom/accessor.js +0 -54
- package/lib/commonjs/shared/utils/bounds/zoom/accessor.js.map +0 -1
- package/lib/commonjs/shared/utils/bounds/zoom/index.js +0 -20
- package/lib/commonjs/shared/utils/bounds/zoom/index.js.map +0 -1
- package/lib/module/shared/utils/bounds/types/frame-props.js +0 -4
- package/lib/module/shared/utils/bounds/types/frame-props.js.map +0 -1
- package/lib/module/shared/utils/bounds/zoom/accessor.js +0 -49
- package/lib/module/shared/utils/bounds/zoom/accessor.js.map +0 -1
- package/lib/module/shared/utils/bounds/zoom/index.js +0 -5
- package/lib/module/shared/utils/bounds/zoom/index.js.map +0 -1
- package/lib/typescript/shared/utils/bounds/types/frame-props.d.ts +0 -5
- package/lib/typescript/shared/utils/bounds/types/frame-props.d.ts.map +0 -1
- package/lib/typescript/shared/utils/bounds/zoom/accessor.d.ts +0 -17
- package/lib/typescript/shared/utils/bounds/zoom/accessor.d.ts.map +0 -1
- package/lib/typescript/shared/utils/bounds/zoom/index.d.ts +0 -3
- package/lib/typescript/shared/utils/bounds/zoom/index.d.ts.map +0 -1
- package/src/shared/utils/bounds/types/frame-props.ts +0 -5
- package/src/shared/utils/bounds/zoom/accessor.ts +0 -69
- package/src/shared/utils/bounds/zoom/index.ts +0 -2
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
useDescriptors,
|
|
7
7
|
} from "../../../providers/screen/descriptors";
|
|
8
8
|
import { AnimationStore } from "../../../stores/animation.store";
|
|
9
|
+
import { SystemStore } from "../../../stores/system.store";
|
|
9
10
|
import { animateToProgress } from "../../../utils/animation/animate-to-progress";
|
|
10
11
|
|
|
11
12
|
export function useContentLayout() {
|
|
@@ -13,15 +14,19 @@ export function useContentLayout() {
|
|
|
13
14
|
const { isFirstKey } = useDescriptorDerivations();
|
|
14
15
|
const { height: screenHeight } = useWindowDimensions();
|
|
15
16
|
const routeKey = current.route.key;
|
|
16
|
-
const animations = AnimationStore.
|
|
17
|
-
const
|
|
17
|
+
const animations = AnimationStore.getBag(routeKey);
|
|
18
|
+
const targetProgressValue = SystemStore.getValue(routeKey, "targetProgress");
|
|
19
|
+
const resolvedAutoSnapPointValue = SystemStore.getValue(
|
|
18
20
|
routeKey,
|
|
19
|
-
"
|
|
21
|
+
"resolvedAutoSnapPoint",
|
|
20
22
|
);
|
|
21
|
-
const
|
|
23
|
+
const measuredContentLayoutValue = SystemStore.getValue(
|
|
22
24
|
routeKey,
|
|
23
|
-
"
|
|
25
|
+
"measuredContentLayout",
|
|
24
26
|
);
|
|
27
|
+
const experimental_animateOnInitialMount =
|
|
28
|
+
current.options.experimental_animateOnInitialMount;
|
|
29
|
+
const transitionSpec = current.options.transitionSpec;
|
|
25
30
|
|
|
26
31
|
return useCallback(
|
|
27
32
|
(event: LayoutChangeEvent) => {
|
|
@@ -29,54 +34,48 @@ export function useContentLayout() {
|
|
|
29
34
|
if (width <= 0 || height <= 0) return;
|
|
30
35
|
|
|
31
36
|
const fraction = Math.min(height / screenHeight, 1);
|
|
32
|
-
const transitionSpec = current.options.transitionSpec;
|
|
33
37
|
|
|
34
|
-
runOnUI(
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
spec: typeof transitionSpec,
|
|
41
|
-
) => {
|
|
42
|
-
"worklet";
|
|
43
|
-
contentLayoutValue.value = {
|
|
44
|
-
width: nextWidth,
|
|
45
|
-
height: nextHeight,
|
|
46
|
-
};
|
|
38
|
+
runOnUI((nextWidth: number, nextHeight: number, nextFraction: number) => {
|
|
39
|
+
"worklet";
|
|
40
|
+
measuredContentLayoutValue.value = {
|
|
41
|
+
width: nextWidth,
|
|
42
|
+
height: nextHeight,
|
|
43
|
+
};
|
|
47
44
|
|
|
48
|
-
|
|
49
|
-
|
|
45
|
+
const isFirstMeasurement = resolvedAutoSnapPointValue.value <= 0;
|
|
46
|
+
resolvedAutoSnapPointValue.value = nextFraction;
|
|
50
47
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
48
|
+
if (
|
|
49
|
+
!isFirstMeasurement ||
|
|
50
|
+
animations.progress.value !== 0 ||
|
|
51
|
+
animations.animating.value !== 0
|
|
52
|
+
) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
58
55
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
56
|
+
if (isFirstKey && !experimental_animateOnInitialMount) {
|
|
57
|
+
targetProgressValue.value = nextFraction;
|
|
58
|
+
animations.progress.value = nextFraction;
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
64
61
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}
|
|
71
|
-
)(width, height, fraction
|
|
62
|
+
animateToProgress({
|
|
63
|
+
target: nextFraction,
|
|
64
|
+
spec: transitionSpec,
|
|
65
|
+
animations,
|
|
66
|
+
targetProgress: targetProgressValue,
|
|
67
|
+
});
|
|
68
|
+
})(width, height, fraction);
|
|
72
69
|
},
|
|
73
70
|
[
|
|
74
71
|
animations,
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
72
|
+
targetProgressValue,
|
|
73
|
+
resolvedAutoSnapPointValue,
|
|
74
|
+
measuredContentLayoutValue,
|
|
78
75
|
isFirstKey,
|
|
79
76
|
screenHeight,
|
|
77
|
+
experimental_animateOnInitialMount,
|
|
78
|
+
transitionSpec,
|
|
80
79
|
],
|
|
81
80
|
);
|
|
82
81
|
}
|
|
@@ -12,6 +12,7 @@ import { useDescriptors } from "../../../providers/screen/descriptors";
|
|
|
12
12
|
import { useScreenStyles } from "../../../providers/screen/styles.provider";
|
|
13
13
|
import { AnimationStore } from "../../../stores/animation.store";
|
|
14
14
|
import { GestureStore } from "../../../stores/gesture.store";
|
|
15
|
+
import { SystemStore } from "../../../stores/system.store";
|
|
15
16
|
import { animateToProgress } from "../../../utils/animation/animate-to-progress";
|
|
16
17
|
import { findCollapseTarget } from "../../../utils/gesture/find-collapse-target";
|
|
17
18
|
import { useBackdropPointerEvents } from "../hooks/use-backdrop-pointer-events";
|
|
@@ -24,10 +25,11 @@ export const BackdropLayer = memo(function BackdropLayer() {
|
|
|
24
25
|
|
|
25
26
|
const BackdropComponent = current.options.backdropComponent;
|
|
26
27
|
const routeKey = current.route.key;
|
|
27
|
-
const animations = AnimationStore.
|
|
28
|
-
const
|
|
28
|
+
const animations = AnimationStore.getBag(routeKey);
|
|
29
|
+
const targetProgressValue = SystemStore.getValue(routeKey, "targetProgress");
|
|
30
|
+
const resolvedAutoSnapPointValue = SystemStore.getValue(
|
|
29
31
|
routeKey,
|
|
30
|
-
"
|
|
32
|
+
"resolvedAutoSnapPoint",
|
|
31
33
|
);
|
|
32
34
|
|
|
33
35
|
const AnimatedBackdropComponent = useMemo(
|
|
@@ -53,13 +55,15 @@ export const BackdropLayer = memo(function BackdropLayer() {
|
|
|
53
55
|
return;
|
|
54
56
|
}
|
|
55
57
|
|
|
56
|
-
const gestures = GestureStore.
|
|
58
|
+
const gestures = GestureStore.getBag(routeKey);
|
|
57
59
|
const transitionSpec = current.options.transitionSpec;
|
|
58
60
|
|
|
59
61
|
runOnUI(() => {
|
|
60
62
|
"worklet";
|
|
61
63
|
const resolvedSnaps = rawSnapPoints
|
|
62
|
-
.map((point) =>
|
|
64
|
+
.map((point) =>
|
|
65
|
+
point === "auto" ? resolvedAutoSnapPointValue.value : point,
|
|
66
|
+
)
|
|
63
67
|
.filter((point): point is number => typeof point === "number");
|
|
64
68
|
|
|
65
69
|
const { target, shouldDismiss } = findCollapseTarget(
|
|
@@ -84,13 +88,15 @@ export const BackdropLayer = memo(function BackdropLayer() {
|
|
|
84
88
|
target,
|
|
85
89
|
spec,
|
|
86
90
|
animations,
|
|
91
|
+
targetProgress: targetProgressValue,
|
|
87
92
|
onAnimationFinish: shouldDismiss ? dismissScreen : undefined,
|
|
88
93
|
});
|
|
89
94
|
})();
|
|
90
95
|
}
|
|
91
96
|
}, [
|
|
92
97
|
animations,
|
|
93
|
-
|
|
98
|
+
targetProgressValue,
|
|
99
|
+
resolvedAutoSnapPointValue,
|
|
94
100
|
backdropBehavior,
|
|
95
101
|
current,
|
|
96
102
|
dismissScreen,
|
|
@@ -6,11 +6,7 @@ import Animated, {
|
|
|
6
6
|
useAnimatedProps,
|
|
7
7
|
useAnimatedStyle,
|
|
8
8
|
} from "react-native-reanimated";
|
|
9
|
-
import {
|
|
10
|
-
NAVIGATION_MASK_CONTAINER_STYLE_ID,
|
|
11
|
-
NO_PROPS,
|
|
12
|
-
NO_STYLES,
|
|
13
|
-
} from "../../../constants";
|
|
9
|
+
import { NO_PROPS, NO_STYLES } from "../../../constants";
|
|
14
10
|
import { useGestureContext } from "../../../providers/gestures";
|
|
15
11
|
import { useDescriptors } from "../../../providers/screen/descriptors";
|
|
16
12
|
import { useScreenStyles } from "../../../providers/screen/styles.provider";
|
|
@@ -28,9 +24,11 @@ export const ContentLayer = memo(({ children }: Props) => {
|
|
|
28
24
|
const { stylesMap } = useScreenStyles();
|
|
29
25
|
const { current } = useDescriptors();
|
|
30
26
|
const { pointerEvents, isBackdropActive } = useBackdropPointerEvents();
|
|
27
|
+
|
|
31
28
|
const gestureContext = useGestureContext();
|
|
32
29
|
const isNavigationMaskEnabled = resolveNavigationMaskEnabled(current.options);
|
|
33
30
|
const contentPointerEvents = isBackdropActive ? "box-none" : pointerEvents;
|
|
31
|
+
|
|
34
32
|
const hasAutoSnapPoint =
|
|
35
33
|
current.options.snapPoints?.includes("auto") ?? false;
|
|
36
34
|
|
|
@@ -41,51 +39,11 @@ export const ContentLayer = memo(({ children }: Props) => {
|
|
|
41
39
|
return stylesMap.value.content?.style || NO_STYLES;
|
|
42
40
|
});
|
|
43
41
|
|
|
44
|
-
const animatedNavigationContainerStyle = useAnimatedStyle(() => {
|
|
45
|
-
"worklet";
|
|
46
|
-
return (
|
|
47
|
-
stylesMap.value[NAVIGATION_MASK_CONTAINER_STYLE_ID]?.style || NO_STYLES
|
|
48
|
-
);
|
|
49
|
-
});
|
|
50
|
-
|
|
51
42
|
const animatedContentProps = useAnimatedProps(() => {
|
|
52
43
|
"worklet";
|
|
53
44
|
return stylesMap.value.content?.props ?? NO_PROPS;
|
|
54
45
|
});
|
|
55
46
|
|
|
56
|
-
const surfaceChildren = (
|
|
57
|
-
<SurfaceContainer pointerEvents={contentPointerEvents}>
|
|
58
|
-
{hasAutoSnapPoint ? (
|
|
59
|
-
<View collapsable={false} onLayout={handleContentLayout}>
|
|
60
|
-
{children}
|
|
61
|
-
</View>
|
|
62
|
-
) : (
|
|
63
|
-
children
|
|
64
|
-
)}
|
|
65
|
-
</SurfaceContainer>
|
|
66
|
-
);
|
|
67
|
-
|
|
68
|
-
const navigationContainer = (
|
|
69
|
-
<Animated.View
|
|
70
|
-
style={[styles.navigationContainer, animatedNavigationContainerStyle]}
|
|
71
|
-
pointerEvents={contentPointerEvents}
|
|
72
|
-
collapsable={false}
|
|
73
|
-
>
|
|
74
|
-
{surfaceChildren}
|
|
75
|
-
</Animated.View>
|
|
76
|
-
);
|
|
77
|
-
|
|
78
|
-
const navigationScopedChildren = isNavigationMaskEnabled ? (
|
|
79
|
-
<MaybeMaskedNavigationContainer
|
|
80
|
-
pointerEvents={contentPointerEvents}
|
|
81
|
-
enabled={isNavigationMaskEnabled}
|
|
82
|
-
>
|
|
83
|
-
{navigationContainer}
|
|
84
|
-
</MaybeMaskedNavigationContainer>
|
|
85
|
-
) : (
|
|
86
|
-
navigationContainer
|
|
87
|
-
);
|
|
88
|
-
|
|
89
47
|
return (
|
|
90
48
|
<GestureDetector gesture={gestureContext!.panGesture}>
|
|
91
49
|
<Animated.View
|
|
@@ -93,7 +51,20 @@ export const ContentLayer = memo(({ children }: Props) => {
|
|
|
93
51
|
animatedProps={animatedContentProps}
|
|
94
52
|
pointerEvents={contentPointerEvents}
|
|
95
53
|
>
|
|
96
|
-
|
|
54
|
+
<MaybeMaskedNavigationContainer
|
|
55
|
+
pointerEvents={contentPointerEvents}
|
|
56
|
+
enabled={isNavigationMaskEnabled}
|
|
57
|
+
>
|
|
58
|
+
<SurfaceContainer pointerEvents={contentPointerEvents}>
|
|
59
|
+
{hasAutoSnapPoint ? (
|
|
60
|
+
<View collapsable={false} onLayout={handleContentLayout}>
|
|
61
|
+
{children}
|
|
62
|
+
</View>
|
|
63
|
+
) : (
|
|
64
|
+
children
|
|
65
|
+
)}
|
|
66
|
+
</SurfaceContainer>
|
|
67
|
+
</MaybeMaskedNavigationContainer>
|
|
97
68
|
</Animated.View>
|
|
98
69
|
</GestureDetector>
|
|
99
70
|
);
|
|
@@ -103,7 +74,4 @@ const styles = StyleSheet.create({
|
|
|
103
74
|
content: {
|
|
104
75
|
flex: 1,
|
|
105
76
|
},
|
|
106
|
-
navigationContainer: {
|
|
107
|
-
flex: 1,
|
|
108
|
-
},
|
|
109
77
|
});
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { memo,
|
|
1
|
+
import { memo, useCallback } from "react";
|
|
2
2
|
import { StyleSheet, View, type ViewProps } from "react-native";
|
|
3
3
|
import Animated, { useAnimatedStyle } from "react-native-reanimated";
|
|
4
4
|
import {
|
|
5
|
+
NAVIGATION_MASK_CONTAINER_STYLE_ID,
|
|
5
6
|
NAVIGATION_MASK_ELEMENT_STYLE_ID,
|
|
6
7
|
NO_STYLES,
|
|
7
8
|
} from "../../../constants";
|
|
@@ -27,6 +28,7 @@ let hasWarnedMissingMaskedView = false;
|
|
|
27
28
|
export const MaybeMaskedNavigationContainer = memo(
|
|
28
29
|
({ enabled, children, pointerEvents }: Props) => {
|
|
29
30
|
const { stylesMap } = useScreenStyles();
|
|
31
|
+
|
|
30
32
|
const animatedNavigationMaskStyle = useAnimatedStyle(() => {
|
|
31
33
|
"worklet";
|
|
32
34
|
return (
|
|
@@ -34,7 +36,14 @@ export const MaybeMaskedNavigationContainer = memo(
|
|
|
34
36
|
);
|
|
35
37
|
});
|
|
36
38
|
|
|
37
|
-
|
|
39
|
+
const animatedNavigationMaskContainerStyle = useAnimatedStyle(() => {
|
|
40
|
+
"worklet";
|
|
41
|
+
return (
|
|
42
|
+
stylesMap.value[NAVIGATION_MASK_CONTAINER_STYLE_ID]?.style || NO_STYLES
|
|
43
|
+
);
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
const maybeLogWarning = useCallback(() => {
|
|
38
47
|
if (!enabled) return;
|
|
39
48
|
if (LazyMaskedView !== View) return;
|
|
40
49
|
if (hasWarnedMissingMaskedView) return;
|
|
@@ -44,9 +53,8 @@ export const MaybeMaskedNavigationContainer = memo(
|
|
|
44
53
|
"navigationMaskEnabled requires @react-native-masked-view/masked-view. Install it to enable navigation bounds masking.",
|
|
45
54
|
);
|
|
46
55
|
}, [enabled]);
|
|
47
|
-
if (!enabled) return children;
|
|
48
56
|
|
|
49
|
-
if (LazyMaskedView === View) {
|
|
57
|
+
if (!enabled || LazyMaskedView === View) {
|
|
50
58
|
return children;
|
|
51
59
|
}
|
|
52
60
|
|
|
@@ -61,8 +69,18 @@ export const MaybeMaskedNavigationContainer = memo(
|
|
|
61
69
|
/>
|
|
62
70
|
}
|
|
63
71
|
pointerEvents={pointerEvents}
|
|
72
|
+
onLayout={maybeLogWarning}
|
|
64
73
|
>
|
|
65
|
-
|
|
74
|
+
<Animated.View
|
|
75
|
+
style={[
|
|
76
|
+
styles.navigationContainer,
|
|
77
|
+
animatedNavigationMaskContainerStyle,
|
|
78
|
+
]}
|
|
79
|
+
pointerEvents={pointerEvents}
|
|
80
|
+
collapsable={false}
|
|
81
|
+
>
|
|
82
|
+
{children}
|
|
83
|
+
</Animated.View>
|
|
66
84
|
</LazyMaskedView>
|
|
67
85
|
);
|
|
68
86
|
},
|
|
@@ -72,6 +90,9 @@ const styles = StyleSheet.create({
|
|
|
72
90
|
navigationMaskedRoot: {
|
|
73
91
|
flex: 1,
|
|
74
92
|
},
|
|
93
|
+
navigationContainer: {
|
|
94
|
+
flex: 1,
|
|
95
|
+
},
|
|
75
96
|
navigationMaskElement: {
|
|
76
97
|
backgroundColor: "white",
|
|
77
98
|
},
|
|
@@ -2,14 +2,16 @@ import { runOnUI } from "react-native-reanimated";
|
|
|
2
2
|
import { AnimationStore } from "../../../../../stores/animation.store";
|
|
3
3
|
import { BoundStore } from "../../../../../stores/bounds";
|
|
4
4
|
import { GestureStore } from "../../../../../stores/gesture.store";
|
|
5
|
+
import { SystemStore } from "../../../../../stores/system.store";
|
|
5
6
|
|
|
6
7
|
export const resetStoresForScreen = (
|
|
7
8
|
routeKey: string,
|
|
8
9
|
isBranchScreen: boolean,
|
|
9
10
|
branchNavigatorKey?: string,
|
|
10
11
|
) => {
|
|
11
|
-
AnimationStore.
|
|
12
|
-
GestureStore.
|
|
12
|
+
AnimationStore.clearBag(routeKey);
|
|
13
|
+
GestureStore.clearBag(routeKey);
|
|
14
|
+
SystemStore.clearBag(routeKey);
|
|
13
15
|
|
|
14
16
|
runOnUI(() => {
|
|
15
17
|
"worklet";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useLayoutEffect } from "react";
|
|
2
2
|
import {
|
|
3
3
|
runOnJS,
|
|
4
|
+
type SharedValue,
|
|
4
5
|
useAnimatedReaction,
|
|
5
6
|
useDerivedValue,
|
|
6
7
|
} from "react-native-reanimated";
|
|
@@ -23,6 +24,7 @@ import { useNavigatorHistoryRegistry } from "./helpers/use-navigator-history-reg
|
|
|
23
24
|
interface CloseHookParams {
|
|
24
25
|
current: BaseDescriptor;
|
|
25
26
|
animations: AnimationStoreMap;
|
|
27
|
+
targetProgress: SharedValue<number>;
|
|
26
28
|
activate: () => void;
|
|
27
29
|
deactivate: () => void;
|
|
28
30
|
resetStores: () => void;
|
|
@@ -35,6 +37,7 @@ interface CloseHookParams {
|
|
|
35
37
|
const useManagedClose = ({
|
|
36
38
|
current,
|
|
37
39
|
animations,
|
|
40
|
+
targetProgress,
|
|
38
41
|
activate,
|
|
39
42
|
deactivate,
|
|
40
43
|
resetStores,
|
|
@@ -66,6 +69,7 @@ const useManagedClose = ({
|
|
|
66
69
|
target: "close",
|
|
67
70
|
spec: transitionSpec,
|
|
68
71
|
animations,
|
|
72
|
+
targetProgress,
|
|
69
73
|
onAnimationFinish: handleCloseEnd,
|
|
70
74
|
});
|
|
71
75
|
},
|
|
@@ -78,6 +82,7 @@ const useManagedClose = ({
|
|
|
78
82
|
const useNativeStackClose = ({
|
|
79
83
|
current,
|
|
80
84
|
animations,
|
|
85
|
+
targetProgress,
|
|
81
86
|
activate,
|
|
82
87
|
deactivate,
|
|
83
88
|
resetStores,
|
|
@@ -119,6 +124,7 @@ const useNativeStackClose = ({
|
|
|
119
124
|
target: "close",
|
|
120
125
|
spec: current.options.transitionSpec,
|
|
121
126
|
animations,
|
|
127
|
+
targetProgress,
|
|
122
128
|
onAnimationFinish: (finished: boolean) => {
|
|
123
129
|
deactivate();
|
|
124
130
|
if (finished) {
|
|
@@ -143,6 +149,7 @@ const useNativeStackClose = ({
|
|
|
143
149
|
export function useCloseTransition(
|
|
144
150
|
current: BaseDescriptor,
|
|
145
151
|
animations: AnimationStoreMap,
|
|
152
|
+
targetProgress: SharedValue<number>,
|
|
146
153
|
activate: () => void,
|
|
147
154
|
deactivate: () => void,
|
|
148
155
|
) {
|
|
@@ -159,6 +166,7 @@ export function useCloseTransition(
|
|
|
159
166
|
const closeParams: CloseHookParams = {
|
|
160
167
|
current,
|
|
161
168
|
animations,
|
|
169
|
+
targetProgress,
|
|
162
170
|
activate,
|
|
163
171
|
deactivate,
|
|
164
172
|
resetStores,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { useLayoutEffect } from "react";
|
|
2
|
+
import type { SharedValue } from "react-native-reanimated";
|
|
2
3
|
import type { BaseDescriptor } from "../../../providers/screen/descriptors";
|
|
3
4
|
import type { AnimationStoreMap } from "../../../stores/animation.store";
|
|
4
5
|
import type { SnapPoint } from "../../../types/screen.types";
|
|
@@ -35,6 +36,7 @@ function getInitialProgress({
|
|
|
35
36
|
export function useOpenTransition(
|
|
36
37
|
current: BaseDescriptor,
|
|
37
38
|
animations: AnimationStoreMap,
|
|
39
|
+
targetProgressValue: SharedValue<number>,
|
|
38
40
|
isFirstKey: boolean,
|
|
39
41
|
) {
|
|
40
42
|
const { activateHighRefreshRate, deactivateHighRefreshRate } =
|
|
@@ -42,16 +44,24 @@ export function useOpenTransition(
|
|
|
42
44
|
|
|
43
45
|
// biome-ignore lint/correctness/useExhaustiveDependencies: Must only run once on mount
|
|
44
46
|
useLayoutEffect(() => {
|
|
45
|
-
const {
|
|
46
|
-
|
|
47
|
+
const {
|
|
48
|
+
snapPoints,
|
|
49
|
+
initialSnapIndex = 0,
|
|
50
|
+
experimental_animateOnInitialMount,
|
|
51
|
+
} = current.options;
|
|
47
52
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
53
|
+
const initialProgress = getInitialProgress({
|
|
54
|
+
snapPoints,
|
|
55
|
+
initialSnapIndex,
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
if (isFirstKey && !experimental_animateOnInitialMount) {
|
|
59
|
+
if (initialProgress === "auto") {
|
|
60
|
+
targetProgressValue.set(0);
|
|
51
61
|
animations.progress.set(0);
|
|
52
62
|
} else {
|
|
53
|
-
const target =
|
|
54
|
-
|
|
63
|
+
const target = initialProgress ?? 1;
|
|
64
|
+
targetProgressValue.set(target);
|
|
55
65
|
animations.progress.set(target);
|
|
56
66
|
}
|
|
57
67
|
animations.animating.set(0);
|
|
@@ -61,16 +71,17 @@ export function useOpenTransition(
|
|
|
61
71
|
}
|
|
62
72
|
|
|
63
73
|
// When the initial snap point is 'auto', defer the opening animation until
|
|
64
|
-
// ScreenContainer has measured the content and set
|
|
65
|
-
if (
|
|
74
|
+
// ScreenContainer has measured the content and set resolvedAutoSnapPoint.
|
|
75
|
+
if (initialProgress === "auto") {
|
|
66
76
|
return;
|
|
67
77
|
}
|
|
68
78
|
|
|
69
79
|
activateHighRefreshRate();
|
|
70
80
|
animateToProgress({
|
|
71
|
-
target:
|
|
81
|
+
target: initialProgress ?? "open",
|
|
72
82
|
spec: current.options.transitionSpec,
|
|
73
83
|
animations,
|
|
84
|
+
targetProgress: targetProgressValue,
|
|
74
85
|
onAnimationFinish: deactivateHighRefreshRate,
|
|
75
86
|
});
|
|
76
87
|
}, []);
|
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
useDescriptors,
|
|
4
4
|
} from "../../providers/screen/descriptors";
|
|
5
5
|
import { AnimationStore } from "../../stores/animation.store";
|
|
6
|
+
import { SystemStore } from "../../stores/system.store";
|
|
6
7
|
import { useCloseTransition } from "./hooks/use-close-transition";
|
|
7
8
|
import { useOpenTransition } from "./hooks/use-open-transition";
|
|
8
9
|
import { useScreenEvents } from "./hooks/use-screen-events";
|
|
@@ -18,14 +19,19 @@ interface Props {
|
|
|
18
19
|
export const ScreenLifecycle = ({ children }: Props) => {
|
|
19
20
|
const { current, previous } = useDescriptors();
|
|
20
21
|
const { isFirstKey } = useDescriptorDerivations();
|
|
21
|
-
const animations = AnimationStore.
|
|
22
|
+
const animations = AnimationStore.getBag(current.route.key);
|
|
23
|
+
const targetProgress = SystemStore.getValue(
|
|
24
|
+
current.route.key,
|
|
25
|
+
"targetProgress",
|
|
26
|
+
);
|
|
22
27
|
|
|
23
28
|
const { activateHighRefreshRate, deactivateHighRefreshRate } =
|
|
24
|
-
useOpenTransition(current, animations, isFirstKey);
|
|
29
|
+
useOpenTransition(current, animations, targetProgress, isFirstKey);
|
|
25
30
|
|
|
26
31
|
useCloseTransition(
|
|
27
32
|
current,
|
|
28
33
|
animations,
|
|
34
|
+
targetProgress,
|
|
29
35
|
activateHighRefreshRate,
|
|
30
36
|
deactivateHighRefreshRate,
|
|
31
37
|
);
|
|
@@ -277,10 +277,10 @@ export const SharedIGImage = ({
|
|
|
277
277
|
const dragXScale = interpolate(normX, [0, 1], [1, 0.8]);
|
|
278
278
|
const dragYScale = interpolate(normY, [0, 1], [1, 0.8]);
|
|
279
279
|
|
|
280
|
-
const navigationStyles =
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
280
|
+
const navigationStyles =
|
|
281
|
+
bounds({
|
|
282
|
+
id: sharedBoundTag,
|
|
283
|
+
}).navigation.zoom() ?? {};
|
|
284
284
|
|
|
285
285
|
// Extract raw style values from bounds result (legacy format)
|
|
286
286
|
const sourceStyle = navigationStyles[sharedBoundTag] as
|
|
@@ -620,9 +620,10 @@ export const SharedXImage = ({
|
|
|
620
620
|
|
|
621
621
|
if (!focused) return {};
|
|
622
622
|
|
|
623
|
-
const navigationStyles =
|
|
624
|
-
|
|
625
|
-
|
|
623
|
+
const navigationStyles =
|
|
624
|
+
bounds({
|
|
625
|
+
id: sharedBoundTag,
|
|
626
|
+
}).navigation.zoom() ?? {};
|
|
626
627
|
const maskStyle = navigationStyles[NAVIGATION_MASK_ELEMENT_STYLE_ID] as
|
|
627
628
|
| Record<string, unknown>
|
|
628
629
|
| undefined;
|
package/src/shared/constants.ts
CHANGED
|
@@ -61,6 +61,13 @@ export const createScreenTransitionState = (
|
|
|
61
61
|
gesture: { ...DEFAULT_GESTURE_VALUES },
|
|
62
62
|
route,
|
|
63
63
|
meta,
|
|
64
|
+
layouts: {
|
|
65
|
+
screen: {
|
|
66
|
+
width: 0,
|
|
67
|
+
height: 0,
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
snapIndex: -1,
|
|
64
71
|
});
|
|
65
72
|
|
|
66
73
|
/**
|
|
@@ -75,6 +82,13 @@ export const DEFAULT_SCREEN_TRANSITION_STATE: ScreenTransitionState =
|
|
|
75
82
|
entering: 0,
|
|
76
83
|
gesture: DEFAULT_GESTURE_VALUES,
|
|
77
84
|
route: {} as RouteProp<ParamListBase>,
|
|
85
|
+
layouts: {
|
|
86
|
+
screen: {
|
|
87
|
+
width: 0,
|
|
88
|
+
height: 0,
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
snapIndex: -1,
|
|
78
92
|
});
|
|
79
93
|
|
|
80
94
|
/**
|
|
@@ -149,14 +149,8 @@ export const useAssociatedStyles = ({
|
|
|
149
149
|
const { stylesMap, ancestorStylesMaps } = useScreenStyles();
|
|
150
150
|
const { previousScreenKey, currentScreenKey, hasConfiguredInterpolator } =
|
|
151
151
|
useDescriptorDerivations();
|
|
152
|
-
const isAnimating = AnimationStore.
|
|
153
|
-
|
|
154
|
-
"animating",
|
|
155
|
-
);
|
|
156
|
-
const isClosing = AnimationStore.getRouteAnimation(
|
|
157
|
-
currentScreenKey,
|
|
158
|
-
"closing",
|
|
159
|
-
);
|
|
152
|
+
const isAnimating = AnimationStore.getValue(currentScreenKey, "animating");
|
|
153
|
+
const isClosing = AnimationStore.getValue(currentScreenKey, "closing");
|
|
160
154
|
const previousAppliedKeys = useSharedValue<Record<string, true>>({});
|
|
161
155
|
const emptyGraceFrameCount = useSharedValue(0);
|
|
162
156
|
const lastResolvedBase = useSharedValue<Record<string, any> | null>(null);
|
package/src/shared/index.ts
CHANGED