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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (421) hide show
  1. package/lib/commonjs/shared/components/boundary/components/boundary-target.js +14 -9
  2. package/lib/commonjs/shared/components/boundary/components/boundary-target.js.map +1 -1
  3. package/lib/commonjs/shared/components/boundary/create-boundary-component.js +66 -28
  4. package/lib/commonjs/shared/components/boundary/create-boundary-component.js.map +1 -1
  5. package/lib/commonjs/shared/components/boundary/hooks/{use-boundary-presence.js → lifecycles/use-boundary-presence.js} +8 -4
  6. package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-boundary-presence.js.map +1 -0
  7. package/lib/commonjs/shared/components/boundary/hooks/{use-initial-destination-measurement.js → lifecycles/use-initial-destination-measurement.js} +27 -10
  8. package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js.map +1 -0
  9. package/lib/commonjs/shared/components/boundary/hooks/{use-initial-source-measurement.js → lifecycles/use-initial-source-measurement.js} +5 -7
  10. package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-initial-source-measurement.js.map +1 -0
  11. package/lib/commonjs/shared/components/boundary/hooks/{use-refresh-boundary.js → lifecycles/use-refresh-boundary.js} +4 -4
  12. package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-refresh-boundary.js.map +1 -0
  13. package/lib/commonjs/shared/components/boundary/hooks/use-boundary-measurement.js +14 -35
  14. package/lib/commonjs/shared/components/boundary/hooks/use-boundary-measurement.js.map +1 -1
  15. package/lib/commonjs/shared/components/boundary/hooks/use-measurer.js +5 -6
  16. package/lib/commonjs/shared/components/boundary/hooks/use-measurer.js.map +1 -1
  17. package/lib/commonjs/shared/components/boundary/index.js +26 -29
  18. package/lib/commonjs/shared/components/boundary/index.js.map +1 -1
  19. package/lib/commonjs/shared/components/boundary/portal/components/boundary-local-portal-host.js +58 -0
  20. package/lib/commonjs/shared/components/boundary/portal/components/boundary-local-portal-host.js.map +1 -0
  21. package/lib/commonjs/shared/components/boundary/portal/components/host.js +20 -4
  22. package/lib/commonjs/shared/components/boundary/portal/components/host.js.map +1 -1
  23. package/lib/commonjs/shared/components/boundary/portal/components/portal-boundary-host.js +53 -32
  24. package/lib/commonjs/shared/components/boundary/portal/components/portal-boundary-host.js.map +1 -1
  25. package/lib/commonjs/shared/components/boundary/portal/components/portal.js +206 -96
  26. package/lib/commonjs/shared/components/boundary/portal/components/portal.js.map +1 -1
  27. package/lib/commonjs/shared/components/boundary/portal/hooks/use-host-measurement.js +14 -2
  28. package/lib/commonjs/shared/components/boundary/portal/hooks/use-host-measurement.js.map +1 -1
  29. package/lib/commonjs/shared/components/boundary/portal/stores/host-registry.store.js +5 -44
  30. package/lib/commonjs/shared/components/boundary/portal/stores/host-registry.store.js.map +1 -1
  31. package/lib/commonjs/shared/components/boundary/portal/stores/portal-boundary-host.store.js +37 -5
  32. package/lib/commonjs/shared/components/boundary/portal/stores/portal-boundary-host.store.js.map +1 -1
  33. package/lib/commonjs/shared/components/boundary/portal/teleport.js +15 -2
  34. package/lib/commonjs/shared/components/boundary/portal/teleport.js.map +1 -1
  35. package/lib/commonjs/shared/components/boundary/portal/utils/has-local-slot.js +18 -0
  36. package/lib/commonjs/shared/components/boundary/portal/utils/has-local-slot.js.map +1 -0
  37. package/lib/commonjs/shared/components/boundary/portal/utils/naming.js +10 -3
  38. package/lib/commonjs/shared/components/boundary/portal/utils/naming.js.map +1 -1
  39. package/lib/commonjs/shared/components/boundary/portal/utils/offset-style.js +28 -49
  40. package/lib/commonjs/shared/components/boundary/portal/utils/offset-style.js.map +1 -1
  41. package/lib/commonjs/shared/components/boundary/portal/utils/ownership.js +254 -0
  42. package/lib/commonjs/shared/components/boundary/portal/utils/ownership.js.map +1 -0
  43. package/lib/commonjs/shared/components/boundary/portal/utils/resolve-portal.js +38 -0
  44. package/lib/commonjs/shared/components/boundary/portal/utils/resolve-portal.js.map +1 -0
  45. package/lib/commonjs/shared/components/boundary/portal/utils/shallow-equal.js +29 -0
  46. package/lib/commonjs/shared/components/boundary/portal/utils/shallow-equal.js.map +1 -0
  47. package/lib/commonjs/shared/components/boundary/portal/utils/teleport-control.js +10 -1
  48. package/lib/commonjs/shared/components/boundary/portal/utils/teleport-control.js.map +1 -1
  49. package/lib/commonjs/shared/components/boundary/portal/utils/visible-host.js +25 -0
  50. package/lib/commonjs/shared/components/boundary/portal/utils/visible-host.js.map +1 -0
  51. package/lib/commonjs/shared/components/boundary/providers/boundary-root.provider.js +6 -7
  52. package/lib/commonjs/shared/components/boundary/providers/boundary-root.provider.js.map +1 -1
  53. package/lib/commonjs/shared/components/boundary/utils/destination-signals.js +1 -22
  54. package/lib/commonjs/shared/components/boundary/utils/destination-signals.js.map +1 -1
  55. package/lib/commonjs/shared/components/boundary/utils/refresh-signals.js +0 -21
  56. package/lib/commonjs/shared/components/boundary/utils/refresh-signals.js.map +1 -1
  57. package/lib/commonjs/shared/components/boundary/utils/source-signals.js +4 -9
  58. package/lib/commonjs/shared/components/boundary/utils/source-signals.js.map +1 -1
  59. package/lib/commonjs/shared/index.js.map +1 -1
  60. package/lib/commonjs/shared/providers/helpers/measured-bounds-writes.js +6 -3
  61. package/lib/commonjs/shared/providers/helpers/measured-bounds-writes.js.map +1 -1
  62. package/lib/commonjs/shared/providers/screen/animation/helpers/derivations.js +1 -0
  63. package/lib/commonjs/shared/providers/screen/animation/helpers/derivations.js.map +1 -1
  64. package/lib/commonjs/shared/providers/screen/animation/helpers/pipeline.js +1 -0
  65. package/lib/commonjs/shared/providers/screen/animation/helpers/pipeline.js.map +1 -1
  66. package/lib/commonjs/shared/providers/screen/styles/helpers/compose-slot-style.js +95 -0
  67. package/lib/commonjs/shared/providers/screen/styles/helpers/compose-slot-style.js.map +1 -0
  68. package/lib/commonjs/shared/providers/screen/styles/helpers/normalize-slots.js +30 -9
  69. package/lib/commonjs/shared/providers/screen/styles/helpers/normalize-slots.js.map +1 -1
  70. package/lib/commonjs/shared/providers/screen/styles/helpers/resolve-slot-styles/index.js +9 -3
  71. package/lib/commonjs/shared/providers/screen/styles/helpers/resolve-slot-styles/index.js.map +1 -1
  72. package/lib/commonjs/shared/providers/screen/styles/helpers/resolve-slot-styles/materialize-slot.js +2 -0
  73. package/lib/commonjs/shared/providers/screen/styles/helpers/resolve-slot-styles/materialize-slot.js.map +1 -1
  74. package/lib/commonjs/shared/providers/screen/styles/hooks/slot-resolvers.js +96 -0
  75. package/lib/commonjs/shared/providers/screen/styles/hooks/slot-resolvers.js.map +1 -0
  76. package/lib/commonjs/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js +16 -3
  77. package/lib/commonjs/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js.map +1 -1
  78. package/lib/commonjs/shared/providers/screen/styles/index.js +16 -3
  79. package/lib/commonjs/shared/providers/screen/styles/index.js.map +1 -1
  80. package/lib/commonjs/shared/providers/screen/styles/slot.provider.js +22 -51
  81. package/lib/commonjs/shared/providers/screen/styles/slot.provider.js.map +1 -1
  82. package/lib/commonjs/shared/providers/screen/styles/stores/slot-references.store.js +53 -0
  83. package/lib/commonjs/shared/providers/screen/styles/stores/slot-references.store.js.map +1 -0
  84. package/lib/commonjs/shared/stores/bounds/helpers/link-pairs.helpers.js +22 -2
  85. package/lib/commonjs/shared/stores/bounds/helpers/link-pairs.helpers.js.map +1 -1
  86. package/lib/commonjs/shared/stores/bounds/internals/entries.js +11 -4
  87. package/lib/commonjs/shared/stores/bounds/internals/entries.js.map +1 -1
  88. package/lib/commonjs/shared/stores/bounds/internals/links.js +134 -51
  89. package/lib/commonjs/shared/stores/bounds/internals/links.js.map +1 -1
  90. package/lib/commonjs/shared/stores/bounds/internals/resolver.js +1 -3
  91. package/lib/commonjs/shared/stores/bounds/internals/resolver.js.map +1 -1
  92. package/lib/commonjs/shared/stores/system.store.js +5 -0
  93. package/lib/commonjs/shared/stores/system.store.js.map +1 -1
  94. package/lib/commonjs/shared/utils/bounds/helpers/styles/compute.js +10 -69
  95. package/lib/commonjs/shared/utils/bounds/helpers/styles/compute.js.map +1 -1
  96. package/lib/commonjs/shared/utils/bounds/helpers/styles/local-transform.js +59 -0
  97. package/lib/commonjs/shared/utils/bounds/helpers/styles/local-transform.js.map +1 -0
  98. package/lib/module/shared/components/boundary/components/boundary-target.js +12 -7
  99. package/lib/module/shared/components/boundary/components/boundary-target.js.map +1 -1
  100. package/lib/module/shared/components/boundary/create-boundary-component.js +67 -29
  101. package/lib/module/shared/components/boundary/create-boundary-component.js.map +1 -1
  102. package/lib/module/shared/components/boundary/hooks/{use-boundary-presence.js → lifecycles/use-boundary-presence.js} +8 -4
  103. package/lib/module/shared/components/boundary/hooks/lifecycles/use-boundary-presence.js.map +1 -0
  104. package/lib/module/shared/components/boundary/hooks/{use-initial-destination-measurement.js → lifecycles/use-initial-destination-measurement.js} +27 -10
  105. package/lib/module/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js.map +1 -0
  106. package/lib/module/shared/components/boundary/hooks/{use-initial-source-measurement.js → lifecycles/use-initial-source-measurement.js} +5 -7
  107. package/lib/module/shared/components/boundary/hooks/lifecycles/use-initial-source-measurement.js.map +1 -0
  108. package/lib/module/shared/components/boundary/hooks/{use-refresh-boundary.js → lifecycles/use-refresh-boundary.js} +4 -4
  109. package/lib/module/shared/components/boundary/hooks/lifecycles/use-refresh-boundary.js.map +1 -0
  110. package/lib/module/shared/components/boundary/hooks/use-boundary-measurement.js +15 -36
  111. package/lib/module/shared/components/boundary/hooks/use-boundary-measurement.js.map +1 -1
  112. package/lib/module/shared/components/boundary/hooks/use-measurer.js +5 -6
  113. package/lib/module/shared/components/boundary/hooks/use-measurer.js.map +1 -1
  114. package/lib/module/shared/components/boundary/index.js +26 -29
  115. package/lib/module/shared/components/boundary/index.js.map +1 -1
  116. package/lib/module/shared/components/boundary/portal/components/boundary-local-portal-host.js +53 -0
  117. package/lib/module/shared/components/boundary/portal/components/boundary-local-portal-host.js.map +1 -0
  118. package/lib/module/shared/components/boundary/portal/components/host.js +21 -5
  119. package/lib/module/shared/components/boundary/portal/components/host.js.map +1 -1
  120. package/lib/module/shared/components/boundary/portal/components/portal-boundary-host.js +53 -32
  121. package/lib/module/shared/components/boundary/portal/components/portal-boundary-host.js.map +1 -1
  122. package/lib/module/shared/components/boundary/portal/components/portal.js +212 -102
  123. package/lib/module/shared/components/boundary/portal/components/portal.js.map +1 -1
  124. package/lib/module/shared/components/boundary/portal/hooks/use-host-measurement.js +15 -3
  125. package/lib/module/shared/components/boundary/portal/hooks/use-host-measurement.js.map +1 -1
  126. package/lib/module/shared/components/boundary/portal/stores/host-registry.store.js +4 -41
  127. package/lib/module/shared/components/boundary/portal/stores/host-registry.store.js.map +1 -1
  128. package/lib/module/shared/components/boundary/portal/stores/portal-boundary-host.store.js +35 -4
  129. package/lib/module/shared/components/boundary/portal/stores/portal-boundary-host.store.js.map +1 -1
  130. package/lib/module/shared/components/boundary/portal/teleport.js +16 -2
  131. package/lib/module/shared/components/boundary/portal/teleport.js.map +1 -1
  132. package/lib/module/shared/components/boundary/portal/utils/has-local-slot.js +13 -0
  133. package/lib/module/shared/components/boundary/portal/utils/has-local-slot.js.map +1 -0
  134. package/lib/module/shared/components/boundary/portal/utils/naming.js +8 -2
  135. package/lib/module/shared/components/boundary/portal/utils/naming.js.map +1 -1
  136. package/lib/module/shared/components/boundary/portal/utils/offset-style.js +29 -49
  137. package/lib/module/shared/components/boundary/portal/utils/offset-style.js.map +1 -1
  138. package/lib/module/shared/components/boundary/portal/utils/ownership.js +246 -0
  139. package/lib/module/shared/components/boundary/portal/utils/ownership.js.map +1 -0
  140. package/lib/module/shared/components/boundary/portal/utils/resolve-portal.js +33 -0
  141. package/lib/module/shared/components/boundary/portal/utils/resolve-portal.js.map +1 -0
  142. package/lib/module/shared/components/boundary/portal/utils/shallow-equal.js +24 -0
  143. package/lib/module/shared/components/boundary/portal/utils/shallow-equal.js.map +1 -0
  144. package/lib/module/shared/components/boundary/portal/utils/teleport-control.js +8 -0
  145. package/lib/module/shared/components/boundary/portal/utils/teleport-control.js.map +1 -1
  146. package/lib/module/shared/components/boundary/portal/utils/visible-host.js +20 -0
  147. package/lib/module/shared/components/boundary/portal/utils/visible-host.js.map +1 -0
  148. package/lib/module/shared/components/boundary/providers/boundary-root.provider.js +6 -7
  149. package/lib/module/shared/components/boundary/providers/boundary-root.provider.js.map +1 -1
  150. package/lib/module/shared/components/boundary/utils/destination-signals.js +2 -23
  151. package/lib/module/shared/components/boundary/utils/destination-signals.js.map +1 -1
  152. package/lib/module/shared/components/boundary/utils/refresh-signals.js +0 -21
  153. package/lib/module/shared/components/boundary/utils/refresh-signals.js.map +1 -1
  154. package/lib/module/shared/components/boundary/utils/source-signals.js +4 -9
  155. package/lib/module/shared/components/boundary/utils/source-signals.js.map +1 -1
  156. package/lib/module/shared/index.js.map +1 -1
  157. package/lib/module/shared/providers/helpers/measured-bounds-writes.js +6 -3
  158. package/lib/module/shared/providers/helpers/measured-bounds-writes.js.map +1 -1
  159. package/lib/module/shared/providers/screen/animation/helpers/derivations.js +1 -0
  160. package/lib/module/shared/providers/screen/animation/helpers/derivations.js.map +1 -1
  161. package/lib/module/shared/providers/screen/animation/helpers/pipeline.js +1 -0
  162. package/lib/module/shared/providers/screen/animation/helpers/pipeline.js.map +1 -1
  163. package/lib/module/shared/providers/screen/styles/helpers/compose-slot-style.js +89 -0
  164. package/lib/module/shared/providers/screen/styles/helpers/compose-slot-style.js.map +1 -0
  165. package/lib/module/shared/providers/screen/styles/helpers/normalize-slots.js +30 -9
  166. package/lib/module/shared/providers/screen/styles/helpers/normalize-slots.js.map +1 -1
  167. package/lib/module/shared/providers/screen/styles/helpers/resolve-slot-styles/index.js +9 -3
  168. package/lib/module/shared/providers/screen/styles/helpers/resolve-slot-styles/index.js.map +1 -1
  169. package/lib/module/shared/providers/screen/styles/helpers/resolve-slot-styles/materialize-slot.js +2 -0
  170. package/lib/module/shared/providers/screen/styles/helpers/resolve-slot-styles/materialize-slot.js.map +1 -1
  171. package/lib/module/shared/providers/screen/styles/hooks/slot-resolvers.js +87 -0
  172. package/lib/module/shared/providers/screen/styles/hooks/slot-resolvers.js.map +1 -0
  173. package/lib/module/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js +16 -3
  174. package/lib/module/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js.map +1 -1
  175. package/lib/module/shared/providers/screen/styles/index.js +2 -1
  176. package/lib/module/shared/providers/screen/styles/index.js.map +1 -1
  177. package/lib/module/shared/providers/screen/styles/slot.provider.js +22 -47
  178. package/lib/module/shared/providers/screen/styles/slot.provider.js.map +1 -1
  179. package/lib/module/shared/providers/screen/styles/stores/slot-references.store.js +47 -0
  180. package/lib/module/shared/providers/screen/styles/stores/slot-references.store.js.map +1 -0
  181. package/lib/module/shared/stores/bounds/helpers/link-pairs.helpers.js +19 -1
  182. package/lib/module/shared/stores/bounds/helpers/link-pairs.helpers.js.map +1 -1
  183. package/lib/module/shared/stores/bounds/internals/entries.js +11 -4
  184. package/lib/module/shared/stores/bounds/internals/entries.js.map +1 -1
  185. package/lib/module/shared/stores/bounds/internals/links.js +135 -53
  186. package/lib/module/shared/stores/bounds/internals/links.js.map +1 -1
  187. package/lib/module/shared/stores/bounds/internals/resolver.js +1 -3
  188. package/lib/module/shared/stores/bounds/internals/resolver.js.map +1 -1
  189. package/lib/module/shared/stores/system.store.js +5 -0
  190. package/lib/module/shared/stores/system.store.js.map +1 -1
  191. package/lib/module/shared/types/animation.types.js.map +1 -1
  192. package/lib/module/shared/utils/bounds/helpers/styles/compute.js +10 -69
  193. package/lib/module/shared/utils/bounds/helpers/styles/compute.js.map +1 -1
  194. package/lib/module/shared/utils/bounds/helpers/styles/local-transform.js +52 -0
  195. package/lib/module/shared/utils/bounds/helpers/styles/local-transform.js.map +1 -0
  196. package/lib/typescript/blank-stack/navigators/create-blank-stack-navigator.d.ts +1 -2
  197. package/lib/typescript/blank-stack/navigators/create-blank-stack-navigator.d.ts.map +1 -1
  198. package/lib/typescript/component-stack/components/component-screen.d.ts +1 -1
  199. package/lib/typescript/component-stack/components/component-screen.d.ts.map +1 -1
  200. package/lib/typescript/component-stack/navigators/create-component-stack-navigator.d.ts +1 -2
  201. package/lib/typescript/component-stack/navigators/create-component-stack-navigator.d.ts.map +1 -1
  202. package/lib/typescript/native-stack/navigators/createNativeStackNavigator.d.ts +1 -1
  203. package/lib/typescript/native-stack/navigators/createNativeStackNavigator.d.ts.map +1 -1
  204. package/lib/typescript/native-stack/views/NativeStackView.d.ts +1 -2
  205. package/lib/typescript/native-stack/views/NativeStackView.d.ts.map +1 -1
  206. package/lib/typescript/native-stack/views/useHeaderConfigProps.d.ts +2 -2
  207. package/lib/typescript/shared/adapters/with-screen-transitions/context.d.ts +1 -1
  208. package/lib/typescript/shared/adapters/with-screen-transitions/context.d.ts.map +1 -1
  209. package/lib/typescript/shared/adapters/with-screen-transitions/stack-layout.d.ts +1 -1
  210. package/lib/typescript/shared/adapters/with-screen-transitions/stack-layout.d.ts.map +1 -1
  211. package/lib/typescript/shared/components/activity/variants/activity-container.d.ts +1 -1
  212. package/lib/typescript/shared/components/activity/variants/activity-container.d.ts.map +1 -1
  213. package/lib/typescript/shared/components/activity/variants/activity-screen.d.ts +1 -1
  214. package/lib/typescript/shared/components/activity/variants/activity-screen.d.ts.map +1 -1
  215. package/lib/typescript/shared/components/boundary/components/boundary-target.d.ts +1 -1
  216. package/lib/typescript/shared/components/boundary/components/boundary-target.d.ts.map +1 -1
  217. package/lib/typescript/shared/components/boundary/create-boundary-component.d.ts +0 -1
  218. package/lib/typescript/shared/components/boundary/create-boundary-component.d.ts.map +1 -1
  219. package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-boundary-presence.d.ts +11 -0
  220. package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-boundary-presence.d.ts.map +1 -0
  221. package/lib/typescript/shared/components/boundary/hooks/{use-initial-destination-measurement.d.ts → lifecycles/use-initial-destination-measurement.d.ts} +2 -2
  222. package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.d.ts.map +1 -0
  223. package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-initial-source-measurement.d.ts +8 -0
  224. package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-initial-source-measurement.d.ts.map +1 -0
  225. package/lib/typescript/shared/components/boundary/hooks/{use-refresh-boundary.d.ts → lifecycles/use-refresh-boundary.d.ts} +2 -2
  226. package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-refresh-boundary.d.ts.map +1 -0
  227. package/lib/typescript/shared/components/boundary/hooks/use-boundary-measurement.d.ts +5 -9
  228. package/lib/typescript/shared/components/boundary/hooks/use-boundary-measurement.d.ts.map +1 -1
  229. package/lib/typescript/shared/components/boundary/hooks/use-measurer.d.ts +4 -3
  230. package/lib/typescript/shared/components/boundary/hooks/use-measurer.d.ts.map +1 -1
  231. package/lib/typescript/shared/components/boundary/index.d.ts +35 -24
  232. package/lib/typescript/shared/components/boundary/index.d.ts.map +1 -1
  233. package/lib/typescript/shared/components/boundary/portal/components/boundary-local-portal-host.d.ts +8 -0
  234. package/lib/typescript/shared/components/boundary/portal/components/boundary-local-portal-host.d.ts.map +1 -0
  235. package/lib/typescript/shared/components/boundary/portal/components/host.d.ts +2 -2
  236. package/lib/typescript/shared/components/boundary/portal/components/host.d.ts.map +1 -1
  237. package/lib/typescript/shared/components/boundary/portal/components/portal-boundary-host.d.ts +2 -2
  238. package/lib/typescript/shared/components/boundary/portal/components/portal-boundary-host.d.ts.map +1 -1
  239. package/lib/typescript/shared/components/boundary/portal/components/portal-provider.d.ts +1 -1
  240. package/lib/typescript/shared/components/boundary/portal/components/portal-provider.d.ts.map +1 -1
  241. package/lib/typescript/shared/components/boundary/portal/components/portal.d.ts +4 -3
  242. package/lib/typescript/shared/components/boundary/portal/components/portal.d.ts.map +1 -1
  243. package/lib/typescript/shared/components/boundary/portal/hooks/use-host-measurement.d.ts.map +1 -1
  244. package/lib/typescript/shared/components/boundary/portal/stores/host-registry.store.d.ts +0 -7
  245. package/lib/typescript/shared/components/boundary/portal/stores/host-registry.store.d.ts.map +1 -1
  246. package/lib/typescript/shared/components/boundary/portal/stores/portal-boundary-host.store.d.ts +16 -1
  247. package/lib/typescript/shared/components/boundary/portal/stores/portal-boundary-host.store.d.ts.map +1 -1
  248. package/lib/typescript/shared/components/boundary/portal/teleport.d.ts +1 -1
  249. package/lib/typescript/shared/components/boundary/portal/teleport.d.ts.map +1 -1
  250. package/lib/typescript/shared/components/boundary/portal/utils/has-local-slot.d.ts +3 -0
  251. package/lib/typescript/shared/components/boundary/portal/utils/has-local-slot.d.ts.map +1 -0
  252. package/lib/typescript/shared/components/boundary/portal/utils/naming.d.ts +2 -1
  253. package/lib/typescript/shared/components/boundary/portal/utils/naming.d.ts.map +1 -1
  254. package/lib/typescript/shared/components/boundary/portal/utils/offset-style.d.ts +16 -32
  255. package/lib/typescript/shared/components/boundary/portal/utils/offset-style.d.ts.map +1 -1
  256. package/lib/typescript/shared/components/boundary/portal/utils/ownership.d.ts +35 -0
  257. package/lib/typescript/shared/components/boundary/portal/utils/ownership.d.ts.map +1 -0
  258. package/lib/typescript/shared/components/boundary/portal/utils/resolve-portal.d.ts +12 -0
  259. package/lib/typescript/shared/components/boundary/portal/utils/resolve-portal.d.ts.map +1 -0
  260. package/lib/typescript/shared/components/boundary/portal/utils/shallow-equal.d.ts +8 -0
  261. package/lib/typescript/shared/components/boundary/portal/utils/shallow-equal.d.ts.map +1 -0
  262. package/lib/typescript/shared/components/boundary/portal/utils/teleport-control.d.ts +4 -0
  263. package/lib/typescript/shared/components/boundary/portal/utils/teleport-control.d.ts.map +1 -1
  264. package/lib/typescript/shared/components/boundary/portal/utils/visible-host.d.ts +8 -0
  265. package/lib/typescript/shared/components/boundary/portal/utils/visible-host.d.ts.map +1 -0
  266. package/lib/typescript/shared/components/boundary/providers/boundary-root.provider.d.ts +7 -12
  267. package/lib/typescript/shared/components/boundary/providers/boundary-root.provider.d.ts.map +1 -1
  268. package/lib/typescript/shared/components/boundary/types.d.ts +9 -36
  269. package/lib/typescript/shared/components/boundary/types.d.ts.map +1 -1
  270. package/lib/typescript/shared/components/boundary/utils/destination-signals.d.ts.map +1 -1
  271. package/lib/typescript/shared/components/boundary/utils/refresh-signals.d.ts.map +1 -1
  272. package/lib/typescript/shared/components/boundary/utils/source-signals.d.ts +0 -1
  273. package/lib/typescript/shared/components/boundary/utils/source-signals.d.ts.map +1 -1
  274. package/lib/typescript/shared/components/create-transition-aware-component.d.ts +6 -5
  275. package/lib/typescript/shared/components/create-transition-aware-component.d.ts.map +1 -1
  276. package/lib/typescript/shared/components/masked-view.d.ts +1 -1
  277. package/lib/typescript/shared/components/masked-view.d.ts.map +1 -1
  278. package/lib/typescript/shared/components/overlay/variations/float-overlay.d.ts +1 -1
  279. package/lib/typescript/shared/components/overlay/variations/float-overlay.d.ts.map +1 -1
  280. package/lib/typescript/shared/components/overlay/variations/overlay-host.d.ts +1 -1
  281. package/lib/typescript/shared/components/overlay/variations/overlay-host.d.ts.map +1 -1
  282. package/lib/typescript/shared/components/scene-view.d.ts +1 -1
  283. package/lib/typescript/shared/components/scene-view.d.ts.map +1 -1
  284. package/lib/typescript/shared/components/screen-container/index.d.ts +1 -1
  285. package/lib/typescript/shared/components/screen-container/index.d.ts.map +1 -1
  286. package/lib/typescript/shared/components/screen-container/layers/backdrop.d.ts +1 -1
  287. package/lib/typescript/shared/components/screen-container/layers/backdrop.d.ts.map +1 -1
  288. package/lib/typescript/shared/components/screen-container/layers/content.d.ts +1 -1
  289. package/lib/typescript/shared/components/screen-container/layers/content.d.ts.map +1 -1
  290. package/lib/typescript/shared/components/screen-container/layers/maybe-masked-navigation-container.d.ts +1 -1
  291. package/lib/typescript/shared/components/screen-container/layers/maybe-masked-navigation-container.d.ts.map +1 -1
  292. package/lib/typescript/shared/components/screen-container/layers/surface-container.d.ts +1 -1
  293. package/lib/typescript/shared/components/screen-container/layers/surface-container.d.ts.map +1 -1
  294. package/lib/typescript/shared/hooks/navigation/use-stack.d.ts +1 -1
  295. package/lib/typescript/shared/hooks/navigation/use-stack.d.ts.map +1 -1
  296. package/lib/typescript/shared/index.d.ts +711 -667
  297. package/lib/typescript/shared/index.d.ts.map +1 -1
  298. package/lib/typescript/shared/providers/helpers/measured-bounds-writes.d.ts +3 -3
  299. package/lib/typescript/shared/providers/helpers/measured-bounds-writes.d.ts.map +1 -1
  300. package/lib/typescript/shared/providers/screen/animation/helpers/derivations.d.ts +1 -0
  301. package/lib/typescript/shared/providers/screen/animation/helpers/derivations.d.ts.map +1 -1
  302. package/lib/typescript/shared/providers/screen/animation/helpers/pipeline.d.ts.map +1 -1
  303. package/lib/typescript/shared/providers/screen/descriptors/descriptors.provider.d.ts +1 -1
  304. package/lib/typescript/shared/providers/screen/descriptors/descriptors.provider.d.ts.map +1 -1
  305. package/lib/typescript/shared/providers/screen/screen-composer.d.ts +1 -1
  306. package/lib/typescript/shared/providers/screen/screen-composer.d.ts.map +1 -1
  307. package/lib/typescript/shared/providers/screen/styles/components/floating-overlay-layer.d.ts +1 -1
  308. package/lib/typescript/shared/providers/screen/styles/components/floating-overlay-layer.d.ts.map +1 -1
  309. package/lib/typescript/shared/providers/screen/styles/helpers/compose-slot-style.d.ts +4 -0
  310. package/lib/typescript/shared/providers/screen/styles/helpers/compose-slot-style.d.ts.map +1 -0
  311. package/lib/typescript/shared/providers/screen/styles/helpers/normalize-slots.d.ts.map +1 -1
  312. package/lib/typescript/shared/providers/screen/styles/helpers/resolve-slot-styles/index.d.ts.map +1 -1
  313. package/lib/typescript/shared/providers/screen/styles/helpers/resolve-slot-styles/materialize-slot.d.ts +2 -1
  314. package/lib/typescript/shared/providers/screen/styles/helpers/resolve-slot-styles/materialize-slot.d.ts.map +1 -1
  315. package/lib/typescript/shared/providers/screen/styles/hooks/slot-resolvers.d.ts +11 -0
  316. package/lib/typescript/shared/providers/screen/styles/hooks/slot-resolvers.d.ts.map +1 -0
  317. package/lib/typescript/shared/providers/screen/styles/hooks/use-interpolated-style-maps.d.ts +4 -1
  318. package/lib/typescript/shared/providers/screen/styles/hooks/use-interpolated-style-maps.d.ts.map +1 -1
  319. package/lib/typescript/shared/providers/screen/styles/hooks/use-maybe-block-visibility.d.ts +2 -2
  320. package/lib/typescript/shared/providers/screen/styles/index.d.ts +2 -1
  321. package/lib/typescript/shared/providers/screen/styles/index.d.ts.map +1 -1
  322. package/lib/typescript/shared/providers/screen/styles/slot.provider.d.ts +5 -10
  323. package/lib/typescript/shared/providers/screen/styles/slot.provider.d.ts.map +1 -1
  324. package/lib/typescript/shared/providers/screen/styles/stores/slot-references.store.d.ts +6 -0
  325. package/lib/typescript/shared/providers/screen/styles/stores/slot-references.store.d.ts.map +1 -0
  326. package/lib/typescript/shared/stores/bounds/helpers/link-pairs.helpers.d.ts +2 -0
  327. package/lib/typescript/shared/stores/bounds/helpers/link-pairs.helpers.d.ts.map +1 -1
  328. package/lib/typescript/shared/stores/bounds/internals/entries.d.ts.map +1 -1
  329. package/lib/typescript/shared/stores/bounds/internals/links.d.ts +4 -3
  330. package/lib/typescript/shared/stores/bounds/internals/links.d.ts.map +1 -1
  331. package/lib/typescript/shared/stores/bounds/internals/resolver.d.ts.map +1 -1
  332. package/lib/typescript/shared/stores/bounds/types.d.ts +9 -20
  333. package/lib/typescript/shared/stores/bounds/types.d.ts.map +1 -1
  334. package/lib/typescript/shared/stores/system.store.d.ts +1 -0
  335. package/lib/typescript/shared/stores/system.store.d.ts.map +1 -1
  336. package/lib/typescript/shared/types/animation.types.d.ts +7 -1
  337. package/lib/typescript/shared/types/animation.types.d.ts.map +1 -1
  338. package/lib/typescript/shared/utils/bounds/helpers/styles/compute.d.ts.map +1 -1
  339. package/lib/typescript/shared/utils/bounds/helpers/styles/local-transform.d.ts +6 -0
  340. package/lib/typescript/shared/utils/bounds/helpers/styles/local-transform.d.ts.map +1 -0
  341. package/package.json +1 -1
  342. package/src/shared/components/boundary/components/boundary-target.tsx +21 -7
  343. package/src/shared/components/boundary/create-boundary-component.tsx +92 -28
  344. package/src/shared/components/boundary/hooks/{use-boundary-presence.ts → lifecycles/use-boundary-presence.ts} +16 -5
  345. package/src/shared/components/boundary/hooks/{use-initial-destination-measurement.ts → lifecycles/use-initial-destination-measurement.ts} +40 -13
  346. package/src/shared/components/boundary/hooks/{use-initial-source-measurement.ts → lifecycles/use-initial-source-measurement.ts} +7 -9
  347. package/src/shared/components/boundary/hooks/{use-refresh-boundary.ts → lifecycles/use-refresh-boundary.ts} +6 -6
  348. package/src/shared/components/boundary/hooks/use-boundary-measurement.ts +15 -45
  349. package/src/shared/components/boundary/hooks/use-measurer.ts +9 -14
  350. package/src/shared/components/boundary/index.tsx +55 -29
  351. package/src/shared/components/boundary/portal/components/boundary-local-portal-host.tsx +66 -0
  352. package/src/shared/components/boundary/portal/components/host.tsx +20 -5
  353. package/src/shared/components/boundary/portal/components/portal-boundary-host.tsx +67 -52
  354. package/src/shared/components/boundary/portal/components/portal.tsx +280 -119
  355. package/src/shared/components/boundary/portal/hooks/use-host-measurement.ts +23 -2
  356. package/src/shared/components/boundary/portal/stores/host-registry.store.ts +4 -51
  357. package/src/shared/components/boundary/portal/stores/portal-boundary-host.store.ts +59 -6
  358. package/src/shared/components/boundary/portal/teleport.ts +28 -3
  359. package/src/shared/components/boundary/portal/utils/has-local-slot.ts +16 -0
  360. package/src/shared/components/boundary/portal/utils/naming.ts +11 -1
  361. package/src/shared/components/boundary/portal/utils/offset-style.ts +37 -139
  362. package/src/shared/components/boundary/portal/utils/ownership.ts +371 -0
  363. package/src/shared/components/boundary/portal/utils/resolve-portal.ts +50 -0
  364. package/src/shared/components/boundary/portal/utils/shallow-equal.ts +25 -0
  365. package/src/shared/components/boundary/portal/utils/teleport-control.ts +12 -0
  366. package/src/shared/components/boundary/portal/utils/visible-host.ts +24 -0
  367. package/src/shared/components/boundary/providers/boundary-root.provider.tsx +9 -18
  368. package/src/shared/components/boundary/types.ts +9 -39
  369. package/src/shared/components/boundary/utils/destination-signals.ts +1 -32
  370. package/src/shared/components/boundary/utils/refresh-signals.ts +0 -41
  371. package/src/shared/components/boundary/utils/source-signals.ts +5 -17
  372. package/src/shared/index.ts +0 -5
  373. package/src/shared/providers/helpers/measured-bounds-writes.ts +6 -11
  374. package/src/shared/providers/screen/animation/helpers/derivations.ts +3 -0
  375. package/src/shared/providers/screen/animation/helpers/pipeline.ts +1 -0
  376. package/src/shared/providers/screen/styles/helpers/compose-slot-style.ts +129 -0
  377. package/src/shared/providers/screen/styles/helpers/normalize-slots.ts +45 -8
  378. package/src/shared/providers/screen/styles/helpers/resolve-slot-styles/index.ts +14 -2
  379. package/src/shared/providers/screen/styles/helpers/resolve-slot-styles/materialize-slot.ts +3 -0
  380. package/src/shared/providers/screen/styles/hooks/slot-resolvers.tsx +111 -0
  381. package/src/shared/providers/screen/styles/hooks/use-interpolated-style-maps.tsx +21 -3
  382. package/src/shared/providers/screen/styles/index.tsx +8 -3
  383. package/src/shared/providers/screen/styles/slot.provider.tsx +36 -54
  384. package/src/shared/providers/screen/styles/stores/slot-references.store.ts +71 -0
  385. package/src/shared/stores/bounds/helpers/link-pairs.helpers.ts +24 -1
  386. package/src/shared/stores/bounds/internals/entries.ts +13 -5
  387. package/src/shared/stores/bounds/internals/links.ts +167 -85
  388. package/src/shared/stores/bounds/internals/resolver.ts +0 -2
  389. package/src/shared/stores/bounds/types.ts +10 -22
  390. package/src/shared/stores/system.store.ts +6 -0
  391. package/src/shared/types/animation.types.ts +8 -1
  392. package/src/shared/utils/bounds/helpers/styles/compute.ts +22 -124
  393. package/src/shared/utils/bounds/helpers/styles/local-transform.ts +86 -0
  394. package/lib/commonjs/shared/components/boundary/hooks/use-boundary-presence.js.map +0 -1
  395. package/lib/commonjs/shared/components/boundary/hooks/use-initial-destination-measurement.js.map +0 -1
  396. package/lib/commonjs/shared/components/boundary/hooks/use-initial-source-measurement.js.map +0 -1
  397. package/lib/commonjs/shared/components/boundary/hooks/use-refresh-boundary.js.map +0 -1
  398. package/lib/commonjs/shared/components/boundary/portal/resolve-portal.js +0 -36
  399. package/lib/commonjs/shared/components/boundary/portal/resolve-portal.js.map +0 -1
  400. package/lib/commonjs/shared/components/boundary/portal/utils/attachment.js +0 -40
  401. package/lib/commonjs/shared/components/boundary/portal/utils/attachment.js.map +0 -1
  402. package/lib/module/shared/components/boundary/hooks/use-boundary-presence.js.map +0 -1
  403. package/lib/module/shared/components/boundary/hooks/use-initial-destination-measurement.js.map +0 -1
  404. package/lib/module/shared/components/boundary/hooks/use-initial-source-measurement.js.map +0 -1
  405. package/lib/module/shared/components/boundary/hooks/use-refresh-boundary.js.map +0 -1
  406. package/lib/module/shared/components/boundary/portal/resolve-portal.js +0 -31
  407. package/lib/module/shared/components/boundary/portal/resolve-portal.js.map +0 -1
  408. package/lib/module/shared/components/boundary/portal/utils/attachment.js +0 -35
  409. package/lib/module/shared/components/boundary/portal/utils/attachment.js.map +0 -1
  410. package/lib/typescript/shared/components/boundary/hooks/use-boundary-presence.d.ts +0 -9
  411. package/lib/typescript/shared/components/boundary/hooks/use-boundary-presence.d.ts.map +0 -1
  412. package/lib/typescript/shared/components/boundary/hooks/use-initial-destination-measurement.d.ts.map +0 -1
  413. package/lib/typescript/shared/components/boundary/hooks/use-initial-source-measurement.d.ts +0 -9
  414. package/lib/typescript/shared/components/boundary/hooks/use-initial-source-measurement.d.ts.map +0 -1
  415. package/lib/typescript/shared/components/boundary/hooks/use-refresh-boundary.d.ts.map +0 -1
  416. package/lib/typescript/shared/components/boundary/portal/resolve-portal.d.ts +0 -14
  417. package/lib/typescript/shared/components/boundary/portal/resolve-portal.d.ts.map +0 -1
  418. package/lib/typescript/shared/components/boundary/portal/utils/attachment.d.ts +0 -21
  419. package/lib/typescript/shared/components/boundary/portal/utils/attachment.d.ts.map +0 -1
  420. package/src/shared/components/boundary/portal/resolve-portal.ts +0 -40
  421. package/src/shared/components/boundary/portal/utils/attachment.ts +0 -48
