react-native-screen-transitions 3.9.0-alpha.0 → 3.9.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (344) hide show
  1. package/lib/commonjs/shared/components/boundary/components/boundary-target.js +10 -10
  2. package/lib/commonjs/shared/components/boundary/components/boundary-target.js.map +1 -1
  3. package/lib/commonjs/shared/components/boundary/create-boundary-component.js +45 -101
  4. package/lib/commonjs/shared/components/boundary/create-boundary-component.js.map +1 -1
  5. package/lib/commonjs/shared/components/boundary/hooks/use-boundary-measurement.js +103 -0
  6. package/lib/commonjs/shared/components/boundary/hooks/use-boundary-measurement.js.map +1 -0
  7. package/lib/commonjs/shared/components/boundary/hooks/use-boundary-presence.js +7 -4
  8. package/lib/commonjs/shared/components/boundary/hooks/use-boundary-presence.js.map +1 -1
  9. package/lib/commonjs/shared/components/boundary/hooks/use-initial-destination-measurement.js +24 -14
  10. package/lib/commonjs/shared/components/boundary/hooks/use-initial-destination-measurement.js.map +1 -1
  11. package/lib/commonjs/shared/components/boundary/hooks/use-initial-source-measurement.js +3 -4
  12. package/lib/commonjs/shared/components/boundary/hooks/use-initial-source-measurement.js.map +1 -1
  13. package/lib/commonjs/shared/components/boundary/hooks/use-measurer.js +6 -8
  14. package/lib/commonjs/shared/components/boundary/hooks/use-measurer.js.map +1 -1
  15. package/lib/commonjs/shared/components/boundary/hooks/use-refresh-boundary.js +6 -3
  16. package/lib/commonjs/shared/components/boundary/hooks/use-refresh-boundary.js.map +1 -1
  17. package/lib/commonjs/shared/components/boundary/index.js +2 -2
  18. package/lib/commonjs/shared/components/boundary/portal/components/portal-boundary-host.js +8 -2
  19. package/lib/commonjs/shared/components/boundary/portal/components/portal-boundary-host.js.map +1 -1
  20. package/lib/commonjs/shared/components/boundary/portal/components/portal-provider.js +5 -2
  21. package/lib/commonjs/shared/components/boundary/portal/components/portal-provider.js.map +1 -1
  22. package/lib/commonjs/shared/components/boundary/portal/components/portal.js +10 -7
  23. package/lib/commonjs/shared/components/boundary/portal/components/portal.js.map +1 -1
  24. package/lib/commonjs/shared/components/boundary/portal/resolve-portal.js +36 -0
  25. package/lib/commonjs/shared/components/boundary/portal/resolve-portal.js.map +1 -0
  26. package/lib/commonjs/shared/components/boundary/portal/teleport.js +23 -0
  27. package/lib/commonjs/shared/components/boundary/portal/teleport.js.map +1 -0
  28. package/lib/commonjs/shared/components/boundary/providers/{boundary-owner.provider.js → boundary-root.provider.js} +21 -23
  29. package/lib/commonjs/shared/components/boundary/providers/boundary-root.provider.js.map +1 -0
  30. package/lib/commonjs/shared/components/boundary/utils/destination-signals.js +33 -2
  31. package/lib/commonjs/shared/components/boundary/utils/destination-signals.js.map +1 -1
  32. package/lib/commonjs/shared/components/create-transition-aware-component.js +2 -20
  33. package/lib/commonjs/shared/components/create-transition-aware-component.js.map +1 -1
  34. package/lib/commonjs/shared/components/overlay/variations/float-overlay.js +1 -1
  35. package/lib/commonjs/shared/components/overlay/variations/float-overlay.js.map +1 -1
  36. package/lib/commonjs/shared/components/screen-container/layers/backdrop.js +2 -14
  37. package/lib/commonjs/shared/components/screen-container/layers/backdrop.js.map +1 -1
  38. package/lib/commonjs/shared/components/screen-container/layers/content.js +4 -16
  39. package/lib/commonjs/shared/components/screen-container/layers/content.js.map +1 -1
  40. package/lib/commonjs/shared/components/screen-container/layers/maybe-masked-navigation-container.js +4 -15
  41. package/lib/commonjs/shared/components/screen-container/layers/maybe-masked-navigation-container.js.map +1 -1
  42. package/lib/commonjs/shared/components/screen-container/layers/surface-container.js +4 -16
  43. package/lib/commonjs/shared/components/screen-container/layers/surface-container.js.map +1 -1
  44. package/lib/commonjs/shared/hooks/navigation/use-stack.js +17 -2
  45. package/lib/commonjs/shared/hooks/navigation/use-stack.js.map +1 -1
  46. package/lib/commonjs/shared/providers/screen/animation/helpers/pipeline.js +142 -33
  47. package/lib/commonjs/shared/providers/screen/animation/helpers/pipeline.js.map +1 -1
  48. package/lib/commonjs/shared/providers/screen/animation/helpers/stack-progress.js +23 -12
  49. package/lib/commonjs/shared/providers/screen/animation/helpers/stack-progress.js.map +1 -1
  50. package/lib/commonjs/shared/providers/screen/animation/helpers/use-build-transition-state.js +1 -0
  51. package/lib/commonjs/shared/providers/screen/animation/helpers/use-build-transition-state.js.map +1 -1
  52. package/lib/commonjs/shared/providers/screen/screen-composer.js +1 -1
  53. package/lib/commonjs/shared/providers/screen/screen-composer.js.map +1 -1
  54. package/lib/commonjs/shared/providers/screen/styles/helpers/opening-phase.js +32 -0
  55. package/lib/commonjs/shared/providers/screen/styles/helpers/opening-phase.js.map +1 -0
  56. package/lib/commonjs/shared/providers/screen/styles/helpers/resolve-slot-styles/index.js +7 -8
  57. package/lib/commonjs/shared/providers/screen/styles/helpers/resolve-slot-styles/index.js.map +1 -1
  58. package/lib/commonjs/shared/providers/screen/styles/helpers/resolve-slot-styles/materialize-slot.js.map +1 -1
  59. package/lib/commonjs/shared/providers/screen/styles/helpers/resolve-slot-styles/slot-state.js +1 -20
  60. package/lib/commonjs/shared/providers/screen/styles/helpers/resolve-slot-styles/slot-state.js.map +1 -1
  61. package/lib/commonjs/shared/providers/screen/styles/helpers/visibility-gate.js +1 -11
  62. package/lib/commonjs/shared/providers/screen/styles/helpers/visibility-gate.js.map +1 -1
  63. package/lib/commonjs/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js +23 -36
  64. package/lib/commonjs/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js.map +1 -1
  65. package/lib/commonjs/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js +1 -19
  66. package/lib/commonjs/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js.map +1 -1
  67. package/lib/commonjs/shared/providers/screen/styles/hooks/use-resolved-slot-style-map.js +8 -3
  68. package/lib/commonjs/shared/providers/screen/styles/hooks/use-resolved-slot-style-map.js.map +1 -1
  69. package/lib/commonjs/shared/providers/screen/styles/index.js +25 -7
  70. package/lib/commonjs/shared/providers/screen/styles/index.js.map +1 -1
  71. package/lib/commonjs/shared/providers/screen/styles/slot.provider.js +103 -0
  72. package/lib/commonjs/shared/providers/screen/styles/slot.provider.js.map +1 -0
  73. package/lib/commonjs/shared/stores/animation.store.js +2 -0
  74. package/lib/commonjs/shared/stores/animation.store.js.map +1 -1
  75. package/lib/commonjs/shared/stores/bounds/helpers/link-pairs.helpers.js +16 -1
  76. package/lib/commonjs/shared/stores/bounds/helpers/link-pairs.helpers.js.map +1 -1
  77. package/lib/commonjs/shared/utils/bounds/navigation/zoom/build.js +8 -1
  78. package/lib/commonjs/shared/utils/bounds/navigation/zoom/build.js.map +1 -1
  79. package/lib/commonjs/shared/utils/bounds/navigation/zoom/helpers.js +59 -0
  80. package/lib/commonjs/shared/utils/bounds/navigation/zoom/helpers.js.map +1 -1
  81. package/lib/commonjs/shared/utils/logger.js +11 -0
  82. package/lib/commonjs/shared/utils/logger.js.map +1 -1
  83. package/lib/module/shared/components/boundary/components/boundary-target.js +10 -10
  84. package/lib/module/shared/components/boundary/components/boundary-target.js.map +1 -1
  85. package/lib/module/shared/components/boundary/create-boundary-component.js +47 -103
  86. package/lib/module/shared/components/boundary/create-boundary-component.js.map +1 -1
  87. package/lib/module/shared/components/boundary/hooks/use-boundary-measurement.js +98 -0
  88. package/lib/module/shared/components/boundary/hooks/use-boundary-measurement.js.map +1 -0
  89. package/lib/module/shared/components/boundary/hooks/use-boundary-presence.js +7 -4
  90. package/lib/module/shared/components/boundary/hooks/use-boundary-presence.js.map +1 -1
  91. package/lib/module/shared/components/boundary/hooks/use-initial-destination-measurement.js +24 -14
  92. package/lib/module/shared/components/boundary/hooks/use-initial-destination-measurement.js.map +1 -1
  93. package/lib/module/shared/components/boundary/hooks/use-initial-source-measurement.js +3 -4
  94. package/lib/module/shared/components/boundary/hooks/use-initial-source-measurement.js.map +1 -1
  95. package/lib/module/shared/components/boundary/hooks/use-measurer.js +6 -8
  96. package/lib/module/shared/components/boundary/hooks/use-measurer.js.map +1 -1
  97. package/lib/module/shared/components/boundary/hooks/use-refresh-boundary.js +6 -3
  98. package/lib/module/shared/components/boundary/hooks/use-refresh-boundary.js.map +1 -1
  99. package/lib/module/shared/components/boundary/index.js +2 -2
  100. package/lib/module/shared/components/boundary/portal/components/portal-boundary-host.js +8 -2
  101. package/lib/module/shared/components/boundary/portal/components/portal-boundary-host.js.map +1 -1
  102. package/lib/module/shared/components/boundary/portal/components/portal-provider.js +4 -1
  103. package/lib/module/shared/components/boundary/portal/components/portal-provider.js.map +1 -1
  104. package/lib/module/shared/components/boundary/portal/components/portal.js +11 -8
  105. package/lib/module/shared/components/boundary/portal/components/portal.js.map +1 -1
  106. package/lib/module/shared/components/boundary/portal/resolve-portal.js +31 -0
  107. package/lib/module/shared/components/boundary/portal/resolve-portal.js.map +1 -0
  108. package/lib/module/shared/components/boundary/portal/teleport.js +19 -0
  109. package/lib/module/shared/components/boundary/portal/teleport.js.map +1 -0
  110. package/lib/module/shared/components/boundary/providers/{boundary-owner.provider.js → boundary-root.provider.js} +18 -20
  111. package/lib/module/shared/components/boundary/providers/boundary-root.provider.js.map +1 -0
  112. package/lib/module/shared/components/boundary/utils/destination-signals.js +33 -2
  113. package/lib/module/shared/components/boundary/utils/destination-signals.js.map +1 -1
  114. package/lib/module/shared/components/create-transition-aware-component.js +4 -22
  115. package/lib/module/shared/components/create-transition-aware-component.js.map +1 -1
  116. package/lib/module/shared/components/overlay/variations/float-overlay.js +2 -2
  117. package/lib/module/shared/components/overlay/variations/float-overlay.js.map +1 -1
  118. package/lib/module/shared/components/screen-container/layers/backdrop.js +4 -16
  119. package/lib/module/shared/components/screen-container/layers/backdrop.js.map +1 -1
  120. package/lib/module/shared/components/screen-container/layers/content.js +4 -16
  121. package/lib/module/shared/components/screen-container/layers/content.js.map +1 -1
  122. package/lib/module/shared/components/screen-container/layers/maybe-masked-navigation-container.js +5 -16
  123. package/lib/module/shared/components/screen-container/layers/maybe-masked-navigation-container.js.map +1 -1
  124. package/lib/module/shared/components/screen-container/layers/surface-container.js +4 -16
  125. package/lib/module/shared/components/screen-container/layers/surface-container.js.map +1 -1
  126. package/lib/module/shared/hooks/navigation/use-stack.js +19 -4
  127. package/lib/module/shared/hooks/navigation/use-stack.js.map +1 -1
  128. package/lib/module/shared/providers/screen/animation/helpers/pipeline.js +144 -35
  129. package/lib/module/shared/providers/screen/animation/helpers/pipeline.js.map +1 -1
  130. package/lib/module/shared/providers/screen/animation/helpers/stack-progress.js +20 -10
  131. package/lib/module/shared/providers/screen/animation/helpers/stack-progress.js.map +1 -1
  132. package/lib/module/shared/providers/screen/animation/helpers/use-build-transition-state.js +1 -0
  133. package/lib/module/shared/providers/screen/animation/helpers/use-build-transition-state.js.map +1 -1
  134. package/lib/module/shared/providers/screen/screen-composer.js +2 -2
  135. package/lib/module/shared/providers/screen/screen-composer.js.map +1 -1
  136. package/lib/module/shared/providers/screen/styles/helpers/opening-phase.js +26 -0
  137. package/lib/module/shared/providers/screen/styles/helpers/opening-phase.js.map +1 -0
  138. package/lib/module/shared/providers/screen/styles/helpers/resolve-slot-styles/index.js +7 -8
  139. package/lib/module/shared/providers/screen/styles/helpers/resolve-slot-styles/index.js.map +1 -1
  140. package/lib/module/shared/providers/screen/styles/helpers/resolve-slot-styles/materialize-slot.js.map +1 -1
  141. package/lib/module/shared/providers/screen/styles/helpers/resolve-slot-styles/slot-state.js +0 -18
  142. package/lib/module/shared/providers/screen/styles/helpers/resolve-slot-styles/slot-state.js.map +1 -1
  143. package/lib/module/shared/providers/screen/styles/helpers/visibility-gate.js +0 -9
  144. package/lib/module/shared/providers/screen/styles/helpers/visibility-gate.js.map +1 -1
  145. package/lib/module/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js +22 -35
  146. package/lib/module/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js.map +1 -1
  147. package/lib/module/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js +1 -19
  148. package/lib/module/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js.map +1 -1
  149. package/lib/module/shared/providers/screen/styles/hooks/use-resolved-slot-style-map.js +9 -4
  150. package/lib/module/shared/providers/screen/styles/hooks/use-resolved-slot-style-map.js.map +1 -1
  151. package/lib/module/shared/providers/screen/styles/index.js +1 -1
  152. package/lib/module/shared/providers/screen/styles/index.js.map +1 -1
  153. package/lib/module/shared/providers/screen/styles/slot.provider.js +91 -0
  154. package/lib/module/shared/providers/screen/styles/slot.provider.js.map +1 -0
  155. package/lib/module/shared/stores/animation.store.js +2 -0
  156. package/lib/module/shared/stores/animation.store.js.map +1 -1
  157. package/lib/module/shared/stores/bounds/helpers/link-pairs.helpers.js +14 -0
  158. package/lib/module/shared/stores/bounds/helpers/link-pairs.helpers.js.map +1 -1
  159. package/lib/module/shared/utils/bounds/navigation/zoom/build.js +9 -2
  160. package/lib/module/shared/utils/bounds/navigation/zoom/build.js.map +1 -1
  161. package/lib/module/shared/utils/bounds/navigation/zoom/helpers.js +58 -0
  162. package/lib/module/shared/utils/bounds/navigation/zoom/helpers.js.map +1 -1
  163. package/lib/module/shared/utils/logger.js +11 -0
  164. package/lib/module/shared/utils/logger.js.map +1 -1
  165. package/lib/typescript/blank-stack/navigators/create-blank-stack-navigator.d.ts +2 -1
  166. package/lib/typescript/blank-stack/navigators/create-blank-stack-navigator.d.ts.map +1 -1
  167. package/lib/typescript/component-stack/components/component-screen.d.ts +1 -1
  168. package/lib/typescript/component-stack/components/component-screen.d.ts.map +1 -1
  169. package/lib/typescript/component-stack/navigators/create-component-stack-navigator.d.ts +2 -1
  170. package/lib/typescript/component-stack/navigators/create-component-stack-navigator.d.ts.map +1 -1
  171. package/lib/typescript/native-stack/navigators/createNativeStackNavigator.d.ts +1 -1
  172. package/lib/typescript/native-stack/navigators/createNativeStackNavigator.d.ts.map +1 -1
  173. package/lib/typescript/native-stack/views/NativeStackView.d.ts +2 -1
  174. package/lib/typescript/native-stack/views/NativeStackView.d.ts.map +1 -1
  175. package/lib/typescript/native-stack/views/useHeaderConfigProps.d.ts +2 -2
  176. package/lib/typescript/shared/adapters/with-screen-transitions/context.d.ts +1 -1
  177. package/lib/typescript/shared/adapters/with-screen-transitions/context.d.ts.map +1 -1
  178. package/lib/typescript/shared/adapters/with-screen-transitions/stack-layout.d.ts +1 -1
  179. package/lib/typescript/shared/adapters/with-screen-transitions/stack-layout.d.ts.map +1 -1
  180. package/lib/typescript/shared/components/activity/variants/activity-container.d.ts +1 -1
  181. package/lib/typescript/shared/components/activity/variants/activity-container.d.ts.map +1 -1
  182. package/lib/typescript/shared/components/activity/variants/activity-screen.d.ts +1 -1
  183. package/lib/typescript/shared/components/activity/variants/activity-screen.d.ts.map +1 -1
  184. package/lib/typescript/shared/components/boundary/components/boundary-target.d.ts +1 -1
  185. package/lib/typescript/shared/components/boundary/components/boundary-target.d.ts.map +1 -1
  186. package/lib/typescript/shared/components/boundary/create-boundary-component.d.ts.map +1 -1
  187. package/lib/typescript/shared/components/boundary/hooks/use-boundary-measurement.d.ts +32 -0
  188. package/lib/typescript/shared/components/boundary/hooks/use-boundary-measurement.d.ts.map +1 -0
  189. package/lib/typescript/shared/components/boundary/hooks/use-boundary-presence.d.ts +2 -1
  190. package/lib/typescript/shared/components/boundary/hooks/use-boundary-presence.d.ts.map +1 -1
  191. package/lib/typescript/shared/components/boundary/hooks/use-initial-destination-measurement.d.ts +3 -2
  192. package/lib/typescript/shared/components/boundary/hooks/use-initial-destination-measurement.d.ts.map +1 -1
  193. package/lib/typescript/shared/components/boundary/hooks/use-initial-source-measurement.d.ts +2 -2
  194. package/lib/typescript/shared/components/boundary/hooks/use-initial-source-measurement.d.ts.map +1 -1
  195. package/lib/typescript/shared/components/boundary/hooks/use-measurer.d.ts +3 -5
  196. package/lib/typescript/shared/components/boundary/hooks/use-measurer.d.ts.map +1 -1
  197. package/lib/typescript/shared/components/boundary/hooks/use-refresh-boundary.d.ts +3 -3
  198. package/lib/typescript/shared/components/boundary/hooks/use-refresh-boundary.d.ts.map +1 -1
  199. package/lib/typescript/shared/components/boundary/index.d.ts +7 -211
  200. package/lib/typescript/shared/components/boundary/index.d.ts.map +1 -1
  201. package/lib/typescript/shared/components/boundary/portal/components/host.d.ts +2 -2
  202. package/lib/typescript/shared/components/boundary/portal/components/host.d.ts.map +1 -1
  203. package/lib/typescript/shared/components/boundary/portal/components/portal-boundary-host.d.ts +1 -1
  204. package/lib/typescript/shared/components/boundary/portal/components/portal-boundary-host.d.ts.map +1 -1
  205. package/lib/typescript/shared/components/boundary/portal/components/portal-provider.d.ts +1 -1
  206. package/lib/typescript/shared/components/boundary/portal/components/portal-provider.d.ts.map +1 -1
  207. package/lib/typescript/shared/components/boundary/portal/components/portal.d.ts +1 -1
  208. package/lib/typescript/shared/components/boundary/portal/components/portal.d.ts.map +1 -1
  209. package/lib/typescript/shared/components/boundary/portal/resolve-portal.d.ts +14 -0
  210. package/lib/typescript/shared/components/boundary/portal/resolve-portal.d.ts.map +1 -0
  211. package/lib/typescript/shared/components/boundary/portal/teleport.d.ts +6 -0
  212. package/lib/typescript/shared/components/boundary/portal/teleport.d.ts.map +1 -0
  213. package/lib/typescript/shared/components/boundary/providers/{boundary-owner.provider.d.ts → boundary-root.provider.d.ts} +12 -14
  214. package/lib/typescript/shared/components/boundary/providers/boundary-root.provider.d.ts.map +1 -0
  215. package/lib/typescript/shared/components/boundary/utils/destination-signals.d.ts +1 -0
  216. package/lib/typescript/shared/components/boundary/utils/destination-signals.d.ts.map +1 -1
  217. package/lib/typescript/shared/components/create-transition-aware-component.d.ts +5 -6
  218. package/lib/typescript/shared/components/create-transition-aware-component.d.ts.map +1 -1
  219. package/lib/typescript/shared/components/masked-view.d.ts +1 -1
  220. package/lib/typescript/shared/components/masked-view.d.ts.map +1 -1
  221. package/lib/typescript/shared/components/overlay/variations/float-overlay.d.ts +1 -1
  222. package/lib/typescript/shared/components/overlay/variations/float-overlay.d.ts.map +1 -1
  223. package/lib/typescript/shared/components/overlay/variations/overlay-host.d.ts +1 -1
  224. package/lib/typescript/shared/components/overlay/variations/overlay-host.d.ts.map +1 -1
  225. package/lib/typescript/shared/components/scene-view.d.ts +1 -1
  226. package/lib/typescript/shared/components/scene-view.d.ts.map +1 -1
  227. package/lib/typescript/shared/components/screen-container/index.d.ts +1 -1
  228. package/lib/typescript/shared/components/screen-container/index.d.ts.map +1 -1
  229. package/lib/typescript/shared/components/screen-container/layers/backdrop.d.ts +1 -1
  230. package/lib/typescript/shared/components/screen-container/layers/backdrop.d.ts.map +1 -1
  231. package/lib/typescript/shared/components/screen-container/layers/content.d.ts +1 -1
  232. package/lib/typescript/shared/components/screen-container/layers/content.d.ts.map +1 -1
  233. package/lib/typescript/shared/components/screen-container/layers/maybe-masked-navigation-container.d.ts +1 -1
  234. package/lib/typescript/shared/components/screen-container/layers/maybe-masked-navigation-container.d.ts.map +1 -1
  235. package/lib/typescript/shared/components/screen-container/layers/surface-container.d.ts +1 -1
  236. package/lib/typescript/shared/components/screen-container/layers/surface-container.d.ts.map +1 -1
  237. package/lib/typescript/shared/hooks/navigation/use-stack.d.ts +1 -1
  238. package/lib/typescript/shared/hooks/navigation/use-stack.d.ts.map +1 -1
  239. package/lib/typescript/shared/index.d.ts +663 -919
  240. package/lib/typescript/shared/index.d.ts.map +1 -1
  241. package/lib/typescript/shared/providers/screen/animation/helpers/hydrate-transition-state/types.d.ts +1 -0
  242. package/lib/typescript/shared/providers/screen/animation/helpers/hydrate-transition-state/types.d.ts.map +1 -1
  243. package/lib/typescript/shared/providers/screen/animation/helpers/pipeline.d.ts.map +1 -1
  244. package/lib/typescript/shared/providers/screen/animation/helpers/stack-progress.d.ts +2 -1
  245. package/lib/typescript/shared/providers/screen/animation/helpers/stack-progress.d.ts.map +1 -1
  246. package/lib/typescript/shared/providers/screen/animation/helpers/use-build-transition-state.d.ts +1 -0
  247. package/lib/typescript/shared/providers/screen/animation/helpers/use-build-transition-state.d.ts.map +1 -1
  248. package/lib/typescript/shared/providers/screen/descriptors/descriptors.provider.d.ts +1 -1
  249. package/lib/typescript/shared/providers/screen/descriptors/descriptors.provider.d.ts.map +1 -1
  250. package/lib/typescript/shared/providers/screen/screen-composer.d.ts +1 -1
  251. package/lib/typescript/shared/providers/screen/screen-composer.d.ts.map +1 -1
  252. package/lib/typescript/shared/providers/screen/styles/components/floating-overlay-layer.d.ts +1 -1
  253. package/lib/typescript/shared/providers/screen/styles/components/floating-overlay-layer.d.ts.map +1 -1
  254. package/lib/typescript/shared/providers/screen/styles/helpers/opening-phase.d.ts +16 -0
  255. package/lib/typescript/shared/providers/screen/styles/helpers/opening-phase.d.ts.map +1 -0
  256. package/lib/typescript/shared/providers/screen/styles/helpers/resolve-slot-styles/index.d.ts +3 -4
  257. package/lib/typescript/shared/providers/screen/styles/helpers/resolve-slot-styles/index.d.ts.map +1 -1
  258. package/lib/typescript/shared/providers/screen/styles/helpers/resolve-slot-styles/materialize-slot.d.ts.map +1 -1
  259. package/lib/typescript/shared/providers/screen/styles/helpers/resolve-slot-styles/slot-state.d.ts +0 -1
  260. package/lib/typescript/shared/providers/screen/styles/helpers/resolve-slot-styles/slot-state.d.ts.map +1 -1
  261. package/lib/typescript/shared/providers/screen/styles/helpers/visibility-gate.d.ts +0 -1
  262. package/lib/typescript/shared/providers/screen/styles/helpers/visibility-gate.d.ts.map +1 -1
  263. package/lib/typescript/shared/providers/screen/styles/hooks/use-interpolated-style-maps.d.ts +0 -5
  264. package/lib/typescript/shared/providers/screen/styles/hooks/use-interpolated-style-maps.d.ts.map +1 -1
  265. package/lib/typescript/shared/providers/screen/styles/hooks/use-maybe-block-visibility.d.ts +2 -3
  266. package/lib/typescript/shared/providers/screen/styles/hooks/use-maybe-block-visibility.d.ts.map +1 -1
  267. package/lib/typescript/shared/providers/screen/styles/hooks/use-resolved-slot-style-map.d.ts.map +1 -1
  268. package/lib/typescript/shared/providers/screen/styles/index.d.ts +1 -1
  269. package/lib/typescript/shared/providers/screen/styles/index.d.ts.map +1 -1
  270. package/lib/typescript/shared/providers/screen/styles/slot.provider.d.ts +23 -0
  271. package/lib/typescript/shared/providers/screen/styles/slot.provider.d.ts.map +1 -0
  272. package/lib/typescript/shared/stores/animation.store.d.ts +1 -0
  273. package/lib/typescript/shared/stores/animation.store.d.ts.map +1 -1
  274. package/lib/typescript/shared/stores/bounds/helpers/link-pairs.helpers.d.ts +6 -1
  275. package/lib/typescript/shared/stores/bounds/helpers/link-pairs.helpers.d.ts.map +1 -1
  276. package/lib/typescript/shared/stores/bounds/types.d.ts +13 -0
  277. package/lib/typescript/shared/stores/bounds/types.d.ts.map +1 -1
  278. package/lib/typescript/shared/utils/bounds/navigation/zoom/build.d.ts.map +1 -1
  279. package/lib/typescript/shared/utils/bounds/navigation/zoom/helpers.d.ts +9 -0
  280. package/lib/typescript/shared/utils/bounds/navigation/zoom/helpers.d.ts.map +1 -1
  281. package/lib/typescript/shared/utils/logger.d.ts +6 -0
  282. package/lib/typescript/shared/utils/logger.d.ts.map +1 -1
  283. package/package.json +6 -1
  284. package/src/shared/components/boundary/components/boundary-target.tsx +12 -12
  285. package/src/shared/components/boundary/create-boundary-component.tsx +59 -142
  286. package/src/shared/components/boundary/hooks/use-boundary-measurement.ts +127 -0
  287. package/src/shared/components/boundary/hooks/use-boundary-presence.ts +7 -5
  288. package/src/shared/components/boundary/hooks/use-initial-destination-measurement.ts +27 -11
  289. package/src/shared/components/boundary/hooks/use-initial-source-measurement.ts +5 -5
  290. package/src/shared/components/boundary/hooks/use-measurer.ts +11 -14
  291. package/src/shared/components/boundary/hooks/use-refresh-boundary.ts +5 -5
  292. package/src/shared/components/boundary/index.tsx +2 -2
  293. package/src/shared/components/boundary/portal/components/portal-boundary-host.tsx +10 -3
  294. package/src/shared/components/boundary/portal/components/portal-provider.tsx +5 -1
  295. package/src/shared/components/boundary/portal/components/portal.tsx +15 -10
  296. package/src/shared/components/boundary/portal/resolve-portal.ts +40 -0
  297. package/src/shared/components/boundary/portal/teleport.ts +21 -0
  298. package/src/shared/components/boundary/providers/{boundary-owner.provider.tsx → boundary-root.provider.tsx} +27 -32
  299. package/src/shared/components/boundary/utils/destination-signals.ts +53 -2
  300. package/src/shared/components/create-transition-aware-component.tsx +3 -25
  301. package/src/shared/components/overlay/variations/float-overlay.tsx +3 -3
  302. package/src/shared/components/screen-container/layers/backdrop.tsx +4 -17
  303. package/src/shared/components/screen-container/layers/content.tsx +4 -16
  304. package/src/shared/components/screen-container/layers/maybe-masked-navigation-container.tsx +8 -18
  305. package/src/shared/components/screen-container/layers/surface-container.tsx +4 -17
  306. package/src/shared/hooks/navigation/use-stack.tsx +32 -1
  307. package/src/shared/providers/screen/animation/helpers/hydrate-transition-state/types.ts +1 -0
  308. package/src/shared/providers/screen/animation/helpers/pipeline.ts +253 -77
  309. package/src/shared/providers/screen/animation/helpers/stack-progress.ts +31 -16
  310. package/src/shared/providers/screen/animation/helpers/use-build-transition-state.ts +2 -0
  311. package/src/shared/providers/screen/screen-composer.tsx +3 -3
  312. package/src/shared/providers/screen/styles/helpers/opening-phase.ts +25 -0
  313. package/src/shared/providers/screen/styles/helpers/resolve-slot-styles/index.ts +8 -10
  314. package/src/shared/providers/screen/styles/helpers/resolve-slot-styles/materialize-slot.ts +0 -1
  315. package/src/shared/providers/screen/styles/helpers/resolve-slot-styles/slot-state.ts +0 -24
  316. package/src/shared/providers/screen/styles/helpers/visibility-gate.ts +0 -12
  317. package/src/shared/providers/screen/styles/hooks/use-interpolated-style-maps.tsx +29 -37
  318. package/src/shared/providers/screen/styles/hooks/use-maybe-block-visibility.tsx +0 -18
  319. package/src/shared/providers/screen/styles/hooks/use-resolved-slot-style-map.tsx +17 -4
  320. package/src/shared/providers/screen/styles/index.tsx +8 -4
  321. package/src/shared/providers/screen/styles/slot.provider.tsx +111 -0
  322. package/src/shared/stores/animation.store.ts +3 -0
  323. package/src/shared/stores/bounds/helpers/link-pairs.helpers.ts +17 -0
  324. package/src/shared/stores/bounds/types.ts +14 -0
  325. package/src/shared/utils/bounds/navigation/zoom/build.ts +9 -1
  326. package/src/shared/utils/bounds/navigation/zoom/helpers.ts +96 -0
  327. package/src/shared/utils/logger.ts +12 -0
  328. package/lib/commonjs/shared/components/boundary/providers/boundary-owner.provider.js.map +0 -1
  329. package/lib/commonjs/shared/providers/screen/styles/helpers/preserve-animated-props-only.js +0 -26
  330. package/lib/commonjs/shared/providers/screen/styles/helpers/preserve-animated-props-only.js.map +0 -1
  331. package/lib/commonjs/shared/providers/screen/styles/styles.provider.js +0 -61
  332. package/lib/commonjs/shared/providers/screen/styles/styles.provider.js.map +0 -1
  333. package/lib/module/shared/components/boundary/providers/boundary-owner.provider.js.map +0 -1
  334. package/lib/module/shared/providers/screen/styles/helpers/preserve-animated-props-only.js +0 -21
  335. package/lib/module/shared/providers/screen/styles/helpers/preserve-animated-props-only.js.map +0 -1
  336. package/lib/module/shared/providers/screen/styles/styles.provider.js +0 -53
  337. package/lib/module/shared/providers/screen/styles/styles.provider.js.map +0 -1
  338. package/lib/typescript/shared/components/boundary/providers/boundary-owner.provider.d.ts.map +0 -1
  339. package/lib/typescript/shared/providers/screen/styles/helpers/preserve-animated-props-only.d.ts +0 -3
  340. package/lib/typescript/shared/providers/screen/styles/helpers/preserve-animated-props-only.d.ts.map +0 -1
  341. package/lib/typescript/shared/providers/screen/styles/styles.provider.d.ts +0 -14
  342. package/lib/typescript/shared/providers/screen/styles/styles.provider.d.ts.map +0 -1
  343. package/src/shared/providers/screen/styles/helpers/preserve-animated-props-only.ts +0 -22
  344. package/src/shared/providers/screen/styles/styles.provider.tsx +0 -60
