react-native-screen-transitions 3.9.0-beta.0 → 3.9.0-beta.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 (350) hide show
  1. package/lib/commonjs/shared/adapters/with-screen-transitions/index.js +20 -4
  2. package/lib/commonjs/shared/adapters/with-screen-transitions/index.js.map +1 -1
  3. package/lib/commonjs/shared/animation/transition-blocking.js +71 -0
  4. package/lib/commonjs/shared/animation/transition-blocking.js.map +1 -0
  5. package/lib/commonjs/shared/components/boundary/components/boundary-target.js +30 -30
  6. package/lib/commonjs/shared/components/boundary/components/boundary-target.js.map +1 -1
  7. package/lib/commonjs/shared/components/boundary/create-boundary-component.js +30 -95
  8. package/lib/commonjs/shared/components/boundary/create-boundary-component.js.map +1 -1
  9. package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js +68 -51
  10. package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js.map +1 -1
  11. package/lib/commonjs/shared/components/boundary/hooks/use-boundary-measurement.js +1 -0
  12. package/lib/commonjs/shared/components/boundary/hooks/use-boundary-measurement.js.map +1 -1
  13. package/lib/commonjs/shared/components/boundary/hooks/use-measurer.js +14 -2
  14. package/lib/commonjs/shared/components/boundary/hooks/use-measurer.js.map +1 -1
  15. package/lib/commonjs/shared/components/boundary/hooks/use-register-target.js +32 -0
  16. package/lib/commonjs/shared/components/boundary/hooks/use-register-target.js.map +1 -0
  17. package/lib/commonjs/shared/components/boundary/index.js +1 -1
  18. package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/components/host.js +40 -0
  19. package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/components/host.js.map +1 -0
  20. package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/helpers/host-name.js +14 -0
  21. package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/helpers/host-name.js.map +1 -0
  22. package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js +194 -0
  23. package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js.map +1 -0
  24. package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/index.js +44 -0
  25. package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/index.js.map +1 -0
  26. package/lib/commonjs/shared/components/boundary/portal/components/{host.js → boundary-portal/components/host.js} +17 -16
  27. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/components/host.js.map +1 -0
  28. package/lib/commonjs/shared/components/boundary/portal/components/{portal-boundary-host.js → boundary-portal/components/portal-boundary-host.js} +11 -11
  29. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.js.map +1 -0
  30. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/components/portal-slot.js +52 -0
  31. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/components/portal-slot.js.map +1 -0
  32. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/helpers/has-local-slot.js.map +1 -0
  33. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/helpers/host-name.js +14 -0
  34. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/helpers/host-name.js.map +1 -0
  35. package/lib/commonjs/shared/components/boundary/portal/{utils → components/boundary-portal/helpers}/offset-style.js +1 -1
  36. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/helpers/offset-style.js.map +1 -0
  37. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js +184 -0
  38. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js.map +1 -0
  39. package/lib/commonjs/shared/components/boundary/portal/{hooks → components/boundary-portal/hooks}/use-host-measurement.js +23 -5
  40. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/hooks/use-host-measurement.js.map +1 -0
  41. package/lib/commonjs/shared/components/boundary/portal/{hooks → components/boundary-portal/hooks}/use-placeholder-styles.js +3 -6
  42. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/hooks/use-placeholder-styles.js.map +1 -0
  43. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/index.js +33 -0
  44. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/index.js.map +1 -0
  45. package/lib/commonjs/shared/components/boundary/portal/{stores → components/boundary-portal/stores}/host-bounds.store.js +1 -1
  46. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/stores/host-bounds.store.js.map +1 -0
  47. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/stores/host-registry.store.js.map +1 -0
  48. package/lib/commonjs/shared/components/boundary/portal/{stores → components/boundary-portal/stores}/portal-boundary-host.store.js +7 -12
  49. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/stores/portal-boundary-host.store.js.map +1 -0
  50. package/lib/commonjs/shared/components/boundary/portal/index.js +1 -8
  51. package/lib/commonjs/shared/components/boundary/portal/index.js.map +1 -1
  52. package/lib/commonjs/shared/components/boundary/portal/teleport.js +2 -2
  53. package/lib/commonjs/shared/components/boundary/portal/utils/naming.js +1 -15
  54. package/lib/commonjs/shared/components/boundary/portal/utils/naming.js.map +1 -1
  55. package/lib/commonjs/shared/components/boundary/portal/utils/ownership.js +19 -56
  56. package/lib/commonjs/shared/components/boundary/portal/utils/ownership.js.map +1 -1
  57. package/lib/commonjs/shared/components/boundary/providers/boundary-root.provider.js +77 -23
  58. package/lib/commonjs/shared/components/boundary/providers/boundary-root.provider.js.map +1 -1
  59. package/lib/commonjs/shared/components/boundary/utils/destination-signals.js +41 -12
  60. package/lib/commonjs/shared/components/boundary/utils/destination-signals.js.map +1 -1
  61. package/lib/commonjs/shared/components/boundary/utils/measured-bounds.js +36 -1
  62. package/lib/commonjs/shared/components/boundary/utils/measured-bounds.js.map +1 -1
  63. package/lib/commonjs/shared/components/screen-container/layers/content.js +1 -1
  64. package/lib/commonjs/shared/configs/presets.js +2 -2
  65. package/lib/commonjs/shared/configs/presets.js.map +1 -1
  66. package/lib/commonjs/shared/index.js +13 -0
  67. package/lib/commonjs/shared/index.js.map +1 -1
  68. package/lib/commonjs/shared/providers/screen/animation/helpers/read-screen-animation-revisions.js +6 -1
  69. package/lib/commonjs/shared/providers/screen/animation/helpers/read-screen-animation-revisions.js.map +1 -1
  70. package/lib/commonjs/shared/providers/screen/styles/helpers/collect-interpolator-shared-values.js +50 -0
  71. package/lib/commonjs/shared/providers/screen/styles/helpers/collect-interpolator-shared-values.js.map +1 -0
  72. package/lib/commonjs/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js +7 -1
  73. package/lib/commonjs/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js.map +1 -1
  74. package/lib/commonjs/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js +2 -1
  75. package/lib/commonjs/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js.map +1 -1
  76. package/lib/commonjs/shared/providers/screen/styles/slot.provider.js +5 -3
  77. package/lib/commonjs/shared/providers/screen/styles/slot.provider.js.map +1 -1
  78. package/lib/commonjs/shared/providers/screen/styles/stores/slot-references.store.js +1 -1
  79. package/lib/commonjs/shared/providers/screen/styles/stores/slot-references.store.js.map +1 -1
  80. package/lib/commonjs/shared/stores/system.store.js +10 -2
  81. package/lib/commonjs/shared/stores/system.store.js.map +1 -1
  82. package/lib/commonjs/shared/utils/bounds/helpers/create-bounds-accessor-core.js +15 -9
  83. package/lib/commonjs/shared/utils/bounds/helpers/create-bounds-accessor-core.js.map +1 -1
  84. package/lib/commonjs/shared/utils/bounds/navigation/reveal/build.js +2 -2
  85. package/lib/commonjs/shared/utils/bounds/navigation/reveal/build.js.map +1 -1
  86. package/lib/commonjs/shared/utils/bounds/navigation/zoom/build.js +3 -3
  87. package/lib/commonjs/shared/utils/bounds/navigation/zoom/build.js.map +1 -1
  88. package/lib/module/shared/adapters/with-screen-transitions/index.js +19 -5
  89. package/lib/module/shared/adapters/with-screen-transitions/index.js.map +1 -1
  90. package/lib/module/shared/animation/transition-blocking.js +66 -0
  91. package/lib/module/shared/animation/transition-blocking.js.map +1 -0
  92. package/lib/module/shared/components/boundary/components/boundary-target.js +32 -32
  93. package/lib/module/shared/components/boundary/components/boundary-target.js.map +1 -1
  94. package/lib/module/shared/components/boundary/create-boundary-component.js +32 -97
  95. package/lib/module/shared/components/boundary/create-boundary-component.js.map +1 -1
  96. package/lib/module/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js +72 -55
  97. package/lib/module/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js.map +1 -1
  98. package/lib/module/shared/components/boundary/hooks/use-boundary-measurement.js +1 -0
  99. package/lib/module/shared/components/boundary/hooks/use-boundary-measurement.js.map +1 -1
  100. package/lib/module/shared/components/boundary/hooks/use-measurer.js +15 -3
  101. package/lib/module/shared/components/boundary/hooks/use-measurer.js.map +1 -1
  102. package/lib/module/shared/components/boundary/hooks/use-register-target.js +27 -0
  103. package/lib/module/shared/components/boundary/hooks/use-register-target.js.map +1 -0
  104. package/lib/module/shared/components/boundary/index.js +1 -1
  105. package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/components/host.js +35 -0
  106. package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/components/host.js.map +1 -0
  107. package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/helpers/host-name.js +9 -0
  108. package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/helpers/host-name.js.map +1 -0
  109. package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js +189 -0
  110. package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js.map +1 -0
  111. package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/index.js +33 -0
  112. package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/index.js.map +1 -0
  113. package/lib/module/shared/components/boundary/portal/components/{host.js → boundary-portal/components/host.js} +17 -16
  114. package/lib/module/shared/components/boundary/portal/components/boundary-portal/components/host.js.map +1 -0
  115. package/lib/module/shared/components/boundary/portal/components/{portal-boundary-host.js → boundary-portal/components/portal-boundary-host.js} +11 -11
  116. package/lib/module/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.js.map +1 -0
  117. package/lib/module/shared/components/boundary/portal/components/boundary-portal/components/portal-slot.js +47 -0
  118. package/lib/module/shared/components/boundary/portal/components/boundary-portal/components/portal-slot.js.map +1 -0
  119. package/lib/module/shared/components/boundary/portal/components/boundary-portal/helpers/has-local-slot.js.map +1 -0
  120. package/lib/module/shared/components/boundary/portal/components/boundary-portal/helpers/host-name.js +9 -0
  121. package/lib/module/shared/components/boundary/portal/components/boundary-portal/helpers/host-name.js.map +1 -0
  122. package/lib/module/shared/components/boundary/portal/{utils → components/boundary-portal/helpers}/offset-style.js +1 -1
  123. package/lib/module/shared/components/boundary/portal/components/boundary-portal/helpers/offset-style.js.map +1 -0
  124. package/lib/module/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js +179 -0
  125. package/lib/module/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js.map +1 -0
  126. package/lib/module/shared/components/boundary/portal/{hooks → components/boundary-portal/hooks}/use-host-measurement.js +23 -5
  127. package/lib/module/shared/components/boundary/portal/components/boundary-portal/hooks/use-host-measurement.js.map +1 -0
  128. package/lib/module/shared/components/boundary/portal/{hooks → components/boundary-portal/hooks}/use-placeholder-styles.js +3 -6
  129. package/lib/module/shared/components/boundary/portal/components/boundary-portal/hooks/use-placeholder-styles.js.map +1 -0
  130. package/lib/module/shared/components/boundary/portal/components/boundary-portal/index.js +29 -0
  131. package/lib/module/shared/components/boundary/portal/components/boundary-portal/index.js.map +1 -0
  132. package/lib/module/shared/components/boundary/portal/{stores → components/boundary-portal/stores}/host-bounds.store.js +1 -1
  133. package/lib/module/shared/components/boundary/portal/components/boundary-portal/stores/host-bounds.store.js.map +1 -0
  134. package/lib/module/shared/components/boundary/portal/components/boundary-portal/stores/host-registry.store.js.map +1 -0
  135. package/lib/module/shared/components/boundary/portal/{stores → components/boundary-portal/stores}/portal-boundary-host.store.js +5 -10
  136. package/lib/module/shared/components/boundary/portal/components/boundary-portal/stores/portal-boundary-host.store.js.map +1 -0
  137. package/lib/module/shared/components/boundary/portal/index.js +1 -2
  138. package/lib/module/shared/components/boundary/portal/index.js.map +1 -1
  139. package/lib/module/shared/components/boundary/portal/teleport.js +2 -2
  140. package/lib/module/shared/components/boundary/portal/utils/naming.js +0 -12
  141. package/lib/module/shared/components/boundary/portal/utils/naming.js.map +1 -1
  142. package/lib/module/shared/components/boundary/portal/utils/ownership.js +16 -52
  143. package/lib/module/shared/components/boundary/portal/utils/ownership.js.map +1 -1
  144. package/lib/module/shared/components/boundary/providers/boundary-root.provider.js +74 -20
  145. package/lib/module/shared/components/boundary/providers/boundary-root.provider.js.map +1 -1
  146. package/lib/module/shared/components/boundary/utils/destination-signals.js +39 -10
  147. package/lib/module/shared/components/boundary/utils/destination-signals.js.map +1 -1
  148. package/lib/module/shared/components/boundary/utils/measured-bounds.js +34 -0
  149. package/lib/module/shared/components/boundary/utils/measured-bounds.js.map +1 -1
  150. package/lib/module/shared/components/screen-container/layers/content.js +1 -1
  151. package/lib/module/shared/components/screen-container/layers/content.js.map +1 -1
  152. package/lib/module/shared/configs/presets.js +2 -2
  153. package/lib/module/shared/configs/presets.js.map +1 -1
  154. package/lib/module/shared/index.js +1 -0
  155. package/lib/module/shared/index.js.map +1 -1
  156. package/lib/module/shared/providers/screen/animation/helpers/read-screen-animation-revisions.js +6 -1
  157. package/lib/module/shared/providers/screen/animation/helpers/read-screen-animation-revisions.js.map +1 -1
  158. package/lib/module/shared/providers/screen/styles/helpers/collect-interpolator-shared-values.js +45 -0
  159. package/lib/module/shared/providers/screen/styles/helpers/collect-interpolator-shared-values.js.map +1 -0
  160. package/lib/module/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js +7 -1
  161. package/lib/module/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js.map +1 -1
  162. package/lib/module/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js +2 -1
  163. package/lib/module/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js.map +1 -1
  164. package/lib/module/shared/providers/screen/styles/slot.provider.js +5 -3
  165. package/lib/module/shared/providers/screen/styles/slot.provider.js.map +1 -1
  166. package/lib/module/shared/providers/screen/styles/stores/slot-references.store.js +1 -1
  167. package/lib/module/shared/providers/screen/styles/stores/slot-references.store.js.map +1 -1
  168. package/lib/module/shared/stores/system.store.js +10 -2
  169. package/lib/module/shared/stores/system.store.js.map +1 -1
  170. package/lib/module/shared/utils/bounds/helpers/create-bounds-accessor-core.js +15 -9
  171. package/lib/module/shared/utils/bounds/helpers/create-bounds-accessor-core.js.map +1 -1
  172. package/lib/module/shared/utils/bounds/navigation/reveal/build.js +2 -2
  173. package/lib/module/shared/utils/bounds/navigation/reveal/build.js.map +1 -1
  174. package/lib/module/shared/utils/bounds/navigation/zoom/build.js +3 -3
  175. package/lib/module/shared/utils/bounds/navigation/zoom/build.js.map +1 -1
  176. package/lib/typescript/shared/adapters/with-screen-transitions/index.d.ts +4 -1
  177. package/lib/typescript/shared/adapters/with-screen-transitions/index.d.ts.map +1 -1
  178. package/lib/typescript/shared/animation/transition-blocking.d.ts +33 -0
  179. package/lib/typescript/shared/animation/transition-blocking.d.ts.map +1 -0
  180. package/lib/typescript/shared/components/boundary/components/boundary-target.d.ts.map +1 -1
  181. package/lib/typescript/shared/components/boundary/create-boundary-component.d.ts.map +1 -1
  182. package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.d.ts +2 -1
  183. package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.d.ts.map +1 -1
  184. package/lib/typescript/shared/components/boundary/hooks/use-boundary-measurement.d.ts.map +1 -1
  185. package/lib/typescript/shared/components/boundary/hooks/use-measurer.d.ts.map +1 -1
  186. package/lib/typescript/shared/components/boundary/hooks/use-register-target.d.ts +10 -0
  187. package/lib/typescript/shared/components/boundary/hooks/use-register-target.d.ts.map +1 -0
  188. package/lib/typescript/shared/components/boundary/index.d.ts +2 -2
  189. package/lib/typescript/shared/components/boundary/portal/components/boundary-content-portal/components/host.d.ts +10 -0
  190. package/lib/typescript/shared/components/boundary/portal/components/boundary-content-portal/components/host.d.ts.map +1 -0
  191. package/lib/typescript/shared/components/boundary/portal/components/boundary-content-portal/helpers/host-name.d.ts +2 -0
  192. package/lib/typescript/shared/components/boundary/portal/components/boundary-content-portal/helpers/host-name.d.ts.map +1 -0
  193. package/lib/typescript/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.d.ts +12 -0
  194. package/lib/typescript/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.d.ts.map +1 -0
  195. package/lib/typescript/shared/components/boundary/portal/components/boundary-content-portal/index.d.ts +11 -0
  196. package/lib/typescript/shared/components/boundary/portal/components/boundary-content-portal/index.d.ts.map +1 -0
  197. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/components/host.d.ts.map +1 -0
  198. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.d.ts.map +1 -0
  199. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/components/portal-slot.d.ts +14 -0
  200. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/components/portal-slot.d.ts.map +1 -0
  201. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/helpers/has-local-slot.d.ts +3 -0
  202. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/helpers/has-local-slot.d.ts.map +1 -0
  203. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/helpers/host-name.d.ts +2 -0
  204. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/helpers/host-name.d.ts.map +1 -0
  205. package/lib/typescript/shared/components/boundary/portal/{utils → components/boundary-portal/helpers}/offset-style.d.ts +1 -1
  206. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/helpers/offset-style.d.ts.map +1 -0
  207. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.d.ts +12 -0
  208. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.d.ts.map +1 -0
  209. package/lib/typescript/shared/components/boundary/portal/{hooks → components/boundary-portal/hooks}/use-host-measurement.d.ts +5 -1
  210. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/hooks/use-host-measurement.d.ts.map +1 -0
  211. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/hooks/use-placeholder-styles.d.ts +12 -0
  212. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/hooks/use-placeholder-styles.d.ts.map +1 -0
  213. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/index.d.ts +13 -0
  214. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/index.d.ts.map +1 -0
  215. package/lib/typescript/shared/components/boundary/portal/{stores → components/boundary-portal/stores}/host-bounds.store.d.ts +1 -1
  216. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/stores/host-bounds.store.d.ts.map +1 -0
  217. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/stores/host-registry.store.d.ts.map +1 -0
  218. package/lib/typescript/shared/components/boundary/portal/{stores → components/boundary-portal/stores}/portal-boundary-host.store.d.ts +3 -3
  219. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/stores/portal-boundary-host.store.d.ts.map +1 -0
  220. package/lib/typescript/shared/components/boundary/portal/index.d.ts +1 -2
  221. package/lib/typescript/shared/components/boundary/portal/index.d.ts.map +1 -1
  222. package/lib/typescript/shared/components/boundary/portal/utils/naming.d.ts +0 -2
  223. package/lib/typescript/shared/components/boundary/portal/utils/naming.d.ts.map +1 -1
  224. package/lib/typescript/shared/components/boundary/portal/utils/ownership.d.ts +9 -10
  225. package/lib/typescript/shared/components/boundary/portal/utils/ownership.d.ts.map +1 -1
  226. package/lib/typescript/shared/components/boundary/providers/boundary-root.provider.d.ts +21 -21
  227. package/lib/typescript/shared/components/boundary/providers/boundary-root.provider.d.ts.map +1 -1
  228. package/lib/typescript/shared/components/boundary/utils/destination-signals.d.ts +9 -2
  229. package/lib/typescript/shared/components/boundary/utils/destination-signals.d.ts.map +1 -1
  230. package/lib/typescript/shared/components/boundary/utils/measured-bounds.d.ts +8 -0
  231. package/lib/typescript/shared/components/boundary/utils/measured-bounds.d.ts.map +1 -1
  232. package/lib/typescript/shared/index.d.ts +1 -0
  233. package/lib/typescript/shared/index.d.ts.map +1 -1
  234. package/lib/typescript/shared/providers/screen/animation/helpers/read-screen-animation-revisions.d.ts +4 -1
  235. package/lib/typescript/shared/providers/screen/animation/helpers/read-screen-animation-revisions.d.ts.map +1 -1
  236. package/lib/typescript/shared/providers/screen/styles/helpers/collect-interpolator-shared-values.d.ts +4 -0
  237. package/lib/typescript/shared/providers/screen/styles/helpers/collect-interpolator-shared-values.d.ts.map +1 -0
  238. package/lib/typescript/shared/providers/screen/styles/hooks/use-interpolated-style-maps.d.ts.map +1 -1
  239. package/lib/typescript/shared/providers/screen/styles/hooks/use-maybe-block-visibility.d.ts +1 -0
  240. package/lib/typescript/shared/providers/screen/styles/hooks/use-maybe-block-visibility.d.ts.map +1 -1
  241. package/lib/typescript/shared/providers/screen/styles/slot.provider.d.ts +1 -0
  242. package/lib/typescript/shared/providers/screen/styles/slot.provider.d.ts.map +1 -1
  243. package/lib/typescript/shared/providers/screen/styles/stores/slot-references.store.d.ts.map +1 -1
  244. package/lib/typescript/shared/stores/system.store.d.ts.map +1 -1
  245. package/lib/typescript/shared/types/animation.types.d.ts +3 -3
  246. package/lib/typescript/shared/types/bounds.types.d.ts +7 -2
  247. package/lib/typescript/shared/types/bounds.types.d.ts.map +1 -1
  248. package/lib/typescript/shared/utils/bounds/helpers/create-bounds-accessor-core.d.ts.map +1 -1
  249. package/lib/typescript/shared/utils/bounds/types/options.d.ts +6 -2
  250. package/lib/typescript/shared/utils/bounds/types/options.d.ts.map +1 -1
  251. package/package.json +1 -1
  252. package/src/shared/adapters/with-screen-transitions/index.tsx +30 -9
  253. package/src/shared/animation/transition-blocking.ts +79 -0
  254. package/src/shared/components/boundary/components/boundary-target.tsx +43 -50
  255. package/src/shared/components/boundary/create-boundary-component.tsx +35 -150
  256. package/src/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.ts +103 -81
  257. package/src/shared/components/boundary/hooks/use-boundary-measurement.ts +1 -0
  258. package/src/shared/components/boundary/hooks/use-measurer.ts +12 -4
  259. package/src/shared/components/boundary/hooks/use-register-target.ts +43 -0
  260. package/src/shared/components/boundary/index.tsx +2 -2
  261. package/src/shared/components/boundary/portal/components/boundary-content-portal/components/host.tsx +48 -0
  262. package/src/shared/components/boundary/portal/components/boundary-content-portal/helpers/host-name.ts +9 -0
  263. package/src/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.ts +274 -0
  264. package/src/shared/components/boundary/portal/components/boundary-content-portal/index.tsx +59 -0
  265. package/src/shared/components/boundary/portal/components/{host.tsx → boundary-portal/components/host.tsx} +14 -15
  266. package/src/shared/components/boundary/portal/components/{portal-boundary-host.tsx → boundary-portal/components/portal-boundary-host.tsx} +12 -12
  267. package/src/shared/components/boundary/portal/components/boundary-portal/components/portal-slot.tsx +80 -0
  268. package/src/shared/components/boundary/portal/{utils → components/boundary-portal/helpers}/has-local-slot.ts +1 -1
  269. package/src/shared/components/boundary/portal/components/boundary-portal/helpers/host-name.ts +10 -0
  270. package/src/shared/components/boundary/portal/{utils → components/boundary-portal/helpers}/offset-style.ts +2 -2
  271. package/src/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.ts +250 -0
  272. package/src/shared/components/boundary/portal/{hooks → components/boundary-portal/hooks}/use-host-measurement.ts +38 -8
  273. package/src/shared/components/boundary/portal/{hooks → components/boundary-portal/hooks}/use-placeholder-styles.ts +4 -15
  274. package/src/shared/components/boundary/portal/components/boundary-portal/index.tsx +38 -0
  275. package/src/shared/components/boundary/portal/{stores → components/boundary-portal/stores}/host-bounds.store.ts +2 -2
  276. package/src/shared/components/boundary/portal/{stores → components/boundary-portal/stores}/portal-boundary-host.store.ts +10 -15
  277. package/src/shared/components/boundary/portal/index.ts +1 -2
  278. package/src/shared/components/boundary/portal/teleport.ts +2 -2
  279. package/src/shared/components/boundary/portal/utils/naming.ts +0 -19
  280. package/src/shared/components/boundary/portal/utils/ownership.ts +32 -88
  281. package/src/shared/components/boundary/providers/boundary-root.provider.tsx +198 -78
  282. package/src/shared/components/boundary/utils/destination-signals.ts +38 -14
  283. package/src/shared/components/boundary/utils/measured-bounds.ts +48 -0
  284. package/src/shared/components/screen-container/layers/content.tsx +1 -1
  285. package/src/shared/configs/presets.ts +2 -2
  286. package/src/shared/index.ts +4 -0
  287. package/src/shared/providers/screen/animation/helpers/read-screen-animation-revisions.ts +14 -0
  288. package/src/shared/providers/screen/styles/helpers/collect-interpolator-shared-values.ts +75 -0
  289. package/src/shared/providers/screen/styles/hooks/use-interpolated-style-maps.tsx +11 -0
  290. package/src/shared/providers/screen/styles/hooks/use-maybe-block-visibility.tsx +1 -0
  291. package/src/shared/providers/screen/styles/slot.provider.tsx +4 -2
  292. package/src/shared/providers/screen/styles/stores/slot-references.store.ts +2 -1
  293. package/src/shared/stores/system.store.ts +10 -4
  294. package/src/shared/types/animation.types.ts +3 -3
  295. package/src/shared/types/bounds.types.ts +9 -2
  296. package/src/shared/utils/bounds/helpers/create-bounds-accessor-core.ts +18 -11
  297. package/src/shared/utils/bounds/navigation/reveal/build.ts +2 -2
  298. package/src/shared/utils/bounds/navigation/zoom/build.ts +3 -3
  299. package/src/shared/utils/bounds/types/options.ts +9 -2
  300. package/lib/commonjs/shared/components/boundary/portal/components/boundary-local-portal-host.js +0 -58
  301. package/lib/commonjs/shared/components/boundary/portal/components/boundary-local-portal-host.js.map +0 -1
  302. package/lib/commonjs/shared/components/boundary/portal/components/host.js.map +0 -1
  303. package/lib/commonjs/shared/components/boundary/portal/components/portal-boundary-host.js.map +0 -1
  304. package/lib/commonjs/shared/components/boundary/portal/components/portal.js +0 -272
  305. package/lib/commonjs/shared/components/boundary/portal/components/portal.js.map +0 -1
  306. package/lib/commonjs/shared/components/boundary/portal/hooks/use-host-measurement.js.map +0 -1
  307. package/lib/commonjs/shared/components/boundary/portal/hooks/use-placeholder-styles.js.map +0 -1
  308. package/lib/commonjs/shared/components/boundary/portal/stores/host-bounds.store.js.map +0 -1
  309. package/lib/commonjs/shared/components/boundary/portal/stores/host-registry.store.js.map +0 -1
  310. package/lib/commonjs/shared/components/boundary/portal/stores/portal-boundary-host.store.js.map +0 -1
  311. package/lib/commonjs/shared/components/boundary/portal/utils/has-local-slot.js.map +0 -1
  312. package/lib/commonjs/shared/components/boundary/portal/utils/offset-style.js.map +0 -1
  313. package/lib/module/shared/components/boundary/portal/components/boundary-local-portal-host.js +0 -53
  314. package/lib/module/shared/components/boundary/portal/components/boundary-local-portal-host.js.map +0 -1
  315. package/lib/module/shared/components/boundary/portal/components/host.js.map +0 -1
  316. package/lib/module/shared/components/boundary/portal/components/portal-boundary-host.js.map +0 -1
  317. package/lib/module/shared/components/boundary/portal/components/portal.js +0 -267
  318. package/lib/module/shared/components/boundary/portal/components/portal.js.map +0 -1
  319. package/lib/module/shared/components/boundary/portal/hooks/use-host-measurement.js.map +0 -1
  320. package/lib/module/shared/components/boundary/portal/hooks/use-placeholder-styles.js.map +0 -1
  321. package/lib/module/shared/components/boundary/portal/stores/host-bounds.store.js.map +0 -1
  322. package/lib/module/shared/components/boundary/portal/stores/host-registry.store.js.map +0 -1
  323. package/lib/module/shared/components/boundary/portal/stores/portal-boundary-host.store.js.map +0 -1
  324. package/lib/module/shared/components/boundary/portal/utils/has-local-slot.js.map +0 -1
  325. package/lib/module/shared/components/boundary/portal/utils/offset-style.js.map +0 -1
  326. package/lib/typescript/shared/components/boundary/portal/components/boundary-local-portal-host.d.ts +0 -8
  327. package/lib/typescript/shared/components/boundary/portal/components/boundary-local-portal-host.d.ts.map +0 -1
  328. package/lib/typescript/shared/components/boundary/portal/components/host.d.ts.map +0 -1
  329. package/lib/typescript/shared/components/boundary/portal/components/portal-boundary-host.d.ts.map +0 -1
  330. package/lib/typescript/shared/components/boundary/portal/components/portal.d.ts +0 -20
  331. package/lib/typescript/shared/components/boundary/portal/components/portal.d.ts.map +0 -1
  332. package/lib/typescript/shared/components/boundary/portal/hooks/use-host-measurement.d.ts.map +0 -1
  333. package/lib/typescript/shared/components/boundary/portal/hooks/use-placeholder-styles.d.ts +0 -17
  334. package/lib/typescript/shared/components/boundary/portal/hooks/use-placeholder-styles.d.ts.map +0 -1
  335. package/lib/typescript/shared/components/boundary/portal/stores/host-bounds.store.d.ts.map +0 -1
  336. package/lib/typescript/shared/components/boundary/portal/stores/host-registry.store.d.ts.map +0 -1
  337. package/lib/typescript/shared/components/boundary/portal/stores/portal-boundary-host.store.d.ts.map +0 -1
  338. package/lib/typescript/shared/components/boundary/portal/utils/has-local-slot.d.ts +0 -3
  339. package/lib/typescript/shared/components/boundary/portal/utils/has-local-slot.d.ts.map +0 -1
  340. package/lib/typescript/shared/components/boundary/portal/utils/offset-style.d.ts.map +0 -1
  341. package/src/shared/components/boundary/portal/components/boundary-local-portal-host.tsx +0 -66
  342. package/src/shared/components/boundary/portal/components/portal.tsx +0 -412
  343. /package/lib/commonjs/shared/components/boundary/portal/{utils → components/boundary-portal/helpers}/has-local-slot.js +0 -0
  344. /package/lib/commonjs/shared/components/boundary/portal/{stores → components/boundary-portal/stores}/host-registry.store.js +0 -0
  345. /package/lib/module/shared/components/boundary/portal/{utils → components/boundary-portal/helpers}/has-local-slot.js +0 -0
  346. /package/lib/module/shared/components/boundary/portal/{stores → components/boundary-portal/stores}/host-registry.store.js +0 -0
  347. /package/lib/typescript/shared/components/boundary/portal/components/{host.d.ts → boundary-portal/components/host.d.ts} +0 -0
  348. /package/lib/typescript/shared/components/boundary/portal/components/{portal-boundary-host.d.ts → boundary-portal/components/portal-boundary-host.d.ts} +0 -0
  349. /package/lib/typescript/shared/components/boundary/portal/{stores → components/boundary-portal/stores}/host-registry.store.d.ts +0 -0
  350. /package/src/shared/components/boundary/portal/{stores → components/boundary-portal/stores}/host-registry.store.ts +0 -0
