react-native-screen-transitions 3.12.0 → 3.13.0-beta.0

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 (336) hide show
  1. package/lib/commonjs/shared/components/activity/variants/activity-screen.js +1 -1
  2. package/lib/commonjs/shared/components/activity/variants/activity-screen.js.map +1 -1
  3. package/lib/commonjs/shared/components/boundary/components/boundary-lifecycle.js +0 -3
  4. package/lib/commonjs/shared/components/boundary/components/boundary-lifecycle.js.map +1 -1
  5. package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-boundary-measurement-request.js +69 -0
  6. package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-boundary-measurement-request.js.map +1 -0
  7. package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-boundary-presence.js +11 -10
  8. package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-boundary-presence.js.map +1 -1
  9. package/lib/commonjs/shared/components/boundary/hooks/use-boundary-measurement.js +3 -19
  10. package/lib/commonjs/shared/components/boundary/hooks/use-boundary-measurement.js.map +1 -1
  11. package/lib/commonjs/shared/components/boundary/hooks/use-measurer.js +6 -16
  12. package/lib/commonjs/shared/components/boundary/hooks/use-measurer.js.map +1 -1
  13. package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/helpers/active-handoff-receiver.js +27 -1
  14. package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/helpers/active-handoff-receiver.js.map +1 -1
  15. package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js +26 -8
  16. package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js.map +1 -1
  17. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.js +8 -1
  18. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.js.map +1 -1
  19. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/helpers/attachment.js +19 -0
  20. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/helpers/attachment.js.map +1 -0
  21. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/helpers/host-readiness.js +18 -0
  22. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/helpers/host-readiness.js.map +1 -0
  23. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/helpers/local-measurement.js +22 -1
  24. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/helpers/local-measurement.js.map +1 -1
  25. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/hooks/use-active-portal-boundary-host.js +10 -10
  26. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/hooks/use-active-portal-boundary-host.js.map +1 -1
  27. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js +18 -6
  28. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js.map +1 -1
  29. package/lib/commonjs/shared/providers/helpers/measured-bounds-writes.js +4 -0
  30. package/lib/commonjs/shared/providers/helpers/measured-bounds-writes.js.map +1 -1
  31. package/lib/commonjs/shared/providers/screen/animation/animation.provider.js +4 -1
  32. package/lib/commonjs/shared/providers/screen/animation/animation.provider.js.map +1 -1
  33. package/lib/commonjs/shared/providers/screen/animation/helpers/hydrate-transition-state/index.js +5 -1
  34. package/lib/commonjs/shared/providers/screen/animation/helpers/hydrate-transition-state/index.js.map +1 -1
  35. package/lib/commonjs/shared/providers/screen/animation/helpers/interpolator-participation.js +9 -0
  36. package/lib/commonjs/shared/providers/screen/animation/helpers/interpolator-participation.js.map +1 -0
  37. package/lib/commonjs/shared/providers/screen/animation/helpers/pipeline.js +13 -2
  38. package/lib/commonjs/shared/providers/screen/animation/helpers/pipeline.js.map +1 -1
  39. package/lib/commonjs/shared/providers/screen/descriptors/descriptors.provider.js +40 -8
  40. package/lib/commonjs/shared/providers/screen/descriptors/descriptors.provider.js.map +1 -1
  41. package/lib/commonjs/shared/providers/screen/descriptors/helpers/derive-descriptor-derivations.js +2 -0
  42. package/lib/commonjs/shared/providers/screen/descriptors/helpers/derive-descriptor-derivations.js.map +1 -1
  43. package/lib/commonjs/shared/providers/screen/descriptors/helpers/derive-structural-ancestor-keys.js +12 -0
  44. package/lib/commonjs/shared/providers/screen/descriptors/helpers/derive-structural-ancestor-keys.js.map +1 -0
  45. package/lib/commonjs/shared/providers/screen/gestures/pan/behavior/pan-lifecycle.js +1 -0
  46. package/lib/commonjs/shared/providers/screen/gestures/pan/behavior/pan-lifecycle.js.map +1 -1
  47. package/lib/commonjs/shared/providers/screen/gestures/pan/behavior/pan-release.js +9 -2
  48. package/lib/commonjs/shared/providers/screen/gestures/pan/behavior/pan-release.js.map +1 -1
  49. package/lib/commonjs/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.js +1 -0
  50. package/lib/commonjs/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.js.map +1 -1
  51. package/lib/commonjs/shared/providers/screen/styles/constants.js +2 -1
  52. package/lib/commonjs/shared/providers/screen/styles/constants.js.map +1 -1
  53. package/lib/commonjs/shared/providers/screen/styles/helpers/visibility-block-ownership.js +19 -0
  54. package/lib/commonjs/shared/providers/screen/styles/helpers/visibility-block-ownership.js.map +1 -0
  55. package/lib/commonjs/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js +35 -15
  56. package/lib/commonjs/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js.map +1 -1
  57. package/lib/commonjs/shared/providers/screen/styles/slot.provider.js +15 -6
  58. package/lib/commonjs/shared/providers/screen/styles/slot.provider.js.map +1 -1
  59. package/lib/commonjs/shared/stores/bounds/helpers/link-pairs.helpers.js +11 -1
  60. package/lib/commonjs/shared/stores/bounds/helpers/link-pairs.helpers.js.map +1 -1
  61. package/lib/commonjs/shared/stores/bounds/internals/clear.js +6 -0
  62. package/lib/commonjs/shared/stores/bounds/internals/clear.js.map +1 -1
  63. package/lib/commonjs/shared/stores/bounds/internals/coordinator.js +298 -0
  64. package/lib/commonjs/shared/stores/bounds/internals/coordinator.js.map +1 -0
  65. package/lib/commonjs/shared/stores/bounds/internals/entries.js +0 -27
  66. package/lib/commonjs/shared/stores/bounds/internals/entries.js.map +1 -1
  67. package/lib/commonjs/shared/stores/bounds/internals/links.js +22 -32
  68. package/lib/commonjs/shared/stores/bounds/internals/links.js.map +1 -1
  69. package/lib/commonjs/shared/stores/bounds/internals/screen-graph.js +45 -0
  70. package/lib/commonjs/shared/stores/bounds/internals/screen-graph.js.map +1 -0
  71. package/lib/commonjs/shared/stores/bounds/internals/state.js +4 -1
  72. package/lib/commonjs/shared/stores/bounds/internals/state.js.map +1 -1
  73. package/lib/commonjs/shared/utils/bounds/helpers/create-bounds-accessor-core.js +7 -3
  74. package/lib/commonjs/shared/utils/bounds/helpers/create-bounds-accessor-core.js.map +1 -1
  75. package/lib/commonjs/shared/utils/bounds/helpers/create-link-accessor.js +11 -0
  76. package/lib/commonjs/shared/utils/bounds/helpers/create-link-accessor.js.map +1 -1
  77. package/lib/commonjs/shared/utils/bounds/helpers/prepare-bound-styles.js +6 -2
  78. package/lib/commonjs/shared/utils/bounds/helpers/prepare-bound-styles.js.map +1 -1
  79. package/lib/commonjs/shared/utils/bounds/helpers/resolve-bounds-pair-key.js.map +1 -1
  80. package/lib/commonjs/shared/utils/bounds/helpers/styles/compute.js +11 -5
  81. package/lib/commonjs/shared/utils/bounds/helpers/styles/compute.js.map +1 -1
  82. package/lib/module/shared/components/activity/variants/activity-screen.js +1 -1
  83. package/lib/module/shared/components/activity/variants/activity-screen.js.map +1 -1
  84. package/lib/module/shared/components/boundary/components/boundary-lifecycle.js +0 -3
  85. package/lib/module/shared/components/boundary/components/boundary-lifecycle.js.map +1 -1
  86. package/lib/module/shared/components/boundary/hooks/lifecycles/use-boundary-measurement-request.js +64 -0
  87. package/lib/module/shared/components/boundary/hooks/lifecycles/use-boundary-measurement-request.js.map +1 -0
  88. package/lib/module/shared/components/boundary/hooks/lifecycles/use-boundary-presence.js +11 -10
  89. package/lib/module/shared/components/boundary/hooks/lifecycles/use-boundary-presence.js.map +1 -1
  90. package/lib/module/shared/components/boundary/hooks/use-boundary-measurement.js +3 -19
  91. package/lib/module/shared/components/boundary/hooks/use-boundary-measurement.js.map +1 -1
  92. package/lib/module/shared/components/boundary/hooks/use-measurer.js +6 -16
  93. package/lib/module/shared/components/boundary/hooks/use-measurer.js.map +1 -1
  94. package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/helpers/active-handoff-receiver.js +24 -0
  95. package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/helpers/active-handoff-receiver.js.map +1 -1
  96. package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js +27 -9
  97. package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js.map +1 -1
  98. package/lib/module/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.js +8 -1
  99. package/lib/module/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.js.map +1 -1
  100. package/lib/module/shared/components/boundary/portal/components/boundary-portal/helpers/attachment.js +14 -0
  101. package/lib/module/shared/components/boundary/portal/components/boundary-portal/helpers/attachment.js.map +1 -0
  102. package/lib/module/shared/components/boundary/portal/components/boundary-portal/helpers/host-readiness.js +13 -0
  103. package/lib/module/shared/components/boundary/portal/components/boundary-portal/helpers/host-readiness.js.map +1 -0
  104. package/lib/module/shared/components/boundary/portal/components/boundary-portal/helpers/local-measurement.js +19 -0
  105. package/lib/module/shared/components/boundary/portal/components/boundary-portal/helpers/local-measurement.js.map +1 -1
  106. package/lib/module/shared/components/boundary/portal/components/boundary-portal/hooks/use-active-portal-boundary-host.js +10 -10
  107. package/lib/module/shared/components/boundary/portal/components/boundary-portal/hooks/use-active-portal-boundary-host.js.map +1 -1
  108. package/lib/module/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js +18 -6
  109. package/lib/module/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js.map +1 -1
  110. package/lib/module/shared/providers/helpers/measured-bounds-writes.js +4 -0
  111. package/lib/module/shared/providers/helpers/measured-bounds-writes.js.map +1 -1
  112. package/lib/module/shared/providers/screen/animation/animation.provider.js +4 -1
  113. package/lib/module/shared/providers/screen/animation/animation.provider.js.map +1 -1
  114. package/lib/module/shared/providers/screen/animation/helpers/hydrate-transition-state/index.js +5 -1
  115. package/lib/module/shared/providers/screen/animation/helpers/hydrate-transition-state/index.js.map +1 -1
  116. package/lib/module/shared/providers/screen/animation/helpers/interpolator-participation.js +4 -0
  117. package/lib/module/shared/providers/screen/animation/helpers/interpolator-participation.js.map +1 -0
  118. package/lib/module/shared/providers/screen/animation/helpers/pipeline.js +13 -2
  119. package/lib/module/shared/providers/screen/animation/helpers/pipeline.js.map +1 -1
  120. package/lib/module/shared/providers/screen/descriptors/descriptors.provider.js +41 -9
  121. package/lib/module/shared/providers/screen/descriptors/descriptors.provider.js.map +1 -1
  122. package/lib/module/shared/providers/screen/descriptors/helpers/derive-descriptor-derivations.js +2 -0
  123. package/lib/module/shared/providers/screen/descriptors/helpers/derive-descriptor-derivations.js.map +1 -1
  124. package/lib/module/shared/providers/screen/descriptors/helpers/derive-structural-ancestor-keys.js +7 -0
  125. package/lib/module/shared/providers/screen/descriptors/helpers/derive-structural-ancestor-keys.js.map +1 -0
  126. package/lib/module/shared/providers/screen/gestures/pan/behavior/pan-lifecycle.js +1 -0
  127. package/lib/module/shared/providers/screen/gestures/pan/behavior/pan-lifecycle.js.map +1 -1
  128. package/lib/module/shared/providers/screen/gestures/pan/behavior/pan-release.js +9 -2
  129. package/lib/module/shared/providers/screen/gestures/pan/behavior/pan-release.js.map +1 -1
  130. package/lib/module/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.js +1 -0
  131. package/lib/module/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.js.map +1 -1
  132. package/lib/module/shared/providers/screen/styles/constants.js +2 -1
  133. package/lib/module/shared/providers/screen/styles/constants.js.map +1 -1
  134. package/lib/module/shared/providers/screen/styles/helpers/visibility-block-ownership.js +14 -0
  135. package/lib/module/shared/providers/screen/styles/helpers/visibility-block-ownership.js.map +1 -0
  136. package/lib/module/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js +35 -15
  137. package/lib/module/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js.map +1 -1
  138. package/lib/module/shared/providers/screen/styles/slot.provider.js +13 -5
  139. package/lib/module/shared/providers/screen/styles/slot.provider.js.map +1 -1
  140. package/lib/module/shared/stores/bounds/helpers/link-pairs.helpers.js +9 -0
  141. package/lib/module/shared/stores/bounds/helpers/link-pairs.helpers.js.map +1 -1
  142. package/lib/module/shared/stores/bounds/internals/clear.js +7 -1
  143. package/lib/module/shared/stores/bounds/internals/clear.js.map +1 -1
  144. package/lib/module/shared/stores/bounds/internals/coordinator.js +286 -0
  145. package/lib/module/shared/stores/bounds/internals/coordinator.js.map +1 -0
  146. package/lib/module/shared/stores/bounds/internals/entries.js +1 -27
  147. package/lib/module/shared/stores/bounds/internals/entries.js.map +1 -1
  148. package/lib/module/shared/stores/bounds/internals/links.js +24 -32
  149. package/lib/module/shared/stores/bounds/internals/links.js.map +1 -1
  150. package/lib/module/shared/stores/bounds/internals/screen-graph.js +39 -0
  151. package/lib/module/shared/stores/bounds/internals/screen-graph.js.map +1 -0
  152. package/lib/module/shared/stores/bounds/internals/state.js +3 -0
  153. package/lib/module/shared/stores/bounds/internals/state.js.map +1 -1
  154. package/lib/module/shared/utils/bounds/helpers/create-bounds-accessor-core.js +7 -3
  155. package/lib/module/shared/utils/bounds/helpers/create-bounds-accessor-core.js.map +1 -1
  156. package/lib/module/shared/utils/bounds/helpers/create-link-accessor.js +11 -0
  157. package/lib/module/shared/utils/bounds/helpers/create-link-accessor.js.map +1 -1
  158. package/lib/module/shared/utils/bounds/helpers/prepare-bound-styles.js +6 -2
  159. package/lib/module/shared/utils/bounds/helpers/prepare-bound-styles.js.map +1 -1
  160. package/lib/module/shared/utils/bounds/helpers/resolve-bounds-pair-key.js.map +1 -1
  161. package/lib/module/shared/utils/bounds/helpers/styles/compute.js +11 -5
  162. package/lib/module/shared/utils/bounds/helpers/styles/compute.js.map +1 -1
  163. package/lib/typescript/native-stack/views/useHeaderConfigProps.d.ts +1 -1
  164. package/lib/typescript/shared/components/boundary/components/boundary-lifecycle.d.ts.map +1 -1
  165. package/lib/typescript/shared/components/boundary/hooks/lifecycles/{use-initial-source-measurement.d.ts → use-boundary-measurement-request.d.ts} +4 -3
  166. package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-boundary-measurement-request.d.ts.map +1 -0
  167. package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-boundary-presence.d.ts.map +1 -1
  168. package/lib/typescript/shared/components/boundary/hooks/use-boundary-measurement.d.ts +1 -3
  169. package/lib/typescript/shared/components/boundary/hooks/use-boundary-measurement.d.ts.map +1 -1
  170. package/lib/typescript/shared/components/boundary/hooks/use-measurer.d.ts.map +1 -1
  171. package/lib/typescript/shared/components/boundary/portal/components/boundary-content-portal/helpers/active-handoff-receiver.d.ts +12 -0
  172. package/lib/typescript/shared/components/boundary/portal/components/boundary-content-portal/helpers/active-handoff-receiver.d.ts.map +1 -1
  173. package/lib/typescript/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.d.ts.map +1 -1
  174. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.d.ts.map +1 -1
  175. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/helpers/attachment.d.ts +8 -0
  176. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/helpers/attachment.d.ts.map +1 -0
  177. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/helpers/host-readiness.d.ts +6 -0
  178. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/helpers/host-readiness.d.ts.map +1 -0
  179. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/helpers/local-measurement.d.ts +4 -1
  180. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/helpers/local-measurement.d.ts.map +1 -1
  181. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/hooks/use-active-portal-boundary-host.d.ts +2 -3
  182. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/hooks/use-active-portal-boundary-host.d.ts.map +1 -1
  183. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.d.ts.map +1 -1
  184. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/hooks/use-placeholder-styles.d.ts +2 -2
  185. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/stores/portal-boundary-host.store.d.ts +1 -1
  186. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/stores/portal-boundary-host.store.d.ts.map +1 -1
  187. package/lib/typescript/shared/components/boundary/types.d.ts +1 -1
  188. package/lib/typescript/shared/components/boundary/types.d.ts.map +1 -1
  189. package/lib/typescript/shared/components/create-transition-aware-component.d.ts +5 -6
  190. package/lib/typescript/shared/components/create-transition-aware-component.d.ts.map +1 -1
  191. package/lib/typescript/shared/components/overlay/hooks/use-overlay-slot.d.ts +1 -1
  192. package/lib/typescript/shared/index.d.ts +651 -703
  193. package/lib/typescript/shared/index.d.ts.map +1 -1
  194. package/lib/typescript/shared/providers/helpers/measured-bounds-writes.d.ts.map +1 -1
  195. package/lib/typescript/shared/providers/screen/animation/animation.provider.d.ts.map +1 -1
  196. package/lib/typescript/shared/providers/screen/animation/helpers/hydrate-transition-state/index.d.ts.map +1 -1
  197. package/lib/typescript/shared/providers/screen/animation/helpers/interpolator-participation.d.ts +3 -0
  198. package/lib/typescript/shared/providers/screen/animation/helpers/interpolator-participation.d.ts.map +1 -0
  199. package/lib/typescript/shared/providers/screen/animation/helpers/pipeline.d.ts +2 -1
  200. package/lib/typescript/shared/providers/screen/animation/helpers/pipeline.d.ts.map +1 -1
  201. package/lib/typescript/shared/providers/screen/descriptors/descriptors.provider.d.ts.map +1 -1
  202. package/lib/typescript/shared/providers/screen/descriptors/helpers/derive-descriptor-derivations.d.ts +4 -0
  203. package/lib/typescript/shared/providers/screen/descriptors/helpers/derive-descriptor-derivations.d.ts.map +1 -1
  204. package/lib/typescript/shared/providers/screen/descriptors/helpers/derive-structural-ancestor-keys.d.ts +5 -0
  205. package/lib/typescript/shared/providers/screen/descriptors/helpers/derive-structural-ancestor-keys.d.ts.map +1 -0
  206. package/lib/typescript/shared/providers/screen/gestures/pan/behavior/pan-lifecycle.d.ts.map +1 -1
  207. package/lib/typescript/shared/providers/screen/gestures/pan/behavior/pan-release.d.ts.map +1 -1
  208. package/lib/typescript/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.d.ts.map +1 -1
  209. package/lib/typescript/shared/providers/screen/gestures/types.d.ts +1 -0
  210. package/lib/typescript/shared/providers/screen/gestures/types.d.ts.map +1 -1
  211. package/lib/typescript/shared/providers/screen/styles/constants.d.ts.map +1 -1
  212. package/lib/typescript/shared/providers/screen/styles/helpers/visibility-block-ownership.d.ts +10 -0
  213. package/lib/typescript/shared/providers/screen/styles/helpers/visibility-block-ownership.d.ts.map +1 -0
  214. package/lib/typescript/shared/providers/screen/styles/hooks/slot-resolvers.d.ts +4 -4
  215. package/lib/typescript/shared/providers/screen/styles/hooks/slot-resolvers.d.ts.map +1 -1
  216. package/lib/typescript/shared/providers/screen/styles/hooks/use-maybe-block-visibility.d.ts +10 -4
  217. package/lib/typescript/shared/providers/screen/styles/hooks/use-maybe-block-visibility.d.ts.map +1 -1
  218. package/lib/typescript/shared/providers/screen/styles/slot.provider.d.ts +1 -0
  219. package/lib/typescript/shared/providers/screen/styles/slot.provider.d.ts.map +1 -1
  220. package/lib/typescript/shared/stores/bounds/helpers/link-pairs.helpers.d.ts +1 -0
  221. package/lib/typescript/shared/stores/bounds/helpers/link-pairs.helpers.d.ts.map +1 -1
  222. package/lib/typescript/shared/stores/bounds/internals/clear.d.ts.map +1 -1
  223. package/lib/typescript/shared/stores/bounds/internals/coordinator.d.ts +36 -0
  224. package/lib/typescript/shared/stores/bounds/internals/coordinator.d.ts.map +1 -0
  225. package/lib/typescript/shared/stores/bounds/internals/entries.d.ts +1 -2
  226. package/lib/typescript/shared/stores/bounds/internals/entries.d.ts.map +1 -1
  227. package/lib/typescript/shared/stores/bounds/internals/links.d.ts +1 -3
  228. package/lib/typescript/shared/stores/bounds/internals/links.d.ts.map +1 -1
  229. package/lib/typescript/shared/stores/bounds/internals/screen-graph.d.ts +5 -0
  230. package/lib/typescript/shared/stores/bounds/internals/screen-graph.d.ts.map +1 -0
  231. package/lib/typescript/shared/stores/bounds/internals/state.d.ts +3 -1
  232. package/lib/typescript/shared/stores/bounds/internals/state.d.ts.map +1 -1
  233. package/lib/typescript/shared/stores/bounds/types.d.ts +13 -1
  234. package/lib/typescript/shared/stores/bounds/types.d.ts.map +1 -1
  235. package/lib/typescript/shared/types/screen.types.d.ts +9 -0
  236. package/lib/typescript/shared/types/screen.types.d.ts.map +1 -1
  237. package/lib/typescript/shared/utils/bounds/helpers/create-bounds-accessor-core.d.ts.map +1 -1
  238. package/lib/typescript/shared/utils/bounds/helpers/create-link-accessor.d.ts.map +1 -1
  239. package/lib/typescript/shared/utils/bounds/helpers/prepare-bound-styles.d.ts.map +1 -1
  240. package/lib/typescript/shared/utils/bounds/helpers/resolve-bounds-pair-key.d.ts.map +1 -1
  241. package/lib/typescript/shared/utils/bounds/helpers/styles/compute.d.ts.map +1 -1
  242. package/package.json +1 -1
  243. package/src/shared/components/activity/variants/activity-screen.tsx +1 -1
  244. package/src/shared/components/boundary/components/boundary-lifecycle.tsx +0 -6
  245. package/src/shared/components/boundary/hooks/lifecycles/use-boundary-measurement-request.ts +102 -0
  246. package/src/shared/components/boundary/hooks/lifecycles/use-boundary-presence.ts +20 -11
  247. package/src/shared/components/boundary/hooks/use-boundary-measurement.ts +3 -22
  248. package/src/shared/components/boundary/hooks/use-measurer.ts +5 -20
  249. package/src/shared/components/boundary/portal/components/boundary-content-portal/helpers/active-handoff-receiver.ts +40 -0
  250. package/src/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.ts +68 -20
  251. package/src/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.tsx +10 -1
  252. package/src/shared/components/boundary/portal/components/boundary-portal/helpers/attachment.ts +19 -0
  253. package/src/shared/components/boundary/portal/components/boundary-portal/helpers/host-readiness.ts +14 -0
  254. package/src/shared/components/boundary/portal/components/boundary-portal/helpers/local-measurement.ts +36 -1
  255. package/src/shared/components/boundary/portal/components/boundary-portal/hooks/use-active-portal-boundary-host.ts +22 -13
  256. package/src/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.ts +26 -9
  257. package/src/shared/components/boundary/portal/components/boundary-portal/stores/portal-boundary-host.store.ts +1 -1
  258. package/src/shared/components/boundary/types.ts +1 -1
  259. package/src/shared/providers/helpers/measured-bounds-writes.ts +5 -0
  260. package/src/shared/providers/screen/animation/animation.provider.tsx +7 -1
  261. package/src/shared/providers/screen/animation/helpers/hydrate-transition-state/index.ts +18 -3
  262. package/src/shared/providers/screen/animation/helpers/interpolator-participation.ts +6 -0
  263. package/src/shared/providers/screen/animation/helpers/pipeline.ts +54 -32
  264. package/src/shared/providers/screen/descriptors/descriptors.provider.tsx +80 -14
  265. package/src/shared/providers/screen/descriptors/helpers/derive-descriptor-derivations.ts +6 -0
  266. package/src/shared/providers/screen/descriptors/helpers/derive-structural-ancestor-keys.ts +13 -0
  267. package/src/shared/providers/screen/gestures/pan/behavior/pan-lifecycle.ts +1 -0
  268. package/src/shared/providers/screen/gestures/pan/behavior/pan-release.ts +12 -2
  269. package/src/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.ts +1 -0
  270. package/src/shared/providers/screen/gestures/types.ts +1 -0
  271. package/src/shared/providers/screen/styles/constants.ts +1 -0
  272. package/src/shared/providers/screen/styles/helpers/visibility-block-ownership.ts +16 -0
  273. package/src/shared/providers/screen/styles/hooks/use-maybe-block-visibility.tsx +40 -15
  274. package/src/shared/providers/screen/styles/slot.provider.tsx +19 -5
  275. package/src/shared/stores/bounds/helpers/link-pairs.helpers.ts +12 -0
  276. package/src/shared/stores/bounds/internals/clear.ts +12 -1
  277. package/src/shared/stores/bounds/internals/coordinator.ts +403 -0
  278. package/src/shared/stores/bounds/internals/entries.ts +1 -38
  279. package/src/shared/stores/bounds/internals/links.ts +28 -38
  280. package/src/shared/stores/bounds/internals/screen-graph.ts +45 -0
  281. package/src/shared/stores/bounds/internals/state.ts +10 -1
  282. package/src/shared/stores/bounds/types.ts +19 -1
  283. package/src/shared/types/screen.types.ts +10 -0
  284. package/src/shared/utils/bounds/helpers/create-bounds-accessor-core.ts +8 -3
  285. package/src/shared/utils/bounds/helpers/create-link-accessor.ts +11 -0
  286. package/src/shared/utils/bounds/helpers/prepare-bound-styles.ts +3 -2
  287. package/src/shared/utils/bounds/helpers/resolve-bounds-pair-key.ts +0 -1
  288. package/src/shared/utils/bounds/helpers/styles/compute.ts +12 -5
  289. package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js +0 -177
  290. package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js.map +0 -1
  291. package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-initial-source-measurement.js +0 -49
  292. package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-initial-source-measurement.js.map +0 -1
  293. package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-refresh-boundary.js +0 -69
  294. package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-refresh-boundary.js.map +0 -1
  295. package/lib/commonjs/shared/components/boundary/utils/destination-signals.js +0 -68
  296. package/lib/commonjs/shared/components/boundary/utils/destination-signals.js.map +0 -1
  297. package/lib/commonjs/shared/components/boundary/utils/refresh-signals.js +0 -97
  298. package/lib/commonjs/shared/components/boundary/utils/refresh-signals.js.map +0 -1
  299. package/lib/commonjs/shared/components/boundary/utils/source-signals.js +0 -43
  300. package/lib/commonjs/shared/components/boundary/utils/source-signals.js.map +0 -1
  301. package/lib/commonjs/shared/providers/screen/descriptors/helpers/get-ancestor-keys.js +0 -29
  302. package/lib/commonjs/shared/providers/screen/descriptors/helpers/get-ancestor-keys.js.map +0 -1
  303. package/lib/module/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js +0 -173
  304. package/lib/module/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js.map +0 -1
  305. package/lib/module/shared/components/boundary/hooks/lifecycles/use-initial-source-measurement.js +0 -44
  306. package/lib/module/shared/components/boundary/hooks/lifecycles/use-initial-source-measurement.js.map +0 -1
  307. package/lib/module/shared/components/boundary/hooks/lifecycles/use-refresh-boundary.js +0 -64
  308. package/lib/module/shared/components/boundary/hooks/lifecycles/use-refresh-boundary.js.map +0 -1
  309. package/lib/module/shared/components/boundary/utils/destination-signals.js +0 -63
  310. package/lib/module/shared/components/boundary/utils/destination-signals.js.map +0 -1
  311. package/lib/module/shared/components/boundary/utils/refresh-signals.js +0 -92
  312. package/lib/module/shared/components/boundary/utils/refresh-signals.js.map +0 -1
  313. package/lib/module/shared/components/boundary/utils/source-signals.js +0 -38
  314. package/lib/module/shared/components/boundary/utils/source-signals.js.map +0 -1
  315. package/lib/module/shared/providers/screen/descriptors/helpers/get-ancestor-keys.js +0 -25
  316. package/lib/module/shared/providers/screen/descriptors/helpers/get-ancestor-keys.js.map +0 -1
  317. package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.d.ts +0 -10
  318. package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.d.ts.map +0 -1
  319. package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-initial-source-measurement.d.ts.map +0 -1
  320. package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-refresh-boundary.d.ts +0 -10
  321. package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-refresh-boundary.d.ts.map +0 -1
  322. package/lib/typescript/shared/components/boundary/utils/destination-signals.d.ts +0 -16
  323. package/lib/typescript/shared/components/boundary/utils/destination-signals.d.ts.map +0 -1
  324. package/lib/typescript/shared/components/boundary/utils/refresh-signals.d.ts +0 -19
  325. package/lib/typescript/shared/components/boundary/utils/refresh-signals.d.ts.map +0 -1
  326. package/lib/typescript/shared/components/boundary/utils/source-signals.d.ts +0 -14
  327. package/lib/typescript/shared/components/boundary/utils/source-signals.d.ts.map +0 -1
  328. package/lib/typescript/shared/providers/screen/descriptors/helpers/get-ancestor-keys.d.ts +0 -6
  329. package/lib/typescript/shared/providers/screen/descriptors/helpers/get-ancestor-keys.d.ts.map +0 -1
  330. package/src/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.ts +0 -267
  331. package/src/shared/components/boundary/hooks/lifecycles/use-initial-source-measurement.ts +0 -51
  332. package/src/shared/components/boundary/hooks/lifecycles/use-refresh-boundary.ts +0 -90
  333. package/src/shared/components/boundary/utils/destination-signals.ts +0 -75
  334. package/src/shared/components/boundary/utils/refresh-signals.ts +0 -164
  335. package/src/shared/components/boundary/utils/source-signals.ts +0 -51
  336. package/src/shared/providers/screen/descriptors/helpers/get-ancestor-keys.ts +0 -28
