react-native-screen-transitions 3.4.0-alpha.0 → 3.4.0-alpha.1

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 (364) hide show
  1. package/README.md +65 -2
  2. package/lib/commonjs/shared/animation/snap-to.js +5 -1
  3. package/lib/commonjs/shared/animation/snap-to.js.map +1 -1
  4. package/lib/commonjs/shared/components/create-boundary-component/utils/build-boundary-match-key.js +5 -10
  5. package/lib/commonjs/shared/components/create-boundary-component/utils/build-boundary-match-key.js.map +1 -1
  6. package/lib/commonjs/shared/components/overlay/helpers/get-active-overlay.js +2 -2
  7. package/lib/commonjs/shared/components/overlay/helpers/get-active-overlay.js.map +1 -1
  8. package/lib/commonjs/shared/components/overlay/index.js +1 -3
  9. package/lib/commonjs/shared/components/overlay/index.js.map +1 -1
  10. package/lib/commonjs/shared/components/overlay/variations/overlay-host.js +2 -16
  11. package/lib/commonjs/shared/components/overlay/variations/overlay-host.js.map +1 -1
  12. package/lib/commonjs/shared/components/scene-view.js +2 -4
  13. package/lib/commonjs/shared/components/scene-view.js.map +1 -1
  14. package/lib/commonjs/shared/components/screen-container/layers/backdrop.js +9 -6
  15. package/lib/commonjs/shared/components/screen-container/layers/backdrop.js.map +1 -1
  16. package/lib/commonjs/shared/components/screen-container/layers/content.js +47 -55
  17. package/lib/commonjs/shared/components/screen-container/layers/content.js.map +1 -1
  18. package/lib/commonjs/shared/components/screen-container/layers/maybe-masked-navigation-container.js +77 -0
  19. package/lib/commonjs/shared/components/screen-container/layers/maybe-masked-navigation-container.js.map +1 -0
  20. package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-close-transition/index.js.map +1 -1
  21. package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-open-transition.js +17 -4
  22. package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-open-transition.js.map +1 -1
  23. package/lib/commonjs/shared/constants.js +6 -2
  24. package/lib/commonjs/shared/constants.js.map +1 -1
  25. package/lib/commonjs/shared/hooks/gestures/resolve-screen-gesture-target.js +49 -0
  26. package/lib/commonjs/shared/hooks/gestures/resolve-screen-gesture-target.js.map +1 -0
  27. package/lib/commonjs/shared/hooks/gestures/types.js +2 -0
  28. package/lib/commonjs/shared/hooks/gestures/types.js.map +1 -0
  29. package/lib/commonjs/shared/hooks/gestures/use-screen-gesture.js +7 -3
  30. package/lib/commonjs/shared/hooks/gestures/use-screen-gesture.js.map +1 -1
  31. package/lib/commonjs/shared/hooks/navigation/use-stack.js.map +1 -1
  32. package/lib/commonjs/shared/index.js +15 -3
  33. package/lib/commonjs/shared/index.js.map +1 -1
  34. package/lib/commonjs/shared/providers/gestures/handlers/use-handlers.js +55 -18
  35. package/lib/commonjs/shared/providers/gestures/handlers/use-handlers.js.map +1 -1
  36. package/lib/commonjs/shared/providers/gestures/helpers/gesture-snap-points.js +44 -0
  37. package/lib/commonjs/shared/providers/gestures/helpers/gesture-snap-points.js.map +1 -0
  38. package/lib/commonjs/shared/providers/screen/animation/animation.provider.js +31 -17
  39. package/lib/commonjs/shared/providers/screen/animation/animation.provider.js.map +1 -1
  40. package/lib/commonjs/shared/providers/screen/animation/helpers/derivations.js +1 -9
  41. package/lib/commonjs/shared/providers/screen/animation/helpers/derivations.js.map +1 -1
  42. package/lib/commonjs/shared/providers/screen/animation/helpers/pipeline.js +11 -6
  43. package/lib/commonjs/shared/providers/screen/animation/helpers/pipeline.js.map +1 -1
  44. package/lib/commonjs/shared/providers/screen/animation/helpers/resolve-screen-animation-target.js +33 -0
  45. package/lib/commonjs/shared/providers/screen/animation/helpers/resolve-screen-animation-target.js.map +1 -0
  46. package/lib/commonjs/shared/providers/screen/animation/types.js +2 -0
  47. package/lib/commonjs/shared/providers/screen/animation/types.js.map +1 -0
  48. package/lib/commonjs/shared/providers/screen/animation/use-screen-animation.js +9 -3
  49. package/lib/commonjs/shared/providers/screen/animation/use-screen-animation.js.map +1 -1
  50. package/lib/commonjs/shared/providers/stack/direct.provider.js +1 -1
  51. package/lib/commonjs/shared/providers/stack/direct.provider.js.map +1 -1
  52. package/lib/commonjs/shared/providers/stack/helpers/use-processed-routes.js +1 -1
  53. package/lib/commonjs/shared/providers/stack/helpers/use-processed-routes.js.map +1 -1
  54. package/lib/commonjs/shared/stores/animation.store.js +8 -2
  55. package/lib/commonjs/shared/stores/animation.store.js.map +1 -1
  56. package/lib/commonjs/shared/stores/bounds/internals/resolver.js +7 -0
  57. package/lib/commonjs/shared/stores/bounds/internals/resolver.js.map +1 -1
  58. package/lib/commonjs/shared/utils/animation/animate-to-progress.js +6 -0
  59. package/lib/commonjs/shared/utils/animation/animate-to-progress.js.map +1 -1
  60. package/lib/commonjs/shared/utils/bounds/helpers/compute-bounds-styles.js +24 -9
  61. package/lib/commonjs/shared/utils/bounds/helpers/compute-bounds-styles.js.map +1 -1
  62. package/lib/commonjs/shared/utils/bounds/helpers/geometry.js +3 -2
  63. package/lib/commonjs/shared/utils/bounds/helpers/geometry.js.map +1 -1
  64. package/lib/commonjs/shared/utils/bounds/helpers/interpolators.js +3 -2
  65. package/lib/commonjs/shared/utils/bounds/helpers/interpolators.js.map +1 -1
  66. package/lib/commonjs/shared/utils/bounds/helpers/link-accessor.js +2 -2
  67. package/lib/commonjs/shared/utils/bounds/helpers/link-accessor.js.map +1 -1
  68. package/lib/commonjs/shared/utils/bounds/helpers/resolve-bound-tag.js +6 -5
  69. package/lib/commonjs/shared/utils/bounds/helpers/resolve-bound-tag.js.map +1 -1
  70. package/lib/commonjs/shared/utils/bounds/helpers/style-composers.js +4 -3
  71. package/lib/commonjs/shared/utils/bounds/helpers/style-composers.js.map +1 -1
  72. package/lib/commonjs/shared/utils/bounds/index.js +3 -3
  73. package/lib/commonjs/shared/utils/bounds/index.js.map +1 -1
  74. package/lib/commonjs/shared/utils/bounds/zoom/accessor.js +54 -0
  75. package/lib/commonjs/shared/utils/bounds/zoom/accessor.js.map +1 -0
  76. package/lib/commonjs/shared/utils/bounds/zoom/build.js +541 -0
  77. package/lib/commonjs/shared/utils/bounds/zoom/build.js.map +1 -0
  78. package/lib/commonjs/shared/utils/bounds/zoom/config.js +118 -0
  79. package/lib/commonjs/shared/utils/bounds/zoom/config.js.map +1 -0
  80. package/lib/commonjs/shared/utils/bounds/zoom/index.js +20 -0
  81. package/lib/commonjs/shared/utils/bounds/zoom/index.js.map +1 -0
  82. package/lib/commonjs/shared/utils/bounds/zoom/types.js.map +1 -0
  83. package/lib/commonjs/shared/utils/gesture/validate-snap-points.js +11 -5
  84. package/lib/commonjs/shared/utils/gesture/validate-snap-points.js.map +1 -1
  85. package/lib/commonjs/shared/utils/overlay/visibility.js +2 -9
  86. package/lib/commonjs/shared/utils/overlay/visibility.js.map +1 -1
  87. package/lib/module/shared/animation/snap-to.js +5 -1
  88. package/lib/module/shared/animation/snap-to.js.map +1 -1
  89. package/lib/module/shared/components/create-boundary-component/utils/build-boundary-match-key.js +5 -10
  90. package/lib/module/shared/components/create-boundary-component/utils/build-boundary-match-key.js.map +1 -1
  91. package/lib/module/shared/components/overlay/helpers/get-active-overlay.js +3 -3
  92. package/lib/module/shared/components/overlay/helpers/get-active-overlay.js.map +1 -1
  93. package/lib/module/shared/components/overlay/index.js +1 -3
  94. package/lib/module/shared/components/overlay/index.js.map +1 -1
  95. package/lib/module/shared/components/overlay/variations/overlay-host.js +3 -17
  96. package/lib/module/shared/components/overlay/variations/overlay-host.js.map +1 -1
  97. package/lib/module/shared/components/scene-view.js +3 -5
  98. package/lib/module/shared/components/scene-view.js.map +1 -1
  99. package/lib/module/shared/components/screen-container/layers/backdrop.js +9 -6
  100. package/lib/module/shared/components/screen-container/layers/backdrop.js.map +1 -1
  101. package/lib/module/shared/components/screen-container/layers/content.js +52 -60
  102. package/lib/module/shared/components/screen-container/layers/content.js.map +1 -1
  103. package/lib/module/shared/components/screen-container/layers/maybe-masked-navigation-container.js +72 -0
  104. package/lib/module/shared/components/screen-container/layers/maybe-masked-navigation-container.js.map +1 -0
  105. package/lib/module/shared/components/screen-lifecycle/hooks/use-close-transition/index.js.map +1 -1
  106. package/lib/module/shared/components/screen-lifecycle/hooks/use-open-transition.js +17 -4
  107. package/lib/module/shared/components/screen-lifecycle/hooks/use-open-transition.js.map +1 -1
  108. package/lib/module/shared/constants.js +6 -2
  109. package/lib/module/shared/constants.js.map +1 -1
  110. package/lib/module/shared/hooks/gestures/resolve-screen-gesture-target.js +45 -0
  111. package/lib/module/shared/hooks/gestures/resolve-screen-gesture-target.js.map +1 -0
  112. package/lib/module/shared/hooks/gestures/types.js +2 -0
  113. package/lib/module/shared/hooks/gestures/types.js.map +1 -0
  114. package/lib/module/shared/hooks/gestures/use-screen-gesture.js +7 -4
  115. package/lib/module/shared/hooks/gestures/use-screen-gesture.js.map +1 -1
  116. package/lib/module/shared/hooks/navigation/use-stack.js.map +1 -1
  117. package/lib/module/shared/index.js +1 -2
  118. package/lib/module/shared/index.js.map +1 -1
  119. package/lib/module/shared/providers/gestures/handlers/use-handlers.js +55 -18
  120. package/lib/module/shared/providers/gestures/handlers/use-handlers.js.map +1 -1
  121. package/lib/module/shared/providers/gestures/helpers/gesture-snap-points.js +38 -0
  122. package/lib/module/shared/providers/gestures/helpers/gesture-snap-points.js.map +1 -0
  123. package/lib/module/shared/providers/screen/animation/animation.provider.js +30 -15
  124. package/lib/module/shared/providers/screen/animation/animation.provider.js.map +1 -1
  125. package/lib/module/shared/providers/screen/animation/helpers/derivations.js +1 -9
  126. package/lib/module/shared/providers/screen/animation/helpers/derivations.js.map +1 -1
  127. package/lib/module/shared/providers/screen/animation/helpers/pipeline.js +11 -6
  128. package/lib/module/shared/providers/screen/animation/helpers/pipeline.js.map +1 -1
  129. package/lib/module/shared/providers/screen/animation/helpers/resolve-screen-animation-target.js +29 -0
  130. package/lib/module/shared/providers/screen/animation/helpers/resolve-screen-animation-target.js.map +1 -0
  131. package/lib/module/shared/providers/screen/animation/index.js.map +1 -1
  132. package/lib/module/shared/providers/screen/animation/types.js +2 -0
  133. package/lib/module/shared/providers/screen/animation/types.js.map +1 -0
  134. package/lib/module/shared/providers/screen/animation/use-screen-animation.js +9 -3
  135. package/lib/module/shared/providers/screen/animation/use-screen-animation.js.map +1 -1
  136. package/lib/module/shared/providers/stack/direct.provider.js +2 -2
  137. package/lib/module/shared/providers/stack/direct.provider.js.map +1 -1
  138. package/lib/module/shared/providers/stack/helpers/use-processed-routes.js +2 -2
  139. package/lib/module/shared/providers/stack/helpers/use-processed-routes.js.map +1 -1
  140. package/lib/module/shared/stores/animation.store.js +8 -2
  141. package/lib/module/shared/stores/animation.store.js.map +1 -1
  142. package/lib/module/shared/stores/bounds/internals/resolver.js +7 -0
  143. package/lib/module/shared/stores/bounds/internals/resolver.js.map +1 -1
  144. package/lib/module/shared/utils/animation/animate-to-progress.js +6 -0
  145. package/lib/module/shared/utils/animation/animate-to-progress.js.map +1 -1
  146. package/lib/module/shared/utils/bounds/helpers/compute-bounds-styles.js +24 -9
  147. package/lib/module/shared/utils/bounds/helpers/compute-bounds-styles.js.map +1 -1
  148. package/lib/module/shared/utils/bounds/helpers/geometry.js +3 -2
  149. package/lib/module/shared/utils/bounds/helpers/geometry.js.map +1 -1
  150. package/lib/module/shared/utils/bounds/helpers/interpolators.js +3 -2
  151. package/lib/module/shared/utils/bounds/helpers/interpolators.js.map +1 -1
  152. package/lib/module/shared/utils/bounds/helpers/link-accessor.js +2 -2
  153. package/lib/module/shared/utils/bounds/helpers/link-accessor.js.map +1 -1
  154. package/lib/module/shared/utils/bounds/helpers/resolve-bound-tag.js +6 -5
  155. package/lib/module/shared/utils/bounds/helpers/resolve-bound-tag.js.map +1 -1
  156. package/lib/module/shared/utils/bounds/helpers/style-composers.js +4 -3
  157. package/lib/module/shared/utils/bounds/helpers/style-composers.js.map +1 -1
  158. package/lib/module/shared/utils/bounds/index.js +3 -3
  159. package/lib/module/shared/utils/bounds/index.js.map +1 -1
  160. package/lib/module/shared/utils/bounds/zoom/accessor.js +49 -0
  161. package/lib/module/shared/utils/bounds/zoom/accessor.js.map +1 -0
  162. package/lib/module/shared/utils/bounds/zoom/build.js +536 -0
  163. package/lib/module/shared/utils/bounds/zoom/build.js.map +1 -0
  164. package/lib/module/shared/utils/bounds/zoom/config.js +112 -0
  165. package/lib/module/shared/utils/bounds/zoom/config.js.map +1 -0
  166. package/lib/module/shared/utils/bounds/zoom/index.js +5 -0
  167. package/lib/module/shared/utils/bounds/zoom/index.js.map +1 -0
  168. package/lib/module/shared/utils/bounds/zoom/types.js.map +1 -0
  169. package/lib/module/shared/utils/gesture/validate-snap-points.js +11 -5
  170. package/lib/module/shared/utils/gesture/validate-snap-points.js.map +1 -1
  171. package/lib/module/shared/utils/overlay/visibility.js +1 -7
  172. package/lib/module/shared/utils/overlay/visibility.js.map +1 -1
  173. package/lib/typescript/shared/animation/snap-to.d.ts.map +1 -1
  174. package/lib/typescript/shared/components/create-boundary-component/utils/build-boundary-match-key.d.ts +0 -1
  175. package/lib/typescript/shared/components/create-boundary-component/utils/build-boundary-match-key.d.ts.map +1 -1
  176. package/lib/typescript/shared/components/overlay/helpers/get-active-overlay.d.ts +1 -1
  177. package/lib/typescript/shared/components/overlay/index.d.ts +0 -2
  178. package/lib/typescript/shared/components/overlay/index.d.ts.map +1 -1
  179. package/lib/typescript/shared/components/overlay/variations/overlay-host.d.ts.map +1 -1
  180. package/lib/typescript/shared/components/scene-view.d.ts.map +1 -1
  181. package/lib/typescript/shared/components/screen-container/layers/backdrop.d.ts.map +1 -1
  182. package/lib/typescript/shared/components/screen-container/layers/content.d.ts.map +1 -1
  183. package/lib/typescript/shared/components/screen-container/layers/maybe-masked-navigation-container.d.ts +7 -0
  184. package/lib/typescript/shared/components/screen-container/layers/maybe-masked-navigation-container.d.ts.map +1 -0
  185. package/lib/typescript/shared/components/screen-lifecycle/hooks/use-close-transition/index.d.ts.map +1 -1
  186. package/lib/typescript/shared/components/screen-lifecycle/hooks/use-open-transition.d.ts.map +1 -1
  187. package/lib/typescript/shared/constants.d.ts +3 -0
  188. package/lib/typescript/shared/constants.d.ts.map +1 -1
  189. package/lib/typescript/shared/hooks/gestures/resolve-screen-gesture-target.d.ts +10 -0
  190. package/lib/typescript/shared/hooks/gestures/resolve-screen-gesture-target.d.ts.map +1 -0
  191. package/lib/typescript/shared/hooks/gestures/types.d.ts +4 -0
  192. package/lib/typescript/shared/hooks/gestures/types.d.ts.map +1 -0
  193. package/lib/typescript/shared/hooks/gestures/use-screen-gesture.d.ts +4 -2
  194. package/lib/typescript/shared/hooks/gestures/use-screen-gesture.d.ts.map +1 -1
  195. package/lib/typescript/shared/hooks/navigation/use-stack.d.ts +1 -2
  196. package/lib/typescript/shared/hooks/navigation/use-stack.d.ts.map +1 -1
  197. package/lib/typescript/shared/index.d.ts +16 -17
  198. package/lib/typescript/shared/index.d.ts.map +1 -1
  199. package/lib/typescript/shared/providers/gestures/handlers/use-handlers.d.ts.map +1 -1
  200. package/lib/typescript/shared/providers/gestures/helpers/gesture-snap-points.d.ts +18 -0
  201. package/lib/typescript/shared/providers/gestures/helpers/gesture-snap-points.d.ts.map +1 -0
  202. package/lib/typescript/shared/providers/screen/animation/animation.provider.d.ts +6 -3
  203. package/lib/typescript/shared/providers/screen/animation/animation.provider.d.ts.map +1 -1
  204. package/lib/typescript/shared/providers/screen/animation/helpers/derivations.d.ts +0 -2
  205. package/lib/typescript/shared/providers/screen/animation/helpers/derivations.d.ts.map +1 -1
  206. package/lib/typescript/shared/providers/screen/animation/helpers/pipeline.d.ts.map +1 -1
  207. package/lib/typescript/shared/providers/screen/animation/helpers/resolve-screen-animation-target.d.ts +11 -0
  208. package/lib/typescript/shared/providers/screen/animation/helpers/resolve-screen-animation-target.d.ts.map +1 -0
  209. package/lib/typescript/shared/providers/screen/animation/index.d.ts +1 -1
  210. package/lib/typescript/shared/providers/screen/animation/index.d.ts.map +1 -1
  211. package/lib/typescript/shared/providers/screen/animation/types.d.ts +4 -0
  212. package/lib/typescript/shared/providers/screen/animation/types.d.ts.map +1 -0
  213. package/lib/typescript/shared/providers/screen/animation/use-screen-animation.d.ts +5 -1
  214. package/lib/typescript/shared/providers/screen/animation/use-screen-animation.d.ts.map +1 -1
  215. package/lib/typescript/shared/providers/stack/direct.provider.d.ts.map +1 -1
  216. package/lib/typescript/shared/stores/animation.store.d.ts +4 -0
  217. package/lib/typescript/shared/stores/animation.store.d.ts.map +1 -1
  218. package/lib/typescript/shared/stores/bounds/internals/resolver.d.ts.map +1 -1
  219. package/lib/typescript/shared/stores/bounds/types.d.ts +2 -0
  220. package/lib/typescript/shared/stores/bounds/types.d.ts.map +1 -1
  221. package/lib/typescript/shared/types/animation.types.d.ts +26 -51
  222. package/lib/typescript/shared/types/animation.types.d.ts.map +1 -1
  223. package/lib/typescript/shared/types/bounds.types.d.ts +46 -9
  224. package/lib/typescript/shared/types/bounds.types.d.ts.map +1 -1
  225. package/lib/typescript/shared/types/index.d.ts +3 -3
  226. package/lib/typescript/shared/types/index.d.ts.map +1 -1
  227. package/lib/typescript/shared/types/overlay.types.d.ts +1 -22
  228. package/lib/typescript/shared/types/overlay.types.d.ts.map +1 -1
  229. package/lib/typescript/shared/types/screen.types.d.ts +16 -15
  230. package/lib/typescript/shared/types/screen.types.d.ts.map +1 -1
  231. package/lib/typescript/shared/utils/animation/animate-to-progress.d.ts.map +1 -1
  232. package/lib/typescript/shared/utils/bounds/helpers/build-bounds-options.d.ts +2 -2
  233. package/lib/typescript/shared/utils/bounds/helpers/build-bounds-options.d.ts.map +1 -1
  234. package/lib/typescript/shared/utils/bounds/helpers/compute-bounds-styles.d.ts.map +1 -1
  235. package/lib/typescript/shared/utils/bounds/helpers/geometry.d.ts +3 -2
  236. package/lib/typescript/shared/utils/bounds/helpers/geometry.d.ts.map +1 -1
  237. package/lib/typescript/shared/utils/bounds/helpers/interpolators.d.ts +3 -2
  238. package/lib/typescript/shared/utils/bounds/helpers/interpolators.d.ts.map +1 -1
  239. package/lib/typescript/shared/utils/bounds/helpers/link-accessor.d.ts +3 -2
  240. package/lib/typescript/shared/utils/bounds/helpers/link-accessor.d.ts.map +1 -1
  241. package/lib/typescript/shared/utils/bounds/helpers/resolve-bound-tag.d.ts +2 -1
  242. package/lib/typescript/shared/utils/bounds/helpers/resolve-bound-tag.d.ts.map +1 -1
  243. package/lib/typescript/shared/utils/bounds/helpers/style-composers.d.ts +4 -3
  244. package/lib/typescript/shared/utils/bounds/helpers/style-composers.d.ts.map +1 -1
  245. package/lib/typescript/shared/utils/bounds/index.d.ts.map +1 -1
  246. package/lib/typescript/shared/utils/bounds/types/options.d.ts +5 -4
  247. package/lib/typescript/shared/utils/bounds/types/options.d.ts.map +1 -1
  248. package/lib/typescript/shared/utils/bounds/zoom/accessor.d.ts +17 -0
  249. package/lib/typescript/shared/utils/bounds/zoom/accessor.d.ts.map +1 -0
  250. package/lib/typescript/shared/utils/bounds/zoom/build.d.ts +4 -0
  251. package/lib/typescript/shared/utils/bounds/zoom/build.d.ts.map +1 -0
  252. package/lib/typescript/shared/utils/bounds/zoom/config.d.ts +43 -0
  253. package/lib/typescript/shared/utils/bounds/zoom/config.d.ts.map +1 -0
  254. package/lib/typescript/shared/utils/bounds/zoom/index.d.ts +3 -0
  255. package/lib/typescript/shared/utils/bounds/zoom/index.d.ts.map +1 -0
  256. package/lib/typescript/shared/utils/bounds/zoom/types.d.ts +17 -0
  257. package/lib/typescript/shared/utils/bounds/zoom/types.d.ts.map +1 -0
  258. package/lib/typescript/shared/utils/gesture/validate-snap-points.d.ts +5 -3
  259. package/lib/typescript/shared/utils/gesture/validate-snap-points.d.ts.map +1 -1
  260. package/lib/typescript/shared/utils/overlay/visibility.d.ts +1 -4
  261. package/lib/typescript/shared/utils/overlay/visibility.d.ts.map +1 -1
  262. package/package.json +2 -2
  263. package/src/shared/animation/snap-to.ts +12 -1
  264. package/src/shared/components/create-boundary-component/utils/build-boundary-match-key.ts +2 -14
  265. package/src/shared/components/overlay/helpers/get-active-overlay.ts +3 -3
  266. package/src/shared/components/overlay/index.ts +0 -2
  267. package/src/shared/components/overlay/variations/overlay-host.tsx +2 -16
  268. package/src/shared/components/scene-view.tsx +0 -3
  269. package/src/shared/components/screen-container/layers/backdrop.tsx +25 -6
  270. package/src/shared/components/screen-container/layers/content.tsx +80 -77
  271. package/src/shared/components/screen-container/layers/maybe-masked-navigation-container.tsx +93 -0
  272. package/src/shared/components/screen-lifecycle/hooks/use-close-transition/index.ts +1 -2
  273. package/src/shared/components/screen-lifecycle/hooks/use-open-transition.ts +20 -6
  274. package/src/shared/constants.ts +6 -2
  275. package/src/shared/hooks/gestures/resolve-screen-gesture-target.ts +66 -0
  276. package/src/shared/hooks/gestures/types.ts +5 -0
  277. package/src/shared/hooks/gestures/use-screen-gesture.ts +10 -3
  278. package/src/shared/hooks/navigation/use-stack.tsx +1 -2
  279. package/src/shared/index.ts +14 -16
  280. package/src/shared/providers/gestures/handlers/use-handlers.ts +67 -24
  281. package/src/shared/providers/gestures/helpers/gesture-snap-points.ts +72 -0
  282. package/src/shared/providers/screen/animation/animation.provider.tsx +46 -10
  283. package/src/shared/providers/screen/animation/helpers/derivations.ts +0 -8
  284. package/src/shared/providers/screen/animation/helpers/pipeline.ts +26 -5
  285. package/src/shared/providers/screen/animation/helpers/resolve-screen-animation-target.ts +44 -0
  286. package/src/shared/providers/screen/animation/index.tsx +4 -1
  287. package/src/shared/providers/screen/animation/types.ts +5 -0
  288. package/src/shared/providers/screen/animation/use-screen-animation.tsx +16 -3
  289. package/src/shared/providers/stack/direct.provider.tsx +2 -5
  290. package/src/shared/providers/stack/helpers/use-processed-routes.ts +2 -2
  291. package/src/shared/stores/animation.store.ts +13 -1
  292. package/src/shared/stores/bounds/internals/resolver.ts +13 -1
  293. package/src/shared/stores/bounds/types.ts +2 -0
  294. package/src/shared/types/animation.types.ts +25 -58
  295. package/src/shared/types/bounds.types.ts +30 -10
  296. package/src/shared/types/index.ts +2 -15
  297. package/src/shared/types/overlay.types.ts +1 -28
  298. package/src/shared/types/screen.types.ts +17 -16
  299. package/src/shared/utils/animation/animate-to-progress.ts +7 -0
  300. package/src/shared/utils/bounds/helpers/build-bounds-options.ts +2 -2
  301. package/src/shared/utils/bounds/helpers/compute-bounds-styles.ts +34 -8
  302. package/src/shared/utils/bounds/helpers/geometry.ts +3 -2
  303. package/src/shared/utils/bounds/helpers/interpolators.ts +8 -6
  304. package/src/shared/utils/bounds/helpers/link-accessor.ts +10 -6
  305. package/src/shared/utils/bounds/helpers/resolve-bound-tag.ts +9 -6
  306. package/src/shared/utils/bounds/helpers/style-composers.ts +4 -3
  307. package/src/shared/utils/bounds/index.ts +6 -8
  308. package/src/shared/utils/bounds/types/options.ts +6 -4
  309. package/src/shared/utils/bounds/zoom/accessor.ts +69 -0
  310. package/src/shared/utils/bounds/zoom/build.ts +705 -0
  311. package/src/shared/utils/bounds/zoom/config.ts +179 -0
  312. package/src/shared/utils/bounds/zoom/index.ts +2 -0
  313. package/src/shared/utils/bounds/zoom/types.ts +22 -0
  314. package/src/shared/utils/gesture/validate-snap-points.ts +20 -8
  315. package/src/shared/utils/overlay/visibility.ts +1 -16
  316. package/lib/commonjs/shared/components/overlay/variations/screen-overlay.js +0 -64
  317. package/lib/commonjs/shared/components/overlay/variations/screen-overlay.js.map +0 -1
  318. package/lib/commonjs/shared/utils/bounds/helpers/math.js +0 -132
  319. package/lib/commonjs/shared/utils/bounds/helpers/math.js.map +0 -1
  320. package/lib/commonjs/shared/utils/bounds/helpers/navigation-accessor.js +0 -45
  321. package/lib/commonjs/shared/utils/bounds/helpers/navigation-accessor.js.map +0 -1
  322. package/lib/commonjs/shared/utils/bounds/sugar/navigation/helpers.js +0 -60
  323. package/lib/commonjs/shared/utils/bounds/sugar/navigation/helpers.js.map +0 -1
  324. package/lib/commonjs/shared/utils/bounds/sugar/navigation/index.js +0 -20
  325. package/lib/commonjs/shared/utils/bounds/sugar/navigation/index.js.map +0 -1
  326. package/lib/commonjs/shared/utils/bounds/sugar/navigation/types.js.map +0 -1
  327. package/lib/commonjs/shared/utils/bounds/sugar/navigation/zoom.js +0 -295
  328. package/lib/commonjs/shared/utils/bounds/sugar/navigation/zoom.js.map +0 -1
  329. package/lib/module/shared/components/overlay/variations/screen-overlay.js +0 -61
  330. package/lib/module/shared/components/overlay/variations/screen-overlay.js.map +0 -1
  331. package/lib/module/shared/utils/bounds/helpers/math.js +0 -115
  332. package/lib/module/shared/utils/bounds/helpers/math.js.map +0 -1
  333. package/lib/module/shared/utils/bounds/helpers/navigation-accessor.js +0 -40
  334. package/lib/module/shared/utils/bounds/helpers/navigation-accessor.js.map +0 -1
  335. package/lib/module/shared/utils/bounds/sugar/navigation/helpers.js +0 -54
  336. package/lib/module/shared/utils/bounds/sugar/navigation/helpers.js.map +0 -1
  337. package/lib/module/shared/utils/bounds/sugar/navigation/index.js +0 -15
  338. package/lib/module/shared/utils/bounds/sugar/navigation/index.js.map +0 -1
  339. package/lib/module/shared/utils/bounds/sugar/navigation/types.js.map +0 -1
  340. package/lib/module/shared/utils/bounds/sugar/navigation/zoom.js +0 -290
  341. package/lib/module/shared/utils/bounds/sugar/navigation/zoom.js.map +0 -1
  342. package/lib/typescript/shared/components/overlay/variations/screen-overlay.d.ts +0 -10
  343. package/lib/typescript/shared/components/overlay/variations/screen-overlay.d.ts.map +0 -1
  344. package/lib/typescript/shared/utils/bounds/helpers/math.d.ts +0 -38
  345. package/lib/typescript/shared/utils/bounds/helpers/math.d.ts.map +0 -1
  346. package/lib/typescript/shared/utils/bounds/helpers/navigation-accessor.d.ts +0 -16
  347. package/lib/typescript/shared/utils/bounds/helpers/navigation-accessor.d.ts.map +0 -1
  348. package/lib/typescript/shared/utils/bounds/sugar/navigation/helpers.d.ts +0 -17
  349. package/lib/typescript/shared/utils/bounds/sugar/navigation/helpers.d.ts.map +0 -1
  350. package/lib/typescript/shared/utils/bounds/sugar/navigation/index.d.ts +0 -3
  351. package/lib/typescript/shared/utils/bounds/sugar/navigation/index.d.ts.map +0 -1
  352. package/lib/typescript/shared/utils/bounds/sugar/navigation/types.d.ts +0 -18
  353. package/lib/typescript/shared/utils/bounds/sugar/navigation/types.d.ts.map +0 -1
  354. package/lib/typescript/shared/utils/bounds/sugar/navigation/zoom.d.ts +0 -4
  355. package/lib/typescript/shared/utils/bounds/sugar/navigation/zoom.d.ts.map +0 -1
  356. package/src/shared/components/overlay/variations/screen-overlay.tsx +0 -68
  357. package/src/shared/utils/bounds/helpers/math.ts +0 -161
  358. package/src/shared/utils/bounds/helpers/navigation-accessor.ts +0 -61
  359. package/src/shared/utils/bounds/sugar/navigation/helpers.ts +0 -74
  360. package/src/shared/utils/bounds/sugar/navigation/index.ts +0 -14
  361. package/src/shared/utils/bounds/sugar/navigation/types.ts +0 -26
  362. package/src/shared/utils/bounds/sugar/navigation/zoom.ts +0 -348
  363. /package/lib/commonjs/shared/utils/bounds/{sugar/navigation → zoom}/types.js +0 -0
  364. /package/lib/module/shared/utils/bounds/{sugar/navigation → zoom}/types.js +0 -0
