react-native-screen-transitions 3.6.0-alpha.1 → 3.6.0-alpha.2

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 (433) hide show
  1. package/lib/commonjs/component-stack/components/component-screen.js +1 -7
  2. package/lib/commonjs/component-stack/components/component-screen.js.map +1 -1
  3. package/lib/commonjs/shared/components/create-boundary-component/create-boundary-component.js +27 -34
  4. package/lib/commonjs/shared/components/create-boundary-component/create-boundary-component.js.map +1 -1
  5. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-boundary-presence.js +4 -4
  6. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-boundary-presence.js.map +1 -1
  7. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-initial-destination-measurement.js +17 -19
  8. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-initial-destination-measurement.js.map +1 -1
  9. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-initial-source-measurement.js +27 -7
  10. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-initial-source-measurement.js.map +1 -1
  11. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-measurer.js +23 -51
  12. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-measurer.js.map +1 -1
  13. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-refresh-boundary.js +33 -40
  14. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-refresh-boundary.js.map +1 -1
  15. package/lib/commonjs/shared/components/create-boundary-component/index.js +3 -1
  16. package/lib/commonjs/shared/components/create-boundary-component/index.js.map +1 -1
  17. package/lib/commonjs/shared/components/create-boundary-component/utils/destination-signals.js +75 -0
  18. package/lib/commonjs/shared/components/create-boundary-component/utils/destination-signals.js.map +1 -0
  19. package/lib/commonjs/shared/components/create-boundary-component/{hooks/helpers/scroll-measurement.js → utils/measured-bounds.js} +15 -2
  20. package/lib/commonjs/shared/components/create-boundary-component/utils/measured-bounds.js.map +1 -0
  21. package/lib/commonjs/shared/components/create-boundary-component/utils/refresh-signals.js +103 -0
  22. package/lib/commonjs/shared/components/create-boundary-component/utils/refresh-signals.js.map +1 -0
  23. package/lib/commonjs/shared/components/create-boundary-component/utils/source-signals.js +52 -0
  24. package/lib/commonjs/shared/components/create-boundary-component/utils/source-signals.js.map +1 -0
  25. package/lib/commonjs/shared/components/native-screen.js +2 -13
  26. package/lib/commonjs/shared/components/native-screen.js.map +1 -1
  27. package/lib/commonjs/shared/constants.js +2 -7
  28. package/lib/commonjs/shared/constants.js.map +1 -1
  29. package/lib/commonjs/shared/providers/helpers/measured-bounds-writes.js +35 -0
  30. package/lib/commonjs/shared/providers/helpers/measured-bounds-writes.js.map +1 -0
  31. package/lib/commonjs/shared/providers/register-bounds.provider.js +48 -55
  32. package/lib/commonjs/shared/providers/register-bounds.provider.js.map +1 -1
  33. package/lib/commonjs/shared/providers/screen/animation/helpers/accessors/use-build-transition-accessor.js +1 -10
  34. package/lib/commonjs/shared/providers/screen/animation/helpers/accessors/use-build-transition-accessor.js.map +1 -1
  35. package/lib/commonjs/shared/providers/screen/animation/helpers/hydrate-transition-state/index.js +1 -6
  36. package/lib/commonjs/shared/providers/screen/animation/helpers/hydrate-transition-state/index.js.map +1 -1
  37. package/lib/commonjs/shared/providers/screen/animation/helpers/pipeline.js.map +1 -1
  38. package/lib/commonjs/shared/providers/screen/gestures/pan/pan-activation.js +2 -2
  39. package/lib/commonjs/shared/providers/screen/gestures/pan/pan-activation.js.map +1 -1
  40. package/lib/commonjs/shared/providers/screen/gestures/pan/pan-lifecycle.js +9 -2
  41. package/lib/commonjs/shared/providers/screen/gestures/pan/pan-lifecycle.js.map +1 -1
  42. package/lib/commonjs/shared/providers/screen/gestures/pan/pan-release.js +19 -0
  43. package/lib/commonjs/shared/providers/screen/gestures/pan/pan-release.js.map +1 -1
  44. package/lib/commonjs/shared/providers/screen/gestures/pan/pan-reset.js +2 -0
  45. package/lib/commonjs/shared/providers/screen/gestures/pan/pan-reset.js.map +1 -1
  46. package/lib/commonjs/shared/providers/screen/gestures/pan/use-pan-behavior.js +2 -2
  47. package/lib/commonjs/shared/providers/screen/gestures/pan/use-pan-behavior.js.map +1 -1
  48. package/lib/commonjs/shared/providers/screen/gestures/pinch/pinch-activation.js +2 -2
  49. package/lib/commonjs/shared/providers/screen/gestures/pinch/pinch-activation.js.map +1 -1
  50. package/lib/commonjs/shared/providers/screen/gestures/pinch/pinch-lifecycle.js +1 -0
  51. package/lib/commonjs/shared/providers/screen/gestures/pinch/pinch-lifecycle.js.map +1 -1
  52. package/lib/commonjs/shared/providers/screen/gestures/pinch/use-pinch-behavior.js +2 -2
  53. package/lib/commonjs/shared/providers/screen/gestures/pinch/use-pinch-behavior.js.map +1 -1
  54. package/lib/commonjs/shared/providers/screen/gestures/shared/physics.js +18 -2
  55. package/lib/commonjs/shared/providers/screen/gestures/shared/physics.js.map +1 -1
  56. package/lib/commonjs/shared/providers/screen/gestures/shared/policy.js +1 -5
  57. package/lib/commonjs/shared/providers/screen/gestures/shared/policy.js.map +1 -1
  58. package/lib/commonjs/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js +1 -4
  59. package/lib/commonjs/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js.map +1 -1
  60. package/lib/commonjs/shared/stores/bounds/helpers/link-pairs.helpers.js +125 -0
  61. package/lib/commonjs/shared/stores/bounds/helpers/link-pairs.helpers.js.map +1 -0
  62. package/lib/commonjs/shared/stores/bounds/index.js +6 -12
  63. package/lib/commonjs/shared/stores/bounds/index.js.map +1 -1
  64. package/lib/commonjs/shared/stores/bounds/internals/clear.js +13 -21
  65. package/lib/commonjs/shared/stores/bounds/internals/clear.js.map +1 -1
  66. package/lib/commonjs/shared/stores/bounds/internals/entries.js +49 -9
  67. package/lib/commonjs/shared/stores/bounds/internals/entries.js.map +1 -1
  68. package/lib/commonjs/shared/stores/bounds/internals/links.js +143 -82
  69. package/lib/commonjs/shared/stores/bounds/internals/links.js.map +1 -1
  70. package/lib/commonjs/shared/stores/bounds/internals/resolver.js +17 -43
  71. package/lib/commonjs/shared/stores/bounds/internals/resolver.js.map +1 -1
  72. package/lib/commonjs/shared/stores/bounds/internals/state.js +26 -3
  73. package/lib/commonjs/shared/stores/bounds/internals/state.js.map +1 -1
  74. package/lib/commonjs/shared/stores/gesture.store.js +2 -0
  75. package/lib/commonjs/shared/stores/gesture.store.js.map +1 -1
  76. package/lib/commonjs/shared/types/gesture.types.js +2 -2
  77. package/lib/commonjs/shared/types/gesture.types.js.map +1 -1
  78. package/lib/commonjs/shared/utils/bounds/helpers/create-bounds-accessor-core.js +2 -1
  79. package/lib/commonjs/shared/utils/bounds/helpers/create-bounds-accessor-core.js.map +1 -1
  80. package/lib/commonjs/shared/utils/bounds/helpers/create-link-accessor.js +6 -5
  81. package/lib/commonjs/shared/utils/bounds/helpers/create-link-accessor.js.map +1 -1
  82. package/lib/commonjs/shared/utils/bounds/helpers/prepare-bound-styles.js +21 -8
  83. package/lib/commonjs/shared/utils/bounds/helpers/prepare-bound-styles.js.map +1 -1
  84. package/lib/commonjs/shared/utils/bounds/helpers/resolve-bounds-pair-key.js +23 -0
  85. package/lib/commonjs/shared/utils/bounds/helpers/resolve-bounds-pair-key.js.map +1 -0
  86. package/lib/commonjs/shared/utils/bounds/navigation/reveal/build.js +91 -199
  87. package/lib/commonjs/shared/utils/bounds/navigation/reveal/build.js.map +1 -1
  88. package/lib/commonjs/shared/utils/bounds/navigation/reveal/config.js +15 -2
  89. package/lib/commonjs/shared/utils/bounds/navigation/reveal/config.js.map +1 -1
  90. package/lib/commonjs/shared/utils/bounds/navigation/reveal/math.js +155 -14
  91. package/lib/commonjs/shared/utils/bounds/navigation/reveal/math.js.map +1 -1
  92. package/lib/commonjs/shared/utils/navigation/resolve-scene-neighbors.js +20 -19
  93. package/lib/commonjs/shared/utils/navigation/resolve-scene-neighbors.js.map +1 -1
  94. package/lib/module/component-stack/components/component-screen.js +2 -8
  95. package/lib/module/component-stack/components/component-screen.js.map +1 -1
  96. package/lib/module/shared/components/create-boundary-component/create-boundary-component.js +27 -34
  97. package/lib/module/shared/components/create-boundary-component/create-boundary-component.js.map +1 -1
  98. package/lib/module/shared/components/create-boundary-component/hooks/use-boundary-presence.js +4 -4
  99. package/lib/module/shared/components/create-boundary-component/hooks/use-boundary-presence.js.map +1 -1
  100. package/lib/module/shared/components/create-boundary-component/hooks/use-initial-destination-measurement.js +18 -20
  101. package/lib/module/shared/components/create-boundary-component/hooks/use-initial-destination-measurement.js.map +1 -1
  102. package/lib/module/shared/components/create-boundary-component/hooks/use-initial-source-measurement.js +28 -8
  103. package/lib/module/shared/components/create-boundary-component/hooks/use-initial-source-measurement.js.map +1 -1
  104. package/lib/module/shared/components/create-boundary-component/hooks/use-measurer.js +22 -50
  105. package/lib/module/shared/components/create-boundary-component/hooks/use-measurer.js.map +1 -1
  106. package/lib/module/shared/components/create-boundary-component/hooks/use-refresh-boundary.js +33 -40
  107. package/lib/module/shared/components/create-boundary-component/hooks/use-refresh-boundary.js.map +1 -1
  108. package/lib/module/shared/components/create-boundary-component/index.js +3 -1
  109. package/lib/module/shared/components/create-boundary-component/index.js.map +1 -1
  110. package/lib/module/shared/components/create-boundary-component/utils/destination-signals.js +70 -0
  111. package/lib/module/shared/components/create-boundary-component/utils/destination-signals.js.map +1 -0
  112. package/lib/module/shared/components/create-boundary-component/{hooks/helpers/scroll-measurement.js → utils/measured-bounds.js} +13 -1
  113. package/lib/module/shared/components/create-boundary-component/utils/measured-bounds.js.map +1 -0
  114. package/lib/module/shared/components/create-boundary-component/utils/refresh-signals.js +98 -0
  115. package/lib/module/shared/components/create-boundary-component/utils/refresh-signals.js.map +1 -0
  116. package/lib/module/shared/components/create-boundary-component/utils/source-signals.js +47 -0
  117. package/lib/module/shared/components/create-boundary-component/utils/source-signals.js.map +1 -0
  118. package/lib/module/shared/components/native-screen.js +3 -14
  119. package/lib/module/shared/components/native-screen.js.map +1 -1
  120. package/lib/module/shared/constants.js +1 -6
  121. package/lib/module/shared/constants.js.map +1 -1
  122. package/lib/module/shared/providers/helpers/measured-bounds-writes.js +30 -0
  123. package/lib/module/shared/providers/helpers/measured-bounds-writes.js.map +1 -0
  124. package/lib/module/shared/providers/register-bounds.provider.js +48 -55
  125. package/lib/module/shared/providers/register-bounds.provider.js.map +1 -1
  126. package/lib/module/shared/providers/screen/animation/helpers/accessors/use-build-transition-accessor.js +1 -10
  127. package/lib/module/shared/providers/screen/animation/helpers/accessors/use-build-transition-accessor.js.map +1 -1
  128. package/lib/module/shared/providers/screen/animation/helpers/hydrate-transition-state/index.js +1 -1
  129. package/lib/module/shared/providers/screen/animation/helpers/hydrate-transition-state/index.js.map +1 -1
  130. package/lib/module/shared/providers/screen/animation/helpers/pipeline.js.map +1 -1
  131. package/lib/module/shared/providers/screen/gestures/pan/pan-activation.js +2 -2
  132. package/lib/module/shared/providers/screen/gestures/pan/pan-activation.js.map +1 -1
  133. package/lib/module/shared/providers/screen/gestures/pan/pan-lifecycle.js +10 -3
  134. package/lib/module/shared/providers/screen/gestures/pan/pan-lifecycle.js.map +1 -1
  135. package/lib/module/shared/providers/screen/gestures/pan/pan-release.js +20 -1
  136. package/lib/module/shared/providers/screen/gestures/pan/pan-release.js.map +1 -1
  137. package/lib/module/shared/providers/screen/gestures/pan/pan-reset.js +2 -0
  138. package/lib/module/shared/providers/screen/gestures/pan/pan-reset.js.map +1 -1
  139. package/lib/module/shared/providers/screen/gestures/pan/use-pan-behavior.js +3 -3
  140. package/lib/module/shared/providers/screen/gestures/pan/use-pan-behavior.js.map +1 -1
  141. package/lib/module/shared/providers/screen/gestures/pinch/pinch-activation.js +3 -3
  142. package/lib/module/shared/providers/screen/gestures/pinch/pinch-activation.js.map +1 -1
  143. package/lib/module/shared/providers/screen/gestures/pinch/pinch-lifecycle.js +1 -0
  144. package/lib/module/shared/providers/screen/gestures/pinch/pinch-lifecycle.js.map +1 -1
  145. package/lib/module/shared/providers/screen/gestures/pinch/use-pinch-behavior.js +3 -3
  146. package/lib/module/shared/providers/screen/gestures/pinch/use-pinch-behavior.js.map +1 -1
  147. package/lib/module/shared/providers/screen/gestures/shared/physics.js +15 -0
  148. package/lib/module/shared/providers/screen/gestures/shared/physics.js.map +1 -1
  149. package/lib/module/shared/providers/screen/gestures/shared/policy.js +3 -3
  150. package/lib/module/shared/providers/screen/gestures/shared/policy.js.map +1 -1
  151. package/lib/module/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js +1 -4
  152. package/lib/module/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js.map +1 -1
  153. package/lib/module/shared/stores/bounds/helpers/link-pairs.helpers.js +105 -0
  154. package/lib/module/shared/stores/bounds/helpers/link-pairs.helpers.js.map +1 -0
  155. package/lib/module/shared/stores/bounds/index.js +7 -13
  156. package/lib/module/shared/stores/bounds/index.js.map +1 -1
  157. package/lib/module/shared/stores/bounds/internals/clear.js +14 -22
  158. package/lib/module/shared/stores/bounds/internals/clear.js.map +1 -1
  159. package/lib/module/shared/stores/bounds/internals/entries.js +49 -9
  160. package/lib/module/shared/stores/bounds/internals/entries.js.map +1 -1
  161. package/lib/module/shared/stores/bounds/internals/links.js +139 -80
  162. package/lib/module/shared/stores/bounds/internals/links.js.map +1 -1
  163. package/lib/module/shared/stores/bounds/internals/resolver.js +17 -43
  164. package/lib/module/shared/stores/bounds/internals/resolver.js.map +1 -1
  165. package/lib/module/shared/stores/bounds/internals/state.js +25 -2
  166. package/lib/module/shared/stores/bounds/internals/state.js.map +1 -1
  167. package/lib/module/shared/stores/gesture.store.js +2 -0
  168. package/lib/module/shared/stores/gesture.store.js.map +1 -1
  169. package/lib/module/shared/types/animation.types.js +0 -4
  170. package/lib/module/shared/types/animation.types.js.map +1 -1
  171. package/lib/module/shared/types/gesture.types.js +0 -1
  172. package/lib/module/shared/types/gesture.types.js.map +1 -1
  173. package/lib/module/shared/utils/bounds/helpers/create-bounds-accessor-core.js +2 -1
  174. package/lib/module/shared/utils/bounds/helpers/create-bounds-accessor-core.js.map +1 -1
  175. package/lib/module/shared/utils/bounds/helpers/create-link-accessor.js +6 -5
  176. package/lib/module/shared/utils/bounds/helpers/create-link-accessor.js.map +1 -1
  177. package/lib/module/shared/utils/bounds/helpers/prepare-bound-styles.js +21 -8
  178. package/lib/module/shared/utils/bounds/helpers/prepare-bound-styles.js.map +1 -1
  179. package/lib/module/shared/utils/bounds/helpers/resolve-bounds-pair-key.js +18 -0
  180. package/lib/module/shared/utils/bounds/helpers/resolve-bounds-pair-key.js.map +1 -0
  181. package/lib/module/shared/utils/bounds/navigation/reveal/build.js +90 -198
  182. package/lib/module/shared/utils/bounds/navigation/reveal/build.js.map +1 -1
  183. package/lib/module/shared/utils/bounds/navigation/reveal/config.js +14 -1
  184. package/lib/module/shared/utils/bounds/navigation/reveal/config.js.map +1 -1
  185. package/lib/module/shared/utils/bounds/navigation/reveal/math.js +144 -12
  186. package/lib/module/shared/utils/bounds/navigation/reveal/math.js.map +1 -1
  187. package/lib/module/shared/utils/navigation/resolve-scene-neighbors.js +20 -19
  188. package/lib/module/shared/utils/navigation/resolve-scene-neighbors.js.map +1 -1
  189. package/lib/typescript/component-stack/components/component-screen.d.ts.map +1 -1
  190. package/lib/typescript/shared/components/create-boundary-component/create-boundary-component.d.ts +1 -0
  191. package/lib/typescript/shared/components/create-boundary-component/create-boundary-component.d.ts.map +1 -1
  192. package/lib/typescript/shared/components/create-boundary-component/hooks/use-boundary-presence.d.ts +1 -1
  193. package/lib/typescript/shared/components/create-boundary-component/hooks/use-boundary-presence.d.ts.map +1 -1
  194. package/lib/typescript/shared/components/create-boundary-component/hooks/use-initial-destination-measurement.d.ts +5 -4
  195. package/lib/typescript/shared/components/create-boundary-component/hooks/use-initial-destination-measurement.d.ts.map +1 -1
  196. package/lib/typescript/shared/components/create-boundary-component/hooks/use-initial-source-measurement.d.ts +6 -2
  197. package/lib/typescript/shared/components/create-boundary-component/hooks/use-initial-source-measurement.d.ts.map +1 -1
  198. package/lib/typescript/shared/components/create-boundary-component/hooks/use-measurer.d.ts +5 -4
  199. package/lib/typescript/shared/components/create-boundary-component/hooks/use-measurer.d.ts.map +1 -1
  200. package/lib/typescript/shared/components/create-boundary-component/hooks/use-refresh-boundary.d.ts +7 -7
  201. package/lib/typescript/shared/components/create-boundary-component/hooks/use-refresh-boundary.d.ts.map +1 -1
  202. package/lib/typescript/shared/components/create-boundary-component/index.d.ts.map +1 -1
  203. package/lib/typescript/shared/components/create-boundary-component/types.d.ts +11 -7
  204. package/lib/typescript/shared/components/create-boundary-component/types.d.ts.map +1 -1
  205. package/lib/typescript/shared/components/create-boundary-component/utils/destination-signals.d.ts +10 -0
  206. package/lib/typescript/shared/components/create-boundary-component/utils/destination-signals.d.ts.map +1 -0
  207. package/lib/typescript/shared/components/create-boundary-component/{hooks/helpers/scroll-measurement.d.ts → utils/measured-bounds.d.ts} +3 -2
  208. package/lib/typescript/shared/components/create-boundary-component/utils/measured-bounds.d.ts.map +1 -0
  209. package/lib/typescript/shared/components/create-boundary-component/utils/refresh-signals.d.ts +22 -0
  210. package/lib/typescript/shared/components/create-boundary-component/utils/refresh-signals.d.ts.map +1 -0
  211. package/lib/typescript/shared/components/create-boundary-component/utils/source-signals.d.ts +16 -0
  212. package/lib/typescript/shared/components/create-boundary-component/utils/source-signals.d.ts.map +1 -0
  213. package/lib/typescript/shared/components/native-screen.d.ts.map +1 -1
  214. package/lib/typescript/shared/constants.d.ts +0 -5
  215. package/lib/typescript/shared/constants.d.ts.map +1 -1
  216. package/lib/typescript/shared/index.d.ts +1 -1
  217. package/lib/typescript/shared/index.d.ts.map +1 -1
  218. package/lib/typescript/shared/providers/helpers/measured-bounds-writes.d.ts +21 -0
  219. package/lib/typescript/shared/providers/helpers/measured-bounds-writes.d.ts.map +1 -0
  220. package/lib/typescript/shared/providers/register-bounds.provider.d.ts.map +1 -1
  221. package/lib/typescript/shared/providers/screen/animation/helpers/accessors/use-build-transition-accessor.d.ts.map +1 -1
  222. package/lib/typescript/shared/providers/screen/animation/helpers/hydrate-transition-state/index.d.ts +0 -1
  223. package/lib/typescript/shared/providers/screen/animation/helpers/hydrate-transition-state/index.d.ts.map +1 -1
  224. package/lib/typescript/shared/providers/screen/animation/helpers/pipeline.d.ts +1 -1
  225. package/lib/typescript/shared/providers/screen/animation/helpers/pipeline.d.ts.map +1 -1
  226. package/lib/typescript/shared/providers/screen/gestures/pan/pan-activation.d.ts.map +1 -1
  227. package/lib/typescript/shared/providers/screen/gestures/pan/pan-lifecycle.d.ts.map +1 -1
  228. package/lib/typescript/shared/providers/screen/gestures/pan/pan-release.d.ts.map +1 -1
  229. package/lib/typescript/shared/providers/screen/gestures/pan/pan-reset.d.ts +2 -1
  230. package/lib/typescript/shared/providers/screen/gestures/pan/pan-reset.d.ts.map +1 -1
  231. package/lib/typescript/shared/providers/screen/gestures/pan/use-pan-behavior.d.ts.map +1 -1
  232. package/lib/typescript/shared/providers/screen/gestures/pinch/pinch-activation.d.ts.map +1 -1
  233. package/lib/typescript/shared/providers/screen/gestures/pinch/pinch-lifecycle.d.ts.map +1 -1
  234. package/lib/typescript/shared/providers/screen/gestures/pinch/use-pinch-behavior.d.ts.map +1 -1
  235. package/lib/typescript/shared/providers/screen/gestures/shared/physics.d.ts +7 -0
  236. package/lib/typescript/shared/providers/screen/gestures/shared/physics.d.ts.map +1 -1
  237. package/lib/typescript/shared/providers/screen/gestures/shared/policy.d.ts +0 -10
  238. package/lib/typescript/shared/providers/screen/gestures/shared/policy.d.ts.map +1 -1
  239. package/lib/typescript/shared/providers/screen/gestures/types.d.ts +2 -0
  240. package/lib/typescript/shared/providers/screen/gestures/types.d.ts.map +1 -1
  241. package/lib/typescript/shared/providers/screen/styles/hooks/use-interpolated-style-maps.d.ts.map +1 -1
  242. package/lib/typescript/shared/stores/bounds/helpers/link-pairs.helpers.d.ts +18 -0
  243. package/lib/typescript/shared/stores/bounds/helpers/link-pairs.helpers.d.ts.map +1 -0
  244. package/lib/typescript/shared/stores/bounds/index.d.ts +6 -12
  245. package/lib/typescript/shared/stores/bounds/index.d.ts.map +1 -1
  246. package/lib/typescript/shared/stores/bounds/internals/clear.d.ts.map +1 -1
  247. package/lib/typescript/shared/stores/bounds/internals/entries.d.ts.map +1 -1
  248. package/lib/typescript/shared/stores/bounds/internals/links.d.ts +13 -10
  249. package/lib/typescript/shared/stores/bounds/internals/links.d.ts.map +1 -1
  250. package/lib/typescript/shared/stores/bounds/internals/resolver.d.ts.map +1 -1
  251. package/lib/typescript/shared/stores/bounds/internals/state.d.ts +26 -5
  252. package/lib/typescript/shared/stores/bounds/internals/state.d.ts.map +1 -1
  253. package/lib/typescript/shared/stores/bounds/types.d.ts +14 -7
  254. package/lib/typescript/shared/stores/bounds/types.d.ts.map +1 -1
  255. package/lib/typescript/shared/stores/gesture.store.d.ts +1 -0
  256. package/lib/typescript/shared/stores/gesture.store.d.ts.map +1 -1
  257. package/lib/typescript/shared/types/animation.types.d.ts +0 -18
  258. package/lib/typescript/shared/types/animation.types.d.ts.map +1 -1
  259. package/lib/typescript/shared/types/gesture.types.d.ts +8 -1
  260. package/lib/typescript/shared/types/gesture.types.d.ts.map +1 -1
  261. package/lib/typescript/shared/types/index.d.ts +1 -1
  262. package/lib/typescript/shared/types/index.d.ts.map +1 -1
  263. package/lib/typescript/shared/utils/bounds/helpers/create-bounds-accessor-core.d.ts.map +1 -1
  264. package/lib/typescript/shared/utils/bounds/helpers/create-link-accessor.d.ts.map +1 -1
  265. package/lib/typescript/shared/utils/bounds/helpers/prepare-bound-styles.d.ts +1 -1
  266. package/lib/typescript/shared/utils/bounds/helpers/prepare-bound-styles.d.ts.map +1 -1
  267. package/lib/typescript/shared/utils/bounds/helpers/resolve-bounds-pair-key.d.ts +4 -0
  268. package/lib/typescript/shared/utils/bounds/helpers/resolve-bounds-pair-key.d.ts.map +1 -0
  269. package/lib/typescript/shared/utils/bounds/navigation/reveal/build.d.ts.map +1 -1
  270. package/lib/typescript/shared/utils/bounds/navigation/reveal/config.d.ts +14 -1
  271. package/lib/typescript/shared/utils/bounds/navigation/reveal/config.d.ts.map +1 -1
  272. package/lib/typescript/shared/utils/bounds/navigation/reveal/math.d.ts +48 -7
  273. package/lib/typescript/shared/utils/bounds/navigation/reveal/math.d.ts.map +1 -1
  274. package/lib/typescript/shared/utils/bounds/types/options.d.ts +2 -3
  275. package/lib/typescript/shared/utils/bounds/types/options.d.ts.map +1 -1
  276. package/lib/typescript/shared/utils/navigation/resolve-scene-neighbors.d.ts +3 -2
  277. package/lib/typescript/shared/utils/navigation/resolve-scene-neighbors.d.ts.map +1 -1
  278. package/package.json +1 -1
  279. package/src/component-stack/components/component-screen.tsx +3 -11
  280. package/src/shared/components/create-boundary-component/create-boundary-component.tsx +30 -27
  281. package/src/shared/components/create-boundary-component/hooks/use-boundary-presence.ts +5 -5
  282. package/src/shared/components/create-boundary-component/hooks/use-initial-destination-measurement.ts +25 -24
  283. package/src/shared/components/create-boundary-component/hooks/use-initial-source-measurement.ts +41 -11
  284. package/src/shared/components/create-boundary-component/hooks/use-measurer.ts +49 -64
  285. package/src/shared/components/create-boundary-component/hooks/use-refresh-boundary.ts +44 -83
  286. package/src/shared/components/create-boundary-component/index.tsx +3 -1
  287. package/src/shared/components/create-boundary-component/types.ts +13 -11
  288. package/src/shared/components/create-boundary-component/utils/destination-signals.ts +129 -0
  289. package/src/shared/components/create-boundary-component/{hooks/helpers/scroll-measurement.ts → utils/measured-bounds.ts} +25 -1
  290. package/src/shared/components/create-boundary-component/utils/refresh-signals.ts +164 -0
  291. package/src/shared/components/create-boundary-component/utils/source-signals.ts +72 -0
  292. package/src/shared/components/native-screen.tsx +3 -12
  293. package/src/shared/constants.ts +1 -6
  294. package/src/shared/index.ts +0 -3
  295. package/src/shared/providers/helpers/measured-bounds-writes.ts +67 -0
  296. package/src/shared/providers/register-bounds.provider.tsx +68 -91
  297. package/src/shared/providers/screen/animation/helpers/accessors/use-build-transition-accessor.ts +0 -14
  298. package/src/shared/providers/screen/animation/helpers/hydrate-transition-state/index.ts +1 -2
  299. package/src/shared/providers/screen/animation/helpers/pipeline.ts +1 -4
  300. package/src/shared/providers/screen/gestures/pan/pan-activation.ts +4 -1
  301. package/src/shared/providers/screen/gestures/pan/pan-lifecycle.ts +18 -2
  302. package/src/shared/providers/screen/gestures/pan/pan-release.ts +33 -0
  303. package/src/shared/providers/screen/gestures/pan/pan-reset.ts +3 -0
  304. package/src/shared/providers/screen/gestures/pan/use-pan-behavior.ts +9 -6
  305. package/src/shared/providers/screen/gestures/pinch/pinch-activation.ts +5 -2
  306. package/src/shared/providers/screen/gestures/pinch/pinch-lifecycle.ts +1 -0
  307. package/src/shared/providers/screen/gestures/pinch/use-pinch-behavior.ts +9 -6
  308. package/src/shared/providers/screen/gestures/shared/physics.ts +25 -0
  309. package/src/shared/providers/screen/gestures/shared/policy.ts +3 -5
  310. package/src/shared/providers/screen/gestures/types.ts +2 -0
  311. package/src/shared/providers/screen/styles/hooks/use-interpolated-style-maps.tsx +0 -3
  312. package/src/shared/stores/bounds/helpers/link-pairs.helpers.ts +161 -0
  313. package/src/shared/stores/bounds/index.ts +10 -20
  314. package/src/shared/stores/bounds/internals/clear.ts +17 -41
  315. package/src/shared/stores/bounds/internals/entries.ts +56 -13
  316. package/src/shared/stores/bounds/internals/links.ts +222 -113
  317. package/src/shared/stores/bounds/internals/resolver.ts +23 -87
  318. package/src/shared/stores/bounds/internals/state.ts +27 -5
  319. package/src/shared/stores/bounds/types.ts +17 -7
  320. package/src/shared/stores/gesture.store.ts +3 -0
  321. package/src/shared/types/animation.types.ts +0 -23
  322. package/src/shared/types/gesture.types.ts +8 -2
  323. package/src/shared/types/index.ts +0 -4
  324. package/src/shared/utils/bounds/helpers/create-bounds-accessor-core.ts +1 -0
  325. package/src/shared/utils/bounds/helpers/create-link-accessor.ts +6 -6
  326. package/src/shared/utils/bounds/helpers/prepare-bound-styles.ts +20 -11
  327. package/src/shared/utils/bounds/helpers/resolve-bounds-pair-key.ts +22 -0
  328. package/src/shared/utils/bounds/navigation/reveal/build.ts +153 -297
  329. package/src/shared/utils/bounds/navigation/reveal/config.ts +20 -1
  330. package/src/shared/utils/bounds/navigation/reveal/math.ts +234 -18
  331. package/src/shared/utils/bounds/types/options.ts +2 -3
  332. package/src/shared/utils/navigation/resolve-scene-neighbors.ts +36 -23
  333. package/lib/commonjs/shared/components/create-boundary-component/helpers/apply-measured-bounds-writes.js +0 -43
  334. package/lib/commonjs/shared/components/create-boundary-component/helpers/apply-measured-bounds-writes.js.map +0 -1
  335. package/lib/commonjs/shared/components/create-boundary-component/helpers/resolve-pending-source-key.js +0 -17
  336. package/lib/commonjs/shared/components/create-boundary-component/helpers/resolve-pending-source-key.js.map +0 -1
  337. package/lib/commonjs/shared/components/create-boundary-component/hooks/helpers/boundary-link-context.js +0 -28
  338. package/lib/commonjs/shared/components/create-boundary-component/hooks/helpers/boundary-link-context.js.map +0 -1
  339. package/lib/commonjs/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js +0 -75
  340. package/lib/commonjs/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js.map +0 -1
  341. package/lib/commonjs/shared/components/create-boundary-component/hooks/helpers/measurement.js +0 -20
  342. package/lib/commonjs/shared/components/create-boundary-component/hooks/helpers/measurement.js.map +0 -1
  343. package/lib/commonjs/shared/components/create-boundary-component/hooks/helpers/scroll-measurement.js.map +0 -1
  344. package/lib/commonjs/shared/components/create-boundary-component/utils/build-boundary-match-key.js +0 -16
  345. package/lib/commonjs/shared/components/create-boundary-component/utils/build-boundary-match-key.js.map +0 -1
  346. package/lib/commonjs/shared/providers/layout-anchor.provider.js +0 -86
  347. package/lib/commonjs/shared/providers/layout-anchor.provider.js.map +0 -1
  348. package/lib/commonjs/shared/stores/bounds/helpers/entries.helpers.js +0 -49
  349. package/lib/commonjs/shared/stores/bounds/helpers/entries.helpers.js.map +0 -1
  350. package/lib/commonjs/shared/stores/bounds/helpers/find-latest.js +0 -25
  351. package/lib/commonjs/shared/stores/bounds/helpers/find-latest.js.map +0 -1
  352. package/lib/commonjs/shared/stores/bounds/helpers/groups.helpers.js +0 -30
  353. package/lib/commonjs/shared/stores/bounds/helpers/groups.helpers.js.map +0 -1
  354. package/lib/commonjs/shared/stores/bounds/helpers/link.helpers.js +0 -79
  355. package/lib/commonjs/shared/stores/bounds/helpers/link.helpers.js.map +0 -1
  356. package/lib/commonjs/shared/stores/bounds/helpers/matching.js +0 -13
  357. package/lib/commonjs/shared/stores/bounds/helpers/matching.js.map +0 -1
  358. package/lib/commonjs/shared/stores/bounds/helpers/tag-state.helpers.js +0 -30
  359. package/lib/commonjs/shared/stores/bounds/helpers/tag-state.helpers.js.map +0 -1
  360. package/lib/commonjs/shared/stores/bounds/internals/groups.js +0 -102
  361. package/lib/commonjs/shared/stores/bounds/internals/groups.js.map +0 -1
  362. package/lib/module/shared/components/create-boundary-component/helpers/apply-measured-bounds-writes.js +0 -38
  363. package/lib/module/shared/components/create-boundary-component/helpers/apply-measured-bounds-writes.js.map +0 -1
  364. package/lib/module/shared/components/create-boundary-component/helpers/resolve-pending-source-key.js +0 -12
  365. package/lib/module/shared/components/create-boundary-component/helpers/resolve-pending-source-key.js.map +0 -1
  366. package/lib/module/shared/components/create-boundary-component/hooks/helpers/boundary-link-context.js +0 -23
  367. package/lib/module/shared/components/create-boundary-component/hooks/helpers/boundary-link-context.js.map +0 -1
  368. package/lib/module/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js +0 -68
  369. package/lib/module/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js.map +0 -1
  370. package/lib/module/shared/components/create-boundary-component/hooks/helpers/measurement.js +0 -15
  371. package/lib/module/shared/components/create-boundary-component/hooks/helpers/measurement.js.map +0 -1
  372. package/lib/module/shared/components/create-boundary-component/hooks/helpers/scroll-measurement.js.map +0 -1
  373. package/lib/module/shared/components/create-boundary-component/utils/build-boundary-match-key.js +0 -12
  374. package/lib/module/shared/components/create-boundary-component/utils/build-boundary-match-key.js.map +0 -1
  375. package/lib/module/shared/providers/layout-anchor.provider.js +0 -80
  376. package/lib/module/shared/providers/layout-anchor.provider.js.map +0 -1
  377. package/lib/module/shared/stores/bounds/helpers/entries.helpers.js +0 -42
  378. package/lib/module/shared/stores/bounds/helpers/entries.helpers.js.map +0 -1
  379. package/lib/module/shared/stores/bounds/helpers/find-latest.js +0 -19
  380. package/lib/module/shared/stores/bounds/helpers/find-latest.js.map +0 -1
  381. package/lib/module/shared/stores/bounds/helpers/groups.helpers.js +0 -23
  382. package/lib/module/shared/stores/bounds/helpers/groups.helpers.js.map +0 -1
  383. package/lib/module/shared/stores/bounds/helpers/link.helpers.js +0 -69
  384. package/lib/module/shared/stores/bounds/helpers/link.helpers.js.map +0 -1
  385. package/lib/module/shared/stores/bounds/helpers/matching.js +0 -9
  386. package/lib/module/shared/stores/bounds/helpers/matching.js.map +0 -1
  387. package/lib/module/shared/stores/bounds/helpers/tag-state.helpers.js +0 -24
  388. package/lib/module/shared/stores/bounds/helpers/tag-state.helpers.js.map +0 -1
  389. package/lib/module/shared/stores/bounds/internals/groups.js +0 -95
  390. package/lib/module/shared/stores/bounds/internals/groups.js.map +0 -1
  391. package/lib/typescript/shared/components/create-boundary-component/helpers/apply-measured-bounds-writes.d.ts +0 -15
  392. package/lib/typescript/shared/components/create-boundary-component/helpers/apply-measured-bounds-writes.d.ts.map +0 -1
  393. package/lib/typescript/shared/components/create-boundary-component/helpers/resolve-pending-source-key.d.ts +0 -2
  394. package/lib/typescript/shared/components/create-boundary-component/helpers/resolve-pending-source-key.d.ts.map +0 -1
  395. package/lib/typescript/shared/components/create-boundary-component/hooks/helpers/boundary-link-context.d.ts +0 -22
  396. package/lib/typescript/shared/components/create-boundary-component/hooks/helpers/boundary-link-context.d.ts.map +0 -1
  397. package/lib/typescript/shared/components/create-boundary-component/hooks/helpers/measurement-rules.d.ts +0 -29
  398. package/lib/typescript/shared/components/create-boundary-component/hooks/helpers/measurement-rules.d.ts.map +0 -1
  399. package/lib/typescript/shared/components/create-boundary-component/hooks/helpers/measurement.d.ts +0 -3
  400. package/lib/typescript/shared/components/create-boundary-component/hooks/helpers/measurement.d.ts.map +0 -1
  401. package/lib/typescript/shared/components/create-boundary-component/hooks/helpers/scroll-measurement.d.ts.map +0 -1
  402. package/lib/typescript/shared/components/create-boundary-component/utils/build-boundary-match-key.d.ts +0 -8
  403. package/lib/typescript/shared/components/create-boundary-component/utils/build-boundary-match-key.d.ts.map +0 -1
  404. package/lib/typescript/shared/providers/layout-anchor.provider.d.ts +0 -39
  405. package/lib/typescript/shared/providers/layout-anchor.provider.d.ts.map +0 -1
  406. package/lib/typescript/shared/stores/bounds/helpers/entries.helpers.d.ts +0 -5
  407. package/lib/typescript/shared/stores/bounds/helpers/entries.helpers.d.ts.map +0 -1
  408. package/lib/typescript/shared/stores/bounds/helpers/find-latest.d.ts +0 -3
  409. package/lib/typescript/shared/stores/bounds/helpers/find-latest.d.ts.map +0 -1
  410. package/lib/typescript/shared/stores/bounds/helpers/groups.helpers.d.ts +0 -10
  411. package/lib/typescript/shared/stores/bounds/helpers/groups.helpers.d.ts.map +0 -1
  412. package/lib/typescript/shared/stores/bounds/helpers/link.helpers.d.ts +0 -14
  413. package/lib/typescript/shared/stores/bounds/helpers/link.helpers.d.ts.map +0 -1
  414. package/lib/typescript/shared/stores/bounds/helpers/matching.d.ts +0 -3
  415. package/lib/typescript/shared/stores/bounds/helpers/matching.d.ts.map +0 -1
  416. package/lib/typescript/shared/stores/bounds/helpers/tag-state.helpers.d.ts +0 -5
  417. package/lib/typescript/shared/stores/bounds/helpers/tag-state.helpers.d.ts.map +0 -1
  418. package/lib/typescript/shared/stores/bounds/internals/groups.d.ts +0 -16
  419. package/lib/typescript/shared/stores/bounds/internals/groups.d.ts.map +0 -1
  420. package/src/shared/components/create-boundary-component/helpers/apply-measured-bounds-writes.ts +0 -83
  421. package/src/shared/components/create-boundary-component/helpers/resolve-pending-source-key.ts +0 -20
  422. package/src/shared/components/create-boundary-component/hooks/helpers/boundary-link-context.ts +0 -48
  423. package/src/shared/components/create-boundary-component/hooks/helpers/measurement-rules.ts +0 -101
  424. package/src/shared/components/create-boundary-component/hooks/helpers/measurement.ts +0 -25
  425. package/src/shared/components/create-boundary-component/utils/build-boundary-match-key.ts +0 -14
  426. package/src/shared/providers/layout-anchor.provider.tsx +0 -112
  427. package/src/shared/stores/bounds/helpers/entries.helpers.ts +0 -55
  428. package/src/shared/stores/bounds/helpers/find-latest.ts +0 -22
  429. package/src/shared/stores/bounds/helpers/groups.helpers.ts +0 -27
  430. package/src/shared/stores/bounds/helpers/link.helpers.ts +0 -131
  431. package/src/shared/stores/bounds/helpers/matching.ts +0 -11
  432. package/src/shared/stores/bounds/helpers/tag-state.helpers.ts +0 -24
  433. package/src/shared/stores/bounds/internals/groups.ts +0 -116
