react-native-screen-transitions 3.11.3 → 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 (524) hide show
  1. package/lib/commonjs/blank-stack/components/stack-view.js +1 -2
  2. package/lib/commonjs/blank-stack/components/stack-view.js.map +1 -1
  3. package/lib/commonjs/component-stack/components/stack-view.js +1 -2
  4. package/lib/commonjs/component-stack/components/stack-view.js.map +1 -1
  5. package/lib/commonjs/native-stack/views/NativeStackView.native.js +2 -3
  6. package/lib/commonjs/native-stack/views/NativeStackView.native.js.map +1 -1
  7. package/lib/commonjs/shared/adapters/with-screen-transitions/stack-layout.js +1 -1
  8. package/lib/commonjs/shared/adapters/with-screen-transitions/stack-layout.js.map +1 -1
  9. package/lib/commonjs/shared/components/activity/variants/activity-screen.js +1 -1
  10. package/lib/commonjs/shared/components/activity/variants/activity-screen.js.map +1 -1
  11. package/lib/commonjs/shared/components/boundary/components/boundary-lifecycle.js +0 -3
  12. package/lib/commonjs/shared/components/boundary/components/boundary-lifecycle.js.map +1 -1
  13. package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-boundary-measurement-request.js +69 -0
  14. package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-boundary-measurement-request.js.map +1 -0
  15. package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-boundary-presence.js +11 -10
  16. package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-boundary-presence.js.map +1 -1
  17. package/lib/commonjs/shared/components/boundary/hooks/use-boundary-measurement.js +3 -19
  18. package/lib/commonjs/shared/components/boundary/hooks/use-boundary-measurement.js.map +1 -1
  19. package/lib/commonjs/shared/components/boundary/hooks/use-measurer.js +6 -16
  20. package/lib/commonjs/shared/components/boundary/hooks/use-measurer.js.map +1 -1
  21. package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/helpers/active-handoff-receiver.js +27 -1
  22. package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/helpers/active-handoff-receiver.js.map +1 -1
  23. package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js +32 -11
  24. package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js.map +1 -1
  25. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.js +8 -1
  26. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.js.map +1 -1
  27. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/helpers/attachment.js +19 -0
  28. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/helpers/attachment.js.map +1 -0
  29. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/helpers/host-readiness.js +18 -0
  30. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/helpers/host-readiness.js.map +1 -0
  31. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/helpers/local-measurement.js +22 -1
  32. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/helpers/local-measurement.js.map +1 -1
  33. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/hooks/use-active-portal-boundary-host.js +10 -10
  34. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/hooks/use-active-portal-boundary-host.js.map +1 -1
  35. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js +18 -6
  36. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js.map +1 -1
  37. package/lib/commonjs/shared/components/overlay/helpers/create-overlay-interpolator-frame.js +30 -0
  38. package/lib/commonjs/shared/components/overlay/helpers/create-overlay-interpolator-frame.js.map +1 -0
  39. package/lib/commonjs/shared/components/overlay/helpers/get-active-overlay.js +40 -22
  40. package/lib/commonjs/shared/components/overlay/helpers/get-active-overlay.js.map +1 -1
  41. package/lib/commonjs/shared/components/overlay/helpers/retain-ready-overlay-resources.js +21 -0
  42. package/lib/commonjs/shared/components/overlay/helpers/retain-ready-overlay-resources.js.map +1 -0
  43. package/lib/commonjs/shared/components/overlay/helpers/run-overlay-slot-interpolator.js +41 -0
  44. package/lib/commonjs/shared/components/overlay/helpers/run-overlay-slot-interpolator.js.map +1 -0
  45. package/lib/commonjs/shared/components/overlay/hooks/use-overlay-slot.js +85 -0
  46. package/lib/commonjs/shared/components/overlay/hooks/use-overlay-slot.js.map +1 -0
  47. package/lib/commonjs/shared/components/overlay/variations/float-overlay.js +14 -65
  48. package/lib/commonjs/shared/components/overlay/variations/float-overlay.js.map +1 -1
  49. package/lib/commonjs/shared/components/overlay/variations/overlay-host.js +89 -16
  50. package/lib/commonjs/shared/components/overlay/variations/overlay-host.js.map +1 -1
  51. package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-close-transition-intent.js +4 -1
  52. package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-close-transition-intent.js.map +1 -1
  53. package/lib/commonjs/shared/providers/helpers/measured-bounds-writes.js +4 -0
  54. package/lib/commonjs/shared/providers/helpers/measured-bounds-writes.js.map +1 -1
  55. package/lib/commonjs/shared/providers/screen/animation/animation.provider.js +14 -8
  56. package/lib/commonjs/shared/providers/screen/animation/animation.provider.js.map +1 -1
  57. package/lib/commonjs/shared/providers/screen/animation/helpers/accessors/use-build-transition-accessor.js +6 -8
  58. package/lib/commonjs/shared/providers/screen/animation/helpers/accessors/use-build-transition-accessor.js.map +1 -1
  59. package/lib/commonjs/shared/providers/screen/animation/helpers/hydrate-transition-state/index.js +5 -1
  60. package/lib/commonjs/shared/providers/screen/animation/helpers/hydrate-transition-state/index.js.map +1 -1
  61. package/lib/commonjs/shared/providers/screen/animation/helpers/interpolator-participation.js +9 -0
  62. package/lib/commonjs/shared/providers/screen/animation/helpers/interpolator-participation.js.map +1 -0
  63. package/lib/commonjs/shared/providers/screen/animation/helpers/pipeline.js +13 -2
  64. package/lib/commonjs/shared/providers/screen/animation/helpers/pipeline.js.map +1 -1
  65. package/lib/commonjs/shared/providers/screen/animation/use-screen-animation.js +8 -2
  66. package/lib/commonjs/shared/providers/screen/animation/use-screen-animation.js.map +1 -1
  67. package/lib/commonjs/shared/providers/screen/descriptors/descriptors.provider.js +40 -8
  68. package/lib/commonjs/shared/providers/screen/descriptors/descriptors.provider.js.map +1 -1
  69. package/lib/commonjs/shared/providers/screen/descriptors/helpers/derive-descriptor-derivations.js +2 -0
  70. package/lib/commonjs/shared/providers/screen/descriptors/helpers/derive-descriptor-derivations.js.map +1 -1
  71. package/lib/commonjs/shared/providers/screen/descriptors/helpers/derive-structural-ancestor-keys.js +12 -0
  72. package/lib/commonjs/shared/providers/screen/descriptors/helpers/derive-structural-ancestor-keys.js.map +1 -0
  73. package/lib/commonjs/shared/providers/screen/gestures/gestures.provider.js +9 -5
  74. package/lib/commonjs/shared/providers/screen/gestures/gestures.provider.js.map +1 -1
  75. package/lib/commonjs/shared/providers/screen/gestures/hooks/use-screen-gesture-config.js +1 -3
  76. package/lib/commonjs/shared/providers/screen/gestures/hooks/use-screen-gesture-config.js.map +1 -1
  77. package/lib/commonjs/shared/providers/screen/gestures/ownership/{use-walk-up-and-register-shadowing-claims.js → gesture-ownership-bridge.js} +36 -50
  78. package/lib/commonjs/shared/providers/screen/gestures/ownership/gesture-ownership-bridge.js.map +1 -0
  79. package/lib/commonjs/shared/providers/screen/gestures/pan/behavior/pan-lifecycle.js +1 -0
  80. package/lib/commonjs/shared/providers/screen/gestures/pan/behavior/pan-lifecycle.js.map +1 -1
  81. package/lib/commonjs/shared/providers/screen/gestures/pan/behavior/pan-release.js +9 -2
  82. package/lib/commonjs/shared/providers/screen/gestures/pan/behavior/pan-release.js.map +1 -1
  83. package/lib/commonjs/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.js +1 -0
  84. package/lib/commonjs/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.js.map +1 -1
  85. package/lib/commonjs/shared/providers/screen/styles/constants.js +3 -1
  86. package/lib/commonjs/shared/providers/screen/styles/constants.js.map +1 -1
  87. package/lib/commonjs/shared/providers/screen/styles/helpers/transition-visual-state.js +20 -1
  88. package/lib/commonjs/shared/providers/screen/styles/helpers/transition-visual-state.js.map +1 -1
  89. package/lib/commonjs/shared/providers/screen/styles/helpers/visibility-block-ownership.js +19 -0
  90. package/lib/commonjs/shared/providers/screen/styles/helpers/visibility-block-ownership.js.map +1 -0
  91. package/lib/commonjs/shared/providers/screen/styles/hooks/slot-resolvers.js +14 -15
  92. package/lib/commonjs/shared/providers/screen/styles/hooks/slot-resolvers.js.map +1 -1
  93. package/lib/commonjs/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js +34 -11
  94. package/lib/commonjs/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js.map +1 -1
  95. package/lib/commonjs/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js +35 -15
  96. package/lib/commonjs/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js.map +1 -1
  97. package/lib/commonjs/shared/providers/screen/styles/slot.provider.js +31 -33
  98. package/lib/commonjs/shared/providers/screen/styles/slot.provider.js.map +1 -1
  99. package/lib/commonjs/shared/providers/stack/blank-stack-state/helpers/resolve-presented-index.js +18 -0
  100. package/lib/commonjs/shared/providers/stack/blank-stack-state/helpers/resolve-presented-index.js.map +1 -0
  101. package/lib/commonjs/shared/providers/stack/blank-stack.provider.js +2 -1
  102. package/lib/commonjs/shared/providers/stack/blank-stack.provider.js.map +1 -1
  103. package/lib/commonjs/shared/stores/bounds/helpers/link-pairs.helpers.js +11 -1
  104. package/lib/commonjs/shared/stores/bounds/helpers/link-pairs.helpers.js.map +1 -1
  105. package/lib/commonjs/shared/stores/bounds/internals/clear.js +6 -0
  106. package/lib/commonjs/shared/stores/bounds/internals/clear.js.map +1 -1
  107. package/lib/commonjs/shared/stores/bounds/internals/coordinator.js +298 -0
  108. package/lib/commonjs/shared/stores/bounds/internals/coordinator.js.map +1 -0
  109. package/lib/commonjs/shared/stores/bounds/internals/entries.js +0 -27
  110. package/lib/commonjs/shared/stores/bounds/internals/entries.js.map +1 -1
  111. package/lib/commonjs/shared/stores/bounds/internals/links.js +22 -32
  112. package/lib/commonjs/shared/stores/bounds/internals/links.js.map +1 -1
  113. package/lib/commonjs/shared/stores/bounds/internals/screen-graph.js +45 -0
  114. package/lib/commonjs/shared/stores/bounds/internals/screen-graph.js.map +1 -0
  115. package/lib/commonjs/shared/stores/bounds/internals/state.js +4 -1
  116. package/lib/commonjs/shared/stores/bounds/internals/state.js.map +1 -1
  117. package/lib/commonjs/shared/utils/bounds/helpers/create-bounds-accessor-core.js +7 -3
  118. package/lib/commonjs/shared/utils/bounds/helpers/create-bounds-accessor-core.js.map +1 -1
  119. package/lib/commonjs/shared/utils/bounds/helpers/create-link-accessor.js +11 -0
  120. package/lib/commonjs/shared/utils/bounds/helpers/create-link-accessor.js.map +1 -1
  121. package/lib/commonjs/shared/utils/bounds/helpers/prepare-bound-styles.js +6 -2
  122. package/lib/commonjs/shared/utils/bounds/helpers/prepare-bound-styles.js.map +1 -1
  123. package/lib/commonjs/shared/utils/bounds/helpers/resolve-bounds-pair-key.js.map +1 -1
  124. package/lib/commonjs/shared/utils/bounds/helpers/styles/compute.js +11 -5
  125. package/lib/commonjs/shared/utils/bounds/helpers/styles/compute.js.map +1 -1
  126. package/lib/commonjs/shared/utils/create-provider.js +119 -10
  127. package/lib/commonjs/shared/utils/create-provider.js.map +1 -1
  128. package/lib/module/blank-stack/components/stack-view.js +1 -2
  129. package/lib/module/blank-stack/components/stack-view.js.map +1 -1
  130. package/lib/module/component-stack/components/stack-view.js +1 -2
  131. package/lib/module/component-stack/components/stack-view.js.map +1 -1
  132. package/lib/module/native-stack/views/NativeStackView.native.js +2 -3
  133. package/lib/module/native-stack/views/NativeStackView.native.js.map +1 -1
  134. package/lib/module/shared/adapters/with-screen-transitions/stack-layout.js +1 -1
  135. package/lib/module/shared/adapters/with-screen-transitions/stack-layout.js.map +1 -1
  136. package/lib/module/shared/components/activity/variants/activity-screen.js +1 -1
  137. package/lib/module/shared/components/activity/variants/activity-screen.js.map +1 -1
  138. package/lib/module/shared/components/boundary/components/boundary-lifecycle.js +0 -3
  139. package/lib/module/shared/components/boundary/components/boundary-lifecycle.js.map +1 -1
  140. package/lib/module/shared/components/boundary/hooks/lifecycles/use-boundary-measurement-request.js +64 -0
  141. package/lib/module/shared/components/boundary/hooks/lifecycles/use-boundary-measurement-request.js.map +1 -0
  142. package/lib/module/shared/components/boundary/hooks/lifecycles/use-boundary-presence.js +11 -10
  143. package/lib/module/shared/components/boundary/hooks/lifecycles/use-boundary-presence.js.map +1 -1
  144. package/lib/module/shared/components/boundary/hooks/use-boundary-measurement.js +3 -19
  145. package/lib/module/shared/components/boundary/hooks/use-boundary-measurement.js.map +1 -1
  146. package/lib/module/shared/components/boundary/hooks/use-measurer.js +6 -16
  147. package/lib/module/shared/components/boundary/hooks/use-measurer.js.map +1 -1
  148. package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/helpers/active-handoff-receiver.js +24 -0
  149. package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/helpers/active-handoff-receiver.js.map +1 -1
  150. package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js +33 -12
  151. package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js.map +1 -1
  152. package/lib/module/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.js +8 -1
  153. package/lib/module/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.js.map +1 -1
  154. package/lib/module/shared/components/boundary/portal/components/boundary-portal/helpers/attachment.js +14 -0
  155. package/lib/module/shared/components/boundary/portal/components/boundary-portal/helpers/attachment.js.map +1 -0
  156. package/lib/module/shared/components/boundary/portal/components/boundary-portal/helpers/host-readiness.js +13 -0
  157. package/lib/module/shared/components/boundary/portal/components/boundary-portal/helpers/host-readiness.js.map +1 -0
  158. package/lib/module/shared/components/boundary/portal/components/boundary-portal/helpers/local-measurement.js +19 -0
  159. package/lib/module/shared/components/boundary/portal/components/boundary-portal/helpers/local-measurement.js.map +1 -1
  160. package/lib/module/shared/components/boundary/portal/components/boundary-portal/hooks/use-active-portal-boundary-host.js +10 -10
  161. package/lib/module/shared/components/boundary/portal/components/boundary-portal/hooks/use-active-portal-boundary-host.js.map +1 -1
  162. package/lib/module/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js +18 -6
  163. package/lib/module/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js.map +1 -1
  164. package/lib/module/shared/components/overlay/helpers/create-overlay-interpolator-frame.js +25 -0
  165. package/lib/module/shared/components/overlay/helpers/create-overlay-interpolator-frame.js.map +1 -0
  166. package/lib/module/shared/components/overlay/helpers/get-active-overlay.js +37 -21
  167. package/lib/module/shared/components/overlay/helpers/get-active-overlay.js.map +1 -1
  168. package/lib/module/shared/components/overlay/helpers/retain-ready-overlay-resources.js +17 -0
  169. package/lib/module/shared/components/overlay/helpers/retain-ready-overlay-resources.js.map +1 -0
  170. package/lib/module/shared/components/overlay/helpers/run-overlay-slot-interpolator.js +36 -0
  171. package/lib/module/shared/components/overlay/helpers/run-overlay-slot-interpolator.js.map +1 -0
  172. package/lib/module/shared/components/overlay/hooks/use-overlay-slot.js +80 -0
  173. package/lib/module/shared/components/overlay/hooks/use-overlay-slot.js.map +1 -0
  174. package/lib/module/shared/components/overlay/variations/float-overlay.js +15 -66
  175. package/lib/module/shared/components/overlay/variations/float-overlay.js.map +1 -1
  176. package/lib/module/shared/components/overlay/variations/overlay-host.js +90 -18
  177. package/lib/module/shared/components/overlay/variations/overlay-host.js.map +1 -1
  178. package/lib/module/shared/components/screen-lifecycle/hooks/use-close-transition-intent.js +4 -1
  179. package/lib/module/shared/components/screen-lifecycle/hooks/use-close-transition-intent.js.map +1 -1
  180. package/lib/module/shared/providers/helpers/measured-bounds-writes.js +4 -0
  181. package/lib/module/shared/providers/helpers/measured-bounds-writes.js.map +1 -1
  182. package/lib/module/shared/providers/screen/animation/animation.provider.js +14 -8
  183. package/lib/module/shared/providers/screen/animation/animation.provider.js.map +1 -1
  184. package/lib/module/shared/providers/screen/animation/helpers/accessors/use-build-transition-accessor.js +6 -8
  185. package/lib/module/shared/providers/screen/animation/helpers/accessors/use-build-transition-accessor.js.map +1 -1
  186. package/lib/module/shared/providers/screen/animation/helpers/hydrate-transition-state/index.js +5 -1
  187. package/lib/module/shared/providers/screen/animation/helpers/hydrate-transition-state/index.js.map +1 -1
  188. package/lib/module/shared/providers/screen/animation/helpers/interpolator-participation.js +4 -0
  189. package/lib/module/shared/providers/screen/animation/helpers/interpolator-participation.js.map +1 -0
  190. package/lib/module/shared/providers/screen/animation/helpers/pipeline.js +13 -2
  191. package/lib/module/shared/providers/screen/animation/helpers/pipeline.js.map +1 -1
  192. package/lib/module/shared/providers/screen/animation/use-screen-animation.js +8 -2
  193. package/lib/module/shared/providers/screen/animation/use-screen-animation.js.map +1 -1
  194. package/lib/module/shared/providers/screen/descriptors/descriptors.provider.js +41 -9
  195. package/lib/module/shared/providers/screen/descriptors/descriptors.provider.js.map +1 -1
  196. package/lib/module/shared/providers/screen/descriptors/helpers/derive-descriptor-derivations.js +2 -0
  197. package/lib/module/shared/providers/screen/descriptors/helpers/derive-descriptor-derivations.js.map +1 -1
  198. package/lib/module/shared/providers/screen/descriptors/helpers/derive-structural-ancestor-keys.js +7 -0
  199. package/lib/module/shared/providers/screen/descriptors/helpers/derive-structural-ancestor-keys.js.map +1 -0
  200. package/lib/module/shared/providers/screen/gestures/gestures.provider.js +10 -6
  201. package/lib/module/shared/providers/screen/gestures/gestures.provider.js.map +1 -1
  202. package/lib/module/shared/providers/screen/gestures/hooks/use-screen-gesture-config.js +1 -3
  203. package/lib/module/shared/providers/screen/gestures/hooks/use-screen-gesture-config.js.map +1 -1
  204. package/lib/module/shared/providers/screen/gestures/ownership/{use-walk-up-and-register-shadowing-claims.js → gesture-ownership-bridge.js} +35 -49
  205. package/lib/module/shared/providers/screen/gestures/ownership/gesture-ownership-bridge.js.map +1 -0
  206. package/lib/module/shared/providers/screen/gestures/pan/behavior/pan-lifecycle.js +1 -0
  207. package/lib/module/shared/providers/screen/gestures/pan/behavior/pan-lifecycle.js.map +1 -1
  208. package/lib/module/shared/providers/screen/gestures/pan/behavior/pan-release.js +9 -2
  209. package/lib/module/shared/providers/screen/gestures/pan/behavior/pan-release.js.map +1 -1
  210. package/lib/module/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.js +1 -0
  211. package/lib/module/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.js.map +1 -1
  212. package/lib/module/shared/providers/screen/styles/constants.js +3 -1
  213. package/lib/module/shared/providers/screen/styles/constants.js.map +1 -1
  214. package/lib/module/shared/providers/screen/styles/helpers/transition-visual-state.js +18 -0
  215. package/lib/module/shared/providers/screen/styles/helpers/transition-visual-state.js.map +1 -1
  216. package/lib/module/shared/providers/screen/styles/helpers/visibility-block-ownership.js +14 -0
  217. package/lib/module/shared/providers/screen/styles/helpers/visibility-block-ownership.js.map +1 -0
  218. package/lib/module/shared/providers/screen/styles/hooks/slot-resolvers.js +14 -15
  219. package/lib/module/shared/providers/screen/styles/hooks/slot-resolvers.js.map +1 -1
  220. package/lib/module/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js +35 -12
  221. package/lib/module/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js.map +1 -1
  222. package/lib/module/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js +35 -15
  223. package/lib/module/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js.map +1 -1
  224. package/lib/module/shared/providers/screen/styles/slot.provider.js +30 -33
  225. package/lib/module/shared/providers/screen/styles/slot.provider.js.map +1 -1
  226. package/lib/module/shared/providers/stack/blank-stack-state/helpers/resolve-presented-index.js +14 -0
  227. package/lib/module/shared/providers/stack/blank-stack-state/helpers/resolve-presented-index.js.map +1 -0
  228. package/lib/module/shared/providers/stack/blank-stack.provider.js +2 -1
  229. package/lib/module/shared/providers/stack/blank-stack.provider.js.map +1 -1
  230. package/lib/module/shared/stores/bounds/helpers/link-pairs.helpers.js +9 -0
  231. package/lib/module/shared/stores/bounds/helpers/link-pairs.helpers.js.map +1 -1
  232. package/lib/module/shared/stores/bounds/internals/clear.js +7 -1
  233. package/lib/module/shared/stores/bounds/internals/clear.js.map +1 -1
  234. package/lib/module/shared/stores/bounds/internals/coordinator.js +286 -0
  235. package/lib/module/shared/stores/bounds/internals/coordinator.js.map +1 -0
  236. package/lib/module/shared/stores/bounds/internals/entries.js +1 -27
  237. package/lib/module/shared/stores/bounds/internals/entries.js.map +1 -1
  238. package/lib/module/shared/stores/bounds/internals/links.js +24 -32
  239. package/lib/module/shared/stores/bounds/internals/links.js.map +1 -1
  240. package/lib/module/shared/stores/bounds/internals/screen-graph.js +39 -0
  241. package/lib/module/shared/stores/bounds/internals/screen-graph.js.map +1 -0
  242. package/lib/module/shared/stores/bounds/internals/state.js +3 -0
  243. package/lib/module/shared/stores/bounds/internals/state.js.map +1 -1
  244. package/lib/module/shared/types/animation.types.js.map +1 -1
  245. package/lib/module/shared/utils/bounds/helpers/create-bounds-accessor-core.js +7 -3
  246. package/lib/module/shared/utils/bounds/helpers/create-bounds-accessor-core.js.map +1 -1
  247. package/lib/module/shared/utils/bounds/helpers/create-link-accessor.js +11 -0
  248. package/lib/module/shared/utils/bounds/helpers/create-link-accessor.js.map +1 -1
  249. package/lib/module/shared/utils/bounds/helpers/prepare-bound-styles.js +6 -2
  250. package/lib/module/shared/utils/bounds/helpers/prepare-bound-styles.js.map +1 -1
  251. package/lib/module/shared/utils/bounds/helpers/resolve-bounds-pair-key.js.map +1 -1
  252. package/lib/module/shared/utils/bounds/helpers/styles/compute.js +11 -5
  253. package/lib/module/shared/utils/bounds/helpers/styles/compute.js.map +1 -1
  254. package/lib/module/shared/utils/create-provider.js +119 -10
  255. package/lib/module/shared/utils/create-provider.js.map +1 -1
  256. package/lib/typescript/blank-stack/components/stack-view.d.ts.map +1 -1
  257. package/lib/typescript/blank-stack/types.d.ts +1 -1
  258. package/lib/typescript/blank-stack/types.d.ts.map +1 -1
  259. package/lib/typescript/component-stack/components/stack-view.d.ts.map +1 -1
  260. package/lib/typescript/component-stack/types.d.ts +1 -1
  261. package/lib/typescript/component-stack/types.d.ts.map +1 -1
  262. package/lib/typescript/native-stack/types.d.ts +1 -1
  263. package/lib/typescript/native-stack/types.d.ts.map +1 -1
  264. package/lib/typescript/native-stack/views/NativeStackView.native.d.ts.map +1 -1
  265. package/lib/typescript/native-stack/views/useHeaderConfigProps.d.ts +1 -1
  266. package/lib/typescript/shared/components/boundary/components/boundary-lifecycle.d.ts.map +1 -1
  267. package/lib/typescript/shared/components/boundary/hooks/lifecycles/{use-initial-source-measurement.d.ts → use-boundary-measurement-request.d.ts} +4 -3
  268. package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-boundary-measurement-request.d.ts.map +1 -0
  269. package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-boundary-presence.d.ts.map +1 -1
  270. package/lib/typescript/shared/components/boundary/hooks/use-boundary-measurement.d.ts +1 -3
  271. package/lib/typescript/shared/components/boundary/hooks/use-boundary-measurement.d.ts.map +1 -1
  272. package/lib/typescript/shared/components/boundary/hooks/use-measurer.d.ts.map +1 -1
  273. package/lib/typescript/shared/components/boundary/portal/components/boundary-content-portal/helpers/active-handoff-receiver.d.ts +12 -0
  274. package/lib/typescript/shared/components/boundary/portal/components/boundary-content-portal/helpers/active-handoff-receiver.d.ts.map +1 -1
  275. package/lib/typescript/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.d.ts.map +1 -1
  276. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.d.ts.map +1 -1
  277. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/helpers/attachment.d.ts +8 -0
  278. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/helpers/attachment.d.ts.map +1 -0
  279. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/helpers/host-readiness.d.ts +6 -0
  280. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/helpers/host-readiness.d.ts.map +1 -0
  281. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/helpers/local-measurement.d.ts +4 -1
  282. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/helpers/local-measurement.d.ts.map +1 -1
  283. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/hooks/use-active-portal-boundary-host.d.ts +2 -3
  284. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/hooks/use-active-portal-boundary-host.d.ts.map +1 -1
  285. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.d.ts.map +1 -1
  286. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/hooks/use-placeholder-styles.d.ts +2 -2
  287. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/stores/portal-boundary-host.store.d.ts +1 -1
  288. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/stores/portal-boundary-host.store.d.ts.map +1 -1
  289. package/lib/typescript/shared/components/boundary/types.d.ts +1 -1
  290. package/lib/typescript/shared/components/boundary/types.d.ts.map +1 -1
  291. package/lib/typescript/shared/components/create-transition-aware-component.d.ts +5 -6
  292. package/lib/typescript/shared/components/create-transition-aware-component.d.ts.map +1 -1
  293. package/lib/typescript/shared/components/overlay/helpers/create-overlay-interpolator-frame.d.ts +7 -0
  294. package/lib/typescript/shared/components/overlay/helpers/create-overlay-interpolator-frame.d.ts.map +1 -0
  295. package/lib/typescript/shared/components/overlay/helpers/get-active-overlay.d.ts +17 -7
  296. package/lib/typescript/shared/components/overlay/helpers/get-active-overlay.d.ts.map +1 -1
  297. package/lib/typescript/shared/components/overlay/helpers/retain-ready-overlay-resources.d.ts +11 -0
  298. package/lib/typescript/shared/components/overlay/helpers/retain-ready-overlay-resources.d.ts.map +1 -0
  299. package/lib/typescript/shared/components/overlay/helpers/run-overlay-slot-interpolator.d.ts +8 -0
  300. package/lib/typescript/shared/components/overlay/helpers/run-overlay-slot-interpolator.d.ts.map +1 -0
  301. package/lib/typescript/shared/components/overlay/hooks/use-overlay-slot.d.ts +15 -0
  302. package/lib/typescript/shared/components/overlay/hooks/use-overlay-slot.d.ts.map +1 -0
  303. package/lib/typescript/shared/components/overlay/variations/float-overlay.d.ts +1 -1
  304. package/lib/typescript/shared/components/overlay/variations/float-overlay.d.ts.map +1 -1
  305. package/lib/typescript/shared/components/overlay/variations/overlay-host.d.ts +7 -6
  306. package/lib/typescript/shared/components/overlay/variations/overlay-host.d.ts.map +1 -1
  307. package/lib/typescript/shared/components/screen-lifecycle/hooks/use-close-transition-intent.d.ts.map +1 -1
  308. package/lib/typescript/shared/index.d.ts +658 -710
  309. package/lib/typescript/shared/index.d.ts.map +1 -1
  310. package/lib/typescript/shared/providers/helpers/measured-bounds-writes.d.ts.map +1 -1
  311. package/lib/typescript/shared/providers/screen/animation/animation.provider.d.ts +4 -0
  312. package/lib/typescript/shared/providers/screen/animation/animation.provider.d.ts.map +1 -1
  313. package/lib/typescript/shared/providers/screen/animation/helpers/accessors/use-build-transition-accessor.d.ts +4 -1
  314. package/lib/typescript/shared/providers/screen/animation/helpers/accessors/use-build-transition-accessor.d.ts.map +1 -1
  315. package/lib/typescript/shared/providers/screen/animation/helpers/hydrate-transition-state/index.d.ts.map +1 -1
  316. package/lib/typescript/shared/providers/screen/animation/helpers/interpolator-participation.d.ts +3 -0
  317. package/lib/typescript/shared/providers/screen/animation/helpers/interpolator-participation.d.ts.map +1 -0
  318. package/lib/typescript/shared/providers/screen/animation/helpers/pipeline.d.ts +2 -1
  319. package/lib/typescript/shared/providers/screen/animation/helpers/pipeline.d.ts.map +1 -1
  320. package/lib/typescript/shared/providers/screen/animation/use-screen-animation.d.ts.map +1 -1
  321. package/lib/typescript/shared/providers/screen/descriptors/descriptors.provider.d.ts.map +1 -1
  322. package/lib/typescript/shared/providers/screen/descriptors/helpers/derive-descriptor-derivations.d.ts +4 -0
  323. package/lib/typescript/shared/providers/screen/descriptors/helpers/derive-descriptor-derivations.d.ts.map +1 -1
  324. package/lib/typescript/shared/providers/screen/descriptors/helpers/derive-structural-ancestor-keys.d.ts +5 -0
  325. package/lib/typescript/shared/providers/screen/descriptors/helpers/derive-structural-ancestor-keys.d.ts.map +1 -0
  326. package/lib/typescript/shared/providers/screen/gestures/gestures.provider.d.ts.map +1 -1
  327. package/lib/typescript/shared/providers/screen/gestures/hooks/use-screen-gesture-config.d.ts +2 -2
  328. package/lib/typescript/shared/providers/screen/gestures/hooks/use-screen-gesture-config.d.ts.map +1 -1
  329. package/lib/typescript/shared/providers/screen/gestures/ownership/gesture-ownership-bridge.d.ts +3 -0
  330. package/lib/typescript/shared/providers/screen/gestures/ownership/gesture-ownership-bridge.d.ts.map +1 -0
  331. package/lib/typescript/shared/providers/screen/gestures/pan/behavior/pan-lifecycle.d.ts.map +1 -1
  332. package/lib/typescript/shared/providers/screen/gestures/pan/behavior/pan-release.d.ts.map +1 -1
  333. package/lib/typescript/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.d.ts.map +1 -1
  334. package/lib/typescript/shared/providers/screen/gestures/types.d.ts +1 -0
  335. package/lib/typescript/shared/providers/screen/gestures/types.d.ts.map +1 -1
  336. package/lib/typescript/shared/providers/screen/styles/constants.d.ts.map +1 -1
  337. package/lib/typescript/shared/providers/screen/styles/helpers/transition-visual-state.d.ts +7 -0
  338. package/lib/typescript/shared/providers/screen/styles/helpers/transition-visual-state.d.ts.map +1 -1
  339. package/lib/typescript/shared/providers/screen/styles/helpers/visibility-block-ownership.d.ts +10 -0
  340. package/lib/typescript/shared/providers/screen/styles/helpers/visibility-block-ownership.d.ts.map +1 -0
  341. package/lib/typescript/shared/providers/screen/styles/hooks/slot-resolvers.d.ts +4 -4
  342. package/lib/typescript/shared/providers/screen/styles/hooks/slot-resolvers.d.ts.map +1 -1
  343. package/lib/typescript/shared/providers/screen/styles/hooks/use-interpolated-style-maps.d.ts +1 -1
  344. package/lib/typescript/shared/providers/screen/styles/hooks/use-interpolated-style-maps.d.ts.map +1 -1
  345. package/lib/typescript/shared/providers/screen/styles/hooks/use-maybe-block-visibility.d.ts +10 -4
  346. package/lib/typescript/shared/providers/screen/styles/hooks/use-maybe-block-visibility.d.ts.map +1 -1
  347. package/lib/typescript/shared/providers/screen/styles/slot.provider.d.ts +6 -5
  348. package/lib/typescript/shared/providers/screen/styles/slot.provider.d.ts.map +1 -1
  349. package/lib/typescript/shared/providers/stack/blank-stack-state/helpers/resolve-presented-index.d.ts +3 -0
  350. package/lib/typescript/shared/providers/stack/blank-stack-state/helpers/resolve-presented-index.d.ts.map +1 -0
  351. package/lib/typescript/shared/providers/stack/blank-stack.provider.d.ts.map +1 -1
  352. package/lib/typescript/shared/stores/bounds/helpers/link-pairs.helpers.d.ts +1 -0
  353. package/lib/typescript/shared/stores/bounds/helpers/link-pairs.helpers.d.ts.map +1 -1
  354. package/lib/typescript/shared/stores/bounds/internals/clear.d.ts.map +1 -1
  355. package/lib/typescript/shared/stores/bounds/internals/coordinator.d.ts +36 -0
  356. package/lib/typescript/shared/stores/bounds/internals/coordinator.d.ts.map +1 -0
  357. package/lib/typescript/shared/stores/bounds/internals/entries.d.ts +1 -2
  358. package/lib/typescript/shared/stores/bounds/internals/entries.d.ts.map +1 -1
  359. package/lib/typescript/shared/stores/bounds/internals/links.d.ts +1 -3
  360. package/lib/typescript/shared/stores/bounds/internals/links.d.ts.map +1 -1
  361. package/lib/typescript/shared/stores/bounds/internals/screen-graph.d.ts +5 -0
  362. package/lib/typescript/shared/stores/bounds/internals/screen-graph.d.ts.map +1 -0
  363. package/lib/typescript/shared/stores/bounds/internals/state.d.ts +3 -1
  364. package/lib/typescript/shared/stores/bounds/internals/state.d.ts.map +1 -1
  365. package/lib/typescript/shared/stores/bounds/types.d.ts +13 -1
  366. package/lib/typescript/shared/stores/bounds/types.d.ts.map +1 -1
  367. package/lib/typescript/shared/types/animation.types.d.ts +8 -0
  368. package/lib/typescript/shared/types/animation.types.d.ts.map +1 -1
  369. package/lib/typescript/shared/types/index.d.ts +1 -1
  370. package/lib/typescript/shared/types/index.d.ts.map +1 -1
  371. package/lib/typescript/shared/types/overlay.types.d.ts +26 -11
  372. package/lib/typescript/shared/types/overlay.types.d.ts.map +1 -1
  373. package/lib/typescript/shared/types/screen.types.d.ts +11 -2
  374. package/lib/typescript/shared/types/screen.types.d.ts.map +1 -1
  375. package/lib/typescript/shared/utils/bounds/helpers/create-bounds-accessor-core.d.ts.map +1 -1
  376. package/lib/typescript/shared/utils/bounds/helpers/create-link-accessor.d.ts.map +1 -1
  377. package/lib/typescript/shared/utils/bounds/helpers/prepare-bound-styles.d.ts.map +1 -1
  378. package/lib/typescript/shared/utils/bounds/helpers/resolve-bounds-pair-key.d.ts.map +1 -1
  379. package/lib/typescript/shared/utils/bounds/helpers/styles/compute.d.ts.map +1 -1
  380. package/lib/typescript/shared/utils/create-provider.d.ts +21 -6
  381. package/lib/typescript/shared/utils/create-provider.d.ts.map +1 -1
  382. package/package.json +1 -1
  383. package/src/blank-stack/components/stack-view.tsx +1 -4
  384. package/src/blank-stack/types.ts +8 -2
  385. package/src/component-stack/components/stack-view.tsx +1 -4
  386. package/src/component-stack/types.ts +8 -2
  387. package/src/native-stack/types.ts +8 -2
  388. package/src/native-stack/views/NativeStackView.native.tsx +3 -9
  389. package/src/shared/adapters/with-screen-transitions/stack-layout.tsx +1 -1
  390. package/src/shared/components/activity/variants/activity-screen.tsx +1 -1
  391. package/src/shared/components/boundary/components/boundary-lifecycle.tsx +0 -6
  392. package/src/shared/components/boundary/hooks/lifecycles/use-boundary-measurement-request.ts +102 -0
  393. package/src/shared/components/boundary/hooks/lifecycles/use-boundary-presence.ts +20 -11
  394. package/src/shared/components/boundary/hooks/use-boundary-measurement.ts +3 -22
  395. package/src/shared/components/boundary/hooks/use-measurer.ts +5 -20
  396. package/src/shared/components/boundary/portal/components/boundary-content-portal/helpers/active-handoff-receiver.ts +40 -0
  397. package/src/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.ts +75 -22
  398. package/src/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.tsx +10 -1
  399. package/src/shared/components/boundary/portal/components/boundary-portal/helpers/attachment.ts +19 -0
  400. package/src/shared/components/boundary/portal/components/boundary-portal/helpers/host-readiness.ts +14 -0
  401. package/src/shared/components/boundary/portal/components/boundary-portal/helpers/local-measurement.ts +36 -1
  402. package/src/shared/components/boundary/portal/components/boundary-portal/hooks/use-active-portal-boundary-host.ts +22 -13
  403. package/src/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.ts +26 -9
  404. package/src/shared/components/boundary/portal/components/boundary-portal/stores/portal-boundary-host.store.ts +1 -1
  405. package/src/shared/components/boundary/types.ts +1 -1
  406. package/src/shared/components/overlay/helpers/create-overlay-interpolator-frame.ts +29 -0
  407. package/src/shared/components/overlay/helpers/get-active-overlay.ts +62 -20
  408. package/src/shared/components/overlay/helpers/retain-ready-overlay-resources.ts +38 -0
  409. package/src/shared/components/overlay/helpers/run-overlay-slot-interpolator.ts +48 -0
  410. package/src/shared/components/overlay/hooks/use-overlay-slot.ts +103 -0
  411. package/src/shared/components/overlay/variations/float-overlay.tsx +22 -64
  412. package/src/shared/components/overlay/variations/overlay-host.tsx +135 -28
  413. package/src/shared/components/screen-lifecycle/hooks/use-close-transition-intent.ts +5 -1
  414. package/src/shared/index.ts +1 -0
  415. package/src/shared/providers/helpers/measured-bounds-writes.ts +5 -0
  416. package/src/shared/providers/screen/animation/animation.provider.tsx +31 -12
  417. package/src/shared/providers/screen/animation/helpers/accessors/use-build-transition-accessor.ts +15 -9
  418. package/src/shared/providers/screen/animation/helpers/hydrate-transition-state/index.ts +18 -3
  419. package/src/shared/providers/screen/animation/helpers/interpolator-participation.ts +6 -0
  420. package/src/shared/providers/screen/animation/helpers/pipeline.ts +54 -32
  421. package/src/shared/providers/screen/animation/use-screen-animation.tsx +12 -2
  422. package/src/shared/providers/screen/descriptors/descriptors.provider.tsx +80 -14
  423. package/src/shared/providers/screen/descriptors/helpers/derive-descriptor-derivations.ts +6 -0
  424. package/src/shared/providers/screen/descriptors/helpers/derive-structural-ancestor-keys.ts +13 -0
  425. package/src/shared/providers/screen/gestures/gestures.provider.tsx +18 -7
  426. package/src/shared/providers/screen/gestures/hooks/use-screen-gesture-config.ts +4 -4
  427. package/src/shared/providers/screen/gestures/ownership/{use-walk-up-and-register-shadowing-claims.ts → gesture-ownership-bridge.tsx} +44 -54
  428. package/src/shared/providers/screen/gestures/pan/behavior/pan-lifecycle.ts +1 -0
  429. package/src/shared/providers/screen/gestures/pan/behavior/pan-release.ts +12 -2
  430. package/src/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.ts +1 -0
  431. package/src/shared/providers/screen/gestures/types.ts +1 -0
  432. package/src/shared/providers/screen/styles/constants.ts +2 -0
  433. package/src/shared/providers/screen/styles/helpers/transition-visual-state.ts +26 -0
  434. package/src/shared/providers/screen/styles/helpers/visibility-block-ownership.ts +16 -0
  435. package/src/shared/providers/screen/styles/hooks/slot-resolvers.tsx +17 -5
  436. package/src/shared/providers/screen/styles/hooks/use-interpolated-style-maps.tsx +51 -12
  437. package/src/shared/providers/screen/styles/hooks/use-maybe-block-visibility.tsx +40 -15
  438. package/src/shared/providers/screen/styles/slot.provider.tsx +60 -70
  439. package/src/shared/providers/stack/blank-stack-state/helpers/resolve-presented-index.ts +22 -0
  440. package/src/shared/providers/stack/blank-stack.provider.tsx +6 -1
  441. package/src/shared/stores/bounds/helpers/link-pairs.helpers.ts +12 -0
  442. package/src/shared/stores/bounds/internals/clear.ts +12 -1
  443. package/src/shared/stores/bounds/internals/coordinator.ts +403 -0
  444. package/src/shared/stores/bounds/internals/entries.ts +1 -38
  445. package/src/shared/stores/bounds/internals/links.ts +28 -38
  446. package/src/shared/stores/bounds/internals/screen-graph.ts +45 -0
  447. package/src/shared/stores/bounds/internals/state.ts +10 -1
  448. package/src/shared/stores/bounds/types.ts +19 -1
  449. package/src/shared/types/animation.types.ts +8 -0
  450. package/src/shared/types/index.ts +1 -1
  451. package/src/shared/types/overlay.types.ts +41 -14
  452. package/src/shared/types/screen.types.ts +12 -2
  453. package/src/shared/utils/bounds/helpers/create-bounds-accessor-core.ts +8 -3
  454. package/src/shared/utils/bounds/helpers/create-link-accessor.ts +11 -0
  455. package/src/shared/utils/bounds/helpers/prepare-bound-styles.ts +3 -2
  456. package/src/shared/utils/bounds/helpers/resolve-bounds-pair-key.ts +0 -1
  457. package/src/shared/utils/bounds/helpers/styles/compute.ts +12 -5
  458. package/src/shared/utils/create-provider.tsx +221 -19
  459. package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js +0 -177
  460. package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js.map +0 -1
  461. package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-initial-source-measurement.js +0 -49
  462. package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-initial-source-measurement.js.map +0 -1
  463. package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-refresh-boundary.js +0 -69
  464. package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-refresh-boundary.js.map +0 -1
  465. package/lib/commonjs/shared/components/boundary/utils/destination-signals.js +0 -68
  466. package/lib/commonjs/shared/components/boundary/utils/destination-signals.js.map +0 -1
  467. package/lib/commonjs/shared/components/boundary/utils/refresh-signals.js +0 -97
  468. package/lib/commonjs/shared/components/boundary/utils/refresh-signals.js.map +0 -1
  469. package/lib/commonjs/shared/components/boundary/utils/source-signals.js +0 -43
  470. package/lib/commonjs/shared/components/boundary/utils/source-signals.js.map +0 -1
  471. package/lib/commonjs/shared/providers/screen/descriptors/helpers/get-ancestor-keys.js +0 -29
  472. package/lib/commonjs/shared/providers/screen/descriptors/helpers/get-ancestor-keys.js.map +0 -1
  473. package/lib/commonjs/shared/providers/screen/gestures/ownership/use-walk-up-and-register-shadowing-claims.js.map +0 -1
  474. package/lib/commonjs/shared/providers/screen/styles/components/floating-overlay-layer.js +0 -28
  475. package/lib/commonjs/shared/providers/screen/styles/components/floating-overlay-layer.js.map +0 -1
  476. package/lib/commonjs/shared/providers/screen/styles/stores/slot-references.store.js +0 -53
  477. package/lib/commonjs/shared/providers/screen/styles/stores/slot-references.store.js.map +0 -1
  478. package/lib/module/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js +0 -173
  479. package/lib/module/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js.map +0 -1
  480. package/lib/module/shared/components/boundary/hooks/lifecycles/use-initial-source-measurement.js +0 -44
  481. package/lib/module/shared/components/boundary/hooks/lifecycles/use-initial-source-measurement.js.map +0 -1
  482. package/lib/module/shared/components/boundary/hooks/lifecycles/use-refresh-boundary.js +0 -64
  483. package/lib/module/shared/components/boundary/hooks/lifecycles/use-refresh-boundary.js.map +0 -1
  484. package/lib/module/shared/components/boundary/utils/destination-signals.js +0 -63
  485. package/lib/module/shared/components/boundary/utils/destination-signals.js.map +0 -1
  486. package/lib/module/shared/components/boundary/utils/refresh-signals.js +0 -92
  487. package/lib/module/shared/components/boundary/utils/refresh-signals.js.map +0 -1
  488. package/lib/module/shared/components/boundary/utils/source-signals.js +0 -38
  489. package/lib/module/shared/components/boundary/utils/source-signals.js.map +0 -1
  490. package/lib/module/shared/providers/screen/descriptors/helpers/get-ancestor-keys.js +0 -25
  491. package/lib/module/shared/providers/screen/descriptors/helpers/get-ancestor-keys.js.map +0 -1
  492. package/lib/module/shared/providers/screen/gestures/ownership/use-walk-up-and-register-shadowing-claims.js.map +0 -1
  493. package/lib/module/shared/providers/screen/styles/components/floating-overlay-layer.js +0 -24
  494. package/lib/module/shared/providers/screen/styles/components/floating-overlay-layer.js.map +0 -1
  495. package/lib/module/shared/providers/screen/styles/stores/slot-references.store.js +0 -47
  496. package/lib/module/shared/providers/screen/styles/stores/slot-references.store.js.map +0 -1
  497. package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.d.ts +0 -10
  498. package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.d.ts.map +0 -1
  499. package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-initial-source-measurement.d.ts.map +0 -1
  500. package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-refresh-boundary.d.ts +0 -10
  501. package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-refresh-boundary.d.ts.map +0 -1
  502. package/lib/typescript/shared/components/boundary/utils/destination-signals.d.ts +0 -16
  503. package/lib/typescript/shared/components/boundary/utils/destination-signals.d.ts.map +0 -1
  504. package/lib/typescript/shared/components/boundary/utils/refresh-signals.d.ts +0 -19
  505. package/lib/typescript/shared/components/boundary/utils/refresh-signals.d.ts.map +0 -1
  506. package/lib/typescript/shared/components/boundary/utils/source-signals.d.ts +0 -14
  507. package/lib/typescript/shared/components/boundary/utils/source-signals.d.ts.map +0 -1
  508. package/lib/typescript/shared/providers/screen/descriptors/helpers/get-ancestor-keys.d.ts +0 -6
  509. package/lib/typescript/shared/providers/screen/descriptors/helpers/get-ancestor-keys.d.ts.map +0 -1
  510. package/lib/typescript/shared/providers/screen/gestures/ownership/use-walk-up-and-register-shadowing-claims.d.ts +0 -14
  511. package/lib/typescript/shared/providers/screen/gestures/ownership/use-walk-up-and-register-shadowing-claims.d.ts.map +0 -1
  512. package/lib/typescript/shared/providers/screen/styles/components/floating-overlay-layer.d.ts +0 -7
  513. package/lib/typescript/shared/providers/screen/styles/components/floating-overlay-layer.d.ts.map +0 -1
  514. package/lib/typescript/shared/providers/screen/styles/stores/slot-references.store.d.ts +0 -6
  515. package/lib/typescript/shared/providers/screen/styles/stores/slot-references.store.d.ts.map +0 -1
  516. package/src/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.ts +0 -267
  517. package/src/shared/components/boundary/hooks/lifecycles/use-initial-source-measurement.ts +0 -51
  518. package/src/shared/components/boundary/hooks/lifecycles/use-refresh-boundary.ts +0 -90
  519. package/src/shared/components/boundary/utils/destination-signals.ts +0 -75
  520. package/src/shared/components/boundary/utils/refresh-signals.ts +0 -164
  521. package/src/shared/components/boundary/utils/source-signals.ts +0 -51
  522. package/src/shared/providers/screen/descriptors/helpers/get-ancestor-keys.ts +0 -28
  523. package/src/shared/providers/screen/styles/components/floating-overlay-layer.tsx +0 -29
  524. package/src/shared/providers/screen/styles/stores/slot-references.store.ts +0 -72