@@ -1,149 +1,243 @@
1
1
  "use strict";
2
2
 
3
3
  import { memo, useCallback, useLayoutEffect, useState } from "react";
4
- import Animated, { runOnJS, useAnimatedProps, useAnimatedReaction, useAnimatedStyle, useSharedValue } from "react-native-reanimated";
4
+ import Animated, { runOnJS, runOnUI, useAnimatedProps, useAnimatedReaction, useAnimatedStyle, useSharedValue } from "react-native-reanimated";
5
+ import { EPSILON } from "../../../../constants";
5
6
  import { useDescriptorsStore } from "../../../../providers/screen/descriptors";
6
7
  import { useScreenSlots } from "../../../../providers/screen/styles";
8
+ import { useRegisteredScreenSlots } from "../../../../providers/screen/styles/stores/slot-references.store";
7
9
  import { AnimationStore } from "../../../../stores/animation.store";
8
- import { getLinkKeyFromTag } from "../../../../stores/bounds/helpers/link-pairs.helpers";
9
- import { getLink } from "../../../../stores/bounds/internals/links";
10
10
  import { pairs } from "../../../../stores/bounds/internals/state";
11
- import { createTransitionAwareComponent } from "../../../create-transition-aware-component";
12
- import { getHostCapturesScroll, useActiveHostKey } from "../stores/host-registry.store";
13
- import { mountPortalBoundaryHost, unmountPortalBoundaryHost } from "../stores/portal-boundary-host.store";
11
+ import { logger } from "../../../../utils/logger";
12
+ import { useActiveHostKey } from "../stores/host-registry.store";
13
+ import { dropStalePortalBoundaryHosts, mountPortalBoundaryHost, unmountPortalBoundaryHost } from "../stores/portal-boundary-host.store";
14
14
  import { isTeleportAvailable, NativePortal } from "../teleport";
