react-native-screen-transitions 3.4.0-alpha.3 → 3.4.0-alpha.5

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 (328) hide show
  1. package/lib/commonjs/component-stack/components/component-screen.js +1 -1
  2. package/lib/commonjs/component-stack/components/component-screen.js.map +1 -1
  3. package/lib/commonjs/shared/animation/snap-to.js +6 -3
  4. package/lib/commonjs/shared/animation/snap-to.js.map +1 -1
  5. package/lib/commonjs/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js +1 -1
  6. package/lib/commonjs/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js.map +1 -1
  7. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-group-active-measurement.js +47 -4
  8. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-group-active-measurement.js.map +1 -1
  9. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-initial-layout-handler.js +2 -2
  10. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-initial-layout-handler.js.map +1 -1
  11. package/lib/commonjs/shared/components/create-boundary-component/index.js +6 -6
  12. package/lib/commonjs/shared/components/create-boundary-component/index.js.map +1 -1
  13. package/lib/commonjs/shared/components/native-screen.js +3 -3
  14. package/lib/commonjs/shared/components/native-screen.js.map +1 -1
  15. package/lib/commonjs/shared/components/screen-container/deferred-visibility-host.js +1 -1
  16. package/lib/commonjs/shared/components/screen-container/deferred-visibility-host.js.map +1 -1
  17. package/lib/commonjs/shared/components/screen-container/hooks/use-content-layout.js +18 -14
  18. package/lib/commonjs/shared/components/screen-container/hooks/use-content-layout.js.map +1 -1
  19. package/lib/commonjs/shared/components/screen-container/layers/backdrop.js +8 -5
  20. package/lib/commonjs/shared/components/screen-container/layers/backdrop.js.map +1 -1
  21. package/lib/commonjs/shared/components/screen-container/layers/content.js +12 -28
  22. package/lib/commonjs/shared/components/screen-container/layers/content.js.map +1 -1
  23. package/lib/commonjs/shared/components/screen-container/layers/maybe-masked-navigation-container.js +17 -4
  24. package/lib/commonjs/shared/components/screen-container/layers/maybe-masked-navigation-container.js.map +1 -1
  25. package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-close-transition/helpers/reset-stores-for-screen.js +4 -2
  26. package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-close-transition/helpers/reset-stores-for-screen.js.map +1 -1
  27. package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-close-transition/index.js +6 -1
  28. package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-close-transition/index.js.map +1 -1
  29. package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-open-transition.js +13 -11
  30. package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-open-transition.js.map +1 -1
  31. package/lib/commonjs/shared/components/screen-lifecycle/index.js +5 -3
  32. package/lib/commonjs/shared/components/screen-lifecycle/index.js.map +1 -1
  33. package/lib/commonjs/shared/configs/presets.js +3 -4
  34. package/lib/commonjs/shared/configs/presets.js.map +1 -1
  35. package/lib/commonjs/shared/constants.js +16 -2
  36. package/lib/commonjs/shared/constants.js.map +1 -1
  37. package/lib/commonjs/shared/hooks/animation/use-associated-style.js +2 -2
  38. package/lib/commonjs/shared/hooks/animation/use-associated-style.js.map +1 -1
  39. package/lib/commonjs/shared/providers/gestures/handlers/use-handlers.js +12 -9
  40. package/lib/commonjs/shared/providers/gestures/handlers/use-handlers.js.map +1 -1
  41. package/lib/commonjs/shared/providers/gestures/helpers/gesture-physics.js +3 -2
  42. package/lib/commonjs/shared/providers/gestures/helpers/gesture-physics.js.map +1 -1
  43. package/lib/commonjs/shared/providers/gestures/helpers/gesture-reset.js +7 -5
  44. package/lib/commonjs/shared/providers/gestures/helpers/gesture-reset.js.map +1 -1
  45. package/lib/commonjs/shared/providers/gestures/helpers/gesture-snap-points.js +5 -5
  46. package/lib/commonjs/shared/providers/gestures/helpers/gesture-snap-points.js.map +1 -1
  47. package/lib/commonjs/shared/providers/gestures/helpers/gesture-targets.js +9 -6
  48. package/lib/commonjs/shared/providers/gestures/helpers/gesture-targets.js.map +1 -1
  49. package/lib/commonjs/shared/providers/gestures/helpers/register-direction-claims.js +1 -1
  50. package/lib/commonjs/shared/providers/gestures/helpers/register-direction-claims.js.map +1 -1
  51. package/lib/commonjs/shared/providers/gestures/use-build-gestures.js +1 -1
  52. package/lib/commonjs/shared/providers/gestures/use-build-gestures.js.map +1 -1
  53. package/lib/commonjs/shared/providers/register-bounds.provider.js +5 -5
  54. package/lib/commonjs/shared/providers/register-bounds.provider.js.map +1 -1
  55. package/lib/commonjs/shared/providers/screen/animation/helpers/has-transitions-enabled.js +17 -0
  56. package/lib/commonjs/shared/providers/screen/animation/helpers/has-transitions-enabled.js.map +1 -0
  57. package/lib/commonjs/shared/providers/screen/animation/helpers/hydrate-transition-state.js +72 -0
  58. package/lib/commonjs/shared/providers/screen/animation/helpers/hydrate-transition-state.js.map +1 -0
  59. package/lib/commonjs/shared/providers/screen/animation/helpers/pipeline.js +22 -108
  60. package/lib/commonjs/shared/providers/screen/animation/helpers/pipeline.js.map +1 -1
  61. package/lib/commonjs/shared/providers/screen/animation/helpers/use-build-transition-state.js +42 -0
  62. package/lib/commonjs/shared/providers/screen/animation/helpers/use-build-transition-state.js.map +1 -0
  63. package/lib/commonjs/shared/providers/screen/helpers/resolve-interpolated-style-output.js +17 -3
  64. package/lib/commonjs/shared/providers/screen/helpers/resolve-interpolated-style-output.js.map +1 -1
  65. package/lib/commonjs/shared/providers/screen/styles.provider.js +4 -1
  66. package/lib/commonjs/shared/providers/screen/styles.provider.js.map +1 -1
  67. package/lib/commonjs/shared/providers/stack/direct.provider.js +1 -1
  68. package/lib/commonjs/shared/providers/stack/direct.provider.js.map +1 -1
  69. package/lib/commonjs/shared/providers/stack/helpers/use-processed-routes.js +1 -1
  70. package/lib/commonjs/shared/providers/stack/helpers/use-processed-routes.js.map +1 -1
  71. package/lib/commonjs/shared/stores/animation.store.js +12 -40
  72. package/lib/commonjs/shared/stores/animation.store.js.map +1 -1
  73. package/lib/commonjs/shared/stores/gesture.store.js +13 -33
  74. package/lib/commonjs/shared/stores/gesture.store.js.map +1 -1
  75. package/lib/commonjs/shared/stores/system.store.js +31 -0
  76. package/lib/commonjs/shared/stores/system.store.js.map +1 -0
  77. package/lib/commonjs/shared/types/bounds.types.js +1 -3
  78. package/lib/commonjs/shared/types/bounds.types.js.map +1 -1
  79. package/lib/commonjs/shared/utils/animation/animate-to-progress.js +2 -2
  80. package/lib/commonjs/shared/utils/animation/animate-to-progress.js.map +1 -1
  81. package/lib/commonjs/shared/utils/bounds/helpers/compute-bounds-styles.js.map +1 -1
  82. package/lib/commonjs/shared/utils/bounds/index.js +23 -50
  83. package/lib/commonjs/shared/utils/bounds/index.js.map +1 -1
  84. package/lib/commonjs/shared/utils/bounds/zoom/build.js +108 -362
  85. package/lib/commonjs/shared/utils/bounds/zoom/build.js.map +1 -1
  86. package/lib/commonjs/shared/utils/bounds/zoom/config.js +15 -101
  87. package/lib/commonjs/shared/utils/bounds/zoom/config.js.map +1 -1
  88. package/lib/commonjs/shared/utils/bounds/zoom/math.js +154 -0
  89. package/lib/commonjs/shared/utils/bounds/zoom/math.js.map +1 -0
  90. package/lib/commonjs/shared/utils/bounds/zoom/types.js +1 -3
  91. package/lib/commonjs/shared/utils/bounds/zoom/types.js.map +1 -1
  92. package/lib/commonjs/shared/utils/create-store.js +54 -0
  93. package/lib/commonjs/shared/utils/create-store.js.map +1 -0
  94. package/lib/module/component-stack/components/component-screen.js +1 -1
  95. package/lib/module/component-stack/components/component-screen.js.map +1 -1
  96. package/lib/module/shared/animation/snap-to.js +6 -3
  97. package/lib/module/shared/animation/snap-to.js.map +1 -1
  98. package/lib/module/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js +1 -1
  99. package/lib/module/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js.map +1 -1
  100. package/lib/module/shared/components/create-boundary-component/hooks/use-group-active-measurement.js +48 -5
  101. package/lib/module/shared/components/create-boundary-component/hooks/use-group-active-measurement.js.map +1 -1
  102. package/lib/module/shared/components/create-boundary-component/hooks/use-initial-layout-handler.js +2 -2
  103. package/lib/module/shared/components/create-boundary-component/hooks/use-initial-layout-handler.js.map +1 -1
  104. package/lib/module/shared/components/create-boundary-component/index.js +6 -6
  105. package/lib/module/shared/components/create-boundary-component/index.js.map +1 -1
  106. package/lib/module/shared/components/native-screen.js +3 -3
  107. package/lib/module/shared/components/native-screen.js.map +1 -1
  108. package/lib/module/shared/components/screen-container/deferred-visibility-host.js +2 -2
  109. package/lib/module/shared/components/screen-container/deferred-visibility-host.js.map +1 -1
  110. package/lib/module/shared/components/screen-container/hooks/use-content-layout.js +18 -14
  111. package/lib/module/shared/components/screen-container/hooks/use-content-layout.js.map +1 -1
  112. package/lib/module/shared/components/screen-container/layers/backdrop.js +8 -5
  113. package/lib/module/shared/components/screen-container/layers/backdrop.js.map +1 -1
  114. package/lib/module/shared/components/screen-container/layers/content.js +13 -29
  115. package/lib/module/shared/components/screen-container/layers/content.js.map +1 -1
  116. package/lib/module/shared/components/screen-container/layers/maybe-masked-navigation-container.js +19 -6
  117. package/lib/module/shared/components/screen-container/layers/maybe-masked-navigation-container.js.map +1 -1
  118. package/lib/module/shared/components/screen-lifecycle/hooks/use-close-transition/helpers/reset-stores-for-screen.js +4 -2
  119. package/lib/module/shared/components/screen-lifecycle/hooks/use-close-transition/helpers/reset-stores-for-screen.js.map +1 -1
  120. package/lib/module/shared/components/screen-lifecycle/hooks/use-close-transition/index.js +6 -1
  121. package/lib/module/shared/components/screen-lifecycle/hooks/use-close-transition/index.js.map +1 -1
  122. package/lib/module/shared/components/screen-lifecycle/hooks/use-open-transition.js +13 -11
  123. package/lib/module/shared/components/screen-lifecycle/hooks/use-open-transition.js.map +1 -1
  124. package/lib/module/shared/components/screen-lifecycle/index.js +5 -3
  125. package/lib/module/shared/components/screen-lifecycle/index.js.map +1 -1
  126. package/lib/module/shared/configs/presets.js +3 -4
  127. package/lib/module/shared/configs/presets.js.map +1 -1
  128. package/lib/module/shared/constants.js +16 -2
  129. package/lib/module/shared/constants.js.map +1 -1
  130. package/lib/module/shared/hooks/animation/use-associated-style.js +2 -2
  131. package/lib/module/shared/hooks/animation/use-associated-style.js.map +1 -1
  132. package/lib/module/shared/providers/gestures/handlers/use-handlers.js +12 -9
  133. package/lib/module/shared/providers/gestures/handlers/use-handlers.js.map +1 -1
  134. package/lib/module/shared/providers/gestures/helpers/gesture-physics.js +3 -2
  135. package/lib/module/shared/providers/gestures/helpers/gesture-physics.js.map +1 -1
  136. package/lib/module/shared/providers/gestures/helpers/gesture-reset.js +7 -5
  137. package/lib/module/shared/providers/gestures/helpers/gesture-reset.js.map +1 -1
  138. package/lib/module/shared/providers/gestures/helpers/gesture-snap-points.js +5 -5
  139. package/lib/module/shared/providers/gestures/helpers/gesture-snap-points.js.map +1 -1
  140. package/lib/module/shared/providers/gestures/helpers/gesture-targets.js +9 -6
  141. package/lib/module/shared/providers/gestures/helpers/gesture-targets.js.map +1 -1
  142. package/lib/module/shared/providers/gestures/helpers/register-direction-claims.js +1 -1
  143. package/lib/module/shared/providers/gestures/helpers/register-direction-claims.js.map +1 -1
  144. package/lib/module/shared/providers/gestures/use-build-gestures.js +1 -1
  145. package/lib/module/shared/providers/gestures/use-build-gestures.js.map +1 -1
  146. package/lib/module/shared/providers/register-bounds.provider.js +5 -5
  147. package/lib/module/shared/providers/register-bounds.provider.js.map +1 -1
  148. package/lib/module/shared/providers/screen/animation/helpers/has-transitions-enabled.js +12 -0
  149. package/lib/module/shared/providers/screen/animation/helpers/has-transitions-enabled.js.map +1 -0
  150. package/lib/module/shared/providers/screen/animation/helpers/hydrate-transition-state.js +67 -0
  151. package/lib/module/shared/providers/screen/animation/helpers/hydrate-transition-state.js.map +1 -0
  152. package/lib/module/shared/providers/screen/animation/helpers/pipeline.js +22 -108
  153. package/lib/module/shared/providers/screen/animation/helpers/pipeline.js.map +1 -1
  154. package/lib/module/shared/providers/screen/animation/helpers/use-build-transition-state.js +37 -0
  155. package/lib/module/shared/providers/screen/animation/helpers/use-build-transition-state.js.map +1 -0
  156. package/lib/module/shared/providers/screen/helpers/resolve-interpolated-style-output.js +15 -2
  157. package/lib/module/shared/providers/screen/helpers/resolve-interpolated-style-output.js.map +1 -1
  158. package/lib/module/shared/providers/screen/styles.provider.js +5 -2
  159. package/lib/module/shared/providers/screen/styles.provider.js.map +1 -1
  160. package/lib/module/shared/providers/stack/direct.provider.js +1 -1
  161. package/lib/module/shared/providers/stack/direct.provider.js.map +1 -1
  162. package/lib/module/shared/providers/stack/helpers/use-processed-routes.js +1 -1
  163. package/lib/module/shared/providers/stack/helpers/use-processed-routes.js.map +1 -1
  164. package/lib/module/shared/stores/animation.store.js +12 -40
  165. package/lib/module/shared/stores/animation.store.js.map +1 -1
  166. package/lib/module/shared/stores/gesture.store.js +13 -33
  167. package/lib/module/shared/stores/gesture.store.js.map +1 -1
  168. package/lib/module/shared/stores/system.store.js +27 -0
  169. package/lib/module/shared/stores/system.store.js.map +1 -0
  170. package/lib/module/shared/types/bounds.types.js +9 -1
  171. package/lib/module/shared/types/bounds.types.js.map +1 -1
  172. package/lib/module/shared/utils/animation/animate-to-progress.js +2 -2
  173. package/lib/module/shared/utils/animation/animate-to-progress.js.map +1 -1
  174. package/lib/module/shared/utils/bounds/helpers/compute-bounds-styles.js.map +1 -1
  175. package/lib/module/shared/utils/bounds/index.js +23 -50
  176. package/lib/module/shared/utils/bounds/index.js.map +1 -1
  177. package/lib/module/shared/utils/bounds/zoom/build.js +101 -355
  178. package/lib/module/shared/utils/bounds/zoom/build.js.map +1 -1
  179. package/lib/module/shared/utils/bounds/zoom/config.js +12 -98
  180. package/lib/module/shared/utils/bounds/zoom/config.js.map +1 -1
  181. package/lib/module/shared/utils/bounds/zoom/math.js +136 -0
  182. package/lib/module/shared/utils/bounds/zoom/math.js.map +1 -0
  183. package/lib/module/shared/utils/bounds/zoom/types.js +1 -1
  184. package/lib/module/shared/utils/bounds/zoom/types.js.map +1 -1
  185. package/lib/module/shared/utils/create-store.js +50 -0
  186. package/lib/module/shared/utils/create-store.js.map +1 -0
  187. package/lib/typescript/shared/animation/snap-to.d.ts.map +1 -1
  188. package/lib/typescript/shared/components/create-boundary-component/hooks/use-group-active-measurement.d.ts +1 -2
  189. package/lib/typescript/shared/components/create-boundary-component/hooks/use-group-active-measurement.d.ts.map +1 -1
  190. package/lib/typescript/shared/components/create-boundary-component/hooks/use-initial-layout-handler.d.ts.map +1 -1
  191. package/lib/typescript/shared/components/create-boundary-component/index.d.ts.map +1 -1
  192. package/lib/typescript/shared/components/native-screen.d.ts.map +1 -1
  193. package/lib/typescript/shared/components/screen-container/hooks/use-content-layout.d.ts.map +1 -1
  194. package/lib/typescript/shared/components/screen-container/layers/backdrop.d.ts.map +1 -1
  195. package/lib/typescript/shared/components/screen-container/layers/content.d.ts.map +1 -1
  196. package/lib/typescript/shared/components/screen-container/layers/maybe-masked-navigation-container.d.ts.map +1 -1
  197. package/lib/typescript/shared/components/screen-lifecycle/hooks/use-close-transition/helpers/reset-stores-for-screen.d.ts.map +1 -1
  198. package/lib/typescript/shared/components/screen-lifecycle/hooks/use-close-transition/index.d.ts +2 -1
  199. package/lib/typescript/shared/components/screen-lifecycle/hooks/use-close-transition/index.d.ts.map +1 -1
  200. package/lib/typescript/shared/components/screen-lifecycle/hooks/use-open-transition.d.ts +2 -1
  201. package/lib/typescript/shared/components/screen-lifecycle/hooks/use-open-transition.d.ts.map +1 -1
  202. package/lib/typescript/shared/components/screen-lifecycle/index.d.ts.map +1 -1
  203. package/lib/typescript/shared/configs/presets.d.ts.map +1 -1
  204. package/lib/typescript/shared/constants.d.ts.map +1 -1
  205. package/lib/typescript/shared/hooks/animation/use-associated-style.d.ts.map +1 -1
  206. package/lib/typescript/shared/index.d.ts +3 -3
  207. package/lib/typescript/shared/index.d.ts.map +1 -1
  208. package/lib/typescript/shared/providers/gestures/handlers/use-handlers.d.ts.map +1 -1
  209. package/lib/typescript/shared/providers/gestures/helpers/gesture-physics.d.ts.map +1 -1
  210. package/lib/typescript/shared/providers/gestures/helpers/gesture-reset.d.ts.map +1 -1
  211. package/lib/typescript/shared/providers/gestures/helpers/gesture-snap-points.d.ts +2 -2
  212. package/lib/typescript/shared/providers/gestures/helpers/gesture-snap-points.d.ts.map +1 -1
  213. package/lib/typescript/shared/providers/gestures/helpers/gesture-targets.d.ts.map +1 -1
  214. package/lib/typescript/shared/providers/gestures/use-build-gestures.d.ts.map +1 -1
  215. package/lib/typescript/shared/providers/register-bounds.provider.d.ts.map +1 -1
  216. package/lib/typescript/shared/providers/screen/animation/helpers/has-transitions-enabled.d.ts +8 -0
  217. package/lib/typescript/shared/providers/screen/animation/helpers/has-transitions-enabled.d.ts.map +1 -0
  218. package/lib/typescript/shared/providers/screen/animation/helpers/hydrate-transition-state.d.ts +22 -0
  219. package/lib/typescript/shared/providers/screen/animation/helpers/hydrate-transition-state.d.ts.map +1 -0
  220. package/lib/typescript/shared/providers/screen/animation/helpers/pipeline.d.ts +4 -2
  221. package/lib/typescript/shared/providers/screen/animation/helpers/pipeline.d.ts.map +1 -1
  222. package/lib/typescript/shared/providers/screen/animation/helpers/use-build-transition-state.d.ts +21 -0
  223. package/lib/typescript/shared/providers/screen/animation/helpers/use-build-transition-state.d.ts.map +1 -0
  224. package/lib/typescript/shared/providers/screen/helpers/resolve-interpolated-style-output.d.ts +6 -2
  225. package/lib/typescript/shared/providers/screen/helpers/resolve-interpolated-style-output.d.ts.map +1 -1
  226. package/lib/typescript/shared/providers/screen/styles.provider.d.ts.map +1 -1
  227. package/lib/typescript/shared/stores/animation.store.d.ts +10 -17
  228. package/lib/typescript/shared/stores/animation.store.d.ts.map +1 -1
  229. package/lib/typescript/shared/stores/gesture.store.d.ts +24 -14
  230. package/lib/typescript/shared/stores/gesture.store.d.ts.map +1 -1
  231. package/lib/typescript/shared/stores/system.store.d.ts +27 -0
  232. package/lib/typescript/shared/stores/system.store.d.ts.map +1 -0
  233. package/lib/typescript/shared/types/animation.types.d.ts +38 -9
  234. package/lib/typescript/shared/types/animation.types.d.ts.map +1 -1
  235. package/lib/typescript/shared/types/bounds.types.d.ts +14 -42
  236. package/lib/typescript/shared/types/bounds.types.d.ts.map +1 -1
  237. package/lib/typescript/shared/types/index.d.ts +2 -2
  238. package/lib/typescript/shared/types/index.d.ts.map +1 -1
  239. package/lib/typescript/shared/types/screen.types.d.ts +11 -0
  240. package/lib/typescript/shared/types/screen.types.d.ts.map +1 -1
  241. package/lib/typescript/shared/utils/animation/animate-to-progress.d.ts +3 -1
  242. package/lib/typescript/shared/utils/animation/animate-to-progress.d.ts.map +1 -1
  243. package/lib/typescript/shared/utils/bounds/helpers/compute-bounds-styles.d.ts.map +1 -1
  244. package/lib/typescript/shared/utils/bounds/index.d.ts +2 -3
  245. package/lib/typescript/shared/utils/bounds/index.d.ts.map +1 -1
  246. package/lib/typescript/shared/utils/bounds/zoom/build.d.ts +2 -3
  247. package/lib/typescript/shared/utils/bounds/zoom/build.d.ts.map +1 -1
  248. package/lib/typescript/shared/utils/bounds/zoom/config.d.ts +15 -41
  249. package/lib/typescript/shared/utils/bounds/zoom/config.d.ts.map +1 -1
  250. package/lib/typescript/shared/utils/bounds/zoom/math.d.ts +44 -0
  251. package/lib/typescript/shared/utils/bounds/zoom/math.d.ts.map +1 -0
  252. package/lib/typescript/shared/utils/bounds/zoom/types.d.ts +8 -13
  253. package/lib/typescript/shared/utils/bounds/zoom/types.d.ts.map +1 -1
  254. package/lib/typescript/shared/utils/create-store.d.ts +14 -0
  255. package/lib/typescript/shared/utils/create-store.d.ts.map +1 -0
  256. package/package.json +1 -1
  257. package/src/component-stack/components/component-screen.tsx +1 -1
  258. package/src/shared/animation/snap-to.ts +10 -4
  259. package/src/shared/components/create-boundary-component/hooks/helpers/measurement-rules.ts +1 -1
  260. package/src/shared/components/create-boundary-component/hooks/use-group-active-measurement.ts +82 -10
  261. package/src/shared/components/create-boundary-component/hooks/use-initial-layout-handler.ts +2 -5
  262. package/src/shared/components/create-boundary-component/index.tsx +6 -12
  263. package/src/shared/components/native-screen.tsx +3 -9
  264. package/src/shared/components/screen-container/deferred-visibility-host.tsx +2 -2
  265. package/src/shared/components/screen-container/hooks/use-content-layout.ts +42 -43
  266. package/src/shared/components/screen-container/layers/backdrop.tsx +12 -6
  267. package/src/shared/components/screen-container/layers/content.tsx +17 -49
  268. package/src/shared/components/screen-container/layers/maybe-masked-navigation-container.tsx +26 -5
  269. package/src/shared/components/screen-lifecycle/hooks/use-close-transition/helpers/reset-stores-for-screen.ts +4 -2
  270. package/src/shared/components/screen-lifecycle/hooks/use-close-transition/index.ts +8 -0
  271. package/src/shared/components/screen-lifecycle/hooks/use-open-transition.ts +21 -10
  272. package/src/shared/components/screen-lifecycle/index.tsx +8 -2
  273. package/src/shared/configs/presets.ts +8 -7
  274. package/src/shared/constants.ts +14 -0
  275. package/src/shared/hooks/animation/use-associated-style.ts +2 -8
  276. package/src/shared/index.ts +2 -0
  277. package/src/shared/providers/gestures/handlers/use-handlers.ts +13 -10
  278. package/src/shared/providers/gestures/helpers/gesture-physics.ts +4 -2
  279. package/src/shared/providers/gestures/helpers/gesture-reset.ts +9 -5
  280. package/src/shared/providers/gestures/helpers/gesture-snap-points.ts +12 -10
  281. package/src/shared/providers/gestures/helpers/gesture-targets.ts +14 -6
  282. package/src/shared/providers/gestures/helpers/register-direction-claims.ts +1 -1
  283. package/src/shared/providers/gestures/use-build-gestures.ts +1 -3
  284. package/src/shared/providers/register-bounds.provider.tsx +5 -11
  285. package/src/shared/providers/screen/animation/helpers/has-transitions-enabled.ts +14 -0
  286. package/src/shared/providers/screen/animation/helpers/hydrate-transition-state.ts +108 -0
  287. package/src/shared/providers/screen/animation/helpers/pipeline.ts +37 -199
  288. package/src/shared/providers/screen/animation/helpers/use-build-transition-state.ts +77 -0
  289. package/src/shared/providers/screen/helpers/resolve-interpolated-style-output.ts +24 -4
  290. package/src/shared/providers/screen/styles.provider.tsx +5 -1
  291. package/src/shared/providers/stack/direct.provider.tsx +1 -1
  292. package/src/shared/providers/stack/helpers/use-processed-routes.ts +1 -1
  293. package/src/shared/stores/animation.store.ts +11 -61
  294. package/src/shared/stores/gesture.store.ts +25 -45
  295. package/src/shared/stores/system.store.ts +44 -0
  296. package/src/shared/types/animation.types.ts +41 -9
  297. package/src/shared/types/bounds.types.ts +25 -25
  298. package/src/shared/types/index.ts +2 -0
  299. package/src/shared/types/screen.types.ts +12 -0
  300. package/src/shared/utils/animation/animate-to-progress.ts +4 -2
  301. package/src/shared/utils/bounds/helpers/compute-bounds-styles.ts +0 -1
  302. package/src/shared/utils/bounds/index.ts +26 -75
  303. package/src/shared/utils/bounds/zoom/build.ts +179 -502
  304. package/src/shared/utils/bounds/zoom/config.ts +14 -164
  305. package/src/shared/utils/bounds/zoom/math.ts +193 -0
  306. package/src/shared/utils/bounds/zoom/types.ts +15 -17
  307. package/src/shared/utils/create-store.ts +62 -0
  308. package/lib/commonjs/shared/utils/bounds/types/frame-props.js +0 -6
  309. package/lib/commonjs/shared/utils/bounds/types/frame-props.js.map +0 -1
  310. package/lib/commonjs/shared/utils/bounds/zoom/accessor.js +0 -54
  311. package/lib/commonjs/shared/utils/bounds/zoom/accessor.js.map +0 -1
  312. package/lib/commonjs/shared/utils/bounds/zoom/index.js +0 -20
  313. package/lib/commonjs/shared/utils/bounds/zoom/index.js.map +0 -1
  314. package/lib/module/shared/utils/bounds/types/frame-props.js +0 -4
  315. package/lib/module/shared/utils/bounds/types/frame-props.js.map +0 -1
  316. package/lib/module/shared/utils/bounds/zoom/accessor.js +0 -49
  317. package/lib/module/shared/utils/bounds/zoom/accessor.js.map +0 -1
  318. package/lib/module/shared/utils/bounds/zoom/index.js +0 -5
  319. package/lib/module/shared/utils/bounds/zoom/index.js.map +0 -1
  320. package/lib/typescript/shared/utils/bounds/types/frame-props.d.ts +0 -5
  321. package/lib/typescript/shared/utils/bounds/types/frame-props.d.ts.map +0 -1
  322. package/lib/typescript/shared/utils/bounds/zoom/accessor.d.ts +0 -17
  323. package/lib/typescript/shared/utils/bounds/zoom/accessor.d.ts.map +0 -1
  324. package/lib/typescript/shared/utils/bounds/zoom/index.d.ts +0 -3
  325. package/lib/typescript/shared/utils/bounds/zoom/index.d.ts.map +0 -1
  326. package/src/shared/utils/bounds/types/frame-props.ts +0 -5
  327. package/src/shared/utils/bounds/zoom/accessor.ts +0 -69
  328. package/src/shared/utils/bounds/zoom/index.ts +0 -2
