react-native-screen-transitions 3.9.0-beta.2 → 3.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (262) hide show
  1. package/lib/commonjs/shared/components/boundary/components/boundary-target.js +19 -14
  2. package/lib/commonjs/shared/components/boundary/components/boundary-target.js.map +1 -1
  3. package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js +14 -7
  4. package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js.map +1 -1
  5. package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/components/host.js +1 -0
  6. package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/components/host.js.map +1 -1
  7. package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js +32 -2
  8. package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js.map +1 -1
  9. package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/index.js +4 -3
  10. package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/index.js.map +1 -1
  11. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/components/host.js +3 -2
  12. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/components/host.js.map +1 -1
  13. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.js +4 -3
  14. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.js.map +1 -1
  15. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/components/portal-slot.js +2 -3
  16. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/components/portal-slot.js.map +1 -1
  17. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js +1 -0
  18. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js.map +1 -1
  19. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/index.js +1 -3
  20. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/index.js.map +1 -1
  21. package/lib/commonjs/shared/components/boundary/portal/teleport.js +2 -1
  22. package/lib/commonjs/shared/components/boundary/portal/teleport.js.map +1 -1
  23. package/lib/commonjs/shared/components/boundary/portal/utils/ownership.js +4 -1
  24. package/lib/commonjs/shared/components/boundary/portal/utils/ownership.js.map +1 -1
  25. package/lib/commonjs/shared/components/boundary/providers/boundary-root.provider.js +16 -3
  26. package/lib/commonjs/shared/components/boundary/providers/boundary-root.provider.js.map +1 -1
  27. package/lib/commonjs/shared/configs/index.js +2 -1
  28. package/lib/commonjs/shared/configs/index.js.map +1 -1
  29. package/lib/commonjs/shared/configs/specs.js +23 -1
  30. package/lib/commonjs/shared/configs/specs.js.map +1 -1
  31. package/lib/commonjs/shared/constants.js +4 -0
  32. package/lib/commonjs/shared/constants.js.map +1 -1
  33. package/lib/commonjs/shared/providers/screen/animation/helpers/hydrate-transition-state/index.js +4 -0
  34. package/lib/commonjs/shared/providers/screen/animation/helpers/hydrate-transition-state/index.js.map +1 -1
  35. package/lib/commonjs/shared/providers/screen/gestures/pan/activation/use-pan-activation.js +10 -10
  36. package/lib/commonjs/shared/providers/screen/gestures/pan/activation/use-pan-activation.js.map +1 -1
  37. package/lib/commonjs/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.js +10 -2
  38. package/lib/commonjs/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.js.map +1 -1
  39. package/lib/commonjs/shared/providers/screen/gestures/pan/use-build-pan-gesture.js +1 -1
  40. package/lib/commonjs/shared/providers/screen/gestures/pan/use-build-pan-gesture.js.map +1 -1
  41. package/lib/commonjs/shared/providers/screen/gestures/pinch/activation/use-pinch-activation.js +25 -3
  42. package/lib/commonjs/shared/providers/screen/gestures/pinch/activation/use-pinch-activation.js.map +1 -1
  43. package/lib/commonjs/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.js +4 -6
  44. package/lib/commonjs/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.js.map +1 -1
  45. package/lib/commonjs/shared/providers/screen/gestures/pinch/behavior/use-pinch-behavior.js +2 -2
  46. package/lib/commonjs/shared/providers/screen/gestures/pinch/behavior/use-pinch-behavior.js.map +1 -1
  47. package/lib/commonjs/shared/providers/screen/gestures/scroll-coordination/use-scroll-gesture-coordination.js +6 -1
  48. package/lib/commonjs/shared/providers/screen/gestures/scroll-coordination/use-scroll-gesture-coordination.js.map +1 -1
  49. package/lib/commonjs/shared/providers/screen/gestures/shared/snapshot.js +2 -0
  50. package/lib/commonjs/shared/providers/screen/gestures/shared/snapshot.js.map +1 -1
  51. package/lib/commonjs/shared/providers/screen/gestures/shared/values.js +2 -0
  52. package/lib/commonjs/shared/providers/screen/gestures/shared/values.js.map +1 -1
  53. package/lib/commonjs/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js +11 -0
  54. package/lib/commonjs/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js.map +1 -1
  55. package/lib/commonjs/shared/stores/gesture.store.js +8 -0
  56. package/lib/commonjs/shared/stores/gesture.store.js.map +1 -1
  57. package/lib/commonjs/shared/utils/animation/animate-to-progress.js +24 -7
  58. package/lib/commonjs/shared/utils/animation/animate-to-progress.js.map +1 -1
  59. package/lib/commonjs/shared/utils/bounds/navigation/reveal/math.js +5 -2
  60. package/lib/commonjs/shared/utils/bounds/navigation/reveal/math.js.map +1 -1
  61. package/lib/commonjs/shared/utils/bounds/navigation/zoom/build.js +184 -314
  62. package/lib/commonjs/shared/utils/bounds/navigation/zoom/build.js.map +1 -1
  63. package/lib/commonjs/shared/utils/bounds/navigation/zoom/config.js +13 -18
  64. package/lib/commonjs/shared/utils/bounds/navigation/zoom/config.js.map +1 -1
  65. package/lib/commonjs/shared/utils/bounds/navigation/zoom/drag.js +196 -0
  66. package/lib/commonjs/shared/utils/bounds/navigation/zoom/drag.js.map +1 -0
  67. package/lib/commonjs/shared/utils/bounds/navigation/zoom/helpers.js +97 -108
  68. package/lib/commonjs/shared/utils/bounds/navigation/zoom/helpers.js.map +1 -1
  69. package/lib/commonjs/shared/utils/bounds/navigation/zoom/mask.js +73 -0
  70. package/lib/commonjs/shared/utils/bounds/navigation/zoom/mask.js.map +1 -0
  71. package/lib/commonjs/shared/utils/bounds/navigation/zoom/targets.js +90 -0
  72. package/lib/commonjs/shared/utils/bounds/navigation/zoom/targets.js.map +1 -0
  73. package/lib/module/shared/components/boundary/components/boundary-target.js +20 -15
  74. package/lib/module/shared/components/boundary/components/boundary-target.js.map +1 -1
  75. package/lib/module/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js +14 -7
  76. package/lib/module/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js.map +1 -1
  77. package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/components/host.js +2 -1
  78. package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/components/host.js.map +1 -1
  79. package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js +32 -2
  80. package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js.map +1 -1
  81. package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/index.js +5 -4
  82. package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/index.js.map +1 -1
  83. package/lib/module/shared/components/boundary/portal/components/boundary-portal/components/host.js +3 -2
  84. package/lib/module/shared/components/boundary/portal/components/boundary-portal/components/host.js.map +1 -1
  85. package/lib/module/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.js +5 -4
  86. package/lib/module/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.js.map +1 -1
  87. package/lib/module/shared/components/boundary/portal/components/boundary-portal/components/portal-slot.js +3 -4
  88. package/lib/module/shared/components/boundary/portal/components/boundary-portal/components/portal-slot.js.map +1 -1
  89. package/lib/module/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js +1 -0
  90. package/lib/module/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js.map +1 -1
  91. package/lib/module/shared/components/boundary/portal/components/boundary-portal/index.js +1 -3
  92. package/lib/module/shared/components/boundary/portal/components/boundary-portal/index.js.map +1 -1
  93. package/lib/module/shared/components/boundary/portal/teleport.js +1 -0
  94. package/lib/module/shared/components/boundary/portal/teleport.js.map +1 -1
  95. package/lib/module/shared/components/boundary/portal/utils/ownership.js +4 -1
  96. package/lib/module/shared/components/boundary/portal/utils/ownership.js.map +1 -1
  97. package/lib/module/shared/components/boundary/providers/boundary-root.provider.js +17 -4
  98. package/lib/module/shared/components/boundary/providers/boundary-root.provider.js.map +1 -1
  99. package/lib/module/shared/configs/index.js +3 -2
  100. package/lib/module/shared/configs/index.js.map +1 -1
  101. package/lib/module/shared/configs/specs.js +22 -0
  102. package/lib/module/shared/configs/specs.js.map +1 -1
  103. package/lib/module/shared/constants.js +4 -0
  104. package/lib/module/shared/constants.js.map +1 -1
  105. package/lib/module/shared/providers/screen/animation/helpers/hydrate-transition-state/index.js +4 -0
  106. package/lib/module/shared/providers/screen/animation/helpers/hydrate-transition-state/index.js.map +1 -1
  107. package/lib/module/shared/providers/screen/gestures/pan/activation/use-pan-activation.js +10 -10
  108. package/lib/module/shared/providers/screen/gestures/pan/activation/use-pan-activation.js.map +1 -1
  109. package/lib/module/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.js +10 -2
  110. package/lib/module/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.js.map +1 -1
  111. package/lib/module/shared/providers/screen/gestures/pan/use-build-pan-gesture.js +1 -1
  112. package/lib/module/shared/providers/screen/gestures/pan/use-build-pan-gesture.js.map +1 -1
  113. package/lib/module/shared/providers/screen/gestures/pinch/activation/use-pinch-activation.js +23 -2
  114. package/lib/module/shared/providers/screen/gestures/pinch/activation/use-pinch-activation.js.map +1 -1
  115. package/lib/module/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.js +4 -6
  116. package/lib/module/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.js.map +1 -1
  117. package/lib/module/shared/providers/screen/gestures/pinch/behavior/use-pinch-behavior.js +2 -2
  118. package/lib/module/shared/providers/screen/gestures/pinch/behavior/use-pinch-behavior.js.map +1 -1
  119. package/lib/module/shared/providers/screen/gestures/scroll-coordination/use-scroll-gesture-coordination.js +6 -1
  120. package/lib/module/shared/providers/screen/gestures/scroll-coordination/use-scroll-gesture-coordination.js.map +1 -1
  121. package/lib/module/shared/providers/screen/gestures/shared/snapshot.js +2 -0
  122. package/lib/module/shared/providers/screen/gestures/shared/snapshot.js.map +1 -1
  123. package/lib/module/shared/providers/screen/gestures/shared/values.js +2 -0
  124. package/lib/module/shared/providers/screen/gestures/shared/values.js.map +1 -1
  125. package/lib/module/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js +11 -0
  126. package/lib/module/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js.map +1 -1
  127. package/lib/module/shared/stores/gesture.store.js +8 -0
  128. package/lib/module/shared/stores/gesture.store.js.map +1 -1
  129. package/lib/module/shared/types/bounds.types.js +26 -0
  130. package/lib/module/shared/types/bounds.types.js.map +1 -1
  131. package/lib/module/shared/utils/animation/animate-to-progress.js +24 -7
  132. package/lib/module/shared/utils/animation/animate-to-progress.js.map +1 -1
  133. package/lib/module/shared/utils/bounds/navigation/reveal/math.js +5 -2
  134. package/lib/module/shared/utils/bounds/navigation/reveal/math.js.map +1 -1
  135. package/lib/module/shared/utils/bounds/navigation/zoom/build.js +188 -318
  136. package/lib/module/shared/utils/bounds/navigation/zoom/build.js.map +1 -1
  137. package/lib/module/shared/utils/bounds/navigation/zoom/config.js +12 -17
  138. package/lib/module/shared/utils/bounds/navigation/zoom/config.js.map +1 -1
  139. package/lib/module/shared/utils/bounds/navigation/zoom/drag.js +184 -0
  140. package/lib/module/shared/utils/bounds/navigation/zoom/drag.js.map +1 -0
  141. package/lib/module/shared/utils/bounds/navigation/zoom/helpers.js +94 -102
  142. package/lib/module/shared/utils/bounds/navigation/zoom/helpers.js.map +1 -1
  143. package/lib/module/shared/utils/bounds/navigation/zoom/mask.js +68 -0
  144. package/lib/module/shared/utils/bounds/navigation/zoom/mask.js.map +1 -0
  145. package/lib/module/shared/utils/bounds/navigation/zoom/targets.js +84 -0
  146. package/lib/module/shared/utils/bounds/navigation/zoom/targets.js.map +1 -0
  147. package/lib/typescript/shared/components/boundary/components/boundary-target.d.ts +3 -1
  148. package/lib/typescript/shared/components/boundary/components/boundary-target.d.ts.map +1 -1
  149. package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.d.ts.map +1 -1
  150. package/lib/typescript/shared/components/boundary/portal/components/boundary-content-portal/components/host.d.ts.map +1 -1
  151. package/lib/typescript/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.d.ts.map +1 -1
  152. package/lib/typescript/shared/components/boundary/portal/components/boundary-content-portal/index.d.ts +1 -3
  153. package/lib/typescript/shared/components/boundary/portal/components/boundary-content-portal/index.d.ts.map +1 -1
  154. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/components/host.d.ts.map +1 -1
  155. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.d.ts.map +1 -1
  156. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/components/portal-slot.d.ts +2 -3
  157. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/components/portal-slot.d.ts.map +1 -1
  158. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.d.ts.map +1 -1
  159. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/index.d.ts +2 -3
  160. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/index.d.ts.map +1 -1
  161. package/lib/typescript/shared/components/boundary/portal/teleport.d.ts +1 -0
  162. package/lib/typescript/shared/components/boundary/portal/teleport.d.ts.map +1 -1
  163. package/lib/typescript/shared/components/boundary/portal/utils/ownership.d.ts.map +1 -1
  164. package/lib/typescript/shared/components/boundary/providers/boundary-root.provider.d.ts +1 -0
  165. package/lib/typescript/shared/components/boundary/providers/boundary-root.provider.d.ts.map +1 -1
  166. package/lib/typescript/shared/configs/index.d.ts +16 -0
  167. package/lib/typescript/shared/configs/index.d.ts.map +1 -1
  168. package/lib/typescript/shared/configs/specs.d.ts +19 -0
  169. package/lib/typescript/shared/configs/specs.d.ts.map +1 -1
  170. package/lib/typescript/shared/constants.d.ts.map +1 -1
  171. package/lib/typescript/shared/index.d.ts +17 -1
  172. package/lib/typescript/shared/index.d.ts.map +1 -1
  173. package/lib/typescript/shared/providers/screen/animation/helpers/hydrate-transition-state/index.d.ts.map +1 -1
  174. package/lib/typescript/shared/providers/screen/gestures/pan/activation/use-pan-activation.d.ts +2 -0
  175. package/lib/typescript/shared/providers/screen/gestures/pan/activation/use-pan-activation.d.ts.map +1 -1
  176. package/lib/typescript/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.d.ts +2 -1
  177. package/lib/typescript/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.d.ts.map +1 -1
  178. package/lib/typescript/shared/providers/screen/gestures/pan/use-build-pan-gesture.d.ts.map +1 -1
  179. package/lib/typescript/shared/providers/screen/gestures/pinch/activation/use-pinch-activation.d.ts +2 -0
  180. package/lib/typescript/shared/providers/screen/gestures/pinch/activation/use-pinch-activation.d.ts.map +1 -1
  181. package/lib/typescript/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.d.ts +1 -1
  182. package/lib/typescript/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.d.ts.map +1 -1
  183. package/lib/typescript/shared/providers/screen/gestures/pinch/behavior/use-pinch-behavior.d.ts.map +1 -1
  184. package/lib/typescript/shared/providers/screen/gestures/scroll-coordination/use-scroll-gesture-coordination.d.ts.map +1 -1
  185. package/lib/typescript/shared/providers/screen/gestures/shared/snapshot.d.ts.map +1 -1
  186. package/lib/typescript/shared/providers/screen/gestures/shared/values.d.ts.map +1 -1
  187. package/lib/typescript/shared/providers/screen/styles/hooks/use-maybe-block-visibility.d.ts +4 -0
  188. package/lib/typescript/shared/providers/screen/styles/hooks/use-maybe-block-visibility.d.ts.map +1 -1
  189. package/lib/typescript/shared/stores/gesture.store.d.ts +4 -0
  190. package/lib/typescript/shared/stores/gesture.store.d.ts.map +1 -1
  191. package/lib/typescript/shared/types/bounds.types.d.ts +115 -88
  192. package/lib/typescript/shared/types/bounds.types.d.ts.map +1 -1
  193. package/lib/typescript/shared/types/gesture.types.d.ts +10 -0
  194. package/lib/typescript/shared/types/gesture.types.d.ts.map +1 -1
  195. package/lib/typescript/shared/types/index.d.ts +1 -1
  196. package/lib/typescript/shared/types/index.d.ts.map +1 -1
  197. package/lib/typescript/shared/utils/animation/animate-to-progress.d.ts.map +1 -1
  198. package/lib/typescript/shared/utils/bounds/navigation/reveal/math.d.ts +3 -1
  199. package/lib/typescript/shared/utils/bounds/navigation/reveal/math.d.ts.map +1 -1
  200. package/lib/typescript/shared/utils/bounds/navigation/zoom/build.d.ts +1 -1
  201. package/lib/typescript/shared/utils/bounds/navigation/zoom/build.d.ts.map +1 -1
  202. package/lib/typescript/shared/utils/bounds/navigation/zoom/config.d.ts +7 -17
  203. package/lib/typescript/shared/utils/bounds/navigation/zoom/config.d.ts.map +1 -1
  204. package/lib/typescript/shared/utils/bounds/navigation/zoom/drag.d.ts +55 -0
  205. package/lib/typescript/shared/utils/bounds/navigation/zoom/drag.d.ts.map +1 -0
  206. package/lib/typescript/shared/utils/bounds/navigation/zoom/helpers.d.ts +33 -34
  207. package/lib/typescript/shared/utils/bounds/navigation/zoom/helpers.d.ts.map +1 -1
  208. package/lib/typescript/shared/utils/bounds/navigation/zoom/mask.d.ts +27 -0
  209. package/lib/typescript/shared/utils/bounds/navigation/zoom/mask.d.ts.map +1 -0
  210. package/lib/typescript/shared/utils/bounds/navigation/zoom/targets.d.ts +22 -0
  211. package/lib/typescript/shared/utils/bounds/navigation/zoom/targets.d.ts.map +1 -0
  212. package/lib/typescript/shared/utils/bounds/navigation/zoom/types.d.ts +1 -1
  213. package/lib/typescript/shared/utils/bounds/navigation/zoom/types.d.ts.map +1 -1
  214. package/package.json +2 -2
  215. package/src/shared/components/boundary/components/boundary-target.tsx +37 -26
  216. package/src/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.ts +16 -13
  217. package/src/shared/components/boundary/portal/components/boundary-content-portal/components/host.tsx +6 -2
  218. package/src/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.ts +46 -3
  219. package/src/shared/components/boundary/portal/components/boundary-content-portal/index.tsx +8 -5
  220. package/src/shared/components/boundary/portal/components/boundary-portal/components/host.tsx +3 -2
  221. package/src/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.tsx +5 -4
  222. package/src/shared/components/boundary/portal/components/boundary-portal/components/portal-slot.tsx +4 -5
  223. package/src/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.ts +5 -1
  224. package/src/shared/components/boundary/portal/components/boundary-portal/index.tsx +1 -4
  225. package/src/shared/components/boundary/portal/teleport.ts +1 -0
  226. package/src/shared/components/boundary/portal/utils/ownership.ts +5 -1
  227. package/src/shared/components/boundary/providers/boundary-root.provider.tsx +23 -3
  228. package/src/shared/configs/index.ts +2 -1
  229. package/src/shared/configs/specs.ts +23 -0
  230. package/src/shared/constants.ts +4 -0
  231. package/src/shared/index.ts +2 -0
  232. package/src/shared/providers/screen/animation/helpers/hydrate-transition-state/index.ts +8 -0
  233. package/src/shared/providers/screen/gestures/pan/activation/use-pan-activation.ts +16 -7
  234. package/src/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.ts +18 -1
  235. package/src/shared/providers/screen/gestures/pan/use-build-pan-gesture.ts +1 -0
  236. package/src/shared/providers/screen/gestures/pinch/activation/use-pinch-activation.ts +40 -2
  237. package/src/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.ts +7 -11
  238. package/src/shared/providers/screen/gestures/pinch/behavior/use-pinch-behavior.ts +12 -15
  239. package/src/shared/providers/screen/gestures/scroll-coordination/use-scroll-gesture-coordination.ts +6 -1
  240. package/src/shared/providers/screen/gestures/shared/snapshot.ts +2 -0
  241. package/src/shared/providers/screen/gestures/shared/values.ts +2 -0
  242. package/src/shared/providers/screen/styles/hooks/use-maybe-block-visibility.tsx +14 -1
  243. package/src/shared/stores/gesture.store.ts +12 -0
  244. package/src/shared/types/bounds.types.ts +119 -90
  245. package/src/shared/types/gesture.types.ts +10 -0
  246. package/src/shared/types/index.ts +2 -0
  247. package/src/shared/utils/animation/animate-to-progress.ts +23 -7
  248. package/src/shared/utils/bounds/navigation/reveal/math.ts +6 -1
  249. package/src/shared/utils/bounds/navigation/zoom/build.ts +231 -411
  250. package/src/shared/utils/bounds/navigation/zoom/config.ts +16 -18
  251. package/src/shared/utils/bounds/navigation/zoom/drag.ts +327 -0
  252. package/src/shared/utils/bounds/navigation/zoom/helpers.ts +127 -184
  253. package/src/shared/utils/bounds/navigation/zoom/mask.ts +133 -0
  254. package/src/shared/utils/bounds/navigation/zoom/targets.ts +132 -0
  255. package/src/shared/utils/bounds/navigation/zoom/types.ts +1 -1
  256. package/lib/commonjs/shared/utils/bounds/navigation/zoom/math.js +0 -25
  257. package/lib/commonjs/shared/utils/bounds/navigation/zoom/math.js.map +0 -1
  258. package/lib/module/shared/utils/bounds/navigation/zoom/math.js +0 -20
  259. package/lib/module/shared/utils/bounds/navigation/zoom/math.js.map +0 -1
  260. package/lib/typescript/shared/utils/bounds/navigation/zoom/math.d.ts +0 -8
  261. package/lib/typescript/shared/utils/bounds/navigation/zoom/math.d.ts.map +0 -1
  262. package/src/shared/utils/bounds/navigation/zoom/math.ts +0 -25