@@ -1,5 +1,6 @@
1
1
  import { useWindowDimensions } from "react-native";
2
2
  import {
3
+ type SharedValue,
3
4
  useAnimatedProps,
4
5
  useAnimatedReaction,
5
6
  useAnimatedStyle,
@@ -10,9 +11,18 @@ import { SystemStore } from "../../../../stores/system.store";
10
11
  import { getVisibilityBlockOffset } from "../../../../utils/visibility-block-offset";
11
12
  import { useDescriptorsStore } from "../../descriptors";
12
13
  import { hasCloseTransitionFinished } from "../helpers/transition-visual-state";
14
+ import { resolveVisibilityBlockOwnership } from "../helpers/visibility-block-ownership";
13
15
  import { resolveScreenVisibilityGate } from "../helpers/visibility-gate";
14
16
 
15
- export const useMaybeBlockVisibility = (isFloatingOverlay?: boolean) => {
17
+ type Params = {
18
+ ancestorVisibilityBlocked: SharedValue<boolean> | null;
19
+ isFloatingOverlay?: boolean;
20
+ };
21
+
22
+ export const useMaybeBlockVisibility = ({
23
+ ancestorVisibilityBlocked,
24
+ isFloatingOverlay,
25
+ }: Params) => {
16
26
  const { height } = useWindowDimensions();
17
27
  const currentScreenKey = useDescriptorsStore(
18
28
  (store) => store.derivations.currentScreenKey,
@@ -25,29 +35,39 @@ export const useMaybeBlockVisibility = (isFloatingOverlay?: boolean) => {
25
35
  } = SystemStore.getBag(currentScreenKey);
26
36
 
27
37
  const hasVisibilityGateOpened = useSharedValue(false);
28
- const shouldBlockVisibility = useSharedValue(!isFloatingOverlay);
38
+ const localVisibilityBlocked = useSharedValue(!isFloatingOverlay);
39
+ const effectiveVisibilityBlocked = useSharedValue(!isFloatingOverlay);
29
40
 
30
41
  useAnimatedReaction(
31
42
  () => {
32
43
  "worklet";
33
44
 
34
- return resolveScreenVisibilityGate({
35
- isFloatingOverlay,
36
- hasVisibilityGateOpened: hasVisibilityGateOpened.get(),
37
- pendingLifecycleStartBlockCount: pendingLifecycleStartBlockCount.get(),
38
- pendingLifecycleRequestKind: pendingLifecycleRequestKind.get(),
39
- animationProgress: animationProgress.get(),
40
- entering: entering.get(),
41
- });
45
+ return {
46
+ gate: resolveScreenVisibilityGate({
47
+ isFloatingOverlay,
48
+ hasVisibilityGateOpened: hasVisibilityGateOpened.get(),
49
+ pendingLifecycleStartBlockCount:
50
+ pendingLifecycleStartBlockCount.get(),
51
+ pendingLifecycleRequestKind: pendingLifecycleRequestKind.get(),
52
+ animationProgress: animationProgress.get(),
53
+ entering: entering.get(),
54
+ }),
55
+ ancestorBlocked: ancestorVisibilityBlocked?.get() ?? false,
56
+ };
42
57
  },
43
- (gate) => {
58
+ ({ gate, ancestorBlocked }) => {
44
59
  "worklet";
45
60
 
46
61
  if (gate.shouldOpenGate) {
47
62
  hasVisibilityGateOpened.set(true);
48
63
  }
49
64
 
50
- shouldBlockVisibility.set(gate.shouldBlock);
65
+ const ownership = resolveVisibilityBlockOwnership({
66
+ localBlocked: gate.shouldBlock,
67
+ ancestorBlocked,
68
+ });
69
+ localVisibilityBlocked.set(gate.shouldBlock);
70
+ effectiveVisibilityBlocked.set(ownership.effectiveBlocked);
51
71
  },
52
72
  );
53
73
 
@@ -66,10 +86,15 @@ export const useMaybeBlockVisibility = (isFloatingOverlay?: boolean) => {
66
86
  };
67
87
  }
68
88
 
89
+ const ownership = resolveVisibilityBlockOwnership({
90
+ localBlocked: localVisibilityBlocked.get(),
91
+ ancestorBlocked: ancestorVisibilityBlocked?.get() ?? false,
92
+ });
93
+
69
94
  return {
70
95
  transform: [
71
96
  {
72
- translateY: shouldBlockVisibility.get() ? offset : 0,
97
+ translateY: ownership.appliesOffset ? offset : 0,
73
98
  },
74
99
  ],
75
100
  };
@@ -78,7 +103,7 @@ export const useMaybeBlockVisibility = (isFloatingOverlay?: boolean) => {
78
103
  const animatedProps = useAnimatedProps(() => {
79
104
  "worklet";
80
105
  return {
81
- pointerEvents: shouldBlockVisibility.get()
106
+ pointerEvents: effectiveVisibilityBlocked.get()
82
107
  ? ("none" as const)
83
108
  : ("box-none" as const),
84
109
  };
@@ -87,6 +112,6 @@ export const useMaybeBlockVisibility = (isFloatingOverlay?: boolean) => {
87
112
  return {
88
113
  animatedStyle,
89
114
  animatedProps,
90
- shouldBlockVisibility,
115
+ visibilityBlocked: effectiveVisibilityBlocked,
91
116
  };
92
117
  };
@@ -30,6 +30,19 @@ export type ScreenSlotContextValue = {
30
30
  visibilityBlocked: SharedValue<boolean>;
31
31
  };
32
32
 
33
+ const NO_PARENT_SCREEN_KEY = "__no-parent-screen__";
34
+
35
+ export const useAreAnyBlockingVisibility = () => {
36
+ const parentScreenKey = useDescriptorsStore(
37
+ (store) => store.derivations.parentScreenKey,
38
+ );
39
+
40
+ return useScreenSlots(
41
+ parentScreenKey ?? NO_PARENT_SCREEN_KEY,
42
+ (store) => store.visibilityBlocked,
43
+ );
44
+ };
45
+
33
46
  export const { ScreenSlotProvider, useScreenSlotStore: useScreenSlots } =
34
47
  createProvider("ScreenSlot", {
35
48
  guarded: true,
@@ -41,12 +54,13 @@ export const { ScreenSlotProvider, useScreenSlotStore: useScreenSlots } =
41
54
  const currentScreenKey = useDescriptorsStore(
42
55
  (store) => store.derivations.currentScreenKey,
43
56
  );
44
- const { animatedStyle, animatedProps, shouldBlockVisibility } =
45
- useMaybeBlockVisibility();
57
+ const ancestorVisibilityBlocked = useAreAnyBlockingVisibility();
58
+ const { animatedStyle, animatedProps, visibilityBlocked } =
59
+ useMaybeBlockVisibility({ ancestorVisibilityBlocked });
46
60
 
47
61
  const { interpolatorReady, localStylesMaps } = useInterpolatedStylesMap({
48
62
  enabled: true,
49
- visibilityBlocked: shouldBlockVisibility,
63
+ visibilityBlocked,
50
64
  });
51
65
 
52
66
  const slotsMap = useResolvedStylesMap({
@@ -57,9 +71,9 @@ export const { ScreenSlotProvider, useScreenSlotStore: useScreenSlots } =
57
71
  () => ({
58
72
  interpolatorReady,
59
73
  slotsMap,
60
- visibilityBlocked: shouldBlockVisibility,
74
+ visibilityBlocked,
61
75
  }),
62
- [interpolatorReady, shouldBlockVisibility, slotsMap],
76
+ [interpolatorReady, slotsMap, visibilityBlocked],
63
77
  );
64
78
  const content = useMemo(
65
79
  () => (
@@ -137,6 +137,18 @@ export const ensurePairSourceRequests = (
137
137
  return pair.sourceRequests;
138
138
  };
139
139
 
140
+ export const ensurePairDestinationRequests = (
141
+ state: LinkPairsState,
142
+ pairKey: ScreenPairKey,
143
+ ): Record<LinkKey, true> => {
144
+ "worklet";
145
+ const pair = ensurePairState(state, pairKey);
146
+ if (!pair.destinationRequests) {
147
+ pair.destinationRequests = {};
148
+ }
149
+ return pair.destinationRequests;
150
+ };
151
+
140
152
  export const removePairLink = (
141
153
  state: LinkPairsState,
142
154
  pairKey: ScreenPairKey,
@@ -1,7 +1,12 @@
1
1
  import { hasAnyKeys } from "../helpers/keys";
2
2
  import { isScreenPairKeyForScreen } from "../helpers/link-pairs.helpers";
3
3
  import type { LinkPairsState, ScreenKey } from "../types";
4
- import { type BoundaryEntriesState, boundaryRegistry, pairs } from "./state";
4
+ import {
5
+ type BoundaryEntriesState,
6
+ boundaryRegistry,
7
+ boundsScreens,
8
+ pairs,
9
+ } from "./state";
5
10
 
6
11
  function clear(screenKey: ScreenKey) {
7
12
  "worklet";
@@ -30,6 +35,12 @@ function clear(screenKey: ScreenKey) {
30
35
 
31
36
  return state;
32
37
  });
38
+
39
+ boundsScreens.modify((state) => {
40
+ "worklet";
41
+ delete state[screenKey];
42
+ return state;
43
+ });
33
44
  }
34
45
 
35
46
  export { clear };
@@ -0,0 +1,403 @@
1
+ import type { SharedValue } from "react-native-reanimated";
2
+ import {
3
+ ensurePairDestinationRequests,
4
+ ensurePairGroups,
5
+ ensurePairLinks,
6
+ ensurePairSourceRequests,
7
+ getDestinationScreenKeyFromPairKey,
8
+ getGroupKeyFromTag,
9
+ getLinkKeyFromTag,
10
+ getSourceScreenKeyFromPairKey,
11
+ } from "../helpers/link-pairs.helpers";
12
+ import type {
13
+ BoundsScreenNode,
14
+ BoundTag,
15
+ EntryPatch,
16
+ LinkKey,
17
+ LinkPairsState,
18
+ ScreenKey,
19
+ ScreenPairKey,
20
+ TagID,
21
+ } from "../types";
22
+ import { removeEntry, setEntry } from "./entries";
23
+ import {
24
+ registerBoundsScreen,
25
+ screenBelongsToScope,
26
+ unregisterBoundsScreen,
27
+ } from "./screen-graph";
28
+ import { boundaryRegistry, boundsScreens, pairs } from "./state";
29
+
30
+ type MeasurementRequest = {
31
+ type: "source" | "destination";
32
+ pairKey: ScreenPairKey;
33
+ };
34
+
35
+ type RegisterScreenParams = {
36
+ screenKey: ScreenKey;
37
+ parentScreenKey?: ScreenKey;
38
+ animationProgress: SharedValue<number>;
39
+ pendingLifecycleStartBlockCount: SharedValue<number>;
40
+ };
41
+
42
+ type RegisterBoundaryParams = {
43
+ boundTag: BoundTag;
44
+ screenKey: ScreenKey;
45
+ entry: EntryPatch;
46
+ };
47
+
48
+ type RequestBoundaryMeasurementsParams = {
49
+ pairKey: ScreenPairKey;
50
+ tag: TagID;
51
+ destination: boolean;
52
+ refresh: boolean;
53
+ };
54
+
55
+ const getRequestedLinkKey = (
56
+ state: LinkPairsState,
57
+ pairKey: ScreenPairKey,
58
+ tag: TagID,
59
+ ): LinkKey => {
60
+ "worklet";
61
+ const requestedLinkKey = getLinkKeyFromTag(tag);
62
+ const group = getGroupKeyFromTag(tag);
63
+ return group
64
+ ? (state[pairKey]?.groups[group]?.activeId ?? requestedLinkKey)
65
+ : requestedLinkKey;
66
+ };
67
+
68
+ const getConcreteTag = (
69
+ state: LinkPairsState,
70
+ pairKey: ScreenPairKey,
71
+ tag: TagID,
72
+ ): TagID => {
73
+ "worklet";
74
+ const group = getGroupKeyFromTag(tag);
75
+ const linkKey = getRequestedLinkKey(state, pairKey, tag);
76
+ return group ? `${group}:${linkKey}` : linkKey;
77
+ };
78
+
79
+ const hasRegisteredDestination = (
80
+ pairKey: ScreenPairKey,
81
+ tag: TagID,
82
+ ): boolean => {
83
+ "worklet";
84
+ const destinationRoot = getDestinationScreenKeyFromPairKey(pairKey);
85
+ if (!destinationRoot) return false;
86
+
87
+ const screens = boundaryRegistry.get()[tag]?.screens;
88
+ for (const screenKey in screens) {
89
+ if (screenBelongsToScope(screenKey, destinationRoot)) return true;
90
+ }
91
+
92
+ return false;
93
+ };
94
+
95
+ const hasRegisteredSource = (pairKey: ScreenPairKey, tag: TagID): boolean => {
96
+ "worklet";
97
+ const sourceRoot = getSourceScreenKeyFromPairKey(pairKey);
98
+ const screens = boundaryRegistry.get()[tag]?.screens;
99
+ for (const screenKey in screens) {
100
+ if (screenBelongsToScope(screenKey, sourceRoot)) return true;
101
+ }
102
+
103
+ return false;
104
+ };
105
+
106
+ const claimDestinationBlock = (pairKey: ScreenPairKey, tag: TagID) => {
107
+ "worklet";
108
+ const state = pairs.get();
109
+ const linkKey = getRequestedLinkKey(state, pairKey, tag);
110
+ const pair = state[pairKey];
111
+ if (
112
+ !pair?.destinationRequests?.[linkKey] ||
113
+ pair.blockedDestinations?.[linkKey]
114
+ ) {
115
+ return;
116
+ }
117
+
118
+ const concreteTag = getConcreteTag(state, pairKey, tag);
119
+ if (
120
+ !hasRegisteredSource(pairKey, concreteTag) ||
121
+ !hasRegisteredDestination(pairKey, concreteTag)
122
+ ) {
123
+ return;
124
+ }
125
+
126
+ const destinationRoot = getDestinationScreenKeyFromPairKey(pairKey);
127
+ const destinationScreen = boundsScreens.get()[destinationRoot];
128
+ if (!destinationScreen || destinationScreen.animationProgress.get() > 0) {
129
+ return;
130
+ }
131
+
132
+ destinationScreen.pendingLifecycleStartBlockCount.modify(
133
+ <T extends number>(count: T): T => {
134
+ "worklet";
135
+ return (count + 1) as T;
136
+ },
137
+ );
138
+
139
+ pairs.modify(<T extends LinkPairsState>(current: T): T => {
140
+ "worklet";
141
+ const currentPair = current[pairKey];
142
+ if (!currentPair) return current;
143
+ if (!currentPair.blockedDestinations) {
144
+ currentPair.blockedDestinations = {};
145
+ }
146
+ currentPair.blockedDestinations[linkKey] = true;
147
+ return current;
148
+ });
149
+ };
150
+
151
+ const releaseDestinationBlock = (pairKey: ScreenPairKey, linkKey: LinkKey) => {
152
+ "worklet";
153
+ const pair = pairs.get()[pairKey];
154
+ if (!pair?.blockedDestinations?.[linkKey]) return;
155
+
156
+ const destinationRoot = getDestinationScreenKeyFromPairKey(pairKey);
157
+ const destinationScreen = boundsScreens.get()[destinationRoot];
158
+ destinationScreen?.pendingLifecycleStartBlockCount.modify(
159
+ <T extends number>(count: T): T => {
160
+ "worklet";
161
+ return Math.max(0, count - 1) as T;
162
+ },
163
+ );
164
+
165
+ pairs.modify(<T extends LinkPairsState>(state: T): T => {
166
+ "worklet";
167
+ delete state[pairKey]?.blockedDestinations?.[linkKey];
168
+ return state;
169
+ });
170
+ };
171
+
172
+ const releaseDestinationBlockWhenReady = (
173
+ pairKey: ScreenPairKey,
174
+ linkKey: LinkKey,
175
+ ) => {
176
+ "worklet";
177
+ const pair = pairs.get()[pairKey];
178
+ const link = pair?.links[linkKey];
179
+ if (!link?.source || !link.destination) return;
180
+ if (link.source.escapeClipping && !pair.portalReadySources?.[linkKey]) return;
181
+ releaseDestinationBlock(pairKey, linkKey);
182
+ };
183
+
184
+ export function registerScreen(params: RegisterScreenParams) {
185
+ "worklet";
186
+ const node: BoundsScreenNode = {
187
+ parentScreenKey: params.parentScreenKey,
188
+ animationProgress: params.animationProgress,
189
+ pendingLifecycleStartBlockCount: params.pendingLifecycleStartBlockCount,
190
+ };
191
+ registerBoundsScreen(params.screenKey, node);
192
+
193
+ const state = pairs.get();
194
+ for (const pairKey in state) {
195
+ const requests = state[pairKey]?.destinationRequests;
196
+ for (const linkKey in requests) {
197
+ claimDestinationBlock(pairKey, linkKey);
198
+ }
199
+ }
200
+ }
201
+
202
+ export function unregisterScreen(screenKey: ScreenKey) {
203
+ "worklet";
204
+ unregisterBoundsScreen(screenKey);
205
+ }
206
+
207
+ export function registerBoundary({
208
+ boundTag,
209
+ screenKey,
210
+ entry,
211
+ }: RegisterBoundaryParams) {
212
+ "worklet";
213
+ setEntry(boundTag.tag, screenKey, entry);
214
+
215
+ const state = pairs.get();
216
+ for (const pairKey in state) {
217
+ const linkKey = getRequestedLinkKey(state, pairKey, boundTag.tag);
218
+ if (state[pairKey]?.destinationRequests?.[linkKey]) {
219
+ claimDestinationBlock(pairKey, boundTag.tag);
220
+ }
221
+ }
222
+ }
223
+
224
+ export function unregisterBoundary(boundTag: BoundTag, screenKey: ScreenKey) {
225
+ "worklet";
226
+ removeEntry(boundTag.tag, screenKey);
227
+ if (!boundsScreens.get()[screenKey]) return;
228
+
229
+ const state = pairs.get();
230
+ for (const pairKey in state) {
231
+ const concreteTag = getConcreteTag(state, pairKey, boundTag.tag);
232
+ const type =
233
+ screenBelongsToScope(screenKey, getSourceScreenKeyFromPairKey(pairKey)) &&
234
+ !hasRegisteredSource(pairKey, concreteTag)
235
+ ? "source"
236
+ : screenBelongsToScope(
237
+ screenKey,
238
+ getDestinationScreenKeyFromPairKey(pairKey),
239
+ ) && !hasRegisteredDestination(pairKey, concreteTag)
240
+ ? "destination"
241
+ : null;
242
+ if (!type) continue;
243
+
244
+ abandonBoundaryMeasurement({
245
+ type,
246
+ pairKey,
247
+ tag: getRequestedLinkKey(state, pairKey, boundTag.tag),
248
+ });
249
+ }
250
+ }
251
+
252
+ export function requestBoundaryMeasurements({
253
+ pairKey,
254
+ tag,
255
+ destination,
256
+ refresh,
257
+ }: RequestBoundaryMeasurementsParams) {
258
+ "worklet";
259
+ const requestedLinkKey = getLinkKeyFromTag(tag);
260
+ const group = getGroupKeyFromTag(tag);
261
+ const previousActiveId = group
262
+ ? pairs.get()[pairKey]?.groups[group]?.activeId
263
+ : undefined;
264
+
265
+ if (previousActiveId && previousActiveId !== requestedLinkKey) {
266
+ releaseDestinationBlock(pairKey, previousActiveId);
267
+ }
268
+
269
+ pairs.modify(<T extends LinkPairsState>(state: T): T => {
270
+ "worklet";
271
+ const groups = ensurePairGroups(state, pairKey);
272
+ if (group && groups[group]?.activeId !== requestedLinkKey) {
273
+ groups[group] = {
274
+ activeId: requestedLinkKey,
275
+ initialId: groups[group]?.initialId ?? requestedLinkKey,
276
+ };
277
+ if (previousActiveId) {
278
+ delete state[pairKey]?.sourceRequests?.[previousActiveId];
279
+ delete state[pairKey]?.destinationRequests?.[previousActiveId];
280
+ }
281
+ }
282
+
283
+ const linkKey = getRequestedLinkKey(state, pairKey, tag);
284
+ const pair = state[pairKey];
285
+ const link = ensurePairLinks(state, pairKey)[linkKey];
286
+ const refreshing = !!pair?.refreshingLinks?.[linkKey];
287
+ const startsRefresh = refresh && !refreshing;
288
+
289
+ if (!pair.refreshingLinks) pair.refreshingLinks = {};
290
+ if (refresh) {
291
+ pair.refreshingLinks[linkKey] = true;
292
+ } else {
293
+ delete pair.refreshingLinks[linkKey];
294
+ }
295
+
296
+ if (!link?.source || startsRefresh) {
297
+ ensurePairSourceRequests(state, pairKey)[linkKey] = true;
298
+ delete pair.portalReadySources?.[linkKey];
299
+ }
300
+
301
+ if (destination) {
302
+ if (group) {
303
+ if (!pair.destinationGroupDemands) pair.destinationGroupDemands = {};
304
+ pair.destinationGroupDemands[group] = true;
305
+ } else {
306
+ if (!pair.destinationLinkDemands) pair.destinationLinkDemands = {};
307
+ pair.destinationLinkDemands[linkKey] = true;
308
+ }
309
+
310
+ if (!link?.destination || startsRefresh) {
311
+ ensurePairDestinationRequests(state, pairKey)[linkKey] = true;
312
+ }
313
+ }
314
+
315
+ return state;
316
+ });
317
+
318
+ if (destination) claimDestinationBlock(pairKey, tag);
319
+ }
320
+
321
+ export function getBoundaryMeasurementRequest(
322
+ tag: TagID,
323
+ screenKey: ScreenKey,
324
+ state: LinkPairsState = pairs.get(),
325
+ ): MeasurementRequest | null {
326
+ "worklet";
327
+ const linkKey = getLinkKeyFromTag(tag);
328
+ const group = getGroupKeyFromTag(tag);
329
+ let match: MeasurementRequest | null = null;
330
+
331
+ for (const pairKey in state) {
332
+ const pair = state[pairKey];
333
+ if (group && pair?.groups[group]?.activeId !== linkKey) continue;
334
+
335
+ const sourceRoot = getSourceScreenKeyFromPairKey(pairKey);
336
+ if (
337
+ pair?.sourceRequests?.[linkKey] &&
338
+ screenBelongsToScope(screenKey, sourceRoot)
339
+ ) {
340
+ match = { type: "source", pairKey };
341
+ }
342
+
343
+ const destinationRoot = getDestinationScreenKeyFromPairKey(pairKey);
344
+ if (
345
+ pair?.destinationRequests?.[linkKey] &&
346
+ destinationRoot &&
347
+ screenBelongsToScope(screenKey, destinationRoot)
348
+ ) {
349
+ match = { type: "destination", pairKey };
350
+ }
351
+ }
352
+
353
+ return match;
354
+ }
355
+
356
+ export function completeBoundaryMeasurement(
357
+ target: MeasurementRequest,
358
+ tag: TagID,
359
+ ) {
360
+ "worklet";
361
+ const linkKey = getLinkKeyFromTag(tag);
362
+ releaseDestinationBlockWhenReady(target.pairKey, linkKey);
363
+ }
364
+
365
+ export function markBoundaryPortalReady(pairKey: ScreenPairKey, tag: TagID) {
366
+ "worklet";
367
+ const linkKey = getLinkKeyFromTag(tag);
368
+ pairs.modify(<T extends LinkPairsState>(state: T): T => {
369
+ "worklet";
370
+ const pair = state[pairKey];
371
+ if (!pair) return state;
372
+ if (!pair.portalReadySources) pair.portalReadySources = {};
373
+ pair.portalReadySources[linkKey] = true;
374
+ return state;
375
+ });
376
+ releaseDestinationBlockWhenReady(pairKey, linkKey);
377
+ }
378
+
379
+ export function abandonBoundaryMeasurement(
380
+ params: MeasurementRequest & { tag: TagID },
381
+ ) {
382
+ "worklet";
383
+ const linkKey = getLinkKeyFromTag(params.tag);
384
+ const pair = pairs.get()[params.pairKey];
385
+ const hasPendingRequest =
386
+ params.type === "source"
387
+ ? !!pair?.sourceRequests?.[linkKey]
388
+ : !!pair?.destinationRequests?.[linkKey];
389
+ const hasDestinationBlock = !!pair?.blockedDestinations?.[linkKey];
390
+ if (!hasPendingRequest && !hasDestinationBlock) return;
391
+
392
+ pairs.modify(<T extends LinkPairsState>(state: T): T => {
393
+ "worklet";
394
+ if (params.type === "source") {
395
+ delete state[params.pairKey]?.sourceRequests?.[linkKey];
396
+ } else {
397
+ delete state[params.pairKey]?.destinationRequests?.[linkKey];
398
+ }
399
+ return state;
400
+ });
401
+
402
+ releaseDestinationBlock(params.pairKey, linkKey);
403
+ }
@@ -62,43 +62,6 @@ function getEntry(tag: TagID, key: ScreenKey): Entry | null {
62
62
  return boundaryRegistry.get()[tag]?.screens[key] ?? null;
63
63
  }
64
64
 
65
- function getMatchingSourceScreenKey(
66
- tag: TagID,
67
- destinationScreenKey: ScreenKey,
68
- preferredScreenKey?: ScreenKey,
69
- excludedScreenKeys?: readonly ScreenKey[],
70
- ): ScreenKey | null {
71
- "worklet";
72
- const screens = boundaryRegistry.get()[tag]?.screens;
73
- if (!screens) return null;
74
- const isExcluded = (screenKey: ScreenKey) => {
75
- "worklet";
76
- for (let index = 0; index < (excludedScreenKeys?.length ?? 0); index++) {
77
- if (excludedScreenKeys?.[index] === screenKey) {
78
- return true;
79
- }
80
- }
81
- return false;
82
- };
83
- if (
84
- preferredScreenKey &&
85
- preferredScreenKey !== destinationScreenKey &&
86
- !isExcluded(preferredScreenKey) &&
87
- screens[preferredScreenKey]
88
- ) {
89
- return preferredScreenKey;
90
- }
91
-
92
- let latestScreenKey: ScreenKey | null = null;
93
- for (const screenKey in screens) {
94
- if (screenKey !== destinationScreenKey && !isExcluded(screenKey)) {
95
- latestScreenKey = screenKey;
96
- }
97
- }
98
-
99
- return latestScreenKey;
100
- }
101
-
102
65
  function setEntry(tag: TagID, screenKey: ScreenKey, patch: EntryPatch) {
103
66
  "worklet";
104
67
  boundaryRegistry.modify(<T extends BoundaryEntriesState>(state: T): T => {
@@ -127,4 +90,4 @@ function removeEntry(tag: TagID, screenKey: ScreenKey) {
127
90
  });
128
91
  }
129
92
 
130
- export { getEntry, getMatchingSourceScreenKey, removeEntry, setEntry };
93
+ export { getEntry, removeEntry, setEntry };