@@ -1,194 +1,37 @@
1
- import { interpolate, type MeasuredDimensions } from "react-native-reanimated";
2
- import {
3
- EPSILON,
4
- NAVIGATION_MASK_ELEMENT_STYLE_ID,
5
- } from "../../../../constants";
1
+ import { interpolate } from "react-native-reanimated";
2
+ import { NAVIGATION_MASK_ELEMENT_STYLE_ID } from "../../../../constants";
6
3
  import { createLinkAccessor } from "../../helpers/create-link-accessor";
7
- import { computeContentTransformGeometry } from "../../helpers/geometry";
8
4
  import { getSourceBorderRadius } from "../helpers";
9
- import { combineScales, resolveDirectionalDragScale } from "../math";
10
5
  import {
11
6
  CLOSE_SOURCE_HANDOFF_PROGRESS,
12
- DISMISS_SCALE_ORBIT_DEPTH,
13
- DRAG_DIRECTIONAL_SCALE_EXPONENT,
14
- DRAG_DIRECTIONAL_SCALE_MAX,
15
- DRAG_DIRECTIONAL_SCALE_MIN,
7
+ CONTENT_CLOSING_OPACITY_OUTPUT,
8
+ CONTENT_CLOSING_OPACITY_RANGE,
9
+ CONTENT_ENTERING_OPACITY_OUTPUT,
10
+ CONTENT_ENTERING_OPACITY_RANGE,
11
+ CONTENT_SHADOW_OPACITY_OUTPUT,
16
12
  DRAG_MASK_HEIGHT_COLLAPSE_END,
17
13
  HORIZONTAL_DRAG_MASK_COLLAPSE_SCALE,
14
+ IDENTITY_DRAG_SCALE_OUTPUT,
18
15
  REVEAL_BORDER_RADIUS,
16
+ REVEAL_SHADOW_OFFSET,
17
+ REVEAL_USES_TRANSFORM_MASK,
18
+ UNFOCUSED_ELEMENT_OPACITY_OUTPUT,
19
+ ZERO_TO_ONE_RANGE,
19
20
  } from "./config";