@@ -0,0 +1,133 @@
1
+ import type { MeasuredDimensions } from "react-native-reanimated";
2
+ import { interpolate } from "react-native-reanimated";
3
+ import type {
4
+ ScreenTransitionState,
5
+ TransitionSlotStyle,
6
+ } from "../../../../types/animation.types";
7
+ import type {
8
+ BoundsLink,
9
+ BoundsScopedAccessor,
10
+ } from "../../../../types/bounds.types";
11
+ import type { Layout } from "../../../../types/screen.types";
12
+ import type { BoundsAnchor } from "../../types/options";
13
+ import { toNumber } from "../helpers";
14
+ import { DRAG_MASK_HEIGHT_COLLAPSE_END } from "../reveal/config";
15
+ import {
16
+ interpolateClamped,
17
+ resolveAspectRatioMaskHeight,
18
+ } from "../reveal/math";
19
+ import { ZOOM_SHARED_OPTIONS } from "./config";
20
+ import type { ZoomDragState } from "./drag";
21
+
22
+ export const ZOOM_NAVIGATION_MASK_BORDER_RADIUS = 64;
23
+ const ZOOM_VERTICAL_DRAG_MASK_COLLAPSE_SCALE = 0.8;
24
+
25
+ interface ZoomNavigationMaskStyleProps {
26
+ scopedBounds: BoundsScopedAccessor;
27
+ link: BoundsLink;
28
+ sourceBounds: MeasuredDimensions;
29
+ screenLayout: Layout;
30
+ transitionProgress: number;
31
+ drag: ZoomDragState;
32
+ contentTransform: {
33
+ translateX: number;
34
+ translateY: number;
35
+ scale: number;
36
+ };
37
+ sourceBorderRadius: number;
38
+ expandedBorderRadius: number;
39
+ active: ScreenTransitionState;
40
+ anchor: BoundsAnchor;
41
+ }
42
+
43
+ export function resolveZoomNavigationMaskStyle({
44
+ scopedBounds,
45
+ link,
46
+ sourceBounds,
47
+ screenLayout,
48
+ transitionProgress,
49
+ drag,
50
+ contentTransform,
51
+ sourceBorderRadius,
52
+ expandedBorderRadius,
53
+ active,
54
+ anchor,
55
+ }: ZoomNavigationMaskStyleProps): TransitionSlotStyle {
56
+ "worklet";
57
+
58
+ const maskRaw = scopedBounds.values({
59
+ scaleMode: ZOOM_SHARED_OPTIONS.scaleMode,
60
+ anchor,
61
+ method: "size",
62
+ space: "absolute",
63
+ target: "fullscreen",
64
+ progress: transitionProgress,
65
+ });
66
+ const maskWidth = maskRaw.width;
67
+ const maskHeight = maskRaw.height;
68
+ const maskAspectBounds = link.initialSource?.bounds ?? sourceBounds;
69
+ const minMaskHeight = resolveAspectRatioMaskHeight({
70
+ maskWidth,
71
+ maskHeight,
72
+ targetWidth: maskAspectBounds.width,
73
+ targetHeight: maskAspectBounds.height,
74
+ });
75
+ const maskHeightCollapseDrag = drag.collapsesMask
76
+ ? Math.max(
77
+ 0,
78
+ drag.dismissNorm * ZOOM_VERTICAL_DRAG_MASK_COLLAPSE_SCALE,
79
+ drag.dismissProgress,
80
+ )
81
+ : 0;
82
+ const renderedMaskHeight = interpolateClamped(
83
+ maskHeightCollapseDrag,
84
+ 0,
85
+ DRAG_MASK_HEIGHT_COLLAPSE_END,
86
+ maskHeight,
87
+ minMaskHeight,
88
+ );
89
+ const maskCenterX = maskWidth / 2;
90
+ const maskCenterY = renderedMaskHeight / 2;
91
+ const contentCenterX = screenLayout.width / 2;
92
+ const contentCenterY = screenLayout.height / 2;
93
+ const maskOriginOffsetY = drag.isVerticalInverted
94
+ ? maskHeight - renderedMaskHeight
95
+ : 0;
96
+ const compensatedMaskTranslateX =
97
+ (maskRaw.translateX -
98
+ contentTransform.translateX +
99
+ (1 - contentTransform.scale) * (maskCenterX - contentCenterX)) /
100
+ contentTransform.scale;
101
+ const compensatedMaskTranslateY =
102
+ (maskRaw.translateY -
103
+ contentTransform.translateY +
104
+ maskOriginOffsetY +
105
+ (1 - contentTransform.scale) * (maskCenterY - contentCenterY)) /
106
+ contentTransform.scale;
107
+ const initialSourceBorderRadius = toNumber(
108
+ link.initialSource?.styles.borderRadius,
109
+ sourceBorderRadius,
110
+ );
111
+
112
+ return {
113
+ style: {
114
+ width: maskWidth,
115
+ height: renderedMaskHeight,
116
+ borderRadius: interpolate(
117
+ transitionProgress,
118
+ [0, 1],
119
+ [
120
+ initialSourceBorderRadius,
121
+ active.animating ? expandedBorderRadius : 0,
122
+ ],
123
+ "clamp",
124
+ ),
125
+ borderCurve: "continuous",
126
+ transform: [
127
+ { translateX: compensatedMaskTranslateX },
128
+ { translateY: compensatedMaskTranslateY },
129
+ { scale: 1 / contentTransform.scale },
130
+ ],
131
+ },
132
+ };
133
+ }
@@ -0,0 +1,132 @@
1
+ import type { MeasuredDimensions } from "react-native-reanimated";
2
+ import type {
3
+ BoundsLink,
4
+ BoundsNavigationZoomOptions,
5
+ } from "../../../../types/bounds.types";
6
+ import type { Layout } from "../../../../types/screen.types";
7
+ import type { BoundsAnchor } from "../../types/options";
8
+
9
+ type ZoomContentTarget = Exclude<
10
+ BoundsNavigationZoomOptions["target"],
11
+ undefined
12
+ >;
13
+
14
+ export function getZoomContentTarget({
15
+ explicitTarget,
16
+ screenLayout,
17
+ link,
18
+ }: {
19
+ explicitTarget: BoundsNavigationZoomOptions["target"];
20
+ screenLayout: Layout;
21
+ link: BoundsLink;
22
+ }): ZoomContentTarget {
23
+ "worklet";
24
+
25
+ if (explicitTarget !== undefined) {
26
+ return explicitTarget;
27
+ }
28
+
29
+ const sourceBounds = link.source?.bounds;
30
+ const screenWidth = screenLayout.width;
31
+ const screenHeight = screenLayout.height;
32
+
33
+ if (
34
+ !sourceBounds ||
35
+ sourceBounds.width <= 0 ||
36
+ sourceBounds.height <= 0 ||
37
+ screenWidth <= 0 ||
38
+ screenHeight <= 0
39
+ ) {
40
+ return "fullscreen";
41
+ }
42
+
43
+ const sourceAspectRatio = sourceBounds.width / sourceBounds.height;
44
+ const screenAspectRatio = screenWidth / screenHeight;
45
+
46
+ // Zoom keeps one edge of the virtual destination attached to the source.
47
+ // A wide source fills the destination width and follows its top edge. A
48
+ // narrow source fills the destination height instead, so it follows the
49
+ // destination's leading edge rather than taking a long vertical path.
50
+ if (sourceAspectRatio < screenAspectRatio) {
51
+ return {
52
+ x: 0,
53
+ y: 0,
54
+ pageX: 0,
55
+ pageY: 0,
56
+ width: (sourceBounds.width / sourceBounds.height) * screenHeight,
57
+ height: screenHeight,
58
+ };
59
+ }
60
+
61
+ const height = (sourceBounds.height / sourceBounds.width) * screenWidth;
62
+
63
+ return {
64
+ x: 0,
65
+ y: 0,
66
+ pageX: 0,
67
+ pageY: 0,
68
+ width: screenWidth,
69
+ height,
70
+ };
71
+ }
72
+
73
+ export function getZoomContentAnchor({
74
+ explicitTarget,
75
+ screenLayout,
76
+ link,
77
+ }: {
78
+ explicitTarget: BoundsNavigationZoomOptions["target"];
79
+ screenLayout: Layout;
80
+ link: BoundsLink;
81
+ }): BoundsAnchor {
82
+ "worklet";
83
+
84
+ if (explicitTarget !== undefined) {
85
+ return explicitTarget === "bound" ? "center" : "top";
86
+ }
87
+
88
+ const sourceBounds = link.source?.bounds;
89
+ if (
90
+ !sourceBounds ||
91
+ sourceBounds.width <= 0 ||
92
+ sourceBounds.height <= 0 ||
93
+ screenLayout.width <= 0 ||
94
+ screenLayout.height <= 0
95
+ ) {
96
+ return "top";
97
+ }
98
+
99
+ return sourceBounds.width / sourceBounds.height <
100
+ screenLayout.width / screenLayout.height
101
+ ? "leading"
102
+ : "top";
103
+ }
104
+
105
+ export function resolveZoomTrackingContentTarget({
106
+ contentTarget,
107
+ link,
108
+ screenLayout,
109
+ }: {
110
+ contentTarget: ZoomContentTarget;
111
+ link: BoundsLink;
112
+ screenLayout: Layout;
113
+ }): MeasuredDimensions | undefined {
114
+ "worklet";
115
+
116
+ if (typeof contentTarget === "object") {
117
+ return contentTarget;
118
+ }
119
+
120
+ if (contentTarget === "bound") {
121
+ return link.destination?.bounds;
122
+ }
123
+
124
+ return {
125
+ x: 0,
126
+ y: 0,
127
+ pageX: 0,
128
+ pageY: 0,
129
+ width: screenLayout.width,
130
+ height: screenLayout.height,
131
+ };
132
+ }
@@ -15,6 +15,6 @@ export type ZoomInterpolatedStyle = BoundsNavigationZoomStyle & {
15
15
 
16
16
  export type BuildZoomStylesParams = {
17
17
  tag?: string;
18
- zoomOptions?: BoundsNavigationZoomOptions;
19
18
  props: BoundsInterpolationProps;
19
+ zoomOptions?: BoundsNavigationZoomOptions;
20
20
  };
@@ -1,25 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.resolveDirectionalDragTranslation = void 0;
7
- const resolveDirectionalDragTranslation = ({
8
- translation,
9
- dimension,
10
- negativeMax,
11
- positiveMax,
12
- exponent = 1
13
- }) => {
14
- "worklet";
15
-
16
- const baseDistance = Math.max(1, dimension);
17
- const clampedMagnitude = Math.min(1, Math.abs(translation) / baseDistance);
18
- const curvedMagnitude = clampedMagnitude ** Math.max(1, exponent);
19
- if (translation < 0) {
20
- return -baseDistance * negativeMax * curvedMagnitude;
21
- }
22
- return baseDistance * positiveMax * curvedMagnitude;
23
- };
24
- exports.resolveDirectionalDragTranslation = resolveDirectionalDragTranslation;
25
- //# sourceMappingURL=math.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["resolveDirectionalDragTranslation","translation","dimension","negativeMax","positiveMax","exponent","baseDistance","Math","max","clampedMagnitude","min","abs","curvedMagnitude","exports"],"sourceRoot":"../../../../../../../src","sources":["shared/utils/bounds/navigation/zoom/math.ts"],"mappings":";;;;;;AAAO,MAAMA,iCAAiC,GAAGA,CAAC;EACjDC,WAAW;EACXC,SAAS;EACTC,WAAW;EACXC,WAAW;EACXC,QAAQ,GAAG;AAOZ,CAAC,KAAK;EACL,SAAS;;EAET,MAAMC,YAAY,GAAGC,IAAI,CAACC,GAAG,CAAC,CAAC,EAAEN,SAAS,CAAC;EAC3C,MAAMO,gBAAgB,GAAGF,IAAI,CAACG,GAAG,CAAC,CAAC,EAAEH,IAAI,CAACI,GAAG,CAACV,WAAW,CAAC,GAAGK,YAAY,CAAC;EAC1E,MAAMM,eAAe,GAAGH,gBAAgB,IAAIF,IAAI,CAACC,GAAG,CAAC,CAAC,EAAEH,QAAQ,CAAC;EAEjE,IAAIJ,WAAW,GAAG,CAAC,EAAE;IACpB,OAAO,CAACK,YAAY,GAAGH,WAAW,GAAGS,eAAe;EACrD;EAEA,OAAON,YAAY,GAAGF,WAAW,GAAGQ,eAAe;AACpD,CAAC;AAACC,OAAA,CAAAb,iCAAA,GAAAA,iCAAA","ignoreList":[]}
@@ -1,20 +0,0 @@
1
- "use strict";
2
-
3
- export const resolveDirectionalDragTranslation = ({
4
- translation,
5
- dimension,
6
- negativeMax,
7
- positiveMax,
8
- exponent = 1
9
- }) => {
10
- "worklet";
11
-
12
- const baseDistance = Math.max(1, dimension);
13
- const clampedMagnitude = Math.min(1, Math.abs(translation) / baseDistance);
14
- const curvedMagnitude = clampedMagnitude ** Math.max(1, exponent);
15
- if (translation < 0) {
16
- return -baseDistance * negativeMax * curvedMagnitude;
17
- }
18
- return baseDistance * positiveMax * curvedMagnitude;
19
- };
20
- //# sourceMappingURL=math.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["resolveDirectionalDragTranslation","translation","dimension","negativeMax","positiveMax","exponent","baseDistance","Math","max","clampedMagnitude","min","abs","curvedMagnitude"],"sourceRoot":"../../../../../../../src","sources":["shared/utils/bounds/navigation/zoom/math.ts"],"mappings":";;AAAA,OAAO,MAAMA,iCAAiC,GAAGA,CAAC;EACjDC,WAAW;EACXC,SAAS;EACTC,WAAW;EACXC,WAAW;EACXC,QAAQ,GAAG;AAOZ,CAAC,KAAK;EACL,SAAS;;EAET,MAAMC,YAAY,GAAGC,IAAI,CAACC,GAAG,CAAC,CAAC,EAAEN,SAAS,CAAC;EAC3C,MAAMO,gBAAgB,GAAGF,IAAI,CAACG,GAAG,CAAC,CAAC,EAAEH,IAAI,CAACI,GAAG,CAACV,WAAW,CAAC,GAAGK,YAAY,CAAC;EAC1E,MAAMM,eAAe,GAAGH,gBAAgB,IAAIF,IAAI,CAACC,GAAG,CAAC,CAAC,EAAEH,QAAQ,CAAC;EAEjE,IAAIJ,WAAW,GAAG,CAAC,EAAE;IACpB,OAAO,CAACK,YAAY,GAAGH,WAAW,GAAGS,eAAe;EACrD;EAEA,OAAON,YAAY,GAAGF,WAAW,GAAGQ,eAAe;AACpD,CAAC","ignoreList":[]}
@@ -1,8 +0,0 @@
1
- export declare const resolveDirectionalDragTranslation: ({ translation, dimension, negativeMax, positiveMax, exponent, }: {
2
- translation: number;
3
- dimension: number;
4
- negativeMax: number;
5
- positiveMax: number;
6
- exponent?: number;
7
- }) => number;
8
- //# sourceMappingURL=math.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"math.d.ts","sourceRoot":"","sources":["../../../../../../../src/shared/utils/bounds/navigation/zoom/math.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iCAAiC,GAAI,iEAM/C;IACF,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB,WAYA,CAAC"}
@@ -1,25 +0,0 @@
1
- export const resolveDirectionalDragTranslation = ({
2
- translation,
3
- dimension,
4
- negativeMax,
5
- positiveMax,
6
- exponent = 1,
7
- }: {
8
- translation: number;
9
- dimension: number;
10
- negativeMax: number;
11
- positiveMax: number;
12
- exponent?: number;
13
- }) => {
14
- "worklet";
15
-
16
- const baseDistance = Math.max(1, dimension);
17
- const clampedMagnitude = Math.min(1, Math.abs(translation) / baseDistance);
18
- const curvedMagnitude = clampedMagnitude ** Math.max(1, exponent);
19
-
20
- if (translation < 0) {
21
- return -baseDistance * negativeMax * curvedMagnitude;
22
- }
23
-
24
- return baseDistance * positiveMax * curvedMagnitude;
25
- };