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
|
@@ -4,85 +4,15 @@ import { useMemo } from "react";
|
|
|
4
4
|
import { useWindowDimensions } from "react-native";
|
|
5
5
|
import { useDerivedValue, useSharedValue } from "react-native-reanimated";
|
|
6
6
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
7
|
-
import {
|
|
7
|
+
import { DEFAULT_SCREEN_TRANSITION_STATE } from "../../../../constants";
|
|
8
8
|
import { useStack } from "../../../../hooks/navigation/use-stack";
|
|
9
|
-
import { AnimationStore } from "../../../../stores/animation.store";
|
|
10
|
-
import { GestureStore } from "../../../../stores/gesture.store";
|
|
11
9
|
import { createBoundsAccessor } from "../../../../utils/bounds";
|
|
12
10
|
import { resolveNavigationMaskEnabled } from "../../../../utils/resolve-screen-transition-options";
|
|
13
11
|
import { useDescriptors } from "../../descriptors";
|
|
14
12
|
import { derivations } from "./derivations";
|
|
15
|
-
import {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
* Returns -1 if no snap points, otherwise interpolates between indices.
|
|
19
|
-
*/
|
|
20
|
-
const computeSnapIndex = (progress, snapPoints) => {
|
|
21
|
-
"worklet";
|
|
22
|
-
|
|
23
|
-
if (snapPoints.length === 0) return -1;
|
|
24
|
-
if (progress <= snapPoints[0]) return 0;
|
|
25
|
-
if (progress >= snapPoints[snapPoints.length - 1]) return snapPoints.length - 1;
|
|
26
|
-
for (let i = 0; i < snapPoints.length - 1; i++) {
|
|
27
|
-
if (progress <= snapPoints[i + 1]) {
|
|
28
|
-
const t = (progress - snapPoints[i]) / (snapPoints[i + 1] - snapPoints[i]);
|
|
29
|
-
return i + t;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
return snapPoints.length - 1;
|
|
33
|
-
};
|
|
34
|
-
const unwrapInto = s => {
|
|
35
|
-
"worklet";
|
|
36
|
-
|
|
37
|
-
const out = s.unwrapped;
|
|
38
|
-
out.progress = s.progress.value;
|
|
39
|
-
out.closing = s.closing.value;
|
|
40
|
-
out.entering = s.entering.value;
|
|
41
|
-
out.animating = s.animating.value;
|
|
42
|
-
out.gesture.x = s.gesture.x.value;
|
|
43
|
-
out.gesture.y = s.gesture.y.value;
|
|
44
|
-
out.gesture.normX = s.gesture.normX.value;
|
|
45
|
-
out.gesture.normY = s.gesture.normY.value;
|
|
46
|
-
out.gesture.dismissing = s.gesture.dismissing.value;
|
|
47
|
-
out.gesture.dragging = s.gesture.dragging.value;
|
|
48
|
-
out.gesture.direction = s.gesture.direction.value;
|
|
49
|
-
|
|
50
|
-
// Deprecated aliases (kept for backwards compatibility)
|
|
51
|
-
out.gesture.normalizedX = out.gesture.normX;
|
|
52
|
-
out.gesture.normalizedY = out.gesture.normY;
|
|
53
|
-
out.gesture.isDismissing = out.gesture.dismissing;
|
|
54
|
-
out.gesture.isDragging = out.gesture.dragging;
|
|
55
|
-
out.settled = out.gesture.dragging || out.animating || out.gesture.dismissing || out.closing ? 0 : 1;
|
|
56
|
-
out.meta = s.meta;
|
|
57
|
-
return out;
|
|
58
|
-
};
|
|
59
|
-
const useBuildScreenTransitionState = (descriptor, slot) => {
|
|
60
|
-
const key = descriptor?.route?.key;
|
|
61
|
-
const meta = descriptor?.options?.meta;
|
|
62
|
-
const route = descriptor?.route;
|
|
63
|
-
const gestureEnabled = descriptor?.options?.gestureEnabled;
|
|
64
|
-
const snapPoints = descriptor?.options?.snapPoints;
|
|
65
|
-
const shouldUseNeutralNextGestures = slot === "next" && gestureEnabled === false && (!snapPoints || snapPoints.length === 0);
|
|
66
|
-
return useMemo(() => {
|
|
67
|
-
if (!key || !route) return undefined;
|
|
68
|
-
const plainRoute = toPlainRoute(route);
|
|
69
|
-
const plainMeta = meta ? toPlainValue(meta) : undefined;
|
|
70
|
-
return {
|
|
71
|
-
progress: AnimationStore.getRouteAnimation(key, "progress"),
|
|
72
|
-
closing: AnimationStore.getRouteAnimation(key, "closing"),
|
|
73
|
-
entering: AnimationStore.getRouteAnimation(key, "entering"),
|
|
74
|
-
animating: AnimationStore.getRouteAnimation(key, "animating"),
|
|
75
|
-
gesture: shouldUseNeutralNextGestures ? GestureStore.peekRouteGestures(key) ?? GestureStore.getNeutralGestures() : GestureStore.getRouteGestures(key),
|
|
76
|
-
route: plainRoute,
|
|
77
|
-
meta: plainMeta,
|
|
78
|
-
unwrapped: createScreenTransitionState(plainRoute, plainMeta)
|
|
79
|
-
};
|
|
80
|
-
}, [key, meta, route, shouldUseNeutralNextGestures]);
|
|
81
|
-
};
|
|
82
|
-
const hasTransitionsEnabled = (options, alwaysOn) => {
|
|
83
|
-
if (alwaysOn) return true;
|
|
84
|
-
return !!options?.enableTransitions;
|
|
85
|
-
};
|
|
13
|
+
import { hasTransitionsEnabled } from "./has-transitions-enabled";
|
|
14
|
+
import { hydrateTransitionState } from "./hydrate-transition-state";
|
|
15
|
+
import { useBuildTransitionState } from "./use-build-transition-state";
|
|
86
16
|
export function useScreenAnimationPipeline() {
|
|
87
17
|
const {
|
|
88
18
|
flags,
|
|
@@ -93,27 +23,19 @@ export function useScreenAnimationPipeline() {
|
|
|
93
23
|
const insets = useSafeAreaInsets();
|
|
94
24
|
const transitionsAlwaysOn = flags.TRANSITIONS_ALWAYS_ON;
|
|
95
25
|
const {
|
|
96
|
-
current:
|
|
26
|
+
current: currDescriptor,
|
|
97
27
|
next: nextDescriptor,
|
|
98
|
-
previous:
|
|
28
|
+
previous: prevDescriptor
|
|
99
29
|
} = useDescriptors();
|
|
100
|
-
const currentAnimation =
|
|
101
|
-
const nextAnimation =
|
|
102
|
-
const prevAnimation =
|
|
103
|
-
const currentRouteKey =
|
|
30
|
+
const currentAnimation = useBuildTransitionState(currDescriptor, "current");
|
|
31
|
+
const nextAnimation = useBuildTransitionState(nextDescriptor, "next");
|
|
32
|
+
const prevAnimation = useBuildTransitionState(prevDescriptor, "previous");
|
|
33
|
+
const currentRouteKey = currDescriptor?.route?.key;
|
|
104
34
|
const currentIndex = routeKeys.indexOf(currentRouteKey);
|
|
105
|
-
const sortedNumericSnapPoints = useMemo(() => {
|
|
106
|
-
const points = currentDescriptor?.options?.snapPoints;
|
|
107
|
-
if (!points) return [];
|
|
108
|
-
return points.filter(p => typeof p === "number").sort((a, b) => a - b);
|
|
109
|
-
}, [currentDescriptor?.options?.snapPoints]);
|
|
110
|
-
const hasAutoSnapPoint = useMemo(() => currentDescriptor?.options?.snapPoints?.includes("auto") ?? false, [currentDescriptor?.options?.snapPoints]);
|
|
111
|
-
const autoSnapPointValue = AnimationStore.getAnimation(currentRouteKey ?? "_", "autoSnapPoint");
|
|
112
|
-
const contentLayoutValue = AnimationStore.getAnimation(currentRouteKey ?? "_", "contentLayout");
|
|
113
35
|
const nextRouteKey = nextDescriptor?.route?.key;
|
|
114
36
|
const nextHasTransitions = !!nextRouteKey && hasTransitionsEnabled(nextDescriptor?.options, transitionsAlwaysOn);
|
|
115
|
-
const currentNavigationMaskEnabled = resolveNavigationMaskEnabled(
|
|
116
|
-
const
|
|
37
|
+
const currentNavigationMaskEnabled = resolveNavigationMaskEnabled(currDescriptor?.options ?? {});
|
|
38
|
+
const boundsFrameProps = useSharedValue({
|
|
117
39
|
layouts: {
|
|
118
40
|
screen: dimensions
|
|
119
41
|
},
|
|
@@ -124,24 +46,24 @@ export function useScreenAnimationPipeline() {
|
|
|
124
46
|
progress: 0,
|
|
125
47
|
stackProgress: 0,
|
|
126
48
|
snapIndex: -1,
|
|
127
|
-
navigationMaskEnabled: false,
|
|
128
49
|
focused: true,
|
|
129
50
|
active: DEFAULT_SCREEN_TRANSITION_STATE,
|
|
51
|
+
navigationMaskEnabled: currentNavigationMaskEnabled,
|
|
130
52
|
inactive: undefined
|
|
131
53
|
});
|
|
132
54
|
const boundsAccessor = useMemo(() => {
|
|
133
55
|
return createBoundsAccessor(() => {
|
|
134
56
|
"worklet";
|
|
135
57
|
|
|
136
|
-
return
|
|
58
|
+
return boundsFrameProps.value;
|
|
137
59
|
});
|
|
138
|
-
}, [
|
|
60
|
+
}, [boundsFrameProps]);
|
|
139
61
|
const screenInterpolatorProps = useDerivedValue(() => {
|
|
140
62
|
"worklet";
|
|
141
63
|
|
|
142
|
-
const previous = prevAnimation ?
|
|
143
|
-
const next = nextAnimation && nextHasTransitions ?
|
|
144
|
-
const current = currentAnimation ?
|
|
64
|
+
const previous = prevAnimation ? hydrateTransitionState(prevAnimation, dimensions) : undefined;
|
|
65
|
+
const next = nextAnimation && nextHasTransitions ? hydrateTransitionState(nextAnimation, dimensions) : undefined;
|
|
66
|
+
const current = currentAnimation ? hydrateTransitionState(currentAnimation, dimensions) : DEFAULT_SCREEN_TRANSITION_STATE;
|
|
145
67
|
const {
|
|
146
68
|
progress,
|
|
147
69
|
...helpers
|
|
@@ -155,33 +77,25 @@ export function useScreenAnimationPipeline() {
|
|
|
155
77
|
// This gives us the sum of progress values from current screen onwards
|
|
156
78
|
// Falls back to current progress if index is invalid
|
|
157
79
|
const stackProgress = currentIndex >= 0 ? rootStackProgress.value - currentIndex : progress;
|
|
158
|
-
|
|
159
|
-
// Resolve 'auto' snap point reactively so computeSnapIndex stays accurate
|
|
160
|
-
const resolvedAutoSnap = hasAutoSnapPoint && autoSnapPointValue.value > 0 ? autoSnapPointValue.value : null;
|
|
161
|
-
const resolvedSnapPoints = resolvedAutoSnap !== null ? [...sortedNumericSnapPoints, resolvedAutoSnap].sort((a, b) => a - b) : sortedNumericSnapPoints;
|
|
162
|
-
const snapIndex = computeSnapIndex(current.progress, resolvedSnapPoints);
|
|
163
80
|
const nextProps = {
|
|
164
|
-
layouts:
|
|
165
|
-
screen: dimensions,
|
|
166
|
-
content: contentLayoutValue.value ?? undefined
|
|
167
|
-
},
|
|
81
|
+
layouts: current.layouts,
|
|
168
82
|
insets,
|
|
169
83
|
previous,
|
|
170
84
|
current,
|
|
171
85
|
next,
|
|
172
86
|
progress,
|
|
173
87
|
stackProgress,
|
|
174
|
-
snapIndex,
|
|
88
|
+
snapIndex: current.snapIndex,
|
|
175
89
|
...helpers
|
|
176
90
|
};
|
|
177
|
-
|
|
91
|
+
boundsFrameProps.value = {
|
|
178
92
|
...nextProps,
|
|
179
93
|
navigationMaskEnabled: currentNavigationMaskEnabled
|
|
180
94
|
};
|
|
181
95
|
return nextProps;
|
|
182
96
|
});
|
|
183
97
|
const nextInterpolator = nextDescriptor?.options.screenStyleInterpolator;
|
|
184
|
-
const currentInterpolator =
|
|
98
|
+
const currentInterpolator = currDescriptor?.options.screenStyleInterpolator;
|
|
185
99
|
return {
|
|
186
100
|
screenInterpolatorProps,
|
|
187
101
|
nextInterpolator,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useMemo","useWindowDimensions","useDerivedValue","useSharedValue","useSafeAreaInsets","
|
|
1
|
+
{"version":3,"names":["useMemo","useWindowDimensions","useDerivedValue","useSharedValue","useSafeAreaInsets","DEFAULT_SCREEN_TRANSITION_STATE","useStack","createBoundsAccessor","resolveNavigationMaskEnabled","useDescriptors","derivations","hasTransitionsEnabled","hydrateTransitionState","useBuildTransitionState","useScreenAnimationPipeline","flags","stackProgress","rootStackProgress","routeKeys","dimensions","insets","transitionsAlwaysOn","TRANSITIONS_ALWAYS_ON","current","currDescriptor","next","nextDescriptor","previous","prevDescriptor","currentAnimation","nextAnimation","prevAnimation","currentRouteKey","route","key","currentIndex","indexOf","nextRouteKey","nextHasTransitions","options","currentNavigationMaskEnabled","boundsFrameProps","layouts","screen","undefined","progress","snapIndex","focused","active","navigationMaskEnabled","inactive","boundsAccessor","value","screenInterpolatorProps","helpers","nextProps","nextInterpolator","screenStyleInterpolator","currentInterpolator"],"sourceRoot":"../../../../../../../src","sources":["shared/providers/screen/animation/helpers/pipeline.ts"],"mappings":";;AAAA,SAASA,OAAO,QAAQ,OAAO;AAC/B,SAASC,mBAAmB,QAAQ,cAAc;AAClD,SAECC,eAAe,EACfC,cAAc,QACR,yBAAyB;AAChC,SAASC,iBAAiB,QAAQ,gCAAgC;AAClE,SAASC,+BAA+B,QAAQ,uBAAuB;AACvE,SAASC,QAAQ,QAAQ,wCAAwC;AAUjE,SAASC,oBAAoB,QAAQ,0BAA0B;AAC/D,SAASC,4BAA4B,QAAQ,qDAAqD;AAClG,SAASC,cAAc,QAAQ,mBAAmB;AAClD,SAASC,WAAW,QAAQ,eAAe;AAC3C,SAASC,qBAAqB,QAAQ,2BAA2B;AACjE,SAASC,sBAAsB,QAAQ,4BAA4B;AACnE,SAASC,uBAAuB,QAAQ,8BAA8B;AAWtE,OAAO,SAASC,0BAA0BA,CAAA,EAA4B;EACrE,MAAM;IAAEC,KAAK;IAAEC,aAAa,EAAEC,iBAAiB;IAAEC;EAAU,CAAC,GAAGZ,QAAQ,CAAC,CAAC;EACzE,MAAMa,UAAU,GAAGlB,mBAAmB,CAAC,CAAC;EACxC,MAAMmB,MAAM,GAAGhB,iBAAiB,CAAC,CAAC;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,OAAO;IACNJ,uBAAuB;IACvBG,gBAAgB;IAChBE,mBAAmB;IACnBP;EACD,CAAC;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useMemo } from "react";
|
|
4
|
+
import { createScreenTransitionState } from "../../../../constants";
|
|
5
|
+
import { AnimationStore } from "../../../../stores/animation.store";
|
|
6
|
+
import { GestureStore } from "../../../../stores/gesture.store";
|
|
7
|
+
import { SystemStore } from "../../../../stores/system.store";
|
|
8
|
+
import { toPlainRoute, toPlainValue } from "./worklet";
|
|
9
|
+
export const useBuildTransitionState = (descriptor, slot) => {
|
|
10
|
+
const key = descriptor?.route?.key;
|
|
11
|
+
const meta = descriptor?.options?.meta;
|
|
12
|
+
const route = descriptor?.route;
|
|
13
|
+
const gestureEnabled = descriptor?.options?.gestureEnabled;
|
|
14
|
+
const snapPoints = descriptor?.options?.snapPoints;
|
|
15
|
+
const shouldUseNeutralNextGestures = slot === "next" && gestureEnabled === false && (!snapPoints || snapPoints.length === 0);
|
|
16
|
+
return useMemo(() => {
|
|
17
|
+
if (!key || !route) return undefined;
|
|
18
|
+
const plainRoute = toPlainRoute(route);
|
|
19
|
+
const plainMeta = meta ? toPlainValue(meta) : undefined;
|
|
20
|
+
const sortedNumericSnapPoints = (snapPoints ?? []).filter(p => typeof p === "number").sort((a, b) => a - b);
|
|
21
|
+
return {
|
|
22
|
+
progress: AnimationStore.getValue(key, "progress"),
|
|
23
|
+
closing: AnimationStore.getValue(key, "closing"),
|
|
24
|
+
entering: AnimationStore.getValue(key, "entering"),
|
|
25
|
+
animating: AnimationStore.getValue(key, "animating"),
|
|
26
|
+
resolvedAutoSnapPoint: SystemStore.getValue(key, "resolvedAutoSnapPoint"),
|
|
27
|
+
measuredContentLayout: SystemStore.getValue(key, "measuredContentLayout"),
|
|
28
|
+
hasAutoSnapPoint: snapPoints?.includes("auto") ?? false,
|
|
29
|
+
sortedNumericSnapPoints,
|
|
30
|
+
gesture: shouldUseNeutralNextGestures ? GestureStore.peekBag(key) ?? GestureStore.getCachedBag() : GestureStore.getBag(key),
|
|
31
|
+
route: plainRoute,
|
|
32
|
+
meta: plainMeta,
|
|
33
|
+
unwrapped: createScreenTransitionState(plainRoute, plainMeta)
|
|
34
|
+
};
|
|
35
|
+
}, [key, meta, route, shouldUseNeutralNextGestures, snapPoints]);
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=use-build-transition-state.js.map
|
package/lib/module/shared/providers/screen/animation/helpers/use-build-transition-state.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useMemo","createScreenTransitionState","AnimationStore","GestureStore","SystemStore","toPlainRoute","toPlainValue","useBuildTransitionState","descriptor","slot","key","route","meta","options","gestureEnabled","snapPoints","shouldUseNeutralNextGestures","length","undefined","plainRoute","plainMeta","sortedNumericSnapPoints","filter","p","sort","a","b","progress","getValue","closing","entering","animating","resolvedAutoSnapPoint","measuredContentLayout","hasAutoSnapPoint","includes","gesture","peekBag","getCachedBag","getBag","unwrapped"],"sourceRoot":"../../../../../../../src","sources":["shared/providers/screen/animation/helpers/use-build-transition-state.ts"],"mappings":";;AAAA,SAASA,OAAO,QAAQ,OAAO;AAE/B,SAASC,2BAA2B,QAAQ,uBAAuB;AACnE,SAASC,cAAc,QAAQ,oCAAoC;AACnE,SACCC,YAAY,QAEN,kCAAkC;AACzC,SAASC,WAAW,QAAQ,iCAAiC;AAO7D,SAASC,YAAY,EAAEC,YAAY,QAAQ,WAAW;AAiBtD,OAAO,MAAMC,uBAAuB,GAAGA,CACtCC,UAAsC,EACtCC,IAAqC,KACT;EAC5B,MAAMC,GAAG,GAAGF,UAAU,EAAEG,KAAK,EAAED,GAAG;EAClC,MAAME,IAAI,GAAGJ,UAAU,EAAEK,OAAO,EAAED,IAAI;EACtC,MAAMD,KAAK,GAAGH,UAAU,EAAEG,KAAK;EAC/B,MAAMG,cAAc,GAAGN,UAAU,EAAE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,GACjCb,YAAY,CAACkC,OAAO,CAAC3B,GAAG,CAAC,IAAIP,YAAY,CAACmC,YAAY,CAAC,CAAC,GACzDnC,YAAY,CAACoC,MAAM,CAAC7B,GAAG,CAAC;MAC3BC,KAAK,EAAEQ,UAAU;MACjBP,IAAI,EAAEQ,SAAS;MACfoB,SAAS,EAAEvC,2BAA2B,CAACkB,UAAU,EAAEC,SAAS;IAC7D,CAAC;EACF,CAAC,EAAE,CAACV,GAAG,EAAEE,IAAI,EAAED,KAAK,EAAEK,4BAA4B,EAAED,UAAU,CAAC,CAAC;AACjE,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { normalizeInterpolatedStyle } from "../../../utils/normalize-interpolated-style";
|
|
4
|
+
const EMPTY_STYLES = {};
|
|
5
|
+
export const PASS_THROUGH_STYLE_OUTPUT = {
|
|
6
|
+
stylesMap: EMPTY_STYLES,
|
|
7
|
+
resolutionMode: "pass-through",
|
|
8
|
+
wasLegacy: false
|
|
9
|
+
};
|
|
10
|
+
export const resolveEffectiveResolutionMode = ({
|
|
11
|
+
resolutionMode,
|
|
12
|
+
isSettled
|
|
13
|
+
}) => {
|
|
14
|
+
"worklet";
|
|
15
|
+
|
|
16
|
+
if (resolutionMode === "deferred" && isSettled) {
|
|
17
|
+
return "pass-through";
|
|
18
|
+
}
|
|
19
|
+
return resolutionMode;
|
|
20
|
+
};
|
|
21
|
+
export const resolveInterpolatedStyleOutput = raw => {
|
|
22
|
+
"worklet";
|
|
23
|
+
|
|
24
|
+
if (raw === "defer") {
|
|
25
|
+
return {
|
|
26
|
+
stylesMap: EMPTY_STYLES,
|
|
27
|
+
resolutionMode: "deferred",
|
|
28
|
+
wasLegacy: false
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
if (raw == null) {
|
|
32
|
+
return PASS_THROUGH_STYLE_OUTPUT;
|
|
33
|
+
}
|
|
34
|
+
const {
|
|
35
|
+
result,
|
|
36
|
+
wasLegacy
|
|
37
|
+
} = normalizeInterpolatedStyle(raw ?? EMPTY_STYLES);
|
|
38
|
+
return {
|
|
39
|
+
stylesMap: result,
|
|
40
|
+
resolutionMode: "live",
|
|
41
|
+
wasLegacy
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=resolve-interpolated-style-output.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["normalizeInterpolatedStyle","EMPTY_STYLES","PASS_THROUGH_STYLE_OUTPUT","stylesMap","resolutionMode","wasLegacy","resolveEffectiveResolutionMode","isSettled","resolveInterpolatedStyleOutput","raw","result"],"sourceRoot":"../../../../../../src","sources":["shared/providers/screen/helpers/resolve-interpolated-style-output.ts"],"mappings":";;AAIA,SAASA,0BAA0B,QAAQ,6CAA6C;AAUxF,MAAMC,YAAY,GAAG,CAAC,CAA0C;AAEhE,OAAO,MAAMC,yBAA0D,GAAG;EACzEC,SAAS,EAAEF,YAAY;EACvBG,cAAc,EAAE,cAAc;EAC9BC,SAAS,EAAE;AACZ,CAAC;AAED,OAAO,MAAMC,8BAA8B,GAAGA,CAAC;EAC9CF,cAAc;EACdG;AAID,CAAC,KAAgC;EAChC,SAAS;;EACT,IAAIH,cAAc,KAAK,UAAU,IAAIG,SAAS,EAAE;IAC/C,OAAO,cAAc;EACtB;EACA,OAAOH,cAAc;AACtB,CAAC;AAED,OAAO,MAAMI,8BAA8B,GAC1CC,GAAuE,IAClC;EACrC,SAAS;;EAET,IAAIA,GAAG,KAAK,OAAO,EAAE;IACpB,OAAO;MACNN,SAAS,EAAEF,YAAY;MACvBG,cAAc,EAAE,UAAU;MAC1BC,SAAS,EAAE;IACZ,CAAC;EACF;EAEA,IAAII,GAAG,IAAI,IAAI,EAAE;IAChB,OAAOP,yBAAyB;EACjC;EAEA,MAAM;IAAEQ,MAAM;IAAEL;EAAU,CAAC,GAAGL,0BAA0B,CAACS,GAAG,IAAIR,YAAY,CAAC;EAE7E,OAAO;IACNE,SAAS,EAAEO,MAAM;IACjBN,cAAc,EAAE,MAAM;IACtBC;EACD,CAAC;AACF,CAAC","ignoreList":[]}
|
|
@@ -5,9 +5,9 @@ import { useDerivedValue, useSharedValue } from "react-native-reanimated";
|
|
|
5
5
|
import { NO_STYLES } from "../../constants";
|
|
6
6
|
import createProvider from "../../utils/create-provider";
|
|
7
7
|
import { logger } from "../../utils/logger";
|
|
8
|
-
import { normalizeInterpolatedStyle } from "../../utils/normalize-interpolated-style";
|
|
9
8
|
import { useScreenAnimationContext } from "./animation";
|
|
10
|
-
|
|
9
|
+
import { PASS_THROUGH_STYLE_OUTPUT, resolveEffectiveResolutionMode, resolveInterpolatedStyleOutput } from "./helpers/resolve-interpolated-style-output";
|
|
10
|
+
export const {
|
|
11
11
|
ScreenStylesProvider,
|
|
12
12
|
ScreenStylesContext,
|
|
13
13
|
useScreenStylesContext: useScreenStyles
|
|
@@ -30,7 +30,7 @@ const {
|
|
|
30
30
|
*/
|
|
31
31
|
const isGesturingDuringCloseAnimation = useSharedValue(false);
|
|
32
32
|
const hasWarnedLegacy = useSharedValue(false);
|
|
33
|
-
const
|
|
33
|
+
const styleResolution = useDerivedValue(() => {
|
|
34
34
|
"worklet";
|
|
35
35
|
|
|
36
36
|
const props = screenInterpolatorProps.value;
|
|
@@ -53,7 +53,9 @@ const {
|
|
|
53
53
|
// - If in gesture mode, use current screen's interpolator since we're driving
|
|
54
54
|
// the animation from this screen (dragging back to dismiss next).
|
|
55
55
|
const interpolator = isInGestureMode ? currentInterpolator : nextInterpolator ?? currentInterpolator;
|
|
56
|
-
if (!interpolator)
|
|
56
|
+
if (!interpolator) {
|
|
57
|
+
return PASS_THROUGH_STYLE_OUTPUT;
|
|
58
|
+
}
|
|
57
59
|
|
|
58
60
|
// Build effective props with corrected progress
|
|
59
61
|
// - Gesture mode: use current.progress only (avoids jumps during drag)
|
|
@@ -73,33 +75,53 @@ const {
|
|
|
73
75
|
bounds: boundsAccessor
|
|
74
76
|
});
|
|
75
77
|
const {
|
|
76
|
-
|
|
78
|
+
stylesMap,
|
|
79
|
+
resolutionMode,
|
|
77
80
|
wasLegacy
|
|
78
|
-
} =
|
|
81
|
+
} = resolveInterpolatedStyleOutput(raw);
|
|
79
82
|
if (__DEV__ && wasLegacy && !hasWarnedLegacy.value) {
|
|
80
83
|
hasWarnedLegacy.value = true;
|
|
81
84
|
logger.warn("Flat interpolator return shape (contentStyle/backdropStyle) is deprecated. " + "Use the nested format instead: { content: { style }, backdrop: { style } }.");
|
|
82
85
|
}
|
|
83
|
-
return
|
|
86
|
+
return {
|
|
87
|
+
stylesMap,
|
|
88
|
+
resolutionMode: resolveEffectiveResolutionMode({
|
|
89
|
+
resolutionMode,
|
|
90
|
+
isSettled: current.settled === 1
|
|
91
|
+
})
|
|
92
|
+
};
|
|
84
93
|
} catch (err) {
|
|
85
94
|
if (__DEV__) {
|
|
86
95
|
console.warn("[react-native-screen-transitions] screenStyleInterpolator must be a worklet", err);
|
|
87
96
|
}
|
|
88
|
-
return
|
|
97
|
+
return {
|
|
98
|
+
stylesMap: NO_STYLES,
|
|
99
|
+
resolutionMode: "live"
|
|
100
|
+
};
|
|
89
101
|
}
|
|
90
102
|
});
|
|
103
|
+
const stylesMap = useDerivedValue(() => {
|
|
104
|
+
"worklet";
|
|
105
|
+
|
|
106
|
+
return styleResolution.value.stylesMap;
|
|
107
|
+
});
|
|
108
|
+
const resolutionMode = useDerivedValue(() => {
|
|
109
|
+
"worklet";
|
|
110
|
+
|
|
111
|
+
return styleResolution.value.resolutionMode;
|
|
112
|
+
});
|
|
91
113
|
const value = useMemo(() => {
|
|
92
114
|
// Build ancestor chain: [parent, grandparent, great-grandparent, ...]
|
|
93
115
|
const ancestorStylesMaps = parentCtx ? [parentCtx.stylesMap, ...parentCtx.ancestorStylesMaps] : [];
|
|
94
116
|
return {
|
|
95
117
|
stylesMap,
|
|
96
|
-
ancestorStylesMaps
|
|
118
|
+
ancestorStylesMaps,
|
|
119
|
+
resolutionMode
|
|
97
120
|
};
|
|
98
|
-
}, [stylesMap, parentCtx]);
|
|
121
|
+
}, [resolutionMode, stylesMap, parentCtx]);
|
|
99
122
|
return {
|
|
100
123
|
value,
|
|
101
124
|
children
|
|
102
125
|
};
|
|
103
126
|
});
|
|
104
|
-
export { ScreenStylesProvider, useScreenStyles };
|
|
105
127
|
//# sourceMappingURL=styles.provider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useContext","useMemo","useDerivedValue","useSharedValue","NO_STYLES","createProvider","logger","
|
|
1
|
+
{"version":3,"names":["useContext","useMemo","useDerivedValue","useSharedValue","NO_STYLES","createProvider","logger","useScreenAnimationContext","PASS_THROUGH_STYLE_OUTPUT","resolveEffectiveResolutionMode","resolveInterpolatedStyleOutput","ScreenStylesProvider","ScreenStylesContext","useScreenStylesContext","useScreenStyles","guarded","children","parentCtx","screenInterpolatorProps","nextInterpolator","currentInterpolator","boundsAccessor","isGesturingDuringCloseAnimation","hasWarnedLegacy","styleResolution","props","value","current","next","progress","isDragging","gesture","dragging","isNextClosing","closing","isInGestureMode","interpolator","effectiveProgress","effectiveNext","undefined","raw","bounds","stylesMap","resolutionMode","wasLegacy","__DEV__","warn","isSettled","settled","err","console","ancestorStylesMaps"],"sourceRoot":"../../../../../src","sources":["shared/providers/screen/styles.provider.tsx"],"mappings":";;AAAA,SAAyBA,UAAU,EAAEC,OAAO,QAAQ,OAAO;AAC3D,SAECC,eAAe,EACfC,cAAc,QACR,yBAAyB;AAChC,SAASC,SAAS,QAAQ,iBAAiB;AAE3C,OAAOC,cAAc,MAAM,6BAA6B;AACxD,SAASC,MAAM,QAAQ,oBAAoB;AAC3C,SAASC,yBAAyB,QAAQ,aAAa;AACvD,SACCC,yBAAyB,EACzBC,8BAA8B,EAC9BC,8BAA8B,QAExB,6CAA6C;AAYpD,OAAO,MAAM;EACZC,oBAAoB;EACpBC,mBAAmB;EACnBC,sBAAsB,EAAEC;AACzB,CAAC,GAAGT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kBAAkB,CAAC,GACtD,EAAE;IAEL,OAAO;MACNT,SAAS;MACTS,kBAAkB;MAClBR;IACD,CAAC;EACF,CAAC,EAAE,CAACA,cAAc,EAAED,SAAS,EAAEzB,SAAS,CAAC,CAAC;EAE1C,OAAO;IAAES,KAAK;IAAEV;EAAS,CAAC;AAC3B,CACD,CAAC","ignoreList":[]}
|
|
@@ -49,7 +49,7 @@ function useDirectStackValue(props) {
|
|
|
49
49
|
isPreloaded
|
|
50
50
|
});
|
|
51
51
|
routeKeys.push(route.key);
|
|
52
|
-
animationMaps.push(AnimationStore.
|
|
52
|
+
animationMaps.push(AnimationStore.getBag(route.key));
|
|
53
53
|
if (!shouldShowFloatOverlay && descriptor) {
|
|
54
54
|
const options = descriptor.options;
|
|
55
55
|
if (options?.enableTransitions === true && isOverlayVisible(options)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useMemo","StackContext","AnimationStore","isOverlayVisible","useStackCoreContext","useStackDerived","jsx","_jsx","useDirectStackValue","props","state","navigation","descriptors","describe","flags","navigatorKey","key","preloadedDescriptors","preloadedRoutes","reduce","acc","route","scenes","shouldShowFloatOverlay","routeKeys","allRoutes","animationMaps","routes","concat","allDescriptors","descriptor","isPreloaded","undefined","push","
|
|
1
|
+
{"version":3,"names":["useMemo","StackContext","AnimationStore","isOverlayVisible","useStackCoreContext","useStackDerived","jsx","_jsx","useDirectStackValue","props","state","navigation","descriptors","describe","flags","navigatorKey","key","preloadedDescriptors","preloadedRoutes","reduce","acc","route","scenes","shouldShowFloatOverlay","routeKeys","allRoutes","animationMaps","routes","concat","allDescriptors","descriptor","isPreloaded","undefined","push","getBag","options","enableTransitions","stackProgress","optimisticFocusedIndex","focusedIndex","index","stackContextValue","lifecycleValue","withDirectStack","Component","DirectStackProvider","Provider","value","children"],"sourceRoot":"../../../../../src","sources":["shared/providers/stack/direct.provider.tsx"],"mappings":";;AACA,SAASA,OAAO,QAAQ,OAAO;AAE/B,SACCC,YAAY,QAE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aAAa,EACbC,sBAAsB,CAExB,CAAC;;EAED;EACA,MAAMI,cAAc,GAAG1C,OAAO,CAC7B,OAAO;IACNU,KAAK;IACLC,UAAU;IACVC,WAAW;IACXU,MAAM;IACNiB,YAAY;IACZhB;EACD,CAAC,CAAC,EACF,CACCb,KAAK,EACLC,UAAU,EACVC,WAAW,EACXU,MAAM,EACNiB,YAAY,EACZhB,sBAAsB,CAExB,CAAC;EAED,OAAO;IAAE,GAAGmB,cAAc;IAAED;EAAkB,CAAC;AAChD;AAEA,SAASE,eAAeA,CACvBC,SAAuD,EACpC;EACnB,OAAO,SAASC,mBAAmBA,CAACpC,KAAa,EAAE;IAClD,MAAM;MAAEgC,iBAAiB;MAAE,GAAGC;IAAe,CAAC,GAAGlC,mBAAmB,CAACC,KAAK,CAAC;IAE3E,oBACCF,IAAA,CAACN,YAAY,CAAC6C,QAAQ;MAACC,KAAK,EAAEN,iBAAkB;MAAAO,QAAA,eAC/CzC,IAAA,CAACqC,SAAS;QAAA,GAAKF;MAAc,CAAG;IAAC,CACX,CAAC;EAE1B,CAAC;AACF;AAEA,SAASC,eAAe","ignoreList":[]}
|
|
@@ -27,7 +27,7 @@ export function useProcessedRoutes(routes, descriptors) {
|
|
|
27
27
|
};
|
|
28
28
|
routeKeys[i] = route.key;
|
|
29
29
|
backdropBehaviors[i] = options?.backdropBehavior ?? "block";
|
|
30
|
-
animationMaps[i] = AnimationStore.
|
|
30
|
+
animationMaps[i] = AnimationStore.getBag(route.key);
|
|
31
31
|
if (!shouldShowFloatOverlay) {
|
|
32
32
|
shouldShowFloatOverlay = isOverlayVisible(options);
|
|
33
33
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useMemo","AnimationStore","isOverlayVisible","useProcessedRoutes","routes","descriptors","scenes","routeKeys","backdropBehaviors","animationMaps","shouldShowFloatOverlay","limit","stopLimit","i","length","route","descriptor","key","options","backdropBehavior","
|
|
1
|
+
{"version":3,"names":["useMemo","AnimationStore","isOverlayVisible","useProcessedRoutes","routes","descriptors","scenes","routeKeys","backdropBehaviors","animationMaps","shouldShowFloatOverlay","limit","stopLimit","i","length","route","descriptor","key","options","backdropBehavior","getBag","shouldKeepPrevious","detachPreviousScreen","activeScreensLimit","Math","min"],"sourceRoot":"../../../../../../src","sources":["shared/providers/stack/helpers/use-processed-routes.ts"],"mappings":";;AAAA,SAASA,OAAO,QAAQ,OAAO;AAC/B,SACCC,cAAc,QAER,iCAAiC;AAKxC,SAASC,gBAAgB,QAAQ,mCAAmC;AAapE;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,kBAAkBA,CAGjCC,MAA8B,EAC9BC,WAAwC,EACT;EAC/B,OAAOL,OAAO,CAAC,MAAM;IACpB,MAAMM,MAAqC,GAAG,EAAE;IAChD,MAAMC,SAAmB,GAAG,EAAE;IAC9B,MAAMC,iBAA2B,GAAG,EAAE;IACtC,MAAMC,aAAkC,GAAG,EAAE;IAE7C,IAAIC,sBAAsB,GAAG,KAAK;IAClC,IAAIC,KAAK,GAAG,CAAC;IACb,IAAIC,SAAS,GAAG,KAAK;IAErB,KAAK,IAAIC,CAAC,GAAGT,MAAM,CAACU,MAAM,GAAG,CAAC,EAAED,CAAC,IAAI,CAAC,EAAEA,CAAC,EAAE,EAAE;MAC5C,MAAME,KAAK,GAAGX,MAAM,CAACS,CAAC,CAAC;MACvB,MAAMG,UAAU,GAAGX,WAAW,CAACU,KAAK,CAACE,GAAG,CAAgB;MACxD,MAAMC,OAAO,GAAGF,UAAU,EAAEE,OAAO;MAEnCZ,MAAM,CAACO,CAAC,CAAC,GAAG;QAAEE,KAAK;QAAEC;MAAW,CAAC;MACjCT,SAAS,CAACM,CAAC,CAAC,GAAGE,KAAK,CAACE,GAAG;MACxBT,iBAAiB,CAACK,CAAC,CAAC,GAAGK,OAAO,EAAEC,gBAAgB,IAAI,OAAO;MAC3DV,aAAa,CAACI,CAAC,CAAC,GAAGZ,cAAc,CAACmB,MAAM,CAACL,KAAK,CAACE,GAAG,CAAC;MAEnD,IAAI,CAACP,sBAAsB,EAAE;QAC5BA,sBAAsB,GAAGR,gBAAgB,CAACgB,OAAO,CAAC;MACnD;MAEA,IAAI,CAACN,SAAS,EAAE;QACf,MAAMS,kBAAkB,GACtBH,OAAO,EACLI,oBAAoB,KAAK,IAAI;QAEjC,IAAID,kBAAkB,EAAE;UACvBV,KAAK,IAAI,CAAC;QACX,CAAC,MAAM;UACNC,SAAS,GAAG,IAAI;QACjB;MACD;IACD;IAEA,MAAMW,kBAAkB,GAAGC,IAAI,CAACC,GAAG,CAClCd,KAAK,EACLP,MAAM,CAACU,MAAM,KAAK,CAAC,GAAG,CAAC,GAAGV,MAAM,CAACU,MAClC,CAAC;IAED,OAAO;MACNR,MAAM;MACNC,SAAS;MACTC,iBAAiB;MACjBC,aAAa;MACbC,sBAAsB;MACtBa;IACD,CAAC;EACF,CAAC,EAAE,CAACnB,MAAM,EAAEC,WAAW,CAAC,CAAC;AAC1B","ignoreList":[]}
|
|
@@ -1,56 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import { cancelAnimation, makeMutable } from "react-native-reanimated";
|
|
4
|
-
|
|
4
|
+
import { createStore } from "../utils/create-store";
|
|
5
5
|
function createAnimationBag() {
|
|
6
6
|
return {
|
|
7
7
|
progress: makeMutable(0),
|
|
8
8
|
closing: makeMutable(0),
|
|
9
9
|
animating: makeMutable(0),
|
|
10
|
-
entering: makeMutable(0)
|
|
11
|
-
targetProgress: makeMutable(1),
|
|
12
|
-
autoSnapPoint: makeMutable(-1),
|
|
13
|
-
contentLayout: makeMutable(null)
|
|
10
|
+
entering: makeMutable(0)
|
|
14
11
|
};
|
|
15
12
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
return store[routeKey];
|
|
26
|
-
}
|
|
27
|
-
function getRouteAnimation(routeKey, type) {
|
|
28
|
-
return ensure(routeKey)[type];
|
|
29
|
-
}
|
|
30
|
-
function getAnimation(routeKey, type) {
|
|
31
|
-
return getRouteAnimation(routeKey, type);
|
|
32
|
-
}
|
|
33
|
-
function getRouteAnimations(routeKey) {
|
|
34
|
-
return ensure(routeKey);
|
|
35
|
-
}
|
|
36
|
-
function clear(routeKey) {
|
|
37
|
-
const bag = store[routeKey];
|
|
38
|
-
if (bag) {
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Route-keyed screen transition state for the public animation lifecycle. These
|
|
16
|
+
* shared values track the current progress and whether a screen is entering,
|
|
17
|
+
* closing, or actively animating.
|
|
18
|
+
*/
|
|
19
|
+
export const AnimationStore = createStore({
|
|
20
|
+
createBag: createAnimationBag,
|
|
21
|
+
disposeBag: bag => {
|
|
39
22
|
cancelAnimation(bag.progress);
|
|
40
23
|
cancelAnimation(bag.animating);
|
|
41
24
|
cancelAnimation(bag.closing);
|
|
42
25
|
cancelAnimation(bag.entering);
|
|
43
|
-
cancelAnimation(bag.targetProgress);
|
|
44
|
-
cancelAnimation(bag.autoSnapPoint);
|
|
45
|
-
cancelAnimation(bag.contentLayout);
|
|
46
26
|
}
|
|
47
|
-
|
|
48
|
-
}
|
|
49
|
-
export const AnimationStore = {
|
|
50
|
-
getAnimation,
|
|
51
|
-
peekRouteAnimations,
|
|
52
|
-
getRouteAnimation,
|
|
53
|
-
getRouteAnimations,
|
|
54
|
-
clear
|
|
55
|
-
};
|
|
27
|
+
});
|
|
56
28
|
//# sourceMappingURL=animation.store.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["cancelAnimation","makeMutable","
|
|
1
|
+
{"version":3,"names":["cancelAnimation","makeMutable","createStore","createAnimationBag","progress","closing","animating","entering","AnimationStore","createBag","disposeBag","bag"],"sourceRoot":"../../../../src","sources":["shared/stores/animation.store.ts"],"mappings":";;AAAA,SACCA,eAAe,EACfC,WAAW,QAEL,yBAAyB;AAChC,SAASC,WAAW,QAAQ,uBAAuB;AASnD,SAASC,kBAAkBA,CAAA,EAAsB;EAChD,OAAO;IACNC,QAAQ,EAAEH,WAAW,CAAC,CAAC,CAAC;IACxBI,OAAO,EAAEJ,WAAW,CAAC,CAAC,CAAC;IACvBK,SAAS,EAAEL,WAAW,CAAC,CAAC,CAAC;IACzBM,QAAQ,EAAEN,WAAW,CAAC,CAAC;EACxB,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMO,cAAc,GAAGN,WAAW,CAAoB;EAC5DO,SAAS,EAAEN,kBAAkB;EAC7BO,UAAU,EAAGC,GAAG,IAAK;IACpBX,eAAe,CAACW,GAAG,CAACP,QAAQ,CAAC;IAC7BJ,eAAe,CAACW,GAAG,CAACL,SAAS,CAAC;IAC9BN,eAAe,CAACW,GAAG,CAACN,OAAO,CAAC;IAC5BL,eAAe,CAACW,GAAG,CAACJ,QAAQ,CAAC;EAC9B;AACD,CAAC,CAAC","ignoreList":[]}
|