react-native-screen-transitions 3.4.0-alpha.1 → 3.4.0-alpha.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 (297) hide show
  1. package/README.md +11 -1109
  2. package/lib/commonjs/blank-stack/navigators/create-blank-stack-navigator.js +69 -2
  3. package/lib/commonjs/blank-stack/navigators/create-blank-stack-navigator.js.map +1 -1
  4. package/lib/commonjs/component-stack/navigators/create-component-stack-navigator.js +9 -0
  5. package/lib/commonjs/component-stack/navigators/create-component-stack-navigator.js.map +1 -1
  6. package/lib/commonjs/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js +195 -0
  7. package/lib/commonjs/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js.map +1 -0
  8. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-auto-source-measurement.js +7 -14
  9. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-auto-source-measurement.js.map +1 -1
  10. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.js +19 -18
  11. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.js.map +1 -1
  12. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.js +54 -0
  13. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.js.map +1 -0
  14. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-group-active-measurement.js +40 -8
  15. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-group-active-measurement.js.map +1 -1
  16. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.js +72 -0
  17. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.js.map +1 -0
  18. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-initial-layout-handler.js +16 -7
  19. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-initial-layout-handler.js.map +1 -1
  20. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-pending-destination-measurement.js +7 -4
  21. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-pending-destination-measurement.js.map +1 -1
  22. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.js +14 -15
  23. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.js.map +1 -1
  24. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.js +27 -9
  25. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.js.map +1 -1
  26. package/lib/commonjs/shared/components/create-boundary-component/index.js +23 -10
  27. package/lib/commonjs/shared/components/create-boundary-component/index.js.map +1 -1
  28. package/lib/commonjs/shared/components/create-transition-aware-component.js +4 -4
  29. package/lib/commonjs/shared/components/create-transition-aware-component.js.map +1 -1
  30. package/lib/commonjs/shared/components/native-screen-container.js +12 -6
  31. package/lib/commonjs/shared/components/native-screen-container.js.map +1 -1
  32. package/lib/commonjs/shared/components/native-screen.js +35 -8
  33. package/lib/commonjs/shared/components/native-screen.js.map +1 -1
  34. package/lib/commonjs/shared/components/screen-container/deferred-visibility-host.js +43 -0
  35. package/lib/commonjs/shared/components/screen-container/deferred-visibility-host.js.map +1 -0
  36. package/lib/commonjs/shared/components/screen-container/hooks/use-content-layout.js +60 -0
  37. package/lib/commonjs/shared/components/screen-container/hooks/use-content-layout.js.map +1 -0
  38. package/lib/commonjs/shared/components/screen-container/index.js +7 -4
  39. package/lib/commonjs/shared/components/screen-container/index.js.map +1 -1
  40. package/lib/commonjs/shared/components/screen-container/layers/content.js +32 -48
  41. package/lib/commonjs/shared/components/screen-container/layers/content.js.map +1 -1
  42. package/lib/commonjs/shared/components/screen-container/layers/maybe-masked-navigation-container.js +9 -20
  43. package/lib/commonjs/shared/components/screen-container/layers/maybe-masked-navigation-container.js.map +1 -1
  44. package/lib/commonjs/shared/configs/presets.js +6 -6
  45. package/lib/commonjs/shared/configs/presets.js.map +1 -1
  46. package/lib/commonjs/shared/constants.js +10 -4
  47. package/lib/commonjs/shared/constants.js.map +1 -1
  48. package/lib/commonjs/shared/hooks/animation/use-associated-style.js +9 -34
  49. package/lib/commonjs/shared/hooks/animation/use-associated-style.js.map +1 -1
  50. package/lib/commonjs/shared/index.js +4 -10
  51. package/lib/commonjs/shared/index.js.map +1 -1
  52. package/lib/commonjs/shared/providers/gestures/handlers/use-handlers.js +6 -7
  53. package/lib/commonjs/shared/providers/gestures/handlers/use-handlers.js.map +1 -1
  54. package/lib/commonjs/shared/providers/gestures/helpers/gesture-activation.js +11 -6
  55. package/lib/commonjs/shared/providers/gestures/helpers/gesture-activation.js.map +1 -1
  56. package/lib/commonjs/shared/providers/layout-anchor.provider.js +4 -6
  57. package/lib/commonjs/shared/providers/layout-anchor.provider.js.map +1 -1
  58. package/lib/commonjs/shared/providers/screen/animation/helpers/pipeline.js +14 -7
  59. package/lib/commonjs/shared/providers/screen/animation/helpers/pipeline.js.map +1 -1
  60. package/lib/commonjs/shared/providers/screen/helpers/resolve-interpolated-style-output.js +36 -0
  61. package/lib/commonjs/shared/providers/screen/helpers/resolve-interpolated-style-output.js.map +1 -0
  62. package/lib/commonjs/shared/providers/screen/styles.provider.js +31 -10
  63. package/lib/commonjs/shared/providers/screen/styles.provider.js.map +1 -1
  64. package/lib/commonjs/shared/providers/stack/core.provider.js +14 -21
  65. package/lib/commonjs/shared/providers/stack/core.provider.js.map +1 -1
  66. package/lib/commonjs/shared/stores/animation.store.js +3 -1
  67. package/lib/commonjs/shared/stores/animation.store.js.map +1 -1
  68. package/lib/commonjs/shared/stores/bounds/internals/presence.js.map +1 -1
  69. package/lib/commonjs/shared/utils/bounds/helpers/compute-bounds-styles.js +16 -7
  70. package/lib/commonjs/shared/utils/bounds/helpers/compute-bounds-styles.js.map +1 -1
  71. package/lib/commonjs/shared/utils/bounds/helpers/resolve-bound-tag.js +0 -5
  72. package/lib/commonjs/shared/utils/bounds/helpers/resolve-bound-tag.js.map +1 -1
  73. package/lib/commonjs/shared/utils/bounds/index.js +10 -0
  74. package/lib/commonjs/shared/utils/bounds/index.js.map +1 -1
  75. package/lib/commonjs/shared/utils/bounds/types/frame-props.js +6 -0
  76. package/lib/commonjs/shared/utils/bounds/types/frame-props.js.map +1 -0
  77. package/lib/commonjs/shared/utils/bounds/zoom/build.js +34 -31
  78. package/lib/commonjs/shared/utils/bounds/zoom/build.js.map +1 -1
  79. package/lib/commonjs/shared/utils/resolve-screen-transition-options.js +25 -0
  80. package/lib/commonjs/shared/utils/resolve-screen-transition-options.js.map +1 -0
  81. package/lib/module/blank-stack/navigators/create-blank-stack-navigator.js +69 -3
  82. package/lib/module/blank-stack/navigators/create-blank-stack-navigator.js.map +1 -1
  83. package/lib/module/component-stack/navigators/create-component-stack-navigator.js +9 -0
  84. package/lib/module/component-stack/navigators/create-component-stack-navigator.js.map +1 -1
  85. package/lib/module/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js +182 -0
  86. package/lib/module/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js.map +1 -0
  87. package/lib/module/shared/components/create-boundary-component/hooks/use-auto-source-measurement.js +7 -14
  88. package/lib/module/shared/components/create-boundary-component/hooks/use-auto-source-measurement.js.map +1 -1
  89. package/lib/module/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.js +19 -18
  90. package/lib/module/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.js.map +1 -1
  91. package/lib/module/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.js +49 -0
  92. package/lib/module/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.js.map +1 -0
  93. package/lib/module/shared/components/create-boundary-component/hooks/use-group-active-measurement.js +41 -8
  94. package/lib/module/shared/components/create-boundary-component/hooks/use-group-active-measurement.js.map +1 -1
  95. package/lib/module/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.js +67 -0
  96. package/lib/module/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.js.map +1 -0
  97. package/lib/module/shared/components/create-boundary-component/hooks/use-initial-layout-handler.js +16 -7
  98. package/lib/module/shared/components/create-boundary-component/hooks/use-initial-layout-handler.js.map +1 -1
  99. package/lib/module/shared/components/create-boundary-component/hooks/use-pending-destination-measurement.js +7 -4
  100. package/lib/module/shared/components/create-boundary-component/hooks/use-pending-destination-measurement.js.map +1 -1
  101. package/lib/module/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.js +14 -15
  102. package/lib/module/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.js.map +1 -1
  103. package/lib/module/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.js +27 -9
  104. package/lib/module/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.js.map +1 -1
  105. package/lib/module/shared/components/create-boundary-component/index.js +23 -10
  106. package/lib/module/shared/components/create-boundary-component/index.js.map +1 -1
  107. package/lib/module/shared/components/create-transition-aware-component.js +4 -4
  108. package/lib/module/shared/components/create-transition-aware-component.js.map +1 -1
  109. package/lib/module/shared/components/native-screen-container.js +12 -6
  110. package/lib/module/shared/components/native-screen-container.js.map +1 -1
  111. package/lib/module/shared/components/native-screen.js +35 -8
  112. package/lib/module/shared/components/native-screen.js.map +1 -1
  113. package/lib/module/shared/components/screen-container/deferred-visibility-host.js +38 -0
  114. package/lib/module/shared/components/screen-container/deferred-visibility-host.js.map +1 -0
  115. package/lib/module/shared/components/screen-container/hooks/use-content-layout.js +56 -0
  116. package/lib/module/shared/components/screen-container/hooks/use-content-layout.js.map +1 -0
  117. package/lib/module/shared/components/screen-container/index.js +7 -4
  118. package/lib/module/shared/components/screen-container/index.js.map +1 -1
  119. package/lib/module/shared/components/screen-container/layers/content.js +37 -53
  120. package/lib/module/shared/components/screen-container/layers/content.js.map +1 -1
  121. package/lib/module/shared/components/screen-container/layers/maybe-masked-navigation-container.js +10 -21
  122. package/lib/module/shared/components/screen-container/layers/maybe-masked-navigation-container.js.map +1 -1
  123. package/lib/module/shared/configs/presets.js +7 -7
  124. package/lib/module/shared/configs/presets.js.map +1 -1
  125. package/lib/module/shared/constants.js +9 -3
  126. package/lib/module/shared/constants.js.map +1 -1
  127. package/lib/module/shared/hooks/animation/use-associated-style.js +10 -35
  128. package/lib/module/shared/hooks/animation/use-associated-style.js.map +1 -1
  129. package/lib/module/shared/index.js +1 -1
  130. package/lib/module/shared/index.js.map +1 -1
  131. package/lib/module/shared/providers/gestures/handlers/use-handlers.js +6 -7
  132. package/lib/module/shared/providers/gestures/handlers/use-handlers.js.map +1 -1
  133. package/lib/module/shared/providers/gestures/helpers/gesture-activation.js +11 -6
  134. package/lib/module/shared/providers/gestures/helpers/gesture-activation.js.map +1 -1
  135. package/lib/module/shared/providers/layout-anchor.provider.js +4 -6
  136. package/lib/module/shared/providers/layout-anchor.provider.js.map +1 -1
  137. package/lib/module/shared/providers/screen/animation/helpers/pipeline.js +14 -7
  138. package/lib/module/shared/providers/screen/animation/helpers/pipeline.js.map +1 -1
  139. package/lib/module/shared/providers/screen/helpers/resolve-interpolated-style-output.js +31 -0
  140. package/lib/module/shared/providers/screen/helpers/resolve-interpolated-style-output.js.map +1 -0
  141. package/lib/module/shared/providers/screen/styles.provider.js +30 -11
  142. package/lib/module/shared/providers/screen/styles.provider.js.map +1 -1
  143. package/lib/module/shared/providers/stack/core.provider.js +14 -21
  144. package/lib/module/shared/providers/stack/core.provider.js.map +1 -1
  145. package/lib/module/shared/stores/animation.store.js +3 -1
  146. package/lib/module/shared/stores/animation.store.js.map +1 -1
  147. package/lib/module/shared/stores/bounds/internals/presence.js.map +1 -1
  148. package/lib/module/shared/utils/bounds/helpers/compute-bounds-styles.js +17 -8
  149. package/lib/module/shared/utils/bounds/helpers/compute-bounds-styles.js.map +1 -1
  150. package/lib/module/shared/utils/bounds/helpers/resolve-bound-tag.js +0 -5
  151. package/lib/module/shared/utils/bounds/helpers/resolve-bound-tag.js.map +1 -1
  152. package/lib/module/shared/utils/bounds/index.js +10 -0
  153. package/lib/module/shared/utils/bounds/index.js.map +1 -1
  154. package/lib/module/shared/utils/bounds/types/frame-props.js +4 -0
  155. package/lib/module/shared/utils/bounds/types/frame-props.js.map +1 -0
  156. package/lib/module/shared/utils/bounds/zoom/build.js +35 -32
  157. package/lib/module/shared/utils/bounds/zoom/build.js.map +1 -1
  158. package/lib/module/shared/utils/resolve-screen-transition-options.js +19 -0
  159. package/lib/module/shared/utils/resolve-screen-transition-options.js.map +1 -0
  160. package/lib/typescript/blank-stack/index.d.ts +1 -1
  161. package/lib/typescript/blank-stack/index.d.ts.map +1 -1
  162. package/lib/typescript/blank-stack/navigators/create-blank-stack-navigator.d.ts +29 -4
  163. package/lib/typescript/blank-stack/navigators/create-blank-stack-navigator.d.ts.map +1 -1
  164. package/lib/typescript/blank-stack/types.d.ts +33 -4
  165. package/lib/typescript/blank-stack/types.d.ts.map +1 -1
  166. package/lib/typescript/component-stack/navigators/create-component-stack-navigator.d.ts +8 -0
  167. package/lib/typescript/component-stack/navigators/create-component-stack-navigator.d.ts.map +1 -1
  168. package/lib/typescript/shared/components/create-boundary-component/hooks/helpers/measurement-rules.d.ts +81 -0
  169. package/lib/typescript/shared/components/create-boundary-component/hooks/helpers/measurement-rules.d.ts.map +1 -0
  170. package/lib/typescript/shared/components/create-boundary-component/hooks/use-auto-source-measurement.d.ts.map +1 -1
  171. package/lib/typescript/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.d.ts +2 -3
  172. package/lib/typescript/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.d.ts.map +1 -1
  173. package/lib/typescript/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.d.ts +11 -0
  174. package/lib/typescript/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.d.ts.map +1 -0
  175. package/lib/typescript/shared/components/create-boundary-component/hooks/use-group-active-measurement.d.ts +2 -2
  176. package/lib/typescript/shared/components/create-boundary-component/hooks/use-group-active-measurement.d.ts.map +1 -1
  177. package/lib/typescript/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.d.ts +11 -0
  178. package/lib/typescript/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.d.ts.map +1 -0
  179. package/lib/typescript/shared/components/create-boundary-component/hooks/use-initial-layout-handler.d.ts.map +1 -1
  180. package/lib/typescript/shared/components/create-boundary-component/hooks/use-pending-destination-measurement.d.ts.map +1 -1
  181. package/lib/typescript/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.d.ts +3 -3
  182. package/lib/typescript/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.d.ts.map +1 -1
  183. package/lib/typescript/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.d.ts +2 -2
  184. package/lib/typescript/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.d.ts.map +1 -1
  185. package/lib/typescript/shared/components/create-boundary-component/index.d.ts +5 -3
  186. package/lib/typescript/shared/components/create-boundary-component/index.d.ts.map +1 -1
  187. package/lib/typescript/shared/components/create-boundary-component/types.d.ts +2 -4
  188. package/lib/typescript/shared/components/create-boundary-component/types.d.ts.map +1 -1
  189. package/lib/typescript/shared/components/create-transition-aware-component.d.ts +1 -0
  190. package/lib/typescript/shared/components/create-transition-aware-component.d.ts.map +1 -1
  191. package/lib/typescript/shared/components/native-screen-container.d.ts.map +1 -1
  192. package/lib/typescript/shared/components/native-screen.d.ts.map +1 -1
  193. package/lib/typescript/shared/components/screen-container/deferred-visibility-host.d.ts +13 -0
  194. package/lib/typescript/shared/components/screen-container/deferred-visibility-host.d.ts.map +1 -0
  195. package/lib/typescript/shared/components/screen-container/hooks/use-content-layout.d.ts +3 -0
  196. package/lib/typescript/shared/components/screen-container/hooks/use-content-layout.d.ts.map +1 -0
  197. package/lib/typescript/shared/components/screen-container/index.d.ts.map +1 -1
  198. package/lib/typescript/shared/components/screen-container/layers/content.d.ts.map +1 -1
  199. package/lib/typescript/shared/components/screen-container/layers/maybe-masked-navigation-container.d.ts +3 -1
  200. package/lib/typescript/shared/components/screen-container/layers/maybe-masked-navigation-container.d.ts.map +1 -1
  201. package/lib/typescript/shared/configs/index.d.ts.map +1 -1
  202. package/lib/typescript/shared/constants.d.ts +9 -3
  203. package/lib/typescript/shared/constants.d.ts.map +1 -1
  204. package/lib/typescript/shared/hooks/animation/use-associated-style.d.ts +5 -11
  205. package/lib/typescript/shared/hooks/animation/use-associated-style.d.ts.map +1 -1
  206. package/lib/typescript/shared/index.d.ts +1 -2
  207. package/lib/typescript/shared/index.d.ts.map +1 -1
  208. package/lib/typescript/shared/providers/gestures/handlers/use-handlers.d.ts +1 -1
  209. package/lib/typescript/shared/providers/gestures/handlers/use-handlers.d.ts.map +1 -1
  210. package/lib/typescript/shared/providers/gestures/helpers/gesture-activation.d.ts.map +1 -1
  211. package/lib/typescript/shared/providers/layout-anchor.provider.d.ts +1 -1
  212. package/lib/typescript/shared/providers/layout-anchor.provider.d.ts.map +1 -1
  213. package/lib/typescript/shared/providers/screen/animation/helpers/pipeline.d.ts.map +1 -1
  214. package/lib/typescript/shared/providers/screen/helpers/resolve-interpolated-style-output.d.ts +10 -0
  215. package/lib/typescript/shared/providers/screen/helpers/resolve-interpolated-style-output.d.ts.map +1 -0
  216. package/lib/typescript/shared/providers/screen/styles.provider.d.ts +4 -2
  217. package/lib/typescript/shared/providers/screen/styles.provider.d.ts.map +1 -1
  218. package/lib/typescript/shared/providers/stack/core.provider.d.ts +2 -0
  219. package/lib/typescript/shared/providers/stack/core.provider.d.ts.map +1 -1
  220. package/lib/typescript/shared/stores/animation.store.d.ts +5 -3
  221. package/lib/typescript/shared/stores/animation.store.d.ts.map +1 -1
  222. package/lib/typescript/shared/stores/bounds/internals/presence.d.ts.map +1 -1
  223. package/lib/typescript/shared/types/animation.types.d.ts +13 -1
  224. package/lib/typescript/shared/types/animation.types.d.ts.map +1 -1
  225. package/lib/typescript/shared/types/screen.types.d.ts +51 -22
  226. package/lib/typescript/shared/types/screen.types.d.ts.map +1 -1
  227. package/lib/typescript/shared/utils/bounds/helpers/compute-bounds-styles.d.ts +11 -1
  228. package/lib/typescript/shared/utils/bounds/helpers/compute-bounds-styles.d.ts.map +1 -1
  229. package/lib/typescript/shared/utils/bounds/helpers/resolve-bound-tag.d.ts.map +1 -1
  230. package/lib/typescript/shared/utils/bounds/index.d.ts +2 -2
  231. package/lib/typescript/shared/utils/bounds/index.d.ts.map +1 -1
  232. package/lib/typescript/shared/utils/bounds/types/frame-props.d.ts +5 -0
  233. package/lib/typescript/shared/utils/bounds/types/frame-props.d.ts.map +1 -0
  234. package/lib/typescript/shared/utils/bounds/zoom/accessor.d.ts +4 -4
  235. package/lib/typescript/shared/utils/bounds/zoom/accessor.d.ts.map +1 -1
  236. package/lib/typescript/shared/utils/bounds/zoom/build.d.ts +2 -2
  237. package/lib/typescript/shared/utils/bounds/zoom/build.d.ts.map +1 -1
  238. package/lib/typescript/shared/utils/bounds/zoom/types.d.ts +3 -3
  239. package/lib/typescript/shared/utils/bounds/zoom/types.d.ts.map +1 -1
  240. package/lib/typescript/shared/utils/resolve-screen-transition-options.d.ts +5 -0
  241. package/lib/typescript/shared/utils/resolve-screen-transition-options.d.ts.map +1 -0
  242. package/package.json +2 -1
  243. package/src/blank-stack/index.ts +1 -0
  244. package/src/blank-stack/navigators/create-blank-stack-navigator.tsx +138 -19
  245. package/src/blank-stack/types.ts +33 -5
  246. package/src/component-stack/navigators/create-component-stack-navigator.tsx +8 -0
  247. package/src/shared/components/create-boundary-component/hooks/helpers/measurement-rules.ts +258 -0
  248. package/src/shared/components/create-boundary-component/hooks/use-auto-source-measurement.ts +7 -17
  249. package/src/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.ts +38 -28
  250. package/src/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.ts +58 -0
  251. package/src/shared/components/create-boundary-component/hooks/use-group-active-measurement.ts +41 -10
  252. package/src/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.ts +82 -0
  253. package/src/shared/components/create-boundary-component/hooks/use-initial-layout-handler.ts +24 -12
  254. package/src/shared/components/create-boundary-component/hooks/use-pending-destination-measurement.ts +11 -9
  255. package/src/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.ts +29 -26
  256. package/src/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.ts +26 -17
  257. package/src/shared/components/create-boundary-component/index.tsx +25 -7
  258. package/src/shared/components/create-boundary-component/types.ts +8 -4
  259. package/src/shared/components/create-transition-aware-component.tsx +5 -3
  260. package/src/shared/components/native-screen-container.tsx +11 -3
  261. package/src/shared/components/native-screen.tsx +65 -20
  262. package/src/shared/components/screen-container/deferred-visibility-host.tsx +37 -0
  263. package/src/shared/components/screen-container/hooks/use-content-layout.ts +82 -0
  264. package/src/shared/components/screen-container/index.tsx +5 -2
  265. package/src/shared/components/screen-container/layers/content.tsx +53 -80
  266. package/src/shared/components/screen-container/layers/maybe-masked-navigation-container.tsx +12 -27
  267. package/src/shared/configs/presets.ts +10 -10
  268. package/src/shared/constants.ts +5 -3
  269. package/src/shared/hooks/animation/use-associated-style.ts +10 -54
  270. package/src/shared/index.ts +2 -3
  271. package/src/shared/providers/gestures/handlers/use-handlers.ts +8 -5
  272. package/src/shared/providers/gestures/helpers/gesture-activation.ts +11 -6
  273. package/src/shared/providers/layout-anchor.provider.tsx +2 -5
  274. package/src/shared/providers/register-bounds.provider.tsx +1 -1
  275. package/src/shared/providers/screen/animation/helpers/pipeline.ts +24 -8
  276. package/src/shared/providers/screen/helpers/resolve-interpolated-style-output.ts +41 -0
  277. package/src/shared/providers/screen/styles.provider.tsx +95 -72
  278. package/src/shared/providers/stack/core.provider.tsx +27 -14
  279. package/src/shared/stores/animation.store.ts +11 -7
  280. package/src/shared/stores/bounds/internals/presence.ts +3 -1
  281. package/src/shared/types/animation.types.ts +13 -1
  282. package/src/shared/types/screen.types.ts +55 -22
  283. package/src/shared/utils/bounds/helpers/compute-bounds-styles.ts +17 -3
  284. package/src/shared/utils/bounds/helpers/resolve-bound-tag.ts +0 -6
  285. package/src/shared/utils/bounds/index.ts +16 -5
  286. package/src/shared/utils/bounds/types/frame-props.ts +5 -0
  287. package/src/shared/utils/bounds/zoom/accessor.ts +3 -3
  288. package/src/shared/utils/bounds/zoom/build.ts +46 -32
  289. package/src/shared/utils/bounds/zoom/types.ts +3 -3
  290. package/src/shared/utils/resolve-screen-transition-options.ts +37 -0
  291. package/lib/commonjs/shared/providers/viewport.provider.js +0 -33
  292. package/lib/commonjs/shared/providers/viewport.provider.js.map +0 -1
  293. package/lib/module/shared/providers/viewport.provider.js +0 -27
  294. package/lib/module/shared/providers/viewport.provider.js.map +0 -1
  295. package/lib/typescript/shared/providers/viewport.provider.d.ts +0 -13
  296. package/lib/typescript/shared/providers/viewport.provider.d.ts.map +0 -1
  297. package/src/shared/providers/viewport.provider.tsx +0 -39
