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

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 (241) 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 +2 -1
  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/providers/boundary-root.provider.js +16 -3
  24. package/lib/commonjs/shared/components/boundary/providers/boundary-root.provider.js.map +1 -1
  25. package/lib/commonjs/shared/constants.js +4 -0
  26. package/lib/commonjs/shared/constants.js.map +1 -1
  27. package/lib/commonjs/shared/providers/screen/animation/helpers/hydrate-transition-state/index.js +4 -0
  28. package/lib/commonjs/shared/providers/screen/animation/helpers/hydrate-transition-state/index.js.map +1 -1
  29. package/lib/commonjs/shared/providers/screen/gestures/pan/activation/use-pan-activation.js +10 -10
  30. package/lib/commonjs/shared/providers/screen/gestures/pan/activation/use-pan-activation.js.map +1 -1
  31. package/lib/commonjs/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.js +10 -2
  32. package/lib/commonjs/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.js.map +1 -1
  33. package/lib/commonjs/shared/providers/screen/gestures/pan/use-build-pan-gesture.js +1 -1
  34. package/lib/commonjs/shared/providers/screen/gestures/pan/use-build-pan-gesture.js.map +1 -1
  35. package/lib/commonjs/shared/providers/screen/gestures/pinch/activation/use-pinch-activation.js +25 -3
  36. package/lib/commonjs/shared/providers/screen/gestures/pinch/activation/use-pinch-activation.js.map +1 -1
  37. package/lib/commonjs/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.js +4 -6
  38. package/lib/commonjs/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.js.map +1 -1
  39. package/lib/commonjs/shared/providers/screen/gestures/pinch/behavior/use-pinch-behavior.js +2 -2
  40. package/lib/commonjs/shared/providers/screen/gestures/pinch/behavior/use-pinch-behavior.js.map +1 -1
  41. package/lib/commonjs/shared/providers/screen/gestures/scroll-coordination/use-scroll-gesture-coordination.js +6 -1
  42. package/lib/commonjs/shared/providers/screen/gestures/scroll-coordination/use-scroll-gesture-coordination.js.map +1 -1
  43. package/lib/commonjs/shared/providers/screen/gestures/shared/snapshot.js +2 -0
  44. package/lib/commonjs/shared/providers/screen/gestures/shared/snapshot.js.map +1 -1
  45. package/lib/commonjs/shared/providers/screen/gestures/shared/values.js +2 -0
  46. package/lib/commonjs/shared/providers/screen/gestures/shared/values.js.map +1 -1
  47. package/lib/commonjs/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js +11 -0
  48. package/lib/commonjs/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js.map +1 -1
  49. package/lib/commonjs/shared/stores/gesture.store.js +8 -0
  50. package/lib/commonjs/shared/stores/gesture.store.js.map +1 -1
  51. package/lib/commonjs/shared/utils/animation/animate-to-progress.js +24 -7
  52. package/lib/commonjs/shared/utils/animation/animate-to-progress.js.map +1 -1
  53. package/lib/commonjs/shared/utils/bounds/navigation/reveal/math.js +2 -1
  54. package/lib/commonjs/shared/utils/bounds/navigation/reveal/math.js.map +1 -1
  55. package/lib/commonjs/shared/utils/bounds/navigation/zoom/build.js +177 -314
  56. package/lib/commonjs/shared/utils/bounds/navigation/zoom/build.js.map +1 -1
  57. package/lib/commonjs/shared/utils/bounds/navigation/zoom/config.js +12 -18
  58. package/lib/commonjs/shared/utils/bounds/navigation/zoom/config.js.map +1 -1
  59. package/lib/commonjs/shared/utils/bounds/navigation/zoom/drag.js +196 -0
  60. package/lib/commonjs/shared/utils/bounds/navigation/zoom/drag.js.map +1 -0
  61. package/lib/commonjs/shared/utils/bounds/navigation/zoom/helpers.js +94 -108
  62. package/lib/commonjs/shared/utils/bounds/navigation/zoom/helpers.js.map +1 -1
  63. package/lib/commonjs/shared/utils/bounds/navigation/zoom/mask.js +72 -0
  64. package/lib/commonjs/shared/utils/bounds/navigation/zoom/mask.js.map +1 -0
  65. package/lib/commonjs/shared/utils/bounds/navigation/zoom/targets.js +55 -0
  66. package/lib/commonjs/shared/utils/bounds/navigation/zoom/targets.js.map +1 -0
  67. package/lib/module/shared/components/boundary/components/boundary-target.js +20 -15
  68. package/lib/module/shared/components/boundary/components/boundary-target.js.map +1 -1
  69. package/lib/module/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js +14 -7
  70. package/lib/module/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js.map +1 -1
  71. package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/components/host.js +2 -1
  72. package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/components/host.js.map +1 -1
  73. package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js +32 -2
  74. package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js.map +1 -1
  75. package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/index.js +5 -4
  76. package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/index.js.map +1 -1
  77. package/lib/module/shared/components/boundary/portal/components/boundary-portal/components/host.js +3 -2
  78. package/lib/module/shared/components/boundary/portal/components/boundary-portal/components/host.js.map +1 -1
  79. package/lib/module/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.js +3 -2
  80. package/lib/module/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.js.map +1 -1
  81. package/lib/module/shared/components/boundary/portal/components/boundary-portal/components/portal-slot.js +3 -4
  82. package/lib/module/shared/components/boundary/portal/components/boundary-portal/components/portal-slot.js.map +1 -1
  83. package/lib/module/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js +1 -0
  84. package/lib/module/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js.map +1 -1
  85. package/lib/module/shared/components/boundary/portal/components/boundary-portal/index.js +1 -3
  86. package/lib/module/shared/components/boundary/portal/components/boundary-portal/index.js.map +1 -1
  87. package/lib/module/shared/components/boundary/portal/teleport.js +1 -0
  88. package/lib/module/shared/components/boundary/portal/teleport.js.map +1 -1
  89. package/lib/module/shared/components/boundary/providers/boundary-root.provider.js +17 -4
  90. package/lib/module/shared/components/boundary/providers/boundary-root.provider.js.map +1 -1
  91. package/lib/module/shared/constants.js +4 -0
  92. package/lib/module/shared/constants.js.map +1 -1
  93. package/lib/module/shared/providers/screen/animation/helpers/hydrate-transition-state/index.js +4 -0
  94. package/lib/module/shared/providers/screen/animation/helpers/hydrate-transition-state/index.js.map +1 -1
  95. package/lib/module/shared/providers/screen/gestures/pan/activation/use-pan-activation.js +10 -10
  96. package/lib/module/shared/providers/screen/gestures/pan/activation/use-pan-activation.js.map +1 -1
  97. package/lib/module/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.js +10 -2
  98. package/lib/module/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.js.map +1 -1
  99. package/lib/module/shared/providers/screen/gestures/pan/use-build-pan-gesture.js +1 -1
  100. package/lib/module/shared/providers/screen/gestures/pan/use-build-pan-gesture.js.map +1 -1
  101. package/lib/module/shared/providers/screen/gestures/pinch/activation/use-pinch-activation.js +23 -2
  102. package/lib/module/shared/providers/screen/gestures/pinch/activation/use-pinch-activation.js.map +1 -1
  103. package/lib/module/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.js +4 -6
  104. package/lib/module/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.js.map +1 -1
  105. package/lib/module/shared/providers/screen/gestures/pinch/behavior/use-pinch-behavior.js +2 -2
  106. package/lib/module/shared/providers/screen/gestures/pinch/behavior/use-pinch-behavior.js.map +1 -1
  107. package/lib/module/shared/providers/screen/gestures/scroll-coordination/use-scroll-gesture-coordination.js +6 -1
  108. package/lib/module/shared/providers/screen/gestures/scroll-coordination/use-scroll-gesture-coordination.js.map +1 -1
  109. package/lib/module/shared/providers/screen/gestures/shared/snapshot.js +2 -0
  110. package/lib/module/shared/providers/screen/gestures/shared/snapshot.js.map +1 -1
  111. package/lib/module/shared/providers/screen/gestures/shared/values.js +2 -0
  112. package/lib/module/shared/providers/screen/gestures/shared/values.js.map +1 -1
  113. package/lib/module/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js +11 -0
  114. package/lib/module/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js.map +1 -1
  115. package/lib/module/shared/stores/gesture.store.js +8 -0
  116. package/lib/module/shared/stores/gesture.store.js.map +1 -1
  117. package/lib/module/shared/types/bounds.types.js +26 -0
  118. package/lib/module/shared/types/bounds.types.js.map +1 -1
  119. package/lib/module/shared/utils/animation/animate-to-progress.js +24 -7
  120. package/lib/module/shared/utils/animation/animate-to-progress.js.map +1 -1
  121. package/lib/module/shared/utils/bounds/navigation/reveal/math.js +2 -1
  122. package/lib/module/shared/utils/bounds/navigation/reveal/math.js.map +1 -1
  123. package/lib/module/shared/utils/bounds/navigation/zoom/build.js +181 -318
  124. package/lib/module/shared/utils/bounds/navigation/zoom/build.js.map +1 -1
  125. package/lib/module/shared/utils/bounds/navigation/zoom/config.js +11 -17
  126. package/lib/module/shared/utils/bounds/navigation/zoom/config.js.map +1 -1
  127. package/lib/module/shared/utils/bounds/navigation/zoom/drag.js +184 -0
  128. package/lib/module/shared/utils/bounds/navigation/zoom/drag.js.map +1 -0
  129. package/lib/module/shared/utils/bounds/navigation/zoom/helpers.js +91 -102
  130. package/lib/module/shared/utils/bounds/navigation/zoom/helpers.js.map +1 -1
  131. package/lib/module/shared/utils/bounds/navigation/zoom/mask.js +67 -0
  132. package/lib/module/shared/utils/bounds/navigation/zoom/mask.js.map +1 -0
  133. package/lib/module/shared/utils/bounds/navigation/zoom/targets.js +50 -0
  134. package/lib/module/shared/utils/bounds/navigation/zoom/targets.js.map +1 -0
  135. package/lib/typescript/shared/components/boundary/components/boundary-target.d.ts +3 -1
  136. package/lib/typescript/shared/components/boundary/components/boundary-target.d.ts.map +1 -1
  137. package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.d.ts.map +1 -1
  138. package/lib/typescript/shared/components/boundary/portal/components/boundary-content-portal/components/host.d.ts.map +1 -1
  139. package/lib/typescript/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.d.ts.map +1 -1
  140. package/lib/typescript/shared/components/boundary/portal/components/boundary-content-portal/index.d.ts +1 -3
  141. package/lib/typescript/shared/components/boundary/portal/components/boundary-content-portal/index.d.ts.map +1 -1
  142. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/components/host.d.ts.map +1 -1
  143. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.d.ts.map +1 -1
  144. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/components/portal-slot.d.ts +2 -3
  145. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/components/portal-slot.d.ts.map +1 -1
  146. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.d.ts.map +1 -1
  147. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/index.d.ts +2 -3
  148. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/index.d.ts.map +1 -1
  149. package/lib/typescript/shared/components/boundary/portal/teleport.d.ts +1 -0
  150. package/lib/typescript/shared/components/boundary/portal/teleport.d.ts.map +1 -1
  151. package/lib/typescript/shared/components/boundary/providers/boundary-root.provider.d.ts +1 -0
  152. package/lib/typescript/shared/components/boundary/providers/boundary-root.provider.d.ts.map +1 -1
  153. package/lib/typescript/shared/constants.d.ts.map +1 -1
  154. package/lib/typescript/shared/index.d.ts +1 -1
  155. package/lib/typescript/shared/index.d.ts.map +1 -1
  156. package/lib/typescript/shared/providers/screen/animation/helpers/hydrate-transition-state/index.d.ts.map +1 -1
  157. package/lib/typescript/shared/providers/screen/gestures/pan/activation/use-pan-activation.d.ts +2 -0
  158. package/lib/typescript/shared/providers/screen/gestures/pan/activation/use-pan-activation.d.ts.map +1 -1
  159. package/lib/typescript/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.d.ts +2 -1
  160. package/lib/typescript/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.d.ts.map +1 -1
  161. package/lib/typescript/shared/providers/screen/gestures/pan/use-build-pan-gesture.d.ts.map +1 -1
  162. package/lib/typescript/shared/providers/screen/gestures/pinch/activation/use-pinch-activation.d.ts +2 -0
  163. package/lib/typescript/shared/providers/screen/gestures/pinch/activation/use-pinch-activation.d.ts.map +1 -1
  164. package/lib/typescript/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.d.ts +1 -1
  165. package/lib/typescript/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.d.ts.map +1 -1
  166. package/lib/typescript/shared/providers/screen/gestures/pinch/behavior/use-pinch-behavior.d.ts.map +1 -1
  167. package/lib/typescript/shared/providers/screen/gestures/scroll-coordination/use-scroll-gesture-coordination.d.ts.map +1 -1
  168. package/lib/typescript/shared/providers/screen/gestures/shared/snapshot.d.ts.map +1 -1
  169. package/lib/typescript/shared/providers/screen/gestures/shared/values.d.ts.map +1 -1
  170. package/lib/typescript/shared/providers/screen/styles/hooks/use-maybe-block-visibility.d.ts +4 -0
  171. package/lib/typescript/shared/providers/screen/styles/hooks/use-maybe-block-visibility.d.ts.map +1 -1
  172. package/lib/typescript/shared/stores/gesture.store.d.ts +4 -0
  173. package/lib/typescript/shared/stores/gesture.store.d.ts.map +1 -1
  174. package/lib/typescript/shared/types/bounds.types.d.ts +115 -88
  175. package/lib/typescript/shared/types/bounds.types.d.ts.map +1 -1
  176. package/lib/typescript/shared/types/gesture.types.d.ts +10 -0
  177. package/lib/typescript/shared/types/gesture.types.d.ts.map +1 -1
  178. package/lib/typescript/shared/types/index.d.ts +1 -1
  179. package/lib/typescript/shared/types/index.d.ts.map +1 -1
  180. package/lib/typescript/shared/utils/animation/animate-to-progress.d.ts.map +1 -1
  181. package/lib/typescript/shared/utils/bounds/navigation/reveal/math.d.ts.map +1 -1
  182. package/lib/typescript/shared/utils/bounds/navigation/zoom/build.d.ts +1 -1
  183. package/lib/typescript/shared/utils/bounds/navigation/zoom/build.d.ts.map +1 -1
  184. package/lib/typescript/shared/utils/bounds/navigation/zoom/config.d.ts +7 -17
  185. package/lib/typescript/shared/utils/bounds/navigation/zoom/config.d.ts.map +1 -1
  186. package/lib/typescript/shared/utils/bounds/navigation/zoom/drag.d.ts +55 -0
  187. package/lib/typescript/shared/utils/bounds/navigation/zoom/drag.d.ts.map +1 -0
  188. package/lib/typescript/shared/utils/bounds/navigation/zoom/helpers.d.ts +31 -34
  189. package/lib/typescript/shared/utils/bounds/navigation/zoom/helpers.d.ts.map +1 -1
  190. package/lib/typescript/shared/utils/bounds/navigation/zoom/mask.d.ts +25 -0
  191. package/lib/typescript/shared/utils/bounds/navigation/zoom/mask.d.ts.map +1 -0
  192. package/lib/typescript/shared/utils/bounds/navigation/zoom/targets.d.ts +16 -0
  193. package/lib/typescript/shared/utils/bounds/navigation/zoom/targets.d.ts.map +1 -0
  194. package/lib/typescript/shared/utils/bounds/navigation/zoom/types.d.ts +1 -1
  195. package/lib/typescript/shared/utils/bounds/navigation/zoom/types.d.ts.map +1 -1
  196. package/package.json +1 -1
  197. package/src/shared/components/boundary/components/boundary-target.tsx +37 -26
  198. package/src/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.ts +16 -13
  199. package/src/shared/components/boundary/portal/components/boundary-content-portal/components/host.tsx +6 -2
  200. package/src/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.ts +46 -3
  201. package/src/shared/components/boundary/portal/components/boundary-content-portal/index.tsx +8 -5
  202. package/src/shared/components/boundary/portal/components/boundary-portal/components/host.tsx +3 -2
  203. package/src/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.tsx +3 -2
  204. package/src/shared/components/boundary/portal/components/boundary-portal/components/portal-slot.tsx +4 -5
  205. package/src/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.ts +5 -1
  206. package/src/shared/components/boundary/portal/components/boundary-portal/index.tsx +1 -4
  207. package/src/shared/components/boundary/portal/teleport.ts +1 -0
  208. package/src/shared/components/boundary/providers/boundary-root.provider.tsx +23 -3
  209. package/src/shared/constants.ts +4 -0
  210. package/src/shared/index.ts +2 -0
  211. package/src/shared/providers/screen/animation/helpers/hydrate-transition-state/index.ts +8 -0
  212. package/src/shared/providers/screen/gestures/pan/activation/use-pan-activation.ts +16 -7
  213. package/src/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.ts +18 -1
  214. package/src/shared/providers/screen/gestures/pan/use-build-pan-gesture.ts +1 -0
  215. package/src/shared/providers/screen/gestures/pinch/activation/use-pinch-activation.ts +40 -2
  216. package/src/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.ts +7 -11
  217. package/src/shared/providers/screen/gestures/pinch/behavior/use-pinch-behavior.ts +12 -15
  218. package/src/shared/providers/screen/gestures/scroll-coordination/use-scroll-gesture-coordination.ts +6 -1
  219. package/src/shared/providers/screen/gestures/shared/snapshot.ts +2 -0
  220. package/src/shared/providers/screen/gestures/shared/values.ts +2 -0
  221. package/src/shared/providers/screen/styles/hooks/use-maybe-block-visibility.tsx +14 -1
  222. package/src/shared/stores/gesture.store.ts +12 -0
  223. package/src/shared/types/bounds.types.ts +119 -90
  224. package/src/shared/types/gesture.types.ts +10 -0
  225. package/src/shared/types/index.ts +2 -0
  226. package/src/shared/utils/animation/animate-to-progress.ts +23 -7
  227. package/src/shared/utils/bounds/navigation/reveal/math.ts +2 -1
  228. package/src/shared/utils/bounds/navigation/zoom/build.ts +223 -411
  229. package/src/shared/utils/bounds/navigation/zoom/config.ts +15 -18
  230. package/src/shared/utils/bounds/navigation/zoom/drag.ts +327 -0
  231. package/src/shared/utils/bounds/navigation/zoom/helpers.ts +122 -184
  232. package/src/shared/utils/bounds/navigation/zoom/mask.ts +130 -0
  233. package/src/shared/utils/bounds/navigation/zoom/targets.ts +74 -0
  234. package/src/shared/utils/bounds/navigation/zoom/types.ts +1 -1
  235. package/lib/commonjs/shared/utils/bounds/navigation/zoom/math.js +0 -25
  236. package/lib/commonjs/shared/utils/bounds/navigation/zoom/math.js.map +0 -1
  237. package/lib/module/shared/utils/bounds/navigation/zoom/math.js +0 -20
  238. package/lib/module/shared/utils/bounds/navigation/zoom/math.js.map +0 -1
  239. package/lib/typescript/shared/utils/bounds/navigation/zoom/math.d.ts +0 -8
  240. package/lib/typescript/shared/utils/bounds/navigation/zoom/math.d.ts.map +0 -1
  241. package/src/shared/utils/bounds/navigation/zoom/math.ts +0 -25
