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,536 @@
1
+ "use strict";
2
+
3
+ import { interpolate } from "react-native-reanimated";
4
+ import { EPSILON, NAVIGATION_CONTAINER_STYLE_ID, NAVIGATION_MASK_STYLE_ID, NO_STYLES } from "../../../constants";
5
+ import { BoundStore } from "../../../stores/bounds";
6
+ import { resolveZoomConfig, toNumber } from "./config";
7
+ const IDENTITY_DRAG_SCALE_OUTPUT = [1, 1];
8
+ const clamp = (value, min, max) => {
9
+ "worklet";
10
+
11
+ const lower = min < max ? min : max;
12
+ const upper = max > min ? max : min;
13
+ if (value < lower) return lower;
14
+ if (value > upper) return upper;
15
+ return value;
16
+ };
17
+ const clamp01 = value => {
18
+ "worklet";
19
+
20
+ return clamp(value, 0, 1);
21
+ };
22
+ const lerp = (from, to, t) => {
23
+ "worklet";
24
+
25
+ return from + (to - from) * t;
26
+ };
27
+ const safeDivide = (numerator, denominator, fallback = 0) => {
28
+ "worklet";
29
+
30
+ if (denominator === 0) return fallback;
31
+ return numerator / denominator;
32
+ };
33
+ const inverseLerp = (value, inMin, inMax) => {
34
+ "worklet";
35
+
36
+ return safeDivide(value - inMin, inMax - inMin, 0);
37
+ };
38
+ const mapRangeClamped = (value, inMin, inMax, outMin, outMax) => {
39
+ "worklet";
40
+
41
+ const t = clamp01(inverseLerp(value, inMin, inMax));
42
+ return lerp(outMin, outMax, t);
43
+ };
44
+ const applyPowerCurve = (value, exponent) => {
45
+ "worklet";
46
+
47
+ const safeExponent = exponent > 0 ? exponent : 1;
48
+ const magnitude = Math.abs(value) ** safeExponent;
49
+ return value < 0 ? -magnitude : magnitude;
50
+ };
51
+ const normalizedToTranslation = ({
52
+ normalized,
53
+ dimension,
54
+ resistance
55
+ }) => {
56
+ "worklet";
57
+
58
+ const distance = Math.max(0, dimension) * resistance;
59
+ return mapRangeClamped(normalized, -1, 1, -distance, distance);
60
+ };
61
+ const normalizedToScale = ({
62
+ normalized,
63
+ outputRange,
64
+ exponent = 1,
65
+ positiveOnly = true
66
+ }) => {
67
+ "worklet";
68
+
69
+ const [outputStart, outputEnd] = outputRange;
70
+ const raw = positiveOnly ? mapRangeClamped(normalized, 0, 1, outputStart, outputEnd) : mapRangeClamped(normalized, -1, 1, outputStart, outputEnd);
71
+ return applyPowerCurve(raw, exponent);
72
+ };
73
+ const combineScales = (scaleX, scaleY, mode = "multiply") => {
74
+ "worklet";
75
+
76
+ switch (mode) {
77
+ case "average":
78
+ return (scaleX + scaleY) / 2;
79
+ case "max":
80
+ return Math.max(scaleX, scaleY);
81
+ case "min":
82
+ return Math.min(scaleX, scaleY);
83
+ default:
84
+ return scaleX * scaleY;
85
+ }
86
+ };
87
+ const computeCenterScaleShift = ({
88
+ center,
89
+ containerCenter,
90
+ scale
91
+ }) => {
92
+ "worklet";
93
+
94
+ return (center - containerCenter) * (scale - 1);
95
+ };
96
+ const compensateTranslationForParentScale = ({
97
+ translation,
98
+ parentScale,
99
+ epsilon
100
+ }) => {
101
+ "worklet";
102
+
103
+ const safeParentScale = Math.max(parentScale, epsilon);
104
+ return safeDivide(translation, safeParentScale, translation);
105
+ };
106
+ const composeCompensatedTranslation = ({
107
+ gesture,
108
+ parentScale,
109
+ centerShift = 0,
110
+ epsilon
111
+ }) => {
112
+ "worklet";
113
+
114
+ return compensateTranslationForParentScale({
115
+ translation: gesture,
116
+ parentScale,
117
+ epsilon
118
+ }) + centerShift;
119
+ };
120
+ const resolveDirectionalDragScale = ({
121
+ normalized,
122
+ dismissDirection,
123
+ shrinkMin,
124
+ growMax,
125
+ exponent
126
+ }) => {
127
+ "worklet";
128
+
129
+ const dismissalRelative = dismissDirection === "negative" ? -normalized : normalized;
130
+ if (dismissalRelative >= 0) {
131
+ return normalizedToScale({
132
+ normalized: dismissalRelative,
133
+ outputRange: [1, shrinkMin],
134
+ exponent
135
+ });
136
+ }
137
+ const oppositeDrag = Math.min(1, Math.abs(dismissalRelative));
138
+ return interpolate(oppositeDrag, [0, 1], [1, growMax], "clamp");
139
+ };
140
+ const getZoomContentTarget = ({
141
+ explicitTarget,
142
+ resolvedTag,
143
+ currentRouteKey,
144
+ previousRouteKey,
145
+ nextRouteKey,
146
+ entering,
147
+ screenLayout,
148
+ anchor,
149
+ resolvedPair
150
+ }) => {
151
+ "worklet";
152
+
153
+ if (explicitTarget !== undefined) return explicitTarget;
154
+ const pair = resolvedPair ?? BoundStore.resolveTransitionPair(resolvedTag, {
155
+ currentScreenKey: currentRouteKey,
156
+ previousScreenKey: previousRouteKey,
157
+ nextScreenKey: nextRouteKey,
158
+ entering
159
+ });
160
+ const sourceBounds = pair.sourceBounds;
161
+ const screenWidth = screenLayout.width;
162
+ if (!sourceBounds || sourceBounds.width <= 0 || screenWidth <= 0) {
163
+ return "fullscreen";
164
+ }
165
+ const height = sourceBounds.height / sourceBounds.width * screenWidth;
166
+ let horizontalAnchor;
167
+ switch (anchor) {
168
+ case "topLeading":
169
+ case "leading":
170
+ case "bottomLeading":
171
+ horizontalAnchor = "leading";
172
+ break;
173
+ case "topTrailing":
174
+ case "trailing":
175
+ case "bottomTrailing":
176
+ horizontalAnchor = "trailing";
177
+ break;
178
+ default:
179
+ horizontalAnchor = "center";
180
+ break;
181
+ }
182
+ let verticalAnchor;
183
+ switch (anchor) {
184
+ case "topLeading":
185
+ case "top":
186
+ case "topTrailing":
187
+ verticalAnchor = "top";
188
+ break;
189
+ case "bottomLeading":
190
+ case "bottom":
191
+ case "bottomTrailing":
192
+ verticalAnchor = "bottom";
193
+ break;
194
+ default:
195
+ verticalAnchor = "center";
196
+ break;
197
+ }
198
+ const x = horizontalAnchor === "leading" ? 0 : horizontalAnchor === "trailing" ? screenLayout.width - screenWidth : (screenLayout.width - screenWidth) / 2;
199
+ const y = verticalAnchor === "top" ? 0 : verticalAnchor === "bottom" ? screenLayout.height - height : (screenLayout.height - height) / 2;
200
+ return {
201
+ x,
202
+ y,
203
+ pageX: x,
204
+ pageY: y,
205
+ width: screenWidth,
206
+ height
207
+ };
208
+ };
209
+ const getStyleRadius = (styles, property) => {
210
+ "worklet";
211
+
212
+ if (!styles || typeof styles !== "object") return undefined;
213
+ const styleRecord = styles;
214
+ const direct = styleRecord[property];
215
+ if (typeof direct === "number") return direct;
216
+ if (property !== "borderRadius") {
217
+ const fallback = styleRecord.borderRadius;
218
+ if (typeof fallback === "number") return fallback;
219
+ }
220
+ return undefined;
221
+ };
222
+ const resolveRadiusRange = ({
223
+ value,
224
+ progress,
225
+ sourceRadius,
226
+ destinationRadius,
227
+ fallback
228
+ }) => {
229
+ "worklet";
230
+
231
+ if (typeof value === "number") return value;
232
+ if (value === "auto") {
233
+ const from = sourceRadius ?? fallback;
234
+ const to = destinationRadius ?? fallback;
235
+ return interpolate(progress, [0, 1], [from, to], "clamp");
236
+ }
237
+ if (value && typeof value === "object") {
238
+ const from = typeof value.from === "number" ? value.from : fallback;
239
+ const to = typeof value.to === "number" ? value.to : fallback;
240
+ return interpolate(progress, [0, 1], [from, to], "clamp");
241
+ }
242
+ const from = sourceRadius ?? fallback;
243
+ const to = destinationRadius ?? fallback;
244
+ return interpolate(progress, [0, 1], [from, to], "clamp");
245
+ };
246
+ const resolveMaskRadii = ({
247
+ progress,
248
+ zoomOptions,
249
+ resolvedPair
250
+ }) => {
251
+ "worklet";
252
+
253
+ const sourceStyles = resolvedPair.sourceStyles;
254
+ const destinationStyles = resolvedPair.destinationStyles;
255
+ const defaultRadius = resolveRadiusRange({
256
+ value: zoomOptions.mask.borderRadius,
257
+ progress,
258
+ sourceRadius: getStyleRadius(sourceStyles, "borderRadius"),
259
+ destinationRadius: getStyleRadius(destinationStyles, "borderRadius"),
260
+ fallback: 12
261
+ });
262
+ const topLeftValue = zoomOptions.mask.borderTopLeftRadius ?? zoomOptions.mask.borderRadius;
263
+ const topRightValue = zoomOptions.mask.borderTopRightRadius ?? zoomOptions.mask.borderRadius;
264
+ const bottomLeftValue = zoomOptions.mask.borderBottomLeftRadius ?? zoomOptions.mask.borderRadius;
265
+ const bottomRightValue = zoomOptions.mask.borderBottomRightRadius ?? zoomOptions.mask.borderRadius;
266
+ return {
267
+ borderRadius: defaultRadius,
268
+ borderTopLeftRadius: resolveRadiusRange({
269
+ value: topLeftValue,
270
+ progress,
271
+ sourceRadius: getStyleRadius(sourceStyles, "borderTopLeftRadius"),
272
+ destinationRadius: getStyleRadius(destinationStyles, "borderTopLeftRadius"),
273
+ fallback: defaultRadius
274
+ }),
275
+ borderTopRightRadius: resolveRadiusRange({
276
+ value: topRightValue,
277
+ progress,
278
+ sourceRadius: getStyleRadius(sourceStyles, "borderTopRightRadius"),
279
+ destinationRadius: getStyleRadius(destinationStyles, "borderTopRightRadius"),
280
+ fallback: defaultRadius
281
+ }),
282
+ borderBottomLeftRadius: resolveRadiusRange({
283
+ value: bottomLeftValue,
284
+ progress,
285
+ sourceRadius: getStyleRadius(sourceStyles, "borderBottomLeftRadius"),
286
+ destinationRadius: getStyleRadius(destinationStyles, "borderBottomLeftRadius"),
287
+ fallback: defaultRadius
288
+ }),
289
+ borderBottomRightRadius: resolveRadiusRange({
290
+ value: bottomRightValue,
291
+ progress,
292
+ sourceRadius: getStyleRadius(sourceStyles, "borderBottomRightRadius"),
293
+ destinationRadius: getStyleRadius(destinationStyles, "borderBottomRightRadius"),
294
+ fallback: defaultRadius
295
+ })
296
+ };
297
+ };
298
+ export const buildZoomStyles = ({
299
+ id,
300
+ group,
301
+ zoomOptions,
302
+ props,
303
+ resolveTag,
304
+ computeRaw
305
+ }) => {
306
+ "worklet";
307
+
308
+ const focused = props.focused;
309
+ const progress = props.progress;
310
+ const currentRouteKey = props.current?.route.key;
311
+ const previousRouteKey = props.previous?.route.key;
312
+ const nextRouteKey = props.next?.route.key;
313
+ const entering = !props.next;
314
+ const screenLayout = props.layouts.screen;
315
+ const resolvedConfig = resolveZoomConfig({
316
+ id,
317
+ group,
318
+ zoomOptions,
319
+ currentRouteKey,
320
+ resolveTag,
321
+ defaultAnchor: "top"
322
+ });
323
+ if (!resolvedConfig) return NO_STYLES;
324
+ const {
325
+ resolvedTag,
326
+ sharedOptions,
327
+ explicitTarget,
328
+ zoomOptions: resolvedZoomOptions
329
+ } = resolvedConfig;
330
+ const normX = props.active.gesture.normX;
331
+ const normY = props.active.gesture.normY;
332
+ const initialDirection = props.active.gesture.direction;
333
+ const dragX = normalizedToTranslation({
334
+ normalized: normX,
335
+ dimension: screenLayout.width,
336
+ resistance: resolvedZoomOptions.motion.dragResistance
337
+ });
338
+ const dragY = normalizedToTranslation({
339
+ normalized: normY,
340
+ dimension: screenLayout.height,
341
+ resistance: resolvedZoomOptions.motion.dragResistance
342
+ });
343
+ const dragXScale = initialDirection === "horizontal" || initialDirection === "horizontal-inverted" ? resolveDirectionalDragScale({
344
+ normalized: normX,
345
+ dismissDirection: initialDirection === "horizontal-inverted" ? "negative" : "positive",
346
+ shrinkMin: resolvedZoomOptions.motion.dragDirectionalScaleMin,
347
+ growMax: resolvedZoomOptions.motion.dragDirectionalScaleMax,
348
+ exponent: 2
349
+ }) : IDENTITY_DRAG_SCALE_OUTPUT[0];
350
+ const dragYScale = initialDirection === "vertical" || initialDirection === "vertical-inverted" ? resolveDirectionalDragScale({
351
+ normalized: normY,
352
+ dismissDirection: initialDirection === "vertical-inverted" ? "negative" : "positive",
353
+ shrinkMin: resolvedZoomOptions.motion.dragDirectionalScaleMin,
354
+ growMax: resolvedZoomOptions.motion.dragDirectionalScaleMax,
355
+ exponent: 2
356
+ }) : IDENTITY_DRAG_SCALE_OUTPUT[1];
357
+ const dragScale = combineScales(dragXScale, dragYScale);
358
+ if (focused) {
359
+ const focusedPair = BoundStore.resolveTransitionPair(resolvedTag, {
360
+ currentScreenKey: currentRouteKey,
361
+ previousScreenKey: previousRouteKey,
362
+ nextScreenKey: nextRouteKey,
363
+ entering
364
+ });
365
+ const contentTarget = getZoomContentTarget({
366
+ explicitTarget,
367
+ resolvedTag,
368
+ currentRouteKey,
369
+ previousRouteKey,
370
+ nextRouteKey,
371
+ entering,
372
+ screenLayout,
373
+ anchor: sharedOptions.anchor,
374
+ resolvedPair: focusedPair
375
+ });
376
+ const contentRaw = computeRaw({
377
+ ...sharedOptions,
378
+ method: "content",
379
+ target: contentTarget
380
+ });
381
+ const maskRaw = computeRaw({
382
+ ...sharedOptions,
383
+ method: "size",
384
+ space: "absolute",
385
+ target: "fullscreen"
386
+ });
387
+ const focusedFade = props.active?.closing ? interpolate(progress, [0.6, 1], [0, 1], "clamp") : interpolate(progress, [0, 0.5], [0, 1], "clamp");
388
+ const {
389
+ top,
390
+ right,
391
+ bottom,
392
+ left
393
+ } = resolvedZoomOptions.mask.outset;
394
+ const maskWidth = Math.max(1, toNumber(maskRaw.width) + left + right);
395
+ const maskHeight = Math.max(1, toNumber(maskRaw.height) + top + bottom);
396
+ const contentTranslateX = toNumber(contentRaw.translateX) + dragX;
397
+ const contentTranslateY = toNumber(contentRaw.translateY) + dragY;
398
+ const contentScale = toNumber(contentRaw.scale, 1) * dragScale;
399
+ const maskTranslateX = toNumber(maskRaw.translateX) + dragX - left;
400
+ const maskTranslateY = toNumber(maskRaw.translateY) + dragY - top;
401
+ const maskRadii = resolveMaskRadii({
402
+ progress,
403
+ zoomOptions: resolvedZoomOptions,
404
+ resolvedPair: focusedPair
405
+ });
406
+ return {
407
+ [NAVIGATION_CONTAINER_STYLE_ID]: {
408
+ style: {
409
+ opacity: focusedFade,
410
+ transform: [{
411
+ translateX: contentTranslateX
412
+ }, {
413
+ translateY: contentTranslateY
414
+ }, {
415
+ scale: contentScale
416
+ }]
417
+ }
418
+ },
419
+ [NAVIGATION_MASK_STYLE_ID]: {
420
+ style: {
421
+ width: maskWidth,
422
+ height: maskHeight,
423
+ transform: [{
424
+ translateX: maskTranslateX
425
+ }, {
426
+ translateY: maskTranslateY
427
+ }, {
428
+ scale: dragScale
429
+ }],
430
+ borderRadius: maskRadii.borderRadius,
431
+ borderTopLeftRadius: maskRadii.borderTopLeftRadius,
432
+ borderTopRightRadius: maskRadii.borderTopRightRadius,
433
+ borderBottomLeftRadius: maskRadii.borderBottomLeftRadius,
434
+ borderBottomRightRadius: maskRadii.borderBottomRightRadius,
435
+ ...(resolvedZoomOptions.mask.borderCurve ? {
436
+ borderCurve: resolvedZoomOptions.mask.borderCurve
437
+ } : {})
438
+ }
439
+ },
440
+ // Signal the destination boundary to stay visible during the transition.
441
+ // Without this, useAssociatedStyles enters "waiting-first-style" mode
442
+ // (opacity: 0) because it detects previous-screen evidence but never
443
+ // receives a resolved style for this tag.
444
+ [resolvedTag]: {
445
+ style: {
446
+ opacity: 1
447
+ }
448
+ }
449
+ };
450
+ }
451
+ const unfocusedFade = props.active?.closing ? interpolate(progress, [1.6, 2], [1, 0], "clamp") : interpolate(progress, [1, 1.5], [1, 0], "clamp");
452
+ const unfocusedScale = interpolate(progress, [1, 2], [1, 0.95], "clamp");
453
+ const isUnfocusedIdle = props.active.settled === 1;
454
+ const elementTarget = sharedOptions.scaleMode === "match" ? "fullscreen" : getZoomContentTarget({
455
+ explicitTarget,
456
+ resolvedTag,
457
+ currentRouteKey,
458
+ previousRouteKey,
459
+ nextRouteKey,
460
+ entering,
461
+ screenLayout,
462
+ anchor: sharedOptions.anchor
463
+ });
464
+ const elementRaw = computeRaw({
465
+ ...sharedOptions,
466
+ method: "transform",
467
+ space: "relative",
468
+ target: elementTarget
469
+ });
470
+
471
+ // Keep compensation tied to the element target's center. In `scaleMode: "match"`
472
+ // this target is fullscreen, so the center offset should resolve to zero.
473
+ const elementCenterY = typeof elementTarget === "object" ? elementTarget.pageY + elementTarget.height / 2 : screenLayout.height / 2;
474
+ const scaleShiftY = computeCenterScaleShift({
475
+ center: elementCenterY,
476
+ containerCenter: screenLayout.height / 2,
477
+ scale: dragScale
478
+ });
479
+ const compensatedGestureX = composeCompensatedTranslation({
480
+ gesture: dragX,
481
+ parentScale: unfocusedScale,
482
+ epsilon: EPSILON
483
+ });
484
+ // dragY is measured in screen space and must be unscaled by the parent
485
+ // content shrink, while scaleShiftY is already in the parent's local space.
486
+ const compensatedGestureY = composeCompensatedTranslation({
487
+ gesture: dragY,
488
+ parentScale: unfocusedScale,
489
+ centerShift: scaleShiftY,
490
+ epsilon: EPSILON
491
+ });
492
+ const elementTranslateX = toNumber(elementRaw.translateX) + compensatedGestureX;
493
+ const elementTranslateY = toNumber(elementRaw.translateY) + compensatedGestureY;
494
+ const elementScaleX = toNumber(elementRaw.scaleX, 1) * dragScale;
495
+ const elementScaleY = toNumber(elementRaw.scaleY, 1) * dragScale;
496
+ const resolvedElementStyle = isUnfocusedIdle ? {
497
+ transform: [{
498
+ translateX: 0
499
+ }, {
500
+ translateY: 0
501
+ }, {
502
+ scaleX: 1
503
+ }, {
504
+ scaleY: 1
505
+ }],
506
+ opacity: 0,
507
+ zIndex: 0,
508
+ elevation: 0
509
+ } : {
510
+ transform: [{
511
+ translateX: elementTranslateX
512
+ }, {
513
+ translateY: elementTranslateY
514
+ }, {
515
+ scaleX: elementScaleX
516
+ }, {
517
+ scaleY: elementScaleY
518
+ }],
519
+ opacity: unfocusedFade,
520
+ zIndex: 9999,
521
+ elevation: 9999
522
+ };
523
+ return {
524
+ content: {
525
+ style: {
526
+ transform: [{
527
+ scale: unfocusedScale
528
+ }]
529
+ }
530
+ },
531
+ [resolvedTag]: {
532
+ style: resolvedElementStyle
533
+ }
534
+ };
535
+ };
536
+ //# sourceMappingURL=build.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["interpolate","EPSILON","NAVIGATION_CONTAINER_STYLE_ID","NAVIGATION_MASK_STYLE_ID","NO_STYLES","BoundStore","resolveZoomConfig","toNumber","IDENTITY_DRAG_SCALE_OUTPUT","clamp","value","min","max","lower","upper","clamp01","lerp","from","to","t","safeDivide","numerator","denominator","fallback","inverseLerp","inMin","inMax","mapRangeClamped","outMin","outMax","applyPowerCurve","exponent","safeExponent","magnitude","Math","abs","normalizedToTranslation","normalized","dimension","resistance","distance","normalizedToScale","outputRange","positiveOnly","outputStart","outputEnd","raw","combineScales","scaleX","scaleY","mode","computeCenterScaleShift","center","containerCenter","scale","compensateTranslationForParentScale","translation","parentScale","epsilon","safeParentScale","composeCompensatedTranslation","gesture","centerShift","resolveDirectionalDragScale","dismissDirection","shrinkMin","growMax","dismissalRelative","oppositeDrag","getZoomContentTarget","explicitTarget","resolvedTag","currentRouteKey","previousRouteKey","nextRouteKey","entering","screenLayout","anchor","resolvedPair","undefined","pair","resolveTransitionPair","currentScreenKey","previousScreenKey","nextScreenKey","sourceBounds","screenWidth","width","height","horizontalAnchor","verticalAnchor","x","y","pageX","pageY","getStyleRadius","styles","property","styleRecord","direct","borderRadius","resolveRadiusRange","progress","sourceRadius","destinationRadius","resolveMaskRadii","zoomOptions","sourceStyles","destinationStyles","defaultRadius","mask","topLeftValue","borderTopLeftRadius","topRightValue","borderTopRightRadius","bottomLeftValue","borderBottomLeftRadius","bottomRightValue","borderBottomRightRadius","buildZoomStyles","id","group","props","resolveTag","computeRaw","focused","current","route","key","previous","next","layouts","screen","resolvedConfig","defaultAnchor","sharedOptions","resolvedZoomOptions","normX","active","normY","initialDirection","direction","dragX","motion","dragResistance","dragY","dragXScale","dragDirectionalScaleMin","dragDirectionalScaleMax","dragYScale","dragScale","focusedPair","contentTarget","contentRaw","method","target","maskRaw","space","focusedFade","closing","top","right","bottom","left","outset","maskWidth","maskHeight","contentTranslateX","translateX","contentTranslateY","translateY","contentScale","maskTranslateX","maskTranslateY","maskRadii","style","opacity","transform","borderCurve","unfocusedFade","unfocusedScale","isUnfocusedIdle","settled","elementTarget","scaleMode","elementRaw","elementCenterY","scaleShiftY","compensatedGestureX","compensatedGestureY","elementTranslateX","elementTranslateY","elementScaleX","elementScaleY","resolvedElementStyle","zIndex","elevation","content"],"sourceRoot":"../../../../../../src","sources":["shared/utils/bounds/zoom/build.ts"],"mappings":";;AAAA,SAASA,WAAW,QAAyB,yBAAyB;AACtE,SACCC,OAAO,EACPC,6BAA6B,EAC7BC,wBAAwB,EACxBC,SAAS,QACH,oBAAoB;AAC3B,SACCC,UAAU,QAEJ,wBAAwB;AAK/B,SAECC,iBAAiB,EACjBC,QAAQ,QACF,UAAU;AAKjB,MAAMC,0BAA0B,GAAG,CAAC,CAAC,EAAE,CAAC,CAAU;AAIlD,MAAMC,KAAK,GAAGA,CAACC,KAAa,EAAEC,GAAW,EAAEC,GAAW,KAAa;EAClE,SAAS;;EACT,MAAMC,KAAK,GAAGF,GAAG,GAAGC,GAAG,GAAGD,GAAG,GAAGC,GAAG;EACnC,MAAME,KAAK,GAAGF,GAAG,GAAGD,GAAG,GAAGC,GAAG,GAAGD,GAAG;EAEnC,IAAID,KAAK,GAAGG,KAAK,EAAE,OAAOA,KAAK;EAC/B,IAAIH,KAAK,GAAGI,KAAK,EAAE,OAAOA,KAAK;EAE/B,OAAOJ,KAAK;AACb,CAAC;AAED,MAAMK,OAAO,GAAIL,KAAa,IAAa;EAC1C,SAAS;;EACT,OAAOD,KAAK,CAACC,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;AAC1B,CAAC;AAED,MAAMM,IAAI,GAAGA,CAACC,IAAY,EAAEC,EAAU,EAAEC,CAAS,KAAa;EAC7D,SAAS;;EACT,OAAOF,IAAI,GAAG,CAACC,EAAE,GAAGD,IAAI,IAAIE,CAAC;AAC9B,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mB,MAAM,EAAE,CAAC;IACTC,SAAS,EAAE;EACZ,CAAC,GACA;IACAnB,SAAS,EAAE,CACV;MAAET,UAAU,EAAEsB;IAAkB,CAAC,EACjC;MAAEpB,UAAU,EAAEqB;IAAkB,CAAC,EACjC;MAAE/I,MAAM,EAAEgJ;IAAc,CAAC,EACzB;MAAE/I,MAAM,EAAEgJ;IAAc,CAAC,CACzB;IACDjB,OAAO,EAAEG,aAAa;IACtBgB,MAAM,EAAE,IAAI;IACZC,SAAS,EAAE;EACZ,CAAC;EAEH,OAAO;IACNC,OAAO,EAAE;MACRtB,KAAK,EAAE;QACNE,SAAS,EAAE,CAAC;UAAE3H,KAAK,EAAE8H;QAAe,CAAC;MACtC;IACD,CAAC;IACD,CAAC7G,WAAW,GAAG;MACdwG,KAAK,EAAEmB;IACR;EACD,CAAC;AACF,CAAC","ignoreList":[]}
@@ -0,0 +1,112 @@
1
+ "use strict";
2
+
3
+ import { BoundStore } from "../../../stores/bounds";
4
+ const DEFAULT_DRAG_RESISTANCE = 0.4;
5
+ const DEFAULT_DRAG_DIRECTIONAL_SCALE_MIN = 0.25;
6
+ const DEFAULT_DRAG_DIRECTIONAL_SCALE_MAX = 1.06;
7
+ const DEFAULT_MASK_BORDER_RADIUS = 12;
8
+ const ZERO_OUTSET = Object.freeze({
9
+ top: 0,
10
+ right: 0,
11
+ bottom: 0,
12
+ left: 0
13
+ });
14
+ export const toNumber = (value, fallback = 0) => {
15
+ "worklet";
16
+
17
+ return typeof value === "number" ? value : fallback;
18
+ };
19
+ const isFiniteNumber = value => {
20
+ "worklet";
21
+
22
+ return typeof value === "number" && Number.isFinite(value);
23
+ };
24
+ const normalizeOutset = value => {
25
+ "worklet";
26
+
27
+ if (typeof value === "number") {
28
+ return {
29
+ top: value,
30
+ right: value,
31
+ bottom: value,
32
+ left: value
33
+ };
34
+ }
35
+ if (!value) {
36
+ return ZERO_OUTSET;
37
+ }
38
+ return {
39
+ top: isFiniteNumber(value.top) ? value.top : 0,
40
+ right: isFiniteNumber(value.right) ? value.right : 0,
41
+ bottom: isFiniteNumber(value.bottom) ? value.bottom : 0,
42
+ left: isFiniteNumber(value.left) ? value.left : 0
43
+ };
44
+ };
45
+ const normalizeZoomOptions = zoomOptions => {
46
+ "worklet";
47
+
48
+ const resolvedMaskRadius = zoomOptions?.mask?.borderRadius ?? (isFiniteNumber(zoomOptions?.maskBorderRadius) ? zoomOptions?.maskBorderRadius : DEFAULT_MASK_BORDER_RADIUS);
49
+ return {
50
+ mask: {
51
+ borderRadius: resolvedMaskRadius,
52
+ borderTopLeftRadius: zoomOptions?.mask?.borderTopLeftRadius,
53
+ borderTopRightRadius: zoomOptions?.mask?.borderTopRightRadius,
54
+ borderBottomLeftRadius: zoomOptions?.mask?.borderBottomLeftRadius,
55
+ borderBottomRightRadius: zoomOptions?.mask?.borderBottomRightRadius,
56
+ borderCurve: zoomOptions?.mask?.borderCurve,
57
+ outset: normalizeOutset(zoomOptions?.mask?.outset)
58
+ },
59
+ motion: {
60
+ dragResistance: isFiniteNumber(zoomOptions?.motion?.dragResistance) ? zoomOptions.motion.dragResistance : DEFAULT_DRAG_RESISTANCE,
61
+ dragDirectionalScaleMin: isFiniteNumber(zoomOptions?.motion?.dragDirectionalScaleMin) ? zoomOptions.motion.dragDirectionalScaleMin : DEFAULT_DRAG_DIRECTIONAL_SCALE_MIN,
62
+ dragDirectionalScaleMax: DEFAULT_DRAG_DIRECTIONAL_SCALE_MAX
63
+ }
64
+ };
65
+ };
66
+ export const resolveZoomConfig = ({
67
+ id,
68
+ group,
69
+ zoomOptions,
70
+ currentRouteKey,
71
+ resolveTag,
72
+ defaultAnchor
73
+ }) => {
74
+ "worklet";
75
+
76
+ const resolvedTag = resolveTag({
77
+ id,
78
+ group
79
+ });
80
+ if (!resolvedTag) return null;
81
+
82
+ // Try direct boundary config for the current screen first.
83
+ const boundaryConfig = currentRouteKey ? BoundStore.getBoundaryConfig(resolvedTag, currentRouteKey) : null;
84
+
85
+ // Fallback: when the current screen has no Boundary (e.g. a zoom detail
86
+ // screen without a destination element), inherit config from the link's
87
+ // source screen so that props like scaleMode propagate to both sides.
88
+ let effectiveConfig = boundaryConfig;
89
+ if (!effectiveConfig) {
90
+ // For no-destination navigation zoom, the focused route won't appear in
91
+ // a completed link yet. Fall back to the latest unscoped link so source
92
+ // boundary defaults (anchor/scaleMode/target) still propagate.
93
+ const scopedLink = currentRouteKey ? BoundStore.getActiveLink(resolvedTag, currentRouteKey) : null;
94
+ const link = scopedLink ?? BoundStore.getActiveLink(resolvedTag);
95
+ if (link?.source) {
96
+ effectiveConfig = BoundStore.getBoundaryConfig(resolvedTag, link.source.screenKey);
97
+ }
98
+ }
99
+ const sharedOptions = {
100
+ anchor: zoomOptions?.anchor ?? effectiveConfig?.anchor ?? defaultAnchor,
101
+ scaleMode: zoomOptions?.scaleMode ?? effectiveConfig?.scaleMode ?? "uniform"
102
+ };
103
+ const explicitTarget = zoomOptions?.target ?? effectiveConfig?.target;
104
+ const resolvedZoomOptions = normalizeZoomOptions(zoomOptions);
105
+ return {
106
+ resolvedTag,
107
+ sharedOptions,
108
+ explicitTarget,
109
+ zoomOptions: resolvedZoomOptions
110
+ };
111
+ };
112
+ //# sourceMappingURL=config.js.map