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
|
@@ -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
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { memo } from "react";
|
|
2
2
|
import { StyleSheet, View } from "react-native";
|
|
3
|
+
import { DeferredVisibilityHost } from "./deferred-visibility-host";
|
|
3
4
|
import { useBackdropPointerEvents } from "./hooks/use-backdrop-pointer-events";
|
|
4
5
|
import { BackdropLayer } from "./layers/backdrop";
|
|
5
6
|
import { ContentLayer } from "./layers/content";
|
|
@@ -13,8 +14,10 @@ export const ScreenContainer = memo(({ children }: Props) => {
|
|
|
13
14
|
|
|
14
15
|
return (
|
|
15
16
|
<View style={styles.container} pointerEvents={pointerEvents}>
|
|
16
|
-
<
|
|
17
|
-
|
|
17
|
+
<DeferredVisibilityHost>
|
|
18
|
+
<BackdropLayer />
|
|
19
|
+
<ContentLayer>{children}</ContentLayer>
|
|
20
|
+
</DeferredVisibilityHost>
|
|
18
21
|
</View>
|
|
19
22
|
);
|
|
20
23
|
});
|
|
@@ -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,
|
|
@@ -24,11 +24,14 @@ export const ContentLayer = memo(({ children }: Props) => {
|
|
|
24
24
|
const { stylesMap } = useScreenStyles();
|
|
25
25
|
const { current } = useDescriptors();
|
|
26
26
|
const { pointerEvents, isBackdropActive } = useBackdropPointerEvents();
|
|
27
|
+
|
|
27
28
|
const gestureContext = useGestureContext();
|
|
28
29
|
const isNavigationMaskEnabled = resolveNavigationMaskEnabled(current.options);
|
|
29
30
|
const contentPointerEvents = isBackdropActive ? "box-none" : pointerEvents;
|
|
31
|
+
|
|
30
32
|
const hasAutoSnapPoint =
|
|
31
33
|
current.options.snapPoints?.includes("auto") ?? false;
|
|
34
|
+
|
|
32
35
|
const handleContentLayout = useContentLayout();
|
|
33
36
|
|
|
34
37
|
const animatedContentStyle = useAnimatedStyle(() => {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { memo,
|
|
2
|
-
import {
|
|
1
|
+
import { memo, useCallback } from "react";
|
|
2
|
+
import { StyleSheet, View, type ViewProps } from "react-native";
|
|
3
3
|
import Animated, { useAnimatedStyle } from "react-native-reanimated";
|
|
4
4
|
import {
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
NAVIGATION_MASK_CONTAINER_STYLE_ID,
|
|
6
|
+
NAVIGATION_MASK_ELEMENT_STYLE_ID,
|
|
7
7
|
NO_STYLES,
|
|
8
8
|
} from "../../../constants";
|
|
9
9
|
import { useScreenStyles } from "../../../providers/screen/styles.provider";
|
|
@@ -24,22 +24,26 @@ try {
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
let hasWarnedMissingMaskedView = false;
|
|
27
|
-
const IS_ANDROID = Platform.OS === "android";
|
|
28
27
|
|
|
29
28
|
export const MaybeMaskedNavigationContainer = memo(
|
|
30
29
|
({ enabled, children, pointerEvents }: Props) => {
|
|
31
30
|
const { stylesMap } = useScreenStyles();
|
|
32
|
-
|
|
31
|
+
|
|
32
|
+
const animatedNavigationMaskStyle = useAnimatedStyle(() => {
|
|
33
33
|
"worklet";
|
|
34
|
-
return
|
|
34
|
+
return (
|
|
35
|
+
stylesMap.value[NAVIGATION_MASK_ELEMENT_STYLE_ID]?.style || NO_STYLES
|
|
36
|
+
);
|
|
35
37
|
});
|
|
36
38
|
|
|
37
|
-
const
|
|
39
|
+
const animatedNavigationMaskContainerStyle = useAnimatedStyle(() => {
|
|
38
40
|
"worklet";
|
|
39
|
-
return
|
|
41
|
+
return (
|
|
42
|
+
stylesMap.value[NAVIGATION_MASK_CONTAINER_STYLE_ID]?.style || NO_STYLES
|
|
43
|
+
);
|
|
40
44
|
});
|
|
41
45
|
|
|
42
|
-
|
|
46
|
+
const maybeLogWarning = useCallback(() => {
|
|
43
47
|
if (!enabled) return;
|
|
44
48
|
if (LazyMaskedView !== View) return;
|
|
45
49
|
if (hasWarnedMissingMaskedView) return;
|
|
@@ -50,24 +54,8 @@ export const MaybeMaskedNavigationContainer = memo(
|
|
|
50
54
|
);
|
|
51
55
|
}, [enabled]);
|
|
52
56
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
style={[styles.navigationContainer, animatedNavigationContainerStyle]}
|
|
56
|
-
pointerEvents={pointerEvents}
|
|
57
|
-
collapsable={false}
|
|
58
|
-
renderToHardwareTextureAndroid={IS_ANDROID && !enabled}
|
|
59
|
-
needsOffscreenAlphaCompositing={IS_ANDROID && !enabled}
|
|
60
|
-
>
|
|
61
|
-
{children}
|
|
62
|
-
</Animated.View>
|
|
63
|
-
);
|
|
64
|
-
|
|
65
|
-
// Navigation zoom uses the root container transform even when the mask
|
|
66
|
-
// wrapper is disabled. Only the mask element itself is optional.
|
|
67
|
-
if (!enabled) return navigationContainer;
|
|
68
|
-
|
|
69
|
-
if (LazyMaskedView === View) {
|
|
70
|
-
return navigationContainer;
|
|
57
|
+
if (!enabled || LazyMaskedView === View) {
|
|
58
|
+
return children;
|
|
71
59
|
}
|
|
72
60
|
|
|
73
61
|
return (
|
|
@@ -81,8 +69,18 @@ export const MaybeMaskedNavigationContainer = memo(
|
|
|
81
69
|
/>
|
|
82
70
|
}
|
|
83
71
|
pointerEvents={pointerEvents}
|
|
72
|
+
onLayout={maybeLogWarning}
|
|
84
73
|
>
|
|
85
|
-
|
|
74
|
+
<Animated.View
|
|
75
|
+
style={[
|
|
76
|
+
styles.navigationContainer,
|
|
77
|
+
animatedNavigationMaskContainerStyle,
|
|
78
|
+
]}
|
|
79
|
+
pointerEvents={pointerEvents}
|
|
80
|
+
collapsable={false}
|
|
81
|
+
>
|
|
82
|
+
{children}
|
|
83
|
+
</Animated.View>
|
|
86
84
|
</LazyMaskedView>
|
|
87
85
|
);
|
|
88
86
|
},
|
|
@@ -92,10 +90,10 @@ const styles = StyleSheet.create({
|
|
|
92
90
|
navigationMaskedRoot: {
|
|
93
91
|
flex: 1,
|
|
94
92
|
},
|
|
95
|
-
navigationMaskElement: {
|
|
96
|
-
backgroundColor: "white",
|
|
97
|
-
},
|
|
98
93
|
navigationContainer: {
|
|
99
94
|
flex: 1,
|
|
100
95
|
},
|
|
96
|
+
navigationMaskElement: {
|
|
97
|
+
backgroundColor: "white",
|
|
98
|
+
},
|
|
101
99
|
});
|
|
@@ -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
|
);
|
|
@@ -5,8 +5,8 @@ import {
|
|
|
5
5
|
interpolateColor,
|
|
6
6
|
} from "react-native-reanimated";
|
|
7
7
|
import {
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
NAVIGATION_MASK_CONTAINER_STYLE_ID,
|
|
9
|
+
NAVIGATION_MASK_ELEMENT_STYLE_ID,
|
|
10
10
|
} from "../constants";
|
|
11
11
|
import type { ScreenTransitionConfig } from "../types/screen.types";
|
|
12
12
|
import { normalizeInterpolatedStyle } from "../utils/normalize-interpolated-style";
|
|
@@ -277,19 +277,19 @@ 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
|
|
287
287
|
| Record<string, unknown>
|
|
288
288
|
| undefined;
|
|
289
|
-
const containerStyle = navigationStyles[
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
const maskStyle = navigationStyles[
|
|
289
|
+
const containerStyle = navigationStyles[
|
|
290
|
+
NAVIGATION_MASK_CONTAINER_STYLE_ID
|
|
291
|
+
] as Record<string, unknown> | undefined;
|
|
292
|
+
const maskStyle = navigationStyles[NAVIGATION_MASK_ELEMENT_STYLE_ID] as
|
|
293
293
|
| Record<string, unknown>
|
|
294
294
|
| undefined;
|
|
295
295
|
|
|
@@ -317,7 +317,7 @@ export const SharedIGImage = ({
|
|
|
317
317
|
],
|
|
318
318
|
},
|
|
319
319
|
},
|
|
320
|
-
[
|
|
320
|
+
[NAVIGATION_MASK_CONTAINER_STYLE_ID]: containerStyle
|
|
321
321
|
? {
|
|
322
322
|
style: {
|
|
323
323
|
...containerStyle,
|
|
@@ -329,7 +329,7 @@ export const SharedIGImage = ({
|
|
|
329
329
|
},
|
|
330
330
|
}
|
|
331
331
|
: undefined,
|
|
332
|
-
[
|
|
332
|
+
[NAVIGATION_MASK_ELEMENT_STYLE_ID]: maskStyle
|
|
333
333
|
? {
|
|
334
334
|
style: {
|
|
335
335
|
...maskStyle,
|
|
@@ -620,10 +620,11 @@ export const SharedXImage = ({
|
|
|
620
620
|
|
|
621
621
|
if (!focused) return {};
|
|
622
622
|
|
|
623
|
-
const navigationStyles =
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
623
|
+
const navigationStyles =
|
|
624
|
+
bounds({
|
|
625
|
+
id: sharedBoundTag,
|
|
626
|
+
}).navigation.zoom() ?? {};
|
|
627
|
+
const maskStyle = navigationStyles[NAVIGATION_MASK_ELEMENT_STYLE_ID] as
|
|
627
628
|
| Record<string, unknown>
|
|
628
629
|
| undefined;
|
|
629
630
|
|
|
@@ -654,7 +655,7 @@ export const SharedXImage = ({
|
|
|
654
655
|
|
|
655
656
|
return {
|
|
656
657
|
...normalizedNav,
|
|
657
|
-
[
|
|
658
|
+
[NAVIGATION_MASK_ELEMENT_STYLE_ID]: maskStyle
|
|
658
659
|
? {
|
|
659
660
|
style: {
|
|
660
661
|
...maskStyle,
|
package/src/shared/constants.ts
CHANGED
|
@@ -8,6 +8,7 @@ import type { BaseStackRoute } from "./types/stack.types";
|
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Masked view integration
|
|
11
|
+
* @deprecated No longer in use. Use {@link NAVIGATION_MASK_ELEMENT_STYLE_ID} and {@link NAVIGATION_MASK_CONTAINER_STYLE_ID} instead.
|
|
11
12
|
*/
|
|
12
13
|
export const MASK_STYLE_ID = "_ROOT_MASKED";
|
|
13
14
|
export const CONTAINER_STYLE_ID = "_ROOT_CONTAINER";
|
|
@@ -15,14 +16,15 @@ export const CONTAINER_STYLE_ID = "_ROOT_CONTAINER";
|
|
|
15
16
|
/**
|
|
16
17
|
* Navigation mask integration
|
|
17
18
|
*/
|
|
18
|
-
export const
|
|
19
|
-
export const
|
|
20
|
-
export const NAVIGATION_CONTAINER_STYLE_ID = "_NAVIGATION_ROOT_CONTAINER";
|
|
19
|
+
export const NAVIGATION_MASK_ELEMENT_STYLE_ID = "_NAVIGATION_ROOT_MASK";
|
|
20
|
+
export const NAVIGATION_MASK_CONTAINER_STYLE_ID = "_NAVIGATION_ROOT_CONTAINER";
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
* Styles
|
|
24
24
|
*/
|
|
25
25
|
export const NO_STYLES = Object.freeze({});
|
|
26
|
+
export const HIDDEN_STYLE = Object.freeze({ opacity: 0 });
|
|
27
|
+
export const VISIBLE_STYLE = Object.freeze({ opacity: 1 });
|
|
26
28
|
export const NO_PROPS = Object.freeze({});
|
|
27
29
|
|
|
28
30
|
/**
|
|
@@ -59,6 +61,13 @@ export const createScreenTransitionState = (
|
|
|
59
61
|
gesture: { ...DEFAULT_GESTURE_VALUES },
|
|
60
62
|
route,
|
|
61
63
|
meta,
|
|
64
|
+
layouts: {
|
|
65
|
+
screen: {
|
|
66
|
+
width: 0,
|
|
67
|
+
height: 0,
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
snapIndex: -1,
|
|
62
71
|
});
|
|
63
72
|
|
|
64
73
|
/**
|
|
@@ -73,6 +82,13 @@ export const DEFAULT_SCREEN_TRANSITION_STATE: ScreenTransitionState =
|
|
|
73
82
|
entering: 0,
|
|
74
83
|
gesture: DEFAULT_GESTURE_VALUES,
|
|
75
84
|
route: {} as RouteProp<ParamListBase>,
|
|
85
|
+
layouts: {
|
|
86
|
+
screen: {
|
|
87
|
+
width: 0,
|
|
88
|
+
height: 0,
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
snapIndex: -1,
|
|
76
92
|
});
|
|
77
93
|
|
|
78
94
|
/**
|