@@ -1,4 +1,4 @@
1
- import { type ReactNode, useLayoutEffect, useMemo } from "react";
1
+ import { type ReactNode, useMemo } from "react";
2
2
  import { StyleSheet } from "react-native";
3
3
  import Animated, { type SharedValue } from "react-native-reanimated";
4
4
  import type {
@@ -8,22 +8,16 @@ import type {
8
8
  import type { NormalizedTransitionInterpolatedStyle } from "../../../types/animation.types";
9
9
  import createProvider from "../../../utils/create-provider";
10
10
  import { useDescriptorsStore } from "../descriptors";
11
- import { FloatingOverlayLayer } from "./components/floating-overlay-layer";
12
- import type { LocalStyleLayers } from "./helpers/resolve-slot-styles";
13
11
  import { useInterpolatedStylesMap } from "./hooks/use-interpolated-style-maps";
14
12
  import { useMaybeBlockVisibility } from "./hooks/use-maybe-block-visibility";
15
13
  import { useResolvedStylesMap } from "./hooks/use-resolved-slot-style-map";
16
- import {
17
- registerScreenSlots,
18
- unregisterScreenSlots,
19
- } from "./stores/slot-references.store";
20
14
 
21
15
  type Props = {
22
16
  children: ReactNode;
23
- isFloatingOverlay?: boolean;
24
17
  };
25
18
 
26
19
  export type ScreenSlotName =
20
+ | "overlay"
27
21
  | "content"
28
22
  | "backdrop"
29
23
  | "surface"
@@ -31,78 +25,74 @@ export type ScreenSlotName =
31
25
  | typeof NAVIGATION_MASK_ELEMENT_STYLE_ID;
32
26
 
33
27
  export type ScreenSlotContextValue = {
34
- localStylesMaps: SharedValue<LocalStyleLayers>;
35
- nextInterpolatorReady: SharedValue<number>;
28
+ interpolatorReady: SharedValue<number>;
36
29
  slotsMap: SharedValue<NormalizedTransitionInterpolatedStyle>;
37
30
  visibilityBlocked: SharedValue<boolean>;
38
31
  };
39
32
 
40
- export const { ScreenSlotProvider, useScreenSlotStore: useScreenSlots } =
41
- createProvider("ScreenSlot", {
42
- guarded: true,
43
- })<Props, ScreenSlotContextValue>(
44
- ({ children, isFloatingOverlay }, { useParentStore }) => {
45
- const parentContext = useParentStore();
46
- const currentScreenKey = useDescriptorsStore(
47
- (s) => s.derivations.currentScreenKey,
48
- );
33
+ const NO_PARENT_SCREEN_KEY = "__no-parent-screen__";
49
34
 
50
- const { animatedStyle, animatedProps, shouldBlockVisibility } =
51
- useMaybeBlockVisibility(isFloatingOverlay);
52
-
53
- const { localStylesMaps, nextInterpolatorReady } =
54
- useInterpolatedStylesMap({
55
- enabled: !isFloatingOverlay,
56
- visibilityBlocked: shouldBlockVisibility,
57
- });
35
+ export const useAreAnyBlockingVisibility = () => {
36
+ const parentScreenKey = useDescriptorsStore(
37
+ (store) => store.derivations.parentScreenKey,
38
+ );
58
39
 
59
- const slotsMap = useResolvedStylesMap({
60
- localStylesMaps,
61
- ancestorStylesMap: parentContext?.slotsMap,
62
- });
63
- const value = useMemo(
64
- () => ({
65
- localStylesMaps,
66
- nextInterpolatorReady,
67
- slotsMap,
68
- visibilityBlocked: shouldBlockVisibility,
69
- }),
70
- [
71
- localStylesMaps,
72
- nextInterpolatorReady,
73
- shouldBlockVisibility,
74
- slotsMap,
75
- ],
76
- );
40
+ return useScreenSlots(
41
+ parentScreenKey ?? NO_PARENT_SCREEN_KEY,
42
+ (store) => store.visibilityBlocked,
43
+ );
44
+ };
77
45
 
78
- useLayoutEffect(() => {
79
- registerScreenSlots(currentScreenKey, value);
46
+ export const { ScreenSlotProvider, useScreenSlotStore: useScreenSlots } =
47
+ createProvider("ScreenSlot", {
48
+ guarded: true,
49
+ global: true,
50
+ })<Props, ScreenSlotContextValue>(({ children }, { useParentStore }) => {
51
+ const ancestorStylesMap = useParentStore(
52
+ (parentContext) => parentContext?.slotsMap,
53
+ );
54
+ const currentScreenKey = useDescriptorsStore(
55
+ (store) => store.derivations.currentScreenKey,
56
+ );
57
+ const ancestorVisibilityBlocked = useAreAnyBlockingVisibility();
58
+ const { animatedStyle, animatedProps, visibilityBlocked } =
59
+ useMaybeBlockVisibility({ ancestorVisibilityBlocked });
80
60
 
81
- return () => {
82
- unregisterScreenSlots(currentScreenKey, value);
83
- };
84
- }, [currentScreenKey, value]);
61
+ const { interpolatorReady, localStylesMaps } = useInterpolatedStylesMap({
62
+ enabled: true,
63
+ visibilityBlocked,
64
+ });
85
65
 
86
- const content = useMemo(
87
- () => (
88
- <FloatingOverlayLayer enabled={isFloatingOverlay}>
89
- <Animated.View
90
- style={[styles.container, animatedStyle]}
91
- animatedProps={animatedProps}
92
- >
93
- {children}
94
- </Animated.View>
95
- </FloatingOverlayLayer>
96
- ),
97
- [children, animatedStyle, isFloatingOverlay, animatedProps],
98
- );
66
+ const slotsMap = useResolvedStylesMap({
67
+ localStylesMaps,
68
+ ancestorStylesMap,
69
+ });
70
+ const value = useMemo(
71
+ () => ({
72
+ interpolatorReady,
73
+ slotsMap,
74
+ visibilityBlocked,
75
+ }),
76
+ [interpolatorReady, slotsMap, visibilityBlocked],
77
+ );
78
+ const content = useMemo(
79
+ () => (
80
+ <Animated.View
81
+ style={[styles.container, animatedStyle]}
82
+ animatedProps={animatedProps}
83
+ >
84
+ {children}
85
+ </Animated.View>
86
+ ),
87
+ [children, animatedStyle, animatedProps],
88
+ );
99
89
 
100
- return {
101
- value,
102
- children: content,
103
- };
104
- },
105
- );
90
+ return {
91
+ key: currentScreenKey,
92
+ value,
93
+ children: content,
94
+ };
95
+ });
106
96
 
107
97
  const styles = StyleSheet.create({
108
98
  container: { flex: 1 },
@@ -0,0 +1,22 @@
1
+ import type { BaseStackRoute } from "../../../../types/stack.types";
2
+
3
+ export function resolvePresentedIndex(
4
+ routes: BaseStackRoute[],
5
+ focusedRouteKey: string | undefined,
6
+ closingRouteKeys: ReadonlySet<string>,
7
+ ): number {
8
+ const focusedIndex = focusedRouteKey
9
+ ? routes.findIndex((route) => route.key === focusedRouteKey)
10
+ : routes.length - 1;
11
+ const resolvedFocusedIndex =
12
+ focusedIndex >= 0 ? focusedIndex : routes.length - 1;
13
+
14
+ for (let index = resolvedFocusedIndex; index >= 0; index -= 1) {
15
+ const route = routes[index];
16
+ if (route && !closingRouteKeys.has(route.key)) {
17
+ return index;
18
+ }
19
+ }
20
+
21
+ return resolvedFocusedIndex;
22
+ }
@@ -15,6 +15,7 @@ import type {
15
15
  } from "../../types/stack.types";
16
16
  import createProvider from "../../utils/create-provider";
17
17
  import { useBlankStackState } from "./blank-stack-state";
18
+ import { resolvePresentedIndex } from "./blank-stack-state/helpers/resolve-presented-index";
18
19
  import { useStackCoreStore } from "./core.provider";
19
20
 
20
21
  type InternalBlankStackProviderProps = BlankStackProviderProps<
@@ -58,7 +59,11 @@ function BlankStackProvider({
58
59
  state: stackState,
59
60
  });
60
61
  const navigatorKey = stackState.key;
61
- const focusedIndex = stackState.index;
62
+ const focusedIndex = resolvePresentedIndex(
63
+ state.routes,
64
+ state.focusedRouteKey,
65
+ state.closingRouteKeys,
66
+ );
62
67
  const scenesByKey = useMemo(
63
68
  () => createScenesByKey(state.scenes),
64
69
  [state.scenes],
@@ -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 };