20
- import { resolveDirectionalDragTranslation } from "./math";
21
+ import {
22
+ interpolateClamped,
23
+ mixUnit,
24
+ resolveDismissScaleHandoff,
25
+ resolveRevealContentBaseTransform,
26
+ resolveRevealDirectionalDragScale,
27
+ resolveRevealGestureHandoff,
28
+ resolveSafeScale,
29
+ resolveTrackedSourceElementTransform,
30
+ resolveUniformScale,
31
+ resolveUnitDragTranslation,
32
+ } from "./math";
21
33
  import type { BuildRevealStylesParams, RevealInterpolatedStyle } from "./types";
22
34
 
23
- const IDENTITY_DRAG_SCALE_OUTPUT = [1, 1] as const;
24
-
25
- function resolveUniformScale({
26
- sourceWidth,
27
- sourceHeight,
28
- destinationWidth,
29
- destinationHeight,
30
- }: {
31
- sourceWidth: number;
32
- sourceHeight: number;
33
- destinationWidth: number;
34
- destinationHeight: number;
35
- }) {
36
- "worklet";
37
-
38
- const sx = sourceWidth / destinationWidth;
39
- const sy = sourceHeight / destinationHeight;
40
-
41
- const sourceAspect = sourceWidth / sourceHeight;
42
- const destinationAspect = destinationWidth / destinationHeight;
43
- const aspectDifference = Math.abs(sourceAspect - destinationAspect);
44
-
45
- return aspectDifference < 0.1 ? Math.max(sx, sy) : Math.min(sx, sy);
46
- }
47
-
48
- function resolveRevealGestureHandoff(rawDrag: number) {
49
- "worklet";
50
-
51
- const gestureSensitivity = interpolate(rawDrag, [0, 1], [0.8, 0.1], "clamp");
52
-
53
- const releaseBoost = interpolate(rawDrag, [0, 1], [1, 1.4], "clamp");
54
-
55
- const releaseSensitivity = interpolate(
56
- gestureSensitivity,
57
- [0.28, 0.9],
58
- [0.7, 1],
59
- "clamp",
60
- );
61
-
62
- return {
63
- gestureSensitivity,
64
- gestureReleaseVelocityScale: releaseBoost * releaseSensitivity,
65
- };
66
- }
67
-
68
- function resolveDismissScaleHandoff({
69
- progress,
70
- releaseScale,
71
- targetScale,
72
- rawDrag,
73
- }: {
74
- progress: number;
75
- releaseScale: number;
76
- targetScale: number;
77
- rawDrag: number;
78
- }) {
79
- "worklet";
80
-
81
- const closeProgress = 1 - progress;
82
- const scaleProgress = Math.sin((Math.PI / 2) * closeProgress);
83
- const baseScale = releaseScale + (targetScale - releaseScale) * scaleProgress;
84
- const orbitDepth = interpolate(
85
- rawDrag,
86
- [0, 1],
87
- [0, DISMISS_SCALE_ORBIT_DEPTH],
88
- "clamp",
89
- );
90
- const orbitScale = 1 - orbitDepth * Math.sin(Math.PI * closeProgress);
91
-
92
- return baseScale * orbitScale;
93
- }
94
-
95
- function getBoundsCenterX(bounds: MeasuredDimensions) {
96
- "worklet";
97
- return bounds.pageX + bounds.width / 2;
98
- }
99
-
100
- function getBoundsCenterY(bounds: MeasuredDimensions) {
101
- "worklet";
102
- return bounds.pageY + bounds.height / 2;
103
- }
104
-
105
- function resolveRevealContentBaseTransform({
106
- progress,
107
- sourceBounds,
108
- destinationBounds,
109
- screenLayout,
110
- }: {
111
- progress: number;
112
- sourceBounds: MeasuredDimensions;
113
- destinationBounds: MeasuredDimensions;
114
- screenLayout: BuildRevealStylesParams["props"]["layouts"]["screen"];
115
- }) {
116
- "worklet";
117
-
118
- const geometry = computeContentTransformGeometry({
119
- start: sourceBounds,
120
- end: destinationBounds,
121
- entering: true,
122
- dimensions: screenLayout,
123
- scaleMode: "uniform",
124
- });
125
-
126
- return {
127
- translateX: interpolate(progress, [0, 1], [geometry.tx, 0], "clamp"),
128
- translateY: interpolate(progress, [0, 1], [geometry.ty, 0], "clamp"),
129
- scale: interpolate(progress, [0, 1], [geometry.s, 1], "clamp"),
130
- };
131
- }
132
-
133
- function resolveTrackedSourceElementTransform({
134
- sourceBounds,
135
- destinationBounds,
136
- contentTranslateX,
137
- contentTranslateY,
138
- contentScale,
139
- parentScale,
140
- screenWidth,
141
- screenHeight,
142
- }: {
143
- sourceBounds: MeasuredDimensions;
144
- destinationBounds: MeasuredDimensions;
145
- contentTranslateX: number;
146
- contentTranslateY: number;
147
- contentScale: number;
148
- parentScale: number;
149
- screenWidth: number;
150
- screenHeight: number;
151
- }) {
152
- "worklet";
153
-
154
- const screenCenterX = screenWidth / 2;
155
- const screenCenterY = screenHeight / 2;
156
- const safeParentScale = Math.max(Math.abs(parentScale), EPSILON);
157
- const safeSourceWidth = Math.max(Math.abs(sourceBounds.width), EPSILON);
158
- const safeSourceHeight = Math.max(Math.abs(sourceBounds.height), EPSILON);
159
-
160
- const sourceCenterX = getBoundsCenterX(sourceBounds);
161
- const sourceCenterY = getBoundsCenterY(sourceBounds);
162
- const destinationCenterX = getBoundsCenterX(destinationBounds);
163
- const destinationCenterY = getBoundsCenterY(destinationBounds);
164
-
165
- const trackedCenterX =
166
- screenCenterX +
167
- (destinationCenterX - screenCenterX) * contentScale +
168
- contentTranslateX;
169
- const trackedCenterY =
170
- screenCenterY +
171
- (destinationCenterY - screenCenterY) * contentScale +
172
- contentTranslateY;
173
-
174
- return {
175
- translateX:
176
- (trackedCenterX - screenCenterX) / safeParentScale +
177
- screenCenterX -
178
- sourceCenterX,
179
- translateY:
180
- (trackedCenterY - screenCenterY) / safeParentScale +
181
- screenCenterY -
182
- sourceCenterY,
183
- scaleX:
184
- (destinationBounds.width * contentScale) /
185
- (safeSourceWidth * safeParentScale),
186
- scaleY:
187
- (destinationBounds.height * contentScale) /
188
- (safeSourceHeight * safeParentScale),
189
- };
190
- }
191
-
192
35
  /* -------------------------------------------------------------------------- */
