react-native-screen-transitions 3.4.0-alpha.2 → 3.4.0-alpha.4
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 +4 -18
- package/lib/commonjs/shared/components/create-boundary-component/index.js.map +1 -1
- package/lib/commonjs/shared/components/create-transition-aware-component.js +1 -2
- package/lib/commonjs/shared/components/create-transition-aware-component.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 +43 -0
- package/lib/commonjs/shared/components/screen-container/deferred-visibility-host.js.map +1 -0
- 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/index.js +7 -4
- package/lib/commonjs/shared/components/screen-container/index.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.map +1 -1
- package/lib/commonjs/shared/components/screen-container/layers/maybe-masked-navigation-container.js +17 -24
- 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 +9 -10
- package/lib/commonjs/shared/configs/presets.js.map +1 -1
- package/lib/commonjs/shared/constants.js +26 -6
- package/lib/commonjs/shared/constants.js.map +1 -1
- package/lib/commonjs/shared/hooks/animation/use-associated-style.js +11 -36
- package/lib/commonjs/shared/hooks/animation/use-associated-style.js.map +1 -1
- package/lib/commonjs/shared/index.js +4 -10
- package/lib/commonjs/shared/index.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-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/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 +50 -0
- package/lib/commonjs/shared/providers/screen/helpers/resolve-interpolated-style-output.js.map +1 -0
- package/lib/commonjs/shared/providers/screen/styles.provider.js +34 -10
- 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 +2 -2
- 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 +100 -363
- 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 +4 -18
- package/lib/module/shared/components/create-boundary-component/index.js.map +1 -1
- package/lib/module/shared/components/create-transition-aware-component.js +1 -2
- package/lib/module/shared/components/create-transition-aware-component.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 +38 -0
- package/lib/module/shared/components/screen-container/deferred-visibility-host.js.map +1 -0
- 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/index.js +7 -4
- package/lib/module/shared/components/screen-container/index.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.map +1 -1
- package/lib/module/shared/components/screen-container/layers/maybe-masked-navigation-container.js +20 -27
- 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 +10 -11
- package/lib/module/shared/configs/presets.js.map +1 -1
- package/lib/module/shared/constants.js +25 -5
- package/lib/module/shared/constants.js.map +1 -1
- package/lib/module/shared/hooks/animation/use-associated-style.js +12 -37
- package/lib/module/shared/hooks/animation/use-associated-style.js.map +1 -1
- package/lib/module/shared/index.js +1 -1
- package/lib/module/shared/index.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-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/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 +44 -0
- package/lib/module/shared/providers/screen/helpers/resolve-interpolated-style-output.js.map +1 -0
- package/lib/module/shared/providers/screen/styles.provider.js +33 -11
- 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 +3 -3
- 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 +94 -357
- 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/create-transition-aware-component.d.ts.map +1 -1
- package/lib/typescript/shared/components/native-screen.d.ts.map +1 -1
- package/lib/typescript/shared/components/screen-container/deferred-visibility-host.d.ts +13 -0
- package/lib/typescript/shared/components/screen-container/deferred-visibility-host.d.ts.map +1 -0
- package/lib/typescript/shared/components/screen-container/hooks/use-content-layout.d.ts.map +1 -1
- package/lib/typescript/shared/components/screen-container/index.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 +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/index.d.ts.map +1 -1
- package/lib/typescript/shared/configs/presets.d.ts.map +1 -1
- package/lib/typescript/shared/constants.d.ts +9 -3
- package/lib/typescript/shared/constants.d.ts.map +1 -1
- package/lib/typescript/shared/hooks/animation/use-associated-style.d.ts +5 -11
- package/lib/typescript/shared/hooks/animation/use-associated-style.d.ts.map +1 -1
- package/lib/typescript/shared/index.d.ts +4 -4
- package/lib/typescript/shared/index.d.ts.map +1 -1
- package/lib/typescript/shared/providers/gestures/handlers/use-handlers.d.ts.map +1 -1
- package/lib/typescript/shared/providers/gestures/helpers/gesture-snap-points.d.ts +2 -2
- package/lib/typescript/shared/providers/gestures/helpers/gesture-snap-points.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 +14 -0
- package/lib/typescript/shared/providers/screen/helpers/resolve-interpolated-style-output.d.ts.map +1 -0
- package/lib/typescript/shared/providers/screen/styles.provider.d.ts +4 -2
- 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 +40 -6
- 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 +16 -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 +11 -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 +3 -23
- package/src/shared/components/create-transition-aware-component.tsx +0 -1
- package/src/shared/components/native-screen.tsx +3 -9
- package/src/shared/components/screen-container/deferred-visibility-host.tsx +37 -0
- package/src/shared/components/screen-container/hooks/use-content-layout.ts +42 -43
- package/src/shared/components/screen-container/index.tsx +5 -2
- package/src/shared/components/screen-container/layers/backdrop.tsx +12 -6
- package/src/shared/components/screen-container/layers/content.tsx +3 -0
- package/src/shared/components/screen-container/layers/maybe-masked-navigation-container.tsx +30 -32
- 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 +18 -17
- package/src/shared/constants.ts +19 -3
- package/src/shared/hooks/animation/use-associated-style.ts +12 -62
- package/src/shared/index.ts +4 -3
- package/src/shared/providers/gestures/handlers/use-handlers.ts +13 -10
- package/src/shared/providers/gestures/helpers/gesture-snap-points.ts +12 -10
- 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 +61 -0
- package/src/shared/providers/screen/styles.provider.tsx +99 -72
- 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 +43 -6
- package/src/shared/types/bounds.types.ts +25 -25
- package/src/shared/types/index.ts +2 -0
- package/src/shared/types/screen.types.ts +17 -0
- package/src/shared/utils/animation/animate-to-progress.ts +4 -2
- package/src/shared/utils/bounds/helpers/compute-bounds-styles.ts +3 -3
- package/src/shared/utils/bounds/index.ts +26 -75
- package/src/shared/utils/bounds/zoom/build.ts +174 -497
- 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
|
@@ -49,7 +49,7 @@ export function useProcessedRoutes<
|
|
|
49
49
|
scenes[i] = { route, descriptor };
|
|
50
50
|
routeKeys[i] = route.key;
|
|
51
51
|
backdropBehaviors[i] = options?.backdropBehavior ?? "block";
|
|
52
|
-
animationMaps[i] = AnimationStore.
|
|
52
|
+
animationMaps[i] = AnimationStore.getBag(route.key);
|
|
53
53
|
|
|
54
54
|
if (!shouldShowFloatOverlay) {
|
|
55
55
|
shouldShowFloatOverlay = isOverlayVisible(options);
|
|
@@ -3,85 +3,35 @@ import {
|
|
|
3
3
|
makeMutable,
|
|
4
4
|
type SharedValue,
|
|
5
5
|
} from "react-native-reanimated";
|
|
6
|
-
import
|
|
6
|
+
import { createStore } from "../utils/create-store";
|
|
7
7
|
|
|
8
8
|
export type AnimationStoreMap = {
|
|
9
9
|
progress: SharedValue<number>;
|
|
10
10
|
animating: SharedValue<number>;
|
|
11
11
|
closing: SharedValue<number>;
|
|
12
12
|
entering: SharedValue<number>;
|
|
13
|
-
targetProgress: SharedValue<number>;
|
|
14
|
-
/** Resolved fraction (contentHeight / screenHeight) for the 'auto' snap point. -1 = not yet measured. */
|
|
15
|
-
autoSnapPoint: SharedValue<number>;
|
|
16
|
-
/** Intrinsic content layout measured from the screen container wrapper. */
|
|
17
|
-
contentLayout: SharedValue<Layout | null>;
|
|
18
13
|
};
|
|
19
14
|
|
|
20
|
-
const store: Record<ScreenKey, AnimationStoreMap> = {};
|
|
21
|
-
|
|
22
15
|
function createAnimationBag(): AnimationStoreMap {
|
|
23
16
|
return {
|
|
24
17
|
progress: makeMutable(0),
|
|
25
18
|
closing: makeMutable(0),
|
|
26
19
|
animating: makeMutable(0),
|
|
27
20
|
entering: makeMutable(0),
|
|
28
|
-
targetProgress: makeMutable(1),
|
|
29
|
-
autoSnapPoint: makeMutable(-1),
|
|
30
|
-
contentLayout: makeMutable<Layout | null>(null),
|
|
31
21
|
};
|
|
32
22
|
}
|
|
33
23
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
function peekRouteAnimations(
|
|
44
|
-
routeKey: ScreenKey,
|
|
45
|
-
): AnimationStoreMap | undefined {
|
|
46
|
-
return store[routeKey];
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
function getRouteAnimation<K extends keyof AnimationStoreMap>(
|
|
50
|
-
routeKey: ScreenKey,
|
|
51
|
-
type: K,
|
|
52
|
-
): AnimationStoreMap[K] {
|
|
53
|
-
return ensure(routeKey)[type];
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
function getAnimation<K extends keyof AnimationStoreMap>(
|
|
57
|
-
routeKey: ScreenKey,
|
|
58
|
-
type: K,
|
|
59
|
-
): AnimationStoreMap[K] {
|
|
60
|
-
return getRouteAnimation(routeKey, type);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
function getRouteAnimations(routeKey: ScreenKey): AnimationStoreMap {
|
|
64
|
-
return ensure(routeKey);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
function clear(routeKey: ScreenKey) {
|
|
68
|
-
const bag = store[routeKey];
|
|
69
|
-
if (bag) {
|
|
24
|
+
/**
|
|
25
|
+
* Route-keyed screen transition state for the public animation lifecycle. These
|
|
26
|
+
* shared values track the current progress and whether a screen is entering,
|
|
27
|
+
* closing, or actively animating.
|
|
28
|
+
*/
|
|
29
|
+
export const AnimationStore = createStore<AnimationStoreMap>({
|
|
30
|
+
createBag: createAnimationBag,
|
|
31
|
+
disposeBag: (bag) => {
|
|
70
32
|
cancelAnimation(bag.progress);
|
|
71
33
|
cancelAnimation(bag.animating);
|
|
72
34
|
cancelAnimation(bag.closing);
|
|
73
35
|
cancelAnimation(bag.entering);
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
cancelAnimation(bag.contentLayout);
|
|
77
|
-
}
|
|
78
|
-
delete store[routeKey];
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
export const AnimationStore = {
|
|
82
|
-
getAnimation,
|
|
83
|
-
peekRouteAnimations,
|
|
84
|
-
getRouteAnimation,
|
|
85
|
-
getRouteAnimations,
|
|
86
|
-
clear,
|
|
87
|
-
};
|
|
36
|
+
},
|
|
37
|
+
});
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
type SharedValue,
|
|
5
5
|
} from "react-native-reanimated";
|
|
6
6
|
import type { GestureDirection } from "../types/gesture.types";
|
|
7
|
-
import
|
|
7
|
+
import { createStore } from "../utils/create-store";
|
|
8
8
|
|
|
9
9
|
export type GestureStoreMap = {
|
|
10
10
|
x: SharedValue<number>;
|
|
@@ -15,19 +15,24 @@ export type GestureStoreMap = {
|
|
|
15
15
|
dragging: SharedValue<number>;
|
|
16
16
|
direction: SharedValue<Omit<GestureDirection, "bidirectional"> | null>;
|
|
17
17
|
|
|
18
|
-
/**
|
|
18
|
+
/**
|
|
19
|
+
* @deprecated Use `normX` instead.
|
|
20
|
+
*/
|
|
19
21
|
normalizedX: SharedValue<number>;
|
|
20
|
-
/**
|
|
22
|
+
/**
|
|
23
|
+
* @deprecated Use `normY` instead.
|
|
24
|
+
*/
|
|
21
25
|
normalizedY: SharedValue<number>;
|
|
22
|
-
/**
|
|
26
|
+
/**
|
|
27
|
+
* @deprecated Use `dismissing` instead.
|
|
28
|
+
*/
|
|
23
29
|
isDismissing: SharedValue<number>;
|
|
24
|
-
/**
|
|
30
|
+
/**
|
|
31
|
+
* @deprecated Use `dragging` instead.
|
|
32
|
+
*/
|
|
25
33
|
isDragging: SharedValue<number>;
|
|
26
34
|
};
|
|
27
35
|
|
|
28
|
-
const store: Record<ScreenKey, GestureStoreMap> = {};
|
|
29
|
-
let neutralGestures: GestureStoreMap | undefined;
|
|
30
|
-
|
|
31
36
|
function createGestureBag(): GestureStoreMap {
|
|
32
37
|
const normX = makeMutable(0);
|
|
33
38
|
const normY = makeMutable(0);
|
|
@@ -53,33 +58,16 @@ function createGestureBag(): GestureStoreMap {
|
|
|
53
58
|
};
|
|
54
59
|
}
|
|
55
60
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
return store[routeKey];
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
function getRouteGestures(routeKey: ScreenKey) {
|
|
70
|
-
return ensure(routeKey);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
function getNeutralGestures(): GestureStoreMap {
|
|
74
|
-
if (!neutralGestures) {
|
|
75
|
-
neutralGestures = createGestureBag();
|
|
76
|
-
}
|
|
77
|
-
return neutralGestures;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
function clear(routeKey: ScreenKey) {
|
|
81
|
-
const bag = store[routeKey];
|
|
82
|
-
if (bag) {
|
|
61
|
+
/**
|
|
62
|
+
* Route-keyed gesture state used by the transition system while a screen is
|
|
63
|
+
* being dragged or dismissed. It stores raw and normalized gesture values,
|
|
64
|
+
* dismissal flags, and the active gesture direction. `getCachedBag()` provides
|
|
65
|
+
* a stable neutral fallback bag for cases where a route should not own live
|
|
66
|
+
* gesture state.
|
|
67
|
+
*/
|
|
68
|
+
export const GestureStore = createStore<GestureStoreMap>({
|
|
69
|
+
createBag: createGestureBag,
|
|
70
|
+
disposeBag: (bag) => {
|
|
83
71
|
cancelAnimation(bag.x);
|
|
84
72
|
cancelAnimation(bag.y);
|
|
85
73
|
cancelAnimation(bag.normX);
|
|
@@ -87,13 +75,5 @@ function clear(routeKey: ScreenKey) {
|
|
|
87
75
|
cancelAnimation(bag.dismissing);
|
|
88
76
|
cancelAnimation(bag.dragging);
|
|
89
77
|
cancelAnimation(bag.direction);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
export const GestureStore = {
|
|
95
|
-
peekRouteGestures,
|
|
96
|
-
getRouteGestures,
|
|
97
|
-
getNeutralGestures,
|
|
98
|
-
clear,
|
|
99
|
-
};
|
|
78
|
+
},
|
|
79
|
+
});
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import {
|
|
2
|
+
cancelAnimation,
|
|
3
|
+
makeMutable,
|
|
4
|
+
type SharedValue,
|
|
5
|
+
} from "react-native-reanimated";
|
|
6
|
+
import type { Layout } from "../types/screen.types";
|
|
7
|
+
import { createStore } from "../utils/create-store";
|
|
8
|
+
|
|
9
|
+
export type SystemStoreMap = {
|
|
10
|
+
targetProgress: SharedValue<number>;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Resolved fraction (contentHeight / screenHeight) for the 'auto' snap point. -1 = not yet measured.
|
|
14
|
+
*/
|
|
15
|
+
resolvedAutoSnapPoint: SharedValue<number>;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Intrinsic measured content layout from the screen container wrapper.
|
|
19
|
+
*/
|
|
20
|
+
measuredContentLayout: SharedValue<Layout | null>;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
function createSystemBag(): SystemStoreMap {
|
|
24
|
+
return {
|
|
25
|
+
targetProgress: makeMutable(1),
|
|
26
|
+
resolvedAutoSnapPoint: makeMutable(-1),
|
|
27
|
+
measuredContentLayout: makeMutable<Layout | null>(null),
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Route-keyed internal engine state that should not be treated as public screen
|
|
33
|
+
* animation data. These values support runtime measurement and orchestration,
|
|
34
|
+
* such as resolved auto snap points, measured content layout, and the current
|
|
35
|
+
* animation target progress. This could possibly grow in the future.
|
|
36
|
+
*/
|
|
37
|
+
export const SystemStore = createStore<SystemStoreMap>({
|
|
38
|
+
createBag: createSystemBag,
|
|
39
|
+
disposeBag: (bag) => {
|
|
40
|
+
cancelAnimation(bag.targetProgress);
|
|
41
|
+
cancelAnimation(bag.resolvedAutoSnapPoint);
|
|
42
|
+
cancelAnimation(bag.measuredContentLayout);
|
|
43
|
+
},
|
|
44
|
+
});
|
|
@@ -77,6 +77,33 @@ export type ScreenTransitionState = {
|
|
|
77
77
|
* The route object for this screen.
|
|
78
78
|
*/
|
|
79
79
|
route: BaseStackRoute;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Layout measurements for this specific screen.
|
|
83
|
+
*/
|
|
84
|
+
layouts: {
|
|
85
|
+
/**
|
|
86
|
+
* The `width` and `height` of the screen container.
|
|
87
|
+
*/
|
|
88
|
+
screen: Layout;
|
|
89
|
+
/**
|
|
90
|
+
* The intrinsic measured content wrapper layout when available.
|
|
91
|
+
*
|
|
92
|
+
* This is currently populated for the measured screen-container path used by
|
|
93
|
+
* auto snap-point sizing. It is undefined until a real measurement exists.
|
|
94
|
+
*/
|
|
95
|
+
content?: Layout;
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Animated index of this screen's current snap point.
|
|
100
|
+
* Interpolates between indices during gestures/animations.
|
|
101
|
+
* - Returns -1 if no snap points are defined
|
|
102
|
+
* - Returns 0 when at or below first snap point
|
|
103
|
+
* - Returns fractional values between snap points (e.g., 1.5 = halfway between snap 1 and 2)
|
|
104
|
+
* - Returns length-1 when at or above last snap point
|
|
105
|
+
*/
|
|
106
|
+
snapIndex: number;
|
|
80
107
|
};
|
|
81
108
|
|
|
82
109
|
export interface ScreenInterpolationProps {
|
|
@@ -97,6 +124,8 @@ export interface ScreenInterpolationProps {
|
|
|
97
124
|
|
|
98
125
|
/**
|
|
99
126
|
* Layout measurements for the screen.
|
|
127
|
+
*
|
|
128
|
+
* @deprecated Use `current.layouts` instead.
|
|
100
129
|
*/
|
|
101
130
|
layouts: {
|
|
102
131
|
/**
|
|
@@ -142,11 +171,8 @@ export interface ScreenInterpolationProps {
|
|
|
142
171
|
|
|
143
172
|
/**
|
|
144
173
|
* Animated index of the current snap point.
|
|
145
|
-
*
|
|
146
|
-
*
|
|
147
|
-
* - Returns 0 when at or below first snap point
|
|
148
|
-
* - Returns fractional values between snap points (e.g., 1.5 = halfway between snap 1 and 2)
|
|
149
|
-
* - Returns length-1 when at or above last snap point
|
|
174
|
+
*
|
|
175
|
+
* @deprecated Use `current.snapIndex` instead.
|
|
150
176
|
*/
|
|
151
177
|
snapIndex: number;
|
|
152
178
|
|
|
@@ -167,9 +193,20 @@ export interface ScreenInterpolationProps {
|
|
|
167
193
|
inactive: ScreenTransitionState | undefined;
|
|
168
194
|
}
|
|
169
195
|
|
|
196
|
+
/**
|
|
197
|
+
* Explicit signal for hiding a screen's visual subtree until the interpolator
|
|
198
|
+
* becomes ready for the current transition frame.
|
|
199
|
+
*/
|
|
200
|
+
export type DeferredScreenStyleSignal = "defer";
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* Returning `'defer'` explicitly hides the screen's visual subtree until the
|
|
204
|
+
* transition is ready. Returning `null`, `undefined`, or `{}` applies no
|
|
205
|
+
* transition styles for the current frame.
|
|
206
|
+
*/
|
|
170
207
|
export type ScreenStyleInterpolator = (
|
|
171
208
|
props: ScreenInterpolationProps,
|
|
172
|
-
) => TransitionInterpolatedStyle;
|
|
209
|
+
) => TransitionInterpolatedStyle | DeferredScreenStyleSignal | null | undefined;
|
|
173
210
|
|
|
174
211
|
/**
|
|
175
212
|
* Animated style properties with full autocomplete.
|
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
import type { MeasuredDimensions, StyleProps } from "react-native-reanimated";
|
|
2
|
+
import {
|
|
3
|
+
NAVIGATION_MASK_CONTAINER_STYLE_ID,
|
|
4
|
+
NAVIGATION_MASK_ELEMENT_STYLE_ID,
|
|
5
|
+
} from "../constants";
|
|
2
6
|
import type { Snapshot } from "../stores/bounds";
|
|
3
7
|
import type {
|
|
4
8
|
BoundId,
|
|
5
|
-
BoundsAnchor,
|
|
6
9
|
BoundsOptions,
|
|
7
10
|
BoundsOptionsResult,
|
|
8
|
-
BoundsScaleMode,
|
|
9
11
|
} from "../utils/bounds/types/options";
|
|
10
|
-
import type {
|
|
12
|
+
import type {
|
|
13
|
+
ScreenInterpolationProps,
|
|
14
|
+
TransitionInterpolatedStyle,
|
|
15
|
+
TransitionSlotStyle,
|
|
16
|
+
} from "./animation.types";
|
|
11
17
|
|
|
12
18
|
/**
|
|
13
19
|
* Target style computation.
|
|
@@ -29,32 +35,19 @@ export type BoundsLink = {
|
|
|
29
35
|
};
|
|
30
36
|
|
|
31
37
|
export type BoundsNavigationZoomOptions = {
|
|
32
|
-
anchor?: BoundsAnchor;
|
|
33
|
-
scaleMode?: BoundsScaleMode;
|
|
34
38
|
target?: "bound" | "fullscreen" | MeasuredDimensions;
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
| number
|
|
44
|
-
| { top?: number; right?: number; bottom?: number; left?: number };
|
|
45
|
-
};
|
|
46
|
-
motion?: {
|
|
47
|
-
dragResistance?: number;
|
|
48
|
-
dragDirectionalScaleMin?: number;
|
|
49
|
-
};
|
|
50
|
-
/**
|
|
51
|
-
* @deprecated Use `mask.borderRadius` instead.
|
|
52
|
-
*/
|
|
53
|
-
maskBorderRadius?: number;
|
|
39
|
+
DEBUG?: boolean;
|
|
40
|
+
borderRadius?: number;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export type BoundsNavigationZoomStyle = TransitionInterpolatedStyle & {
|
|
44
|
+
content?: TransitionSlotStyle;
|
|
45
|
+
[NAVIGATION_MASK_CONTAINER_STYLE_ID]?: TransitionSlotStyle;
|
|
46
|
+
[NAVIGATION_MASK_ELEMENT_STYLE_ID]?: TransitionSlotStyle;
|
|
54
47
|
};
|
|
55
48
|
|
|
56
49
|
export type BoundsNavigationAccessor = {
|
|
57
|
-
zoom: (options?: BoundsNavigationZoomOptions) =>
|
|
50
|
+
zoom: (options?: BoundsNavigationZoomOptions) => BoundsNavigationZoomStyle;
|
|
58
51
|
};
|
|
59
52
|
|
|
60
53
|
type BoundsBoundNavigationAccessor = {
|
|
@@ -80,3 +73,10 @@ export type BoundsAccessor = {
|
|
|
80
73
|
fallback?: number,
|
|
81
74
|
) => number;
|
|
82
75
|
};
|
|
76
|
+
|
|
77
|
+
export type BoundsInterpolationProps = Omit<
|
|
78
|
+
ScreenInterpolationProps,
|
|
79
|
+
"bounds"
|
|
80
|
+
> & {
|
|
81
|
+
navigationMaskEnabled?: boolean;
|
|
82
|
+
};
|
|
@@ -2,6 +2,7 @@ export { FALSE, TRUE } from "../constants";
|
|
|
2
2
|
export type {
|
|
3
3
|
AnimatedViewStyle,
|
|
4
4
|
AnimationConfig,
|
|
5
|
+
DeferredScreenStyleSignal,
|
|
5
6
|
ScreenInterpolationProps,
|
|
6
7
|
ScreenStyleInterpolator,
|
|
7
8
|
ScreenTransitionState,
|
|
@@ -14,6 +15,7 @@ export type {
|
|
|
14
15
|
BoundsMethod,
|
|
15
16
|
BoundsNavigationAccessor,
|
|
16
17
|
BoundsNavigationZoomOptions,
|
|
18
|
+
BoundsNavigationZoomStyle,
|
|
17
19
|
} from "./bounds.types";
|
|
18
20
|
export type {
|
|
19
21
|
ActivationArea,
|
|
@@ -80,6 +80,11 @@ export type TransitionAwareProps<T extends object> = AnimatedProps<T> & {
|
|
|
80
80
|
export type ScreenTransitionConfig = {
|
|
81
81
|
/**
|
|
82
82
|
* The user-provided function to calculate styles based on animation progress.
|
|
83
|
+
*
|
|
84
|
+
* Return `null` to explicitly defer rendering of the screen's visual subtree
|
|
85
|
+
* until a later frame. This is useful for transitions such as
|
|
86
|
+
* `bounds().navigation.zoom()` where the screen should stay hidden until the
|
|
87
|
+
* interpolator has enough state to produce a safe first frame.
|
|
83
88
|
*/
|
|
84
89
|
screenStyleInterpolator?: ScreenStyleInterpolator;
|
|
85
90
|
|
|
@@ -197,6 +202,18 @@ export type ScreenTransitionConfig = {
|
|
|
197
202
|
*/
|
|
198
203
|
experimental_enableHighRefreshRate?: boolean;
|
|
199
204
|
|
|
205
|
+
/**
|
|
206
|
+
* Animates the first screen in a navigator from its closed state on initial mount
|
|
207
|
+
* instead of snapping directly to its settled progress.
|
|
208
|
+
*
|
|
209
|
+
* Useful for launch/onboarding flows where the initial screen should participate
|
|
210
|
+
* in the same transition system as pushed screens.
|
|
211
|
+
*
|
|
212
|
+
* @experimental This API may change in future versions.
|
|
213
|
+
* @default false
|
|
214
|
+
*/
|
|
215
|
+
experimental_animateOnInitialMount?: boolean;
|
|
216
|
+
|
|
200
217
|
/**
|
|
201
218
|
* Describes heights where a screen can rest, as fractions of screen height,
|
|
202
219
|
* or `'auto'` to snap to the intrinsic height of the screen content.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { runOnJS } from "react-native-reanimated";
|
|
1
|
+
import { runOnJS, type SharedValue } from "react-native-reanimated";
|
|
2
2
|
import { FALSE, TRUE } from "../../constants";
|
|
3
3
|
import type { AnimationStoreMap } from "../../stores/animation.store";
|
|
4
4
|
import type { TransitionSpec } from "../../types/animation.types";
|
|
@@ -15,6 +15,7 @@ interface AnimateToProgressProps {
|
|
|
15
15
|
spec?: TransitionSpec;
|
|
16
16
|
onAnimationFinish?: (finished: boolean) => void;
|
|
17
17
|
animations: AnimationStoreMap;
|
|
18
|
+
targetProgress: SharedValue<number>;
|
|
18
19
|
/** Optional initial velocity for spring-based progress (units: progress/sec). */
|
|
19
20
|
initialVelocity?: number;
|
|
20
21
|
}
|
|
@@ -24,6 +25,7 @@ export const animateToProgress = ({
|
|
|
24
25
|
spec,
|
|
25
26
|
onAnimationFinish,
|
|
26
27
|
animations,
|
|
28
|
+
targetProgress,
|
|
27
29
|
initialVelocity,
|
|
28
30
|
}: AnimateToProgressProps) => {
|
|
29
31
|
"worklet";
|
|
@@ -44,7 +46,7 @@ export const animateToProgress = ({
|
|
|
44
46
|
? { ...config, velocity: initialVelocity }
|
|
45
47
|
: config;
|
|
46
48
|
|
|
47
|
-
const { progress, animating, closing, entering
|
|
49
|
+
const { progress, animating, closing, entering } = animations;
|
|
48
50
|
|
|
49
51
|
targetProgress.set(value);
|
|
50
52
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { MeasuredDimensions } from "react-native-reanimated";
|
|
2
2
|
import {
|
|
3
|
-
EMPTY_BOUND_HELPER_RESULT,
|
|
4
3
|
EMPTY_BOUND_HELPER_RESULT_RAW,
|
|
5
4
|
ENTER_RANGE,
|
|
6
5
|
EXIT_RANGE,
|
|
7
6
|
FULLSCREEN_DIMENSIONS,
|
|
7
|
+
HIDDEN_STYLE,
|
|
8
8
|
} from "../../../constants";
|
|
9
9
|
import {
|
|
10
10
|
BoundStore,
|
|
@@ -127,7 +127,7 @@ export const computeBoundStyles = (
|
|
|
127
127
|
if (computeOptions.raw) {
|
|
128
128
|
return EMPTY_BOUND_HELPER_RESULT_RAW;
|
|
129
129
|
}
|
|
130
|
-
return
|
|
130
|
+
return HIDDEN_STYLE;
|
|
131
131
|
}
|
|
132
132
|
|
|
133
133
|
const {
|
|
@@ -153,7 +153,7 @@ export const computeBoundStyles = (
|
|
|
153
153
|
if (computeOptions.raw) {
|
|
154
154
|
return EMPTY_BOUND_HELPER_RESULT_RAW;
|
|
155
155
|
}
|
|
156
|
-
return
|
|
156
|
+
return HIDDEN_STYLE;
|
|
157
157
|
}
|
|
158
158
|
|
|
159
159
|
const ranges: readonly [number, number] = entering ? ENTER_RANGE : EXIT_RANGE;
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import { BoundStore, type ResolvedTransitionPair } from "../../stores/bounds";
|
|
2
2
|
import type { ScreenInterpolationProps } from "../../types/animation.types";
|
|
3
|
-
import type {
|
|
3
|
+
import type {
|
|
4
|
+
BoundsAccessor,
|
|
5
|
+
BoundsInterpolationProps,
|
|
6
|
+
BoundsNavigationZoomOptions,
|
|
7
|
+
} from "../../types/bounds.types";
|
|
4
8
|
import { buildBoundsOptions } from "./helpers/build-bounds-options";
|
|
5
9
|
import { computeBoundStyles } from "./helpers/compute-bounds-styles";
|
|
6
10
|
import { createInterpolators } from "./helpers/interpolators";
|
|
7
11
|
import { createLinkAccessor } from "./helpers/link-accessor";
|
|
8
12
|
import { resolveBoundTag } from "./helpers/resolve-bound-tag";
|
|
9
|
-
import type { BoundsFrameProps } from "./types/frame-props";
|
|
10
13
|
import type { BoundsOptions } from "./types/options";
|
|
11
|
-
import {
|
|
14
|
+
import { buildZoomStyles } from "./zoom/build";
|
|
12
15
|
|
|
13
16
|
const syncGroupActiveMember = (group?: string, id?: string | number) => {
|
|
14
17
|
"worklet";
|
|
@@ -22,7 +25,7 @@ const syncGroupActiveMember = (group?: string, id?: string | number) => {
|
|
|
22
25
|
};
|
|
23
26
|
|
|
24
27
|
export const createBoundsAccessor = (
|
|
25
|
-
getProps: () =>
|
|
28
|
+
getProps: () => BoundsInterpolationProps,
|
|
26
29
|
): BoundsAccessor => {
|
|
27
30
|
"worklet";
|
|
28
31
|
|
|
@@ -49,90 +52,38 @@ export const createBoundsAccessor = (
|
|
|
49
52
|
const computeElementBoundsStyles = (params?: BoundsOptions) => {
|
|
50
53
|
"worklet";
|
|
51
54
|
const props = getProps();
|
|
52
|
-
|
|
55
|
+
const id = params?.id;
|
|
56
|
+
const group = params?.group;
|
|
57
|
+
syncGroupActiveMember(group, id);
|
|
53
58
|
|
|
54
59
|
const resolved = buildBoundsOptions({
|
|
55
60
|
props,
|
|
56
|
-
id
|
|
57
|
-
group
|
|
61
|
+
id,
|
|
62
|
+
group,
|
|
58
63
|
overrides: params,
|
|
59
64
|
mode: "style",
|
|
60
65
|
resolveBoundTag,
|
|
61
66
|
});
|
|
62
67
|
|
|
63
68
|
const computed = computeForResolvedOptions(resolved, props);
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
target: params?.target,
|
|
69
|
-
};
|
|
70
|
-
let cachedNavigationPairProps: BoundsFrameProps | undefined;
|
|
71
|
-
let cachedNavigationPairTag = "";
|
|
72
|
-
let cachedNavigationPair: ResolvedTransitionPair | undefined;
|
|
73
|
-
|
|
74
|
-
const resolveNavigationPair = (
|
|
75
|
-
tag: string,
|
|
76
|
-
frameProps: BoundsFrameProps,
|
|
77
|
-
): ResolvedTransitionPair | undefined => {
|
|
78
|
-
"worklet";
|
|
79
|
-
if (!tag) return undefined;
|
|
80
|
-
|
|
81
|
-
if (
|
|
82
|
-
cachedNavigationPairProps === frameProps &&
|
|
83
|
-
cachedNavigationPairTag === tag
|
|
84
|
-
) {
|
|
85
|
-
return cachedNavigationPair;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
const nextPair = BoundStore.resolveTransitionPair(tag, {
|
|
89
|
-
currentScreenKey: frameProps.current?.route.key,
|
|
90
|
-
previousScreenKey: frameProps.previous?.route.key,
|
|
91
|
-
nextScreenKey: frameProps.next?.route.key,
|
|
92
|
-
entering: !frameProps.next,
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
cachedNavigationPairProps = frameProps;
|
|
96
|
-
cachedNavigationPairTag = tag;
|
|
97
|
-
cachedNavigationPair = nextPair;
|
|
98
|
-
|
|
99
|
-
return nextPair;
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
const navigation = createZoomAccessor({
|
|
103
|
-
id: params?.id,
|
|
104
|
-
group: params?.group,
|
|
105
|
-
getProps,
|
|
106
|
-
resolveBoundTag,
|
|
107
|
-
zoomBaseOptions,
|
|
108
|
-
computeRaw: (overrides, frameProps) =>
|
|
109
|
-
(() => {
|
|
110
|
-
const currentProps = frameProps ?? getProps();
|
|
111
|
-
const resolvedNavigationOptions = buildBoundsOptions({
|
|
112
|
-
props: currentProps,
|
|
113
|
-
id: params?.id,
|
|
114
|
-
group: params?.group,
|
|
115
|
-
overrides,
|
|
116
|
-
mode: "navigation",
|
|
117
|
-
resolveBoundTag,
|
|
118
|
-
});
|
|
119
|
-
const resolvedPair = resolveNavigationPair(
|
|
120
|
-
String(resolvedNavigationOptions.id),
|
|
121
|
-
currentProps,
|
|
122
|
-
);
|
|
123
|
-
|
|
124
|
-
return computeForResolvedOptions(
|
|
125
|
-
resolvedNavigationOptions,
|
|
126
|
-
currentProps,
|
|
127
|
-
resolvedPair,
|
|
128
|
-
) as Record<string, unknown>;
|
|
129
|
-
})(),
|
|
130
|
-
});
|
|
69
|
+
// Navigation helpers are intentionally opinionated. Only the resolved
|
|
70
|
+
// tag from `id`/`group` is allowed to flow into `navigation.zoom()`;
|
|
71
|
+
// base bounds overrides like `target`, `anchor`, or `scaleMode` must not.
|
|
72
|
+
const navigationTag = resolveBoundTag({ id, group });
|
|
131
73
|
|
|
132
74
|
const target = Object.isExtensible(computed) ? computed : { ...computed };
|
|
133
75
|
|
|
134
76
|
Object.defineProperty(target, "navigation", {
|
|
135
|
-
value:
|
|
77
|
+
value: {
|
|
78
|
+
zoom: (options?: BoundsNavigationZoomOptions) => {
|
|
79
|
+
"worklet";
|
|
80
|
+
return buildZoomStyles({
|
|
81
|
+
props: getProps(),
|
|
82
|
+
resolvedTag: navigationTag,
|
|
83
|
+
zoomOptions: options,
|
|
84
|
+
});
|
|
85
|
+
},
|
|
86
|
+
},
|
|
136
87
|
enumerable: false,
|
|
137
88
|
configurable: true,
|
|
138
89
|
});
|