react-native-screen-transitions 3.9.0-alpha.2 → 3.9.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 (475) 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 +78 -27
  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 +195 -121
  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/hooks/use-placeholder-styles.js +57 -0
  30. package/lib/commonjs/shared/components/boundary/portal/hooks/use-placeholder-styles.js.map +1 -0
  31. package/lib/commonjs/shared/components/boundary/portal/stores/host-registry.store.js +5 -44
  32. package/lib/commonjs/shared/components/boundary/portal/stores/host-registry.store.js.map +1 -1
  33. package/lib/commonjs/shared/components/boundary/portal/stores/portal-boundary-host.store.js +37 -5
  34. package/lib/commonjs/shared/components/boundary/portal/stores/portal-boundary-host.store.js.map +1 -1
  35. package/lib/commonjs/shared/components/boundary/portal/teleport.js +15 -2
  36. package/lib/commonjs/shared/components/boundary/portal/teleport.js.map +1 -1
  37. package/lib/commonjs/shared/components/boundary/portal/utils/has-local-slot.js +18 -0
  38. package/lib/commonjs/shared/components/boundary/portal/utils/has-local-slot.js.map +1 -0
  39. package/lib/commonjs/shared/components/boundary/portal/utils/naming.js +10 -3
  40. package/lib/commonjs/shared/components/boundary/portal/utils/naming.js.map +1 -1
  41. package/lib/commonjs/shared/components/boundary/portal/utils/offset-style.js +28 -48
  42. package/lib/commonjs/shared/components/boundary/portal/utils/offset-style.js.map +1 -1
  43. package/lib/commonjs/shared/components/boundary/portal/utils/ownership.js +254 -0
  44. package/lib/commonjs/shared/components/boundary/portal/utils/ownership.js.map +1 -0
  45. package/lib/commonjs/shared/components/boundary/portal/utils/resolve-portal.js +38 -0
  46. package/lib/commonjs/shared/components/boundary/portal/utils/resolve-portal.js.map +1 -0
  47. package/lib/commonjs/shared/components/boundary/portal/utils/shallow-equal.js +29 -0
  48. package/lib/commonjs/shared/components/boundary/portal/utils/shallow-equal.js.map +1 -0
  49. package/lib/commonjs/shared/components/boundary/portal/utils/teleport-control.js +10 -1
  50. package/lib/commonjs/shared/components/boundary/portal/utils/teleport-control.js.map +1 -1
  51. package/lib/commonjs/shared/components/boundary/portal/utils/visible-host.js +25 -0
  52. package/lib/commonjs/shared/components/boundary/portal/utils/visible-host.js.map +1 -0
  53. package/lib/commonjs/shared/components/boundary/providers/boundary-root.provider.js +6 -7
  54. package/lib/commonjs/shared/components/boundary/providers/boundary-root.provider.js.map +1 -1
  55. package/lib/commonjs/shared/components/boundary/utils/destination-signals.js +1 -22
  56. package/lib/commonjs/shared/components/boundary/utils/destination-signals.js.map +1 -1
  57. package/lib/commonjs/shared/components/boundary/utils/refresh-signals.js +0 -21
  58. package/lib/commonjs/shared/components/boundary/utils/refresh-signals.js.map +1 -1
  59. package/lib/commonjs/shared/components/boundary/utils/source-signals.js +4 -9
  60. package/lib/commonjs/shared/components/boundary/utils/source-signals.js.map +1 -1
  61. package/lib/commonjs/shared/components/masked-view.js +5 -0
  62. package/lib/commonjs/shared/components/masked-view.js.map +1 -1
  63. package/lib/commonjs/shared/components/screen-container/layers/backdrop.js +18 -8
  64. package/lib/commonjs/shared/components/screen-container/layers/backdrop.js.map +1 -1
  65. package/lib/commonjs/shared/components/screen-container/layers/content.js +34 -16
  66. package/lib/commonjs/shared/components/screen-container/layers/content.js.map +1 -1
  67. package/lib/commonjs/shared/components/screen-container/layers/render-component.js +10 -0
  68. package/lib/commonjs/shared/components/screen-container/layers/render-component.js.map +1 -0
  69. package/lib/commonjs/shared/components/screen-container/layers/surface-container.js +5 -3
  70. package/lib/commonjs/shared/components/screen-container/layers/surface-container.js.map +1 -1
  71. package/lib/commonjs/shared/index.js +4 -0
  72. package/lib/commonjs/shared/index.js.map +1 -1
  73. package/lib/commonjs/shared/providers/helpers/measured-bounds-writes.js +6 -3
  74. package/lib/commonjs/shared/providers/helpers/measured-bounds-writes.js.map +1 -1
  75. package/lib/commonjs/shared/providers/register-bounds.provider.js +6 -0
  76. package/lib/commonjs/shared/providers/register-bounds.provider.js.map +1 -1
  77. package/lib/commonjs/shared/providers/screen/animation/helpers/derivations.js +1 -0
  78. package/lib/commonjs/shared/providers/screen/animation/helpers/derivations.js.map +1 -1
  79. package/lib/commonjs/shared/providers/screen/animation/helpers/pipeline.js +1 -0
  80. package/lib/commonjs/shared/providers/screen/animation/helpers/pipeline.js.map +1 -1
  81. package/lib/commonjs/shared/providers/screen/styles/helpers/compose-slot-style.js +95 -0
  82. package/lib/commonjs/shared/providers/screen/styles/helpers/compose-slot-style.js.map +1 -0
  83. package/lib/commonjs/shared/providers/screen/styles/helpers/normalize-slots.js +30 -9
  84. package/lib/commonjs/shared/providers/screen/styles/helpers/normalize-slots.js.map +1 -1
  85. package/lib/commonjs/shared/providers/screen/styles/helpers/resolve-slot-styles/index.js +9 -3
  86. package/lib/commonjs/shared/providers/screen/styles/helpers/resolve-slot-styles/index.js.map +1 -1
  87. package/lib/commonjs/shared/providers/screen/styles/helpers/resolve-slot-styles/materialize-slot.js +2 -0
  88. package/lib/commonjs/shared/providers/screen/styles/helpers/resolve-slot-styles/materialize-slot.js.map +1 -1
  89. package/lib/commonjs/shared/providers/screen/styles/hooks/slot-resolvers.js +96 -0
  90. package/lib/commonjs/shared/providers/screen/styles/hooks/slot-resolvers.js.map +1 -0
  91. package/lib/commonjs/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js +16 -3
  92. package/lib/commonjs/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js.map +1 -1
  93. package/lib/commonjs/shared/providers/screen/styles/index.js +16 -3
  94. package/lib/commonjs/shared/providers/screen/styles/index.js.map +1 -1
  95. package/lib/commonjs/shared/providers/screen/styles/slot.provider.js +22 -51
  96. package/lib/commonjs/shared/providers/screen/styles/slot.provider.js.map +1 -1
  97. package/lib/commonjs/shared/providers/screen/styles/stores/slot-references.store.js +53 -0
  98. package/lib/commonjs/shared/providers/screen/styles/stores/slot-references.store.js.map +1 -0
  99. package/lib/commonjs/shared/stores/bounds/helpers/link-pairs.helpers.js +22 -2
  100. package/lib/commonjs/shared/stores/bounds/helpers/link-pairs.helpers.js.map +1 -1
  101. package/lib/commonjs/shared/stores/bounds/internals/entries.js +11 -4
  102. package/lib/commonjs/shared/stores/bounds/internals/entries.js.map +1 -1
  103. package/lib/commonjs/shared/stores/bounds/internals/links.js +134 -51
  104. package/lib/commonjs/shared/stores/bounds/internals/links.js.map +1 -1
  105. package/lib/commonjs/shared/stores/bounds/internals/resolver.js +1 -3
  106. package/lib/commonjs/shared/stores/bounds/internals/resolver.js.map +1 -1
  107. package/lib/commonjs/shared/stores/system.store.js +5 -0
  108. package/lib/commonjs/shared/stores/system.store.js.map +1 -1
  109. package/lib/commonjs/shared/utils/bounds/helpers/styles/compute.js +10 -69
  110. package/lib/commonjs/shared/utils/bounds/helpers/styles/compute.js.map +1 -1
  111. package/lib/commonjs/shared/utils/bounds/helpers/styles/local-transform.js +59 -0
  112. package/lib/commonjs/shared/utils/bounds/helpers/styles/local-transform.js.map +1 -0
  113. package/lib/module/shared/components/boundary/components/boundary-target.js +12 -7
  114. package/lib/module/shared/components/boundary/components/boundary-target.js.map +1 -1
  115. package/lib/module/shared/components/boundary/create-boundary-component.js +67 -29
  116. package/lib/module/shared/components/boundary/create-boundary-component.js.map +1 -1
  117. package/lib/module/shared/components/boundary/hooks/{use-boundary-presence.js → lifecycles/use-boundary-presence.js} +8 -4
  118. package/lib/module/shared/components/boundary/hooks/lifecycles/use-boundary-presence.js.map +1 -0
  119. package/lib/module/shared/components/boundary/hooks/{use-initial-destination-measurement.js → lifecycles/use-initial-destination-measurement.js} +27 -10
  120. package/lib/module/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js.map +1 -0
  121. package/lib/module/shared/components/boundary/hooks/{use-initial-source-measurement.js → lifecycles/use-initial-source-measurement.js} +5 -7
  122. package/lib/module/shared/components/boundary/hooks/lifecycles/use-initial-source-measurement.js.map +1 -0
  123. package/lib/module/shared/components/boundary/hooks/{use-refresh-boundary.js → lifecycles/use-refresh-boundary.js} +4 -4
  124. package/lib/module/shared/components/boundary/hooks/lifecycles/use-refresh-boundary.js.map +1 -0
  125. package/lib/module/shared/components/boundary/hooks/use-boundary-measurement.js +15 -36
  126. package/lib/module/shared/components/boundary/hooks/use-boundary-measurement.js.map +1 -1
  127. package/lib/module/shared/components/boundary/hooks/use-measurer.js +5 -6
  128. package/lib/module/shared/components/boundary/hooks/use-measurer.js.map +1 -1
  129. package/lib/module/shared/components/boundary/index.js +26 -29
  130. package/lib/module/shared/components/boundary/index.js.map +1 -1
  131. package/lib/module/shared/components/boundary/portal/components/boundary-local-portal-host.js +53 -0
  132. package/lib/module/shared/components/boundary/portal/components/boundary-local-portal-host.js.map +1 -0
  133. package/lib/module/shared/components/boundary/portal/components/host.js +21 -5
  134. package/lib/module/shared/components/boundary/portal/components/host.js.map +1 -1
  135. package/lib/module/shared/components/boundary/portal/components/portal-boundary-host.js +79 -28
  136. package/lib/module/shared/components/boundary/portal/components/portal-boundary-host.js.map +1 -1
  137. package/lib/module/shared/components/boundary/portal/components/portal.js +201 -127
  138. package/lib/module/shared/components/boundary/portal/components/portal.js.map +1 -1
  139. package/lib/module/shared/components/boundary/portal/hooks/use-host-measurement.js +15 -3
  140. package/lib/module/shared/components/boundary/portal/hooks/use-host-measurement.js.map +1 -1
  141. package/lib/module/shared/components/boundary/portal/hooks/use-placeholder-styles.js +52 -0
  142. package/lib/module/shared/components/boundary/portal/hooks/use-placeholder-styles.js.map +1 -0
  143. package/lib/module/shared/components/boundary/portal/stores/host-registry.store.js +4 -41
  144. package/lib/module/shared/components/boundary/portal/stores/host-registry.store.js.map +1 -1
  145. package/lib/module/shared/components/boundary/portal/stores/portal-boundary-host.store.js +35 -4
  146. package/lib/module/shared/components/boundary/portal/stores/portal-boundary-host.store.js.map +1 -1
  147. package/lib/module/shared/components/boundary/portal/teleport.js +16 -2
  148. package/lib/module/shared/components/boundary/portal/teleport.js.map +1 -1
  149. package/lib/module/shared/components/boundary/portal/utils/has-local-slot.js +13 -0
  150. package/lib/module/shared/components/boundary/portal/utils/has-local-slot.js.map +1 -0
  151. package/lib/module/shared/components/boundary/portal/utils/naming.js +8 -2
  152. package/lib/module/shared/components/boundary/portal/utils/naming.js.map +1 -1
  153. package/lib/module/shared/components/boundary/portal/utils/offset-style.js +29 -48
  154. package/lib/module/shared/components/boundary/portal/utils/offset-style.js.map +1 -1
  155. package/lib/module/shared/components/boundary/portal/utils/ownership.js +246 -0
  156. package/lib/module/shared/components/boundary/portal/utils/ownership.js.map +1 -0
  157. package/lib/module/shared/components/boundary/portal/utils/resolve-portal.js +33 -0
  158. package/lib/module/shared/components/boundary/portal/utils/resolve-portal.js.map +1 -0
  159. package/lib/module/shared/components/boundary/portal/utils/shallow-equal.js +24 -0
  160. package/lib/module/shared/components/boundary/portal/utils/shallow-equal.js.map +1 -0
  161. package/lib/module/shared/components/boundary/portal/utils/teleport-control.js +8 -0
  162. package/lib/module/shared/components/boundary/portal/utils/teleport-control.js.map +1 -1
  163. package/lib/module/shared/components/boundary/portal/utils/visible-host.js +20 -0
  164. package/lib/module/shared/components/boundary/portal/utils/visible-host.js.map +1 -0
  165. package/lib/module/shared/components/boundary/providers/boundary-root.provider.js +6 -7
  166. package/lib/module/shared/components/boundary/providers/boundary-root.provider.js.map +1 -1
  167. package/lib/module/shared/components/boundary/utils/destination-signals.js +2 -23
  168. package/lib/module/shared/components/boundary/utils/destination-signals.js.map +1 -1
  169. package/lib/module/shared/components/boundary/utils/refresh-signals.js +0 -21
  170. package/lib/module/shared/components/boundary/utils/refresh-signals.js.map +1 -1
  171. package/lib/module/shared/components/boundary/utils/source-signals.js +4 -9
  172. package/lib/module/shared/components/boundary/utils/source-signals.js.map +1 -1
  173. package/lib/module/shared/components/masked-view.js +5 -0
  174. package/lib/module/shared/components/masked-view.js.map +1 -1
  175. package/lib/module/shared/components/screen-container/layers/backdrop.js +19 -9
  176. package/lib/module/shared/components/screen-container/layers/backdrop.js.map +1 -1
  177. package/lib/module/shared/components/screen-container/layers/content.js +35 -17
  178. package/lib/module/shared/components/screen-container/layers/content.js.map +1 -1
  179. package/lib/module/shared/components/screen-container/layers/render-component.js +6 -0
  180. package/lib/module/shared/components/screen-container/layers/render-component.js.map +1 -0
  181. package/lib/module/shared/components/screen-container/layers/surface-container.js +5 -3
  182. package/lib/module/shared/components/screen-container/layers/surface-container.js.map +1 -1
  183. package/lib/module/shared/index.js +4 -0
  184. package/lib/module/shared/index.js.map +1 -1
  185. package/lib/module/shared/providers/helpers/measured-bounds-writes.js +6 -3
  186. package/lib/module/shared/providers/helpers/measured-bounds-writes.js.map +1 -1
  187. package/lib/module/shared/providers/register-bounds.provider.js +6 -0
  188. package/lib/module/shared/providers/register-bounds.provider.js.map +1 -1
  189. package/lib/module/shared/providers/screen/animation/helpers/derivations.js +1 -0
  190. package/lib/module/shared/providers/screen/animation/helpers/derivations.js.map +1 -1
  191. package/lib/module/shared/providers/screen/animation/helpers/pipeline.js +1 -0
  192. package/lib/module/shared/providers/screen/animation/helpers/pipeline.js.map +1 -1
  193. package/lib/module/shared/providers/screen/styles/helpers/compose-slot-style.js +89 -0
  194. package/lib/module/shared/providers/screen/styles/helpers/compose-slot-style.js.map +1 -0
  195. package/lib/module/shared/providers/screen/styles/helpers/normalize-slots.js +30 -9
  196. package/lib/module/shared/providers/screen/styles/helpers/normalize-slots.js.map +1 -1
  197. package/lib/module/shared/providers/screen/styles/helpers/resolve-slot-styles/index.js +9 -3
  198. package/lib/module/shared/providers/screen/styles/helpers/resolve-slot-styles/index.js.map +1 -1
  199. package/lib/module/shared/providers/screen/styles/helpers/resolve-slot-styles/materialize-slot.js +2 -0
  200. package/lib/module/shared/providers/screen/styles/helpers/resolve-slot-styles/materialize-slot.js.map +1 -1
  201. package/lib/module/shared/providers/screen/styles/hooks/slot-resolvers.js +87 -0
  202. package/lib/module/shared/providers/screen/styles/hooks/slot-resolvers.js.map +1 -0
  203. package/lib/module/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js +16 -3
  204. package/lib/module/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js.map +1 -1
  205. package/lib/module/shared/providers/screen/styles/index.js +2 -1
  206. package/lib/module/shared/providers/screen/styles/index.js.map +1 -1
  207. package/lib/module/shared/providers/screen/styles/slot.provider.js +22 -47
  208. package/lib/module/shared/providers/screen/styles/slot.provider.js.map +1 -1
  209. package/lib/module/shared/providers/screen/styles/stores/slot-references.store.js +47 -0
  210. package/lib/module/shared/providers/screen/styles/stores/slot-references.store.js.map +1 -0
  211. package/lib/module/shared/stores/bounds/helpers/link-pairs.helpers.js +19 -1
  212. package/lib/module/shared/stores/bounds/helpers/link-pairs.helpers.js.map +1 -1
  213. package/lib/module/shared/stores/bounds/internals/entries.js +11 -4
  214. package/lib/module/shared/stores/bounds/internals/entries.js.map +1 -1
  215. package/lib/module/shared/stores/bounds/internals/links.js +135 -53
  216. package/lib/module/shared/stores/bounds/internals/links.js.map +1 -1
  217. package/lib/module/shared/stores/bounds/internals/resolver.js +1 -3
  218. package/lib/module/shared/stores/bounds/internals/resolver.js.map +1 -1
  219. package/lib/module/shared/stores/system.store.js +5 -0
  220. package/lib/module/shared/stores/system.store.js.map +1 -1
  221. package/lib/module/shared/types/animation.types.js.map +1 -1
  222. package/lib/module/shared/utils/bounds/helpers/styles/compute.js +10 -69
  223. package/lib/module/shared/utils/bounds/helpers/styles/compute.js.map +1 -1
  224. package/lib/module/shared/utils/bounds/helpers/styles/local-transform.js +52 -0
  225. package/lib/module/shared/utils/bounds/helpers/styles/local-transform.js.map +1 -0
  226. package/lib/typescript/blank-stack/navigators/create-blank-stack-navigator.d.ts +1 -2
  227. package/lib/typescript/blank-stack/navigators/create-blank-stack-navigator.d.ts.map +1 -1
  228. package/lib/typescript/component-stack/components/component-screen.d.ts +1 -1
  229. package/lib/typescript/component-stack/components/component-screen.d.ts.map +1 -1
  230. package/lib/typescript/component-stack/navigators/create-component-stack-navigator.d.ts +1 -2
  231. package/lib/typescript/component-stack/navigators/create-component-stack-navigator.d.ts.map +1 -1
  232. package/lib/typescript/component-stack/types.d.ts +26 -0
  233. package/lib/typescript/component-stack/types.d.ts.map +1 -1
  234. package/lib/typescript/native-stack/navigators/createNativeStackNavigator.d.ts +1 -1
  235. package/lib/typescript/native-stack/navigators/createNativeStackNavigator.d.ts.map +1 -1
  236. package/lib/typescript/native-stack/views/NativeStackView.d.ts +1 -2
  237. package/lib/typescript/native-stack/views/NativeStackView.d.ts.map +1 -1
  238. package/lib/typescript/native-stack/views/useHeaderConfigProps.d.ts +2 -2
  239. package/lib/typescript/shared/adapters/with-screen-transitions/context.d.ts +1 -1
  240. package/lib/typescript/shared/adapters/with-screen-transitions/context.d.ts.map +1 -1
  241. package/lib/typescript/shared/adapters/with-screen-transitions/stack-layout.d.ts +1 -1
  242. package/lib/typescript/shared/adapters/with-screen-transitions/stack-layout.d.ts.map +1 -1
  243. package/lib/typescript/shared/components/activity/variants/activity-container.d.ts +1 -1
  244. package/lib/typescript/shared/components/activity/variants/activity-container.d.ts.map +1 -1
  245. package/lib/typescript/shared/components/activity/variants/activity-screen.d.ts +1 -1
  246. package/lib/typescript/shared/components/activity/variants/activity-screen.d.ts.map +1 -1
  247. package/lib/typescript/shared/components/boundary/components/boundary-target.d.ts +1 -1
  248. package/lib/typescript/shared/components/boundary/components/boundary-target.d.ts.map +1 -1
  249. package/lib/typescript/shared/components/boundary/create-boundary-component.d.ts +0 -1
  250. package/lib/typescript/shared/components/boundary/create-boundary-component.d.ts.map +1 -1
  251. package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-boundary-presence.d.ts +11 -0
  252. package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-boundary-presence.d.ts.map +1 -0
  253. package/lib/typescript/shared/components/boundary/hooks/{use-initial-destination-measurement.d.ts → lifecycles/use-initial-destination-measurement.d.ts} +2 -2
  254. package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.d.ts.map +1 -0
  255. package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-initial-source-measurement.d.ts +8 -0
  256. package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-initial-source-measurement.d.ts.map +1 -0
  257. package/lib/typescript/shared/components/boundary/hooks/{use-refresh-boundary.d.ts → lifecycles/use-refresh-boundary.d.ts} +2 -2
  258. package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-refresh-boundary.d.ts.map +1 -0
  259. package/lib/typescript/shared/components/boundary/hooks/use-boundary-measurement.d.ts +5 -9
  260. package/lib/typescript/shared/components/boundary/hooks/use-boundary-measurement.d.ts.map +1 -1
  261. package/lib/typescript/shared/components/boundary/hooks/use-measurer.d.ts +4 -3
  262. package/lib/typescript/shared/components/boundary/hooks/use-measurer.d.ts.map +1 -1
  263. package/lib/typescript/shared/components/boundary/index.d.ts +35 -24
  264. package/lib/typescript/shared/components/boundary/index.d.ts.map +1 -1
  265. package/lib/typescript/shared/components/boundary/portal/components/boundary-local-portal-host.d.ts +8 -0
  266. package/lib/typescript/shared/components/boundary/portal/components/boundary-local-portal-host.d.ts.map +1 -0
  267. package/lib/typescript/shared/components/boundary/portal/components/host.d.ts +2 -2
  268. package/lib/typescript/shared/components/boundary/portal/components/host.d.ts.map +1 -1
  269. package/lib/typescript/shared/components/boundary/portal/components/portal-boundary-host.d.ts +2 -2
  270. package/lib/typescript/shared/components/boundary/portal/components/portal-boundary-host.d.ts.map +1 -1
  271. package/lib/typescript/shared/components/boundary/portal/components/portal-provider.d.ts +1 -1
  272. package/lib/typescript/shared/components/boundary/portal/components/portal-provider.d.ts.map +1 -1
  273. package/lib/typescript/shared/components/boundary/portal/components/portal.d.ts +4 -3
  274. package/lib/typescript/shared/components/boundary/portal/components/portal.d.ts.map +1 -1
  275. package/lib/typescript/shared/components/boundary/portal/hooks/use-host-measurement.d.ts.map +1 -1
  276. package/lib/typescript/shared/components/boundary/portal/hooks/use-placeholder-styles.d.ts +17 -0
  277. package/lib/typescript/shared/components/boundary/portal/hooks/use-placeholder-styles.d.ts.map +1 -0
  278. package/lib/typescript/shared/components/boundary/portal/stores/host-registry.store.d.ts +0 -7
  279. package/lib/typescript/shared/components/boundary/portal/stores/host-registry.store.d.ts.map +1 -1
  280. package/lib/typescript/shared/components/boundary/portal/stores/portal-boundary-host.store.d.ts +16 -1
  281. package/lib/typescript/shared/components/boundary/portal/stores/portal-boundary-host.store.d.ts.map +1 -1
  282. package/lib/typescript/shared/components/boundary/portal/teleport.d.ts +1 -1
  283. package/lib/typescript/shared/components/boundary/portal/teleport.d.ts.map +1 -1
  284. package/lib/typescript/shared/components/boundary/portal/utils/has-local-slot.d.ts +3 -0
  285. package/lib/typescript/shared/components/boundary/portal/utils/has-local-slot.d.ts.map +1 -0
  286. package/lib/typescript/shared/components/boundary/portal/utils/naming.d.ts +2 -1
  287. package/lib/typescript/shared/components/boundary/portal/utils/naming.d.ts.map +1 -1
  288. package/lib/typescript/shared/components/boundary/portal/utils/offset-style.d.ts +23 -30
  289. package/lib/typescript/shared/components/boundary/portal/utils/offset-style.d.ts.map +1 -1
  290. package/lib/typescript/shared/components/boundary/portal/utils/ownership.d.ts +35 -0
  291. package/lib/typescript/shared/components/boundary/portal/utils/ownership.d.ts.map +1 -0
  292. package/lib/typescript/shared/components/boundary/portal/utils/resolve-portal.d.ts +12 -0
  293. package/lib/typescript/shared/components/boundary/portal/utils/resolve-portal.d.ts.map +1 -0
  294. package/lib/typescript/shared/components/boundary/portal/utils/shallow-equal.d.ts +8 -0
  295. package/lib/typescript/shared/components/boundary/portal/utils/shallow-equal.d.ts.map +1 -0
  296. package/lib/typescript/shared/components/boundary/portal/utils/teleport-control.d.ts +4 -0
  297. package/lib/typescript/shared/components/boundary/portal/utils/teleport-control.d.ts.map +1 -1
  298. package/lib/typescript/shared/components/boundary/portal/utils/visible-host.d.ts +8 -0
  299. package/lib/typescript/shared/components/boundary/portal/utils/visible-host.d.ts.map +1 -0
  300. package/lib/typescript/shared/components/boundary/providers/boundary-root.provider.d.ts +7 -12
  301. package/lib/typescript/shared/components/boundary/providers/boundary-root.provider.d.ts.map +1 -1
  302. package/lib/typescript/shared/components/boundary/types.d.ts +9 -36
  303. package/lib/typescript/shared/components/boundary/types.d.ts.map +1 -1
  304. package/lib/typescript/shared/components/boundary/utils/destination-signals.d.ts.map +1 -1
  305. package/lib/typescript/shared/components/boundary/utils/refresh-signals.d.ts.map +1 -1
  306. package/lib/typescript/shared/components/boundary/utils/source-signals.d.ts +0 -1
  307. package/lib/typescript/shared/components/boundary/utils/source-signals.d.ts.map +1 -1
  308. package/lib/typescript/shared/components/create-transition-aware-component.d.ts +6 -5
  309. package/lib/typescript/shared/components/create-transition-aware-component.d.ts.map +1 -1
  310. package/lib/typescript/shared/components/masked-view.d.ts +5 -1
  311. package/lib/typescript/shared/components/masked-view.d.ts.map +1 -1
  312. package/lib/typescript/shared/components/overlay/variations/float-overlay.d.ts +1 -1
  313. package/lib/typescript/shared/components/overlay/variations/float-overlay.d.ts.map +1 -1
  314. package/lib/typescript/shared/components/overlay/variations/overlay-host.d.ts +1 -1
  315. package/lib/typescript/shared/components/overlay/variations/overlay-host.d.ts.map +1 -1
  316. package/lib/typescript/shared/components/scene-view.d.ts +1 -1
  317. package/lib/typescript/shared/components/scene-view.d.ts.map +1 -1
  318. package/lib/typescript/shared/components/screen-container/index.d.ts +1 -1
  319. package/lib/typescript/shared/components/screen-container/index.d.ts.map +1 -1
  320. package/lib/typescript/shared/components/screen-container/layers/backdrop.d.ts +1 -1
  321. package/lib/typescript/shared/components/screen-container/layers/backdrop.d.ts.map +1 -1
  322. package/lib/typescript/shared/components/screen-container/layers/content.d.ts +1 -1
  323. package/lib/typescript/shared/components/screen-container/layers/content.d.ts.map +1 -1
  324. package/lib/typescript/shared/components/screen-container/layers/maybe-masked-navigation-container.d.ts +1 -1
  325. package/lib/typescript/shared/components/screen-container/layers/maybe-masked-navigation-container.d.ts.map +1 -1
  326. package/lib/typescript/shared/components/screen-container/layers/render-component.d.ts +3 -0
  327. package/lib/typescript/shared/components/screen-container/layers/render-component.d.ts.map +1 -0
  328. package/lib/typescript/shared/components/screen-container/layers/surface-container.d.ts +1 -1
  329. package/lib/typescript/shared/components/screen-container/layers/surface-container.d.ts.map +1 -1
  330. package/lib/typescript/shared/hooks/navigation/use-stack.d.ts +1 -1
  331. package/lib/typescript/shared/hooks/navigation/use-stack.d.ts.map +1 -1
  332. package/lib/typescript/shared/index.d.ts +731 -683
  333. package/lib/typescript/shared/index.d.ts.map +1 -1
  334. package/lib/typescript/shared/providers/helpers/measured-bounds-writes.d.ts +3 -3
  335. package/lib/typescript/shared/providers/helpers/measured-bounds-writes.d.ts.map +1 -1
  336. package/lib/typescript/shared/providers/register-bounds.provider.d.ts.map +1 -1
  337. package/lib/typescript/shared/providers/screen/animation/helpers/derivations.d.ts +1 -0
  338. package/lib/typescript/shared/providers/screen/animation/helpers/derivations.d.ts.map +1 -1
  339. package/lib/typescript/shared/providers/screen/animation/helpers/pipeline.d.ts.map +1 -1
  340. package/lib/typescript/shared/providers/screen/descriptors/descriptors.provider.d.ts +1 -1
  341. package/lib/typescript/shared/providers/screen/descriptors/descriptors.provider.d.ts.map +1 -1
  342. package/lib/typescript/shared/providers/screen/screen-composer.d.ts +1 -1
  343. package/lib/typescript/shared/providers/screen/screen-composer.d.ts.map +1 -1
  344. package/lib/typescript/shared/providers/screen/styles/components/floating-overlay-layer.d.ts +1 -1
  345. package/lib/typescript/shared/providers/screen/styles/components/floating-overlay-layer.d.ts.map +1 -1
  346. package/lib/typescript/shared/providers/screen/styles/helpers/compose-slot-style.d.ts +4 -0
  347. package/lib/typescript/shared/providers/screen/styles/helpers/compose-slot-style.d.ts.map +1 -0
  348. package/lib/typescript/shared/providers/screen/styles/helpers/normalize-slots.d.ts.map +1 -1
  349. package/lib/typescript/shared/providers/screen/styles/helpers/resolve-slot-styles/index.d.ts.map +1 -1
  350. package/lib/typescript/shared/providers/screen/styles/helpers/resolve-slot-styles/materialize-slot.d.ts +2 -1
  351. package/lib/typescript/shared/providers/screen/styles/helpers/resolve-slot-styles/materialize-slot.d.ts.map +1 -1
  352. package/lib/typescript/shared/providers/screen/styles/hooks/slot-resolvers.d.ts +11 -0
  353. package/lib/typescript/shared/providers/screen/styles/hooks/slot-resolvers.d.ts.map +1 -0
  354. package/lib/typescript/shared/providers/screen/styles/hooks/use-interpolated-style-maps.d.ts +4 -1
  355. package/lib/typescript/shared/providers/screen/styles/hooks/use-interpolated-style-maps.d.ts.map +1 -1
  356. package/lib/typescript/shared/providers/screen/styles/hooks/use-maybe-block-visibility.d.ts +3 -3
  357. package/lib/typescript/shared/providers/screen/styles/index.d.ts +2 -1
  358. package/lib/typescript/shared/providers/screen/styles/index.d.ts.map +1 -1
  359. package/lib/typescript/shared/providers/screen/styles/slot.provider.d.ts +5 -10
  360. package/lib/typescript/shared/providers/screen/styles/slot.provider.d.ts.map +1 -1
  361. package/lib/typescript/shared/providers/screen/styles/stores/slot-references.store.d.ts +6 -0
  362. package/lib/typescript/shared/providers/screen/styles/stores/slot-references.store.d.ts.map +1 -0
  363. package/lib/typescript/shared/stores/bounds/helpers/link-pairs.helpers.d.ts +2 -0
  364. package/lib/typescript/shared/stores/bounds/helpers/link-pairs.helpers.d.ts.map +1 -1
  365. package/lib/typescript/shared/stores/bounds/internals/entries.d.ts.map +1 -1
  366. package/lib/typescript/shared/stores/bounds/internals/links.d.ts +4 -3
  367. package/lib/typescript/shared/stores/bounds/internals/links.d.ts.map +1 -1
  368. package/lib/typescript/shared/stores/bounds/internals/resolver.d.ts.map +1 -1
  369. package/lib/typescript/shared/stores/bounds/types.d.ts +9 -20
  370. package/lib/typescript/shared/stores/bounds/types.d.ts.map +1 -1
  371. package/lib/typescript/shared/stores/system.store.d.ts +1 -0
  372. package/lib/typescript/shared/stores/system.store.d.ts.map +1 -1
  373. package/lib/typescript/shared/types/animation.types.d.ts +7 -1
  374. package/lib/typescript/shared/types/animation.types.d.ts.map +1 -1
  375. package/lib/typescript/shared/types/index.d.ts +1 -1
  376. package/lib/typescript/shared/types/index.d.ts.map +1 -1
  377. package/lib/typescript/shared/types/screen.types.d.ts +99 -4
  378. package/lib/typescript/shared/types/screen.types.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/bounds/helpers/styles/local-transform.d.ts +6 -0
  381. package/lib/typescript/shared/utils/bounds/helpers/styles/local-transform.d.ts.map +1 -0
  382. package/lib/typescript/shared/utils/bounds/types/options.d.ts +2 -0
  383. package/lib/typescript/shared/utils/bounds/types/options.d.ts.map +1 -1
  384. package/package.json +1 -1
  385. package/src/component-stack/types.ts +26 -0
  386. package/src/shared/components/boundary/components/boundary-target.tsx +21 -7
  387. package/src/shared/components/boundary/create-boundary-component.tsx +92 -28
  388. package/src/shared/components/boundary/hooks/{use-boundary-presence.ts → lifecycles/use-boundary-presence.ts} +16 -5
  389. package/src/shared/components/boundary/hooks/{use-initial-destination-measurement.ts → lifecycles/use-initial-destination-measurement.ts} +40 -13
  390. package/src/shared/components/boundary/hooks/{use-initial-source-measurement.ts → lifecycles/use-initial-source-measurement.ts} +7 -9
  391. package/src/shared/components/boundary/hooks/{use-refresh-boundary.ts → lifecycles/use-refresh-boundary.ts} +6 -6
  392. package/src/shared/components/boundary/hooks/use-boundary-measurement.ts +15 -45
  393. package/src/shared/components/boundary/hooks/use-measurer.ts +9 -14
  394. package/src/shared/components/boundary/index.tsx +55 -29
  395. package/src/shared/components/boundary/portal/components/boundary-local-portal-host.tsx +66 -0
  396. package/src/shared/components/boundary/portal/components/host.tsx +20 -5
  397. package/src/shared/components/boundary/portal/components/portal-boundary-host.tsx +112 -46
  398. package/src/shared/components/boundary/portal/components/portal.tsx +263 -134
  399. package/src/shared/components/boundary/portal/hooks/use-host-measurement.ts +23 -2
  400. package/src/shared/components/boundary/portal/hooks/use-placeholder-styles.ts +55 -0
  401. package/src/shared/components/boundary/portal/stores/host-registry.store.ts +4 -51
  402. package/src/shared/components/boundary/portal/stores/portal-boundary-host.store.ts +59 -6
  403. package/src/shared/components/boundary/portal/teleport.ts +28 -3
  404. package/src/shared/components/boundary/portal/utils/has-local-slot.ts +16 -0
  405. package/src/shared/components/boundary/portal/utils/naming.ts +11 -1
  406. package/src/shared/components/boundary/portal/utils/offset-style.ts +42 -137
  407. package/src/shared/components/boundary/portal/utils/ownership.ts +371 -0
  408. package/src/shared/components/boundary/portal/utils/resolve-portal.ts +50 -0
  409. package/src/shared/components/boundary/portal/utils/shallow-equal.ts +25 -0
  410. package/src/shared/components/boundary/portal/utils/teleport-control.ts +12 -0
  411. package/src/shared/components/boundary/portal/utils/visible-host.ts +24 -0
  412. package/src/shared/components/boundary/providers/boundary-root.provider.tsx +9 -18
  413. package/src/shared/components/boundary/types.ts +9 -39
  414. package/src/shared/components/boundary/utils/destination-signals.ts +1 -32
  415. package/src/shared/components/boundary/utils/refresh-signals.ts +0 -41
  416. package/src/shared/components/boundary/utils/source-signals.ts +5 -17
  417. package/src/shared/components/masked-view.tsx +4 -0
  418. package/src/shared/components/screen-container/layers/backdrop.tsx +31 -10
  419. package/src/shared/components/screen-container/layers/content.tsx +61 -22
  420. package/src/shared/components/screen-container/layers/render-component.ts +9 -0
  421. package/src/shared/components/screen-container/layers/surface-container.tsx +5 -4
  422. package/src/shared/index.ts +9 -5
  423. package/src/shared/providers/helpers/measured-bounds-writes.ts +6 -11
  424. package/src/shared/providers/register-bounds.provider.tsx +5 -0
  425. package/src/shared/providers/screen/animation/helpers/derivations.ts +3 -0
  426. package/src/shared/providers/screen/animation/helpers/pipeline.ts +1 -0
  427. package/src/shared/providers/screen/styles/helpers/compose-slot-style.ts +129 -0
  428. package/src/shared/providers/screen/styles/helpers/normalize-slots.ts +45 -8
  429. package/src/shared/providers/screen/styles/helpers/resolve-slot-styles/index.ts +14 -2
  430. package/src/shared/providers/screen/styles/helpers/resolve-slot-styles/materialize-slot.ts +3 -0
  431. package/src/shared/providers/screen/styles/hooks/slot-resolvers.tsx +111 -0
  432. package/src/shared/providers/screen/styles/hooks/use-interpolated-style-maps.tsx +21 -3
  433. package/src/shared/providers/screen/styles/index.tsx +8 -3
  434. package/src/shared/providers/screen/styles/slot.provider.tsx +36 -54
  435. package/src/shared/providers/screen/styles/stores/slot-references.store.ts +71 -0
  436. package/src/shared/stores/bounds/helpers/link-pairs.helpers.ts +24 -1
  437. package/src/shared/stores/bounds/internals/entries.ts +13 -5
  438. package/src/shared/stores/bounds/internals/links.ts +167 -85
  439. package/src/shared/stores/bounds/internals/resolver.ts +0 -2
  440. package/src/shared/stores/bounds/types.ts +10 -22
  441. package/src/shared/stores/system.store.ts +6 -0
  442. package/src/shared/types/animation.types.ts +8 -1
  443. package/src/shared/types/index.ts +5 -0
  444. package/src/shared/types/screen.types.ts +111 -4
  445. package/src/shared/utils/bounds/helpers/styles/compute.ts +22 -124
  446. package/src/shared/utils/bounds/helpers/styles/local-transform.ts +86 -0
  447. package/src/shared/utils/bounds/types/options.ts +2 -0
  448. package/lib/commonjs/shared/components/boundary/hooks/use-boundary-presence.js.map +0 -1
  449. package/lib/commonjs/shared/components/boundary/hooks/use-initial-destination-measurement.js.map +0 -1
  450. package/lib/commonjs/shared/components/boundary/hooks/use-initial-source-measurement.js.map +0 -1
  451. package/lib/commonjs/shared/components/boundary/hooks/use-refresh-boundary.js.map +0 -1
  452. package/lib/commonjs/shared/components/boundary/portal/resolve-portal.js +0 -36
  453. package/lib/commonjs/shared/components/boundary/portal/resolve-portal.js.map +0 -1
  454. package/lib/commonjs/shared/components/boundary/portal/utils/attachment.js +0 -40
  455. package/lib/commonjs/shared/components/boundary/portal/utils/attachment.js.map +0 -1
  456. package/lib/module/shared/components/boundary/hooks/use-boundary-presence.js.map +0 -1
  457. package/lib/module/shared/components/boundary/hooks/use-initial-destination-measurement.js.map +0 -1
  458. package/lib/module/shared/components/boundary/hooks/use-initial-source-measurement.js.map +0 -1
  459. package/lib/module/shared/components/boundary/hooks/use-refresh-boundary.js.map +0 -1
  460. package/lib/module/shared/components/boundary/portal/resolve-portal.js +0 -31
  461. package/lib/module/shared/components/boundary/portal/resolve-portal.js.map +0 -1
  462. package/lib/module/shared/components/boundary/portal/utils/attachment.js +0 -35
  463. package/lib/module/shared/components/boundary/portal/utils/attachment.js.map +0 -1
  464. package/lib/typescript/shared/components/boundary/hooks/use-boundary-presence.d.ts +0 -9
  465. package/lib/typescript/shared/components/boundary/hooks/use-boundary-presence.d.ts.map +0 -1
  466. package/lib/typescript/shared/components/boundary/hooks/use-initial-destination-measurement.d.ts.map +0 -1
  467. package/lib/typescript/shared/components/boundary/hooks/use-initial-source-measurement.d.ts +0 -9
  468. package/lib/typescript/shared/components/boundary/hooks/use-initial-source-measurement.d.ts.map +0 -1
  469. package/lib/typescript/shared/components/boundary/hooks/use-refresh-boundary.d.ts.map +0 -1
  470. package/lib/typescript/shared/components/boundary/portal/resolve-portal.d.ts +0 -14
  471. package/lib/typescript/shared/components/boundary/portal/resolve-portal.d.ts.map +0 -1
  472. package/lib/typescript/shared/components/boundary/portal/utils/attachment.d.ts +0 -21
  473. package/lib/typescript/shared/components/boundary/portal/utils/attachment.d.ts.map +0 -1
  474. package/src/shared/components/boundary/portal/resolve-portal.ts +0 -40
  475. package/src/shared/components/boundary/portal/utils/attachment.ts +0 -48