@@ -0,0 +1,705 @@
1
+ import { interpolate, type StyleProps } from "react-native-reanimated";
2
+ import {
3
+ EPSILON,
4
+ NAVIGATION_CONTAINER_STYLE_ID,
5
+ NAVIGATION_MASK_STYLE_ID,
6
+ NO_STYLES,
7
+ } from "../../../constants";
8
+ import {
9
+ BoundStore,
10
+ type ResolvedTransitionPair,
11
+ } from "../../../stores/bounds";
12
+ import type { TransitionInterpolatedStyle } from "../../../types/animation.types";
13
+ import type { BoundsNavigationZoomOptions } from "../../../types/bounds.types";
14
+ import type { Layout } from "../../../types/screen.types";
15
+ import type { BoundsOptions } from "../types/options";
16
+ import {
17
+ type ResolvedZoomOptions,
18
+ resolveZoomConfig,
19
+ toNumber,
20
+ } from "./config";
21
+ import type { BuildZoomStylesParams } from "./types";
22
+
23
+ type CombinedScaleMode = "multiply" | "average" | "max" | "min";
24
+
25
+ const IDENTITY_DRAG_SCALE_OUTPUT = [1, 1] as const;
26
+ type ZoomMask = NonNullable<BoundsNavigationZoomOptions["mask"]>;
27
+ type ZoomRadiusValue = Exclude<ZoomMask["borderRadius"], undefined>;
28
+
29
+ const clamp = (value: number, min: number, max: number): number => {
30
+ "worklet";
31
+ const lower = min < max ? min : max;
32
+ const upper = max > min ? max : min;
33
+
34
+ if (value < lower) return lower;
35
+ if (value > upper) return upper;
36
+
37
+ return value;
38
+ };
39
+
40
+ const clamp01 = (value: number): number => {
41
+ "worklet";
42
+ return clamp(value, 0, 1);
43
+ };
44
+
45
+ const lerp = (from: number, to: number, t: number): number => {
46
+ "worklet";
47
+ return from + (to - from) * t;
48
+ };
49
+
50
+ const safeDivide = (
51
+ numerator: number,
52
+ denominator: number,
53
+ fallback = 0,
54
+ ): number => {
55
+ "worklet";
56
+ if (denominator === 0) return fallback;
57
+ return numerator / denominator;
58
+ };
59
+
60
+ const inverseLerp = (value: number, inMin: number, inMax: number): number => {
61
+ "worklet";
62
+ return safeDivide(value - inMin, inMax - inMin, 0);
63
+ };
64
+
65
+ const mapRangeClamped = (
66
+ value: number,
67
+ inMin: number,
68
+ inMax: number,
69
+ outMin: number,
70
+ outMax: number,
71
+ ): number => {
72
+ "worklet";
73
+ const t = clamp01(inverseLerp(value, inMin, inMax));
74
+ return lerp(outMin, outMax, t);
75
+ };
76
+
77
+ const applyPowerCurve = (value: number, exponent: number): number => {
78
+ "worklet";
79
+ const safeExponent = exponent > 0 ? exponent : 1;
80
+ const magnitude = Math.abs(value) ** safeExponent;
81
+ return value < 0 ? -magnitude : magnitude;
82
+ };
83
+
84
+ const normalizedToTranslation = ({
85
+ normalized,
86
+ dimension,
87
+ resistance,
88
+ }: {
89
+ normalized: number;
90
+ dimension: number;
91
+ resistance: number;
92
+ }): number => {
93
+ "worklet";
94
+ const distance = Math.max(0, dimension) * resistance;
95
+ return mapRangeClamped(normalized, -1, 1, -distance, distance);
96
+ };
97
+
98
+ const normalizedToScale = ({
99
+ normalized,
100
+ outputRange,
101
+ exponent = 1,
102
+ positiveOnly = true,
103
+ }: {
104
+ normalized: number;
105
+ outputRange: readonly [number, number];
106
+ exponent?: number;
107
+ positiveOnly?: boolean;
108
+ }): number => {
109
+ "worklet";
110
+ const [outputStart, outputEnd] = outputRange;
111
+ const raw = positiveOnly
112
+ ? mapRangeClamped(normalized, 0, 1, outputStart, outputEnd)
113
+ : mapRangeClamped(normalized, -1, 1, outputStart, outputEnd);
114
+
115
+ return applyPowerCurve(raw, exponent);
116
+ };
117
+
118
+ const combineScales = (
119
+ scaleX: number,
120
+ scaleY: number,
121
+ mode: CombinedScaleMode = "multiply",
122
+ ): number => {
123
+ "worklet";
124
+
125
+ switch (mode) {
126
+ case "average":
127
+ return (scaleX + scaleY) / 2;
128
+ case "max":
129
+ return Math.max(scaleX, scaleY);
130
+ case "min":
131
+ return Math.min(scaleX, scaleY);
132
+ default:
133
+ return scaleX * scaleY;
134
+ }
135
+ };
136
+
137
+ const computeCenterScaleShift = ({
138
+ center,
139
+ containerCenter,
140
+ scale,
141
+ }: {
142
+ center: number;
143
+ containerCenter: number;
144
+ scale: number;
145
+ }): number => {
146
+ "worklet";
147
+ return (center - containerCenter) * (scale - 1);
148
+ };
149
+
150
+ const compensateTranslationForParentScale = ({
151
+ translation,
152
+ parentScale,
153
+ epsilon,
154
+ }: {
155
+ translation: number;
156
+ parentScale: number;
157
+ epsilon: number;
158
+ }): number => {
159
+ "worklet";
160
+ const safeParentScale = Math.max(parentScale, epsilon);
161
+ return safeDivide(translation, safeParentScale, translation);
162
+ };
163
+
164
+ const composeCompensatedTranslation = ({
165
+ gesture,
166
+ parentScale,
167
+ centerShift = 0,
168
+ epsilon,
169
+ }: {
170
+ gesture: number;
171
+ parentScale: number;
172
+ centerShift?: number;
173
+ epsilon: number;
174
+ }): number => {
175
+ "worklet";
176
+ return (
177
+ compensateTranslationForParentScale({
178
+ translation: gesture,
179
+ parentScale,
180
+ epsilon,
181
+ }) + centerShift
182
+ );
183
+ };
184
+
185
+ const resolveDirectionalDragScale = ({
186
+ normalized,
187
+ dismissDirection,
188
+ shrinkMin,
189
+ growMax,
190
+ exponent,
191
+ }: {
192
+ normalized: number;
193
+ dismissDirection: "positive" | "negative";
194
+ shrinkMin: number;
195
+ growMax: number;
196
+ exponent: number;
197
+ }) => {
198
+ "worklet";
199
+
200
+ const dismissalRelative =
201
+ dismissDirection === "negative" ? -normalized : normalized;
202
+
203
+ if (dismissalRelative >= 0) {
204
+ return normalizedToScale({
205
+ normalized: dismissalRelative,
206
+ outputRange: [1, shrinkMin],
207
+ exponent,
208
+ });
209
+ }
210
+
211
+ const oppositeDrag = Math.min(1, Math.abs(dismissalRelative));
212
+ return interpolate(oppositeDrag, [0, 1], [1, growMax], "clamp");
213
+ };
214
+
215
+ const getZoomContentTarget = ({
216
+ explicitTarget,
217
+ resolvedTag,
218
+ currentRouteKey,
219
+ previousRouteKey,
220
+ nextRouteKey,
221
+ entering,
222
+ screenLayout,
223
+ anchor,
224
+ resolvedPair,
225
+ }: {
226
+ explicitTarget: BoundsOptions["target"] | undefined;
227
+ resolvedTag: string;
228
+ currentRouteKey?: string;
229
+ previousRouteKey?: string;
230
+ nextRouteKey?: string;
231
+ entering: boolean;
232
+ screenLayout: Layout;
233
+ anchor: BoundsOptions["anchor"] | undefined;
234
+ resolvedPair?: ResolvedTransitionPair;
235
+ }) => {
236
+ "worklet";
237
+ if (explicitTarget !== undefined) return explicitTarget;
238
+
239
+ const pair =
240
+ resolvedPair ??
241
+ BoundStore.resolveTransitionPair(resolvedTag, {
242
+ currentScreenKey: currentRouteKey,
243
+ previousScreenKey: previousRouteKey,
244
+ nextScreenKey: nextRouteKey,
245
+ entering,
246
+ });
247
+
248
+ const sourceBounds = pair.sourceBounds;
249
+ const screenWidth = screenLayout.width;
250
+
251
+ if (!sourceBounds || sourceBounds.width <= 0 || screenWidth <= 0) {
252
+ return "fullscreen" as const;
253
+ }
254
+
255
+ const height = (sourceBounds.height / sourceBounds.width) * screenWidth;
256
+ let horizontalAnchor: "leading" | "center" | "trailing";
257
+ switch (anchor) {
258
+ case "topLeading":
259
+ case "leading":
260
+ case "bottomLeading":
261
+ horizontalAnchor = "leading";
262
+ break;
263
+ case "topTrailing":
264
+ case "trailing":
265
+ case "bottomTrailing":
266
+ horizontalAnchor = "trailing";
267
+ break;
268
+ default:
269
+ horizontalAnchor = "center";
270
+ break;
271
+ }
272
+
273
+ let verticalAnchor: "top" | "center" | "bottom";
274
+ switch (anchor) {
275
+ case "topLeading":
276
+ case "top":
277
+ case "topTrailing":
278
+ verticalAnchor = "top";
279
+ break;
280
+ case "bottomLeading":
281
+ case "bottom":
282
+ case "bottomTrailing":
283
+ verticalAnchor = "bottom";
284
+ break;
285
+ default:
286
+ verticalAnchor = "center";
287
+ break;
288
+ }
289
+ const x =
290
+ horizontalAnchor === "leading"
291
+ ? 0
292
+ : horizontalAnchor === "trailing"
293
+ ? screenLayout.width - screenWidth
294
+ : (screenLayout.width - screenWidth) / 2;
295
+ const y =
296
+ verticalAnchor === "top"
297
+ ? 0
298
+ : verticalAnchor === "bottom"
299
+ ? screenLayout.height - height
300
+ : (screenLayout.height - height) / 2;
301
+
302
+ return {
303
+ x,
304
+ y,
305
+ pageX: x,
306
+ pageY: y,
307
+ width: screenWidth,
308
+ height,
309
+ };
310
+ };
311
+
312
+ const getStyleRadius = (
313
+ styles: StyleProps | null,
314
+ property:
315
+ | "borderRadius"
316
+ | "borderTopLeftRadius"
317
+ | "borderTopRightRadius"
318
+ | "borderBottomLeftRadius"
319
+ | "borderBottomRightRadius",
320
+ ): number | undefined => {
321
+ "worklet";
322
+ if (!styles || typeof styles !== "object") return undefined;
323
+
324
+ const styleRecord = styles as Record<string, unknown>;
325
+ const direct = styleRecord[property];
326
+ if (typeof direct === "number") return direct;
327
+
328
+ if (property !== "borderRadius") {
329
+ const fallback = styleRecord.borderRadius;
330
+ if (typeof fallback === "number") return fallback;
331
+ }
332
+
333
+ return undefined;
334
+ };
335
+
336
+ const resolveRadiusRange = ({
337
+ value,
338
+ progress,
339
+ sourceRadius,
340
+ destinationRadius,
341
+ fallback,
342
+ }: {
343
+ value: ZoomRadiusValue | undefined;
344
+ progress: number;
345
+ sourceRadius?: number;
346
+ destinationRadius?: number;
347
+ fallback: number;
348
+ }): number => {
349
+ "worklet";
350
+
351
+ if (typeof value === "number") return value;
352
+
353
+ if (value === "auto") {
354
+ const from = sourceRadius ?? fallback;
355
+ const to = destinationRadius ?? fallback;
356
+ return interpolate(progress, [0, 1], [from, to], "clamp");
357
+ }
358
+
359
+ if (value && typeof value === "object") {
360
+ const from = typeof value.from === "number" ? value.from : fallback;
361
+ const to = typeof value.to === "number" ? value.to : fallback;
362
+ return interpolate(progress, [0, 1], [from, to], "clamp");
363
+ }
364
+
365
+ const from = sourceRadius ?? fallback;
366
+ const to = destinationRadius ?? fallback;
367
+ return interpolate(progress, [0, 1], [from, to], "clamp");
368
+ };
369
+
370
+ const resolveMaskRadii = ({
371
+ progress,
372
+ zoomOptions,
373
+ resolvedPair,
374
+ }: {
375
+ progress: number;
376
+ zoomOptions: ResolvedZoomOptions;
377
+ resolvedPair: ResolvedTransitionPair;
378
+ }) => {
379
+ "worklet";
380
+ const sourceStyles = resolvedPair.sourceStyles;
381
+ const destinationStyles = resolvedPair.destinationStyles;
382
+
383
+ const defaultRadius = resolveRadiusRange({
384
+ value: zoomOptions.mask.borderRadius,
385
+ progress,
386
+ sourceRadius: getStyleRadius(sourceStyles, "borderRadius"),
387
+ destinationRadius: getStyleRadius(destinationStyles, "borderRadius"),
388
+ fallback: 12,
389
+ });
390
+
391
+ const topLeftValue =
392
+ zoomOptions.mask.borderTopLeftRadius ?? zoomOptions.mask.borderRadius;
393
+ const topRightValue =
394
+ zoomOptions.mask.borderTopRightRadius ?? zoomOptions.mask.borderRadius;
395
+ const bottomLeftValue =
396
+ zoomOptions.mask.borderBottomLeftRadius ?? zoomOptions.mask.borderRadius;
397
+ const bottomRightValue =
398
+ zoomOptions.mask.borderBottomRightRadius ?? zoomOptions.mask.borderRadius;
399
+
400
+ return {
401
+ borderRadius: defaultRadius,
402
+ borderTopLeftRadius: resolveRadiusRange({
403
+ value: topLeftValue,
404
+ progress,
405
+ sourceRadius: getStyleRadius(sourceStyles, "borderTopLeftRadius"),
406
+ destinationRadius: getStyleRadius(
407
+ destinationStyles,
408
+ "borderTopLeftRadius",
409
+ ),
410
+ fallback: defaultRadius,
411
+ }),
412
+ borderTopRightRadius: resolveRadiusRange({
413
+ value: topRightValue,
414
+ progress,
415
+ sourceRadius: getStyleRadius(sourceStyles, "borderTopRightRadius"),
416
+ destinationRadius: getStyleRadius(
417
+ destinationStyles,
418
+ "borderTopRightRadius",
419
+ ),
420
+ fallback: defaultRadius,
421
+ }),
422
+ borderBottomLeftRadius: resolveRadiusRange({
423
+ value: bottomLeftValue,
424
+ progress,
425
+ sourceRadius: getStyleRadius(sourceStyles, "borderBottomLeftRadius"),
426
+ destinationRadius: getStyleRadius(
427
+ destinationStyles,
428
+ "borderBottomLeftRadius",
429
+ ),
430
+ fallback: defaultRadius,
431
+ }),
432
+ borderBottomRightRadius: resolveRadiusRange({
433
+ value: bottomRightValue,
434
+ progress,
435
+ sourceRadius: getStyleRadius(sourceStyles, "borderBottomRightRadius"),
436
+ destinationRadius: getStyleRadius(
437
+ destinationStyles,
438
+ "borderBottomRightRadius",
439
+ ),
440
+ fallback: defaultRadius,
441
+ }),
442
+ };
443
+ };
444
+
445
+ export const buildZoomStyles = ({
446
+ id,
447
+ group,
448
+ zoomOptions,
449
+ props,
450
+ resolveTag,
451
+ computeRaw,
452
+ }: BuildZoomStylesParams): TransitionInterpolatedStyle => {
453
+ "worklet";
454
+
455
+ const focused = props.focused;
456
+ const progress = props.progress;
457
+ const currentRouteKey = props.current?.route.key;
458
+ const previousRouteKey = props.previous?.route.key;
459
+ const nextRouteKey = props.next?.route.key;
460
+ const entering = !props.next;
461
+ const screenLayout = props.layouts.screen;
462
+
463
+ const resolvedConfig = resolveZoomConfig({
464
+ id,
465
+ group,
466
+ zoomOptions,
467
+ currentRouteKey,
468
+ resolveTag,
469
+ defaultAnchor: "top",
470
+ });
471
+
472
+ if (!resolvedConfig) return NO_STYLES;
473
+
474
+ const {
475
+ resolvedTag,
476
+ sharedOptions,
477
+ explicitTarget,
478
+ zoomOptions: resolvedZoomOptions,
479
+ } = resolvedConfig;
480
+
481
+ const normX = props.active.gesture.normX;
482
+ const normY = props.active.gesture.normY;
483
+ const initialDirection = props.active.gesture.direction;
484
+ const dragX = normalizedToTranslation({
485
+ normalized: normX,
486
+ dimension: screenLayout.width,
487
+ resistance: resolvedZoomOptions.motion.dragResistance,
488
+ });
489
+ const dragY = normalizedToTranslation({
490
+ normalized: normY,
491
+ dimension: screenLayout.height,
492
+ resistance: resolvedZoomOptions.motion.dragResistance,
493
+ });
494
+ const dragXScale =
495
+ initialDirection === "horizontal" ||
496
+ initialDirection === "horizontal-inverted"
497
+ ? resolveDirectionalDragScale({
498
+ normalized: normX,
499
+ dismissDirection:
500
+ initialDirection === "horizontal-inverted"
501
+ ? "negative"
502
+ : "positive",
503
+ shrinkMin: resolvedZoomOptions.motion.dragDirectionalScaleMin,
504
+ growMax: resolvedZoomOptions.motion.dragDirectionalScaleMax,
505
+ exponent: 2,
506
+ })
507
+ : IDENTITY_DRAG_SCALE_OUTPUT[0];
508
+ const dragYScale =
509
+ initialDirection === "vertical" || initialDirection === "vertical-inverted"
510
+ ? resolveDirectionalDragScale({
511
+ normalized: normY,
512
+ dismissDirection:
513
+ initialDirection === "vertical-inverted" ? "negative" : "positive",
514
+ shrinkMin: resolvedZoomOptions.motion.dragDirectionalScaleMin,
515
+ growMax: resolvedZoomOptions.motion.dragDirectionalScaleMax,
516
+ exponent: 2,
517
+ })
518
+ : IDENTITY_DRAG_SCALE_OUTPUT[1];
519
+ const dragScale = combineScales(dragXScale, dragYScale);
520
+
521
+ if (focused) {
522
+ const focusedPair = BoundStore.resolveTransitionPair(resolvedTag, {
523
+ currentScreenKey: currentRouteKey,
524
+ previousScreenKey: previousRouteKey,
525
+ nextScreenKey: nextRouteKey,
526
+ entering,
527
+ });
528
+
529
+ const contentTarget = getZoomContentTarget({
530
+ explicitTarget,
531
+ resolvedTag,
532
+ currentRouteKey,
533
+ previousRouteKey,
534
+ nextRouteKey,
535
+ entering,
536
+ screenLayout,
537
+ anchor: sharedOptions.anchor,
538
+ resolvedPair: focusedPair,
539
+ });
540
+
541
+ const contentRaw = computeRaw({
542
+ ...sharedOptions,
543
+ method: "content",
544
+ target: contentTarget,
545
+ });
546
+
547
+ const maskRaw = computeRaw({
548
+ ...sharedOptions,
549
+ method: "size",
550
+ space: "absolute",
551
+ target: "fullscreen",
552
+ });
553
+
554
+ const focusedFade = props.active?.closing
555
+ ? interpolate(progress, [0.6, 1], [0, 1], "clamp")
556
+ : interpolate(progress, [0, 0.5], [0, 1], "clamp");
557
+ const { top, right, bottom, left } = resolvedZoomOptions.mask.outset;
558
+ const maskWidth = Math.max(1, toNumber(maskRaw.width) + left + right);
559
+ const maskHeight = Math.max(1, toNumber(maskRaw.height) + top + bottom);
560
+ const contentTranslateX = toNumber(contentRaw.translateX) + dragX;
561
+ const contentTranslateY = toNumber(contentRaw.translateY) + dragY;
562
+ const contentScale = toNumber(contentRaw.scale, 1) * dragScale;
563
+ const maskTranslateX = toNumber(maskRaw.translateX) + dragX - left;
564
+ const maskTranslateY = toNumber(maskRaw.translateY) + dragY - top;
565
+ const maskRadii = resolveMaskRadii({
566
+ progress,
567
+ zoomOptions: resolvedZoomOptions,
568
+ resolvedPair: focusedPair,
569
+ });
570
+
571
+ return {
572
+ [NAVIGATION_CONTAINER_STYLE_ID]: {
573
+ style: {
574
+ opacity: focusedFade,
575
+ transform: [
576
+ { translateX: contentTranslateX },
577
+ { translateY: contentTranslateY },
578
+ { scale: contentScale },
579
+ ],
580
+ },
581
+ },
582
+ [NAVIGATION_MASK_STYLE_ID]: {
583
+ style: {
584
+ width: maskWidth,
585
+ height: maskHeight,
586
+ transform: [
587
+ { translateX: maskTranslateX },
588
+ { translateY: maskTranslateY },
589
+ { scale: dragScale },
590
+ ],
591
+ borderRadius: maskRadii.borderRadius,
592
+ borderTopLeftRadius: maskRadii.borderTopLeftRadius,
593
+ borderTopRightRadius: maskRadii.borderTopRightRadius,
594
+ borderBottomLeftRadius: maskRadii.borderBottomLeftRadius,
595
+ borderBottomRightRadius: maskRadii.borderBottomRightRadius,
596
+ ...(resolvedZoomOptions.mask.borderCurve
597
+ ? { borderCurve: resolvedZoomOptions.mask.borderCurve }
598
+ : {}),
599
+ },
600
+ },
601
+ // Signal the destination boundary to stay visible during the transition.
602
+ // Without this, useAssociatedStyles enters "waiting-first-style" mode
603
+ // (opacity: 0) because it detects previous-screen evidence but never
604
+ // receives a resolved style for this tag.
605
+ [resolvedTag]: {
606
+ style: { opacity: 1 },
607
+ },
608
+ };
609
+ }
610
+
611
+ const unfocusedFade = props.active?.closing
612
+ ? interpolate(progress, [1.6, 2], [1, 0], "clamp")
613
+ : interpolate(progress, [1, 1.5], [1, 0], "clamp");
614
+ const unfocusedScale = interpolate(progress, [1, 2], [1, 0.95], "clamp");
615
+ const isUnfocusedIdle = props.active.settled === 1;
616
+
617
+ const elementTarget =
618
+ sharedOptions.scaleMode === "match"
619
+ ? ("fullscreen" as const)
620
+ : getZoomContentTarget({
621
+ explicitTarget,
622
+ resolvedTag,
623
+ currentRouteKey,
624
+ previousRouteKey,
625
+ nextRouteKey,
626
+ entering,
627
+ screenLayout,
628
+ anchor: sharedOptions.anchor,
629
+ });
630
+
631
+ const elementRaw = computeRaw({
632
+ ...sharedOptions,
633
+ method: "transform",
634
+ space: "relative",
635
+ target: elementTarget,
636
+ });
637
+
638
+ // Keep compensation tied to the element target's center. In `scaleMode: "match"`
639
+ // this target is fullscreen, so the center offset should resolve to zero.
640
+ const elementCenterY =
641
+ typeof elementTarget === "object"
642
+ ? elementTarget.pageY + elementTarget.height / 2
643
+ : screenLayout.height / 2;
644
+
645
+ const scaleShiftY = computeCenterScaleShift({
646
+ center: elementCenterY,
647
+ containerCenter: screenLayout.height / 2,
648
+ scale: dragScale,
649
+ });
650
+
651
+ const compensatedGestureX = composeCompensatedTranslation({
652
+ gesture: dragX,
653
+ parentScale: unfocusedScale,
654
+ epsilon: EPSILON,
655
+ });
656
+ // dragY is measured in screen space and must be unscaled by the parent
657
+ // content shrink, while scaleShiftY is already in the parent's local space.
658
+ const compensatedGestureY = composeCompensatedTranslation({
659
+ gesture: dragY,
660
+ parentScale: unfocusedScale,
661
+ centerShift: scaleShiftY,
662
+ epsilon: EPSILON,
663
+ });
664
+ const elementTranslateX =
665
+ toNumber(elementRaw.translateX) + compensatedGestureX;
666
+ const elementTranslateY =
667
+ toNumber(elementRaw.translateY) + compensatedGestureY;
668
+ const elementScaleX = toNumber(elementRaw.scaleX, 1) * dragScale;
669
+ const elementScaleY = toNumber(elementRaw.scaleY, 1) * dragScale;
670
+
671
+ const resolvedElementStyle = isUnfocusedIdle
672
+ ? {
673
+ transform: [
674
+ { translateX: 0 },
675
+ { translateY: 0 },
676
+ { scaleX: 1 },
677
+ { scaleY: 1 },
678
+ ],
679
+ opacity: 0,
680
+ zIndex: 0,
681
+ elevation: 0,
682
+ }
683
+ : {
684
+ transform: [
685
+ { translateX: elementTranslateX },
686
+ { translateY: elementTranslateY },
687
+ { scaleX: elementScaleX },
688
+ { scaleY: elementScaleY },
689
+ ],
690
+ opacity: unfocusedFade,
691
+ zIndex: 9999,
692
+ elevation: 9999,
693
+ };
694
+
695
+ return {
696
+ content: {
697
+ style: {
698
+ transform: [{ scale: unfocusedScale }],
699
+ },
700
+ },
701
+ [resolvedTag]: {
702
+ style: resolvedElementStyle,
703
+ },
704
+ };
705
+ };