15
- import { resolvePortalAttachmentTargets } from "../utils/attachment";
16
- import { createPortalBoundaryHostName, PORTAL_HOST_NAME_RESET_VALUE } from "../utils/naming";
17
- import { isTeleportEnabled } from "../utils/teleport-control";
18
- import { jsx as _jsx } from "react/jsx-runtime";
19
- const TransitionAwareTeleport = NativePortal ? createTransitionAwareComponent(NativePortal) : null;
15
+ import { createBoundaryLocalPortalHostName, createPortalBoundaryHostName, PORTAL_HOST_NAME_RESET_VALUE } from "../utils/naming";
16
+ import { canSwitchBoundaryLocalHandoffImmediately, resolveBoundaryPortalOwnership } from "../utils/ownership";
17
+ import { shallowEqual } from "../utils/shallow-equal";
18
+ import { shouldAttachBoundaryPortal } from "../utils/teleport-control";
19
+ import { resolveNextVisiblePortalHostName } from "../utils/visible-host";
20
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
21
+ const AnimatedNativePortal = NativePortal ? Animated.createAnimatedComponent(NativePortal) : null;
20
22
  export const Portal = /*#__PURE__*/memo(function Portal({
21
- id = "my-id",
23
+ id,
22
24
  children,
23
- mode = false,
24
- placeholderRef
25
+ handoff = false,
26
+ escapeClipping = false,
27
+ placeholderRef,
28
+ placeholderChildren
25
29
  }) {
26
- // Teleporting requires the optional `react-native-teleport` peer. Without it,
27
- // a portal-enabled boundary degrades to inline rendering (the `return
28
- // children` path below).
29
- const isPortalEnabled = !!mode && isTeleportAvailable;
30
- const portalAttachTarget = !mode || mode === true ? "current-screen" : mode.attachTo ?? "current-screen";
31
- const {
32
- slotsMap
33
- } = useScreenSlots();
30
+ // Teleporting requires the optional `react-native-teleport` peer and a stable
31
+ // `id` to name the boundary host. Missing either degrades to inline rendering
32
+ // (the `return children` path below).
33
+ const isPortalEnabled = (handoff || escapeClipping) && isTeleportAvailable && id !== undefined;
34
+ if (__DEV__ && (handoff || escapeClipping) && id === undefined) {
35
+ logger.warnOnce("portal:missing-id", "A handoff or escapeClipping boundary was rendered without an id; rendering inline.");
36
+ }
37
+ const boundaryId = id ?? "";
38
+ const ownScreenSlots = useScreenSlots();
34
39
  const sourcePairKey = useDescriptorsStore(s => s.derivations.sourcePairKey);
35
40
  const currentScreenKey = useDescriptorsStore(s => s.derivations.currentScreenKey);
36
- const nextScreenKey = useDescriptorsStore(s => s.derivations.nextScreenKey);
37
- const [attachment, setAttachment] = useState(PORTAL_HOST_NAME_RESET_VALUE);
38
- const attachedHostName = useSharedValue(PORTAL_HOST_NAME_RESET_VALUE);
41
+ const [ownership, setOwnership] = useState(null);
42
+ const styleOwnerScreenKey = ownership?.ownerScreenKey ?? currentScreenKey;
43
+ const ownerScreenSlots = useRegisteredScreenSlots(styleOwnerScreenKey);
44
+ const activeScreenSlots = ownerScreenSlots ?? ownScreenSlots;
45
+ const {
46
+ localStylesMaps: activeLocalStylesMaps,
47
+ nextInterpolatorReady: activeNextInterpolatorReady,
48
+ slotsMap: activeSlotsMap
49
+ } = activeScreenSlots;
50
+ const requestedPortalHostName = useSharedValue(null);
51
+ const visiblePortalHostName = useSharedValue(null);
52
+ const canSwitchPortalHostImmediately = useSharedValue(0);
39
53
  const placeholderWidth = useSharedValue(0);
40
54
  const placeholderHeight = useSharedValue(0);
41
- const {
42
- progressScreenKey,
43
- targetScreenKey
44
- } = resolvePortalAttachmentTargets({
45
- attachment,
46
- currentScreenKey,
47
- nextScreenKey,
48
- portalAttachTarget,
49
- sourcePairKey
50
- });
51
- const activeHostKey = useActiveHostKey(targetScreenKey);
52
- const activeHostCapturesScroll = activeHostKey ? getHostCapturesScroll(activeHostKey) : false;
53
- const progress = AnimationStore.getValue(progressScreenKey ?? "", "transitionProgress");
54
- const closing = AnimationStore.getValue(progressScreenKey ?? "", "closing");
55
- const updatePortalAttachment = useCallback((matchedScreenKey, pairKey) => {
56
- if (matchedScreenKey && pairKey) {
57
- setAttachment(current => {
58
- if (current?.matchedScreenKey === matchedScreenKey && current.pairKey === pairKey) {
55
+ const targetScreenKey = ownership ? ownership.hostScreenKey : null;
56
+ const settledHostScreenKey = ownership?.hostScreenKey ?? null;
57
+ const settledHostProgress = AnimationStore.getValue(settledHostScreenKey ?? currentScreenKey, "progressSettled");
58
+ const settledHostAnimating = AnimationStore.getValue(settledHostScreenKey ?? currentScreenKey, "progressAnimating");
59
+ const settledHostClosing = AnimationStore.getValue(settledHostScreenKey ?? currentScreenKey, "closing");
60
+ const settledHostVisualProgress = AnimationStore.getValue(settledHostScreenKey ?? currentScreenKey, "visualProgress");
61
+ const activeHostKey = useActiveHostKey(escapeClipping ? targetScreenKey : null);
62
+ const boundaryLocalHostName = handoff && !escapeClipping && targetScreenKey ? createBoundaryLocalPortalHostName(targetScreenKey, boundaryId) : null;
63
+ const updatePortalOwnership = useCallback((hostScreenKey, ownerPairKey, ownerScreenKey) => {
64
+ if (hostScreenKey && ownerPairKey && ownerScreenKey) {
65
+ setOwnership(current => {
66
+ if (current?.hostScreenKey === hostScreenKey && current.ownerPairKey === ownerPairKey && current.ownerScreenKey === ownerScreenKey) {
59
67
  return current;
60
68
  }
61
69
  return {
62
- matchedScreenKey,
63
- pairKey
70
+ hostScreenKey,
71
+ ownerPairKey,
72
+ ownerScreenKey,
73
+ status: "complete"
64
74
  };
65
75
  });
66
76
  return;
67
77
  }
68
- setAttachment(current => current ? null : current);
78
+ setOwnership(current => current ? null : current);
69
79
  }, []);
70
80
  useLayoutEffect(() => {
71
- if (!isPortalEnabled || !attachment || !activeHostKey || !targetScreenKey) {
72
- attachedHostName.set(PORTAL_HOST_NAME_RESET_VALUE);
81
+ if (!isPortalEnabled || !ownership || !targetScreenKey) {
82
+ requestedPortalHostName.set(null);
83
+ visiblePortalHostName.set(null);
84
+ unmountPortalBoundaryHost(boundaryId);
73
85
  return;
74
86
  }
87
+ if (boundaryLocalHostName) {
88
+ requestedPortalHostName.set(boundaryLocalHostName);
89
+ unmountPortalBoundaryHost(boundaryId);
90
+ return;
91
+ }
92
+ if (!escapeClipping || !activeHostKey) {
93
+ requestedPortalHostName.set(null);
94
+ visiblePortalHostName.set(null);
95
+ unmountPortalBoundaryHost(boundaryId);
96
+ return;
97
+ }
98
+ const portalHostName = createPortalBoundaryHostName(activeHostKey, boundaryId, ownership.ownerPairKey);
75
99
  mountPortalBoundaryHost({
76
- boundaryId: id,
77
- capturesScroll: activeHostCapturesScroll,
100
+ boundaryId,
101
+ escapeClipping,
78
102
  hostKey: activeHostKey,
79
- pairKey: attachment.pairKey,
80
- screenKey: targetScreenKey
103
+ localStylesMaps: activeLocalStylesMaps,
104
+ pairKey: ownership.ownerPairKey,
105
+ portalHostName,
106
+ screenKey: targetScreenKey,
107
+ slotsMap: activeSlotsMap
81
108
  });
82
109
 
83
- // The native registry parks portals whose host has not registered yet and
84
- // re-parents the moment it does, so the host name can be handed over
85
- // immediately ordering belongs to the registry, not to frame counting.
86
- // hostName rides animated props, so the handover needs no React commit.
87
- attachedHostName.set(createPortalBoundaryHostName(activeHostKey, id));
88
- }, [activeHostKey, activeHostCapturesScroll, attachedHostName, attachment, id, isPortalEnabled, targetScreenKey]);
110
+ // Request the new receiver immediately, but keep the currently visible
111
+ // receiver until the new interpolator is ready. This avoids a no-host gap
112
+ // during A -> B(closing) -> C(opening) spam retargets.
113
+ requestedPortalHostName.set(portalHostName);
114
+ }, [activeHostKey, boundaryId, escapeClipping, isPortalEnabled, activeLocalStylesMaps, activeSlotsMap, ownership, boundaryLocalHostName, requestedPortalHostName, targetScreenKey, visiblePortalHostName]);
89
115
  useLayoutEffect(() => {
90
116
  return () => {
91
- attachedHostName.set(PORTAL_HOST_NAME_RESET_VALUE);
92
- unmountPortalBoundaryHost(id);
117
+ requestedPortalHostName.set(null);
118
+ visiblePortalHostName.set(null);
119
+ unmountPortalBoundaryHost(boundaryId);
93
120
  };
94
- }, [attachedHostName, id]);
121
+ }, [boundaryId, requestedPortalHostName, visiblePortalHostName]);
95
122
  useAnimatedReaction(() => {
96
123
  "worklet";
97
124
 
98
125
  if (!isPortalEnabled || !sourcePairKey) {
99
- return null;
100
- }
101
- pairs.get();
102
- // Strict per-member lookup: getResolvedLink's group fallback borrows
103
- // the initial member's link for style resolution, which would make
104
- // every inactive group member's portal see a "complete" link and
105
- // attach. A portal may only teleport on its OWN member's link.
106
- const link = getLink(sourcePairKey, id);
107
- if (link?.status !== "complete") {
108
- return null;
126
+ return {
127
+ hostScreenKey: null,
128
+ ownerPairKey: sourcePairKey,
129
+ ownerScreenKey: null,
130
+ status: "clear"
131
+ };
109
132
  }
133
+ return resolveBoundaryPortalOwnership({
134
+ boundaryId,
135
+ currentScreenKey,
136
+ escapeClipping,
137
+ handoff,
138
+ isSettledHostClosingComplete: !!settledHostClosing.get() && settledHostVisualProgress.get() <= EPSILON,
139
+ isSettledHostReady: settledHostProgress.get() === 1 && settledHostAnimating.get() === 0,
140
+ pairsState: pairs.get(),
141
+ settledHostScreenKey,
142
+ sourcePairKey
143
+ });
144
+ }, (signal, previousSignal) => {
145
+ "worklet";
110
146
 
111
- // Grouped portals teleport only while their member is the group's
112
- // active id — retargeting detaches the previous member (its content
113
- // returns home) and attaches the new one. Exactly one grouped member
114
- // is teleported at a time.
115
- if (link.group) {
116
- const activeId = pairs.get()[sourcePairKey]?.groups?.[link.group]?.activeId;
117
- if (activeId && activeId !== getLinkKeyFromTag(id)) {
118
- return null;
147
+ if (shallowEqual(previousSignal, signal)) {
148
+ return;
149
+ }
150
+ if (!handoff || escapeClipping) {
151
+ canSwitchPortalHostImmediately.set(0);
152
+ } else if (signal.status === "pending") {
153
+ canSwitchPortalHostImmediately.set(0);
154
+ return;
155
+ } else {
156
+ const hostScreenKey = signal.status === "complete" ? signal.hostScreenKey : null;
157
+ let previousOwnerPairKey;
158
+ if (previousSignal?.status === "complete") {
159
+ previousOwnerPairKey = previousSignal.ownerPairKey ?? undefined;
160
+ }
161
+ const canSwitchImmediately = canSwitchBoundaryLocalHandoffImmediately({
162
+ hostScreenKey,
163
+ ownerPairKey: signal.status === "complete" ? signal.ownerPairKey : undefined,
164
+ previousOwnerPairKey
165
+ });
166
+ canSwitchPortalHostImmediately.set(canSwitchImmediately ? 1 : 0);
167
+ if (canSwitchImmediately && hostScreenKey) {
168
+ const hostName = createBoundaryLocalPortalHostName(hostScreenKey, boundaryId);
169
+ requestedPortalHostName.set(hostName);
170
+ visiblePortalHostName.set(hostName);
119
171
  }
120
172
  }
121
- return link.destination.screenKey;
122
- }, (matchedScreenKey, previousMatchedScreenKey) => {
173
+ runOnJS(updatePortalOwnership)(signal.hostScreenKey, signal.ownerPairKey, signal.ownerScreenKey ?? undefined);
174
+ });
175
+ useAnimatedReaction(() => {
123
176
  "worklet";
124
177
 
125
- if (matchedScreenKey === previousMatchedScreenKey) {
178
+ const slot = activeSlotsMap.get()[boundaryId];
179
+ const teleport = slot?.props?.teleport;
180
+ const shouldTeleport = shouldAttachBoundaryPortal({
181
+ enabled: isPortalEnabled,
182
+ teleport
183
+ });
184
+ const requestedName = requestedPortalHostName.get();
185
+ const visibleName = visiblePortalHostName.get();
186
+ const isInterpolatorReady = activeNextInterpolatorReady.get();
187
+ const nextVisibleName = resolveNextVisiblePortalHostName({
188
+ canSwitchImmediately: canSwitchPortalHostImmediately.get() === 1,
189
+ isInterpolatorReady: isInterpolatorReady === 1,
190
+ requestedName,
191
+ shouldTeleport,
192
+ visibleName
193
+ });
194
+ return {
195
+ isInterpolatorReady,
196
+ nextVisibleName,
197
+ requestedName,
198
+ shouldTeleport,
199
+ teleport,
200
+ visibleName
201
+ };
202
+ }, (state, previousState) => {
203
+ "worklet";
204
+
205
+ if (shallowEqual(previousState, state)) {
126
206
  return;
127
207
  }
128
- runOnJS(updatePortalAttachment)(matchedScreenKey, sourcePairKey);
208
+ if (state.nextVisibleName !== state.visibleName) {
209
+ visiblePortalHostName.set(state.nextVisibleName);
210
+ return;
211
+ }
212
+
213
+ // Visible receiver has caught up to the request: GC the superseded hosts.
214
+ if (state.visibleName && state.visibleName === state.requestedName) {
215
+ runOnJS(dropStalePortalBoundaryHosts)({
216
+ boundaryId,
217
+ keepPortalHostName: state.visibleName
218
+ });
219
+ }
129
220
  });
130
221
  const teleportProps = useAnimatedProps(() => {
131
222
  "worklet";
132
223
 
133
- // Opening waits for the destination transition to start so content is not
134
- // re-parented before the host is visually ready. Closing stays attached
135
- // through progress 0 so the final frame can land in the matched host.
136
- const attachThreshold = closing.get() === 1 ? 0 : 0.001;
224
+ const slot = activeSlotsMap.get()[boundaryId];
137
225
  const {
138
226
  teleport,
139
227
  ...slotProps
140
- } = slotsMap.get()[id]?.props ?? {};
141
- const shouldTeleport = isTeleportEnabled(teleport);
228
+ } = slot?.props ?? {};
229
+ const shouldTeleport = shouldAttachBoundaryPortal({
230
+ enabled: isPortalEnabled,
231
+ teleport
232
+ });
233
+ const visibleName = visiblePortalHostName.get();
142
234
  return {
143
235
  // Preserve portal slot props from the interpolator while keeping
144
- // hostName owned by the attachment gate below.
236
+ // hostName owned by the attachment gate below. Handoff
237
+ // waits until the receiving interpolator owns styles for the same host;
238
+ // after that, it stays attached until teleport is disabled or retargeted.
145
239
  ...slotProps,
146
- hostName: shouldTeleport && progress.get() >= attachThreshold ? attachedHostName.get() : PORTAL_HOST_NAME_RESET_VALUE
240
+ hostName: shouldTeleport && visibleName ? visibleName : PORTAL_HOST_NAME_RESET_VALUE
147
241
  };
148
242
  });
149
243
 
@@ -154,8 +248,7 @@ export const Portal = /*#__PURE__*/memo(function Portal({
154
248
  const placeholderStyle = useAnimatedStyle(() => {
155
249
  "worklet";
156
250
 
157
- const hostName = attachedHostName.get();
158
- const isAttached = hostName !== null;
251
+ const isAttached = visiblePortalHostName.get() !== null;
159
252
  const width = placeholderWidth.get();
160
253
  const height = placeholderHeight.get();
161
254
  if (!isAttached || width === 0) {
@@ -169,23 +262,40 @@ export const Portal = /*#__PURE__*/memo(function Portal({
169
262
  height
170
263
  };
171
264
  });
172
- if (isPortalEnabled && TransitionAwareTeleport) {
173
- return /*#__PURE__*/_jsx(Animated.View, {
265
+ const handleOnLayout = useCallback(layout => {
266
+ "worklet";
267
+
268
+ const {
269
+ width,
270
+ height
271
+ } = layout;
272
+ if (width === 0 || height === 0) {
273
+ return;
274
+ }
275
+ const hasValidDimensions = placeholderHeight.get() !== 0 && placeholderWidth.get() !== 0;
276
+ if (!hasValidDimensions) {
277
+ placeholderWidth.set(width);
278
+ placeholderHeight.set(height);
279
+ }
280
+ }, [placeholderHeight, placeholderWidth]);
281
+ if (isPortalEnabled && AnimatedNativePortal) {
282
+ return /*#__PURE__*/_jsxs(Animated.View, {
174
283
  ref: placeholderRef,
175
- onLayout: event => {
176
- placeholderWidth.set(event.nativeEvent.layout.width);
177
- placeholderHeight.set(event.nativeEvent.layout.height);
178
- },
284
+ onLayout: ({
285
+ nativeEvent: {
286
+ layout
287
+ }
288
+ }) => runOnUI(handleOnLayout)(layout),
179
289
  style: placeholderStyle,
180
290
  collapsable: false,
181
- children: /*#__PURE__*/_jsx(TransitionAwareTeleport, {
291
+ children: [placeholderChildren, /*#__PURE__*/_jsx(AnimatedNativePortal, {
182
292
  animatedProps: teleportProps,
183
- name: id,
293
+ name: boundaryId,
184
294
  children: /*#__PURE__*/_jsx(Animated.View, {
185
295
  style: placeholderStyle,
186
296
  children: children
187
297
  })
188
- })
298
+ })]
189
299
  });
190
300
  }
191
301
  return children;
@@ -1 +1 @@
1
- {"version":3,"names":["memo","useCallback","useLayoutEffect","useState","Animated","runOnJS","useAnimatedProps","useAnimatedReaction","useAnimatedStyle","useSharedValue","useDescriptorsStore","useScreenSlots","AnimationStore","getLinkKeyFromTag","getLink","pairs","createTransitionAwareComponent","getHostCapturesScroll","useActiveHostKey","mountPortalBoundaryHost","unmountPortalBoundaryHost","isTeleportAvailable","NativePortal","resolvePortalAttachmentTargets","createPortalBoundaryHostName","PORTAL_HOST_NAME_RESET_VALUE","isTeleportEnabled","jsx","_jsx","TransitionAwareTeleport","Portal","id","children","mode","placeholderRef","isPortalEnabled","portalAttachTarget","attachTo","slotsMap","sourcePairKey","s","derivations","currentScreenKey","nextScreenKey","attachment","setAttachment","attachedHostName","placeholderWidth","placeholderHeight","progressScreenKey","targetScreenKey","activeHostKey","activeHostCapturesScroll","progress","getValue","closing","updatePortalAttachment","matchedScreenKey","pairKey","current","set","boundaryId","capturesScroll","hostKey","screenKey","get","link","status","group","activeId","groups","destination","previousMatchedScreenKey","teleportProps","attachThreshold","teleport","slotProps","props","shouldTeleport","hostName","placeholderStyle","isAttached","width","height","View","ref","onLayout","event","nativeEvent","layout","style","collapsable","animatedProps","name"],"sourceRoot":"../../../../../../../src","sources":["shared/components/boundary/portal/components/portal.tsx"],"mappings":";;AAAA,SAGCA,IAAI,EAEJC,WAAW,EACXC,eAAe,EACfC,QAAQ,QACF,OAAO;AAEd,OAAOC,QAA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gB,CAACmB,GAAG,CAAC,CAAC;IACvC,MAAMgB,UAAU,GAAGF,QAAQ,KAAK,IAAI;IACpC,MAAMG,KAAK,GAAGnC,gBAAgB,CAACkB,GAAG,CAAC,CAAC;IACpC,MAAMkB,MAAM,GAAGnC,iBAAiB,CAACiB,GAAG,CAAC,CAAC;IAEtC,IAAI,CAACgB,UAAU,IAAIC,KAAK,KAAK,CAAC,EAAE;MAC/B,OAAO;QAAEA,KAAK,EAAE,MAAM;QAAEC,MAAM,EAAE;MAAO,CAAC;IACzC;IAEA,OAAO;MAAED,KAAK;MAAEC;IAAO,CAAC;EACzB,CAAC,CAAC;EAEF,IAAIhD,eAAe,IAAIN,uBAAuB,EAAE;IAC/C,oBACCD,IAAA,CAACxB,QAAQ,CAACgF,IAAI;MACbC,GAAG,EAAEnD,cAAe;MACpBoD,QAAQ,EAAGC,KAAK,IAAK;QACpBxC,gBAAgB,CAACa,GAAG,CAAC2B,KAAK,CAACC,WAAW,CAACC,MAAM,CAACP,KAAK,CAAC;QACpDlC,iBAAiB,CAACY,GAAG,CAAC2B,KAAK,CAACC,WAAW,CAACC,MAAM,CAACN,MAAM,CAAC;MACvD,CAAE;MACFO,KAAK,EAAEV,gBAAiB;MACxBW,WAAW,EAAE,KAAM;MAAA3D,QAAA,eAEnBJ,IAAA,CAACC,uBAAuB;QAAC+D,aAAa,EAAEnB,aAAc;QAACoB,IAAI,EAAE9D,EAAG;QAAAC,QAAA,eAC/DJ,IAAA,CAACxB,QAAQ,CAACgF,IAAI;UAACM,KAAK,EAAEV,gBAAiB;UAAAhD,QAAA,EAAEA;QAAQ,CAAgB;MAAC,CAC1C;IAAC,CACZ,CAAC;EAElB;EAEA,OAAOA,QAAQ;AAChB,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["memo","useCallback","useLayoutEffect","useState","Animated","runOnJS","runOnUI","useAnimatedProps","useAnimatedReaction","useAnimatedStyle","useSharedValue","EPSILON","useDescriptorsStore","useScreenSlots","useRegisteredScreenSlots","AnimationStore","pairs","logger","useActiveHostKey","dropStalePortalBoundaryHosts","mountPortalBoundaryHost","unmountPortalBoundaryHost","isTeleportAvailable","NativePortal","createBoundaryLocalPortalHostName","createPortalBoundaryHostName","PORTAL_HOST_NAME_RESET_VALUE","canSwitchBoundaryLocalHandoffImmediately","resolveBoundaryPortalOwnership","shallowEqual","shouldAttachBoundaryPortal","resolveNextVisiblePortalHostName","jsx","_jsx","jsxs","_jsxs","AnimatedNativePortal","createAnimatedComponent","Portal","id","children","handoff","escapeClipping","placeholderRef","placeholderChildren","isPortalEnabled","undefined","__DEV__","warnOnce","boundaryId","ownScreenSlots","sourcePairKey","s","derivations","currentScreenKey","ownership","setOwnership","styleOwnerScreenKey","ownerScreenKey","ownerScreenSlots","activeScreenSlots","localStylesMaps","activeLocalStylesMaps","nextInterpolatorReady","activeNextInterpolatorReady","slotsMap","activeSlotsMap","requestedPortalHostName","visiblePortalHostName","canSwitchPortalHostImmediately","placeholderWidth","placeholderHeight","targetScreenKey","hostScreenKey","settledHostScreenKey","settledHostProgress","getValue","settledHostAnimating","settledHostClosing","settledHostVisualProgress","activeHostKey","boundaryLocalHostName","updatePortalOwnership","ownerPairKey","current","status","set","portalHostName","hostKey","pairKey","screenKey","isSettledHostClosingComplete","get","isSettledHostReady","pairsState","signal","previousSignal","previousOwnerPairKey","canSwitchImmediately","hostName","slot","teleport","props","shouldTeleport","enabled","requestedName","visibleName","isInterpolatorReady","nextVisibleName","state","previousState","keepPortalHostName","teleportProps","slotProps","placeholderStyle","isAttached","width","height","handleOnLayout","layout","hasValidDimensions","View","ref","onLayout","nativeEvent","style","collapsable","animatedProps","name"],"sourceRoot":"../../../../../../../src","sources":["shared/components/boundary/portal/components/portal.tsx"],"mappings":";;AAAA,SAGCA,IAAI,EAEJC,WAAW,EACXC,eAAe,EACfC,QAAQ,QACF,OAAO;AAEd,OAAOC,QAAQ,IAEdC,OAAO,EACPC,OAAO,EACPC,gBAAgB,EAChBC,mBAAmB,EACn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tF,QAAA,GAElBI,mBAAmB,eACpBX,IAAA,CAACG,oBAAoB;QAAC2F,aAAa,EAAEf,aAAc;QAACgB,IAAI,EAAE/E,UAAW;QAAAT,QAAA,eACpEP,IAAA,CAAC7B,QAAQ,CAACqH,IAAI;UAACI,KAAK,EAAEX,gBAAiB;UAAA1E,QAAA,EAAEA;QAAQ,CAAgB;MAAC,CAC7C,CAAC;IAAA,CACT,CAAC;EAElB;EAEA,OAAOA,QAAQ;AAChB,CAAC,CAAC","ignoreList":[]}
@@ -1,11 +1,12 @@
1
1
  "use strict";
2
2
 
3
3
  import { useLayoutEffect, useState } from "react";
4
- import { measure, runOnJS, runOnUI, useAnimatedReaction, useAnimatedRef, useSharedValue } from "react-native-reanimated";
4
+ import { cancelAnimation, measure, runOnJS, runOnUI, useAnimatedReaction, useAnimatedRef, useSharedValue, withDelay, withTiming } from "react-native-reanimated";
5
5
  import { useOriginContext } from "../../../../providers/screen/origin.provider";
6
6
  import { ScrollStore } from "../../../../stores/scroll.store";
7
7
  import { adjustedMeasuredBoundsForOverscrollDeltas, normalizeMeasuredBoundsToOrigin } from "../../utils/measured-bounds";
8
8
  import { clearPortalHostBounds, setPortalHostBounds } from "../stores/host-bounds.store";
9
+ const HOST_MEASUREMENT_RETRY_DELAY_MS = 16;
9
10
  export const useHostMeasurement = ({
10
11
  capturesScroll,
11
12
  enabled,
@@ -19,24 +20,35 @@ export const useHostMeasurement = ({
19
20
  originRef
20
21
  } = useOriginContext();
21
22
  const hasMeasuredHost = useSharedValue(false);
23
+ const retryToken = useSharedValue(0);
22
24
  useAnimatedReaction(() => {
23
25
  "worklet";
24
26
 
25
27
  if (!enabled) {
26
28
  return null;
27
29
  }
28
- return hasMeasuredHost.get();
29
- }, hasAlreadyMeasured => {
30
+ return [hasMeasuredHost.get(), retryToken.get()];
31
+ }, state => {
30
32
  "worklet";
31
33
 
34
+ if (!state) {
35
+ cancelAnimation(retryToken);
36
+ return;
37
+ }
38
+ const [hasAlreadyMeasured] = state;
32
39
  if (!enabled || hasAlreadyMeasured) {
33
40
  return;
34
41
  }
35
42
  const measured = measure(hostRef);
36
43
  const measuredOrigin = measure(originRef);
37
44
  if (!measured || !measuredOrigin) {
45
+ cancelAnimation(retryToken);
46
+ retryToken.set(withDelay(HOST_MEASUREMENT_RETRY_DELAY_MS, withTiming(retryToken.get() + 1, {
47
+ duration: 0
48
+ })));
38
49
  return;
39
50
  }
51
+ cancelAnimation(retryToken);
40
52
  hasMeasuredHost.set(true);
41
53
 
42
54
  // A measurement taken mid rubber-band would bake the transient
@@ -1 +1 @@
1
- {"version":3,"names":["useLayoutEffect","useState","measure","runOnJS","runOnUI","useAnimatedReaction","useAnimatedRef","useSharedValue","useOriginContext","ScrollStore","adjustedMeasuredBoundsForOverscrollDeltas","normalizeMeasuredBoundsToOrigin","clearPortalHostBounds","setPortalHostBounds","useHostMeasurement","capturesScroll","enabled","hostKey","screenKey","hostRef","scrollMetadata","getValue","canRenderHosts","setCanRenderHosts","originRef","hasMeasuredHost","get","hasAlreadyMeasured","measured","measuredOrigin","set","currentScroll","overscrollNormalized","normalizedMeasured","x","y","width","height","pageX","pageY","scroll"],"sourceRoot":"../../../../../../../src","sources":["shared/components/boundary/portal/hooks/use-host-measurement.ts"],"mappings":";;AAAA,SAASA,eAAe,EAAEC,QAAQ,QAAQ,OAAO;AAEjD,SACCC,OAAO,EACPC,OAAO,EACPC,OAAO,EACPC,mBAAmB,EACnBC,cAAc,EACdC,cAAc,QACR,yBAAyB;AAChC,SAASC,gBAAgB,QAAQ,8CAA8C;AAC/E,SAASC,WAAW,QAAQ,iCAAiC;AAC7D,SACCC,yCAAyC,EACzCC,+BAA+B,QACzB,6BAA6B;AACpC,SACCC,qBAAqB,EACrBC,mBAAmB,QACb,6BAA6B;AASpC,OAAO,MAAMC,kBAAkB,GAAGA,CAAC;EAClCC,cAAc;EACdC,OAAO;EACPC,OAAO;EACPC;AACyB,CAAC,KAAK;EAC/B,MAAMC,OAAO,GAAGb,cAAc,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KAAK,EAAEN,kBAAkB,CAACM,KAAK;MAC/BC,MAAM,EAAEzB,cAAc,GAAGgB,aAAa,GAAG;IAC1C,CAAC,CAAC;IAEF5B,OAAO,CAACoB,iBAAiB,CAAC,CAAC,IAAI,CAAC;EACjC,CACD,CAAC;EAEDvB,eAAe,CAAC,MAAM;IACrB,OAAO,MAAM;MACZI,OAAO,CAACQ,qBAAqB,CAAC,CAACK,OAAO,CAAC;IACxC,CAAC;EACF,CAAC,EAAE,CAACA,OAAO,CAAC,CAAC;EAEb,OAAO;IACNK,cAAc;IACdH;EACD,CAAC;AACF,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["useLayoutEffect","useState","cancelAnimation","measure","runOnJS","runOnUI","useAnimatedReaction","useAnimatedRef","useSharedValue","withDelay","withTiming","useOriginContext","ScrollStore","adjustedMeasuredBoundsForOverscrollDeltas","normalizeMeasuredBoundsToOrigin","clearPortalHostBounds","setPortalHostBounds","HOST_MEASUREMENT_RETRY_DELAY_MS","useHostMeasurement","capturesScroll","enabled","hostKey","screenKey","hostRef","scrollMetadata","getValue","canRenderHosts","setCanRenderHosts","originRef","hasMeasuredHost","retryToken","get","state","hasAlreadyMeasured","measured","measuredOrigin","set","duration","currentScroll","overscrollNormalized","normalizedMeasured","x","y","width","height","pageX","pageY","scroll"],"sourceRoot":"../../../../../../../src","sources":["shared/components/boundary/portal/hooks/use-host-measurement.ts"],"mappings":";;AAAA,SAASA,eAAe,EAAEC,QAAQ,QAAQ,OAAO;AAEjD,SACCC,eAAe,EACfC,OAAO,EACPC,OAAO,EACPC,OAAO,EACPC,mBAAmB,EACnBC,cAAc,EACdC,cAAc,EACdC,SAAS,EACTC,UAAU,QACJ,yBAAyB;AAChC,SAASC,gBAAgB,QAAQ,8CAA8C;AAC/E,SAASC,WAAW,QAAQ,iCAAiC;AAC7D,SACCC,yCAAyC,EACzCC,+BAA+B,QACzB,6BAA6B;AACpC,SACCC,qBAAqB,EACrBC,mBAAmB,QACb,6BAA6B;AAEp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M,QAAQ,EAAE;MAAE,CAAC,CACjD,CACD,CAAC;MACD;IACD;IAEAnC,eAAe,CAAC4B,UAAU,CAAC;IAC3BD,eAAe,CAACO,GAAG,CAAC,IAAI,CAAC;;IAEzB;IACA;IACA;IACA,MAAME,aAAa,GAAGd,cAAc,CAACO,GAAG,CAAC,CAAC;IAC1C,MAAMQ,oBAAoB,GAAGpB,cAAc,GACxCN,yCAAyC,CAACqB,QAAQ,EAAEI,aAAa,CAAC,GAClEJ,QAAQ;IAEX,MAAMM,kBAAkB,GAAG1B,+BAA+B,CACzDyB,oBAAoB,EACpBJ,cACD,CAAC;IAEDnB,mBAAmB,CAACK,OAAO,EAAE;MAC5BoB,CAAC,EAAED,kBAAkB,CAACC,CAAC;MACvBC,CAAC,EAAEF,kBAAkB,CAACE,CAAC;MACvBC,KAAK,EAAEH,kBAAkB,CAACG,KAAK;MAC/BC,MAAM,EAAEJ,kBAAkB,CAACI,MAAM;MACjCC,KAAK,EAAEL,kBAAkB,CAACK,KAAK;MAC/BC,KAAK,EAAEN,kBAAkB,CAACM,KAAK;MAC/BC,MAAM,EAAE5B,cAAc,GAAGmB,aAAa,GAAG;IAC1C,CAAC,CAAC;IAEFlC,OAAO,CAACuB,iBAAiB,CAAC,CAAC,IAAI,CAAC;EACjC,CACD,CAAC;EAED3B,eAAe,CAAC,MAAM;IACrB,OAAO,MAAM;MACZK,OAAO,CAACU,qBAAqB,CAAC,CAACM,OAAO,CAAC;IACxC,CAAC;EACF,CAAC,EAAE,CAACA,OAAO,CAAC,CAAC;EAEb,OAAO;IACNK,cAAc;IACdH;EACD,CAAC;AACF,CAAC","ignoreList":[]}
@@ -1,19 +1,17 @@
1
1
  "use strict";
2
2
 
3
3
  import { useSyncExternalStore } from "react";
4
- import { makeMutable } from "react-native-reanimated";
5
4
  const EMPTY_SNAPSHOT = {};
6
5
  const listeners = new Set();
7
6
  const hostStacks = new Map();
8
7
  let snapshot = EMPTY_SNAPSHOT;
9
8
 
10
9
  /**
11
- * UI-readable mirror of each screen's active host, kept only for hosts that
12
- * capture scroll. Measurement worklets read it to record which scroll-scoped
13
- * host a source boundary originated from at measure time, without any React
14
- * subscription on the boundary itself.
10
+ * The active host for a screen. Stack ordering is the load-bearing invariant:
11
+ * `registerHost` unshifts fallback hosts to the front and pushes real hosts to
12
+ * the back, so the active host is the last real (non-fallback) host, falling
13
+ * back to the first entry and finally to the screen's own key.
15
14
  */
16
- const activeScrollHosts = makeMutable({});
17
15
  const getActiveHostFromStack = (screenKey, stack) => {
18
16
  if (!stack || stack.length === 0) {
19
17
  return screenKey;
@@ -33,23 +31,8 @@ const buildSnapshot = () => {
33
31
  }
34
32
  return nextSnapshot;
35
33
  };
36
- const buildScrollHostSnapshot = () => {
37
- const nextSnapshot = {};
38
- for (const [screenKey, stack] of hostStacks) {
39
- const activeHostKey = getActiveHostFromStack(screenKey, stack);
40
- const activeHost = stack.find(host => host.hostKey === activeHostKey);
41
- if (activeHost?.capturesScroll) {
42
- nextSnapshot[screenKey] = {
43
- hostKey: activeHost.hostKey,
44
- capturesScroll: true
45
- };
46
- }
47
- }
48
- return nextSnapshot;
49
- };
50
34
  const emit = () => {
51
35
  snapshot = buildSnapshot();
52
- activeScrollHosts.set(buildScrollHostSnapshot());
53
36
  for (const listener of listeners) {
54
37
  listener();
55
38
  }
@@ -95,32 +78,12 @@ export const unregisterHost = (screenKey, hostKey) => {
95
78
  export const getActiveHostKey = screenKey => {
96
79
  return snapshot[screenKey] ?? screenKey;
97
80
  };
98
-
99
- /**
100
- * The screen's active host, if it captures scroll. Worklet-safe: measurement
101
- * code calls this on the UI thread while writing source bounds.
102
- */
103
- export const getActiveScrollHost = screenKey => {
104
- "worklet";
105
-
106
- return activeScrollHosts.get()[screenKey] ?? null;
107
- };
108
- export const getHostCapturesScroll = hostKey => {
109
- for (const stack of hostStacks.values()) {
110
- const host = stack.find(registration => registration.hostKey === hostKey);
111
- if (host) {
112
- return host.capturesScroll;
113
- }
114
- }
115
- return false;
116
- };
117
81
  export const useActiveHostKey = screenKey => {
118
82
  return useSyncExternalStore(subscribe, () => screenKey ? getActiveHostKey(screenKey) : undefined, () => undefined);
119
83
  };
120
84
  export const resetHostRegistry = () => {
121
85
  hostStacks.clear();
122
86
  snapshot = EMPTY_SNAPSHOT;
123
- activeScrollHosts.set({});
124
87
  emit();
125
88
  };
126
89
  //# sourceMappingURL=host-registry.store.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["useSyncExternalStore","makeMutable","EMPTY_SNAPSHOT","listeners","Set","hostStacks","Map","snapshot","activeScrollHosts","getActiveHostFromStack","screenKey","stack","length","index","host","fallback","hostKey","buildSnapshot","nextSnapshot","buildScrollHostSnapshot","activeHostKey","activeHost","find","capturesScroll","emit","set","listener","subscribe","add","delete","registerHost","registration","get","previousActiveHostKey","nextStack","filter","unshift","push","unregisterHost","getActiveHostKey","getActiveScrollHost","getHostCapturesScroll","values","useActiveHostKey","undefined","resetHostRegistry","clear"],"sourceRoot":"../../../../../../../src","sources":["shared/components/boundary/portal/stores/host-registry.store.ts"],"mappings":";;AAAA,SAASA,oBAAoB,QAAQ,OAAO;AAC5C,SAASC,WAAW,QAAQ,yBAAyB;AAYrD,MAAMC,cAAoC,GAAG,CAAC,CAAC;AAE/C,MAAMC,SAAS,GAAG,IAAIC,GAAG,CAAa,CAAC;AACvC,MAAMC,UAAU,GAAG,IAAIC,GAAG,CAA6B,CAAC;AAExD,IAAIC,QAA8B,GAAGL,cAAc;;AAEnD;AACA;AACA;AACA;AACA;AACA;AACA,MAAMM,iBAAiB,GAAGP,WAAW,CAAgC,CAAC,CAAC,CAAC;AAExE,MAAMQ,sBAAsB,GAAGA,CAC9BC,SAAiB,EACjBC,KAAqC,KACjC;EACJ,IAAI,CAACA,KAAK,IAAIA,KAAK,CAACC,MAAM,KAAK,CAAC,EAAE;IACjC,OAAOF,SAAS;EACjB;EAEA,KAAK,IAAIG,KAAK,GAAGF,KAAK,CAACC,MAAM,GAAG,CAAC,EAAEC,KAAK,IAA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EACzBM,iBAAiB,CAACiB,GAAG,CAAC,CAAC,CAAC,CAAC;EACzBD,IAAI,CAAC,CAAC;AACP,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["useSyncExternalStore","EMPTY_SNAPSHOT","listeners","Set","hostStacks","Map","snapshot","getActiveHostFromStack","screenKey","stack","length","index","host","fallback","hostKey","buildSnapshot","nextSnapshot","emit","listener","subscribe","add","delete","registerHost","registration","get","previousActiveHostKey","nextStack","filter","unshift","push","set","unregisterHost","getActiveHostKey","useActiveHostKey","undefined","resetHostRegistry","clear"],"sourceRoot":"../../../../../../../src","sources":["shared/components/boundary/portal/stores/host-registry.store.ts"],"mappings":";;AAAA,SAASA,oBAAoB,QAAQ,OAAO;AAW5C,MAAMC,cAAoC,GAAG,CAAC,CAAC;AAE/C,MAAMC,SAAS,GAAG,IAAIC,GAAG,CAAa,CAAC;AACvC,MAAMC,UAAU,GAAG,IAAIC,GAAG,CAA6B,CAAC;AAExD,IAAIC,QAA8B,GAAGL,cAAc;;AAEnD;AACA;AACA;AACA;AACA;AACA;AACA,MAAMM,sBAAsB,GAAGA,CAC9BC,SAAiB,EACjBC,KAAqC,KACjC;EACJ,IAAI,CAACA,KAAK,IAAIA,KAAK,CAACC,MAAM,KAAK,CAAC,EAAE;IACjC,OAAOF,SAAS;EACjB;EAEA,KAAK,IAAIG,KAAK,GAAGF,KAAK,CAACC,MAAM,GAAG,CAAC,EAAEC,KAAK,IAAI,CAAC,EAAEA,KAAK,EAAE,EAAE;IACvD,MAAMC,IAAI,GAAGH,KAAK,CAACE,KAAK,CAAC;IACzB,IAAI,CAACC,IAAI,CAACC,QAAQ,EAAE;MACnB,OAAOD,IAAI,CAACE,OAAO;IACpB;EACD;EAEA,OAAOL,KAAK,CAAC,CAAC,CAAC,EAAEK,OAAO,IAAIN,SAAS;AACtC,CAAC;AAED,MAAMO,aAAa,GAAGA,CAAA,KAA4B;EACjD,MAAMC,YAAkC,GAAG,CAAC,CAAC;EAE7C,KAAK,MAAM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