@@ -5,12 +5,12 @@ import { StyleSheet } from "react-native";
5
5
  import { GestureHandlerRootView } from "react-native-gesture-handler";
6
6
  import { StackType } from "../../types/stack.types";
7
7
  import createProvider from "../../utils/create-provider";
8
- import { ViewportProvider } from "../viewport.provider";
9
8
 
10
9
  export interface StackCoreConfig {
11
10
  TRANSITIONS_ALWAYS_ON?: boolean;
12
11
  STACK_TYPE?: StackType;
13
12
  DISABLE_NATIVE_SCREENS?: boolean;
13
+ DISABLE_NATIVE_SCREEN_CONTAINER?: boolean;
14
14
  }
15
15
 
16
16
  interface StackCoreProviderProps {
@@ -23,6 +23,7 @@ export interface StackCoreContextValue {
23
23
  TRANSITIONS_ALWAYS_ON: boolean;
24
24
  STACK_TYPE?: StackType;
25
25
  DISABLE_NATIVE_SCREENS: boolean;
26
+ DISABLE_NATIVE_SCREEN_CONTAINER: boolean;
26
27
  };
27
28
  }
28
29
 
@@ -34,18 +35,27 @@ const { StackCoreProvider: InternalStackCoreProvider, useStackCoreContext } =
34
35
  const {
35
36
  TRANSITIONS_ALWAYS_ON = false,
36
37
  DISABLE_NATIVE_SCREENS = false,
38
+ DISABLE_NATIVE_SCREEN_CONTAINER = false,
37
39
  STACK_TYPE = StackType.BLANK,
38
40
  } = config;