@@ -1,13 +1,35 @@
1
- import { type ReactNode, useCallback, useMemo, useState } from "react";
1
+ import {
2
+ type ForwardedRef,
3
+ type ReactNode,
4
+ useCallback,
5
+ useImperativeHandle,
6
+ useMemo,
7
+ useState,
8
+ } from "react";
2
9
  import type { View } from "react-native";
3
10
  import type { AnimatedRef, StyleProps } from "react-native-reanimated";
4
11
  import { useAnimatedRef } from "react-native-reanimated";
12
+ import { useDescriptorsStore } from "../../../providers/screen/descriptors";
13
+ import {
14
+ useComposedSlotStyles,
15
+ useSlotStackingStyles,
16
+ } from "../../../providers/screen/styles";
17
+ import { createBoundTag } from "../../../stores/bounds/helpers/link-pairs.helpers";
5
18
  import type { BoundTag } from "../../../stores/bounds/types";
6
19
  import createProvider from "../../../utils/create-provider";
7
20
  import { logger } from "../../../utils/logger";
8
- import type { BoundaryPortalRuntime } from "../portal/utils/resolve-portal";
21
+ import { useBoundaryMeasurement } from "../hooks/use-boundary-measurement";
22
+ import {
23
+ type BoundaryPortalRuntime,
24
+ resolveBoundaryPortal,
25
+ } from "../portal/utils/resolve-portal";
26
+ import type {
27
+ BoundaryConfigProps,
28
+ BoundaryId,
29
+ BoundaryOwnProps,
30
+ } from "../types";
9
31
 