@@ -1,191 +1,265 @@
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, 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 { usePlaceholderStyles } from "../hooks/use-placeholder-styles";
13
+ import { useActiveHostKey } from "../stores/host-registry.store";
14
+ import { dropStalePortalBoundaryHosts, mountPortalBoundaryHost, unmountPortalBoundaryHost } from "../stores/portal-boundary-host.store";
14
15
  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;
16
+ import { createBoundaryLocalPortalHostName, createPortalBoundaryHostName, PORTAL_HOST_NAME_RESET_VALUE } from "../utils/naming";
17
+ import { canSwitchBoundaryLocalHandoffImmediately, resolveBoundaryPortalOwnership } from "../utils/ownership";
18
+ import { shallowEqual } from "../utils/shallow-equal";
19
+ import { shouldAttachBoundaryPortal } from "../utils/teleport-control";
20
+ import { resolveNextVisiblePortalHostName } from "../utils/visible-host";
21
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
22
+ const AnimatedNativePortal = NativePortal ? Animated.createAnimatedComponent(NativePortal) : null;
20
23
  export const Portal = /*#__PURE__*/memo(function Portal({
21
- id = "my-id",
24
+ id,
22
25
  children,
23
- mode = false,
24
- placeholderRef
26
+ handoff = false,
27
+ escapeClipping = false,
28
+ placeholderRef,
29
+ placeholderChildren
25
30
  }) {
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();
31
+ // Teleporting requires the optional `react-native-teleport` peer and a stable
32
+ // `id` to name the boundary host. Missing either degrades to inline rendering
33
+ // (the `return children` path below).
34
+ const isPortalEnabled = (handoff || escapeClipping) && isTeleportAvailable && id !== undefined;
35
+ if (__DEV__ && (handoff || escapeClipping) && id === undefined) {
36
+ logger.warnOnce("portal:missing-id", "A handoff or escapeClipping boundary was rendered without an id; rendering inline.");
37
+ }
38
+ const boundaryId = id ?? "";
39
+ const ownScreenSlots = useScreenSlots();
34
40
  const sourcePairKey = useDescriptorsStore(s => s.derivations.sourcePairKey);
35
41
  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);
39
- const placeholderWidth = useSharedValue(0);
40
- const placeholderHeight = useSharedValue(0);
42
+ const [ownership, setOwnership] = useState(null);
43
+ const styleOwnerScreenKey = ownership?.ownerScreenKey ?? currentScreenKey;
44
+ const ownerScreenSlots = useRegisteredScreenSlots(styleOwnerScreenKey);
45
+ const activeScreenSlots = ownerScreenSlots ?? ownScreenSlots;
41
46
  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) {
47
+ localStylesMaps: activeLocalStylesMaps,
48
+ nextInterpolatorReady: activeNextInterpolatorReady,
49
+ slotsMap: activeSlotsMap
50
+ } = activeScreenSlots;
51
+ const requestedPortalHostName = useSharedValue(null);
52
+ const visiblePortalHostName = useSharedValue(null);
53
+ const canSwitchPortalHostImmediately = useSharedValue(0);
54
+ const targetScreenKey = ownership ? ownership.hostScreenKey : null;
55
+ const settledHostScreenKey = ownership?.hostScreenKey ?? null;
56
+ const settledHostProgress = AnimationStore.getValue(settledHostScreenKey ?? currentScreenKey, "progressSettled");
57
+ const settledHostAnimating = AnimationStore.getValue(settledHostScreenKey ?? currentScreenKey, "progressAnimating");
58
+ const settledHostClosing = AnimationStore.getValue(settledHostScreenKey ?? currentScreenKey, "closing");
59
+ const settledHostVisualProgress = AnimationStore.getValue(settledHostScreenKey ?? currentScreenKey, "visualProgress");
60
+ const activeHostKey = useActiveHostKey(escapeClipping ? targetScreenKey : null);
61
+ const boundaryLocalHostName = handoff && !escapeClipping && targetScreenKey ? createBoundaryLocalPortalHostName(targetScreenKey, boundaryId) : null;
62
+ const updatePortalOwnership = useCallback((hostScreenKey, ownerPairKey, ownerScreenKey) => {
63
+ if (hostScreenKey && ownerPairKey && ownerScreenKey) {
64
+ setOwnership(current => {
65
+ if (current?.hostScreenKey === hostScreenKey && current.ownerPairKey === ownerPairKey && current.ownerScreenKey === ownerScreenKey) {
59
66
  return current;
60
67
  }
61
68
  return {
62
- matchedScreenKey,
63
- pairKey
69
+ hostScreenKey,
70
+ ownerPairKey,
71
+ ownerScreenKey,
72
+ status: "complete"
64
73
  };
65
74
  });
66
75
  return;
67
76
  }
68
- setAttachment(current => current ? null : current);
77
+ setOwnership(current => current ? null : current);
69
78
  }, []);