39
41
 
40
42
  const flags = useMemo(
41
- () => ({ TRANSITIONS_ALWAYS_ON, STACK_TYPE, DISABLE_NATIVE_SCREENS }),
42
- [TRANSITIONS_ALWAYS_ON, STACK_TYPE, DISABLE_NATIVE_SCREENS],
43
+ () => ({
44
+ TRANSITIONS_ALWAYS_ON,
45
+ STACK_TYPE,
46
+ DISABLE_NATIVE_SCREENS,
47
+ DISABLE_NATIVE_SCREEN_CONTAINER,
48
+ }),
49
+ [
50
+ TRANSITIONS_ALWAYS_ON,
51
+ STACK_TYPE,
52
+ DISABLE_NATIVE_SCREENS,
53
+ DISABLE_NATIVE_SCREEN_CONTAINER,
54
+ ],
43
55
  );
44
56
 
45
- const value = useMemo(() => ({ flags }), [flags]);
46
-
47
57
  return {
48
- value,
58
+ value: { flags },
49
59
  children: (
50
60
  <GestureHandlerRootView
51
61
  style={styles.container}
@@ -53,9 +63,7 @@ const { StackCoreProvider: InternalStackCoreProvider, useStackCoreContext } =
53
63
  STACK_TYPE === StackType.COMPONENT ? "box-none" : undefined
54
64
  }
55
65
  >
56
- <SafeAreaProviderCompat>
57
- <ViewportProvider>{children}</ViewportProvider>
58
- </SafeAreaProviderCompat>
66
+ <SafeAreaProviderCompat>{children}</SafeAreaProviderCompat>
59
67
  </GestureHandlerRootView>
60
68
  ),
