react-native-screen-transitions 3.7.0-beta.2 → 3.8.0-alpha.0
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/blank-stack/components/stack-view.js +2 -2
- package/lib/commonjs/blank-stack/components/stack-view.js.map +1 -1
- package/lib/commonjs/component-stack/components/stack-view.js +2 -2
- package/lib/commonjs/component-stack/components/stack-view.js.map +1 -1
- package/lib/commonjs/shared/adapters/with-screen-transitions/options.js +37 -9
- package/lib/commonjs/shared/adapters/with-screen-transitions/options.js.map +1 -1
- package/lib/commonjs/shared/adapters/with-screen-transitions/stack-layout.js +1 -10
- package/lib/commonjs/shared/adapters/with-screen-transitions/stack-layout.js.map +1 -1
- package/lib/commonjs/shared/components/overlay/variations/float-overlay.js +1 -3
- package/lib/commonjs/shared/components/overlay/variations/float-overlay.js.map +1 -1
- package/lib/commonjs/shared/components/scene-view.js +1 -1
- package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-close-transition-intent.js +7 -7
- package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-close-transition-intent.js.map +1 -1
- package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-transition-start-controller.js +2 -2
- package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-transition-start-controller.js.map +1 -1
- package/lib/commonjs/shared/components/screen-lifecycle/index.js +2 -2
- package/lib/commonjs/shared/components/screen-lifecycle/index.js.map +1 -1
- package/lib/commonjs/shared/constants.js +3 -13
- package/lib/commonjs/shared/constants.js.map +1 -1
- package/lib/commonjs/shared/hooks/navigation/use-screen-state.js +1 -3
- package/lib/commonjs/shared/hooks/navigation/use-screen-state.js.map +1 -1
- package/lib/commonjs/shared/hooks/navigation/use-stack.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/animation/helpers/accessors/use-build-transition-accessor.js +15 -12
- package/lib/commonjs/shared/providers/screen/animation/helpers/accessors/use-build-transition-accessor.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/animation/helpers/build-screen-transition-options.js +2 -6
- package/lib/commonjs/shared/providers/screen/animation/helpers/build-screen-transition-options.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/animation/helpers/hydrate-transition-state/gesture-progress.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/animation/helpers/hydrate-transition-state/index.js +6 -23
- package/lib/commonjs/shared/providers/screen/animation/helpers/hydrate-transition-state/index.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/animation/helpers/pipeline.js +1 -1
- package/lib/commonjs/shared/providers/screen/animation/helpers/pipeline.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/animation/helpers/selected-interpolator-options.js +14 -1
- package/lib/commonjs/shared/providers/screen/animation/helpers/selected-interpolator-options.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/animation/helpers/use-build-transition-state.js +1 -1
- package/lib/commonjs/shared/providers/screen/animation/helpers/use-build-transition-state.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/gestures.provider.js +21 -8
- package/lib/commonjs/shared/providers/screen/gestures/gestures.provider.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/ownership/compute-claimed-directions.js +2 -1
- package/lib/commonjs/shared/providers/screen/gestures/ownership/compute-claimed-directions.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/pan/{pan-activation-decision.js → activation/pan-activation-decision.js} +5 -5
- package/lib/commonjs/shared/providers/screen/gestures/pan/activation/pan-activation-decision.js.map +1 -0
- package/lib/commonjs/shared/providers/screen/gestures/pan/{pan-activation-rules.js → activation/pan-activation-rules.js} +12 -9
- package/lib/commonjs/shared/providers/screen/gestures/pan/activation/pan-activation-rules.js.map +1 -0
- package/lib/commonjs/shared/providers/screen/gestures/pan/{pan-activation.js → activation/use-pan-activation.js} +15 -10
- package/lib/commonjs/shared/providers/screen/gestures/pan/activation/use-pan-activation.js.map +1 -0
- package/lib/commonjs/shared/providers/screen/gestures/pan/{pan-lifecycle.js → behavior/pan-lifecycle.js} +29 -8
- package/lib/commonjs/shared/providers/screen/gestures/pan/behavior/pan-lifecycle.js.map +1 -0
- package/lib/commonjs/shared/providers/screen/gestures/pan/{pan-release.js → behavior/pan-release.js} +5 -5
- package/lib/commonjs/shared/providers/screen/gestures/pan/behavior/pan-release.js.map +1 -0
- package/lib/commonjs/shared/providers/screen/gestures/pan/{pan-reset.js → behavior/pan-reset.js} +21 -11
- package/lib/commonjs/shared/providers/screen/gestures/pan/behavior/pan-reset.js.map +1 -0
- package/lib/commonjs/shared/providers/screen/gestures/pan/{use-pan-behavior.js → behavior/use-pan-behavior.js} +34 -8
- package/lib/commonjs/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.js.map +1 -0
- package/lib/commonjs/shared/providers/screen/gestures/pan/{build-pan-gesture.js → use-build-pan-gesture.js} +10 -8
- package/lib/commonjs/shared/providers/screen/gestures/pan/use-build-pan-gesture.js.map +1 -0
- package/lib/commonjs/shared/providers/screen/gestures/pinch/{pinch-activation.js → activation/use-pinch-activation.js} +12 -5
- package/lib/commonjs/shared/providers/screen/gestures/pinch/activation/use-pinch-activation.js.map +1 -0
- package/lib/commonjs/shared/providers/screen/gestures/pinch/{pinch-lifecycle.js → behavior/pinch-lifecycle.js} +7 -7
- package/lib/commonjs/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.js.map +1 -0
- package/lib/commonjs/shared/providers/screen/gestures/pinch/{pinch-release.js → behavior/pinch-release.js} +4 -4
- package/lib/commonjs/shared/providers/screen/gestures/pinch/behavior/pinch-release.js.map +1 -0
- package/lib/commonjs/shared/providers/screen/gestures/pinch/{pinch-reset.js → behavior/pinch-reset.js} +6 -3
- package/lib/commonjs/shared/providers/screen/gestures/pinch/behavior/pinch-reset.js.map +1 -0
- package/lib/commonjs/shared/providers/screen/gestures/pinch/{use-pinch-behavior.js → behavior/use-pinch-behavior.js} +6 -5
- package/lib/commonjs/shared/providers/screen/gestures/pinch/behavior/use-pinch-behavior.js.map +1 -0
- package/lib/commonjs/shared/providers/screen/gestures/pinch/{build-pinch-gesture.js → use-build-pinch-gesture.js} +9 -7
- package/lib/commonjs/shared/providers/screen/gestures/pinch/use-build-pinch-gesture.js.map +1 -0
- package/lib/commonjs/shared/providers/screen/gestures/rotation/activation/use-rotation-activation.js +62 -0
- package/lib/commonjs/shared/providers/screen/gestures/rotation/activation/use-rotation-activation.js.map +1 -0
- package/lib/commonjs/shared/providers/screen/gestures/rotation/behavior/rotation-lifecycle.js +21 -0
- package/lib/commonjs/shared/providers/screen/gestures/rotation/behavior/rotation-lifecycle.js.map +1 -0
- package/lib/commonjs/shared/providers/screen/gestures/rotation/behavior/use-rotation-behavior.js +29 -0
- package/lib/commonjs/shared/providers/screen/gestures/rotation/behavior/use-rotation-behavior.js.map +1 -0
- package/lib/commonjs/shared/providers/screen/gestures/rotation/use-build-rotation-gesture.js +45 -0
- package/lib/commonjs/shared/providers/screen/gestures/rotation/use-build-rotation-gesture.js.map +1 -0
- package/lib/commonjs/shared/providers/screen/gestures/shared/directions.js +17 -5
- package/lib/commonjs/shared/providers/screen/gestures/shared/directions.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/shared/policy.js +67 -2
- package/lib/commonjs/shared/providers/screen/gestures/shared/policy.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/shared/reset.js +3 -12
- package/lib/commonjs/shared/providers/screen/gestures/shared/reset.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/shared/runtime.js +1 -10
- package/lib/commonjs/shared/providers/screen/gestures/shared/runtime.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/shared/snap-points.js +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/shared/snap-points.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/types.js +2 -0
- package/lib/commonjs/shared/providers/screen/gestures/types.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/options/helpers.js +60 -24
- package/lib/commonjs/shared/providers/screen/options/helpers.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/styles/components/{maybe-floating-container.js → floating-overlay-layer.js} +5 -5
- package/lib/commonjs/shared/providers/screen/styles/components/floating-overlay-layer.js.map +1 -0
- package/lib/commonjs/shared/providers/screen/styles/styles.provider.js +3 -3
- package/lib/commonjs/shared/providers/screen/styles/styles.provider.js.map +1 -1
- package/lib/commonjs/shared/providers/stack/{helpers/managed-stack-state/managed-stack-controller.js → blank-stack-state/blank-stack-controller.js} +11 -11
- package/lib/commonjs/shared/providers/stack/blank-stack-state/blank-stack-controller.js.map +1 -0
- package/lib/commonjs/shared/providers/stack/{helpers/managed-stack-state/helpers/build-managed-stack-state.js → blank-stack-state/helpers/build-blank-stack-state.js} +18 -18
- package/lib/commonjs/shared/providers/stack/blank-stack-state/helpers/build-blank-stack-state.js.map +1 -0
- package/lib/commonjs/shared/providers/stack/blank-stack-state/helpers/derive-blank-stack-state.js +58 -0
- package/lib/commonjs/shared/providers/stack/blank-stack-state/helpers/derive-blank-stack-state.js.map +1 -0
- package/lib/commonjs/shared/providers/stack/blank-stack-state/helpers/navigation/compose-descriptors.js.map +1 -0
- package/lib/commonjs/shared/providers/stack/blank-stack-state/helpers/navigation/resolve-scene-neighbors.js.map +1 -0
- package/lib/commonjs/shared/{utils → providers/stack/blank-stack-state/helpers}/navigation/sync-routes-with-removed.js +6 -23
- package/lib/commonjs/shared/providers/stack/blank-stack-state/helpers/navigation/sync-routes-with-removed.js.map +1 -0
- package/lib/commonjs/shared/providers/stack/{helpers/managed-stack-state/helpers/reconcile-managed-routes.js → blank-stack-state/helpers/reconcile-blank-stack-routes.js} +8 -8
- package/lib/commonjs/shared/providers/stack/{helpers/managed-stack-state/helpers/reconcile-managed-routes.js.map → blank-stack-state/helpers/reconcile-blank-stack-routes.js.map} +1 -1
- package/lib/commonjs/shared/providers/stack/{helpers/managed-stack-state/helpers/helpers.js → blank-stack-state/helpers/state-equality.js} +1 -1
- package/lib/commonjs/shared/providers/stack/blank-stack-state/helpers/state-equality.js.map +1 -0
- package/lib/commonjs/shared/providers/stack/blank-stack-state/helpers/types.js.map +1 -0
- package/lib/commonjs/shared/providers/stack/{helpers/managed-stack-state → blank-stack-state}/index.js +5 -5
- package/lib/commonjs/shared/providers/stack/blank-stack-state/index.js.map +1 -0
- package/lib/commonjs/shared/providers/stack/{managed.provider.js → blank-stack.provider.js} +20 -27
- package/lib/commonjs/shared/providers/stack/blank-stack.provider.js.map +1 -0
- package/lib/commonjs/shared/providers/stack/direct.provider.js +3 -13
- package/lib/commonjs/shared/providers/stack/direct.provider.js.map +1 -1
- package/lib/commonjs/shared/stores/animation.store.js +2 -0
- package/lib/commonjs/shared/stores/animation.store.js.map +1 -1
- package/lib/commonjs/shared/stores/gesture.store.js +5 -1
- package/lib/commonjs/shared/stores/gesture.store.js.map +1 -1
- package/lib/commonjs/shared/stores/system.store.js +1 -4
- package/lib/commonjs/shared/stores/system.store.js.map +1 -1
- package/lib/commonjs/shared/types/animation.types.js.map +1 -1
- package/lib/commonjs/shared/types/gesture.types.js.map +1 -1
- package/lib/commonjs/shared/types/providers/blank-stack-provider.types.js +6 -0
- package/lib/commonjs/shared/types/providers/blank-stack-provider.types.js.map +1 -0
- package/lib/commonjs/shared/utils/animation/animate-to-progress.js +10 -4
- package/lib/commonjs/shared/utils/animation/animate-to-progress.js.map +1 -1
- package/lib/commonjs/shared/utils/animation/animate.js +22 -5
- package/lib/commonjs/shared/utils/animation/animate.js.map +1 -1
- package/lib/commonjs/shared/utils/animation/spring/index.js +13 -0
- package/lib/commonjs/shared/utils/animation/spring/index.js.map +1 -0
- package/lib/commonjs/shared/utils/animation/spring/spring.js +244 -0
- package/lib/commonjs/shared/utils/animation/spring/spring.js.map +1 -0
- package/lib/commonjs/shared/{types/providers/managed-stack.types.js → utils/animation/spring/springConfigs.js} +1 -1
- package/lib/commonjs/shared/utils/animation/spring/springConfigs.js.map +1 -0
- package/lib/commonjs/shared/utils/animation/spring/springUtils.js +313 -0
- package/lib/commonjs/shared/utils/animation/spring/springUtils.js.map +1 -0
- package/lib/commonjs/shared/utils/animation/state.js +2 -0
- package/lib/commonjs/shared/utils/animation/state.js.map +1 -0
- package/lib/commonjs/shared/utils/bounds/navigation/reveal/build.js +5 -5
- package/lib/commonjs/shared/utils/bounds/navigation/reveal/build.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/build.js +4 -4
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/build.js.map +1 -1
- package/lib/module/blank-stack/components/stack-view.js +2 -2
- package/lib/module/blank-stack/components/stack-view.js.map +1 -1
- package/lib/module/component-stack/components/stack-view.js +2 -2
- package/lib/module/component-stack/components/stack-view.js.map +1 -1
- package/lib/module/shared/adapters/with-screen-transitions/options.js +37 -9
- package/lib/module/shared/adapters/with-screen-transitions/options.js.map +1 -1
- package/lib/module/shared/adapters/with-screen-transitions/stack-layout.js +1 -10
- package/lib/module/shared/adapters/with-screen-transitions/stack-layout.js.map +1 -1
- package/lib/module/shared/components/overlay/variations/float-overlay.js +1 -3
- package/lib/module/shared/components/overlay/variations/float-overlay.js.map +1 -1
- package/lib/module/shared/components/scene-view.js +1 -1
- package/lib/module/shared/components/screen-lifecycle/hooks/use-close-transition-intent.js +7 -7
- package/lib/module/shared/components/screen-lifecycle/hooks/use-close-transition-intent.js.map +1 -1
- package/lib/module/shared/components/screen-lifecycle/hooks/use-transition-start-controller.js +2 -2
- package/lib/module/shared/components/screen-lifecycle/hooks/use-transition-start-controller.js.map +1 -1
- package/lib/module/shared/components/screen-lifecycle/index.js +2 -2
- package/lib/module/shared/components/screen-lifecycle/index.js.map +1 -1
- package/lib/module/shared/constants.js +2 -12
- package/lib/module/shared/constants.js.map +1 -1
- package/lib/module/shared/hooks/navigation/use-screen-state.js +1 -3
- package/lib/module/shared/hooks/navigation/use-screen-state.js.map +1 -1
- package/lib/module/shared/hooks/navigation/use-stack.js.map +1 -1
- package/lib/module/shared/providers/screen/animation/helpers/accessors/use-build-transition-accessor.js +15 -12
- package/lib/module/shared/providers/screen/animation/helpers/accessors/use-build-transition-accessor.js.map +1 -1
- package/lib/module/shared/providers/screen/animation/helpers/build-screen-transition-options.js +2 -6
- package/lib/module/shared/providers/screen/animation/helpers/build-screen-transition-options.js.map +1 -1
- package/lib/module/shared/providers/screen/animation/helpers/hydrate-transition-state/gesture-progress.js.map +1 -1
- package/lib/module/shared/providers/screen/animation/helpers/hydrate-transition-state/index.js +7 -24
- package/lib/module/shared/providers/screen/animation/helpers/hydrate-transition-state/index.js.map +1 -1
- package/lib/module/shared/providers/screen/animation/helpers/pipeline.js +1 -1
- package/lib/module/shared/providers/screen/animation/helpers/pipeline.js.map +1 -1
- package/lib/module/shared/providers/screen/animation/helpers/selected-interpolator-options.js +14 -1
- package/lib/module/shared/providers/screen/animation/helpers/selected-interpolator-options.js.map +1 -1
- package/lib/module/shared/providers/screen/animation/helpers/use-build-transition-state.js +1 -1
- package/lib/module/shared/providers/screen/animation/helpers/use-build-transition-state.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/gestures.provider.js +19 -6
- package/lib/module/shared/providers/screen/gestures/gestures.provider.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/ownership/compute-claimed-directions.js +2 -1
- package/lib/module/shared/providers/screen/gestures/ownership/compute-claimed-directions.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/pan/{pan-activation-decision.js → activation/pan-activation-decision.js} +5 -5
- package/lib/module/shared/providers/screen/gestures/pan/activation/pan-activation-decision.js.map +1 -0
- package/lib/module/shared/providers/screen/gestures/pan/{pan-activation-rules.js → activation/pan-activation-rules.js} +12 -9
- package/lib/module/shared/providers/screen/gestures/pan/activation/pan-activation-rules.js.map +1 -0
- package/lib/module/shared/providers/screen/gestures/pan/{pan-activation.js → activation/use-pan-activation.js} +15 -10
- package/lib/module/shared/providers/screen/gestures/pan/activation/use-pan-activation.js.map +1 -0
- package/lib/module/shared/providers/screen/gestures/pan/{pan-lifecycle.js → behavior/pan-lifecycle.js} +29 -8
- package/lib/module/shared/providers/screen/gestures/pan/behavior/pan-lifecycle.js.map +1 -0
- package/lib/module/shared/providers/screen/gestures/pan/{pan-release.js → behavior/pan-release.js} +5 -5
- package/lib/module/shared/providers/screen/gestures/pan/behavior/pan-release.js.map +1 -0
- package/lib/module/shared/providers/screen/gestures/pan/{pan-reset.js → behavior/pan-reset.js} +21 -11
- package/lib/module/shared/providers/screen/gestures/pan/behavior/pan-reset.js.map +1 -0
- package/lib/module/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.js +75 -0
- package/lib/module/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.js.map +1 -0
- package/lib/module/shared/providers/screen/gestures/pan/{build-pan-gesture.js → use-build-pan-gesture.js} +9 -7
- package/lib/module/shared/providers/screen/gestures/pan/use-build-pan-gesture.js.map +1 -0
- package/lib/module/shared/providers/screen/gestures/pinch/{pinch-activation.js → activation/use-pinch-activation.js} +12 -5
- package/lib/module/shared/providers/screen/gestures/pinch/activation/use-pinch-activation.js.map +1 -0
- package/lib/module/shared/providers/screen/gestures/pinch/{pinch-lifecycle.js → behavior/pinch-lifecycle.js} +7 -7
- package/lib/module/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.js.map +1 -0
- package/lib/module/shared/providers/screen/gestures/pinch/{pinch-release.js → behavior/pinch-release.js} +4 -4
- package/lib/module/shared/providers/screen/gestures/pinch/behavior/pinch-release.js.map +1 -0
- package/lib/module/shared/providers/screen/gestures/pinch/{pinch-reset.js → behavior/pinch-reset.js} +6 -3
- package/lib/module/shared/providers/screen/gestures/pinch/behavior/pinch-reset.js.map +1 -0
- package/lib/module/shared/providers/screen/gestures/pinch/{use-pinch-behavior.js → behavior/use-pinch-behavior.js} +6 -5
- package/lib/module/shared/providers/screen/gestures/pinch/behavior/use-pinch-behavior.js.map +1 -0
- package/lib/module/shared/providers/screen/gestures/pinch/{build-pinch-gesture.js → use-build-pinch-gesture.js} +8 -6
- package/lib/module/shared/providers/screen/gestures/pinch/use-build-pinch-gesture.js.map +1 -0
- package/lib/module/shared/providers/screen/gestures/rotation/activation/use-rotation-activation.js +57 -0
- package/lib/module/shared/providers/screen/gestures/rotation/activation/use-rotation-activation.js.map +1 -0
- package/lib/module/shared/providers/screen/gestures/rotation/behavior/rotation-lifecycle.js +15 -0
- package/lib/module/shared/providers/screen/gestures/rotation/behavior/rotation-lifecycle.js.map +1 -0
- package/lib/module/shared/providers/screen/gestures/rotation/behavior/use-rotation-behavior.js +24 -0
- package/lib/module/shared/providers/screen/gestures/rotation/behavior/use-rotation-behavior.js.map +1 -0
- package/lib/module/shared/providers/screen/gestures/rotation/use-build-rotation-gesture.js +40 -0
- package/lib/module/shared/providers/screen/gestures/rotation/use-build-rotation-gesture.js.map +1 -0
- package/lib/module/shared/providers/screen/gestures/shared/directions.js +14 -4
- package/lib/module/shared/providers/screen/gestures/shared/directions.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/shared/policy.js +68 -3
- package/lib/module/shared/providers/screen/gestures/shared/policy.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/shared/reset.js +4 -13
- package/lib/module/shared/providers/screen/gestures/shared/reset.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/shared/runtime.js +1 -10
- package/lib/module/shared/providers/screen/gestures/shared/runtime.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/shared/snap-points.js +1 -1
- package/lib/module/shared/providers/screen/gestures/shared/snap-points.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/types.js +2 -0
- package/lib/module/shared/providers/screen/gestures/types.js.map +1 -1
- package/lib/module/shared/providers/screen/options/helpers.js +60 -24
- package/lib/module/shared/providers/screen/options/helpers.js.map +1 -1
- package/lib/module/shared/providers/screen/styles/components/{maybe-floating-container.js → floating-overlay-layer.js} +4 -4
- package/lib/module/shared/providers/screen/styles/components/floating-overlay-layer.js.map +1 -0
- package/lib/module/shared/providers/screen/styles/styles.provider.js +3 -3
- package/lib/module/shared/providers/screen/styles/styles.provider.js.map +1 -1
- package/lib/module/shared/providers/stack/{helpers/managed-stack-state/managed-stack-controller.js → blank-stack-state/blank-stack-controller.js} +9 -9
- package/lib/module/shared/providers/stack/blank-stack-state/blank-stack-controller.js.map +1 -0
- package/lib/module/shared/providers/stack/{helpers/managed-stack-state/helpers/build-managed-stack-state.js → blank-stack-state/helpers/build-blank-stack-state.js} +10 -10
- package/lib/module/shared/providers/stack/blank-stack-state/helpers/build-blank-stack-state.js.map +1 -0
- package/lib/module/shared/providers/stack/{helpers/managed-stack-state/helpers/derive-managed-stack-state.js → blank-stack-state/helpers/derive-blank-stack-state.js} +7 -7
- package/lib/module/shared/providers/stack/blank-stack-state/helpers/derive-blank-stack-state.js.map +1 -0
- package/lib/module/shared/providers/stack/blank-stack-state/helpers/navigation/compose-descriptors.js.map +1 -0
- package/lib/module/shared/providers/stack/blank-stack-state/helpers/navigation/resolve-scene-neighbors.js.map +1 -0
- package/lib/module/shared/{utils → providers/stack/blank-stack-state/helpers}/navigation/sync-routes-with-removed.js +6 -23
- package/lib/module/shared/providers/stack/blank-stack-state/helpers/navigation/sync-routes-with-removed.js.map +1 -0
- package/lib/module/shared/providers/stack/{helpers/managed-stack-state/helpers/reconcile-managed-routes.js → blank-stack-state/helpers/reconcile-blank-stack-routes.js} +5 -5
- package/lib/module/shared/providers/stack/blank-stack-state/helpers/reconcile-blank-stack-routes.js.map +1 -0
- package/lib/module/shared/providers/stack/{helpers/managed-stack-state/helpers/helpers.js → blank-stack-state/helpers/state-equality.js} +1 -1
- package/lib/module/shared/providers/stack/blank-stack-state/helpers/state-equality.js.map +1 -0
- package/lib/module/shared/providers/stack/blank-stack-state/helpers/types.js.map +1 -0
- package/lib/module/shared/providers/stack/{helpers/managed-stack-state → blank-stack-state}/index.js +3 -3
- package/lib/module/shared/providers/stack/blank-stack-state/index.js.map +1 -0
- package/lib/module/shared/providers/stack/{managed.provider.js → blank-stack.provider.js} +19 -26
- package/lib/module/shared/providers/stack/blank-stack.provider.js.map +1 -0
- package/lib/module/shared/providers/stack/direct.provider.js +3 -13
- package/lib/module/shared/providers/stack/direct.provider.js.map +1 -1
- package/lib/module/shared/stores/animation.store.js +2 -0
- package/lib/module/shared/stores/animation.store.js.map +1 -1
- package/lib/module/shared/stores/gesture.store.js +5 -1
- package/lib/module/shared/stores/gesture.store.js.map +1 -1
- package/lib/module/shared/stores/system.store.js +1 -4
- package/lib/module/shared/stores/system.store.js.map +1 -1
- package/lib/module/shared/types/animation.types.js.map +1 -1
- package/lib/module/shared/types/gesture.types.js.map +1 -1
- package/lib/module/shared/types/providers/blank-stack-provider.types.js +4 -0
- package/lib/module/shared/types/providers/blank-stack-provider.types.js.map +1 -0
- package/lib/module/shared/utils/animation/animate-to-progress.js +11 -5
- package/lib/module/shared/utils/animation/animate-to-progress.js.map +1 -1
- package/lib/module/shared/utils/animation/animate.js +21 -5
- package/lib/module/shared/utils/animation/animate.js.map +1 -1
- package/lib/module/shared/utils/animation/spring/index.js +4 -0
- package/lib/module/shared/utils/animation/spring/index.js.map +1 -0
- package/lib/module/shared/utils/animation/spring/spring.js +239 -0
- package/lib/module/shared/utils/animation/spring/spring.js.map +1 -0
- package/lib/module/shared/utils/animation/spring/springConfigs.js +4 -0
- package/lib/module/shared/utils/animation/spring/springConfigs.js.map +1 -0
- package/lib/module/shared/utils/animation/spring/springUtils.js +300 -0
- package/lib/module/shared/utils/animation/spring/springUtils.js.map +1 -0
- package/lib/module/shared/utils/animation/state.js +2 -0
- package/lib/module/shared/utils/animation/state.js.map +1 -0
- package/lib/module/shared/utils/bounds/navigation/reveal/build.js +5 -5
- package/lib/module/shared/utils/bounds/navigation/reveal/build.js.map +1 -1
- package/lib/module/shared/utils/bounds/navigation/zoom/build.js +4 -4
- package/lib/module/shared/utils/bounds/navigation/zoom/build.js.map +1 -1
- package/lib/typescript/blank-stack/components/stack-view.d.ts +1 -1
- package/lib/typescript/blank-stack/components/stack-view.d.ts.map +1 -1
- package/lib/typescript/component-stack/components/stack-view.d.ts +1 -1
- package/lib/typescript/component-stack/components/stack-view.d.ts.map +1 -1
- package/lib/typescript/shared/adapters/with-screen-transitions/options.d.ts.map +1 -1
- package/lib/typescript/shared/adapters/with-screen-transitions/stack-layout.d.ts.map +1 -1
- package/lib/typescript/shared/components/overlay/variations/float-overlay.d.ts.map +1 -1
- package/lib/typescript/shared/components/scene-view.d.ts +1 -1
- package/lib/typescript/shared/components/screen-lifecycle/hooks/use-close-transition-intent.d.ts +1 -1
- package/lib/typescript/shared/components/screen-lifecycle/hooks/use-close-transition-intent.d.ts.map +1 -1
- package/lib/typescript/shared/components/screen-lifecycle/hooks/use-transition-start-controller.d.ts +2 -2
- package/lib/typescript/shared/components/screen-lifecycle/hooks/use-transition-start-controller.d.ts.map +1 -1
- package/lib/typescript/shared/constants.d.ts +0 -9
- package/lib/typescript/shared/constants.d.ts.map +1 -1
- package/lib/typescript/shared/hooks/navigation/use-screen-state.d.ts.map +1 -1
- package/lib/typescript/shared/hooks/navigation/use-stack.d.ts +0 -2
- package/lib/typescript/shared/hooks/navigation/use-stack.d.ts.map +1 -1
- package/lib/typescript/shared/index.d.ts +12 -12
- package/lib/typescript/shared/providers/screen/animation/helpers/accessors/use-build-transition-accessor.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/animation/helpers/build-screen-transition-options.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/animation/helpers/hydrate-transition-state/index.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/animation/helpers/hydrate-transition-state/types.d.ts +1 -6
- package/lib/typescript/shared/providers/screen/animation/helpers/hydrate-transition-state/types.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/animation/helpers/selected-interpolator-options.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/animation/helpers/use-build-transition-state.d.ts +1 -1
- package/lib/typescript/shared/providers/screen/animation/helpers/use-build-transition-state.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/gestures.provider.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/ownership/compute-claimed-directions.d.ts +2 -2
- package/lib/typescript/shared/providers/screen/gestures/ownership/compute-claimed-directions.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/pan/{pan-activation-decision.d.ts → activation/pan-activation-decision.d.ts} +3 -3
- package/lib/typescript/shared/providers/screen/gestures/pan/activation/pan-activation-decision.d.ts.map +1 -0
- package/lib/typescript/shared/providers/screen/gestures/pan/{pan-activation-rules.d.ts → activation/pan-activation-rules.d.ts} +11 -11
- package/lib/typescript/shared/providers/screen/gestures/pan/activation/pan-activation-rules.d.ts.map +1 -0
- package/lib/typescript/shared/providers/screen/gestures/pan/{pan-activation.d.ts → activation/use-pan-activation.d.ts} +5 -4
- package/lib/typescript/shared/providers/screen/gestures/pan/activation/use-pan-activation.d.ts.map +1 -0
- package/lib/typescript/shared/providers/screen/gestures/pan/{pan-lifecycle.d.ts → behavior/pan-lifecycle.d.ts} +3 -2
- package/lib/typescript/shared/providers/screen/gestures/pan/behavior/pan-lifecycle.d.ts.map +1 -0
- package/lib/typescript/shared/providers/screen/gestures/pan/{pan-release.d.ts → behavior/pan-release.d.ts} +1 -1
- package/lib/typescript/shared/providers/screen/gestures/pan/behavior/pan-release.d.ts.map +1 -0
- package/lib/typescript/shared/providers/screen/gestures/pan/{pan-reset.d.ts → behavior/pan-reset.d.ts} +4 -3
- package/lib/typescript/shared/providers/screen/gestures/pan/behavior/pan-reset.d.ts.map +1 -0
- package/lib/typescript/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.d.ts +5 -0
- package/lib/typescript/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.d.ts.map +1 -0
- package/lib/typescript/shared/providers/screen/gestures/pan/use-build-pan-gesture.d.ts +11 -0
- package/lib/typescript/shared/providers/screen/gestures/pan/use-build-pan-gesture.d.ts.map +1 -0
- package/lib/typescript/shared/providers/screen/gestures/pinch/{pinch-activation.d.ts → activation/use-pinch-activation.d.ts} +5 -4
- package/lib/typescript/shared/providers/screen/gestures/pinch/activation/use-pinch-activation.d.ts.map +1 -0
- package/lib/typescript/shared/providers/screen/gestures/pinch/{pinch-lifecycle.d.ts → behavior/pinch-lifecycle.d.ts} +1 -1
- package/lib/typescript/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.d.ts.map +1 -0
- package/lib/typescript/shared/providers/screen/gestures/pinch/{pinch-release.d.ts → behavior/pinch-release.d.ts} +1 -1
- package/lib/typescript/shared/providers/screen/gestures/pinch/behavior/pinch-release.d.ts.map +1 -0
- package/lib/typescript/shared/providers/screen/gestures/pinch/{pinch-reset.d.ts → behavior/pinch-reset.d.ts} +2 -2
- package/lib/typescript/shared/providers/screen/gestures/pinch/behavior/pinch-reset.d.ts.map +1 -0
- package/lib/typescript/shared/providers/screen/gestures/pinch/behavior/use-pinch-behavior.d.ts +5 -0
- package/lib/typescript/shared/providers/screen/gestures/pinch/behavior/use-pinch-behavior.d.ts.map +1 -0
- package/lib/typescript/shared/providers/screen/gestures/pinch/use-build-pinch-gesture.d.ts +9 -0
- package/lib/typescript/shared/providers/screen/gestures/pinch/use-build-pinch-gesture.d.ts.map +1 -0
- package/lib/typescript/shared/providers/screen/gestures/rotation/activation/use-rotation-activation.d.ts +15 -0
- package/lib/typescript/shared/providers/screen/gestures/rotation/activation/use-rotation-activation.d.ts.map +1 -0
- package/lib/typescript/shared/providers/screen/gestures/rotation/behavior/rotation-lifecycle.d.ts +4 -0
- package/lib/typescript/shared/providers/screen/gestures/rotation/behavior/rotation-lifecycle.d.ts.map +1 -0
- package/lib/typescript/shared/providers/screen/gestures/rotation/behavior/use-rotation-behavior.d.ts +5 -0
- package/lib/typescript/shared/providers/screen/gestures/rotation/behavior/use-rotation-behavior.d.ts.map +1 -0
- package/lib/typescript/shared/providers/screen/gestures/rotation/use-build-rotation-gesture.d.ts +9 -0
- package/lib/typescript/shared/providers/screen/gestures/rotation/use-build-rotation-gesture.d.ts.map +1 -0
- package/lib/typescript/shared/providers/screen/gestures/shared/directions.d.ts +8 -6
- package/lib/typescript/shared/providers/screen/gestures/shared/directions.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/shared/policy.d.ts +2 -2
- package/lib/typescript/shared/providers/screen/gestures/shared/policy.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/shared/reset.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/shared/runtime.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/types.d.ts +14 -4
- package/lib/typescript/shared/providers/screen/gestures/types.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/options/helpers.d.ts +2 -2
- package/lib/typescript/shared/providers/screen/options/helpers.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/options/types.d.ts +4 -3
- package/lib/typescript/shared/providers/screen/options/types.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/styles/components/floating-overlay-layer.d.ts +7 -0
- package/lib/typescript/shared/providers/screen/styles/components/floating-overlay-layer.d.ts.map +1 -0
- package/lib/typescript/shared/providers/stack/blank-stack-state/blank-stack-controller.d.ts +13 -0
- package/lib/typescript/shared/providers/stack/blank-stack-state/blank-stack-controller.d.ts.map +1 -0
- package/lib/typescript/shared/providers/stack/blank-stack-state/helpers/build-blank-stack-state.d.ts +13 -0
- package/lib/typescript/shared/providers/stack/blank-stack-state/helpers/build-blank-stack-state.d.ts.map +1 -0
- package/lib/typescript/shared/providers/stack/blank-stack-state/helpers/derive-blank-stack-state.d.ts +12 -0
- package/lib/typescript/shared/providers/stack/blank-stack-state/helpers/derive-blank-stack-state.d.ts.map +1 -0
- package/lib/typescript/shared/{utils → providers/stack/blank-stack-state/helpers}/navigation/compose-descriptors.d.ts +1 -1
- package/lib/typescript/shared/providers/stack/blank-stack-state/helpers/navigation/compose-descriptors.d.ts.map +1 -0
- package/lib/typescript/shared/providers/stack/blank-stack-state/helpers/navigation/resolve-scene-neighbors.d.ts.map +1 -0
- package/lib/typescript/shared/{utils → providers/stack/blank-stack-state/helpers}/navigation/sync-routes-with-removed.d.ts +2 -4
- package/lib/typescript/shared/providers/stack/blank-stack-state/helpers/navigation/sync-routes-with-removed.d.ts.map +1 -0
- package/lib/typescript/shared/providers/stack/blank-stack-state/helpers/reconcile-blank-stack-routes.d.ts +12 -0
- package/lib/typescript/shared/providers/stack/blank-stack-state/helpers/reconcile-blank-stack-routes.d.ts.map +1 -0
- package/lib/typescript/shared/providers/stack/{helpers/managed-stack-state/helpers/helpers.d.ts → blank-stack-state/helpers/state-equality.d.ts} +4 -4
- package/lib/typescript/shared/providers/stack/blank-stack-state/helpers/state-equality.d.ts.map +1 -0
- package/lib/typescript/shared/providers/stack/blank-stack-state/helpers/types.d.ts +39 -0
- package/lib/typescript/shared/providers/stack/blank-stack-state/helpers/types.d.ts.map +1 -0
- package/lib/typescript/shared/providers/stack/blank-stack-state/index.d.ts +12 -0
- package/lib/typescript/shared/providers/stack/blank-stack-state/index.d.ts.map +1 -0
- package/lib/typescript/shared/providers/stack/blank-stack.provider.d.ts +8 -0
- package/lib/typescript/shared/providers/stack/blank-stack.provider.d.ts.map +1 -0
- package/lib/typescript/shared/providers/stack/direct.provider.d.ts.map +1 -1
- package/lib/typescript/shared/stores/animation.store.d.ts +1 -0
- package/lib/typescript/shared/stores/animation.store.d.ts.map +1 -1
- package/lib/typescript/shared/stores/gesture.store.d.ts +2 -0
- package/lib/typescript/shared/stores/gesture.store.d.ts.map +1 -1
- package/lib/typescript/shared/stores/system.store.d.ts +1 -5
- package/lib/typescript/shared/stores/system.store.d.ts.map +1 -1
- package/lib/typescript/shared/types/animation.types.d.ts +12 -10
- package/lib/typescript/shared/types/animation.types.d.ts.map +1 -1
- package/lib/typescript/shared/types/bounds.types.d.ts +1 -1
- package/lib/typescript/shared/types/gesture.types.d.ts +24 -0
- package/lib/typescript/shared/types/gesture.types.d.ts.map +1 -1
- package/lib/typescript/shared/types/index.d.ts +1 -1
- package/lib/typescript/shared/types/index.d.ts.map +1 -1
- package/lib/typescript/shared/types/providers/{managed-stack.types.d.ts → blank-stack-provider.types.d.ts} +11 -11
- package/lib/typescript/shared/types/providers/blank-stack-provider.types.d.ts.map +1 -0
- package/lib/typescript/shared/types/screen.types.d.ts +7 -2
- package/lib/typescript/shared/types/screen.types.d.ts.map +1 -1
- package/lib/typescript/shared/utils/animation/animate-to-progress.d.ts.map +1 -1
- package/lib/typescript/shared/utils/animation/animate.d.ts +8 -3
- package/lib/typescript/shared/utils/animation/animate.d.ts.map +1 -1
- package/lib/typescript/shared/utils/animation/spring/index.d.ts +3 -0
- package/lib/typescript/shared/utils/animation/spring/index.d.ts.map +1 -0
- package/lib/typescript/shared/utils/animation/spring/spring.d.ts +24 -0
- package/lib/typescript/shared/utils/animation/spring/spring.d.ts.map +1 -0
- package/lib/typescript/shared/utils/animation/spring/springConfigs.d.ts +46 -0
- package/lib/typescript/shared/utils/animation/spring/springConfigs.d.ts.map +1 -0
- package/lib/typescript/shared/utils/animation/spring/springUtils.d.ts +68 -0
- package/lib/typescript/shared/utils/animation/spring/springUtils.d.ts.map +1 -0
- package/lib/typescript/shared/utils/animation/state.d.ts +6 -0
- package/lib/typescript/shared/utils/animation/state.d.ts.map +1 -0
- package/lib/typescript/shared/utils/bounds/navigation/reveal/build.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/navigation/zoom/build.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/blank-stack/components/stack-view.tsx +2 -2
- package/src/component-stack/components/stack-view.tsx +2 -2
- package/src/shared/adapters/with-screen-transitions/options.ts +86 -19
- package/src/shared/adapters/with-screen-transitions/stack-layout.tsx +0 -14
- package/src/shared/components/overlay/variations/float-overlay.tsx +1 -7
- package/src/shared/components/scene-view.tsx +1 -1
- package/src/shared/components/screen-lifecycle/hooks/use-close-transition-intent.ts +11 -8
- package/src/shared/components/screen-lifecycle/hooks/use-transition-start-controller.ts +4 -4
- package/src/shared/components/screen-lifecycle/index.tsx +2 -2
- package/src/shared/constants.ts +1 -11
- package/src/shared/hooks/navigation/use-screen-state.ts +1 -7
- package/src/shared/hooks/navigation/use-stack.tsx +0 -2
- package/src/shared/providers/screen/animation/helpers/accessors/use-build-transition-accessor.ts +19 -16
- package/src/shared/providers/screen/animation/helpers/build-screen-transition-options.ts +2 -17
- package/src/shared/providers/screen/animation/helpers/hydrate-transition-state/gesture-progress.ts +3 -3
- package/src/shared/providers/screen/animation/helpers/hydrate-transition-state/index.ts +9 -51
- package/src/shared/providers/screen/animation/helpers/hydrate-transition-state/types.ts +1 -7
- package/src/shared/providers/screen/animation/helpers/pipeline.ts +1 -1
- package/src/shared/providers/screen/animation/helpers/selected-interpolator-options.ts +24 -1
- package/src/shared/providers/screen/animation/helpers/use-build-transition-state.ts +2 -5
- package/src/shared/providers/screen/gestures/gestures.provider.tsx +21 -4
- package/src/shared/providers/screen/gestures/ownership/compute-claimed-directions.ts +6 -9
- package/src/shared/providers/screen/gestures/pan/{pan-activation-decision.ts → activation/pan-activation-decision.ts} +7 -7
- package/src/shared/providers/screen/gestures/pan/{pan-activation-rules.ts → activation/pan-activation-rules.ts} +32 -25
- package/src/shared/providers/screen/gestures/pan/{pan-activation.ts → activation/use-pan-activation.ts} +23 -12
- package/src/shared/providers/screen/gestures/pan/{pan-lifecycle.ts → behavior/pan-lifecycle.ts} +46 -8
- package/src/shared/providers/screen/gestures/pan/{pan-release.ts → behavior/pan-release.ts} +6 -6
- package/src/shared/providers/screen/gestures/pan/{pan-reset.ts → behavior/pan-reset.ts} +22 -12
- package/src/shared/providers/screen/gestures/pan/{use-pan-behavior.ts → behavior/use-pan-behavior.ts} +43 -10
- package/src/shared/providers/screen/gestures/pan/{build-pan-gesture.ts → use-build-pan-gesture.ts} +15 -6
- package/src/shared/providers/screen/gestures/pinch/{pinch-activation.ts → activation/use-pinch-activation.ts} +17 -5
- package/src/shared/providers/screen/gestures/pinch/{pinch-lifecycle.ts → behavior/pinch-lifecycle.ts} +10 -8
- package/src/shared/providers/screen/gestures/pinch/{pinch-release.ts → behavior/pinch-release.ts} +5 -5
- package/src/shared/providers/screen/gestures/pinch/{pinch-reset.ts → behavior/pinch-reset.ts} +11 -5
- package/src/shared/providers/screen/gestures/pinch/{use-pinch-behavior.ts → behavior/use-pinch-behavior.ts} +16 -6
- package/src/shared/providers/screen/gestures/pinch/{build-pinch-gesture.ts → use-build-pinch-gesture.ts} +18 -6
- package/src/shared/providers/screen/gestures/rotation/activation/use-rotation-activation.ts +87 -0
- package/src/shared/providers/screen/gestures/rotation/behavior/rotation-lifecycle.ts +19 -0
- package/src/shared/providers/screen/gestures/rotation/behavior/use-rotation-behavior.ts +47 -0
- package/src/shared/providers/screen/gestures/rotation/use-build-rotation-gesture.ts +55 -0
- package/src/shared/providers/screen/gestures/shared/directions.ts +27 -13
- package/src/shared/providers/screen/gestures/shared/policy.ts +99 -5
- package/src/shared/providers/screen/gestures/shared/reset.ts +9 -17
- package/src/shared/providers/screen/gestures/shared/runtime.ts +1 -14
- package/src/shared/providers/screen/gestures/shared/snap-points.ts +1 -1
- package/src/shared/providers/screen/gestures/types.ts +20 -3
- package/src/shared/providers/screen/options/helpers.ts +85 -30
- package/src/shared/providers/screen/options/types.ts +6 -5
- package/src/shared/providers/screen/styles/components/{maybe-floating-container.tsx → floating-overlay-layer.tsx} +6 -6
- package/src/shared/providers/screen/styles/styles.provider.tsx +3 -3
- package/src/shared/providers/stack/{helpers/managed-stack-state/managed-stack-controller.ts → blank-stack-state/blank-stack-controller.ts} +22 -20
- package/src/shared/providers/stack/{helpers/managed-stack-state/helpers/build-managed-stack-state.ts → blank-stack-state/helpers/build-blank-stack-state.ts} +28 -25
- package/src/shared/providers/stack/{helpers/managed-stack-state/helpers/derive-managed-stack-state.ts → blank-stack-state/helpers/derive-blank-stack-state.ts} +13 -13
- package/src/shared/{utils → providers/stack/blank-stack-state/helpers}/navigation/compose-descriptors.ts +1 -1
- package/src/shared/{utils → providers/stack/blank-stack-state/helpers}/navigation/sync-routes-with-removed.ts +8 -40
- package/src/shared/providers/stack/{helpers/managed-stack-state/helpers/reconcile-managed-routes.ts → blank-stack-state/helpers/reconcile-blank-stack-routes.ts} +26 -22
- package/src/shared/providers/stack/{helpers/managed-stack-state/helpers/helpers.ts → blank-stack-state/helpers/state-equality.ts} +4 -4
- package/src/shared/providers/stack/{helpers/managed-stack-state → blank-stack-state}/helpers/types.ts +16 -15
- package/src/shared/providers/stack/{helpers/managed-stack-state → blank-stack-state}/index.ts +9 -9
- package/src/shared/providers/stack/blank-stack.provider.tsx +118 -0
- package/src/shared/providers/stack/direct.provider.tsx +38 -54
- package/src/shared/stores/animation.store.ts +3 -0
- package/src/shared/stores/gesture.store.ts +6 -0
- package/src/shared/stores/system.store.ts +1 -9
- package/src/shared/types/animation.types.ts +12 -14
- package/src/shared/types/bounds.types.ts +1 -1
- package/src/shared/types/gesture.types.ts +33 -0
- package/src/shared/types/index.ts +4 -0
- package/src/shared/types/providers/{managed-stack.types.ts → blank-stack-provider.types.ts} +10 -10
- package/src/shared/types/screen.types.ts +7 -2
- package/src/shared/utils/animation/animate-to-progress.ts +18 -7
- package/src/shared/utils/animation/animate.ts +44 -21
- package/src/shared/utils/animation/spring/index.ts +2 -0
- package/src/shared/utils/animation/spring/spring.ts +343 -0
- package/src/shared/utils/animation/spring/springConfigs.ts +46 -0
- package/src/shared/utils/animation/spring/springUtils.ts +418 -0
- package/src/shared/utils/animation/state.ts +6 -0
- package/src/shared/utils/bounds/navigation/reveal/build.ts +5 -9
- package/src/shared/utils/bounds/navigation/zoom/build.ts +4 -6
- package/lib/commonjs/shared/hooks/navigation/use-closing-route-keys.js +0 -61
- package/lib/commonjs/shared/hooks/navigation/use-closing-route-keys.js.map +0 -1
- package/lib/commonjs/shared/hooks/navigation/use-optimistic-focused-index.js +0 -20
- package/lib/commonjs/shared/hooks/navigation/use-optimistic-focused-index.js.map +0 -1
- package/lib/commonjs/shared/providers/screen/animation/helpers/hydrate-transition-state/settle.js +0 -29
- package/lib/commonjs/shared/providers/screen/animation/helpers/hydrate-transition-state/settle.js.map +0 -1
- package/lib/commonjs/shared/providers/screen/gestures/pan/build-pan-gesture.js.map +0 -1
- package/lib/commonjs/shared/providers/screen/gestures/pan/pan-activation-decision.js.map +0 -1
- package/lib/commonjs/shared/providers/screen/gestures/pan/pan-activation-rules.js.map +0 -1
- package/lib/commonjs/shared/providers/screen/gestures/pan/pan-activation.js.map +0 -1
- package/lib/commonjs/shared/providers/screen/gestures/pan/pan-lifecycle.js.map +0 -1
- package/lib/commonjs/shared/providers/screen/gestures/pan/pan-release.js.map +0 -1
- package/lib/commonjs/shared/providers/screen/gestures/pan/pan-reset.js.map +0 -1
- package/lib/commonjs/shared/providers/screen/gestures/pan/use-pan-behavior.js.map +0 -1
- package/lib/commonjs/shared/providers/screen/gestures/pinch/build-pinch-gesture.js.map +0 -1
- package/lib/commonjs/shared/providers/screen/gestures/pinch/pinch-activation.js.map +0 -1
- package/lib/commonjs/shared/providers/screen/gestures/pinch/pinch-lifecycle.js.map +0 -1
- package/lib/commonjs/shared/providers/screen/gestures/pinch/pinch-release.js.map +0 -1
- package/lib/commonjs/shared/providers/screen/gestures/pinch/pinch-reset.js.map +0 -1
- package/lib/commonjs/shared/providers/screen/gestures/pinch/use-pinch-behavior.js.map +0 -1
- package/lib/commonjs/shared/providers/screen/styles/components/maybe-floating-container.js.map +0 -1
- package/lib/commonjs/shared/providers/stack/helpers/managed-stack-state/helpers/build-managed-stack-state.js.map +0 -1
- package/lib/commonjs/shared/providers/stack/helpers/managed-stack-state/helpers/derive-managed-stack-state.js +0 -58
- package/lib/commonjs/shared/providers/stack/helpers/managed-stack-state/helpers/derive-managed-stack-state.js.map +0 -1
- package/lib/commonjs/shared/providers/stack/helpers/managed-stack-state/helpers/helpers.js.map +0 -1
- package/lib/commonjs/shared/providers/stack/helpers/managed-stack-state/helpers/types.js.map +0 -1
- package/lib/commonjs/shared/providers/stack/helpers/managed-stack-state/index.js.map +0 -1
- package/lib/commonjs/shared/providers/stack/helpers/managed-stack-state/managed-stack-controller.js.map +0 -1
- package/lib/commonjs/shared/providers/stack/helpers/use-closing-route-map.js +0 -30
- package/lib/commonjs/shared/providers/stack/helpers/use-closing-route-map.js.map +0 -1
- package/lib/commonjs/shared/providers/stack/helpers/use-processed-routes.js +0 -58
- package/lib/commonjs/shared/providers/stack/helpers/use-processed-routes.js.map +0 -1
- package/lib/commonjs/shared/providers/stack/helpers/use-stack-derived.js +0 -27
- package/lib/commonjs/shared/providers/stack/helpers/use-stack-derived.js.map +0 -1
- package/lib/commonjs/shared/providers/stack/managed.provider.js.map +0 -1
- package/lib/commonjs/shared/types/providers/managed-stack.types.js.map +0 -1
- package/lib/commonjs/shared/utils/navigation/compose-descriptors.js.map +0 -1
- package/lib/commonjs/shared/utils/navigation/resolve-scene-neighbors.js.map +0 -1
- package/lib/commonjs/shared/utils/navigation/sync-routes-with-removed.js.map +0 -1
- package/lib/module/shared/hooks/navigation/use-closing-route-keys.js +0 -55
- package/lib/module/shared/hooks/navigation/use-closing-route-keys.js.map +0 -1
- package/lib/module/shared/hooks/navigation/use-optimistic-focused-index.js +0 -17
- package/lib/module/shared/hooks/navigation/use-optimistic-focused-index.js.map +0 -1
- package/lib/module/shared/providers/screen/animation/helpers/hydrate-transition-state/settle.js +0 -22
- package/lib/module/shared/providers/screen/animation/helpers/hydrate-transition-state/settle.js.map +0 -1
- package/lib/module/shared/providers/screen/gestures/pan/build-pan-gesture.js.map +0 -1
- package/lib/module/shared/providers/screen/gestures/pan/pan-activation-decision.js.map +0 -1
- package/lib/module/shared/providers/screen/gestures/pan/pan-activation-rules.js.map +0 -1
- package/lib/module/shared/providers/screen/gestures/pan/pan-activation.js.map +0 -1
- package/lib/module/shared/providers/screen/gestures/pan/pan-lifecycle.js.map +0 -1
- package/lib/module/shared/providers/screen/gestures/pan/pan-release.js.map +0 -1
- package/lib/module/shared/providers/screen/gestures/pan/pan-reset.js.map +0 -1
- package/lib/module/shared/providers/screen/gestures/pan/use-pan-behavior.js +0 -49
- package/lib/module/shared/providers/screen/gestures/pan/use-pan-behavior.js.map +0 -1
- package/lib/module/shared/providers/screen/gestures/pinch/build-pinch-gesture.js.map +0 -1
- package/lib/module/shared/providers/screen/gestures/pinch/pinch-activation.js.map +0 -1
- package/lib/module/shared/providers/screen/gestures/pinch/pinch-lifecycle.js.map +0 -1
- package/lib/module/shared/providers/screen/gestures/pinch/pinch-release.js.map +0 -1
- package/lib/module/shared/providers/screen/gestures/pinch/pinch-reset.js.map +0 -1
- package/lib/module/shared/providers/screen/gestures/pinch/use-pinch-behavior.js.map +0 -1
- package/lib/module/shared/providers/screen/styles/components/maybe-floating-container.js.map +0 -1
- package/lib/module/shared/providers/stack/helpers/managed-stack-state/helpers/build-managed-stack-state.js.map +0 -1
- package/lib/module/shared/providers/stack/helpers/managed-stack-state/helpers/derive-managed-stack-state.js.map +0 -1
- package/lib/module/shared/providers/stack/helpers/managed-stack-state/helpers/helpers.js.map +0 -1
- package/lib/module/shared/providers/stack/helpers/managed-stack-state/helpers/reconcile-managed-routes.js.map +0 -1
- package/lib/module/shared/providers/stack/helpers/managed-stack-state/helpers/types.js.map +0 -1
- package/lib/module/shared/providers/stack/helpers/managed-stack-state/index.js.map +0 -1
- package/lib/module/shared/providers/stack/helpers/managed-stack-state/managed-stack-controller.js.map +0 -1
- package/lib/module/shared/providers/stack/helpers/use-closing-route-map.js +0 -25
- package/lib/module/shared/providers/stack/helpers/use-closing-route-map.js.map +0 -1
- package/lib/module/shared/providers/stack/helpers/use-processed-routes.js +0 -54
- package/lib/module/shared/providers/stack/helpers/use-processed-routes.js.map +0 -1
- package/lib/module/shared/providers/stack/helpers/use-stack-derived.js +0 -23
- package/lib/module/shared/providers/stack/helpers/use-stack-derived.js.map +0 -1
- package/lib/module/shared/providers/stack/managed.provider.js.map +0 -1
- package/lib/module/shared/types/providers/managed-stack.types.js +0 -4
- package/lib/module/shared/types/providers/managed-stack.types.js.map +0 -1
- package/lib/module/shared/utils/navigation/compose-descriptors.js.map +0 -1
- package/lib/module/shared/utils/navigation/resolve-scene-neighbors.js.map +0 -1
- package/lib/module/shared/utils/navigation/sync-routes-with-removed.js.map +0 -1
- package/lib/typescript/shared/hooks/navigation/use-closing-route-keys.d.ts +0 -8
- package/lib/typescript/shared/hooks/navigation/use-closing-route-keys.d.ts.map +0 -1
- package/lib/typescript/shared/hooks/navigation/use-optimistic-focused-index.d.ts +0 -7
- package/lib/typescript/shared/hooks/navigation/use-optimistic-focused-index.d.ts.map +0 -1
- package/lib/typescript/shared/providers/screen/animation/helpers/hydrate-transition-state/settle.d.ts +0 -5
- package/lib/typescript/shared/providers/screen/animation/helpers/hydrate-transition-state/settle.d.ts.map +0 -1
- package/lib/typescript/shared/providers/screen/gestures/pan/build-pan-gesture.d.ts +0 -10
- package/lib/typescript/shared/providers/screen/gestures/pan/build-pan-gesture.d.ts.map +0 -1
- package/lib/typescript/shared/providers/screen/gestures/pan/pan-activation-decision.d.ts.map +0 -1
- package/lib/typescript/shared/providers/screen/gestures/pan/pan-activation-rules.d.ts.map +0 -1
- package/lib/typescript/shared/providers/screen/gestures/pan/pan-activation.d.ts.map +0 -1
- package/lib/typescript/shared/providers/screen/gestures/pan/pan-lifecycle.d.ts.map +0 -1
- package/lib/typescript/shared/providers/screen/gestures/pan/pan-release.d.ts.map +0 -1
- package/lib/typescript/shared/providers/screen/gestures/pan/pan-reset.d.ts.map +0 -1
- package/lib/typescript/shared/providers/screen/gestures/pan/use-pan-behavior.d.ts +0 -5
- package/lib/typescript/shared/providers/screen/gestures/pan/use-pan-behavior.d.ts.map +0 -1
- package/lib/typescript/shared/providers/screen/gestures/pinch/build-pinch-gesture.d.ts +0 -7
- package/lib/typescript/shared/providers/screen/gestures/pinch/build-pinch-gesture.d.ts.map +0 -1
- package/lib/typescript/shared/providers/screen/gestures/pinch/pinch-activation.d.ts.map +0 -1
- package/lib/typescript/shared/providers/screen/gestures/pinch/pinch-lifecycle.d.ts.map +0 -1
- package/lib/typescript/shared/providers/screen/gestures/pinch/pinch-release.d.ts.map +0 -1
- package/lib/typescript/shared/providers/screen/gestures/pinch/pinch-reset.d.ts.map +0 -1
- package/lib/typescript/shared/providers/screen/gestures/pinch/use-pinch-behavior.d.ts +0 -5
- package/lib/typescript/shared/providers/screen/gestures/pinch/use-pinch-behavior.d.ts.map +0 -1
- package/lib/typescript/shared/providers/screen/styles/components/maybe-floating-container.d.ts +0 -7
- package/lib/typescript/shared/providers/screen/styles/components/maybe-floating-container.d.ts.map +0 -1
- package/lib/typescript/shared/providers/stack/helpers/managed-stack-state/helpers/build-managed-stack-state.d.ts +0 -13
- package/lib/typescript/shared/providers/stack/helpers/managed-stack-state/helpers/build-managed-stack-state.d.ts.map +0 -1
- package/lib/typescript/shared/providers/stack/helpers/managed-stack-state/helpers/derive-managed-stack-state.d.ts +0 -12
- package/lib/typescript/shared/providers/stack/helpers/managed-stack-state/helpers/derive-managed-stack-state.d.ts.map +0 -1
- package/lib/typescript/shared/providers/stack/helpers/managed-stack-state/helpers/helpers.d.ts.map +0 -1
- package/lib/typescript/shared/providers/stack/helpers/managed-stack-state/helpers/reconcile-managed-routes.d.ts +0 -12
- package/lib/typescript/shared/providers/stack/helpers/managed-stack-state/helpers/reconcile-managed-routes.d.ts.map +0 -1
- package/lib/typescript/shared/providers/stack/helpers/managed-stack-state/helpers/types.d.ts +0 -39
- package/lib/typescript/shared/providers/stack/helpers/managed-stack-state/helpers/types.d.ts.map +0 -1
- package/lib/typescript/shared/providers/stack/helpers/managed-stack-state/index.d.ts +0 -12
- package/lib/typescript/shared/providers/stack/helpers/managed-stack-state/index.d.ts.map +0 -1
- package/lib/typescript/shared/providers/stack/helpers/managed-stack-state/managed-stack-controller.d.ts +0 -13
- package/lib/typescript/shared/providers/stack/helpers/managed-stack-state/managed-stack-controller.d.ts.map +0 -1
- package/lib/typescript/shared/providers/stack/helpers/use-closing-route-map.d.ts +0 -7
- package/lib/typescript/shared/providers/stack/helpers/use-closing-route-map.d.ts.map +0 -1
- package/lib/typescript/shared/providers/stack/helpers/use-processed-routes.d.ts +0 -17
- package/lib/typescript/shared/providers/stack/helpers/use-processed-routes.d.ts.map +0 -1
- package/lib/typescript/shared/providers/stack/helpers/use-stack-derived.d.ts +0 -18
- package/lib/typescript/shared/providers/stack/helpers/use-stack-derived.d.ts.map +0 -1
- package/lib/typescript/shared/providers/stack/managed.provider.d.ts +0 -8
- package/lib/typescript/shared/providers/stack/managed.provider.d.ts.map +0 -1
- package/lib/typescript/shared/types/providers/managed-stack.types.d.ts.map +0 -1
- package/lib/typescript/shared/utils/navigation/compose-descriptors.d.ts.map +0 -1
- package/lib/typescript/shared/utils/navigation/resolve-scene-neighbors.d.ts.map +0 -1
- package/lib/typescript/shared/utils/navigation/sync-routes-with-removed.d.ts.map +0 -1
- package/src/shared/hooks/navigation/use-closing-route-keys.ts +0 -60
- package/src/shared/hooks/navigation/use-optimistic-focused-index.ts +0 -19
- package/src/shared/providers/screen/animation/helpers/hydrate-transition-state/settle.ts +0 -41
- package/src/shared/providers/stack/helpers/use-closing-route-map.ts +0 -28
- package/src/shared/providers/stack/helpers/use-processed-routes.ts +0 -85
- package/src/shared/providers/stack/helpers/use-stack-derived.ts +0 -34
- package/src/shared/providers/stack/managed.provider.tsx +0 -126
- /package/lib/commonjs/shared/{utils → providers/stack/blank-stack-state/helpers}/navigation/compose-descriptors.js +0 -0
- /package/lib/commonjs/shared/{utils → providers/stack/blank-stack-state/helpers}/navigation/resolve-scene-neighbors.js +0 -0
- /package/lib/commonjs/shared/providers/stack/{helpers/managed-stack-state → blank-stack-state}/helpers/types.js +0 -0
- /package/lib/module/shared/{utils → providers/stack/blank-stack-state/helpers}/navigation/compose-descriptors.js +0 -0
- /package/lib/module/shared/{utils → providers/stack/blank-stack-state/helpers}/navigation/resolve-scene-neighbors.js +0 -0
- /package/lib/module/shared/providers/stack/{helpers/managed-stack-state → blank-stack-state}/helpers/types.js +0 -0
- /package/lib/typescript/shared/{utils → providers/stack/blank-stack-state/helpers}/navigation/resolve-scene-neighbors.d.ts +0 -0
- /package/src/shared/{utils → providers/stack/blank-stack-state/helpers}/navigation/resolve-scene-neighbors.ts +0 -0
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
Animation,
|
|
3
|
+
AnimationCallback,
|
|
4
|
+
ReduceMotion,
|
|
5
|
+
} from "react-native-reanimated";
|
|
6
|
+
import type { AnimationStateCallback } from "../state";
|
|
7
|
+
import type { SpringConfig } from "./springConfigs";
|
|
8
|
+
import type {
|
|
9
|
+
DefaultSpringConfig,
|
|
10
|
+
InnerSpringAnimation,
|
|
11
|
+
SpringAnimation,
|
|
12
|
+
SpringConfigInner,
|
|
13
|
+
} from "./springUtils";
|
|
14
|
+
import {
|
|
15
|
+
calculateNewStiffnessToMatchDuration,
|
|
16
|
+
checkIfConfigIsValid,
|
|
17
|
+
criticallyDampedSpringCalculations,
|
|
18
|
+
getEnergy,
|
|
19
|
+
initialCalculations,
|
|
20
|
+
isAnimationSettledCalculation,
|
|
21
|
+
isAnimationTerminatingCalculation,
|
|
22
|
+
safeMergeConfigs,
|
|
23
|
+
scaleZetaToMatchClamps,
|
|
24
|
+
underDampedSpringCalculations,
|
|
25
|
+
} from "./springUtils";
|
|
26
|
+
|
|
27
|
+
type Timestamp = number;
|
|
28
|
+
|
|
29
|
+
const REACT_NATIVE_RUNTIME_KIND = 1;
|
|
30
|
+
const REDUCE_MOTION_SYSTEM = "system";
|
|
31
|
+
const REDUCE_MOTION_ALWAYS = "always";
|
|
32
|
+
const DEFAULT_SPRING_SETTLE_DISTANCE = 0.001;
|
|
33
|
+
|
|
34
|
+
const DEFAULT_SPRING_CONFIG = {
|
|
35
|
+
damping: 120,
|
|
36
|
+
mass: 4,
|
|
37
|
+
stiffness: 900,
|
|
38
|
+
duration: 550,
|
|
39
|
+
dampingRatio: 1,
|
|
40
|
+
overshootClamping: false,
|
|
41
|
+
energyThreshold: 6e-9,
|
|
42
|
+
velocity: 0,
|
|
43
|
+
reduceMotion: undefined,
|
|
44
|
+
clamp: undefined,
|
|
45
|
+
} as const satisfies DefaultSpringConfig;
|
|
46
|
+
|
|
47
|
+
const getRuntimeKind = () => {
|
|
48
|
+
"worklet";
|
|
49
|
+
return (globalThis as { __RUNTIME_KIND?: number }).__RUNTIME_KIND;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
const getReduceMotionForAnimation = (config?: ReduceMotion) => {
|
|
53
|
+
"worklet";
|
|
54
|
+
if (!config || config === REDUCE_MOTION_SYSTEM) {
|
|
55
|
+
return undefined;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
return config === REDUCE_MOTION_ALWAYS;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
const defineSpringAnimation = <TAnimation extends Animation<TAnimation>>(
|
|
62
|
+
_starting: number,
|
|
63
|
+
factory: () => TAnimation,
|
|
64
|
+
): TAnimation => {
|
|
65
|
+
"worklet";
|
|
66
|
+
const create = (() => {
|
|
67
|
+
"worklet";
|
|
68
|
+
const animation = factory();
|
|
69
|
+
const baseOnStart = animation.onStart;
|
|
70
|
+
|
|
71
|
+
animation.onStart = (
|
|
72
|
+
animation: TAnimation,
|
|
73
|
+
value: Parameters<TAnimation["onStart"]>[1],
|
|
74
|
+
timestamp: Timestamp,
|
|
75
|
+
previousAnimation: Parameters<TAnimation["onStart"]>[3],
|
|
76
|
+
) => {
|
|
77
|
+
"worklet";
|
|
78
|
+
if (animation.reduceMotion) {
|
|
79
|
+
animation.current = animation.toValue;
|
|
80
|
+
animation.onFrame = () => true;
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
baseOnStart(animation, value, timestamp, previousAnimation);
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
return animation;
|
|
88
|
+
}) as (() => TAnimation) & { __isAnimationDefinition?: true };
|
|
89
|
+
|
|
90
|
+
if (getRuntimeKind() !== REACT_NATIVE_RUNTIME_KIND) {
|
|
91
|
+
return create();
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
create.__isAnimationDefinition = true;
|
|
95
|
+
return create as unknown as TAnimation;
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
type withSpringType = (
|
|
99
|
+
toValue: number,
|
|
100
|
+
userConfig?: SpringConfig,
|
|
101
|
+
callback?: AnimationStateCallback,
|
|
102
|
+
) => number;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Internal numeric spring forked from Reanimated's `withSpring`.
|
|
106
|
+
*
|
|
107
|
+
* As of version 4.4, Reanimated resets the spring velocity to zero whenever it
|
|
108
|
+
* initially points away from the target (see
|
|
109
|
+
* https://github.com/software-mansion/react-native-reanimated/pull/9463).
|
|
110
|
+
* That's a reasonable fix for stale inherited velocity in Reanimated's public
|
|
111
|
+
* spring behavior, but our gesture release handoff relies on that
|
|
112
|
+
* away-from-target velocity on purpose. It's what preserves the visual
|
|
113
|
+
* dismissal tail controlled by `gestureReleaseVelocityScale`.
|
|
114
|
+
*
|
|
115
|
+
* We went with this fork rather than trying to recreate the velocity scale
|
|
116
|
+
* outside the spring, since that approach pushed too much state and timing
|
|
117
|
+
* logic into the transition layer, bloated the code, and made the handoff
|
|
118
|
+
* easier to get subtly wrong. Keeping the fork lets screen transitions hold on
|
|
119
|
+
* to the native spring handoff behavior while keeping our own surface small and
|
|
120
|
+
* easy to extend with callbacks tailored to the transition lifecycle.
|
|
121
|
+
*/
|
|
122
|
+
export const withInternalSpring = ((
|
|
123
|
+
toValue: number,
|
|
124
|
+
userConfig?: SpringConfig,
|
|
125
|
+
callback?: AnimationStateCallback,
|
|
126
|
+
): Animation<SpringAnimation> => {
|
|
127
|
+
"worklet";
|
|
128
|
+
|
|
129
|
+
return defineSpringAnimation<SpringAnimation>(toValue, () => {
|
|
130
|
+
"worklet";
|
|
131
|
+
const config: DefaultSpringConfig & SpringConfigInner = safeMergeConfigs<
|
|
132
|
+
DefaultSpringConfig & SpringConfigInner
|
|
133
|
+
>(
|
|
134
|
+
{
|
|
135
|
+
...DEFAULT_SPRING_CONFIG,
|
|
136
|
+
useDuration: !!(userConfig?.duration || userConfig?.dampingRatio),
|
|
137
|
+
skipAnimation: false,
|
|
138
|
+
settleDistance: DEFAULT_SPRING_SETTLE_DISTANCE,
|
|
139
|
+
},
|
|
140
|
+
userConfig,
|
|
141
|
+
);
|
|
142
|
+
|
|
143
|
+
let settled = false;
|
|
144
|
+
|
|
145
|
+
const updateSettled = (animation: SpringAnimation) => {
|
|
146
|
+
"worklet";
|
|
147
|
+
if (settled) {
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
if (!isAnimationSettledCalculation(animation, config)) {
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
settled = true;
|
|
156
|
+
animation.settled = true;
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
config.skipAnimation = !checkIfConfigIsValid(config);
|
|
160
|
+
|
|
161
|
+
if (config.duration === 0) {
|
|
162
|
+
config.skipAnimation = true;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
function springOnFrame(
|
|
166
|
+
animation: InnerSpringAnimation,
|
|
167
|
+
now: Timestamp,
|
|
168
|
+
): boolean {
|
|
169
|
+
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
170
|
+
const { toValue, current } = animation;
|
|
171
|
+
|
|
172
|
+
if (config.skipAnimation) {
|
|
173
|
+
animation.current = toValue;
|
|
174
|
+
animation.lastTimestamp = 0;
|
|
175
|
+
return true;
|
|
176
|
+
}
|
|
177
|
+
const { lastTimestamp, velocity } = animation;
|
|
178
|
+
|
|
179
|
+
const deltaTime = Math.min(Math.max(now - lastTimestamp, 0), 64);
|
|
180
|
+
animation.lastTimestamp = now;
|
|
181
|
+
|
|
182
|
+
const t = deltaTime / 1000;
|
|
183
|
+
const v0 = velocity as number;
|
|
184
|
+
const x0 = current - toValue;
|
|
185
|
+
|
|
186
|
+
const { zeta, omega0, omega1 } = animation;
|
|
187
|
+
|
|
188
|
+
const { position: newPosition, velocity: newVelocity } =
|
|
189
|
+
zeta < 1
|
|
190
|
+
? underDampedSpringCalculations(animation, {
|
|
191
|
+
zeta,
|
|
192
|
+
v0,
|
|
193
|
+
x0,
|
|
194
|
+
omega0,
|
|
195
|
+
omega1,
|
|
196
|
+
t,
|
|
197
|
+
})
|
|
198
|
+
: criticallyDampedSpringCalculations(animation, {
|
|
199
|
+
v0,
|
|
200
|
+
x0,
|
|
201
|
+
omega0,
|
|
202
|
+
t,
|
|
203
|
+
});
|
|
204
|
+
|
|
205
|
+
animation.current = newPosition;
|
|
206
|
+
animation.velocity = newVelocity;
|
|
207
|
+
|
|
208
|
+
if (isAnimationTerminatingCalculation(animation, config)) {
|
|
209
|
+
animation.velocity = 0;
|
|
210
|
+
animation.current = toValue;
|
|
211
|
+
settled = true;
|
|
212
|
+
animation.settled = true;
|
|
213
|
+
// clear lastTimestamp to avoid using stale value by the next spring animation that starts after this one
|
|
214
|
+
animation.lastTimestamp = 0;
|
|
215
|
+
return true;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
updateSettled(animation);
|
|
219
|
+
|
|
220
|
+
return false;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
function isTriggeredTwice(
|
|
224
|
+
previousAnimation: SpringAnimation | undefined,
|
|
225
|
+
animation: SpringAnimation,
|
|
226
|
+
) {
|
|
227
|
+
return (
|
|
228
|
+
previousAnimation?.lastTimestamp &&
|
|
229
|
+
previousAnimation?.startTimestamp &&
|
|
230
|
+
previousAnimation?.toValue === animation.toValue &&
|
|
231
|
+
previousAnimation?.duration === animation.duration &&
|
|
232
|
+
previousAnimation?.dampingRatio === animation.dampingRatio
|
|
233
|
+
);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
function onStart(
|
|
237
|
+
animation: SpringAnimation,
|
|
238
|
+
value: number,
|
|
239
|
+
now: Timestamp,
|
|
240
|
+
previousAnimation: SpringAnimation | undefined,
|
|
241
|
+
): void {
|
|
242
|
+
animation.current = value;
|
|
243
|
+
|
|
244
|
+
let stiffness = config.stiffness;
|
|
245
|
+
const triggeredTwice = isTriggeredTwice(previousAnimation, animation);
|
|
246
|
+
|
|
247
|
+
const duration = config.duration;
|
|
248
|
+
|
|
249
|
+
const x0 = triggeredTwice
|
|
250
|
+
? // If animation is triggered twice we want to continue the previous animation
|
|
251
|
+
// form the previous starting point
|
|
252
|
+
(previousAnimation?.startValue as number)
|
|
253
|
+
: value - (animation.toValue as number);
|
|
254
|
+
|
|
255
|
+
animation.startValue = x0;
|
|
256
|
+
|
|
257
|
+
if (previousAnimation) {
|
|
258
|
+
animation.velocity =
|
|
259
|
+
(triggeredTwice
|
|
260
|
+
? previousAnimation?.velocity
|
|
261
|
+
: previousAnimation?.velocity + config.velocity) || 0;
|
|
262
|
+
} else {
|
|
263
|
+
animation.velocity = config.velocity || 0;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
if (triggeredTwice) {
|
|
267
|
+
animation.zeta = previousAnimation?.zeta || 0;
|
|
268
|
+
animation.omega0 = previousAnimation?.omega0 || 0;
|
|
269
|
+
animation.omega1 = previousAnimation?.omega1 || 0;
|
|
270
|
+
} else {
|
|
271
|
+
if (config.useDuration) {
|
|
272
|
+
const actualDuration = triggeredTwice
|
|
273
|
+
? // If animation is triggered twice we want to continue the previous animation
|
|
274
|
+
// so we need to include the time that already elapsed
|
|
275
|
+
duration -
|
|
276
|
+
((previousAnimation?.lastTimestamp || 0) -
|
|
277
|
+
(previousAnimation?.startTimestamp || 0))
|
|
278
|
+
: duration;
|
|
279
|
+
|
|
280
|
+
config.duration = actualDuration;
|
|
281
|
+
stiffness = calculateNewStiffnessToMatchDuration(
|
|
282
|
+
x0,
|
|
283
|
+
config,
|
|
284
|
+
animation.velocity,
|
|
285
|
+
);
|
|
286
|
+
config.stiffness = stiffness;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
const { zeta, omega0, omega1 } = initialCalculations(stiffness, config);
|
|
290
|
+
animation.zeta = zeta;
|
|
291
|
+
animation.omega0 = omega0;
|
|
292
|
+
animation.omega1 = omega1;
|
|
293
|
+
|
|
294
|
+
if (config.clamp !== undefined) {
|
|
295
|
+
animation.zeta = scaleZetaToMatchClamps(animation, config.clamp);
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
const initialEnergy = getEnergy(
|
|
300
|
+
x0,
|
|
301
|
+
config.velocity,
|
|
302
|
+
config.stiffness,
|
|
303
|
+
config.mass,
|
|
304
|
+
);
|
|
305
|
+
animation.initialEnergy = initialEnergy;
|
|
306
|
+
|
|
307
|
+
animation.lastTimestamp = previousAnimation?.lastTimestamp || now;
|
|
308
|
+
|
|
309
|
+
animation.startTimestamp = triggeredTwice
|
|
310
|
+
? previousAnimation?.startTimestamp || now
|
|
311
|
+
: now;
|
|
312
|
+
|
|
313
|
+
updateSettled(animation);
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
const animation = {
|
|
317
|
+
onFrame: springOnFrame,
|
|
318
|
+
onStart,
|
|
319
|
+
toValue,
|
|
320
|
+
velocity: config.velocity || 0,
|
|
321
|
+
current: toValue,
|
|
322
|
+
settled: false,
|
|
323
|
+
startValue: 0,
|
|
324
|
+
callback: ((finished?: boolean) => {
|
|
325
|
+
"worklet";
|
|
326
|
+
const didFinish = finished === true;
|
|
327
|
+
callback?.({
|
|
328
|
+
finished: didFinish,
|
|
329
|
+
settled: didFinish || settled,
|
|
330
|
+
});
|
|
331
|
+
}) as AnimationCallback,
|
|
332
|
+
lastTimestamp: 0,
|
|
333
|
+
startTimestamp: 0,
|
|
334
|
+
zeta: 0,
|
|
335
|
+
omega0: 0,
|
|
336
|
+
omega1: 0,
|
|
337
|
+
initialEnergy: 0,
|
|
338
|
+
reduceMotion: getReduceMotionForAnimation(config.reduceMotion),
|
|
339
|
+
} as SpringAnimation;
|
|
340
|
+
|
|
341
|
+
return animation;
|
|
342
|
+
});
|
|
343
|
+
}) as unknown as withSpringType;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { ReduceMotion } from "react-native-reanimated";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Internal spring animation configuration.
|
|
5
|
+
*
|
|
6
|
+
* @param mass - The weight of the spring. Reducing this value makes the
|
|
7
|
+
* animation faster.
|
|
8
|
+
* @param damping - How quickly a spring slows down. Higher damping means the
|
|
9
|
+
* spring will come to rest faster.
|
|
10
|
+
* @param stiffness - How bouncy the spring is.
|
|
11
|
+
* @param duration - Perceptual duration of the animation in milliseconds.
|
|
12
|
+
* Actual duration is 1.5 times the value of perceptual duration.
|
|
13
|
+
* @param dampingRatio - How damped the spring is. Value `1` means the spring is
|
|
14
|
+
* critically damped, value `<1` means the spring is underdamped and value
|
|
15
|
+
* `>1` means the spring is overdamped.
|
|
16
|
+
* @param velocity - Initial velocity applied to the spring equation.
|
|
17
|
+
* @param overshootClamping - Whether a spring can bounce over the `toValue`.
|
|
18
|
+
* @param energyThreshold - Relative energy threshold below which the spring
|
|
19
|
+
* will snap to `toValue` without further oscillations.
|
|
20
|
+
* @param reduceMotion - Optional reduced-motion override. `ReduceMotion.Always`
|
|
21
|
+
* finishes immediately, `ReduceMotion.Never` runs normally, and
|
|
22
|
+
* `ReduceMotion.System` is treated like the default in this internal fork.
|
|
23
|
+
* @see https://docs.swmansion.com/react-native-reanimated/docs/animations/withSpring/#config-
|
|
24
|
+
*/
|
|
25
|
+
export type SpringConfig = {
|
|
26
|
+
mass?: number;
|
|
27
|
+
overshootClamping?: boolean;
|
|
28
|
+
energyThreshold?: number;
|
|
29
|
+
velocity?: number;
|
|
30
|
+
reduceMotion?: ReduceMotion;
|
|
31
|
+
} & (
|
|
32
|
+
| {
|
|
33
|
+
stiffness?: number;
|
|
34
|
+
damping?: number;
|
|
35
|
+
duration?: never;
|
|
36
|
+
dampingRatio?: never;
|
|
37
|
+
clamp?: never;
|
|
38
|
+
}
|
|
39
|
+
| {
|
|
40
|
+
stiffness?: never;
|
|
41
|
+
damping?: never;
|
|
42
|
+
duration?: number;
|
|
43
|
+
dampingRatio?: number;
|
|
44
|
+
clamp?: { min?: number; max?: number };
|
|
45
|
+
}
|
|
46
|
+
);
|