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.
Files changed (643) hide show
  1. package/lib/commonjs/blank-stack/components/stack-view.js +2 -2
  2. package/lib/commonjs/blank-stack/components/stack-view.js.map +1 -1
  3. package/lib/commonjs/component-stack/components/stack-view.js +2 -2
  4. package/lib/commonjs/component-stack/components/stack-view.js.map +1 -1
  5. package/lib/commonjs/shared/adapters/with-screen-transitions/options.js +37 -9
  6. package/lib/commonjs/shared/adapters/with-screen-transitions/options.js.map +1 -1
  7. package/lib/commonjs/shared/adapters/with-screen-transitions/stack-layout.js +1 -10
  8. package/lib/commonjs/shared/adapters/with-screen-transitions/stack-layout.js.map +1 -1
  9. package/lib/commonjs/shared/components/overlay/variations/float-overlay.js +1 -3
  10. package/lib/commonjs/shared/components/overlay/variations/float-overlay.js.map +1 -1
  11. package/lib/commonjs/shared/components/scene-view.js +1 -1
  12. package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-close-transition-intent.js +7 -7
  13. package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-close-transition-intent.js.map +1 -1
  14. package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-transition-start-controller.js +2 -2
  15. package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-transition-start-controller.js.map +1 -1
  16. package/lib/commonjs/shared/components/screen-lifecycle/index.js +2 -2
  17. package/lib/commonjs/shared/components/screen-lifecycle/index.js.map +1 -1
  18. package/lib/commonjs/shared/constants.js +3 -13
  19. package/lib/commonjs/shared/constants.js.map +1 -1
  20. package/lib/commonjs/shared/hooks/navigation/use-screen-state.js +1 -3
  21. package/lib/commonjs/shared/hooks/navigation/use-screen-state.js.map +1 -1
  22. package/lib/commonjs/shared/hooks/navigation/use-stack.js.map +1 -1
  23. package/lib/commonjs/shared/providers/screen/animation/helpers/accessors/use-build-transition-accessor.js +15 -12
  24. package/lib/commonjs/shared/providers/screen/animation/helpers/accessors/use-build-transition-accessor.js.map +1 -1
  25. package/lib/commonjs/shared/providers/screen/animation/helpers/build-screen-transition-options.js +2 -6
  26. package/lib/commonjs/shared/providers/screen/animation/helpers/build-screen-transition-options.js.map +1 -1
  27. package/lib/commonjs/shared/providers/screen/animation/helpers/hydrate-transition-state/gesture-progress.js.map +1 -1
  28. package/lib/commonjs/shared/providers/screen/animation/helpers/hydrate-transition-state/index.js +6 -23
  29. package/lib/commonjs/shared/providers/screen/animation/helpers/hydrate-transition-state/index.js.map +1 -1
  30. package/lib/commonjs/shared/providers/screen/animation/helpers/pipeline.js +1 -1
  31. package/lib/commonjs/shared/providers/screen/animation/helpers/pipeline.js.map +1 -1
  32. package/lib/commonjs/shared/providers/screen/animation/helpers/selected-interpolator-options.js +14 -1
  33. package/lib/commonjs/shared/providers/screen/animation/helpers/selected-interpolator-options.js.map +1 -1
  34. package/lib/commonjs/shared/providers/screen/animation/helpers/use-build-transition-state.js +1 -1
  35. package/lib/commonjs/shared/providers/screen/animation/helpers/use-build-transition-state.js.map +1 -1
  36. package/lib/commonjs/shared/providers/screen/gestures/gestures.provider.js +21 -8
  37. package/lib/commonjs/shared/providers/screen/gestures/gestures.provider.js.map +1 -1
  38. package/lib/commonjs/shared/providers/screen/gestures/ownership/compute-claimed-directions.js +2 -1
  39. package/lib/commonjs/shared/providers/screen/gestures/ownership/compute-claimed-directions.js.map +1 -1
  40. package/lib/commonjs/shared/providers/screen/gestures/pan/{pan-activation-decision.js → activation/pan-activation-decision.js} +5 -5
  41. package/lib/commonjs/shared/providers/screen/gestures/pan/activation/pan-activation-decision.js.map +1 -0
  42. package/lib/commonjs/shared/providers/screen/gestures/pan/{pan-activation-rules.js → activation/pan-activation-rules.js} +12 -9
  43. package/lib/commonjs/shared/providers/screen/gestures/pan/activation/pan-activation-rules.js.map +1 -0
  44. package/lib/commonjs/shared/providers/screen/gestures/pan/{pan-activation.js → activation/use-pan-activation.js} +15 -10
  45. package/lib/commonjs/shared/providers/screen/gestures/pan/activation/use-pan-activation.js.map +1 -0
  46. package/lib/commonjs/shared/providers/screen/gestures/pan/{pan-lifecycle.js → behavior/pan-lifecycle.js} +29 -8
  47. package/lib/commonjs/shared/providers/screen/gestures/pan/behavior/pan-lifecycle.js.map +1 -0
  48. package/lib/commonjs/shared/providers/screen/gestures/pan/{pan-release.js → behavior/pan-release.js} +5 -5
  49. package/lib/commonjs/shared/providers/screen/gestures/pan/behavior/pan-release.js.map +1 -0
  50. package/lib/commonjs/shared/providers/screen/gestures/pan/{pan-reset.js → behavior/pan-reset.js} +21 -11
  51. package/lib/commonjs/shared/providers/screen/gestures/pan/behavior/pan-reset.js.map +1 -0
  52. package/lib/commonjs/shared/providers/screen/gestures/pan/{use-pan-behavior.js → behavior/use-pan-behavior.js} +34 -8
  53. package/lib/commonjs/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.js.map +1 -0
  54. package/lib/commonjs/shared/providers/screen/gestures/pan/{build-pan-gesture.js → use-build-pan-gesture.js} +10 -8
  55. package/lib/commonjs/shared/providers/screen/gestures/pan/use-build-pan-gesture.js.map +1 -0
  56. package/lib/commonjs/shared/providers/screen/gestures/pinch/{pinch-activation.js → activation/use-pinch-activation.js} +12 -5
  57. package/lib/commonjs/shared/providers/screen/gestures/pinch/activation/use-pinch-activation.js.map +1 -0
  58. package/lib/commonjs/shared/providers/screen/gestures/pinch/{pinch-lifecycle.js → behavior/pinch-lifecycle.js} +7 -7
  59. package/lib/commonjs/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.js.map +1 -0
  60. package/lib/commonjs/shared/providers/screen/gestures/pinch/{pinch-release.js → behavior/pinch-release.js} +4 -4
  61. package/lib/commonjs/shared/providers/screen/gestures/pinch/behavior/pinch-release.js.map +1 -0
  62. package/lib/commonjs/shared/providers/screen/gestures/pinch/{pinch-reset.js → behavior/pinch-reset.js} +6 -3
  63. package/lib/commonjs/shared/providers/screen/gestures/pinch/behavior/pinch-reset.js.map +1 -0
  64. package/lib/commonjs/shared/providers/screen/gestures/pinch/{use-pinch-behavior.js → behavior/use-pinch-behavior.js} +6 -5
  65. package/lib/commonjs/shared/providers/screen/gestures/pinch/behavior/use-pinch-behavior.js.map +1 -0
  66. package/lib/commonjs/shared/providers/screen/gestures/pinch/{build-pinch-gesture.js → use-build-pinch-gesture.js} +9 -7
  67. package/lib/commonjs/shared/providers/screen/gestures/pinch/use-build-pinch-gesture.js.map +1 -0
  68. package/lib/commonjs/shared/providers/screen/gestures/rotation/activation/use-rotation-activation.js +62 -0
  69. package/lib/commonjs/shared/providers/screen/gestures/rotation/activation/use-rotation-activation.js.map +1 -0
  70. package/lib/commonjs/shared/providers/screen/gestures/rotation/behavior/rotation-lifecycle.js +21 -0
  71. package/lib/commonjs/shared/providers/screen/gestures/rotation/behavior/rotation-lifecycle.js.map +1 -0
  72. package/lib/commonjs/shared/providers/screen/gestures/rotation/behavior/use-rotation-behavior.js +29 -0
  73. package/lib/commonjs/shared/providers/screen/gestures/rotation/behavior/use-rotation-behavior.js.map +1 -0
  74. package/lib/commonjs/shared/providers/screen/gestures/rotation/use-build-rotation-gesture.js +45 -0
  75. package/lib/commonjs/shared/providers/screen/gestures/rotation/use-build-rotation-gesture.js.map +1 -0
  76. package/lib/commonjs/shared/providers/screen/gestures/shared/directions.js +17 -5
  77. package/lib/commonjs/shared/providers/screen/gestures/shared/directions.js.map +1 -1
  78. package/lib/commonjs/shared/providers/screen/gestures/shared/policy.js +67 -2
  79. package/lib/commonjs/shared/providers/screen/gestures/shared/policy.js.map +1 -1
  80. package/lib/commonjs/shared/providers/screen/gestures/shared/reset.js +3 -12
  81. package/lib/commonjs/shared/providers/screen/gestures/shared/reset.js.map +1 -1
  82. package/lib/commonjs/shared/providers/screen/gestures/shared/runtime.js +1 -10
  83. package/lib/commonjs/shared/providers/screen/gestures/shared/runtime.js.map +1 -1
  84. package/lib/commonjs/shared/providers/screen/gestures/shared/snap-points.js +1 -1
  85. package/lib/commonjs/shared/providers/screen/gestures/shared/snap-points.js.map +1 -1
  86. package/lib/commonjs/shared/providers/screen/gestures/types.js +2 -0
  87. package/lib/commonjs/shared/providers/screen/gestures/types.js.map +1 -1
  88. package/lib/commonjs/shared/providers/screen/options/helpers.js +60 -24
  89. package/lib/commonjs/shared/providers/screen/options/helpers.js.map +1 -1
  90. package/lib/commonjs/shared/providers/screen/styles/components/{maybe-floating-container.js → floating-overlay-layer.js} +5 -5
  91. package/lib/commonjs/shared/providers/screen/styles/components/floating-overlay-layer.js.map +1 -0
  92. package/lib/commonjs/shared/providers/screen/styles/styles.provider.js +3 -3
  93. package/lib/commonjs/shared/providers/screen/styles/styles.provider.js.map +1 -1
  94. package/lib/commonjs/shared/providers/stack/{helpers/managed-stack-state/managed-stack-controller.js → blank-stack-state/blank-stack-controller.js} +11 -11
  95. package/lib/commonjs/shared/providers/stack/blank-stack-state/blank-stack-controller.js.map +1 -0
  96. 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
  97. package/lib/commonjs/shared/providers/stack/blank-stack-state/helpers/build-blank-stack-state.js.map +1 -0
  98. package/lib/commonjs/shared/providers/stack/blank-stack-state/helpers/derive-blank-stack-state.js +58 -0
  99. package/lib/commonjs/shared/providers/stack/blank-stack-state/helpers/derive-blank-stack-state.js.map +1 -0
  100. package/lib/commonjs/shared/providers/stack/blank-stack-state/helpers/navigation/compose-descriptors.js.map +1 -0
  101. package/lib/commonjs/shared/providers/stack/blank-stack-state/helpers/navigation/resolve-scene-neighbors.js.map +1 -0
  102. package/lib/commonjs/shared/{utils → providers/stack/blank-stack-state/helpers}/navigation/sync-routes-with-removed.js +6 -23
  103. package/lib/commonjs/shared/providers/stack/blank-stack-state/helpers/navigation/sync-routes-with-removed.js.map +1 -0
  104. 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
  105. 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
  106. package/lib/commonjs/shared/providers/stack/{helpers/managed-stack-state/helpers/helpers.js → blank-stack-state/helpers/state-equality.js} +1 -1
  107. package/lib/commonjs/shared/providers/stack/blank-stack-state/helpers/state-equality.js.map +1 -0
  108. package/lib/commonjs/shared/providers/stack/blank-stack-state/helpers/types.js.map +1 -0
  109. package/lib/commonjs/shared/providers/stack/{helpers/managed-stack-state → blank-stack-state}/index.js +5 -5
  110. package/lib/commonjs/shared/providers/stack/blank-stack-state/index.js.map +1 -0
  111. package/lib/commonjs/shared/providers/stack/{managed.provider.js → blank-stack.provider.js} +20 -27
  112. package/lib/commonjs/shared/providers/stack/blank-stack.provider.js.map +1 -0
  113. package/lib/commonjs/shared/providers/stack/direct.provider.js +3 -13
  114. package/lib/commonjs/shared/providers/stack/direct.provider.js.map +1 -1
  115. package/lib/commonjs/shared/stores/animation.store.js +2 -0
  116. package/lib/commonjs/shared/stores/animation.store.js.map +1 -1
  117. package/lib/commonjs/shared/stores/gesture.store.js +5 -1
  118. package/lib/commonjs/shared/stores/gesture.store.js.map +1 -1
  119. package/lib/commonjs/shared/stores/system.store.js +1 -4
  120. package/lib/commonjs/shared/stores/system.store.js.map +1 -1
  121. package/lib/commonjs/shared/types/animation.types.js.map +1 -1
  122. package/lib/commonjs/shared/types/gesture.types.js.map +1 -1
  123. package/lib/commonjs/shared/types/providers/blank-stack-provider.types.js +6 -0
  124. package/lib/commonjs/shared/types/providers/blank-stack-provider.types.js.map +1 -0
  125. package/lib/commonjs/shared/utils/animation/animate-to-progress.js +10 -4
  126. package/lib/commonjs/shared/utils/animation/animate-to-progress.js.map +1 -1
  127. package/lib/commonjs/shared/utils/animation/animate.js +22 -5
  128. package/lib/commonjs/shared/utils/animation/animate.js.map +1 -1
  129. package/lib/commonjs/shared/utils/animation/spring/index.js +13 -0
  130. package/lib/commonjs/shared/utils/animation/spring/index.js.map +1 -0
  131. package/lib/commonjs/shared/utils/animation/spring/spring.js +244 -0
  132. package/lib/commonjs/shared/utils/animation/spring/spring.js.map +1 -0
  133. package/lib/commonjs/shared/{types/providers/managed-stack.types.js → utils/animation/spring/springConfigs.js} +1 -1
  134. package/lib/commonjs/shared/utils/animation/spring/springConfigs.js.map +1 -0
  135. package/lib/commonjs/shared/utils/animation/spring/springUtils.js +313 -0
  136. package/lib/commonjs/shared/utils/animation/spring/springUtils.js.map +1 -0
  137. package/lib/commonjs/shared/utils/animation/state.js +2 -0
  138. package/lib/commonjs/shared/utils/animation/state.js.map +1 -0
  139. package/lib/commonjs/shared/utils/bounds/navigation/reveal/build.js +5 -5
  140. package/lib/commonjs/shared/utils/bounds/navigation/reveal/build.js.map +1 -1
  141. package/lib/commonjs/shared/utils/bounds/navigation/zoom/build.js +4 -4
  142. package/lib/commonjs/shared/utils/bounds/navigation/zoom/build.js.map +1 -1
  143. package/lib/module/blank-stack/components/stack-view.js +2 -2
  144. package/lib/module/blank-stack/components/stack-view.js.map +1 -1
  145. package/lib/module/component-stack/components/stack-view.js +2 -2
  146. package/lib/module/component-stack/components/stack-view.js.map +1 -1
  147. package/lib/module/shared/adapters/with-screen-transitions/options.js +37 -9
  148. package/lib/module/shared/adapters/with-screen-transitions/options.js.map +1 -1
  149. package/lib/module/shared/adapters/with-screen-transitions/stack-layout.js +1 -10
  150. package/lib/module/shared/adapters/with-screen-transitions/stack-layout.js.map +1 -1
  151. package/lib/module/shared/components/overlay/variations/float-overlay.js +1 -3
  152. package/lib/module/shared/components/overlay/variations/float-overlay.js.map +1 -1
  153. package/lib/module/shared/components/scene-view.js +1 -1
  154. package/lib/module/shared/components/screen-lifecycle/hooks/use-close-transition-intent.js +7 -7
  155. package/lib/module/shared/components/screen-lifecycle/hooks/use-close-transition-intent.js.map +1 -1
  156. package/lib/module/shared/components/screen-lifecycle/hooks/use-transition-start-controller.js +2 -2
  157. package/lib/module/shared/components/screen-lifecycle/hooks/use-transition-start-controller.js.map +1 -1
  158. package/lib/module/shared/components/screen-lifecycle/index.js +2 -2
  159. package/lib/module/shared/components/screen-lifecycle/index.js.map +1 -1
  160. package/lib/module/shared/constants.js +2 -12
  161. package/lib/module/shared/constants.js.map +1 -1
  162. package/lib/module/shared/hooks/navigation/use-screen-state.js +1 -3
  163. package/lib/module/shared/hooks/navigation/use-screen-state.js.map +1 -1
  164. package/lib/module/shared/hooks/navigation/use-stack.js.map +1 -1
  165. package/lib/module/shared/providers/screen/animation/helpers/accessors/use-build-transition-accessor.js +15 -12
  166. package/lib/module/shared/providers/screen/animation/helpers/accessors/use-build-transition-accessor.js.map +1 -1
  167. package/lib/module/shared/providers/screen/animation/helpers/build-screen-transition-options.js +2 -6
  168. package/lib/module/shared/providers/screen/animation/helpers/build-screen-transition-options.js.map +1 -1
  169. package/lib/module/shared/providers/screen/animation/helpers/hydrate-transition-state/gesture-progress.js.map +1 -1
  170. package/lib/module/shared/providers/screen/animation/helpers/hydrate-transition-state/index.js +7 -24
  171. package/lib/module/shared/providers/screen/animation/helpers/hydrate-transition-state/index.js.map +1 -1
  172. package/lib/module/shared/providers/screen/animation/helpers/pipeline.js +1 -1
  173. package/lib/module/shared/providers/screen/animation/helpers/pipeline.js.map +1 -1
  174. package/lib/module/shared/providers/screen/animation/helpers/selected-interpolator-options.js +14 -1
  175. package/lib/module/shared/providers/screen/animation/helpers/selected-interpolator-options.js.map +1 -1
  176. package/lib/module/shared/providers/screen/animation/helpers/use-build-transition-state.js +1 -1
  177. package/lib/module/shared/providers/screen/animation/helpers/use-build-transition-state.js.map +1 -1
  178. package/lib/module/shared/providers/screen/gestures/gestures.provider.js +19 -6
  179. package/lib/module/shared/providers/screen/gestures/gestures.provider.js.map +1 -1
  180. package/lib/module/shared/providers/screen/gestures/ownership/compute-claimed-directions.js +2 -1
  181. package/lib/module/shared/providers/screen/gestures/ownership/compute-claimed-directions.js.map +1 -1
  182. package/lib/module/shared/providers/screen/gestures/pan/{pan-activation-decision.js → activation/pan-activation-decision.js} +5 -5
  183. package/lib/module/shared/providers/screen/gestures/pan/activation/pan-activation-decision.js.map +1 -0
  184. package/lib/module/shared/providers/screen/gestures/pan/{pan-activation-rules.js → activation/pan-activation-rules.js} +12 -9
  185. package/lib/module/shared/providers/screen/gestures/pan/activation/pan-activation-rules.js.map +1 -0
  186. package/lib/module/shared/providers/screen/gestures/pan/{pan-activation.js → activation/use-pan-activation.js} +15 -10
  187. package/lib/module/shared/providers/screen/gestures/pan/activation/use-pan-activation.js.map +1 -0
  188. package/lib/module/shared/providers/screen/gestures/pan/{pan-lifecycle.js → behavior/pan-lifecycle.js} +29 -8
  189. package/lib/module/shared/providers/screen/gestures/pan/behavior/pan-lifecycle.js.map +1 -0
  190. package/lib/module/shared/providers/screen/gestures/pan/{pan-release.js → behavior/pan-release.js} +5 -5
  191. package/lib/module/shared/providers/screen/gestures/pan/behavior/pan-release.js.map +1 -0
  192. package/lib/module/shared/providers/screen/gestures/pan/{pan-reset.js → behavior/pan-reset.js} +21 -11
  193. package/lib/module/shared/providers/screen/gestures/pan/behavior/pan-reset.js.map +1 -0
  194. package/lib/module/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.js +75 -0
  195. package/lib/module/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.js.map +1 -0
  196. package/lib/module/shared/providers/screen/gestures/pan/{build-pan-gesture.js → use-build-pan-gesture.js} +9 -7
  197. package/lib/module/shared/providers/screen/gestures/pan/use-build-pan-gesture.js.map +1 -0
  198. package/lib/module/shared/providers/screen/gestures/pinch/{pinch-activation.js → activation/use-pinch-activation.js} +12 -5
  199. package/lib/module/shared/providers/screen/gestures/pinch/activation/use-pinch-activation.js.map +1 -0
  200. package/lib/module/shared/providers/screen/gestures/pinch/{pinch-lifecycle.js → behavior/pinch-lifecycle.js} +7 -7
  201. package/lib/module/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.js.map +1 -0
  202. package/lib/module/shared/providers/screen/gestures/pinch/{pinch-release.js → behavior/pinch-release.js} +4 -4
  203. package/lib/module/shared/providers/screen/gestures/pinch/behavior/pinch-release.js.map +1 -0
  204. package/lib/module/shared/providers/screen/gestures/pinch/{pinch-reset.js → behavior/pinch-reset.js} +6 -3
  205. package/lib/module/shared/providers/screen/gestures/pinch/behavior/pinch-reset.js.map +1 -0
  206. package/lib/module/shared/providers/screen/gestures/pinch/{use-pinch-behavior.js → behavior/use-pinch-behavior.js} +6 -5
  207. package/lib/module/shared/providers/screen/gestures/pinch/behavior/use-pinch-behavior.js.map +1 -0
  208. package/lib/module/shared/providers/screen/gestures/pinch/{build-pinch-gesture.js → use-build-pinch-gesture.js} +8 -6
  209. package/lib/module/shared/providers/screen/gestures/pinch/use-build-pinch-gesture.js.map +1 -0
  210. package/lib/module/shared/providers/screen/gestures/rotation/activation/use-rotation-activation.js +57 -0
  211. package/lib/module/shared/providers/screen/gestures/rotation/activation/use-rotation-activation.js.map +1 -0
  212. package/lib/module/shared/providers/screen/gestures/rotation/behavior/rotation-lifecycle.js +15 -0
  213. package/lib/module/shared/providers/screen/gestures/rotation/behavior/rotation-lifecycle.js.map +1 -0
  214. package/lib/module/shared/providers/screen/gestures/rotation/behavior/use-rotation-behavior.js +24 -0
  215. package/lib/module/shared/providers/screen/gestures/rotation/behavior/use-rotation-behavior.js.map +1 -0
  216. package/lib/module/shared/providers/screen/gestures/rotation/use-build-rotation-gesture.js +40 -0
  217. package/lib/module/shared/providers/screen/gestures/rotation/use-build-rotation-gesture.js.map +1 -0
  218. package/lib/module/shared/providers/screen/gestures/shared/directions.js +14 -4
  219. package/lib/module/shared/providers/screen/gestures/shared/directions.js.map +1 -1
  220. package/lib/module/shared/providers/screen/gestures/shared/policy.js +68 -3
  221. package/lib/module/shared/providers/screen/gestures/shared/policy.js.map +1 -1
  222. package/lib/module/shared/providers/screen/gestures/shared/reset.js +4 -13
  223. package/lib/module/shared/providers/screen/gestures/shared/reset.js.map +1 -1
  224. package/lib/module/shared/providers/screen/gestures/shared/runtime.js +1 -10
  225. package/lib/module/shared/providers/screen/gestures/shared/runtime.js.map +1 -1
  226. package/lib/module/shared/providers/screen/gestures/shared/snap-points.js +1 -1
  227. package/lib/module/shared/providers/screen/gestures/shared/snap-points.js.map +1 -1
  228. package/lib/module/shared/providers/screen/gestures/types.js +2 -0
  229. package/lib/module/shared/providers/screen/gestures/types.js.map +1 -1
  230. package/lib/module/shared/providers/screen/options/helpers.js +60 -24
  231. package/lib/module/shared/providers/screen/options/helpers.js.map +1 -1
  232. package/lib/module/shared/providers/screen/styles/components/{maybe-floating-container.js → floating-overlay-layer.js} +4 -4
  233. package/lib/module/shared/providers/screen/styles/components/floating-overlay-layer.js.map +1 -0
  234. package/lib/module/shared/providers/screen/styles/styles.provider.js +3 -3
  235. package/lib/module/shared/providers/screen/styles/styles.provider.js.map +1 -1
  236. package/lib/module/shared/providers/stack/{helpers/managed-stack-state/managed-stack-controller.js → blank-stack-state/blank-stack-controller.js} +9 -9
  237. package/lib/module/shared/providers/stack/blank-stack-state/blank-stack-controller.js.map +1 -0
  238. 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
  239. package/lib/module/shared/providers/stack/blank-stack-state/helpers/build-blank-stack-state.js.map +1 -0
  240. 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
  241. package/lib/module/shared/providers/stack/blank-stack-state/helpers/derive-blank-stack-state.js.map +1 -0
  242. package/lib/module/shared/providers/stack/blank-stack-state/helpers/navigation/compose-descriptors.js.map +1 -0
  243. package/lib/module/shared/providers/stack/blank-stack-state/helpers/navigation/resolve-scene-neighbors.js.map +1 -0
  244. package/lib/module/shared/{utils → providers/stack/blank-stack-state/helpers}/navigation/sync-routes-with-removed.js +6 -23
  245. package/lib/module/shared/providers/stack/blank-stack-state/helpers/navigation/sync-routes-with-removed.js.map +1 -0
  246. 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
  247. package/lib/module/shared/providers/stack/blank-stack-state/helpers/reconcile-blank-stack-routes.js.map +1 -0
  248. package/lib/module/shared/providers/stack/{helpers/managed-stack-state/helpers/helpers.js → blank-stack-state/helpers/state-equality.js} +1 -1
  249. package/lib/module/shared/providers/stack/blank-stack-state/helpers/state-equality.js.map +1 -0
  250. package/lib/module/shared/providers/stack/blank-stack-state/helpers/types.js.map +1 -0
  251. package/lib/module/shared/providers/stack/{helpers/managed-stack-state → blank-stack-state}/index.js +3 -3
  252. package/lib/module/shared/providers/stack/blank-stack-state/index.js.map +1 -0
  253. package/lib/module/shared/providers/stack/{managed.provider.js → blank-stack.provider.js} +19 -26
  254. package/lib/module/shared/providers/stack/blank-stack.provider.js.map +1 -0
  255. package/lib/module/shared/providers/stack/direct.provider.js +3 -13
  256. package/lib/module/shared/providers/stack/direct.provider.js.map +1 -1
  257. package/lib/module/shared/stores/animation.store.js +2 -0
  258. package/lib/module/shared/stores/animation.store.js.map +1 -1
  259. package/lib/module/shared/stores/gesture.store.js +5 -1
  260. package/lib/module/shared/stores/gesture.store.js.map +1 -1
  261. package/lib/module/shared/stores/system.store.js +1 -4
  262. package/lib/module/shared/stores/system.store.js.map +1 -1
  263. package/lib/module/shared/types/animation.types.js.map +1 -1
  264. package/lib/module/shared/types/gesture.types.js.map +1 -1
  265. package/lib/module/shared/types/providers/blank-stack-provider.types.js +4 -0
  266. package/lib/module/shared/types/providers/blank-stack-provider.types.js.map +1 -0
  267. package/lib/module/shared/utils/animation/animate-to-progress.js +11 -5
  268. package/lib/module/shared/utils/animation/animate-to-progress.js.map +1 -1
  269. package/lib/module/shared/utils/animation/animate.js +21 -5
  270. package/lib/module/shared/utils/animation/animate.js.map +1 -1
  271. package/lib/module/shared/utils/animation/spring/index.js +4 -0
  272. package/lib/module/shared/utils/animation/spring/index.js.map +1 -0
  273. package/lib/module/shared/utils/animation/spring/spring.js +239 -0
  274. package/lib/module/shared/utils/animation/spring/spring.js.map +1 -0
  275. package/lib/module/shared/utils/animation/spring/springConfigs.js +4 -0
  276. package/lib/module/shared/utils/animation/spring/springConfigs.js.map +1 -0
  277. package/lib/module/shared/utils/animation/spring/springUtils.js +300 -0
  278. package/lib/module/shared/utils/animation/spring/springUtils.js.map +1 -0
  279. package/lib/module/shared/utils/animation/state.js +2 -0
  280. package/lib/module/shared/utils/animation/state.js.map +1 -0
  281. package/lib/module/shared/utils/bounds/navigation/reveal/build.js +5 -5
  282. package/lib/module/shared/utils/bounds/navigation/reveal/build.js.map +1 -1
  283. package/lib/module/shared/utils/bounds/navigation/zoom/build.js +4 -4
  284. package/lib/module/shared/utils/bounds/navigation/zoom/build.js.map +1 -1
  285. package/lib/typescript/blank-stack/components/stack-view.d.ts +1 -1
  286. package/lib/typescript/blank-stack/components/stack-view.d.ts.map +1 -1
  287. package/lib/typescript/component-stack/components/stack-view.d.ts +1 -1
  288. package/lib/typescript/component-stack/components/stack-view.d.ts.map +1 -1
  289. package/lib/typescript/shared/adapters/with-screen-transitions/options.d.ts.map +1 -1
  290. package/lib/typescript/shared/adapters/with-screen-transitions/stack-layout.d.ts.map +1 -1
  291. package/lib/typescript/shared/components/overlay/variations/float-overlay.d.ts.map +1 -1
  292. package/lib/typescript/shared/components/scene-view.d.ts +1 -1
  293. package/lib/typescript/shared/components/screen-lifecycle/hooks/use-close-transition-intent.d.ts +1 -1
  294. package/lib/typescript/shared/components/screen-lifecycle/hooks/use-close-transition-intent.d.ts.map +1 -1
  295. package/lib/typescript/shared/components/screen-lifecycle/hooks/use-transition-start-controller.d.ts +2 -2
  296. package/lib/typescript/shared/components/screen-lifecycle/hooks/use-transition-start-controller.d.ts.map +1 -1
  297. package/lib/typescript/shared/constants.d.ts +0 -9
  298. package/lib/typescript/shared/constants.d.ts.map +1 -1
  299. package/lib/typescript/shared/hooks/navigation/use-screen-state.d.ts.map +1 -1
  300. package/lib/typescript/shared/hooks/navigation/use-stack.d.ts +0 -2
  301. package/lib/typescript/shared/hooks/navigation/use-stack.d.ts.map +1 -1
  302. package/lib/typescript/shared/index.d.ts +12 -12
  303. package/lib/typescript/shared/providers/screen/animation/helpers/accessors/use-build-transition-accessor.d.ts.map +1 -1
  304. package/lib/typescript/shared/providers/screen/animation/helpers/build-screen-transition-options.d.ts.map +1 -1
  305. package/lib/typescript/shared/providers/screen/animation/helpers/hydrate-transition-state/index.d.ts.map +1 -1
  306. package/lib/typescript/shared/providers/screen/animation/helpers/hydrate-transition-state/types.d.ts +1 -6
  307. package/lib/typescript/shared/providers/screen/animation/helpers/hydrate-transition-state/types.d.ts.map +1 -1
  308. package/lib/typescript/shared/providers/screen/animation/helpers/selected-interpolator-options.d.ts.map +1 -1
  309. package/lib/typescript/shared/providers/screen/animation/helpers/use-build-transition-state.d.ts +1 -1
  310. package/lib/typescript/shared/providers/screen/animation/helpers/use-build-transition-state.d.ts.map +1 -1
  311. package/lib/typescript/shared/providers/screen/gestures/gestures.provider.d.ts.map +1 -1
  312. package/lib/typescript/shared/providers/screen/gestures/ownership/compute-claimed-directions.d.ts +2 -2
  313. package/lib/typescript/shared/providers/screen/gestures/ownership/compute-claimed-directions.d.ts.map +1 -1
  314. package/lib/typescript/shared/providers/screen/gestures/pan/{pan-activation-decision.d.ts → activation/pan-activation-decision.d.ts} +3 -3
  315. package/lib/typescript/shared/providers/screen/gestures/pan/activation/pan-activation-decision.d.ts.map +1 -0
  316. package/lib/typescript/shared/providers/screen/gestures/pan/{pan-activation-rules.d.ts → activation/pan-activation-rules.d.ts} +11 -11
  317. package/lib/typescript/shared/providers/screen/gestures/pan/activation/pan-activation-rules.d.ts.map +1 -0
  318. package/lib/typescript/shared/providers/screen/gestures/pan/{pan-activation.d.ts → activation/use-pan-activation.d.ts} +5 -4
  319. package/lib/typescript/shared/providers/screen/gestures/pan/activation/use-pan-activation.d.ts.map +1 -0
  320. package/lib/typescript/shared/providers/screen/gestures/pan/{pan-lifecycle.d.ts → behavior/pan-lifecycle.d.ts} +3 -2
  321. package/lib/typescript/shared/providers/screen/gestures/pan/behavior/pan-lifecycle.d.ts.map +1 -0
  322. package/lib/typescript/shared/providers/screen/gestures/pan/{pan-release.d.ts → behavior/pan-release.d.ts} +1 -1
  323. package/lib/typescript/shared/providers/screen/gestures/pan/behavior/pan-release.d.ts.map +1 -0
  324. package/lib/typescript/shared/providers/screen/gestures/pan/{pan-reset.d.ts → behavior/pan-reset.d.ts} +4 -3
  325. package/lib/typescript/shared/providers/screen/gestures/pan/behavior/pan-reset.d.ts.map +1 -0
  326. package/lib/typescript/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.d.ts +5 -0
  327. package/lib/typescript/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.d.ts.map +1 -0
  328. package/lib/typescript/shared/providers/screen/gestures/pan/use-build-pan-gesture.d.ts +11 -0
  329. package/lib/typescript/shared/providers/screen/gestures/pan/use-build-pan-gesture.d.ts.map +1 -0
  330. package/lib/typescript/shared/providers/screen/gestures/pinch/{pinch-activation.d.ts → activation/use-pinch-activation.d.ts} +5 -4
  331. package/lib/typescript/shared/providers/screen/gestures/pinch/activation/use-pinch-activation.d.ts.map +1 -0
  332. package/lib/typescript/shared/providers/screen/gestures/pinch/{pinch-lifecycle.d.ts → behavior/pinch-lifecycle.d.ts} +1 -1
  333. package/lib/typescript/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.d.ts.map +1 -0
  334. package/lib/typescript/shared/providers/screen/gestures/pinch/{pinch-release.d.ts → behavior/pinch-release.d.ts} +1 -1
  335. package/lib/typescript/shared/providers/screen/gestures/pinch/behavior/pinch-release.d.ts.map +1 -0
  336. package/lib/typescript/shared/providers/screen/gestures/pinch/{pinch-reset.d.ts → behavior/pinch-reset.d.ts} +2 -2
  337. package/lib/typescript/shared/providers/screen/gestures/pinch/behavior/pinch-reset.d.ts.map +1 -0
  338. package/lib/typescript/shared/providers/screen/gestures/pinch/behavior/use-pinch-behavior.d.ts +5 -0
  339. package/lib/typescript/shared/providers/screen/gestures/pinch/behavior/use-pinch-behavior.d.ts.map +1 -0
  340. package/lib/typescript/shared/providers/screen/gestures/pinch/use-build-pinch-gesture.d.ts +9 -0
  341. package/lib/typescript/shared/providers/screen/gestures/pinch/use-build-pinch-gesture.d.ts.map +1 -0
  342. package/lib/typescript/shared/providers/screen/gestures/rotation/activation/use-rotation-activation.d.ts +15 -0
  343. package/lib/typescript/shared/providers/screen/gestures/rotation/activation/use-rotation-activation.d.ts.map +1 -0
  344. package/lib/typescript/shared/providers/screen/gestures/rotation/behavior/rotation-lifecycle.d.ts +4 -0
  345. package/lib/typescript/shared/providers/screen/gestures/rotation/behavior/rotation-lifecycle.d.ts.map +1 -0
  346. package/lib/typescript/shared/providers/screen/gestures/rotation/behavior/use-rotation-behavior.d.ts +5 -0
  347. package/lib/typescript/shared/providers/screen/gestures/rotation/behavior/use-rotation-behavior.d.ts.map +1 -0
  348. package/lib/typescript/shared/providers/screen/gestures/rotation/use-build-rotation-gesture.d.ts +9 -0
  349. package/lib/typescript/shared/providers/screen/gestures/rotation/use-build-rotation-gesture.d.ts.map +1 -0
  350. package/lib/typescript/shared/providers/screen/gestures/shared/directions.d.ts +8 -6
  351. package/lib/typescript/shared/providers/screen/gestures/shared/directions.d.ts.map +1 -1
  352. package/lib/typescript/shared/providers/screen/gestures/shared/policy.d.ts +2 -2
  353. package/lib/typescript/shared/providers/screen/gestures/shared/policy.d.ts.map +1 -1
  354. package/lib/typescript/shared/providers/screen/gestures/shared/reset.d.ts.map +1 -1
  355. package/lib/typescript/shared/providers/screen/gestures/shared/runtime.d.ts.map +1 -1
  356. package/lib/typescript/shared/providers/screen/gestures/types.d.ts +14 -4
  357. package/lib/typescript/shared/providers/screen/gestures/types.d.ts.map +1 -1
  358. package/lib/typescript/shared/providers/screen/options/helpers.d.ts +2 -2
  359. package/lib/typescript/shared/providers/screen/options/helpers.d.ts.map +1 -1
  360. package/lib/typescript/shared/providers/screen/options/types.d.ts +4 -3
  361. package/lib/typescript/shared/providers/screen/options/types.d.ts.map +1 -1
  362. package/lib/typescript/shared/providers/screen/styles/components/floating-overlay-layer.d.ts +7 -0
  363. package/lib/typescript/shared/providers/screen/styles/components/floating-overlay-layer.d.ts.map +1 -0
  364. package/lib/typescript/shared/providers/stack/blank-stack-state/blank-stack-controller.d.ts +13 -0
  365. package/lib/typescript/shared/providers/stack/blank-stack-state/blank-stack-controller.d.ts.map +1 -0
  366. package/lib/typescript/shared/providers/stack/blank-stack-state/helpers/build-blank-stack-state.d.ts +13 -0
  367. package/lib/typescript/shared/providers/stack/blank-stack-state/helpers/build-blank-stack-state.d.ts.map +1 -0
  368. package/lib/typescript/shared/providers/stack/blank-stack-state/helpers/derive-blank-stack-state.d.ts +12 -0
  369. package/lib/typescript/shared/providers/stack/blank-stack-state/helpers/derive-blank-stack-state.d.ts.map +1 -0
  370. package/lib/typescript/shared/{utils → providers/stack/blank-stack-state/helpers}/navigation/compose-descriptors.d.ts +1 -1
  371. package/lib/typescript/shared/providers/stack/blank-stack-state/helpers/navigation/compose-descriptors.d.ts.map +1 -0
  372. package/lib/typescript/shared/providers/stack/blank-stack-state/helpers/navigation/resolve-scene-neighbors.d.ts.map +1 -0
  373. package/lib/typescript/shared/{utils → providers/stack/blank-stack-state/helpers}/navigation/sync-routes-with-removed.d.ts +2 -4
  374. package/lib/typescript/shared/providers/stack/blank-stack-state/helpers/navigation/sync-routes-with-removed.d.ts.map +1 -0
  375. package/lib/typescript/shared/providers/stack/blank-stack-state/helpers/reconcile-blank-stack-routes.d.ts +12 -0
  376. package/lib/typescript/shared/providers/stack/blank-stack-state/helpers/reconcile-blank-stack-routes.d.ts.map +1 -0
  377. package/lib/typescript/shared/providers/stack/{helpers/managed-stack-state/helpers/helpers.d.ts → blank-stack-state/helpers/state-equality.d.ts} +4 -4
  378. package/lib/typescript/shared/providers/stack/blank-stack-state/helpers/state-equality.d.ts.map +1 -0
  379. package/lib/typescript/shared/providers/stack/blank-stack-state/helpers/types.d.ts +39 -0
  380. package/lib/typescript/shared/providers/stack/blank-stack-state/helpers/types.d.ts.map +1 -0
  381. package/lib/typescript/shared/providers/stack/blank-stack-state/index.d.ts +12 -0
  382. package/lib/typescript/shared/providers/stack/blank-stack-state/index.d.ts.map +1 -0
  383. package/lib/typescript/shared/providers/stack/blank-stack.provider.d.ts +8 -0
  384. package/lib/typescript/shared/providers/stack/blank-stack.provider.d.ts.map +1 -0
  385. package/lib/typescript/shared/providers/stack/direct.provider.d.ts.map +1 -1
  386. package/lib/typescript/shared/stores/animation.store.d.ts +1 -0
  387. package/lib/typescript/shared/stores/animation.store.d.ts.map +1 -1
  388. package/lib/typescript/shared/stores/gesture.store.d.ts +2 -0
  389. package/lib/typescript/shared/stores/gesture.store.d.ts.map +1 -1
  390. package/lib/typescript/shared/stores/system.store.d.ts +1 -5
  391. package/lib/typescript/shared/stores/system.store.d.ts.map +1 -1
  392. package/lib/typescript/shared/types/animation.types.d.ts +12 -10
  393. package/lib/typescript/shared/types/animation.types.d.ts.map +1 -1
  394. package/lib/typescript/shared/types/bounds.types.d.ts +1 -1
  395. package/lib/typescript/shared/types/gesture.types.d.ts +24 -0
  396. package/lib/typescript/shared/types/gesture.types.d.ts.map +1 -1
  397. package/lib/typescript/shared/types/index.d.ts +1 -1
  398. package/lib/typescript/shared/types/index.d.ts.map +1 -1
  399. package/lib/typescript/shared/types/providers/{managed-stack.types.d.ts → blank-stack-provider.types.d.ts} +11 -11
  400. package/lib/typescript/shared/types/providers/blank-stack-provider.types.d.ts.map +1 -0
  401. package/lib/typescript/shared/types/screen.types.d.ts +7 -2
  402. package/lib/typescript/shared/types/screen.types.d.ts.map +1 -1
  403. package/lib/typescript/shared/utils/animation/animate-to-progress.d.ts.map +1 -1
  404. package/lib/typescript/shared/utils/animation/animate.d.ts +8 -3
  405. package/lib/typescript/shared/utils/animation/animate.d.ts.map +1 -1
  406. package/lib/typescript/shared/utils/animation/spring/index.d.ts +3 -0
  407. package/lib/typescript/shared/utils/animation/spring/index.d.ts.map +1 -0
  408. package/lib/typescript/shared/utils/animation/spring/spring.d.ts +24 -0
  409. package/lib/typescript/shared/utils/animation/spring/spring.d.ts.map +1 -0
  410. package/lib/typescript/shared/utils/animation/spring/springConfigs.d.ts +46 -0
  411. package/lib/typescript/shared/utils/animation/spring/springConfigs.d.ts.map +1 -0
  412. package/lib/typescript/shared/utils/animation/spring/springUtils.d.ts +68 -0
  413. package/lib/typescript/shared/utils/animation/spring/springUtils.d.ts.map +1 -0
  414. package/lib/typescript/shared/utils/animation/state.d.ts +6 -0
  415. package/lib/typescript/shared/utils/animation/state.d.ts.map +1 -0
  416. package/lib/typescript/shared/utils/bounds/navigation/reveal/build.d.ts.map +1 -1
  417. package/lib/typescript/shared/utils/bounds/navigation/zoom/build.d.ts.map +1 -1
  418. package/package.json +1 -1
  419. package/src/blank-stack/components/stack-view.tsx +2 -2
  420. package/src/component-stack/components/stack-view.tsx +2 -2
  421. package/src/shared/adapters/with-screen-transitions/options.ts +86 -19
  422. package/src/shared/adapters/with-screen-transitions/stack-layout.tsx +0 -14
  423. package/src/shared/components/overlay/variations/float-overlay.tsx +1 -7
  424. package/src/shared/components/scene-view.tsx +1 -1
  425. package/src/shared/components/screen-lifecycle/hooks/use-close-transition-intent.ts +11 -8
  426. package/src/shared/components/screen-lifecycle/hooks/use-transition-start-controller.ts +4 -4
  427. package/src/shared/components/screen-lifecycle/index.tsx +2 -2
  428. package/src/shared/constants.ts +1 -11
  429. package/src/shared/hooks/navigation/use-screen-state.ts +1 -7
  430. package/src/shared/hooks/navigation/use-stack.tsx +0 -2
  431. package/src/shared/providers/screen/animation/helpers/accessors/use-build-transition-accessor.ts +19 -16
  432. package/src/shared/providers/screen/animation/helpers/build-screen-transition-options.ts +2 -17
  433. package/src/shared/providers/screen/animation/helpers/hydrate-transition-state/gesture-progress.ts +3 -3
  434. package/src/shared/providers/screen/animation/helpers/hydrate-transition-state/index.ts +9 -51
  435. package/src/shared/providers/screen/animation/helpers/hydrate-transition-state/types.ts +1 -7
  436. package/src/shared/providers/screen/animation/helpers/pipeline.ts +1 -1
  437. package/src/shared/providers/screen/animation/helpers/selected-interpolator-options.ts +24 -1
  438. package/src/shared/providers/screen/animation/helpers/use-build-transition-state.ts +2 -5
  439. package/src/shared/providers/screen/gestures/gestures.provider.tsx +21 -4
  440. package/src/shared/providers/screen/gestures/ownership/compute-claimed-directions.ts +6 -9
  441. package/src/shared/providers/screen/gestures/pan/{pan-activation-decision.ts → activation/pan-activation-decision.ts} +7 -7
  442. package/src/shared/providers/screen/gestures/pan/{pan-activation-rules.ts → activation/pan-activation-rules.ts} +32 -25
  443. package/src/shared/providers/screen/gestures/pan/{pan-activation.ts → activation/use-pan-activation.ts} +23 -12
  444. package/src/shared/providers/screen/gestures/pan/{pan-lifecycle.ts → behavior/pan-lifecycle.ts} +46 -8
  445. package/src/shared/providers/screen/gestures/pan/{pan-release.ts → behavior/pan-release.ts} +6 -6
  446. package/src/shared/providers/screen/gestures/pan/{pan-reset.ts → behavior/pan-reset.ts} +22 -12
  447. package/src/shared/providers/screen/gestures/pan/{use-pan-behavior.ts → behavior/use-pan-behavior.ts} +43 -10
  448. package/src/shared/providers/screen/gestures/pan/{build-pan-gesture.ts → use-build-pan-gesture.ts} +15 -6
  449. package/src/shared/providers/screen/gestures/pinch/{pinch-activation.ts → activation/use-pinch-activation.ts} +17 -5
  450. package/src/shared/providers/screen/gestures/pinch/{pinch-lifecycle.ts → behavior/pinch-lifecycle.ts} +10 -8
  451. package/src/shared/providers/screen/gestures/pinch/{pinch-release.ts → behavior/pinch-release.ts} +5 -5
  452. package/src/shared/providers/screen/gestures/pinch/{pinch-reset.ts → behavior/pinch-reset.ts} +11 -5
  453. package/src/shared/providers/screen/gestures/pinch/{use-pinch-behavior.ts → behavior/use-pinch-behavior.ts} +16 -6
  454. package/src/shared/providers/screen/gestures/pinch/{build-pinch-gesture.ts → use-build-pinch-gesture.ts} +18 -6
  455. package/src/shared/providers/screen/gestures/rotation/activation/use-rotation-activation.ts +87 -0
  456. package/src/shared/providers/screen/gestures/rotation/behavior/rotation-lifecycle.ts +19 -0
  457. package/src/shared/providers/screen/gestures/rotation/behavior/use-rotation-behavior.ts +47 -0
  458. package/src/shared/providers/screen/gestures/rotation/use-build-rotation-gesture.ts +55 -0
  459. package/src/shared/providers/screen/gestures/shared/directions.ts +27 -13
  460. package/src/shared/providers/screen/gestures/shared/policy.ts +99 -5
  461. package/src/shared/providers/screen/gestures/shared/reset.ts +9 -17
  462. package/src/shared/providers/screen/gestures/shared/runtime.ts +1 -14
  463. package/src/shared/providers/screen/gestures/shared/snap-points.ts +1 -1
  464. package/src/shared/providers/screen/gestures/types.ts +20 -3
  465. package/src/shared/providers/screen/options/helpers.ts +85 -30
  466. package/src/shared/providers/screen/options/types.ts +6 -5
  467. package/src/shared/providers/screen/styles/components/{maybe-floating-container.tsx → floating-overlay-layer.tsx} +6 -6
  468. package/src/shared/providers/screen/styles/styles.provider.tsx +3 -3
  469. package/src/shared/providers/stack/{helpers/managed-stack-state/managed-stack-controller.ts → blank-stack-state/blank-stack-controller.ts} +22 -20
  470. 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
  471. 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
  472. package/src/shared/{utils → providers/stack/blank-stack-state/helpers}/navigation/compose-descriptors.ts +1 -1
  473. package/src/shared/{utils → providers/stack/blank-stack-state/helpers}/navigation/sync-routes-with-removed.ts +8 -40
  474. 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
  475. package/src/shared/providers/stack/{helpers/managed-stack-state/helpers/helpers.ts → blank-stack-state/helpers/state-equality.ts} +4 -4
  476. package/src/shared/providers/stack/{helpers/managed-stack-state → blank-stack-state}/helpers/types.ts +16 -15
  477. package/src/shared/providers/stack/{helpers/managed-stack-state → blank-stack-state}/index.ts +9 -9
  478. package/src/shared/providers/stack/blank-stack.provider.tsx +118 -0
  479. package/src/shared/providers/stack/direct.provider.tsx +38 -54
  480. package/src/shared/stores/animation.store.ts +3 -0
  481. package/src/shared/stores/gesture.store.ts +6 -0
  482. package/src/shared/stores/system.store.ts +1 -9
  483. package/src/shared/types/animation.types.ts +12 -14
  484. package/src/shared/types/bounds.types.ts +1 -1
  485. package/src/shared/types/gesture.types.ts +33 -0
  486. package/src/shared/types/index.ts +4 -0
  487. package/src/shared/types/providers/{managed-stack.types.ts → blank-stack-provider.types.ts} +10 -10
  488. package/src/shared/types/screen.types.ts +7 -2
  489. package/src/shared/utils/animation/animate-to-progress.ts +18 -7
  490. package/src/shared/utils/animation/animate.ts +44 -21
  491. package/src/shared/utils/animation/spring/index.ts +2 -0
  492. package/src/shared/utils/animation/spring/spring.ts +343 -0
  493. package/src/shared/utils/animation/spring/springConfigs.ts +46 -0
  494. package/src/shared/utils/animation/spring/springUtils.ts +418 -0
  495. package/src/shared/utils/animation/state.ts +6 -0
  496. package/src/shared/utils/bounds/navigation/reveal/build.ts +5 -9
  497. package/src/shared/utils/bounds/navigation/zoom/build.ts +4 -6
  498. package/lib/commonjs/shared/hooks/navigation/use-closing-route-keys.js +0 -61
  499. package/lib/commonjs/shared/hooks/navigation/use-closing-route-keys.js.map +0 -1
  500. package/lib/commonjs/shared/hooks/navigation/use-optimistic-focused-index.js +0 -20
  501. package/lib/commonjs/shared/hooks/navigation/use-optimistic-focused-index.js.map +0 -1
  502. package/lib/commonjs/shared/providers/screen/animation/helpers/hydrate-transition-state/settle.js +0 -29
  503. package/lib/commonjs/shared/providers/screen/animation/helpers/hydrate-transition-state/settle.js.map +0 -1
  504. package/lib/commonjs/shared/providers/screen/gestures/pan/build-pan-gesture.js.map +0 -1
  505. package/lib/commonjs/shared/providers/screen/gestures/pan/pan-activation-decision.js.map +0 -1
  506. package/lib/commonjs/shared/providers/screen/gestures/pan/pan-activation-rules.js.map +0 -1
  507. package/lib/commonjs/shared/providers/screen/gestures/pan/pan-activation.js.map +0 -1
  508. package/lib/commonjs/shared/providers/screen/gestures/pan/pan-lifecycle.js.map +0 -1
  509. package/lib/commonjs/shared/providers/screen/gestures/pan/pan-release.js.map +0 -1
  510. package/lib/commonjs/shared/providers/screen/gestures/pan/pan-reset.js.map +0 -1
  511. package/lib/commonjs/shared/providers/screen/gestures/pan/use-pan-behavior.js.map +0 -1
  512. package/lib/commonjs/shared/providers/screen/gestures/pinch/build-pinch-gesture.js.map +0 -1
  513. package/lib/commonjs/shared/providers/screen/gestures/pinch/pinch-activation.js.map +0 -1
  514. package/lib/commonjs/shared/providers/screen/gestures/pinch/pinch-lifecycle.js.map +0 -1
  515. package/lib/commonjs/shared/providers/screen/gestures/pinch/pinch-release.js.map +0 -1
  516. package/lib/commonjs/shared/providers/screen/gestures/pinch/pinch-reset.js.map +0 -1
  517. package/lib/commonjs/shared/providers/screen/gestures/pinch/use-pinch-behavior.js.map +0 -1
  518. package/lib/commonjs/shared/providers/screen/styles/components/maybe-floating-container.js.map +0 -1
  519. package/lib/commonjs/shared/providers/stack/helpers/managed-stack-state/helpers/build-managed-stack-state.js.map +0 -1
  520. package/lib/commonjs/shared/providers/stack/helpers/managed-stack-state/helpers/derive-managed-stack-state.js +0 -58
  521. package/lib/commonjs/shared/providers/stack/helpers/managed-stack-state/helpers/derive-managed-stack-state.js.map +0 -1
  522. package/lib/commonjs/shared/providers/stack/helpers/managed-stack-state/helpers/helpers.js.map +0 -1
  523. package/lib/commonjs/shared/providers/stack/helpers/managed-stack-state/helpers/types.js.map +0 -1
  524. package/lib/commonjs/shared/providers/stack/helpers/managed-stack-state/index.js.map +0 -1
  525. package/lib/commonjs/shared/providers/stack/helpers/managed-stack-state/managed-stack-controller.js.map +0 -1
  526. package/lib/commonjs/shared/providers/stack/helpers/use-closing-route-map.js +0 -30
  527. package/lib/commonjs/shared/providers/stack/helpers/use-closing-route-map.js.map +0 -1
  528. package/lib/commonjs/shared/providers/stack/helpers/use-processed-routes.js +0 -58
  529. package/lib/commonjs/shared/providers/stack/helpers/use-processed-routes.js.map +0 -1
  530. package/lib/commonjs/shared/providers/stack/helpers/use-stack-derived.js +0 -27
  531. package/lib/commonjs/shared/providers/stack/helpers/use-stack-derived.js.map +0 -1
  532. package/lib/commonjs/shared/providers/stack/managed.provider.js.map +0 -1
  533. package/lib/commonjs/shared/types/providers/managed-stack.types.js.map +0 -1
  534. package/lib/commonjs/shared/utils/navigation/compose-descriptors.js.map +0 -1
  535. package/lib/commonjs/shared/utils/navigation/resolve-scene-neighbors.js.map +0 -1
  536. package/lib/commonjs/shared/utils/navigation/sync-routes-with-removed.js.map +0 -1
  537. package/lib/module/shared/hooks/navigation/use-closing-route-keys.js +0 -55
  538. package/lib/module/shared/hooks/navigation/use-closing-route-keys.js.map +0 -1
  539. package/lib/module/shared/hooks/navigation/use-optimistic-focused-index.js +0 -17
  540. package/lib/module/shared/hooks/navigation/use-optimistic-focused-index.js.map +0 -1
  541. package/lib/module/shared/providers/screen/animation/helpers/hydrate-transition-state/settle.js +0 -22
  542. package/lib/module/shared/providers/screen/animation/helpers/hydrate-transition-state/settle.js.map +0 -1
  543. package/lib/module/shared/providers/screen/gestures/pan/build-pan-gesture.js.map +0 -1
  544. package/lib/module/shared/providers/screen/gestures/pan/pan-activation-decision.js.map +0 -1
  545. package/lib/module/shared/providers/screen/gestures/pan/pan-activation-rules.js.map +0 -1
  546. package/lib/module/shared/providers/screen/gestures/pan/pan-activation.js.map +0 -1
  547. package/lib/module/shared/providers/screen/gestures/pan/pan-lifecycle.js.map +0 -1
  548. package/lib/module/shared/providers/screen/gestures/pan/pan-release.js.map +0 -1
  549. package/lib/module/shared/providers/screen/gestures/pan/pan-reset.js.map +0 -1
  550. package/lib/module/shared/providers/screen/gestures/pan/use-pan-behavior.js +0 -49
  551. package/lib/module/shared/providers/screen/gestures/pan/use-pan-behavior.js.map +0 -1
  552. package/lib/module/shared/providers/screen/gestures/pinch/build-pinch-gesture.js.map +0 -1
  553. package/lib/module/shared/providers/screen/gestures/pinch/pinch-activation.js.map +0 -1
  554. package/lib/module/shared/providers/screen/gestures/pinch/pinch-lifecycle.js.map +0 -1
  555. package/lib/module/shared/providers/screen/gestures/pinch/pinch-release.js.map +0 -1
  556. package/lib/module/shared/providers/screen/gestures/pinch/pinch-reset.js.map +0 -1
  557. package/lib/module/shared/providers/screen/gestures/pinch/use-pinch-behavior.js.map +0 -1
  558. package/lib/module/shared/providers/screen/styles/components/maybe-floating-container.js.map +0 -1
  559. package/lib/module/shared/providers/stack/helpers/managed-stack-state/helpers/build-managed-stack-state.js.map +0 -1
  560. package/lib/module/shared/providers/stack/helpers/managed-stack-state/helpers/derive-managed-stack-state.js.map +0 -1
  561. package/lib/module/shared/providers/stack/helpers/managed-stack-state/helpers/helpers.js.map +0 -1
  562. package/lib/module/shared/providers/stack/helpers/managed-stack-state/helpers/reconcile-managed-routes.js.map +0 -1
  563. package/lib/module/shared/providers/stack/helpers/managed-stack-state/helpers/types.js.map +0 -1
  564. package/lib/module/shared/providers/stack/helpers/managed-stack-state/index.js.map +0 -1
  565. package/lib/module/shared/providers/stack/helpers/managed-stack-state/managed-stack-controller.js.map +0 -1
  566. package/lib/module/shared/providers/stack/helpers/use-closing-route-map.js +0 -25
  567. package/lib/module/shared/providers/stack/helpers/use-closing-route-map.js.map +0 -1
  568. package/lib/module/shared/providers/stack/helpers/use-processed-routes.js +0 -54
  569. package/lib/module/shared/providers/stack/helpers/use-processed-routes.js.map +0 -1
  570. package/lib/module/shared/providers/stack/helpers/use-stack-derived.js +0 -23
  571. package/lib/module/shared/providers/stack/helpers/use-stack-derived.js.map +0 -1
  572. package/lib/module/shared/providers/stack/managed.provider.js.map +0 -1
  573. package/lib/module/shared/types/providers/managed-stack.types.js +0 -4
  574. package/lib/module/shared/types/providers/managed-stack.types.js.map +0 -1
  575. package/lib/module/shared/utils/navigation/compose-descriptors.js.map +0 -1
  576. package/lib/module/shared/utils/navigation/resolve-scene-neighbors.js.map +0 -1
  577. package/lib/module/shared/utils/navigation/sync-routes-with-removed.js.map +0 -1
  578. package/lib/typescript/shared/hooks/navigation/use-closing-route-keys.d.ts +0 -8
  579. package/lib/typescript/shared/hooks/navigation/use-closing-route-keys.d.ts.map +0 -1
  580. package/lib/typescript/shared/hooks/navigation/use-optimistic-focused-index.d.ts +0 -7
  581. package/lib/typescript/shared/hooks/navigation/use-optimistic-focused-index.d.ts.map +0 -1
  582. package/lib/typescript/shared/providers/screen/animation/helpers/hydrate-transition-state/settle.d.ts +0 -5
  583. package/lib/typescript/shared/providers/screen/animation/helpers/hydrate-transition-state/settle.d.ts.map +0 -1
  584. package/lib/typescript/shared/providers/screen/gestures/pan/build-pan-gesture.d.ts +0 -10
  585. package/lib/typescript/shared/providers/screen/gestures/pan/build-pan-gesture.d.ts.map +0 -1
  586. package/lib/typescript/shared/providers/screen/gestures/pan/pan-activation-decision.d.ts.map +0 -1
  587. package/lib/typescript/shared/providers/screen/gestures/pan/pan-activation-rules.d.ts.map +0 -1
  588. package/lib/typescript/shared/providers/screen/gestures/pan/pan-activation.d.ts.map +0 -1
  589. package/lib/typescript/shared/providers/screen/gestures/pan/pan-lifecycle.d.ts.map +0 -1
  590. package/lib/typescript/shared/providers/screen/gestures/pan/pan-release.d.ts.map +0 -1
  591. package/lib/typescript/shared/providers/screen/gestures/pan/pan-reset.d.ts.map +0 -1
  592. package/lib/typescript/shared/providers/screen/gestures/pan/use-pan-behavior.d.ts +0 -5
  593. package/lib/typescript/shared/providers/screen/gestures/pan/use-pan-behavior.d.ts.map +0 -1
  594. package/lib/typescript/shared/providers/screen/gestures/pinch/build-pinch-gesture.d.ts +0 -7
  595. package/lib/typescript/shared/providers/screen/gestures/pinch/build-pinch-gesture.d.ts.map +0 -1
  596. package/lib/typescript/shared/providers/screen/gestures/pinch/pinch-activation.d.ts.map +0 -1
  597. package/lib/typescript/shared/providers/screen/gestures/pinch/pinch-lifecycle.d.ts.map +0 -1
  598. package/lib/typescript/shared/providers/screen/gestures/pinch/pinch-release.d.ts.map +0 -1
  599. package/lib/typescript/shared/providers/screen/gestures/pinch/pinch-reset.d.ts.map +0 -1
  600. package/lib/typescript/shared/providers/screen/gestures/pinch/use-pinch-behavior.d.ts +0 -5
  601. package/lib/typescript/shared/providers/screen/gestures/pinch/use-pinch-behavior.d.ts.map +0 -1
  602. package/lib/typescript/shared/providers/screen/styles/components/maybe-floating-container.d.ts +0 -7
  603. package/lib/typescript/shared/providers/screen/styles/components/maybe-floating-container.d.ts.map +0 -1
  604. package/lib/typescript/shared/providers/stack/helpers/managed-stack-state/helpers/build-managed-stack-state.d.ts +0 -13
  605. package/lib/typescript/shared/providers/stack/helpers/managed-stack-state/helpers/build-managed-stack-state.d.ts.map +0 -1
  606. package/lib/typescript/shared/providers/stack/helpers/managed-stack-state/helpers/derive-managed-stack-state.d.ts +0 -12
  607. package/lib/typescript/shared/providers/stack/helpers/managed-stack-state/helpers/derive-managed-stack-state.d.ts.map +0 -1
  608. package/lib/typescript/shared/providers/stack/helpers/managed-stack-state/helpers/helpers.d.ts.map +0 -1
  609. package/lib/typescript/shared/providers/stack/helpers/managed-stack-state/helpers/reconcile-managed-routes.d.ts +0 -12
  610. package/lib/typescript/shared/providers/stack/helpers/managed-stack-state/helpers/reconcile-managed-routes.d.ts.map +0 -1
  611. package/lib/typescript/shared/providers/stack/helpers/managed-stack-state/helpers/types.d.ts +0 -39
  612. package/lib/typescript/shared/providers/stack/helpers/managed-stack-state/helpers/types.d.ts.map +0 -1
  613. package/lib/typescript/shared/providers/stack/helpers/managed-stack-state/index.d.ts +0 -12
  614. package/lib/typescript/shared/providers/stack/helpers/managed-stack-state/index.d.ts.map +0 -1
  615. package/lib/typescript/shared/providers/stack/helpers/managed-stack-state/managed-stack-controller.d.ts +0 -13
  616. package/lib/typescript/shared/providers/stack/helpers/managed-stack-state/managed-stack-controller.d.ts.map +0 -1
  617. package/lib/typescript/shared/providers/stack/helpers/use-closing-route-map.d.ts +0 -7
  618. package/lib/typescript/shared/providers/stack/helpers/use-closing-route-map.d.ts.map +0 -1
  619. package/lib/typescript/shared/providers/stack/helpers/use-processed-routes.d.ts +0 -17
  620. package/lib/typescript/shared/providers/stack/helpers/use-processed-routes.d.ts.map +0 -1
  621. package/lib/typescript/shared/providers/stack/helpers/use-stack-derived.d.ts +0 -18
  622. package/lib/typescript/shared/providers/stack/helpers/use-stack-derived.d.ts.map +0 -1
  623. package/lib/typescript/shared/providers/stack/managed.provider.d.ts +0 -8
  624. package/lib/typescript/shared/providers/stack/managed.provider.d.ts.map +0 -1
  625. package/lib/typescript/shared/types/providers/managed-stack.types.d.ts.map +0 -1
  626. package/lib/typescript/shared/utils/navigation/compose-descriptors.d.ts.map +0 -1
  627. package/lib/typescript/shared/utils/navigation/resolve-scene-neighbors.d.ts.map +0 -1
  628. package/lib/typescript/shared/utils/navigation/sync-routes-with-removed.d.ts.map +0 -1
  629. package/src/shared/hooks/navigation/use-closing-route-keys.ts +0 -60
  630. package/src/shared/hooks/navigation/use-optimistic-focused-index.ts +0 -19
  631. package/src/shared/providers/screen/animation/helpers/hydrate-transition-state/settle.ts +0 -41
  632. package/src/shared/providers/stack/helpers/use-closing-route-map.ts +0 -28
  633. package/src/shared/providers/stack/helpers/use-processed-routes.ts +0 -85
  634. package/src/shared/providers/stack/helpers/use-stack-derived.ts +0 -34
  635. package/src/shared/providers/stack/managed.provider.tsx +0 -126
  636. /package/lib/commonjs/shared/{utils → providers/stack/blank-stack-state/helpers}/navigation/compose-descriptors.js +0 -0
  637. /package/lib/commonjs/shared/{utils → providers/stack/blank-stack-state/helpers}/navigation/resolve-scene-neighbors.js +0 -0
  638. /package/lib/commonjs/shared/providers/stack/{helpers/managed-stack-state → blank-stack-state}/helpers/types.js +0 -0
  639. /package/lib/module/shared/{utils → providers/stack/blank-stack-state/helpers}/navigation/compose-descriptors.js +0 -0
  640. /package/lib/module/shared/{utils → providers/stack/blank-stack-state/helpers}/navigation/resolve-scene-neighbors.js +0 -0
  641. /package/lib/module/shared/providers/stack/{helpers/managed-stack-state → blank-stack-state}/helpers/types.js +0 -0
  642. /package/lib/typescript/shared/{utils → providers/stack/blank-stack-state/helpers}/navigation/resolve-scene-neighbors.d.ts +0 -0
  643. /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
+ );