10
- interface BoundaryRootContextValue {
32
+ interface BoundaryRootContextValue extends BoundaryRootRenderState {
11
33
  registerTargetRef: (
12
34
  targetRef: AnimatedRef<View>,
13
35
  preparedStyles: StyleProps,
@@ -33,83 +55,181 @@ const MULTIPLE_TARGETS_WARNING =
33
55
  export const TARGET_OUTSIDE_ROOT_WARNING =
34
56
  "Boundary.Target must be rendered inside Transition.Boundary or a component created by createBoundaryComponent.";
35
57
 
36
- interface BoundaryRootProps {
37
- value: BoundaryRootContextValue;
38
- children: ReactNode;
39
- }
40
-
41
- export const { BoundaryRootProvider, useBoundaryRootContext } = createProvider(
42
- "BoundaryRoot",
43
- { guarded: false },
44
- )<BoundaryRootProps, BoundaryRootContextValue>((props) => props);
45
-
46
- export const useBoundaryRootState = (params: {
58
+ export type BoundaryRootRenderState = {
59
+ attachedStyle: unknown;
47
60
  boundTag: BoundTag;
61
+ currentScreenKey: string;
48
62
  portalRuntime: BoundaryPortalRuntime;
49
- rootMeasurementRef?: AnimatedRef<View>;
50
- }) => {
51
- const { boundTag, portalRuntime, rootMeasurementRef } = params;
52
- const rootRef = useAnimatedRef<View>();
53
- const [targetEntry, setTargetEntry] = useState<BoundaryTargetEntry | null>(
54
- null,
55
- );
56
-
57
- const registerTargetRef = useCallback(
58
- (
59
- targetRef: AnimatedRef<View>,
60
- preparedStyles: StyleProps,
61
- measurementRef?: AnimatedRef<View>,
62
- ) => {
63
- setTargetEntry((prev) => {
64
- if (prev?.ref === targetRef) {
65
- return prev;
66
- }
67
-
68
- if (__DEV__ && prev !== null) {
69
- logger.warnOnce(
70
- "boundary:multiple-targets",
71
- MULTIPLE_TARGETS_WARNING,
72
- );
73
- }
63
+ ref: AnimatedRef<View>;
64
+ rootEscapePlaceholderRef: AnimatedRef<View>;
65
+ shouldRenderBoundaryRootThroughPortal: boolean;
66
+ shouldRenderHandoffHost: boolean;
67
+ };
74
68
 
75
- return (
76
- prev ?? {
77
- ref: targetRef,
78
- measurementRef: measurementRef ?? targetRef,
79
- preparedStyles,
69
+ type BoundaryRootProviderProps = Pick<
70
+ BoundaryOwnProps,
71
+ "enabled" | "escapeClipping" | "group" | "handoff"
72
+ > & {
73
+ children: (state: BoundaryRootRenderState) => ReactNode;
74
+ config: BoundaryConfigProps;
75
+ forwardedRef?: ForwardedRef<any>;
76
+ id: BoundaryId;
77
+ style?: unknown;
78
+ };
79
+
80
+ export const {
81
+ BoundaryRootProvider,
82
+ useBoundaryRootContext,
83
+ useBoundaryRootStore,
84
+ } = createProvider("BoundaryRoot", { guarded: false })<
85
+ BoundaryRootProviderProps,
86
+ BoundaryRootContextValue
87
+ >(
88
+ ({
89
+ children,
90
+ config,
91
+ enabled = true,
92
+ escapeClipping,
93
+ forwardedRef,
94
+ group,
95
+ handoff,
96
+ id,
97
+ style,
98
+ }) => {
99
+ const boundTag = useMemo(
100
+ () => createBoundTag(String(id), group),
101
+ [id, group],
102
+ );
103
+ const portalRuntime = resolveBoundaryPortal({
104
+ handoff,
105
+ escapeClipping,
106
+ });
107
+
108
+ const currentScreenKey = useDescriptorsStore(
109
+ (s) => s.derivations.currentScreenKey,
110
+ );
111
+ const hasConfiguredInterpolator = useDescriptorsStore(
112
+ (s) => s.derivations.hasConfiguredInterpolator,
113
+ );
114
+ const runtimeEnabled = enabled && hasConfiguredInterpolator;
115
+ // Associated slot styles attach whenever the boundary is enabled,
116
+ // independent of whether an interpolator is configured for this transition.
117
+ const shouldAttachAssociatedStyles = enabled;
118
+ const shouldEscapeBoundaryRootToScreenHost = portalRuntime.escapeClipping;
119
+
120
+ const associatedStyles = useComposedSlotStyles(boundTag.tag, style);
121
+ const associatedStackingStyles = useSlotStackingStyles(boundTag.tag);
122
+ const rootRef = useAnimatedRef<View>();
123
+ const rootEscapePlaceholderRef = useAnimatedRef<View>();
124
+ const [targetEntry, setTargetEntry] = useState<BoundaryTargetEntry | null>(
125
+ null,
126
+ );
127
+
128
+ const registerTargetRef = useCallback(
129
+ (
130
+ targetRef: AnimatedRef<View>,
131
+ preparedStyles: StyleProps,
132
+ measurementRef?: AnimatedRef<View>,
133
+ ) => {
134
+ setTargetEntry((prev) => {
135
+ if (prev?.ref === targetRef) {
136
+ return prev;
80
137
  }
81
- );
82
- });
83
- },
84
- [],
85
- );
86
-
87
- const unregisterTargetRef = useCallback((targetRef: AnimatedRef<View>) => {
88
- setTargetEntry((prev) => (prev?.ref === targetRef ? null : prev));
89
- }, []);
90
-
91
- const contextValue = useMemo(
92
- () => ({
93
- registerTargetRef,
94
- unregisterTargetRef,
95
- activeTargetRef: targetEntry?.ref ?? null,
96
- boundTag,
97
- portalRuntime,
98
- }),
99
- [
100
- registerTargetRef,
101
- unregisterTargetRef,
102
- targetEntry,
138
+
139
+ if (__DEV__ && prev !== null) {
140
+ logger.warnOnce(
141
+ "boundary:multiple-targets",
142
+ MULTIPLE_TARGETS_WARNING,
143
+ );
144
+ }
145
+
146
+ return (
147
+ prev ?? {
148
+ ref: targetRef,
149
+ measurementRef: measurementRef ?? targetRef,
150
+ preparedStyles,
151
+ }
152
+ );
153
+ });
154
+ },
155
+ [],
156
+ );
157
+
158
+ const unregisterTargetRef = useCallback((targetRef: AnimatedRef<View>) => {
159
+ setTargetEntry((prev) => (prev?.ref === targetRef ? null : prev));
160
+ }, []);
161
+
162
+ const rootMeasurementRef = shouldEscapeBoundaryRootToScreenHost
163
+ ? rootEscapePlaceholderRef
164
+ : rootRef;
165
+ const measuredRef = targetEntry?.measurementRef ?? rootMeasurementRef;
166
+ const hasActiveTarget = targetEntry !== null;
167
+ const targetPreparedStyles = targetEntry?.preparedStyles;
168
+
169
+ useImperativeHandle(forwardedRef, () => rootRef.current as any, [rootRef]);
170
+
171
+ useBoundaryMeasurement({
103
172
  boundTag,
104
- portalRuntime,
105
- ],
106
- );
107
-
108
- return {
109
- ref: rootRef,
110
- contextValue,
111
- hasActiveTarget: targetEntry !== null,
112
- measuredRef: targetEntry?.measurementRef ?? rootMeasurementRef ?? rootRef,
113
- targetPreparedStyles: targetEntry?.preparedStyles,
114
- };
115
- };
173
+ enabled,
174
+ runtimeEnabled,
175
+ currentScreenKey,
176
+ measuredRef,
177
+ style,
178
+ targetPreparedStyles,
179
+ handoff: portalRuntime.handoff,
180
+ escapeClipping: portalRuntime.escapeClipping,
181
+ config,
182
+ });
183
+
184
+ const shouldRenderBoundaryRootThroughPortal =
185
+ shouldEscapeBoundaryRootToScreenHost && !hasActiveTarget;
186
+ // A nested active target takes the full associated style, so the root keeps
187
+ // only its stacking context. Root-owned escape-clipping moves the root
188
+ // through a screen host, so its associated style is applied through the
189
+ // host instead of inline on the escaped element.
190
+ // Host-only handoff receivers still need the associated style: their
191
+ // handoff host is absolute-filled inside this root, so the root is the
192
+ // visual frame that animates the received payload.
193
+ const attachedStyle = shouldAttachAssociatedStyles
194
+ ? hasActiveTarget
195
+ ? associatedStackingStyles
196
+ : shouldRenderBoundaryRootThroughPortal
197
+ ? undefined
198
+ : associatedStyles
199
+ : undefined;
200
+
201
+ const value = useMemo<BoundaryRootContextValue>(
202
+ () => ({
203
+ attachedStyle,
204
+ activeTargetRef: targetEntry?.ref ?? null,
205
+ boundTag,
206
+ currentScreenKey,
207
+ portalRuntime,
208
+ registerTargetRef,
209
+ ref: rootRef,
210
+ rootEscapePlaceholderRef,
211
+ shouldRenderBoundaryRootThroughPortal,
212
+ shouldRenderHandoffHost: enabled && portalRuntime.handoff,
213
+ unregisterTargetRef,
214
+ }),
215
+ [
216
+ attachedStyle,
217
+ boundTag,
218
+ currentScreenKey,
219
+ enabled,
220
+ portalRuntime,
221
+ registerTargetRef,
222
+ rootRef,
223
+ rootEscapePlaceholderRef,
224
+ shouldRenderBoundaryRootThroughPortal,
225
+ targetEntry,
226
+ unregisterTargetRef,
227
+ ],
228
+ );
229
+
230
+ return {
231
+ value,
232
+ children: children(value),
233
+ };
234
+ },
235
+ );
@@ -7,14 +7,27 @@ import type {
7
7
  ScreenPairKey,
8
8
  } from "../../../stores/bounds/types";
9
9
 
10
- export const getInitialDestinationMeasurePairKey = (params: {
10
+ export type InitialDestinationMeasurementAction =
11
+ | "wait"
12
+ | "release"
13
+ | "measure"
14
+ | "complete";
15
+
16
+ export type InitialDestinationMeasurementSignal = {
17
+ pairKey: ScreenPairKey;
18
+ action: InitialDestinationMeasurementAction;
19
+ };
20
+
21
+ export const getInitialDestinationMeasurementSignal = (params: {
11
22
  enabled: boolean;
12
23
  destinationPairKey?: ScreenPairKey;
13
24
  ancestorDestinationPairKey?: ScreenPairKey;
14
25
  linkId: string;
15
26
  group?: string;
27
+ destinationPresent: boolean;
28
+ sourcePresent: boolean;
16
29
  linkState?: LinkPairsState;
17
- }): ScreenPairKey | null => {
30
+ }): InitialDestinationMeasurementSignal | null => {
18
31
  "worklet";
19
32
  const {
20
33
  enabled,
@@ -22,30 +35,41 @@ export const getInitialDestinationMeasurePairKey = (params: {
22
35
  ancestorDestinationPairKey,
23
36
  linkId,
24
37
  group,
38
+ destinationPresent,
39
+ sourcePresent,
25
40
  linkState,
26
41
  } = params;
27
- const measurePairKey = destinationPairKey ?? ancestorDestinationPairKey;
42
+ const pairKey = destinationPairKey ?? ancestorDestinationPairKey;
28
43
 
29
- if (!enabled || !measurePairKey) {
44
+ if (!enabled || !pairKey) {
30
45
  return null;
31
46
  }
32
47
 
33
- const linkKey = getLinkKeyFromTag(linkId);
34
- const hasDestination =
35
- linkState?.[measurePairKey]?.links?.[linkKey]?.destination;
48
+ if (!destinationPresent) {
49
+ return { pairKey, action: "wait" };
50
+ }
36
51
 
37
- if (hasDestination) {
38
- return null;
52
+ if (!sourcePresent) {
53
+ return { pairKey, action: "release" };
39
54
  }
40
55
 
56
+ const linkKey = getLinkKeyFromTag(linkId);
41
57
  const activeGroupId =
42
- group && linkState
43
- ? getActiveGroupId(linkState, measurePairKey, group)
44
- : null;
58
+ group && linkState ? getActiveGroupId(linkState, pairKey, group) : null;
45
59
 
46
60
  if (activeGroupId && activeGroupId !== linkKey) {
47
- return null;
61
+ return { pairKey, action: "release" };
62
+ }
63
+
64
+ const link = linkState?.[pairKey]?.links?.[linkKey];
65
+
66
+ if (!link?.destination) {
67
+ return { pairKey, action: "measure" };
68
+ }
69
+
70
+ if (!link.source) {
71
+ return { pairKey, action: "wait" };
48
72
  }
49
73
 
50
- return measurePairKey;
74
+ return { pairKey, action: "complete" };
51
75
  };
@@ -96,6 +96,54 @@ export const isMeasurementInViewport = (
96
96
  );
97
97
  };
98
98
 
99
+ export const normalizeMeasuredBoundsWithVisibilityGate = ({
100
+ measured,
101
+ origin,
102
+ visibilityBlocked,
103
+ visibilityBlockOffset,
104
+ viewportWidth,
105
+ viewportHeight,
106
+ }: {
107
+ measured: MeasuredDimensions;
108
+ origin: MeasuredDimensions;
109
+ visibilityBlocked: boolean;
110
+ visibilityBlockOffset: number;
111
+ viewportWidth: number;
112
+ viewportHeight: number;
113
+ }): MeasuredDimensions => {
114
+ "worklet";
115
+ const normalized = normalizeMeasuredBoundsToOrigin(measured, origin);
116
+
117
+ if (
118
+ !visibilityBlocked ||
119
+ visibilityBlockOffset <= 0 ||
120
+ isMeasurementInViewport(normalized, viewportWidth, viewportHeight)
121
+ ) {
122
+ return normalized;
123
+ }
124
+
125
+ // Fabric can expose the visibility transform to one native measurement one
126
+ // frame before the other. Prefer normal origin-relative coordinates, then
127
+ // test either side of that known frame skew while the gate is active.
128
+ const measuredAhead = {
129
+ ...normalized,
130
+ pageY: normalized.pageY - visibilityBlockOffset,
131
+ };
132
+ if (isMeasurementInViewport(measuredAhead, viewportWidth, viewportHeight)) {
133
+ return measuredAhead;
134
+ }
135
+
136
+ const originAhead = {
137
+ ...normalized,
138
+ pageY: normalized.pageY + visibilityBlockOffset,
139
+ };
140
+ if (isMeasurementInViewport(originAhead, viewportWidth, viewportHeight)) {
141
+ return originAhead;
142
+ }
143
+
144
+ return normalized;
145
+ };
146
+
99
147
  export const measureWithOverscrollAwareness = (
100
148
  ref: AnimatedRef<View>,
101
149
  scrollState: ScrollGestureState | null,
@@ -8,7 +8,7 @@ import { useGestureContext } from "../../../providers/screen/gestures";
8
8
  import { OriginProvider } from "../../../providers/screen/origin.provider";
9
9
  import { useSlotProps, useSlotStyles } from "../../../providers/screen/styles";
10
10
  import type { ScreenContentComponentProps } from "../../../types";
11
- import { ScreenFallbackHost } from "../../boundary/portal/components/host";
11
+ import { ScreenFallbackHost } from "../../boundary/portal/components/boundary-portal/components/host";
12
12
  import { useContentLayout } from "../hooks/use-content-layout";
13
13
  import { MaybeMaskedNavigationContainer } from "./maybe-masked-navigation-container";
14
14
  import { usesLayerRenderProps } from "./render-component";
@@ -434,7 +434,7 @@ export const SharedAppleMusic = ({
434
434
  const dragXScale = interpolate(normX, [0, 1], xScaleOuput);
435
435
  const dragYScale = interpolate(normY, [0, 1], yScaleOuput);
436
436
 
437
- const boundValues = bounds({ id: sharedBoundTag }).math({
437
+ const boundValues = bounds({ id: sharedBoundTag }).values({
438
438
  method: focused ? "content" : "transform",
439
439
  anchor: "top",
440
440
  scaleMode: "uniform",
@@ -453,7 +453,7 @@ export const SharedAppleMusic = ({
453
453
  * ===============================
454
454
  */
455
455
  if (focused) {
456
- const maskedValues = bounds({ id: sharedBoundTag }).math({
456
+ const maskedValues = bounds({ id: sharedBoundTag }).values({
457
457
  space: "absolute",
458
458
  method: "size",
459
459
  target: "fullscreen",
@@ -30,6 +30,10 @@ export default {
30
30
  export type { NativeStackAdapterOptions } from "./adapters/with-screen-transitions";
31
31
  export { withScreenTransitions } from "./adapters/with-screen-transitions";
32
32
  export { snapTo } from "./animation/snap-to";
33
+ export {
34
+ blockTransition,
35
+ unblockTransition,
36
+ } from "./animation/transition-blocking";
33
37
  export {
34
38
  NAVIGATION_MASK_CONTAINER_STYLE_ID,
35
39
  NAVIGATION_MASK_ELEMENT_STYLE_ID,
@@ -1,13 +1,17 @@
1
+ import type { SharedValue } from "react-native-reanimated";
1
2
  import type {
2
3
  ScreenAnimationDescendantSources,
3
4
  ScreenAnimationSource,
4
5
  ScreenInterpolatorPropsRevision,
5
6
  } from "../types";
6
7
 
8
+ type ScreenInterpolatorExternalDeps = Pick<SharedValue<unknown>, "get">[];
9
+
7
10
  export const readScreenAnimationRevisions = (
8
11
  screenInterpolatorPropsRevision: ScreenInterpolatorPropsRevision,
9
12
  ancestorScreenAnimationSources: ScreenAnimationSource[],
10
13
  descendantScreenAnimationSources: ScreenAnimationDescendantSources,
14
+ screenInterpolatorExternalDeps?: ScreenInterpolatorExternalDeps,
11
15
  ) => {
12
16
  "worklet";
13
17
  screenInterpolatorPropsRevision.get();
@@ -22,4 +26,14 @@ export const readScreenAnimationRevisions = (
22
26
  for (let index = 0; index < descendantSources.length; index++) {
23
27
  descendantSources[index]?.source.screenInterpolatorPropsRevision.get();
24
28
  }
29
+
30
+ if (screenInterpolatorExternalDeps) {
31
+ for (
32
+ let index = 0;
33
+ index < screenInterpolatorExternalDeps.length;
34
+ index++
35
+ ) {
36
+ screenInterpolatorExternalDeps[index]?.get();
37
+ }
38
+ }
25
39
  };
@@ -0,0 +1,75 @@
1
+ import type { SharedValue } from "react-native-reanimated";
2
+ import type { ScreenStyleInterpolator } from "../../../../types/animation.types";
3
+
4
+ type WorkletClosure = Record<string, unknown>;
5
+
6
+ type ClosureCarrier = {
7
+ __closure?: WorkletClosure;
8
+ };
9
+
10
+ type SharedValueLike = SharedValue<unknown> & {
11
+ _isReanimatedSharedValue: true;
12
+ };
13
+
14
+ const isSharedValueLike = (value: unknown): value is SharedValueLike =>
15
+ (value as Partial<SharedValueLike> | null)?._isReanimatedSharedValue === true;
16
+
17
+ const getWorkletClosure = (value: unknown): WorkletClosure | undefined => {
18
+ if (
19
+ value === null ||
20
+ (typeof value !== "object" && typeof value !== "function")
21
+ ) {
22
+ return undefined;
23
+ }
24
+
25
+ const closure = (value as Partial<ClosureCarrier>).__closure;
26
+ return closure && typeof closure === "object" ? closure : undefined;
27
+ };
28
+
29
+ const isPlainObject = (value: unknown): value is Record<string, unknown> =>
30
+ value !== null &&
31
+ typeof value === "object" &&
32
+ Object.getPrototypeOf(value) === Object.prototype;
33
+
34
+ export const collectInterpolatorSharedValues = (
35
+ interpolators: Array<ScreenStyleInterpolator | undefined>,
36
+ ): SharedValue<unknown>[] => {
37
+ const sharedValues: SharedValue<unknown>[] = [];
38
+ const seen = new Set<unknown>();
39
+
40
+ const visit = (value: unknown) => {
41
+ if (value === null || value === undefined || seen.has(value)) {
42
+ return;
43
+ }
44
+ seen.add(value);
45
+
46
+ if (isSharedValueLike(value)) {
47
+ sharedValues.push(value);
48
+ return;
49
+ }
50
+
51
+ if (typeof value === "function") {
52
+ visit(getWorkletClosure(value));
53
+ return;
54
+ }
55
+
56
+ if (Array.isArray(value)) {
57
+ for (let index = 0; index < value.length; index++) {
58
+ visit(value[index]);
59
+ }
60
+ return;
61
+ }
62
+
63
+ if (isPlainObject(value)) {
64
+ for (const item of Object.values(value)) {
65
+ visit(item);
66
+ }
67
+ }
68
+ };
69
+
70
+ for (let index = 0; index < interpolators.length; index++) {
71
+ visit(getWorkletClosure(interpolators[index]));
72
+ }
73
+
74
+ return sharedValues;
75
+ };
@@ -1,3 +1,4 @@
1
+ import { useMemo } from "react";
1
2
  import { useDerivedValue, useSharedValue } from "react-native-reanimated";
2
3
  import { NO_STYLES } from "../../../../constants";
3
4
  import { AnimationStore } from "../../../../stores/animation.store";
@@ -22,6 +23,7 @@ import {
22
23
  syncScreenOptionsOverrides,
23
24
  useScreenOptionsContext,
24
25
  } from "../../options";
26
+ import { collectInterpolatorSharedValues } from "../helpers/collect-interpolator-shared-values";
25
27
  import { normalizeSlots } from "../helpers/normalize-slots";
26
28
  import { isOpeningBeforeStart } from "../helpers/opening-phase";
27
29
  import type { LocalStyleLayers } from "../helpers/resolve-slot-styles";
@@ -146,6 +148,14 @@ export const useInterpolatedStylesMap = () => {
146
148
  const transition = useBuildTransitionAccessor();
147
149
  const nextInterpolatorReady = useSharedValue(0);
148
150
 
151
+ // In some cases, a user may want to use external shared values to drive animations in the interpoaltor.
152
+ // We can now support this by collecting those shared values and reading them here to trigger an update.
153
+ const interpolatorSharedValues = useMemo(
154
+ () =>
155
+ collectInterpolatorSharedValues([currentInterpolator, nextInterpolator]),
156
+ [currentInterpolator, nextInterpolator],
157
+ );
158
+
149
159
  const activeScreenKey = nextScreenKey ?? currentScreenKey;
150
160
  const {
151
161
  entering: activeEntering,
@@ -162,6 +172,7 @@ export const useInterpolatedStylesMap = () => {
162
172
  screenInterpolatorPropsRevision,
163
173
  ancestorScreenAnimationSources,
164
174
  descendantScreenAnimationSources,
175
+ interpolatorSharedValues,
165
176
  );
166
177
  const props = screenInterpolatorProps.get();
167
178
 
@@ -71,5 +71,6 @@ export const useMaybeBlockVisibility = (isFloatingOverlay?: boolean) => {
71
71
  return {
72
72
  animatedStyle,
73
73
  animatedProps,
74
+ shouldBlockVisibility,
74
75
  };
75
76
  };
@@ -34,6 +34,7 @@ export type ScreenSlotContextValue = {
34
34
  localStylesMaps: SharedValue<LocalStyleLayers>;
35
35
  nextInterpolatorReady: SharedValue<number>;
36
36
  slotsMap: SharedValue<NormalizedTransitionInterpolatedStyle>;
37
+ visibilityBlocked: SharedValue<boolean>;
37
38
  };
38
39
 
39
40
  export const {
@@ -54,15 +55,16 @@ export const {
54
55
  localStylesMaps,
55
56
  ancestorStylesMap: parentContext?.slotsMap,
56
57
  });
57
- const { animatedStyle, animatedProps } =
58
+ const { animatedStyle, animatedProps, shouldBlockVisibility } =
58
59
  useMaybeBlockVisibility(isFloatingOverlay);
59
60
  const value = useMemo(
60
61
  () => ({
61
62
  localStylesMaps,
62
63
  nextInterpolatorReady,
63
64
  slotsMap,
65
+ visibilityBlocked: shouldBlockVisibility,
64
66
  }),
65
- [localStylesMaps, nextInterpolatorReady, slotsMap],
67
+ [localStylesMaps, nextInterpolatorReady, shouldBlockVisibility, slotsMap],
66
68
  );
67
69
 
68
70
  useLayoutEffect(() => {
@@ -33,7 +33,8 @@ export const registerScreenSlots = (
33
33
  if (
34
34
  previous?.localStylesMaps === slots.localStylesMaps &&
35
35
  previous.nextInterpolatorReady === slots.nextInterpolatorReady &&
36
- previous.slotsMap === slots.slotsMap
36
+ previous.slotsMap === slots.slotsMap &&
37
+ previous.visibilityBlocked === slots.visibilityBlocked
37
38
  ) {
38
39
  return;
39
40
  }