@@ -2,31 +2,23 @@ import {
2
2
  type ComponentType,
3
3
  forwardRef,
4
4
  memo,
5
- useCallback,
6
5
  useImperativeHandle,
7
6
  useMemo,
8
7
  } from "react";
9
- import type { View } from "react-native";
10
- import Animated, {
11
- runOnUI,
12
- useAnimatedRef,
13
- useAnimatedStyle,
14
- } from "react-native-reanimated";
15
- import { NO_STYLES } from "../../constants";
8
+ import Animated from "react-native-reanimated";
16
9
  import { useDescriptorsStore } from "../../providers/screen/descriptors";
17
- import { useScreenStyles } from "../../providers/screen/styles";
18
- import { createPendingPairKey } from "../../stores/bounds/helpers/link-pairs.helpers";
19
- import { prepareStyleForBounds } from "../../utils/bounds/helpers/styles/styles";
20
- import { useBoundaryPresence } from "./hooks/use-boundary-presence";
21
- import { useInitialDestinationMeasurement } from "./hooks/use-initial-destination-measurement";
22
- import { useInitialSourceMeasurement } from "./hooks/use-initial-source-measurement";
23
- import { useMeasurer } from "./hooks/use-measurer";
24
- import { useRefreshBoundary } from "./hooks/use-refresh-boundary";
25
10
  import {
26
- BoundaryOwnerProvider,
27
- useBoundaryOwner,
28
- } from "./providers/boundary-owner.provider";
29
- import type { BoundaryComponentProps, BoundaryConfigProps } from "./types";
11
+ useSlotStackingStyles,
12
+ useSlotStyles,
13
+ } from "../../providers/screen/styles";
14
+ import { createBoundTag } from "../../stores/bounds/helpers/link-pairs.helpers";
15
+ import { useBoundaryMeasurement } from "./hooks/use-boundary-measurement";
16
+ import { resolveBoundaryPortal } from "./portal/resolve-portal";
17
+ import {
18
+ BoundaryRootProvider,
19
+ useBoundaryRootState,
20
+ } from "./providers/boundary-root.provider";
21
+ import type { BoundaryComponentProps } from "./types";
30
22
 