193
36
  /* BUILD REVEAL STYLES */
194
37
  /* -------------------------------------------------------------------------- */
@@ -211,11 +54,6 @@ export function buildRevealStyles({
211
54
  layouts: { screen: screenLayout },
212
55
  } = props;
213
56
 
214
- const baseRawOptions = {
215
- raw: true,
216
- scaleMode: "uniform",
217
- } as const;
218
-
219
57
  const boundsAccessor = createLinkAccessor(() => props);
220
58
  const link = boundsAccessor.getLink(tag);
221
59
 
@@ -230,8 +68,10 @@ export function buildRevealStyles({
230
68
  const initialGesture =
231
69
  props.active.gesture.active ?? props.active.gesture.direction;
232
70
 
233
- const isHorizontalDismiss = initialGesture?.includes("horizontal");
234
- const isVerticalDismiss = initialGesture?.includes("vertical");
71
+ const isHorizontalDismiss =
72
+ initialGesture === "horizontal" || initialGesture === "horizontal-inverted";
73
+ const isVerticalDismiss =
74
+ initialGesture === "vertical" || initialGesture === "vertical-inverted";
235
75
 
236
76
  const rawDrag = isHorizontalDismiss
237
77
  ? Math.abs(props.active.gesture.raw.normX)
@@ -239,45 +79,31 @@ export function buildRevealStyles({
239
79
  ? Math.abs(props.active.gesture.raw.normY)
240
80
  : 0;
241
81
 
242
- const dragX = resolveDirectionalDragTranslation({
243
- translation: props.active.gesture.x,
244
- dimension: screenLayout.width,
245
- negativeMax: 1,
246
- positiveMax: 1,
247
- exponent: 1,
248
- });
82
+ const dragX =
83
+ props.active.gesture.x === 0
84
+ ? 0
85
+ : resolveUnitDragTranslation(props.active.gesture.x, screenLayout.width);
249
86
 
250
- const dragY = resolveDirectionalDragTranslation({
251
- translation: props.active.gesture.y,
252
- dimension: screenLayout.height,
253
- negativeMax: 1,
254
- positiveMax: 1,
255
- exponent: 1,
256
- });
87
+ const dragY =
88
+ props.active.gesture.y === 0
89
+ ? 0
90
+ : resolveUnitDragTranslation(props.active.gesture.y, screenLayout.height);
257
91
 
258
92
  const dragXScale = isHorizontalDismiss
259
- ? resolveDirectionalDragScale({
260
- normalized: props.active.gesture.normX,
261
- dismissDirection:
262
- initialGesture === "horizontal-inverted" ? "negative" : "positive",
263
- shrinkMin: DRAG_DIRECTIONAL_SCALE_MIN,
264
- growMax: DRAG_DIRECTIONAL_SCALE_MAX,
265
- exponent: DRAG_DIRECTIONAL_SCALE_EXPONENT,
266
- })
93
+ ? resolveRevealDirectionalDragScale(
94
+ props.active.gesture.normX,
95
+ initialGesture === "horizontal-inverted",
96
+ )
267
97
  : IDENTITY_DRAG_SCALE_OUTPUT[0];
268
98
 
269
99
  const dragYScale = isVerticalDismiss
270
- ? resolveDirectionalDragScale({
271
- normalized: props.active.gesture.normY,
272
- dismissDirection:
273
- initialGesture === "vertical-inverted" ? "negative" : "positive",
274
- shrinkMin: DRAG_DIRECTIONAL_SCALE_MIN,
275
- growMax: DRAG_DIRECTIONAL_SCALE_MAX,
276
- exponent: DRAG_DIRECTIONAL_SCALE_EXPONENT,
277
- })
100
+ ? resolveRevealDirectionalDragScale(
101
+ props.active.gesture.normY,
102
+ initialGesture === "vertical-inverted",
103
+ )
278
104
  : IDENTITY_DRAG_SCALE_OUTPUT[1];
279
105
 
280
- const dragScale = combineScales(dragXScale, dragYScale);
106
+ const dragScale = dragXScale * dragYScale;
281
107
 
282
108
  const initialDestinationTarget =
283
109
  props.active.closing && link.initialDestination?.bounds
@@ -288,52 +114,53 @@ export function buildRevealStyles({
288
114
 
289
115
  if (focused) {
290
116
  const contentRaw = link.compute({
291
- ...baseRawOptions,
117
+ raw: true,
118
+ scaleMode: "uniform",
292
119
  method: "content",
293
120
  target: initialDestinationTarget,
294
- });
121
+ } as const);
295
122
 
296
123
  const maskRaw = link.compute({
297
- ...baseRawOptions,
124
+ raw: true,
125
+ scaleMode: "uniform",
298
126
  method: "size",
299
127
  space: "absolute",
300
128
  target: "fullscreen",
301
- });
129
+ } as const);
302
130
 
303
- const maskBorderRadius = interpolate(
131
+ const maskBorderRadius = mixUnit(
132
+ sourceBorderRadius,
133
+ REVEAL_BORDER_RADIUS,
304
134
  progress,
305
- [0, 1],
306
- [sourceBorderRadius, REVEAL_BORDER_RADIUS],
307
- "clamp",
308
135
  );
309
136
 
310
137
  const maskSizeMultiplier = props.active.closing
311
- ? interpolate(props.active.progress, [0, 1], [0.9, 1], "clamp")
138
+ ? mixUnit(0.9, 1, props.active.progress)
312
139
  : 1;
313
140
 
314
141
  const maskWidth = Math.max(1, maskRaw.width * maskSizeMultiplier);
315
142
  const maskHeight = Math.max(1, maskRaw.height * maskSizeMultiplier);
316
143
 
317
144
  const contentBaseScale = contentRaw.scale;
318
- const contentTargetBounds =
319
- initialDestinationTarget ?? link.destination.bounds;
320
- const sourceContentScale = resolveUniformScale({
321
- sourceWidth: link.source.bounds.width,
322
- sourceHeight: link.source.bounds.height,
323
- destinationWidth: contentTargetBounds.width,
324
- destinationHeight: contentTargetBounds.height,
325
- });
326
- const safeContentBaseScale =
327
- Math.abs(contentBaseScale) > EPSILON ? contentBaseScale : 1;
328
-
329
- const contentScale = props.active.gesture.dismissing
330
- ? resolveDismissScaleHandoff({
331
- progress: props.active.progress,
332
- releaseScale: dragScale,
333
- targetScale: sourceContentScale,
334
- rawDrag,
335
- })
336
- : contentBaseScale * dragScale;
145
+ const safeContentBaseScale = resolveSafeScale(contentBaseScale);
146
+
147
+ let contentScale = contentBaseScale * dragScale;
148
+ if (props.active.gesture.dismissing) {
149
+ const contentTargetBounds =
150
+ initialDestinationTarget ?? link.destination.bounds;
151
+ const sourceContentScale = resolveUniformScale({
152
+ sourceWidth: link.source.bounds.width,
153
+ sourceHeight: link.source.bounds.height,
154
+ destinationWidth: contentTargetBounds.width,
155
+ destinationHeight: contentTargetBounds.height,
156
+ });
157
+ contentScale = resolveDismissScaleHandoff({
158
+ progress: props.active.progress,
159
+ releaseScale: dragScale,
160
+ targetScale: sourceContentScale,
161
+ velocity: props.active.gesture.velocity,
162
+ });
163
+ }
337
164
  const contentTranslateX = contentRaw.translateX + dragX;
338
165
  const contentTranslateY = contentRaw.translateY + dragY;
339
166
 
@@ -368,11 +195,12 @@ export function buildRevealStyles({
368
195
  Math.max(maskWidth, link.source.bounds.height),
369
196
  );
370
197
 
371
- const renderedMaskHeight = interpolate(
198
+ const renderedMaskHeight = interpolateClamped(
372
199
  maskHeightCollapseDrag,
373
- [0, DRAG_MASK_HEIGHT_COLLAPSE_END],
374
- [maskHeight, minMaskHeight],
375
- "clamp",
200
+ 0,
201
+ DRAG_MASK_HEIGHT_COLLAPSE_END,
202
+ maskHeight,
203
+ minMaskHeight,
376
204
  );
377
205
 
378
206
  const maskCenterX = maskWidth / 2;
@@ -406,6 +234,38 @@ export function buildRevealStyles({
406
234
  safeContentBaseScale;
407
235
 
408
236
  const compensatedMaskScale = 1 / safeContentBaseScale;
237
+ const maskBaseWidth = Math.max(1, screenLayout.width);
238
+ const maskBaseHeight = Math.max(1, screenLayout.height);
239
+ const maskScaleX = maskWidth / maskBaseWidth;
240
+ const maskScaleY = renderedMaskHeight / maskBaseHeight;
241
+ const transformMaskTranslateX =
242
+ compensatedMaskTranslateX + (maskWidth - maskBaseWidth) / 2;
243
+ const transformMaskTranslateY =
244
+ compensatedMaskTranslateY + (renderedMaskHeight - maskBaseHeight) / 2;
245
+ const maskElementStyle = REVEAL_USES_TRANSFORM_MASK
246
+ ? {
247
+ width: maskBaseWidth,
248
+ height: maskBaseHeight,
249
+ borderRadius: props.active.settled ? 0 : maskBorderRadius,
250
+ borderCurve: "continuous" as const,
251
+ transform: [
252
+ { translateX: transformMaskTranslateX },
253
+ { translateY: transformMaskTranslateY },
254
+ { scaleX: maskScaleX * compensatedMaskScale },
255
+ { scaleY: maskScaleY * compensatedMaskScale },
256
+ ],
257
+ }
258
+ : {
259
+ width: maskWidth,
260
+ height: renderedMaskHeight,
261
+ borderRadius: props.active.settled ? 0 : maskBorderRadius,
262
+ borderCurve: "continuous" as const,
263
+ transform: [
264
+ { translateX: compensatedMaskTranslateX },
265
+ { translateY: compensatedMaskTranslateY },
266
+ { scale: compensatedMaskScale },
267
+ ],
268
+ };
409
269
 
410
270
  const elementOffsetX = initialDestinationTarget
411
271
  ? initialDestinationTarget.pageX - link.destination.bounds.pageX
@@ -416,19 +276,21 @@ export function buildRevealStyles({
416
276
  : 0;
417
277
 
418
278
  const elementTX = props.active.closing
419
- ? interpolate(
279
+ ? interpolateClamped(
420
280
  props.active.progress,
421
- [CLOSE_SOURCE_HANDOFF_PROGRESS, 1],
422
- [elementOffsetX, 0],
423
- "clamp",
281
+ CLOSE_SOURCE_HANDOFF_PROGRESS,
282
+ 1,
283
+ elementOffsetX,
284
+ 0,
424
285
  )
425
286
  : 0;
426
287
  const elementY = props.active.closing
427
- ? interpolate(
288
+ ? interpolateClamped(
428
289
  props.active.progress,
429
- [CLOSE_SOURCE_HANDOFF_PROGRESS, 1],
430
- [elementOffsetY, 0],
431
- "clamp",
290
+ CLOSE_SOURCE_HANDOFF_PROGRESS,
291
+ 1,
292
+ elementOffsetY,
293
+ 0,
432
294
  )
433
295
  : 0;
434
296
 
@@ -449,35 +311,29 @@ export function buildRevealStyles({
449
311
  { scale: contentScale },
450
312
  ],
451
313
  shadowColor: "#000",
452
- shadowOffset: { width: 0, height: 2 },
453
- shadowOpacity: interpolate(props.active.progress, [0, 1], [0, 0.25]),
314
+ shadowOffset: REVEAL_SHADOW_OFFSET,
315
+ shadowOpacity: interpolate(
316
+ props.active.progress,
317
+ ZERO_TO_ONE_RANGE,
318
+ CONTENT_SHADOW_OPACITY_OUTPUT,
319
+ ),
454
320
  shadowRadius: 32,
455
321
  elevation: 5,
456
322
  opacity: props.active.entering
457
323
  ? interpolate(
458
324
  props.active.progress,
459
- [0, CLOSE_SOURCE_HANDOFF_PROGRESS],
460
- [0, 1],
325
+ CONTENT_ENTERING_OPACITY_RANGE,
326
+ CONTENT_ENTERING_OPACITY_OUTPUT,
461
327
  )
462
328
  : interpolate(
463
329
  props.active.progress,
464
- [0, CLOSE_SOURCE_HANDOFF_PROGRESS, 1],
465
- [0, 1, 1],
330
+ CONTENT_CLOSING_OPACITY_RANGE,
331
+ CONTENT_CLOSING_OPACITY_OUTPUT,
466
332
  ),
467
333
  },
468
334
  },
469
335
  [NAVIGATION_MASK_ELEMENT_STYLE_ID]: {
470
- style: {
471
- width: maskWidth,
472
- height: renderedMaskHeight,
473
- borderRadius: props.active.settled ? 0 : maskBorderRadius,
474
- borderCurve: "continuous",
475
- transform: [
476
- { translateX: compensatedMaskTranslateX },
477
- { translateY: compensatedMaskTranslateY },
478
- { scale: compensatedMaskScale },
479
- ],
480
- },
336
+ style: maskElementStyle,
481
337
  },
482
338
  [link.id]: {
483
339
  style: {
@@ -491,12 +347,7 @@ export function buildRevealStyles({
491
347
 
492
348
  /* ---------------------------- Unfocused Screen ---------------------------- */
493
349
 
494
- const unfocusedScale = interpolate(
495
- props.active.progress,
496
- [0, 1],
497
- [1, 0.9375],
498
- "clamp",
499
- );
350
+ const unfocusedScale = mixUnit(1, 0.9375, props.active.progress);
500
351
  const unfocusedContentScale = props.active.logicallySettled
501
352
  ? 1
502
353
  : unfocusedScale;
@@ -510,20 +361,21 @@ export function buildRevealStyles({
510
361
  destinationBounds: trackingContentTarget,
511
362
  screenLayout,
512
363
  });
513
- const trackingTargetScale = resolveUniformScale({
514
- sourceWidth: link.source.bounds.width,
515
- sourceHeight: link.source.bounds.height,
516
- destinationWidth: trackingContentTarget.width,
517
- destinationHeight: trackingContentTarget.height,
518
- });
519
- const trackingContentScale = props.active.gesture.dismissing
520
- ? resolveDismissScaleHandoff({
521
- progress: props.active.progress,
522
- releaseScale: dragScale,
523
- targetScale: trackingTargetScale,
524
- rawDrag,
525
- })
526
- : trackingContentBaseTransform.scale * dragScale;
364
+ let trackingContentScale = trackingContentBaseTransform.scale * dragScale;
365
+ if (props.active.gesture.dismissing) {
366
+ const trackingTargetScale = resolveUniformScale({
367
+ sourceWidth: link.source.bounds.width,
368
+ sourceHeight: link.source.bounds.height,
369
+ destinationWidth: trackingContentTarget.width,
370
+ destinationHeight: trackingContentTarget.height,
371
+ });
372
+ trackingContentScale = resolveDismissScaleHandoff({
373
+ progress: props.active.progress,
374
+ releaseScale: dragScale,
375
+ targetScale: trackingTargetScale,
376
+ velocity: props.active.gesture.velocity,
377
+ });
378
+ }
527
379
  const trackingContentTranslateX =
528
380
  trackingContentBaseTransform.translateX + dragX;
529
381
  const trackingContentTranslateY =
@@ -558,7 +410,11 @@ export function buildRevealStyles({
558
410
  style: {
559
411
  opacity: props.active.closing
560
412
  ? 1
561
- : interpolate(props.active.progress, [0, 1], [1, 0], "clamp"),
413
+ : interpolate(
414
+ props.active.progress,
415
+ ZERO_TO_ONE_RANGE,
416
+ UNFOCUSED_ELEMENT_OPACITY_OUTPUT,
417
+ ),
562
418
 
563
419
  zIndex: 9999,
564
420
  elevation: 9999,
@@ -6,10 +6,29 @@ export const REVEAL_BORDER_RADIUS = Platform.select({
6
6
  default: 36,
7
7
  });
8
8
 
9
+ export const REVEAL_USES_TRANSFORM_MASK = Platform.OS === "android";
10
+
9
11
  export const DRAG_DIRECTIONAL_SCALE_MIN = 0.25;
10
12
  export const DRAG_DIRECTIONAL_SCALE_MAX = 1.06;
11
13
  export const DRAG_DIRECTIONAL_SCALE_EXPONENT = 2;
12
14
  export const DRAG_MASK_HEIGHT_COLLAPSE_END = 0.7;
13
15
  export const HORIZONTAL_DRAG_MASK_COLLAPSE_SCALE = 0.5;
14
- export const DISMISS_SCALE_ORBIT_DEPTH = 0.8;
16
+ export const DISMISS_SCALE_ORBIT_DEPTH = 0.5;
15
17
  export const CLOSE_SOURCE_HANDOFF_PROGRESS = 0.25;
18
+
19
+ export const IDENTITY_DRAG_SCALE_OUTPUT = [1, 1] as const;
20
+ export const ZERO_TO_ONE_RANGE = [0, 1] as const;
21
+ export const CONTENT_ENTERING_OPACITY_RANGE = [
22
+ 0,
23
+ CLOSE_SOURCE_HANDOFF_PROGRESS,
24
+ ] as const;
25
+ export const CONTENT_CLOSING_OPACITY_RANGE = [
26
+ 0,
27
+ CLOSE_SOURCE_HANDOFF_PROGRESS,
28
+ 1,
29
+ ] as const;
30
+ export const CONTENT_ENTERING_OPACITY_OUTPUT = [0, 1] as const;
31
+ export const CONTENT_CLOSING_OPACITY_OUTPUT = [0, 1, 1] as const;
32
+ export const CONTENT_SHADOW_OPACITY_OUTPUT = [0, 0.25] as const;
33
+ export const UNFOCUSED_ELEMENT_OPACITY_OUTPUT = [1, 0] as const;
34
+ export const REVEAL_SHADOW_OFFSET = { width: 0, height: 2 } as const;