70
79
  useLayoutEffect(() => {
71
- if (!isPortalEnabled || !attachment || !activeHostKey || !targetScreenKey) {
72
- attachedHostName.set(PORTAL_HOST_NAME_RESET_VALUE);
80
+ if (!isPortalEnabled || !ownership || !targetScreenKey) {
81
+ requestedPortalHostName.set(null);
82
+ visiblePortalHostName.set(null);
83
+ unmountPortalBoundaryHost(boundaryId);
73
84
  return;
74
85
  }
86
+ if (boundaryLocalHostName) {
87
+ requestedPortalHostName.set(boundaryLocalHostName);
88
+ unmountPortalBoundaryHost(boundaryId);
89
+ return;
90
+ }
91
+ if (!escapeClipping || !activeHostKey) {
92
+ requestedPortalHostName.set(null);
93
+ visiblePortalHostName.set(null);
94
+ unmountPortalBoundaryHost(boundaryId);
95
+ return;
96
+ }
97
+ const portalHostName = createPortalBoundaryHostName(activeHostKey, boundaryId, ownership.ownerPairKey);
75
98
  mountPortalBoundaryHost({
76
- boundaryId: id,
77
- capturesScroll: activeHostCapturesScroll,
99
+ boundaryId,
100
+ escapeClipping,
78
101
  hostKey: activeHostKey,
79
- pairKey: attachment.pairKey,
80
- screenKey: targetScreenKey
102
+ localStylesMaps: activeLocalStylesMaps,
103
+ pairKey: ownership.ownerPairKey,
104
+ portalHostName,
105
+ screenKey: targetScreenKey,
106
+ slotsMap: activeSlotsMap
81
107
  });
82
108
 
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]);
109
+ // Request the new receiver immediately, but keep the currently visible
110
+ // receiver until the new interpolator is ready. This avoids a no-host gap
111
+ // during A -> B(closing) -> C(opening) spam retargets.
112
+ requestedPortalHostName.set(portalHostName);
113
+ }, [activeHostKey, boundaryId, escapeClipping, isPortalEnabled, activeLocalStylesMaps, activeSlotsMap, ownership, boundaryLocalHostName, requestedPortalHostName, targetScreenKey, visiblePortalHostName]);
89
114
  useLayoutEffect(() => {
90
115
  return () => {
91
- attachedHostName.set(PORTAL_HOST_NAME_RESET_VALUE);
92
- unmountPortalBoundaryHost(id);
116
+ requestedPortalHostName.set(null);
117
+ visiblePortalHostName.set(null);
118
+ unmountPortalBoundaryHost(boundaryId);
93
119
  };
94
- }, [attachedHostName, id]);
120
+ }, [boundaryId, requestedPortalHostName, visiblePortalHostName]);
95
121
  useAnimatedReaction(() => {
96
122
  "worklet";
97
123
 
98
124
  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;
125
+ return {
126
+ hostScreenKey: null,
127
+ ownerPairKey: sourcePairKey,
128
+ ownerScreenKey: null,
129
+ status: "clear"
130
+ };
109
131
  }
132
+ return resolveBoundaryPortalOwnership({
133
+ boundaryId,
134
+ currentScreenKey,
135
+ escapeClipping,
136
+ handoff,
137
+ isSettledHostClosingComplete: !!settledHostClosing.get() && settledHostVisualProgress.get() <= EPSILON,
138
+ isSettledHostReady: settledHostProgress.get() === 1 && settledHostAnimating.get() === 0,
139
+ pairsState: pairs.get(),
140
+ settledHostScreenKey,
141
+ sourcePairKey
142
+ });
143
+ }, (signal, previousSignal) => {
144
+ "worklet";
110
145
 
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;
146
+ if (shallowEqual(previousSignal, signal)) {
147
+ return;
148
+ }
149
+ if (!handoff || escapeClipping) {
150
+ canSwitchPortalHostImmediately.set(0);
151
+ } else if (signal.status === "pending") {
152
+ canSwitchPortalHostImmediately.set(0);
153
+ return;
154
+ } else {
155
+ const hostScreenKey = signal.status === "complete" ? signal.hostScreenKey : null;
156
+ let previousOwnerPairKey;
157
+ if (previousSignal?.status === "complete") {
158
+ previousOwnerPairKey = previousSignal.ownerPairKey ?? undefined;
159
+ }
160
+ const canSwitchImmediately = canSwitchBoundaryLocalHandoffImmediately({
161
+ hostScreenKey,
162
+ ownerPairKey: signal.status === "complete" ? signal.ownerPairKey : undefined,
163
+ previousOwnerPairKey
164
+ });
165
+ canSwitchPortalHostImmediately.set(canSwitchImmediately ? 1 : 0);
166
+ if (canSwitchImmediately && hostScreenKey) {
167
+ const hostName = createBoundaryLocalPortalHostName(hostScreenKey, boundaryId);
168
+ requestedPortalHostName.set(hostName);
169
+ visiblePortalHostName.set(hostName);
119
170
  }
120
171
  }
121
- return link.destination.screenKey;
122
- }, (matchedScreenKey, previousMatchedScreenKey) => {
172
+ runOnJS(updatePortalOwnership)(signal.hostScreenKey, signal.ownerPairKey, signal.ownerScreenKey ?? undefined);
173
+ });
174
+ useAnimatedReaction(() => {
175
+ "worklet";
176
+
177
+ const slot = activeSlotsMap.get()[boundaryId];
178
+ const teleport = slot?.props?.teleport;
179
+ const shouldTeleport = shouldAttachBoundaryPortal({
180
+ enabled: isPortalEnabled,
181
+ teleport
182
+ });
183
+ const requestedName = requestedPortalHostName.get();
184
+ const visibleName = visiblePortalHostName.get();
185
+ const isInterpolatorReady = activeNextInterpolatorReady.get();
186
+ const nextVisibleName = resolveNextVisiblePortalHostName({
187
+ canSwitchImmediately: canSwitchPortalHostImmediately.get() === 1,
188
+ isInterpolatorReady: isInterpolatorReady === 1,
189
+ requestedName,
190
+ shouldTeleport,
191
+ visibleName
192
+ });
193
+ return {
194
+ isInterpolatorReady,
195
+ nextVisibleName,
196
+ requestedName,
197
+ shouldTeleport,
198
+ teleport,
199
+ visibleName
200
+ };
201
+ }, (state, previousState) => {
123
202
  "worklet";
124
203
 
125
- if (matchedScreenKey === previousMatchedScreenKey) {
204
+ if (shallowEqual(previousState, state)) {
126
205
  return;
127
206
  }
128
- runOnJS(updatePortalAttachment)(matchedScreenKey, sourcePairKey);
207
+ if (state.nextVisibleName !== state.visibleName) {
208
+ visiblePortalHostName.set(state.nextVisibleName);
209
+ return;
210
+ }
211
+
212
+ // Visible receiver has caught up to the request: GC the superseded hosts.
213
+ if (state.visibleName && state.visibleName === state.requestedName) {
214
+ runOnJS(dropStalePortalBoundaryHosts)({
215
+ boundaryId,
216
+ keepPortalHostName: state.visibleName
217
+ });
218
+ }
129
219
  });
130
220
  const teleportProps = useAnimatedProps(() => {
131
221
  "worklet";
132
222
 
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;
223
+ const slot = activeSlotsMap.get()[boundaryId];
137
224
  const {
138
225
  teleport,
139
226
  ...slotProps
140
- } = slotsMap.get()[id]?.props ?? {};
141
- const shouldTeleport = isTeleportEnabled(teleport);
227
+ } = slot?.props ?? {};
228
+ const shouldTeleport = shouldAttachBoundaryPortal({
229
+ enabled: isPortalEnabled,
230
+ teleport
231
+ });
232
+ const visibleName = visiblePortalHostName.get();
142
233
  return {
143
234
  // Preserve portal slot props from the interpolator while keeping
144
- // hostName owned by the attachment gate below.
235
+ // hostName owned by the attachment gate below. Handoff
236
+ // waits until the receiving interpolator owns styles for the same host;
237
+ // after that, it stays attached until teleport is disabled or retargeted.
145
238
  ...slotProps,
146
- hostName: shouldTeleport && progress.get() >= attachThreshold ? attachedHostName.get() : PORTAL_HOST_NAME_RESET_VALUE
239
+ hostName: shouldTeleport && visibleName ? visibleName : PORTAL_HOST_NAME_RESET_VALUE
147
240
  };
148
241
  });