31
23
  interface CreateBoundaryComponentOptions {
32
24
  alreadyAnimated?: boolean;
@@ -46,7 +38,6 @@ export function createBoundaryComponent<P extends object>(
46
38
  React.ComponentRef<typeof AnimatedComponent>,
47
39
  BoundaryComponentProps<P>
48
40
  >((props, forwardedRef) => {
49
- const ownerRef = useAnimatedRef<View>();
50
41
  const {
51
42
  enabled = true,
52
43
  group,
@@ -57,12 +48,15 @@ export function createBoundaryComponent<P extends object>(
57
48
  method,
58
49
  style,
59
50
  onPress,
60
- portal,
51
+ portal: portalProp,
61
52
  ...rest
62
53
  } = props as any;
63
54
 
64
- const linkId = String(id);
65
- const entryTag = group ? `${group}:${linkId}` : linkId;
55
+ const boundTag = useMemo(
56
+ () => createBoundTag(String(id), group),
57
+ [id, group],
58
+ );
59
+ const portal = resolveBoundaryPortal(portalProp);
66
60
 
67
61
  const currentScreenKey = useDescriptorsStore(
68
62
  (s) => s.derivations.currentScreenKey,
@@ -70,144 +64,67 @@ export function createBoundaryComponent<P extends object>(
70
64
  const hasConfiguredInterpolator = useDescriptorsStore(
71
65
  (s) => s.derivations.hasConfiguredInterpolator,
72
66
  );
73
-
74
67
  const runtimeEnabled = enabled && hasConfiguredInterpolator;
75
- const boundaryConfig = useMemo<BoundaryConfigProps>(() => {
76
- return {
77
- anchor,
78
- scaleMode,
79
- target,
80
- method,
81
- };
82
- }, [anchor, scaleMode, target, method]);
83
-
84
- const ownerPreparedStyles = useMemo(
85
- () => prepareStyleForBounds(style),
86
- [style],
87
- );
88
- const { stylesMap } = useScreenStyles();
89
-
90
- const associatedStyles = useAnimatedStyle(() => {
91
- "worklet";
92
- return stylesMap.get()[entryTag]?.style ?? NO_STYLES;
93
- });
94
-
95
- const associatedStackingStyles = useAnimatedStyle(() => {
96
- "worklet";
97
- const baseStyle = stylesMap.get()[entryTag]?.style;
98
- const zIndex = baseStyle?.zIndex ?? 0;
99
- const elevation = baseStyle?.elevation ?? 0;
68
+ // Associated slot styles attach whenever the boundary is enabled,
69
+ // independent of whether an interpolator is configured for this transition.
70
+ const shouldAttachAssociatedStyles = enabled;
100
71
 
101
- if (zIndex === 0 && elevation === 0) {
102
- return NO_STYLES;
103
- }
72
+ const associatedStyles = useSlotStyles(boundTag.tag);
73
+ const associatedStackingStyles = useSlotStackingStyles(boundTag.tag);
104
74
 
105
- return { zIndex, elevation };
75
+ const {
76
+ ref,
77
+ contextValue,
78
+ measuredRef,
79
+ hasActiveTarget,
80
+ targetPreparedStyles,
81
+ } = useBoundaryRootState({
82
+ boundTag,
83
+ portal,
84
+ associatedTargetStyles: shouldAttachAssociatedStyles
85
+ ? associatedStyles
86
+ : undefined,
106
87
  });
107
88
 
108
- const { contextValue, measuredRef, hasActiveTarget, targetPreparedStyles } =
109
- useBoundaryOwner({
110
- ownerRef,
111
- associatedTargetStyles: runtimeEnabled ? associatedStyles : undefined,
112
- entryTag,
113
- portal,
114
- });
115
-
116
- const preparedStyles = targetPreparedStyles ?? ownerPreparedStyles;
117
-
118
- const portalHost =
119
- typeof portal === "object"
120
- ? (portal.attachTo ?? "current-screen")
121
- : portal
122
- ? "current-screen"
123
- : undefined;
124
-
125
- const measureBoundary = useMeasurer({
89
+ const { onPress: resolvedOnPress } = useBoundaryMeasurement({
90
+ boundTag,
126
91
  enabled,
127
- entryTag,
128
- linkId,
129
- group,
92
+ runtimeEnabled,
130
93
  currentScreenKey,
131
- preparedStyles,
132
- measuredAnimatedRef: measuredRef,
133
- portalHost,
134
- });
135
-
136
- // Register/unregister this boundary in the presence map so source/destination
137
- // matching can resolve across concrete screen keys.
138
- useBoundaryPresence({
139
- enabled: runtimeEnabled,
140
- entryTag,
141
- currentScreenKey,
142
- boundaryConfig,
143
- });
144
-
145
- const shouldPassivelyMeasureSource =
146
- shouldAutoMeasure && typeof onPress !== "function";
147
-
148
- useInitialSourceMeasurement({
149
- enabled: runtimeEnabled,
150
- measureBoundary,
151
- linkId,
152
- group,
153
- shouldAutoMeasure: shouldPassivelyMeasureSource,
154
- });
155
-
156
- useInitialDestinationMeasurement({
157
- linkId,
158
- enabled: runtimeEnabled,
159
- measureBoundary,
160
- });
161
-
162
- useRefreshBoundary({
163
- enabled: runtimeEnabled,
164
- linkId,
165
- group,
166
- measureBoundary,
94
+ measuredRef,
95
+ style,
96
+ targetPreparedStyles,
97
+ portal,
98
+ shouldAutoMeasure,
99
+ config: { anchor, scaleMode, target, method },
100
+ onPress,
167
101
  });
168
102
 
169
- const handlePress = useCallback(
170
- (...args: unknown[]) => {
171
- // Press path has priority: capture source before user onPress/navigation.
172
- runOnUI(measureBoundary)({
173
- type: "source",
174
- pairKey: createPendingPairKey(currentScreenKey),
175
- });
176
-
177
- if (typeof onPress === "function") {
178
- onPress(...args);
179
- }
180
- },
181
- [measureBoundary, onPress, currentScreenKey],
182
- );
183
-
184
- const resolvedOnPress =
185
- typeof onPress === "function" ? handlePress : undefined;
103
+ useImperativeHandle(forwardedRef, () => ref.current as any, [ref]);
186
104
 
187
- useImperativeHandle(forwardedRef, () => ownerRef.current as any, [
188
- ownerRef,
189
- ]);
105
+ // A nested active target takes the full associated style, so the root keeps
106
+ // only its stacking context; otherwise the root wears the full style.
107
+ const attachedStyle = shouldAttachAssociatedStyles
108
+ ? hasActiveTarget
109
+ ? associatedStackingStyles
110
+ : associatedStyles
111
+ : undefined;
190
112
 
191
113
  return (
192
- <BoundaryOwnerProvider value={contextValue}>
114
+ <BoundaryRootProvider value={contextValue}>
193
115
  <AnimatedComponent
194
116
  {...rest}
195
- ref={ownerRef}
196
- style={[
197
- style,
198
- runtimeEnabled
199
- ? hasActiveTarget
200
- ? associatedStackingStyles
201
- : associatedStyles
202
- : undefined,
203
- ]}
117
+ ref={ref}
118
+ style={[style, attachedStyle]}
204
119
  onPress={resolvedOnPress}
205
120
  collapsable={false}
206
121
  />
207
- </BoundaryOwnerProvider>
122
+ </BoundaryRootProvider>
208
123
  );
209
124
  });
210
125
 
126
+ // The HOC's runtime identity (animated + memoized forwardRef) is not
127
+ // expressible against the public boundary props, so assert it here.
211
128
  return memo(
212
129
  Animated.createAnimatedComponent(Inner),
213
130
  ) as unknown as React.MemoExoticComponent<
@@ -0,0 +1,127 @@
1
+ import { useCallback, useMemo } from "react";
2
+ import type { View } from "react-native";
3
+ import type { AnimatedRef, StyleProps } from "react-native-reanimated";
4
+ import { runOnUI } from "react-native-reanimated";
5
+ import { createPendingPairKey } from "../../../stores/bounds/helpers/link-pairs.helpers";
6
+ import type { BoundTag } from "../../../stores/bounds/types";
7
+ import { prepareStyleForBounds } from "../../../utils/bounds/helpers/styles/styles";
8
+ import { resolvePortalHost } from "../portal/resolve-portal";
9
+ import type { BoundaryConfigProps, BoundaryPortal } from "../types";
10
+ import { useBoundaryPresence } from "./use-boundary-presence";
11
+ import { useInitialDestinationMeasurement } from "./use-initial-destination-measurement";
12
+ import { useInitialSourceMeasurement } from "./use-initial-source-measurement";
13
+ import { useMeasurer } from "./use-measurer";
14
+ import { useRefreshBoundary } from "./use-refresh-boundary";
15
+
16
+ interface UseBoundaryMeasurementParams {
17
+ boundTag: BoundTag;
18
+ /** Raw `enabled` prop — drives the measurer and the passive-source gate. */
19
+ enabled: boolean;
20
+ /** `enabled && hasConfiguredInterpolator` — gates presence + lifecycle. */
21
+ runtimeEnabled: boolean;
22
+ currentScreenKey: string;
23
+ /** Surface to measure: a nested target's placeholder, else the root. */
24
+ measuredRef: AnimatedRef<View>;
25
+ /** Root's own style; ignored when a nested target supplies its own. */
26
+ style?: unknown;
27
+ targetPreparedStyles?: StyleProps;
28
+ portal?: BoundaryPortal;
29
+ shouldAutoMeasure: boolean;
30
+ config: BoundaryConfigProps;
31
+ onPress?: (...args: unknown[]) => void;
32
+ }
33
+
34
+ /**
35
+ * Owns the full measurement lifecycle for a boundary: builds the measurer,
36
+ * registers presence, runs the initial source/destination + refresh reactions,
37
+ * and returns the press-priority `onPress`. The component never touches the
38
+ * measurer itself.
39
+ */
40
+ export const useBoundaryMeasurement = ({
41
+ boundTag,
42
+ enabled,
43
+ runtimeEnabled,
44
+ currentScreenKey,
45
+ measuredRef,
46
+ style,
47
+ targetPreparedStyles,
48
+ portal,
49
+ shouldAutoMeasure,
50
+ config,
51
+ onPress,
52
+ }: UseBoundaryMeasurementParams) => {
53
+ const { anchor, scaleMode, target, method } = config;
54
+ const boundaryConfig = useMemo<BoundaryConfigProps>(
55
+ () => ({ anchor, scaleMode, target, method }),
56
+ [anchor, scaleMode, target, method],
57
+ );
58
+
59
+ const rootPreparedStyles = useMemo(
60
+ () => prepareStyleForBounds(style),
61
+ [style],
62
+ );
63
+ const preparedStyles = targetPreparedStyles ?? rootPreparedStyles;
64
+
65
+ const portalHost = resolvePortalHost(portal);
66
+
67
+ const measureBoundary = useMeasurer({
68
+ enabled,
69
+ boundTag,
70
+ currentScreenKey,
71
+ preparedStyles,
72
+ measuredAnimatedRef: measuredRef,
73
+ portalHost,
74
+ });
75
+
76
+ // Register/unregister this boundary in the presence map so source/destination
77
+ // matching can resolve across concrete screen keys.
78
+ useBoundaryPresence({
79
+ enabled: runtimeEnabled,
80
+ boundTag,
81
+ currentScreenKey,
82
+ boundaryConfig,
83
+ });
84
+
85
+ // Passive auto-measurement only applies to non-pressable boundaries; pressable
86
+ // ones capture their source on press (see handlePress below).
87
+ const shouldPassivelyMeasureSource =
88
+ shouldAutoMeasure && typeof onPress !== "function";
89
+
90
+ useInitialSourceMeasurement({
91
+ enabled: runtimeEnabled,
92
+ measureBoundary,
93
+ boundTag,
94
+ shouldAutoMeasure: shouldPassivelyMeasureSource,
95
+ });
96
+
97
+ useInitialDestinationMeasurement({
98
+ boundTag,
99
+ enabled: runtimeEnabled,
100
+ measureBoundary,
101
+ });
102
+
103
+ useRefreshBoundary({
104
+ enabled: runtimeEnabled,
105
+ boundTag,
106
+ measureBoundary,
107
+ });
108
+
109
+ const handlePress = useCallback(
110
+ (...args: unknown[]) => {
111
+ // Press path has priority: capture source before user onPress/navigation.
112
+ runOnUI(measureBoundary)({
113
+ type: "source",
114
+ pairKey: createPendingPairKey(currentScreenKey),
115
+ });
116
+
117
+ if (typeof onPress === "function") {
118
+ onPress(...args);
119
+ }
120
+ },
121
+ [measureBoundary, onPress, currentScreenKey],
122
+ );
123
+
124
+ return {
125
+ onPress: typeof onPress === "function" ? handlePress : undefined,
126
+ };
127
+ };
@@ -4,25 +4,27 @@ import {
4
4
  removeEntry,
5
5
  setEntry,
6
6
  } from "../../../stores/bounds/internals/entries";
7
+ import type { BoundTag } from "../../../stores/bounds/types";
7
8
  import type { BoundaryConfigProps } from "../types";
8
9
 
9
10
  export const useBoundaryPresence = (params: {
10
11
  enabled: boolean;
11
- entryTag: string;
12
+ boundTag: BoundTag;
12
13
  currentScreenKey: string;
13
14
  boundaryConfig?: BoundaryConfigProps;
14
15
  }) => {
15
- const { enabled, entryTag, currentScreenKey, boundaryConfig } = params;
16
+ const { enabled, boundTag, currentScreenKey, boundaryConfig } = params;
17
+ const { tag } = boundTag;
16
18
 
17
19
  useLayoutEffect(() => {
18
20
  if (!enabled) return;
19
21
 
20
- runOnUI(setEntry)(entryTag, currentScreenKey, {
22
+ runOnUI(setEntry)(tag, currentScreenKey, {
21
23
  boundaryConfig,
22
24
  });
23
25
 
24
26
  return () => {
25
- runOnUI(removeEntry)(entryTag, currentScreenKey);
27
+ runOnUI(removeEntry)(tag, currentScreenKey);
26
28
  };
27
- }, [enabled, entryTag, currentScreenKey, boundaryConfig]);
29
+ }, [enabled, tag, currentScreenKey, boundaryConfig]);
28
30
  };
@@ -9,6 +9,7 @@ import { useDescriptorsStore } from "../../../providers/screen/descriptors";
9
9
  import { AnimationStore } from "../../../stores/animation.store";
10
10
  import { getDestination } from "../../../stores/bounds/internals/links";
11
11
  import { pairs } from "../../../stores/bounds/internals/state";
12
+ import type { BoundTag } from "../../../stores/bounds/types";
12
13
  import {
13
14
  LifecycleTransitionRequestKind,
14
15
  SystemStore,
@@ -17,7 +18,7 @@ import { logger } from "../../../utils/logger";
17
18
  import type { MeasureBoundary } from "../types";
18
19
  import { getInitialDestinationMeasurePairKey } from "../utils/destination-signals";
19
20
 
20
- const VIEWPORT_RETRY_DELAY_MS = 16;
21
+ const VIEWPORT_RETRY_DELAY_MS = 100;
21
22
  /**
22
23
  * A destination that keeps failing its measurement guards must not hold the
23
24
  * transition gate forever — after this budget the block is released with a
@@ -26,16 +27,17 @@ const VIEWPORT_RETRY_DELAY_MS = 16;
26
27
  const MAX_VIEWPORT_RETRIES = 20;
27
28
 
28
29
  interface UseInitialDestinationMeasurementParams {
29
- linkId: string;
30
+ boundTag: BoundTag;
30
31
  enabled: boolean;
31
32
  measureBoundary: MeasureBoundary;
32
33
  }
33
34
 
34
35
  export const useInitialDestinationMeasurement = ({
35
- linkId,
36
+ boundTag,
36
37
  enabled,
37
38
  measureBoundary,
38
39
  }: UseInitialDestinationMeasurementParams) => {
40
+ const { linkKey, group } = boundTag;
39
41
  const currentScreenKey = useDescriptorsStore(
40
42
  (s) => s.derivations.currentScreenKey,
41
43
  );
@@ -51,9 +53,12 @@ export const useInitialDestinationMeasurement = ({
51
53
  currentScreenKey,
52
54
  "transitionProgress",
53
55
  );
54
- const system = SystemStore.getBag(currentScreenKey);
55
- const { pendingLifecycleRequestKind } = system;
56
- const { blockLifecycleStart, unblockLifecycleStart } = system.actions;
56
+
57
+ const {
58
+ pendingLifecycleRequestKind,
59
+ actions: { blockLifecycleStart, unblockLifecycleStart },
60
+ } = SystemStore.getBag(currentScreenKey);
61
+
57
62
  const isBlockingLifecycleStart = useSharedValue(0);
58
63
  const retryToken = useSharedValue(0);
59
64
  const viewportRetries = useSharedValue(0);
@@ -90,7 +95,8 @@ export const useInitialDestinationMeasurement = ({
90
95
  enabled: destinationEnabled,
91
96
  destinationPairKey,
92
97
  ancestorDestinationPairKey,
93
- linkId,
98
+ linkId: linkKey,
99
+ group,
94
100
  linkState:
95
101
  destinationEnabled &&
96
102
  (destinationPairKey || ancestorDestinationPairKey)
@@ -100,7 +106,7 @@ export const useInitialDestinationMeasurement = ({
100
106
 
101
107
  return [measurePairKey, retryTick] as const;
102
108
  },
103
- ([measurePairKey]) => {
109
+ ([measurePairKey, retryTick], previous) => {
104
110
  "worklet";
105
111
  if (!measurePairKey) {
106
112
  releaseLifecycleStartBlock();
@@ -109,6 +115,16 @@ export const useInitialDestinationMeasurement = ({
109
115
  return;
110
116
  }
111
117
 
118
+ const previousMeasurePairKey = previous?.[0];
119
+ const previousRetryTick = previous?.[1];
120
+ const shouldAttemptMeasure =
121
+ measurePairKey !== previousMeasurePairKey ||
122
+ retryTick !== previousRetryTick;
123
+
124
+ if (!shouldAttemptMeasure) {
125
+ return;
126
+ }
127
+
112
128
  if (hasGivenUp.get()) {
113
129
  return;
114
130
  }
@@ -124,7 +140,7 @@ export const useInitialDestinationMeasurement = ({
124
140
  });
125
141
 
126
142
  const destinationAttached =
127
- getDestination(measurePairKey, linkId) !== null;
143
+ getDestination(measurePairKey, linkKey) !== null;
128
144
 
129
145
  if (destinationAttached) {
130
146
  releaseLifecycleStartBlock();
@@ -136,13 +152,13 @@ export const useInitialDestinationMeasurement = ({
136
152
  hasGivenUp.set(1);
137
153
  releaseLifecycleStartBlock();
138
154
  logger.warn(
139
- `Destination boundary "${linkId}" never produced a valid measurement after ${MAX_VIEWPORT_RETRIES} attempts; releasing the transition gate without it. The boundary is likely off-viewport (e.g. an inactive group member on a paged screen) or unmounted.`,
155
+ `Destination boundary "${linkKey}" never produced a valid measurement after ${MAX_VIEWPORT_RETRIES} attempts; releasing the transition gate without it. The boundary is likely off-viewport (e.g. an inactive group member on a paged screen) or unmounted.`,
140
156
  );
141
157
  return;
142
158
  }
143
159
 
144
160
  // Destination did not attach (malformed off-screen measurement); retry
145
- // on the next tick while the lifecycle stays blocked.
161
+ // after the retry token advances while the lifecycle stays blocked.
146
162
  viewportRetries.set(viewportRetries.get() + 1);
147
163
  cancelAnimation(retryToken);
148
164
  retryToken.set(
@@ -1,17 +1,17 @@
1
1
  import { useAnimatedReaction, useSharedValue } from "react-native-reanimated";
2
2
  import { useDescriptorsStore } from "../../../providers/screen/descriptors";
3
3
  import { pairs } from "../../../stores/bounds/internals/state";
4
+ import type { BoundTag } from "../../../stores/bounds/types";
4
5
  import type { MeasureBoundary } from "../types";
5
6
  import { getInitialSourceCaptureSignal } from "../utils/source-signals";
6
7
 
7
8
  export const useInitialSourceMeasurement = (params: {
8
9
  enabled: boolean;
9
10
  measureBoundary: MeasureBoundary;
10
- linkId: string;
11
- group?: string;
11
+ boundTag: BoundTag;
12
12
  shouldAutoMeasure: boolean;
13
13
  }) => {
14
- const { enabled, measureBoundary, linkId, group, shouldAutoMeasure } = params;
14
+ const { enabled, measureBoundary, boundTag, shouldAutoMeasure } = params;
15
15
  const sourcePairKey = useDescriptorsStore((s) => s.derivations.sourcePairKey);
16
16
  const lastSourceCaptureSignal = useSharedValue<string | null>(null);
17
17
 
@@ -21,8 +21,8 @@ export const useInitialSourceMeasurement = (params: {
21
21
  return getInitialSourceCaptureSignal({
22
22
  enabled,
23
23
  sourcePairKey,
24
- linkId,
25
- group,
24
+ linkId: boundTag.linkKey,
25
+ group: boundTag.group,
26
26
  shouldAutoMeasure,
27
27
  linkState: shouldAutoMeasure && sourcePairKey ? pairs.get() : undefined,
28
28
  });
@@ -8,7 +8,10 @@ import {
8
8
  } from "react-native-reanimated";
9
9
  import { applyMeasuredBoundsWrites } from "../../../providers/helpers/measured-bounds-writes";
10
10
  import { useOriginContext } from "../../../providers/screen/origin.provider";
11
- import type { BoundsPortalAttachTarget } from "../../../stores/bounds/types";
11
+ import type {
12
+ BoundsPortalAttachTarget,
13
+ BoundTag,
14
+ } from "../../../stores/bounds/types";
12
15
  import { ScrollStore } from "../../../stores/scroll.store";
13
16
  import { SystemStore } from "../../../stores/system.store";
14
17
  import { getActiveScrollHost } from "../portal/stores/host-registry.store";
@@ -22,9 +25,7 @@ import {
22
25
 
23
26
  interface UseMeasurerParams {
24
27
  enabled: boolean;
25
- entryTag: string;
26
- linkId: string;
27
- group?: string;
28
+ boundTag: BoundTag;
28
29
  currentScreenKey: string;
29
30
  preparedStyles: StyleProps;
30
31
  measuredAnimatedRef: AnimatedRef<View>;
@@ -33,9 +34,7 @@ interface UseMeasurerParams {
33
34
 
34
35
  export const useMeasurer = ({
35
36
  enabled,
36
- entryTag,
37
- linkId,
38
- group,
37
+ boundTag,
39
38
  currentScreenKey,
40
39
  preparedStyles,
41
40
  measuredAnimatedRef,
@@ -78,7 +77,7 @@ export const useMeasurer = ({
78
77
  * lifecycle blocked until a valid retry lands.
79
78
  */
80
79
  const shouldGuardDestinationViewport =
81
- pendingLifecycleStartBlockCount.get() > 0 || !!group;
80
+ pendingLifecycleStartBlockCount.get() > 0 || !!boundTag.group;
82
81
 
83
82
  const viewportAllowsDestinationWrite =
84
83
  target.type !== "destination" ||
@@ -101,9 +100,9 @@ export const useMeasurer = ({
101
100
  : undefined;
102
101
 
103
102
  applyMeasuredBoundsWrites({
104
- entryTag,
105
- linkId,
106
- group,
103
+ entryTag: boundTag.tag,
104
+ linkId: boundTag.linkKey,
105
+ group: boundTag.group,
107
106
  currentScreenKey,
108
107
  measured: measuredWithScroll,
109
108
  preparedStyles,
@@ -114,9 +113,7 @@ export const useMeasurer = ({
114
113
  },
115
114
  [
116
115
  enabled,
117
- entryTag,
118
- linkId,
119
- group,
116
+ boundTag,
120
117
  currentScreenKey,
121
118
  preparedStyles,
122
119
  measuredAnimatedRef,
@@ -2,22 +2,22 @@ import { useAnimatedReaction } from "react-native-reanimated";
2
2
  import { useDescriptorsStore } from "../../../providers/screen/descriptors";
3
3
  import { AnimationStore } from "../../../stores/animation.store";
4
4
  import { pairs } from "../../../stores/bounds/internals/state";
5
+ import type { BoundTag } from "../../../stores/bounds/types";
5
6
  import type { MeasureBoundary } from "../types";
6
7
  import { getRefreshBoundarySignal } from "../utils/refresh-signals";
7
8
 
8
9
  interface UseRefreshBoundaryParams {
9
10
  enabled: boolean;
10
- linkId: string;
11
- group?: string;
11
+ boundTag: BoundTag;
12
12
  measureBoundary: MeasureBoundary;
13
13
  }
14
14
 
15
15
  export const useRefreshBoundary = ({
16
16
  enabled,
17
- linkId,
18
- group,
17
+ boundTag,
19
18
  measureBoundary,
20
19
  }: UseRefreshBoundaryParams) => {
20
+ const { linkKey, group } = boundTag;
21
21
  const currentScreenKey = useDescriptorsStore(
22
22
  (s) => s.derivations.currentScreenKey,
23
23
  );
@@ -57,7 +57,7 @@ export const useRefreshBoundary = ({
57
57
  destinationPairKey,
58
58
  ancestorDestinationPairKey,
59
59
  nextScreenKey,
60
- linkId,
60
+ linkId: linkKey,
61
61
  group,
62
62
  shouldRefresh: !!refreshWillAnimate.get(),
63
63
  closing: !!refreshClosing.get(),
@@ -35,7 +35,7 @@ Host.displayName = "Transition.Boundary.Host";
35
35
  * Use:
36
36
  * - `Boundary.View` for passive/shared elements.
37
37
  * - `Boundary.Trigger` for tappable elements that start navigation.
38
- * - `Boundary.Target` to measure a nested descendant instead of the owner.
38
+ * - `Boundary.Target` to measure a nested descendant instead of the root.
39
39
  * - `Boundary.Host` to make nested portal placement explicit.
40
40
  */
41
41
  export const Boundary = {
@@ -48,7 +48,7 @@ export const Boundary = {
48
48
  */
49
49
  Trigger: BoundaryTrigger,
50
50
  /**
51
- * Optional nested measurement override inside a boundary owner.
51
+ * Optional nested measurement override inside a boundary root.
52
52
  */
53
53
  Target: BoundaryTarget,
54
54
  /**