@@ -7,308 +7,51 @@ exports.buildZoomStyles = void 0;
7
7
  var _reactNativeReanimated = require("react-native-reanimated");
8
8
  var _constants = require("../../../constants");
9
9
  var _bounds = require("../../../stores/bounds");
10
+ var _computeBoundsStyles = require("../helpers/compute-bounds-styles");
10
11
  var _config = require("./config");
12
+ var _math = require("./math");
11
13
  const IDENTITY_DRAG_SCALE_OUTPUT = [1, 1];
12
- const clamp = (value, min, max) => {
14
+ const getSourceBorderRadius = resolvedPair => {
13
15
  "worklet";
14
16
 
15
- const lower = min < max ? min : max;
16
- const upper = max > min ? max : min;
17
- if (value < lower) return lower;
18
- if (value > upper) return upper;
19
- return value;
20
- };
21
- const clamp01 = value => {
22
- "worklet";
23
-
24
- return clamp(value, 0, 1);
25
- };
26
- const lerp = (from, to, t) => {
27
- "worklet";
28
-
29
- return from + (to - from) * t;
30
- };
31
- const safeDivide = (numerator, denominator, fallback = 0) => {
32
- "worklet";
33
-
34
- if (denominator === 0) return fallback;
35
- return numerator / denominator;
36
- };
37
- const inverseLerp = (value, inMin, inMax) => {
38
- "worklet";
39
-
40
- return safeDivide(value - inMin, inMax - inMin, 0);
41
- };
42
- const mapRangeClamped = (value, inMin, inMax, outMin, outMax) => {
43
- "worklet";
44
-
45
- const t = clamp01(inverseLerp(value, inMin, inMax));
46
- return lerp(outMin, outMax, t);
47
- };
48
- const applyPowerCurve = (value, exponent) => {
49
- "worklet";
50
-
51
- const safeExponent = exponent > 0 ? exponent : 1;
52
- const magnitude = Math.abs(value) ** safeExponent;
53
- return value < 0 ? -magnitude : magnitude;
54
- };
55
- const normalizedToTranslation = ({
56
- normalized,
57
- dimension,
58
- resistance
59
- }) => {
60
- "worklet";
61
-
62
- const distance = Math.max(0, dimension) * resistance;
63
- return mapRangeClamped(normalized, -1, 1, -distance, distance);
64
- };
65
- const normalizedToScale = ({
66
- normalized,
67
- outputRange,
68
- exponent = 1,
69
- positiveOnly = true
70
- }) => {
71
- "worklet";
72
-
73
- const [outputStart, outputEnd] = outputRange;
74
- const raw = positiveOnly ? mapRangeClamped(normalized, 0, 1, outputStart, outputEnd) : mapRangeClamped(normalized, -1, 1, outputStart, outputEnd);
75
- return applyPowerCurve(raw, exponent);
76
- };
77
- const combineScales = (scaleX, scaleY, mode = "multiply") => {
78
- "worklet";
79
-
80
- switch (mode) {
81
- case "average":
82
- return (scaleX + scaleY) / 2;
83
- case "max":
84
- return Math.max(scaleX, scaleY);
85
- case "min":
86
- return Math.min(scaleX, scaleY);
87
- default:
88
- return scaleX * scaleY;
89
- }
90
- };
91
- const computeCenterScaleShift = ({
92
- center,
93
- containerCenter,
94
- scale
95
- }) => {
96
- "worklet";
97
-
98
- return (center - containerCenter) * (scale - 1);
99
- };
100
- const compensateTranslationForParentScale = ({
101
- translation,
102
- parentScale,
103
- epsilon
104
- }) => {
105
- "worklet";
106
-
107
- const safeParentScale = Math.max(parentScale, epsilon);
108
- return safeDivide(translation, safeParentScale, translation);
109
- };
110
- const composeCompensatedTranslation = ({
111
- gesture,
112
- parentScale,
113
- centerShift = 0,
114
- epsilon
115
- }) => {
116
- "worklet";
117
-
118
- return compensateTranslationForParentScale({
119
- translation: gesture,
120
- parentScale,
121
- epsilon
122
- }) + centerShift;
123
- };
124
- const resolveDirectionalDragScale = ({
125
- normalized,
126
- dismissDirection,
127
- shrinkMin,
128
- growMax,
129
- exponent
130
- }) => {
131
- "worklet";
132
-
133
- const dismissalRelative = dismissDirection === "negative" ? -normalized : normalized;
134
- if (dismissalRelative >= 0) {
135
- return normalizedToScale({
136
- normalized: dismissalRelative,
137
- outputRange: [1, shrinkMin],
138
- exponent
139
- });
140
- }
141
- const oppositeDrag = Math.min(1, Math.abs(dismissalRelative));
142
- return (0, _reactNativeReanimated.interpolate)(oppositeDrag, [0, 1], [1, growMax], "clamp");
17
+ return typeof resolvedPair.sourceStyles?.borderRadius === "number" ? resolvedPair.sourceStyles.borderRadius : 0;
143
18
  };
144
19
  const getZoomContentTarget = ({
145
20
  explicitTarget,
146
- resolvedTag,
147
- currentRouteKey,
148
- previousRouteKey,
149
- nextRouteKey,
150
- entering,
151
21
  screenLayout,
152
22
  anchor,
153
23
  resolvedPair
154
24
  }) => {
155
25
  "worklet";
156
26
 
157
- if (explicitTarget !== undefined) return explicitTarget;
158
- const pair = resolvedPair ?? _bounds.BoundStore.resolveTransitionPair(resolvedTag, {
159
- currentScreenKey: currentRouteKey,
160
- previousScreenKey: previousRouteKey,
161
- nextScreenKey: nextRouteKey,
162
- entering
163
- });
164
- const sourceBounds = pair.sourceBounds;
27
+ if (explicitTarget) return explicitTarget;
28
+ const sourceBounds = resolvedPair.sourceBounds;
165
29
  const screenWidth = screenLayout.width;
166
30
  if (!sourceBounds || sourceBounds.width <= 0 || screenWidth <= 0) {
167
31
  return "fullscreen";
168
32
  }
169
33
  const height = sourceBounds.height / sourceBounds.width * screenWidth;
170
- let horizontalAnchor;
171
- switch (anchor) {
172
- case "topLeading":
173
- case "leading":
174
- case "bottomLeading":
175
- horizontalAnchor = "leading";
176
- break;
177
- case "topTrailing":
178
- case "trailing":
179
- case "bottomTrailing":
180
- horizontalAnchor = "trailing";
181
- break;
182
- default:
183
- horizontalAnchor = "center";
184
- break;
185
- }
186
- let verticalAnchor;
187
- switch (anchor) {
188
- case "topLeading":
189
- case "top":
190
- case "topTrailing":
191
- verticalAnchor = "top";
192
- break;
193
- case "bottomLeading":
194
- case "bottom":
195
- case "bottomTrailing":
196
- verticalAnchor = "bottom";
197
- break;
198
- default:
199
- verticalAnchor = "center";
200
- break;
201
- }
202
- const x = horizontalAnchor === "leading" ? 0 : horizontalAnchor === "trailing" ? screenLayout.width - screenWidth : (screenLayout.width - screenWidth) / 2;
34
+ const verticalAnchor = anchor === "bottomLeading" || anchor === "bottom" || anchor === "bottomTrailing" ? "bottom" : anchor === "center" || anchor === "leading" || anchor === "trailing" ? "center" : "top";
203
35
  const y = verticalAnchor === "top" ? 0 : verticalAnchor === "bottom" ? screenLayout.height - height : (screenLayout.height - height) / 2;
204
36
  return {
205
- x,
37
+ x: 0,
206
38
  y,
207
- pageX: x,
39
+ pageX: 0,
208
40
  pageY: y,
209
41
  width: screenWidth,
210
42
  height
211
43
  };
212
44
  };
213
- const getStyleRadius = (styles, property) => {
214
- "worklet";
215
-
216
- if (!styles || typeof styles !== "object") return undefined;
217
- const styleRecord = styles;
218
- const direct = styleRecord[property];
219
- if (typeof direct === "number") return direct;
220
- if (property !== "borderRadius") {
221
- const fallback = styleRecord.borderRadius;
222
- if (typeof fallback === "number") return fallback;
223
- }
224
- return undefined;
225
- };
226
- const resolveRadiusRange = ({
227
- value,
228
- progress,
229
- sourceRadius,
230
- destinationRadius,
231
- fallback
232
- }) => {
233
- "worklet";
234
-
235
- if (typeof value === "number") return value;
236
- if (value === "auto") {
237
- const from = sourceRadius ?? fallback;
238
- const to = destinationRadius ?? fallback;
239
- return (0, _reactNativeReanimated.interpolate)(progress, [0, 1], [from, to], "clamp");
240
- }
241
- if (value && typeof value === "object") {
242
- const from = typeof value.from === "number" ? value.from : fallback;
243
- const to = typeof value.to === "number" ? value.to : fallback;
244
- return (0, _reactNativeReanimated.interpolate)(progress, [0, 1], [from, to], "clamp");
245
- }
246
- const from = sourceRadius ?? fallback;
247
- const to = destinationRadius ?? fallback;
248
- return (0, _reactNativeReanimated.interpolate)(progress, [0, 1], [from, to], "clamp");
249
- };
250
- const resolveMaskRadii = ({
251
- progress,
252
- zoomOptions,
253
- resolvedPair
254
- }) => {
255
- "worklet";
256
-
257
- const sourceStyles = resolvedPair.sourceStyles;
258
- const destinationStyles = resolvedPair.destinationStyles;
259
- const defaultRadius = resolveRadiusRange({
260
- value: zoomOptions.mask.borderRadius,
261
- progress,
262
- sourceRadius: getStyleRadius(sourceStyles, "borderRadius"),
263
- destinationRadius: getStyleRadius(destinationStyles, "borderRadius"),
264
- fallback: 12
265
- });
266
- const topLeftValue = zoomOptions.mask.borderTopLeftRadius ?? zoomOptions.mask.borderRadius;
267
- const topRightValue = zoomOptions.mask.borderTopRightRadius ?? zoomOptions.mask.borderRadius;
268
- const bottomLeftValue = zoomOptions.mask.borderBottomLeftRadius ?? zoomOptions.mask.borderRadius;
269
- const bottomRightValue = zoomOptions.mask.borderBottomRightRadius ?? zoomOptions.mask.borderRadius;
270
- return {
271
- borderRadius: defaultRadius,
272
- borderTopLeftRadius: resolveRadiusRange({
273
- value: topLeftValue,
274
- progress,
275
- sourceRadius: getStyleRadius(sourceStyles, "borderTopLeftRadius"),
276
- destinationRadius: getStyleRadius(destinationStyles, "borderTopLeftRadius"),
277
- fallback: defaultRadius
278
- }),
279
- borderTopRightRadius: resolveRadiusRange({
280
- value: topRightValue,
281
- progress,
282
- sourceRadius: getStyleRadius(sourceStyles, "borderTopRightRadius"),
283
- destinationRadius: getStyleRadius(destinationStyles, "borderTopRightRadius"),
284
- fallback: defaultRadius
285
- }),
286
- borderBottomLeftRadius: resolveRadiusRange({
287
- value: bottomLeftValue,
288
- progress,
289
- sourceRadius: getStyleRadius(sourceStyles, "borderBottomLeftRadius"),
290
- destinationRadius: getStyleRadius(destinationStyles, "borderBottomLeftRadius"),
291
- fallback: defaultRadius
292
- }),
293
- borderBottomRightRadius: resolveRadiusRange({
294
- value: bottomRightValue,
295
- progress,
296
- sourceRadius: getStyleRadius(sourceStyles, "borderBottomRightRadius"),
297
- destinationRadius: getStyleRadius(destinationStyles, "borderBottomRightRadius"),
298
- fallback: defaultRadius
299
- })
300
- };
301
- };
302
45
  const buildZoomStyles = ({
303
- id,
304
- group,
46
+ resolvedTag,
305
47
  zoomOptions,
306
- props,
307
- resolveTag,
308
- computeRaw
48
+ props
309
49
  }) => {
310
50
  "worklet";
311
51
 
52
+ if (!resolvedTag) return {};
53
+ const explicitTarget = zoomOptions?.target;
54
+ const debug = zoomOptions?.DEBUG === true;
312
55
  const focused = props.focused;
313
56
  const progress = props.progress;
314
57
  const currentRouteKey = props.current?.route.key;
@@ -316,94 +59,103 @@ const buildZoomStyles = ({
316
59
  const nextRouteKey = props.next?.route.key;
317
60
  const entering = !props.next;
318
61
  const screenLayout = props.layouts.screen;
319
- const transitionContext = {
62
+ const resolvedZoomAnchor = (0, _config.getZoomAnchor)(explicitTarget);
63
+ const zoomComputeParams = {
64
+ id: resolvedTag,
65
+ previous: props.previous,
66
+ current: props.current,
67
+ next: props.next,
68
+ progress,
69
+ dimensions: screenLayout
70
+ };
71
+ const baseRawOptions = {
72
+ id: resolvedTag,
73
+ raw: true,
74
+ scaleMode: _config.ZOOM_SHARED_OPTIONS.scaleMode
75
+ };
76
+ const resolvedPair = _bounds.BoundStore.resolveTransitionPair(resolvedTag, {
320
77
  currentScreenKey: currentRouteKey,
321
78
  previousScreenKey: previousRouteKey,
322
79
  nextScreenKey: nextRouteKey,
323
80
  entering
324
- };
325
- const resolvedConfig = (0, _config.resolveZoomConfig)({
326
- id,
327
- group,
328
- zoomOptions,
329
- currentRouteKey,
330
- resolveTag,
331
- defaultAnchor: "top"
332
81
  });
333
- if (!resolvedConfig) return null;
334
- const {
335
- resolvedTag,
336
- sharedOptions,
337
- explicitTarget,
338
- zoomOptions: resolvedZoomOptions
339
- } = resolvedConfig;
340
- const resolvedPair = _bounds.BoundStore.resolveTransitionPair(resolvedTag, transitionContext);
82
+ const sourceBorderRadius = getSourceBorderRadius(resolvedPair);
83
+ const targetBorderRadius = zoomOptions?.borderRadius ?? sourceBorderRadius;
341
84
  const focusedVisibilityStyles = {
342
85
  [resolvedTag]: _constants.VISIBLE_STYLE
343
86
  };
344
- if (!resolvedPair.sourceBounds) {
87
+ const focusedContainerStyleId = props.navigationMaskEnabled ? _constants.NAVIGATION_MASK_CONTAINER_STYLE_ID : "content";
88
+
89
+ // To avoid initial flickering, we'll want to hide if there are no source bounds
90
+ // But to also avoid scenarios where activeId changes in dst and theres a failed measurement,
91
+ // we should only hide if entering and there is no source bounds.
92
+ if (!resolvedPair.sourceBounds && props.active.entering) {
345
93
  return {
346
- [_constants.NAVIGATION_MASK_CONTAINER_STYLE_ID]: _constants.HIDDEN_STYLE
94
+ [focusedContainerStyleId]: _constants.HIDDEN_STYLE
347
95
  };
348
96
  }
349
97
  const normX = props.active.gesture.normX;
350
98
  const normY = props.active.gesture.normY;
351
99
  const initialDirection = props.active.gesture.direction;
352
- const dragX = normalizedToTranslation({
100
+ const dragX = (0, _math.normalizedToTranslation)({
353
101
  normalized: normX,
354
102
  dimension: screenLayout.width,
355
- resistance: resolvedZoomOptions.motion.dragResistance
103
+ resistance: _config.ZOOM_DRAG_RESISTANCE
356
104
  });
357
- const dragY = normalizedToTranslation({
105
+ const dragY = (0, _math.normalizedToTranslation)({
358
106
  normalized: normY,
359
107
  dimension: screenLayout.height,
360
- resistance: resolvedZoomOptions.motion.dragResistance
108
+ resistance: _config.ZOOM_DRAG_RESISTANCE
361
109
  });
362
- const dragXScale = initialDirection === "horizontal" || initialDirection === "horizontal-inverted" ? resolveDirectionalDragScale({
110
+ const dragXScale = initialDirection === "horizontal" || initialDirection === "horizontal-inverted" ? (0, _math.resolveDirectionalDragScale)({
363
111
  normalized: normX,
364
112
  dismissDirection: initialDirection === "horizontal-inverted" ? "negative" : "positive",
365
- shrinkMin: resolvedZoomOptions.motion.dragDirectionalScaleMin,
366
- growMax: resolvedZoomOptions.motion.dragDirectionalScaleMax,
113
+ shrinkMin: _config.ZOOM_DRAG_DIRECTIONAL_SCALE_MIN,
114
+ growMax: _config.ZOOM_DRAG_DIRECTIONAL_SCALE_MAX,
367
115
  exponent: 2
368
116
  }) : IDENTITY_DRAG_SCALE_OUTPUT[0];
369
- const dragYScale = initialDirection === "vertical" || initialDirection === "vertical-inverted" ? resolveDirectionalDragScale({
117
+ const dragYScale = initialDirection === "vertical" || initialDirection === "vertical-inverted" ? (0, _math.resolveDirectionalDragScale)({
370
118
  normalized: normY,
371
119
  dismissDirection: initialDirection === "vertical-inverted" ? "negative" : "positive",
372
- shrinkMin: resolvedZoomOptions.motion.dragDirectionalScaleMin,
373
- growMax: resolvedZoomOptions.motion.dragDirectionalScaleMax,
120
+ shrinkMin: _config.ZOOM_DRAG_DIRECTIONAL_SCALE_MIN,
121
+ growMax: _config.ZOOM_DRAG_DIRECTIONAL_SCALE_MAX,
374
122
  exponent: 2
375
123
  }) : IDENTITY_DRAG_SCALE_OUTPUT[1];
376
- const dragScale = combineScales(dragXScale, dragYScale);
124
+ const dragScale = (0, _math.combineScales)(dragXScale, dragYScale);
377
125
  if (focused) {
378
126
  const contentTarget = getZoomContentTarget({
379
127
  explicitTarget,
380
- resolvedTag,
381
- currentRouteKey,
382
- previousRouteKey,
383
- nextRouteKey,
384
- entering,
385
128
  screenLayout,
386
- anchor: sharedOptions.anchor,
129
+ anchor: _config.ZOOM_SHARED_OPTIONS.anchor,
387
130
  resolvedPair
388
131
  });
389
- const contentRaw = computeRaw({
390
- ...sharedOptions,
132
+ const contentRaw = (0, _computeBoundsStyles.computeBoundStyles)(zoomComputeParams, {
133
+ ...baseRawOptions,
134
+ anchor: resolvedZoomAnchor,
391
135
  method: "content",
392
136
  target: contentTarget
393
- });
394
- const maskRaw = computeRaw({
395
- ...sharedOptions,
137
+ }, resolvedPair);
138
+ const maskRaw = (0, _computeBoundsStyles.computeBoundStyles)(zoomComputeParams, {
139
+ ...baseRawOptions,
140
+ anchor: _config.ZOOM_SHARED_OPTIONS.anchor,
396
141
  method: "size",
397
142
  space: "absolute",
398
143
  target: "fullscreen"
399
- });
400
- const focusedFade = props.active?.closing ? (0, _reactNativeReanimated.interpolate)(progress, [0.6, 1], [0, 1], "clamp") : (0, _reactNativeReanimated.interpolate)(progress, [0, 0.5], [0, 1], "clamp");
144
+ }, resolvedPair);
145
+ const focusedFade = props.active?.closing ? (0, _reactNativeReanimated.interpolate)(progress, [0.6, 1], [0, debug ? 0.5 : 1], "clamp") : (0, _reactNativeReanimated.interpolate)(progress, [0, 0.5], [0, debug ? 0.5 : 1], "clamp");
146
+
147
+ /**
148
+ * This is also how swiftui handles their navigation zoom.
149
+ * They remove clipping as soon as the screen stops animating
150
+ */
151
+ const shouldRemoveClipping = !props.active.animating;
152
+ const focusedMaskBorderRadius = (0, _reactNativeReanimated.interpolate)(progress, [0, 1], [sourceBorderRadius, shouldRemoveClipping ? 0 : targetBorderRadius], "clamp");
401
153
  const {
402
154
  top,
403
155
  right,
404
156
  bottom,
405
157
  left
406
- } = resolvedZoomOptions.mask.outset;
158
+ } = _config.ZOOM_MASK_OUTSET;
407
159
  const maskWidth = Math.max(1, (0, _config.toNumber)(maskRaw.width) + left + right);
408
160
  const maskHeight = Math.max(1, (0, _config.toNumber)(maskRaw.height) + top + bottom);
409
161
  const contentTranslateX = (0, _config.toNumber)(contentRaw.translateX) + dragX;
@@ -411,11 +163,6 @@ const buildZoomStyles = ({
411
163
  const contentScale = (0, _config.toNumber)(contentRaw.scale, 1) * dragScale;
412
164
  const maskTranslateX = (0, _config.toNumber)(maskRaw.translateX) + dragX - left;
413
165
  const maskTranslateY = (0, _config.toNumber)(maskRaw.translateY) + dragY - top;
414
- const maskRadii = resolveMaskRadii({
415
- progress,
416
- zoomOptions: resolvedZoomOptions,
417
- resolvedPair
418
- });
419
166
  const focusedContentStyle = {
420
167
  opacity: focusedFade,
421
168
  transform: [{
@@ -424,73 +171,72 @@ const buildZoomStyles = ({
424
171
  translateY: contentTranslateY
425
172
  }, {
426
173
  scale: contentScale
427
- }]
174
+ }],
175
+ borderRadius: focusedMaskBorderRadius,
176
+ overflow: "hidden"
428
177
  };
429
- return {
430
- [_constants.NAVIGATION_MASK_CONTAINER_STYLE_ID]: {
178
+ const focusedStyles = {
179
+ [focusedContainerStyleId]: {
431
180
  style: focusedContentStyle
432
181
  },
433
- [_constants.NAVIGATION_MASK_ELEMENT_STYLE_ID]: {
182
+ ...focusedVisibilityStyles
183
+ };
184
+ if (props.navigationMaskEnabled) {
185
+ focusedStyles[_constants.NAVIGATION_MASK_ELEMENT_STYLE_ID] = {
434
186
  style: {
435
187
  width: maskWidth,
436
188
  height: maskHeight,
189
+ borderRadius: focusedMaskBorderRadius,
437
190
  transform: [{
438
191
  translateX: maskTranslateX
439
192
  }, {
440
193
  translateY: maskTranslateY
441
194
  }, {
442
195
  scale: dragScale
443
- }],
444
- borderRadius: maskRadii.borderRadius,
445
- borderTopLeftRadius: maskRadii.borderTopLeftRadius,
446
- borderTopRightRadius: maskRadii.borderTopRightRadius,
447
- borderBottomLeftRadius: maskRadii.borderBottomLeftRadius,
448
- borderBottomRightRadius: maskRadii.borderBottomRightRadius,
449
- ...(resolvedZoomOptions.mask.borderCurve ? {
450
- borderCurve: resolvedZoomOptions.mask.borderCurve
451
- } : {})
196
+ }]
452
197
  }
453
- },
454
- ...focusedVisibilityStyles
455
- };
198
+ };
199
+ }
200
+ return focusedStyles;
456
201
  }
457
- const unfocusedFade = props.active?.closing ? (0, _reactNativeReanimated.interpolate)(progress, [1.6, 2], [1, 0], "clamp") : (0, _reactNativeReanimated.interpolate)(progress, [1, 1.5], [1, 0], "clamp");
202
+ const unfocusedFade = props.active?.closing ? (0, _reactNativeReanimated.interpolate)(progress, [1.6, 2], [1, debug ? 1 : 0], "clamp") : (0, _reactNativeReanimated.interpolate)(progress, [1, 1.5], [1, debug ? 1 : 0], "clamp");
458
203
  const unfocusedScale = (0, _reactNativeReanimated.interpolate)(progress, [1, 2], [1, 0.95], "clamp");
459
204
  const isUnfocusedIdle = props.active.settled === 1;
460
- const elementTarget = sharedOptions.scaleMode === "match" ? "fullscreen" : getZoomContentTarget({
205
+ const shouldHideUnfocusedIdle = isUnfocusedIdle && !debug;
206
+ const elementTarget = explicitTarget !== undefined || resolvedPair.destinationBounds ? getZoomContentTarget({
461
207
  explicitTarget,
462
- resolvedTag,
463
- currentRouteKey,
464
- previousRouteKey,
465
- nextRouteKey,
466
- entering,
467
208
  screenLayout,
468
- anchor: sharedOptions.anchor,
209
+ anchor: _config.ZOOM_SHARED_OPTIONS.anchor,
469
210
  resolvedPair
470
- });
471
- const elementRaw = computeRaw({
472
- ...sharedOptions,
211
+ }) : "fullscreen";
212
+ const elementRaw = (0, _computeBoundsStyles.computeBoundStyles)(zoomComputeParams, {
213
+ ...baseRawOptions,
214
+ anchor: resolvedZoomAnchor,
473
215
  method: "transform",
474
216
  space: "relative",
475
217
  target: elementTarget
218
+ }, resolvedPair);
219
+ const boundTargetCenterX = explicitTarget === "bound" && resolvedPair.destinationBounds ? resolvedPair.destinationBounds.pageX + resolvedPair.destinationBounds.width / 2 : undefined;
220
+ const boundTargetCenterY = explicitTarget === "bound" && resolvedPair.destinationBounds ? resolvedPair.destinationBounds.pageY + resolvedPair.destinationBounds.height / 2 : undefined;
221
+ const elementCenterX = boundTargetCenterX ?? (typeof elementTarget === "object" ? elementTarget.pageX + elementTarget.width / 2 : screenLayout.width / 2);
222
+ const elementCenterY = boundTargetCenterY ?? (typeof elementTarget === "object" ? elementTarget.pageY + elementTarget.height / 2 : screenLayout.height / 2);
223
+ const scaleShiftX = (0, _math.computeCenterScaleShift)({
224
+ center: elementCenterX,
225
+ containerCenter: screenLayout.width / 2,
226
+ scale: dragScale
476
227
  });
477
-
478
- // Keep compensation tied to the element target's center. In `scaleMode: "match"`
479
- // this target is fullscreen, so the center offset should resolve to zero.
480
- const elementCenterY = typeof elementTarget === "object" ? elementTarget.pageY + elementTarget.height / 2 : screenLayout.height / 2;
481
- const scaleShiftY = computeCenterScaleShift({
228
+ const scaleShiftY = (0, _math.computeCenterScaleShift)({
482
229
  center: elementCenterY,
483
230
  containerCenter: screenLayout.height / 2,
484
231
  scale: dragScale
485
232
  });
486
- const compensatedGestureX = composeCompensatedTranslation({
233
+ const compensatedGestureX = (0, _math.composeCompensatedTranslation)({
487
234
  gesture: dragX,
488
235
  parentScale: unfocusedScale,
236
+ centerShift: scaleShiftX,
489
237
  epsilon: _constants.EPSILON
490
238
  });
491
- // dragY is measured in screen space and must be unscaled by the parent
492
- // content shrink, while scaleShiftY is already in the parent's local space.
493
- const compensatedGestureY = composeCompensatedTranslation({
239
+ const compensatedGestureY = (0, _math.composeCompensatedTranslation)({
494
240
  gesture: dragY,
495
241
  parentScale: unfocusedScale,
496
242
  centerShift: scaleShiftY,
@@ -500,7 +246,7 @@ const buildZoomStyles = ({
500
246
  const elementTranslateY = (0, _config.toNumber)(elementRaw.translateY) + compensatedGestureY;
501
247
  const elementScaleX = (0, _config.toNumber)(elementRaw.scaleX, 1) * dragScale;
502
248
  const elementScaleY = (0, _config.toNumber)(elementRaw.scaleY, 1) * dragScale;
503
- const resolvedElementStyle = isUnfocusedIdle ? {
249
+ const resolvedElementStyle = shouldHideUnfocusedIdle ? {
504
250
  transform: [{
505
251
  translateX: 0
506
252
  }, {
@@ -515,15 +261,15 @@ const buildZoomStyles = ({
515
261
  elevation: 0
516
262
  } : {
517
263
  transform: [{
518
- translateX: elementTranslateX
264
+ translateX: props.active.settled ? 0 : elementTranslateX
519
265
  }, {
520
- translateY: elementTranslateY
266
+ translateY: props.active.settled ? 0 : elementTranslateY
521
267
  }, {
522
- scaleX: elementScaleX
268
+ scaleX: props.active.settled ? 1 : elementScaleX
523
269
  }, {
524
- scaleY: elementScaleY
270
+ scaleY: props.active.settled ? 1 : elementScaleY
525
271
  }],
526
- opacity: unfocusedFade,
272
+ opacity: debug ? 1 : unfocusedFade,
527
273
  zIndex: 9999,
528
274
  elevation: 9999
529
275
  };