149
-
150
- // Pin the placeholder to its measured size while content lives in the host,
151
- // in the same UI frame the host name flips — no commit in between. Until the
152
- // first layout lands (dims 0) sizing stays natural so an instant attach
153
- // cannot collapse the slot.
154
- const placeholderStyle = useAnimatedStyle(() => {
155
- "worklet";
156
-
157
- const hostName = attachedHostName.get();
158
- const isAttached = hostName !== null;
159
- const width = placeholderWidth.get();
160
- const height = placeholderHeight.get();
161
- if (!isAttached || width === 0) {
162
- return {
163
- width: "auto",
164
- height: "auto"
165
- };
166
- }
167
- return {
168
- width,
169
- height
170
- };
242
+ const {
243
+ handleOnLayout,
244
+ placeholderStyle
245
+ } = usePlaceholderStyles({
246
+ visiblePortalHostName
171
247
  });
172
- if (isPortalEnabled && TransitionAwareTeleport) {
173
- return /*#__PURE__*/_jsx(Animated.View, {
248
+ if (isPortalEnabled && AnimatedNativePortal) {
249
+ return /*#__PURE__*/_jsxs(Animated.View, {
174
250
  ref: placeholderRef,
175
- onLayout: event => {
176
- placeholderWidth.set(event.nativeEvent.layout.width);
177
- placeholderHeight.set(event.nativeEvent.layout.height);
178
- },
251
+ onLayout: ({
252
+ nativeEvent: {
253
+ layout
254
+ }
255
+ }) => runOnUI(handleOnLayout)(layout),
179
256
  style: placeholderStyle,
180
257
  collapsable: false,
181
- children: /*#__PURE__*/_jsx(TransitionAwareTeleport, {
258
+ children: [placeholderChildren, /*#__PURE__*/_jsx(AnimatedNativePortal, {
182
259
  animatedProps: teleportProps,
183
- name: id,
184
- children: /*#__PURE__*/_jsx(Animated.View, {
185
- style: placeholderStyle,
186
- children: children
187
- })
188
- })
260
+ name: boundaryId,
261
+ children: children
262
+ })]
189
263
  });
190
264
  }
191
265
  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,QAAQ,IAEdC,OAAO,EACPC,gBAAgB,EAChBC,mBAAmB,EACnBC,gBAAgB,EAChBC,cAAc,QACR,yBAAyB;AAChC,SAASC,mBAAmB,QAAQ,0CAA0C;AAC9E,SAASC,cAAc,QAAQ,qCAAqC;AACpE,SAASC,cAAc,QAAQ,oCAAoC;AACnE,SAASC,iBAAiB,QAAQ,sDAAsD;AACxF,SAASC,OAAO,QAAQ,2CAA2C;AACnE,SAASC,KAAK,QAAQ,2CAA2C;AACjE,SAASC,8BAA8B,QAAQ,4CAA4C;AAE3F,SACCC,qBAAqB,EACrBC,gBAAg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O,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","useSharedValue","EPSILON","useDescriptorsStore","useScreenSlots","useRegisteredScreenSlots","AnimationStore","pairs","logger","usePlaceholderStyles","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","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","handleOnLayout","placeholderStyle","View","ref","onLayout","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,QAAQ,IAEdC,OAAO,EACPC,OAAO,EACPC,gBAAgB,EAChBC,mBAAmB,EACnBC,cAAc,QACR,yBAAyB;AAChC,SAASC,OAAO,QAAQ,uBAAuB;AAC/C,SAASC,mBAAmB,QAAQ,0CAA0C;AAC9E,SAASC,cAAc,QAAQ,qCAAqC;AACpE,SAASC,wBAAwB,QAAQ,kEAAkE;AAC3G,SAASC,cAAc,QAAQ,oCAAoC;AACnE,SAASC,KAAK,QAAQ,2CAA2C;AACjE,SAASC,MAAM,QAAQ,0BAA0B;AACjD,SAASC,oBAAoB,QAAQ,iCAAiC;AACtE,SAASC,gBAAgB,QAAQ,+BAA+B;AAChE,SACCC,4BAA4B,EAC5BC,uBAAuB,EACvBC,yBAAyB,QACnB,sCAAsC;A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AC,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,CAAO,CAAC;EACtC,MAAMc,cAAc,GAAGX,WAAW,CAACY,QAAQ,CAACH,SAAS,EAAE,UAAU,CAAC;EAClE,MAAM,CAACI,cAAc,EAAEC,iBAAiB,CAAC,GAAGtB,QAAQ,CAAU,KAAK,CAAC;EACpE,MAAM;IAAEuB;EAAU,CAAC,GAAGhB,gBAAgB,CAAC,CAAC;EACxC,MAAMiB,eAAe,GAAGlB,cAAc,CAAC,KAAK,CAAC;EAE7CF,mBAAmB,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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;AAEpC,MAAMC,+BAA+B,GAAG,EAAE;AAS1C,OAAO,MAAMC,kBAAkB,GAAGA,CAAC;EAClCC,cAAc;EACdC,OAAO;EACPC,OAAO;EACPC;AACyB,CAAC,KAAK;EAC/B,MAAMC,OAAO,GAAGhB,cAAc,CAAO,CAAC;EACtC,MAAMiB,cAAc,GAAGZ,WAAW,CAACa,QAAQ,CAACH,SAAS,EAAE,UAAU,CAAC;EAClE,MAAM,CAACI,cAAc,EAAEC,iBAAiB,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J,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":[]}
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+
3
+ import { useCallback } from "react";
4
+ import { useAnimatedStyle, useSharedValue } from "react-native-reanimated";
5
+ export const usePlaceholderStyles = ({
6
+ visiblePortalHostName
7
+ }) => {
8
+ const placeholderWidth = useSharedValue(0);
9
+ const placeholderHeight = useSharedValue(0);
10
+ // Pin the placeholder to its measured size while content lives in the host,
11
+ // in the same UI frame the host name flips — no commit in between. Until the
12
+ // first layout lands (dims 0) sizing stays natural so an instant attach
13
+ // cannot collapse the slot.
14
+ const placeholderStyle = useAnimatedStyle(() => {
15
+ "worklet";
16
+
17
+ const isAttached = visiblePortalHostName.get() !== null;
18
+ const width = placeholderWidth.get();
19
+ const height = placeholderHeight.get();
20
+ if (!isAttached || width === 0) {
21
+ return {
22
+ width: "auto",
23
+ height: "auto"
24
+ };
25
+ }
26
+ return {
27
+ width,
28
+ height
29
+ };
30
+ });
31
+ const handleOnLayout = useCallback(layout => {
32
+ "worklet";
33
+
34
+ const {
35
+ width,
36
+ height
37
+ } = layout;
38
+ if (width === 0 || height === 0) {
39
+ return;
40
+ }
41
+ const hasValidDimensions = placeholderHeight.get() !== 0 && placeholderWidth.get() !== 0;
42
+ if (!hasValidDimensions) {
43
+ placeholderWidth.set(width);
44
+ placeholderHeight.set(height);
45
+ }
46
+ }, [placeholderHeight, placeholderWidth]);
47
+ return {
48
+ placeholderStyle,
49
+ handleOnLayout
50
+ };
51
+ };
52
+ //# sourceMappingURL=use-placeholder-styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useCallback","useAnimatedStyle","useSharedValue","usePlaceholderStyles","visiblePortalHostName","placeholderWidth","placeholderHeight","placeholderStyle","isAttached","get","width","height","handleOnLayout","layout","hasValidDimensions","set"],"sourceRoot":"../../../../../../../src","sources":["shared/components/boundary/portal/hooks/use-placeholder-styles.ts"],"mappings":";;AAAA,SAASA,WAAW,QAAQ,OAAO;AAEnC,SAECC,gBAAgB,EAChBC,cAAc,QACR,yBAAyB;AAMhC,OAAO,MAAMC,oBAAoB,GAAGA,CAAC;EACpCC;AACoB,CAAC,KAAK;EAC1B,MAAMC,gBAAgB,GAAGH,cAAc,CAAC,CAAC,CAAC;EAC1C,MAAMI,iBAAiB,GAAGJ,cAAc,CAAC,CAAC,CAAC;EAC3C;EACA;EACA;EACA;EACA,MAAMK,gBAAgB,GAAGN,gBAAgB,CAAC,MAAM;IAC/C,SAAS;;IACT,MAAMO,UAAU,GAAGJ,qBAAqB,CAACK,GAAG,CAAC,CAAC,KAAK,IAAI;IACvD,MAAMC,KAAK,GAAGL,gBAAgB,CAACI,GAAG,CAAC,CAAC;IACpC,MAAME,MAAM,GAAGL,iBAAiB,CAACG,GAAG,CAAC,CAAC;IAEtC,IAAI,CAACD,UAAU,IAAIE,KAAK,KAAK,CAAC,EAAE;MAC/B,O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