61
69
  };
@@ -71,16 +79,21 @@ export function withStackCore<TProps extends object>(
71
79
  ): React.FC<TProps & StackCoreConfig> {
72
80
  return function StackCoreWrapper({
73
81
  DISABLE_NATIVE_SCREENS,
82
+ DISABLE_NATIVE_SCREEN_CONTAINER,
74
83
  TRANSITIONS_ALWAYS_ON,
75
84
  STACK_TYPE,
76
85
  ...props
77
86
  }: TProps & StackCoreConfig) {
78
- // User props first, then defaultConfig overrides (config takes priority)
87
+ // Start from defaults, then apply explicit overrides from the caller.
79
88
  const config: StackCoreConfig = {
80
- ...(DISABLE_NATIVE_SCREENS !== undefined && { DISABLE_NATIVE_SCREENS }),
81
- ...(TRANSITIONS_ALWAYS_ON !== undefined && { TRANSITIONS_ALWAYS_ON }),
82
- ...(STACK_TYPE !== undefined && { STACK_TYPE }),
83
- ...defaultConfig,
89
+ TRANSITIONS_ALWAYS_ON:
90
+ TRANSITIONS_ALWAYS_ON ?? defaultConfig.TRANSITIONS_ALWAYS_ON,
91
+ STACK_TYPE: STACK_TYPE ?? defaultConfig.STACK_TYPE,
92
+ DISABLE_NATIVE_SCREENS:
93
+ DISABLE_NATIVE_SCREENS ?? defaultConfig.DISABLE_NATIVE_SCREENS,
94
+ DISABLE_NATIVE_SCREEN_CONTAINER:
95
+ DISABLE_NATIVE_SCREEN_CONTAINER ??
96
+ defaultConfig.DISABLE_NATIVE_SCREEN_CONTAINER,
84
97
  };
85
98
  return (
86
99
  <InternalStackCoreProvider config={config}>
@@ -3,7 +3,7 @@ import {
3
3
  makeMutable,
4
4
  type SharedValue,
5
5
  } from "react-native-reanimated";
6
- import type { ScreenKey } from "../types/screen.types";
6
+ import type { Layout, ScreenKey } from "../types/screen.types";
7
7
 
8
8
  export type AnimationStoreMap = {
9
9
  progress: SharedValue<number>;
@@ -13,6 +13,8 @@ export type AnimationStoreMap = {
13
13
  targetProgress: SharedValue<number>;
14
14
  /** Resolved fraction (contentHeight / screenHeight) for the 'auto' snap point. -1 = not yet measured. */
15
15
  autoSnapPoint: SharedValue<number>;
16
+ /** Intrinsic content layout measured from the screen container wrapper. */
17
+ contentLayout: SharedValue<Layout | null>;
16
18
  };
17
19
 
18
20
  const store: Record<ScreenKey, AnimationStoreMap> = {};
@@ -25,6 +27,7 @@ function createAnimationBag(): AnimationStoreMap {
25
27
  entering: makeMutable(0),
26
28
  targetProgress: makeMutable(1),
27
29
  autoSnapPoint: makeMutable(-1),
30
+ contentLayout: makeMutable<Layout | null>(null),
28
31
  };
29
32
  }
30
33
 
@@ -43,17 +46,17 @@ function peekRouteAnimations(
43
46
  return store[routeKey];
44
47
  }
45
48
 
46
- function getRouteAnimation(
49
+ function getRouteAnimation<K extends keyof AnimationStoreMap>(
47
50
  routeKey: ScreenKey,
48
- type: keyof AnimationStoreMap,
49
- ): SharedValue<number> {
51
+ type: K,
52
+ ): AnimationStoreMap[K] {
50
53
  return ensure(routeKey)[type];
51
54
  }
52
55
 
53
- function getAnimation(
56
+ function getAnimation<K extends keyof AnimationStoreMap>(
54
57
  routeKey: ScreenKey,
55
- type: keyof AnimationStoreMap,
56
- ): SharedValue<number> {
58
+ type: K,
59
+ ): AnimationStoreMap[K] {
57
60
  return getRouteAnimation(routeKey, type);
58
61
  }
59
62
 
@@ -70,6 +73,7 @@ function clear(routeKey: ScreenKey) {
70
73
  cancelAnimation(bag.entering);
71
74
  cancelAnimation(bag.targetProgress);
72
75
  cancelAnimation(bag.autoSnapPoint);
76
+ cancelAnimation(bag.contentLayout);
73
77
  }
74
78
  delete store[routeKey];
75
79
  }
@@ -118,7 +118,9 @@ function setGroupActiveId(group: string, id: string) {
118
118
  groups.modify(<T extends GroupsState>(state: T): T => {
119
119
  "worklet";
120
120
  const mutableState = state as GroupsState;
121
- mutableState[group] = { activeId: id };
121
+ mutableState[group] = {
122
+ activeId: id,
123
+ };
122
124
  return state;
123
125
  });
124
126
  debugStoreSizeLog(`setGroupActiveId(${group},${id})`);
@@ -103,6 +103,13 @@ export interface ScreenInterpolationProps {
103
103
  * The `width` and `height` of the screen container.
104
104
  */
105
105
  screen: Layout;
106
+ /**
107
+ * The intrinsic measured content wrapper layout when available.
108
+ *
109
+ * This is currently populated for the measured screen-container path used by
110
+ * auto snap-point sizing. It is undefined until a real measurement exists.
111
+ */
112
+ content?: Layout;
106
113
  };
107
114
 
108
115
  /**
@@ -160,9 +167,14 @@ export interface ScreenInterpolationProps {
160
167
  inactive: ScreenTransitionState | undefined;
161
168
  }
162
169
 
170
+ /**
171
+ * Returning `null` explicitly defers rendering of the screen's visual subtree
172
+ * for the current frame. Returning an object applies transition styles
173
+ * immediately.
174
+ */
163
175
  export type ScreenStyleInterpolator = (
164
176
  props: ScreenInterpolationProps,
165
- ) => TransitionInterpolatedStyle;
177
+ ) => TransitionInterpolatedStyle | null;
166
178
 
167
179
  /**
168
180
  * Animated style properties with full autocomplete.
@@ -12,6 +12,9 @@ export type Layout = {
12
12
  };
13
13
 
14
14
  export type ScreenKey = string;
15
+ export type SheetScrollGestureBehavior =
16
+ | "expand-and-collapse"
17
+ | "collapse-only";
15
18
 
16
19
  /**
17
20
  * A single snap point value. Either a fraction of screen height (0–1) or
@@ -33,10 +36,13 @@ export type TransitionAwareProps<T extends object> = AnimatedProps<T> & {
33
36
  * </Transition.View>
34
37
  *
35
38
  * // In your screenStyleInterpolator:
36
- * return {
37
- * 'hero-image': {
38
- * opacity: interpolate(progress, [0, 1], [0, 1]),
39
- * transform: [{ scale: interpolate(progress, [0, 1], [0.8, 1]) }]
39
+ * screenStyleInterpolator: ({ progress }) => {
40
+ * "worklet";
41
+ * return {
42
+ * 'hero-image': {
43
+ * opacity: interpolate(progress, [0, 1], [0, 1]),
44
+ * transform: [{ scale: interpolate(progress, [0, 1], [0.8, 1]) }]
45
+ * }
40
46
  * }
41
47
  * }
42
48
  */
@@ -74,6 +80,11 @@ export type TransitionAwareProps<T extends object> = AnimatedProps<T> & {
74
80
  export type ScreenTransitionConfig = {
75
81
  /**
76
82
  * The user-provided function to calculate styles based on animation progress.
83
+ *
84
+ * Return `null` to explicitly defer rendering of the screen's visual subtree
85
+ * until a later frame. This is useful for transitions such as
86
+ * `bounds().navigation.zoom()` where the screen should stay hidden until the
87
+ * interpolator has enough state to produce a safe first frame.
77
88
  */
78
89
  screenStyleInterpolator?: ScreenStyleInterpolator;
79
90
 
@@ -87,6 +98,13 @@ export type ScreenTransitionConfig = {
87
98
  * (e.g. `bounds().navigation.zoom()`) is ready from the first frame.
88
99
  *
89
100
  * Requires `@react-native-masked-view/masked-view` to be installed.
101
+ *
102
+ * @default false
103
+ */
104
+ navigationMaskEnabled?: boolean;
105
+
106
+ /**
107
+ * @deprecated Use `navigationMaskEnabled` instead.
90
108
  */
91
109
  maskEnabled?: boolean;
92
110
 
@@ -209,16 +227,25 @@ export type ScreenTransitionConfig = {
209
227
  initialSnapIndex?: number;
210
228
 
211
229
  /**
212
- * Controls whether swiping to expand the sheet works from within a ScrollView.
213
- *
214
- * - `true` (Apple Maps style): Swiping up at scroll top expands the sheet
215
- * - `false` (Instagram style): Expand only works via deadspace (non-scrollable areas)
230
+ * Controls how nested scroll content hands gestures off to a snap sheet.
216
231
  *
217
- * Collapse (swipe down at scroll top) always works regardless of this setting.
232
+ * - `"expand-and-collapse"` (Apple Maps style): Swiping up at scroll boundary expands the sheet,
233
+ * and swiping down at scroll boundary collapses or dismisses it
234
+ * - `"collapse-only"` (Instagram style): Expand only works via deadspace; collapse/dismiss via
235
+ * nested scroll content still works at boundary
218
236
  *
219
237
  * Only applies to screens with `snapPoints` configured.
220
238
  *
221
- * @default true
239
+ * @default "expand-and-collapse"
240
+ */
241
+ sheetScrollGestureBehavior?: SheetScrollGestureBehavior;
242
+
243
+ /**
244
+ * @deprecated Use `sheetScrollGestureBehavior` instead.
245
+ *
246
+ * Mapping:
247
+ * - `true` -> `"expand-and-collapse"`
248
+ * - `false` -> `"collapse-only"`
222
249
  */
223
250
  expandViaScrollView?: boolean;
224
251
 
@@ -255,12 +282,15 @@ export type ScreenTransitionConfig = {
255
282
  *
256
283
  * @example
257
284
  * backdropComponent: BlurView,
258
- * screenStyleInterpolator: ({ progress }) => ({
259
- * backdrop: {
260
- * style: { opacity: interpolate(progress, [0, 1], [0, 1]) },
261
- * props: { intensity: interpolate(progress, [0, 1], [0, 80]) },
262
- * },
263
- * })
285
+ * screenStyleInterpolator: ({ progress }) => {
286
+ * "worklet";
287
+ * return {
288
+ * backdrop: {
289
+ * style: { opacity: interpolate(progress, [0, 1], [0, 1]) },
290
+ * props: { intensity: interpolate(progress, [0, 1], [0, 80]) },
291
+ * },
292
+ * };
293
+ * }
264
294
  *
265
295
  * @default undefined
266
296
  */
@@ -277,12 +307,15 @@ export type ScreenTransitionConfig = {
277
307
  *
278
308
  * @example
279
309
  * surfaceComponent: SquircleView,
280
- * screenStyleInterpolator: ({ progress }) => ({
281
- * surface: {
282
- * style: { opacity: interpolate(progress, [0, 1], [0, 1]) },
283
- * props: { cornerRadius: 24, cornerSmoothing: 0.7 },
284
- * },
285
- * })
310
+ * screenStyleInterpolator: ({ progress }) => {
311
+ * "worklet";
312
+ * return {
313
+ * surface: {
314
+ * style: { opacity: interpolate(progress, [0, 1], [0, 1]) },
315
+ * props: { cornerRadius: 24, cornerSmoothing: 0.7 },
316
+ * },
317
+ * };
318
+ * }
286
319
  *
287
320
  * @default undefined
288
321
  */
@@ -5,6 +5,7 @@ import {
5
5
  ENTER_RANGE,
6
6
  EXIT_RANGE,
7
7
  FULLSCREEN_DIMENSIONS,
8
+ HIDDEN_STYLE,
8
9
  } from "../../../constants";
9
10
  import {
10
11
  BoundStore,
@@ -73,6 +74,8 @@ const resolveBounds = (params: {
73
74
  currentScreenKey,
74
75
  sourceScreenKey: resolvedPair.sourceScreenKey,
75
76
  destinationScreenKey: resolvedPair.destinationScreenKey,
77
+ hasTargetOverride,
78
+ usedSnapshotDestination: resolvedPair.usedSnapshotDestination,
76
79
  };
77
80
  }
78
81
 
@@ -85,6 +88,8 @@ const resolveBounds = (params: {
85
88
  currentScreenKey,
86
89
  sourceScreenKey: resolvedPair.sourceScreenKey,
87
90
  destinationScreenKey: resolvedPair.destinationScreenKey,
91
+ hasTargetOverride,
92
+ usedSnapshotDestination: resolvedPair.usedSnapshotDestination,
88
93
  };
89
94
  }
90
95
 
@@ -107,6 +112,8 @@ const resolveBounds = (params: {
107
112
  currentScreenKey,
108
113
  sourceScreenKey: resolvedPair.sourceScreenKey,
109
114
  destinationScreenKey: resolvedPair.destinationScreenKey,
115
+ hasTargetOverride,
116
+ usedSnapshotDestination: resolvedPair.usedSnapshotDestination,
110
117
  };
111
118
  };
112
119
 
@@ -121,7 +128,7 @@ export const computeBoundStyles = (
121
128
  if (computeOptions.raw) {
122
129
  return EMPTY_BOUND_HELPER_RESULT_RAW;
123
130
  }
124
- return EMPTY_BOUND_HELPER_RESULT;
131
+ return HIDDEN_STYLE;
125
132
  }
126
133
 
127
134
  const {
@@ -131,6 +138,8 @@ export const computeBoundStyles = (
131
138
  currentScreenKey,
132
139
  sourceScreenKey,
133
140
  destinationScreenKey,
141
+ hasTargetOverride,
142
+ usedSnapshotDestination,
134
143
  } = resolveBounds({
135
144
  id,
136
145
  previous,
@@ -145,16 +154,21 @@ export const computeBoundStyles = (
145
154
  if (computeOptions.raw) {
146
155
  return EMPTY_BOUND_HELPER_RESULT_RAW;
147
156
  }
148
- return EMPTY_BOUND_HELPER_RESULT;
157
+ return HIDDEN_STYLE;
149
158
  }
150
159
 
151
160
  const ranges: readonly [number, number] = entering ? ENTER_RANGE : EXIT_RANGE;
152
161
 
153
162
  if (computeOptions.method === "content") {
163
+ const ignoresSnapshotDestinationOwnership =
164
+ hasTargetOverride &&
165
+ usedSnapshotDestination &&
166
+ destinationScreenKey === sourceScreenKey;
154
167
  const currentOwnsSource =
155
168
  !!currentScreenKey &&
156
169
  currentScreenKey === sourceScreenKey &&
157
- currentScreenKey !== destinationScreenKey;
170
+ (currentScreenKey !== destinationScreenKey ||
171
+ ignoresSnapshotDestinationOwnership);
158
172
  const contentStart = currentOwnsSource ? end : start;
159
173
  const contentEnd = currentOwnsSource ? start : end;
160
174
  const geometry = computeContentTransformGeometry({
@@ -1,4 +1,3 @@
1
- import { BoundStore } from "../../../stores/bounds";
2
1
  import type { BoundId } from "../types/options";
3
2
 
4
3
  export type ResolveBoundTagParams = {
@@ -20,10 +19,5 @@ export const resolveBoundTag = ({
20
19
  return normalizedId;
21
20
  }
22
21
 
23
- const currentActiveId = BoundStore.getGroupActiveId(group);
24
- if (currentActiveId !== normalizedId) {
25
- BoundStore.setGroupActiveId(group, normalizedId);
26
- }
27
-
28
22
  return `${group}:${normalizedId}`;
29
23
  };
@@ -6,11 +6,23 @@ import { computeBoundStyles } from "./helpers/compute-bounds-styles";
6
6
  import { createInterpolators } from "./helpers/interpolators";
7
7
  import { createLinkAccessor } from "./helpers/link-accessor";
8
8
  import { resolveBoundTag } from "./helpers/resolve-bound-tag";
9
+ import type { BoundsFrameProps } from "./types/frame-props";
9
10
  import type { BoundsOptions } from "./types/options";
10
11
  import { createZoomAccessor } from "./zoom";
11
12
 
13
+ const syncGroupActiveMember = (group?: string, id?: string | number) => {
14
+ "worklet";
15
+ if (!group) return;
16
+ if (id === undefined || id === null || id === "") return;
17
+
18
+ const normalizedId = String(id);
19
+ if (BoundStore.getGroupActiveId(group) === normalizedId) return;
20
+
21
+ BoundStore.setGroupActiveId(group, normalizedId);
22
+ };
23
+
12
24
  export const createBoundsAccessor = (
13
- getProps: () => Omit<ScreenInterpolationProps, "bounds">,
25
+ getProps: () => BoundsFrameProps,
14
26
  ): BoundsAccessor => {
15
27
  "worklet";
16
28
 
@@ -37,6 +49,7 @@ export const createBoundsAccessor = (
37
49
  const computeElementBoundsStyles = (params?: BoundsOptions) => {
38
50
  "worklet";
39
51
  const props = getProps();
52
+ syncGroupActiveMember(params?.group, params?.id);
40
53
 
41
54
  const resolved = buildBoundsOptions({
42
55
  props,
@@ -54,15 +67,13 @@ export const createBoundsAccessor = (
54
67
  scaleMode: params?.scaleMode,
55
68
  target: params?.target,
56
69
  };
57
- let cachedNavigationPairProps:
58
- | Omit<ScreenInterpolationProps, "bounds">
59
- | undefined;
70
+ let cachedNavigationPairProps: BoundsFrameProps | undefined;
60
71
  let cachedNavigationPairTag = "";
61
72
  let cachedNavigationPair: ResolvedTransitionPair | undefined;
62
73
 
63
74
  const resolveNavigationPair = (
64
75
  tag: string,
65
- frameProps: Omit<ScreenInterpolationProps, "bounds">,
76
+ frameProps: BoundsFrameProps,
66
77
  ): ResolvedTransitionPair | undefined => {
67
78
  "worklet";
68
79
  if (!tag) return undefined;
@@ -0,0 +1,5 @@
1
+ import type { ScreenInterpolationProps } from "../../../types/animation.types";
2
+
3
+ export type BoundsFrameProps = Omit<ScreenInterpolationProps, "bounds"> & {
4
+ navigationMaskEnabled: boolean;
5
+ };
@@ -1,17 +1,17 @@
1
- import type { ScreenInterpolationProps } from "../../../types/animation.types";
2
1
  import type { BoundsNavigationZoomOptions } from "../../../types/bounds.types";
3
2
  import type { ResolveBoundTagParams } from "../helpers/resolve-bound-tag";
3
+ import type { BoundsFrameProps } from "../types/frame-props";
4
4
  import type { BoundId, BoundsOptions } from "../types/options";
5
5
  import { buildZoomStyles } from "./build";
6
6
 
7
7
  type ZoomAccessorParams = {
8
8
  id?: BoundId;
9
9
  group?: string;
10
- getProps: () => Omit<ScreenInterpolationProps, "bounds">;
10
+ getProps: () => BoundsFrameProps;
11
11
  resolveBoundTag: (params: ResolveBoundTagParams) => string | undefined;
12
12
  computeRaw: (
13
13
  overrides?: Partial<BoundsOptions>,
14
- frameProps?: Omit<ScreenInterpolationProps, "bounds">,
14
+ frameProps?: BoundsFrameProps,
15
15
  ) => Record<string, unknown>;
16
16
  zoomBaseOptions?: Pick<
17
17
  BoundsNavigationZoomOptions,
@@ -1,15 +1,19 @@
1
1
  import { interpolate, type StyleProps } from "react-native-reanimated";
2
2
  import {
3
3
  EPSILON,
4
- NAVIGATION_CONTAINER_STYLE_ID,
5
- NAVIGATION_MASK_STYLE_ID,
6
- NO_STYLES,
4
+ HIDDEN_STYLE,
5
+ NAVIGATION_MASK_CONTAINER_STYLE_ID,
6
+ NAVIGATION_MASK_ELEMENT_STYLE_ID,
7
+ VISIBLE_STYLE,
7
8
  } from "../../../constants";
8
9
  import {
9
10
  BoundStore,
10
11
  type ResolvedTransitionPair,
11
12
  } from "../../../stores/bounds";
12
- import type { TransitionInterpolatedStyle } from "../../../types/animation.types";
13
+ import type {
14
+ ScreenStyleInterpolator,
15
+ TransitionInterpolatedStyle,
16
+ } from "../../../types/animation.types";
13
17
  import type { BoundsNavigationZoomOptions } from "../../../types/bounds.types";
14
18
  import type { Layout } from "../../../types/screen.types";
15
19
  import type { BoundsOptions } from "../types/options";
@@ -449,7 +453,7 @@ export const buildZoomStyles = ({
449
453
  props,
450
454
  resolveTag,
451
455
  computeRaw,
452
- }: BuildZoomStylesParams): TransitionInterpolatedStyle => {
456
+ }: BuildZoomStylesParams): ReturnType<ScreenStyleInterpolator> => {
453
457
  "worklet";
454
458
 
455
459
  const focused = props.focused;
@@ -459,6 +463,12 @@ export const buildZoomStyles = ({
459
463
  const nextRouteKey = props.next?.route.key;
460
464
  const entering = !props.next;
461
465
  const screenLayout = props.layouts.screen;
466
+ const transitionContext = {
467
+ currentScreenKey: currentRouteKey,
468
+ previousScreenKey: previousRouteKey,
469
+ nextScreenKey: nextRouteKey,
470
+ entering,
471
+ };
462
472
 
463
473
  const resolvedConfig = resolveZoomConfig({
464
474
  id,
@@ -469,7 +479,7 @@ export const buildZoomStyles = ({
469
479
  defaultAnchor: "top",
470
480
  });
471
481
 
472
- if (!resolvedConfig) return NO_STYLES;
482
+ if (!resolvedConfig) return null;
473
483
 
474
484
  const {
475
485
  resolvedTag,
@@ -478,6 +488,21 @@ export const buildZoomStyles = ({
478
488
  zoomOptions: resolvedZoomOptions,
479
489
  } = resolvedConfig;
480
490
 
491
+ const resolvedPair = BoundStore.resolveTransitionPair(
492
+ resolvedTag,
493
+ transitionContext,
494
+ );
495
+
496
+ const focusedVisibilityStyles = {
497
+ [resolvedTag]: VISIBLE_STYLE,
498
+ } satisfies TransitionInterpolatedStyle;
499
+
500
+ if (!resolvedPair.sourceBounds) {
501
+ return {
502
+ [NAVIGATION_MASK_CONTAINER_STYLE_ID]: HIDDEN_STYLE,
503
+ };
504
+ }
505
+
481
506
  const normX = props.active.gesture.normX;
482
507
  const normY = props.active.gesture.normY;
483
508
  const initialDirection = props.active.gesture.direction;
@@ -519,13 +544,6 @@ export const buildZoomStyles = ({
519
544
  const dragScale = combineScales(dragXScale, dragYScale);
520
545
 
521
546
  if (focused) {
522
- const focusedPair = BoundStore.resolveTransitionPair(resolvedTag, {
523
- currentScreenKey: currentRouteKey,
524
- previousScreenKey: previousRouteKey,
525
- nextScreenKey: nextRouteKey,
526
- entering,
527
- });
528
-
529
547
  const contentTarget = getZoomContentTarget({
530
548
  explicitTarget,
531
549
  resolvedTag,
@@ -535,7 +553,7 @@ export const buildZoomStyles = ({
535
553
  entering,
536
554
  screenLayout,
537
555
  anchor: sharedOptions.anchor,
538
- resolvedPair: focusedPair,
556
+ resolvedPair,
539
557
  });
540
558
 
541
559
  const contentRaw = computeRaw({
@@ -565,21 +583,22 @@ export const buildZoomStyles = ({
565
583
  const maskRadii = resolveMaskRadii({
566
584
  progress,
567
585
  zoomOptions: resolvedZoomOptions,
568
- resolvedPair: focusedPair,
586
+ resolvedPair,
569
587
  });
588
+ const focusedContentStyle = {
589
+ opacity: focusedFade,
590
+ transform: [
591
+ { translateX: contentTranslateX },
592
+ { translateY: contentTranslateY },
593
+ { scale: contentScale },
594
+ ],
595
+ };
570
596
 
571
597
  return {
572
- [NAVIGATION_CONTAINER_STYLE_ID]: {
573
- style: {
574
- opacity: focusedFade,
575
- transform: [
576
- { translateX: contentTranslateX },
577
- { translateY: contentTranslateY },
578
- { scale: contentScale },
579
- ],
580
- },
598
+ [NAVIGATION_MASK_CONTAINER_STYLE_ID]: {
599
+ style: focusedContentStyle,
581
600
  },
582
- [NAVIGATION_MASK_STYLE_ID]: {
601
+ [NAVIGATION_MASK_ELEMENT_STYLE_ID]: {
583
602
  style: {
584
603
  width: maskWidth,
585
604
  height: maskHeight,
@@ -598,13 +617,7 @@ export const buildZoomStyles = ({
598
617
  : {}),
599
618
  },
600
619
  },
601
- // Signal the destination boundary to stay visible during the transition.
602
- // Without this, useAssociatedStyles enters "waiting-first-style" mode
603
- // (opacity: 0) because it detects previous-screen evidence but never
604
- // receives a resolved style for this tag.
605
- [resolvedTag]: {
606
- style: { opacity: 1 },
607
- },
620
+ ...focusedVisibilityStyles,
608
621
  };
609
622
  }
610
623
 
@@ -626,6 +639,7 @@ export const buildZoomStyles = ({
626
639
  entering,
627
640
  screenLayout,
628
641
  anchor: sharedOptions.anchor,
642
+ resolvedPair,
629
643
  });
630
644
 
631
645
  const elementRaw = computeRaw({
@@ -1,5 +1,5 @@
1
- import type { ScreenInterpolationProps } from "../../../types/animation.types";
2
1
  import type { BoundsNavigationZoomOptions } from "../../../types/bounds.types";
2
+ import type { BoundsFrameProps } from "../types/frame-props";
3
3
  import type { BoundId, BoundsOptions } from "../types/options";
4
4
 
5
5
  export type ResolveTag = (params: {
@@ -9,14 +9,14 @@ export type ResolveTag = (params: {
9
9
 
10
10
  export type ComputeRaw = (
11
11
  overrides: Partial<BoundsOptions>,
12
- frameProps?: Omit<ScreenInterpolationProps, "bounds">,
12
+ frameProps?: BoundsFrameProps,
13
13
  ) => Record<string, unknown>;
14
14
 
15
15
  export type BuildZoomStylesParams = {
16
16
  id: BoundId;
17
17
  group?: string;
18
18
  zoomOptions?: BoundsNavigationZoomOptions;
19
- props: Omit<ScreenInterpolationProps, "bounds">;
19
+ props: BoundsFrameProps;
20
20
  resolveTag: ResolveTag;
21
21
  computeRaw: ComputeRaw;
22
22
  };