@@ -0,0 +1,130 @@
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 { toNumber } from "../helpers";
13
+ import { DRAG_MASK_HEIGHT_COLLAPSE_END } from "../reveal/config";
14
+ import {
15
+ interpolateClamped,
16
+ resolveAspectRatioMaskHeight,
17
+ } from "../reveal/math";
18
+ import { ZOOM_SHARED_OPTIONS } from "./config";
19
+ import type { ZoomDragState } from "./drag";
20
+
21
+ export const ZOOM_NAVIGATION_MASK_BORDER_RADIUS = 64;
22
+ const ZOOM_VERTICAL_DRAG_MASK_COLLAPSE_SCALE = 0.8;
23
+
24
+ interface ZoomNavigationMaskStyleProps {
25
+ scopedBounds: BoundsScopedAccessor;
26
+ link: BoundsLink;
27
+ sourceBounds: MeasuredDimensions;
28
+ screenLayout: Layout;
29
+ transitionProgress: number;
30
+ drag: ZoomDragState;
31
+ contentTransform: {
32
+ translateX: number;
33
+ translateY: number;
34
+ scale: number;
35
+ };
36
+ sourceBorderRadius: number;
37
+ expandedBorderRadius: number;
38
+ active: ScreenTransitionState;
39
+ }
40
+
41
+ export function resolveZoomNavigationMaskStyle({
42
+ scopedBounds,
43
+ link,
44
+ sourceBounds,
45
+ screenLayout,
46
+ transitionProgress,
47
+ drag,
48
+ contentTransform,
49
+ sourceBorderRadius,
50
+ expandedBorderRadius,
51
+ active,
52
+ }: ZoomNavigationMaskStyleProps): TransitionSlotStyle {
53
+ "worklet";
54
+
55
+ const maskRaw = scopedBounds.values({
56
+ scaleMode: ZOOM_SHARED_OPTIONS.scaleMode,
57
+ anchor: ZOOM_SHARED_OPTIONS.anchor,
58
+ method: "size",
59
+ space: "absolute",
60
+ target: "fullscreen",
61
+ progress: transitionProgress,
62
+ });
63
+ const maskWidth = maskRaw.width;
64
+ const maskHeight = maskRaw.height;
65
+ const maskAspectBounds = link.initialSource?.bounds ?? sourceBounds;
66
+ const minMaskHeight = resolveAspectRatioMaskHeight({
67
+ maskWidth,
68
+ maskHeight,
69
+ targetWidth: maskAspectBounds.width,
70
+ targetHeight: maskAspectBounds.height,
71
+ });
72
+ const maskHeightCollapseDrag = drag.collapsesMask
73
+ ? Math.max(
74
+ 0,
75
+ drag.dismissNorm * ZOOM_VERTICAL_DRAG_MASK_COLLAPSE_SCALE,
76
+ drag.dismissProgress,
77
+ )
78
+ : 0;
79
+ const renderedMaskHeight = interpolateClamped(
80
+ maskHeightCollapseDrag,
81
+ 0,
82
+ DRAG_MASK_HEIGHT_COLLAPSE_END,
83
+ maskHeight,
84
+ minMaskHeight,
85
+ );
86
+ const maskCenterX = maskWidth / 2;
87
+ const maskCenterY = renderedMaskHeight / 2;
88
+ const contentCenterX = screenLayout.width / 2;
89
+ const contentCenterY = screenLayout.height / 2;
90
+ const maskOriginOffsetY = drag.isVerticalInverted
91
+ ? maskHeight - renderedMaskHeight
92
+ : 0;
93
+ const compensatedMaskTranslateX =
94
+ (maskRaw.translateX -
95
+ contentTransform.translateX +
96
+ (1 - contentTransform.scale) * (maskCenterX - contentCenterX)) /
97
+ contentTransform.scale;
98
+ const compensatedMaskTranslateY =
99
+ (maskRaw.translateY -
100
+ contentTransform.translateY +
101
+ maskOriginOffsetY +
102
+ (1 - contentTransform.scale) * (maskCenterY - contentCenterY)) /
103
+ contentTransform.scale;
104
+ const initialSourceBorderRadius = toNumber(
105
+ link.initialSource?.styles.borderRadius,
106
+ sourceBorderRadius,
107
+ );
108
+
109
+ return {
110
+ style: {
111
+ width: maskWidth,
112
+ height: renderedMaskHeight,
113
+ borderRadius: interpolate(
114
+ transitionProgress,
115
+ [0, 1],
116
+ [
117
+ initialSourceBorderRadius,
118
+ active.animating ? expandedBorderRadius : 0,
119
+ ],
120
+ "clamp",
121
+ ),
122
+ borderCurve: "continuous",
123
+ transform: [
124
+ { translateX: compensatedMaskTranslateX },
125
+ { translateY: compensatedMaskTranslateY },
126
+ { scale: 1 / contentTransform.scale },
127
+ ],
128
+ },
129
+ };
130
+ }
@@ -0,0 +1,74 @@
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
+
8
+ type ZoomContentTarget = Exclude<
9
+ BoundsNavigationZoomOptions["target"],
10
+ undefined
11
+ >;
12
+
13
+ export function getZoomContentTarget({
14
+ explicitTarget,
15
+ screenLayout,
16
+ link,
17
+ }: {
18
+ explicitTarget: BoundsNavigationZoomOptions["target"];
19
+ screenLayout: Layout;
20
+ link: BoundsLink;
21
+ }): ZoomContentTarget {
22
+ "worklet";
23
+
24
+ if (explicitTarget !== undefined) {
25
+ return explicitTarget;
26
+ }
27
+
28
+ const sourceBounds = link.source?.bounds;
29
+ const screenWidth = screenLayout.width;
30
+
31
+ if (!sourceBounds || sourceBounds.width <= 0 || screenWidth <= 0) {
32
+ return "fullscreen";
33
+ }
34
+
35
+ const height = (sourceBounds.height / sourceBounds.width) * screenWidth;
36
+
37
+ return {
38
+ x: 0,
39
+ y: 0,
40
+ pageX: 0,
41
+ pageY: 0,
42
+ width: screenWidth,
43
+ height,
44
+ };
45
+ }
46
+
47
+ export function resolveZoomTrackingContentTarget({
48
+ contentTarget,
49
+ link,
50
+ screenLayout,
51
+ }: {
52
+ contentTarget: ZoomContentTarget;
53
+ link: BoundsLink;
54
+ screenLayout: Layout;
55
+ }): MeasuredDimensions | undefined {
56
+ "worklet";
57
+
58
+ if (typeof contentTarget === "object") {
59
+ return contentTarget;
60
+ }
61
+
62
+ if (contentTarget === "bound") {
63
+ return link.destination?.bounds;
64
+ }
65
+
66
+ return {
67
+ x: 0,
68
+ y: 0,
69
+ pageX: 0,
70
+ pageY: 0,
71
+ width: screenLayout.width,
72
+ height: screenLayout.height,
73
+ };
74
+ }
@@ -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
- };