react-native-screen-transitions 3.8.0-beta.1 → 3.9.0-alpha.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 (485) hide show
  1. package/lib/commonjs/blank-stack/components/stack-view.js +2 -1
  2. package/lib/commonjs/blank-stack/components/stack-view.js.map +1 -1
  3. package/lib/commonjs/shared/components/{create-boundary-component → boundary}/components/boundary-target.js +21 -8
  4. package/lib/commonjs/shared/components/boundary/components/boundary-target.js.map +1 -0
  5. package/lib/commonjs/shared/components/{create-boundary-component → boundary}/create-boundary-component.js +10 -24
  6. package/lib/commonjs/shared/components/boundary/create-boundary-component.js.map +1 -0
  7. package/lib/commonjs/shared/components/boundary/hooks/use-boundary-presence.js.map +1 -0
  8. package/lib/commonjs/shared/components/boundary/hooks/use-initial-destination-measurement.js +115 -0
  9. package/lib/commonjs/shared/components/boundary/hooks/use-initial-destination-measurement.js.map +1 -0
  10. package/lib/commonjs/shared/components/{create-boundary-component → boundary}/hooks/use-initial-source-measurement.js +4 -5
  11. package/lib/commonjs/shared/components/boundary/hooks/use-initial-source-measurement.js.map +1 -0
  12. package/lib/commonjs/shared/components/{create-boundary-component → boundary}/hooks/use-measurer.js +26 -22
  13. package/lib/commonjs/shared/components/boundary/hooks/use-measurer.js.map +1 -0
  14. package/lib/commonjs/shared/components/{create-boundary-component → boundary}/hooks/use-refresh-boundary.js +10 -7
  15. package/lib/commonjs/shared/components/boundary/hooks/use-refresh-boundary.js.map +1 -0
  16. package/lib/commonjs/shared/components/{create-boundary-component → boundary}/index.js +8 -1
  17. package/lib/commonjs/shared/components/boundary/index.js.map +1 -0
  18. package/lib/commonjs/shared/components/boundary/portal/components/host.js +99 -0
  19. package/lib/commonjs/shared/components/boundary/portal/components/host.js.map +1 -0
  20. package/lib/commonjs/shared/components/boundary/portal/components/portal-boundary-host.js +68 -0
  21. package/lib/commonjs/shared/components/boundary/portal/components/portal-boundary-host.js.map +1 -0
  22. package/lib/commonjs/shared/components/boundary/portal/components/portal-provider.js +17 -0
  23. package/lib/commonjs/shared/components/boundary/portal/components/portal-provider.js.map +1 -0
  24. package/lib/commonjs/shared/components/boundary/portal/components/portal.js +195 -0
  25. package/lib/commonjs/shared/components/boundary/portal/components/portal.js.map +1 -0
  26. package/lib/commonjs/shared/components/boundary/portal/hooks/use-host-measurement.js +74 -0
  27. package/lib/commonjs/shared/components/boundary/portal/hooks/use-host-measurement.js.map +1 -0
  28. package/lib/commonjs/shared/components/boundary/portal/index.js +27 -0
  29. package/lib/commonjs/shared/components/boundary/portal/index.js.map +1 -0
  30. package/lib/commonjs/shared/components/boundary/portal/stores/host-bounds.store.js +47 -0
  31. package/lib/commonjs/shared/components/boundary/portal/stores/host-bounds.store.js.map +1 -0
  32. package/lib/commonjs/shared/components/boundary/portal/stores/host-registry.store.js +137 -0
  33. package/lib/commonjs/shared/components/boundary/portal/stores/host-registry.store.js.map +1 -0
  34. package/lib/commonjs/shared/components/boundary/portal/stores/portal-boundary-host.store.js +60 -0
  35. package/lib/commonjs/shared/components/boundary/portal/stores/portal-boundary-host.store.js.map +1 -0
  36. package/lib/commonjs/shared/components/boundary/portal/utils/attachment.js +40 -0
  37. package/lib/commonjs/shared/components/boundary/portal/utils/attachment.js.map +1 -0
  38. package/lib/commonjs/shared/components/boundary/portal/utils/naming.js +15 -0
  39. package/lib/commonjs/shared/components/boundary/portal/utils/naming.js.map +1 -0
  40. package/lib/commonjs/shared/components/boundary/portal/utils/offset-style.js +71 -0
  41. package/lib/commonjs/shared/components/boundary/portal/utils/offset-style.js.map +1 -0
  42. package/lib/commonjs/shared/components/boundary/portal/utils/teleport-control.js +16 -0
  43. package/lib/commonjs/shared/components/boundary/portal/utils/teleport-control.js.map +1 -0
  44. package/lib/commonjs/shared/components/{create-boundary-component → boundary}/providers/boundary-owner.provider.js +26 -25
  45. package/lib/commonjs/shared/components/boundary/providers/boundary-owner.provider.js.map +1 -0
  46. package/lib/commonjs/shared/components/boundary/types.js.map +1 -0
  47. package/lib/commonjs/shared/components/boundary/utils/destination-signals.js +25 -0
  48. package/lib/commonjs/shared/components/boundary/utils/destination-signals.js.map +1 -0
  49. package/lib/commonjs/shared/components/{create-boundary-component → boundary}/utils/measured-bounds.js +19 -9
  50. package/lib/commonjs/shared/components/boundary/utils/measured-bounds.js.map +1 -0
  51. package/lib/commonjs/shared/components/boundary/utils/refresh-signals.js +105 -0
  52. package/lib/commonjs/shared/components/boundary/utils/refresh-signals.js.map +1 -0
  53. package/lib/commonjs/shared/components/boundary/utils/source-signals.js +48 -0
  54. package/lib/commonjs/shared/components/boundary/utils/source-signals.js.map +1 -0
  55. package/lib/commonjs/shared/components/create-transition-aware-component.js +8 -3
  56. package/lib/commonjs/shared/components/create-transition-aware-component.js.map +1 -1
  57. package/lib/commonjs/shared/components/{integrations/masked-view.js → masked-view.js} +2 -2
  58. package/lib/commonjs/shared/components/masked-view.js.map +1 -0
  59. package/lib/commonjs/shared/components/screen-container/layers/content.js +9 -5
  60. package/lib/commonjs/shared/components/screen-container/layers/content.js.map +1 -1
  61. package/lib/commonjs/shared/configs/presets.js +6 -6
  62. package/lib/commonjs/shared/configs/presets.js.map +1 -1
  63. package/lib/commonjs/shared/index.js +4 -4
  64. package/lib/commonjs/shared/index.js.map +1 -1
  65. package/lib/commonjs/shared/providers/helpers/measured-bounds-writes.js +4 -2
  66. package/lib/commonjs/shared/providers/helpers/measured-bounds-writes.js.map +1 -1
  67. package/lib/commonjs/shared/providers/screen/descriptors/descriptors.provider.js +7 -3
  68. package/lib/commonjs/shared/providers/screen/descriptors/descriptors.provider.js.map +1 -1
  69. package/lib/commonjs/shared/providers/screen/descriptors/helpers/derive-descriptor-derivations.js +8 -1
  70. package/lib/commonjs/shared/providers/screen/descriptors/helpers/derive-descriptor-derivations.js.map +1 -1
  71. package/lib/commonjs/shared/providers/screen/descriptors/helpers/get-ancestor-keys.js +21 -6
  72. package/lib/commonjs/shared/providers/screen/descriptors/helpers/get-ancestor-keys.js.map +1 -1
  73. package/lib/commonjs/shared/providers/screen/origin.provider.js +41 -0
  74. package/lib/commonjs/shared/providers/screen/origin.provider.js.map +1 -0
  75. package/lib/commonjs/shared/providers/screen/styles/constants.js +2 -0
  76. package/lib/commonjs/shared/providers/screen/styles/constants.js.map +1 -1
  77. package/lib/commonjs/shared/providers/screen/styles/helpers/resolve-slot-styles/are-resettable-states-equal.js +58 -0
  78. package/lib/commonjs/shared/providers/screen/styles/helpers/resolve-slot-styles/are-resettable-states-equal.js.map +1 -0
  79. package/lib/commonjs/shared/providers/screen/styles/helpers/resolve-slot-styles/index.js +7 -0
  80. package/lib/commonjs/shared/providers/screen/styles/helpers/resolve-slot-styles/index.js.map +1 -1
  81. package/lib/commonjs/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js +2 -1
  82. package/lib/commonjs/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js.map +1 -1
  83. package/lib/commonjs/shared/providers/screen/styles/styles.provider.js +7 -5
  84. package/lib/commonjs/shared/providers/screen/styles/styles.provider.js.map +1 -1
  85. package/lib/commonjs/shared/stores/bounds/helpers/link-pairs.helpers.js +1 -10
  86. package/lib/commonjs/shared/stores/bounds/helpers/link-pairs.helpers.js.map +1 -1
  87. package/lib/commonjs/shared/stores/bounds/index.js.map +1 -1
  88. package/lib/commonjs/shared/stores/bounds/internals/entries.js.map +1 -1
  89. package/lib/commonjs/shared/stores/bounds/internals/links.js +36 -19
  90. package/lib/commonjs/shared/stores/bounds/internals/links.js.map +1 -1
  91. package/lib/commonjs/shared/stores/bounds/internals/resolver.js +6 -4
  92. package/lib/commonjs/shared/stores/bounds/internals/resolver.js.map +1 -1
  93. package/lib/commonjs/shared/stores/bounds/internals/state.js.map +1 -1
  94. package/lib/commonjs/shared/stores/scroll.store.js +54 -1
  95. package/lib/commonjs/shared/stores/scroll.store.js.map +1 -1
  96. package/lib/commonjs/shared/utils/bounds/helpers/create-bound-tag.js +38 -4
  97. package/lib/commonjs/shared/utils/bounds/helpers/create-bound-tag.js.map +1 -1
  98. package/lib/commonjs/shared/utils/bounds/helpers/create-bounds-accessor-core.js +40 -87
  99. package/lib/commonjs/shared/utils/bounds/helpers/create-bounds-accessor-core.js.map +1 -1
  100. package/lib/commonjs/shared/utils/bounds/helpers/create-link-accessor.js +6 -67
  101. package/lib/commonjs/shared/utils/bounds/helpers/create-link-accessor.js.map +1 -1
  102. package/lib/commonjs/shared/utils/bounds/helpers/prepare-bound-styles.js +8 -12
  103. package/lib/commonjs/shared/utils/bounds/helpers/prepare-bound-styles.js.map +1 -1
  104. package/lib/commonjs/shared/utils/bounds/helpers/styles/composers.js +235 -68
  105. package/lib/commonjs/shared/utils/bounds/helpers/styles/composers.js.map +1 -1
  106. package/lib/commonjs/shared/utils/bounds/helpers/styles/compute.js +74 -4
  107. package/lib/commonjs/shared/utils/bounds/helpers/styles/compute.js.map +1 -1
  108. package/lib/commonjs/shared/utils/bounds/navigation/reveal/build.js +5 -9
  109. package/lib/commonjs/shared/utils/bounds/navigation/reveal/build.js.map +1 -1
  110. package/lib/commonjs/shared/utils/bounds/navigation/zoom/build.js +5 -10
  111. package/lib/commonjs/shared/utils/bounds/navigation/zoom/build.js.map +1 -1
  112. package/lib/module/blank-stack/components/stack-view.js +3 -2
  113. package/lib/module/blank-stack/components/stack-view.js.map +1 -1
  114. package/lib/module/shared/components/{create-boundary-component → boundary}/components/boundary-target.js +21 -8
  115. package/lib/module/shared/components/boundary/components/boundary-target.js.map +1 -0
  116. package/lib/module/shared/components/{create-boundary-component → boundary}/create-boundary-component.js +11 -25
  117. package/lib/module/shared/components/boundary/create-boundary-component.js.map +1 -0
  118. package/lib/module/shared/components/boundary/hooks/use-boundary-presence.js.map +1 -0
  119. package/lib/module/shared/components/boundary/hooks/use-initial-destination-measurement.js +110 -0
  120. package/lib/module/shared/components/boundary/hooks/use-initial-destination-measurement.js.map +1 -0
  121. package/lib/module/shared/components/{create-boundary-component → boundary}/hooks/use-initial-source-measurement.js +4 -5
  122. package/lib/module/shared/components/boundary/hooks/use-initial-source-measurement.js.map +1 -0
  123. package/lib/module/shared/components/{create-boundary-component → boundary}/hooks/use-measurer.js +27 -23
  124. package/lib/module/shared/components/boundary/hooks/use-measurer.js.map +1 -0
  125. package/lib/module/shared/components/{create-boundary-component → boundary}/hooks/use-refresh-boundary.js +10 -7
  126. package/lib/module/shared/components/boundary/hooks/use-refresh-boundary.js.map +1 -0
  127. package/lib/module/shared/components/{create-boundary-component → boundary}/index.js +8 -1
  128. package/lib/module/shared/components/boundary/index.js.map +1 -0
  129. package/lib/module/shared/components/boundary/portal/components/host.js +94 -0
  130. package/lib/module/shared/components/boundary/portal/components/host.js.map +1 -0
  131. package/lib/module/shared/components/boundary/portal/components/portal-boundary-host.js +63 -0
  132. package/lib/module/shared/components/boundary/portal/components/portal-boundary-host.js.map +1 -0
  133. package/lib/module/shared/components/boundary/portal/components/portal-provider.js +13 -0
  134. package/lib/module/shared/components/boundary/portal/components/portal-provider.js.map +1 -0
  135. package/lib/module/shared/components/boundary/portal/components/portal.js +190 -0
  136. package/lib/module/shared/components/boundary/portal/components/portal.js.map +1 -0
  137. package/lib/module/shared/components/boundary/portal/hooks/use-host-measurement.js +69 -0
  138. package/lib/module/shared/components/boundary/portal/hooks/use-host-measurement.js.map +1 -0
  139. package/lib/module/shared/components/boundary/portal/index.js +6 -0
  140. package/lib/module/shared/components/boundary/portal/index.js.map +1 -0
  141. package/lib/module/shared/components/boundary/portal/stores/host-bounds.store.js +40 -0
  142. package/lib/module/shared/components/boundary/portal/stores/host-bounds.store.js.map +1 -0
  143. package/lib/module/shared/components/boundary/portal/stores/host-registry.store.js +126 -0
  144. package/lib/module/shared/components/boundary/portal/stores/host-registry.store.js.map +1 -0
  145. package/lib/module/shared/components/boundary/portal/stores/portal-boundary-host.store.js +53 -0
  146. package/lib/module/shared/components/boundary/portal/stores/portal-boundary-host.store.js.map +1 -0
  147. package/lib/module/shared/components/boundary/portal/utils/attachment.js +35 -0
  148. package/lib/module/shared/components/boundary/portal/utils/attachment.js.map +1 -0
  149. package/lib/module/shared/components/boundary/portal/utils/naming.js +10 -0
  150. package/lib/module/shared/components/boundary/portal/utils/naming.js.map +1 -0
  151. package/lib/module/shared/components/boundary/portal/utils/offset-style.js +66 -0
  152. package/lib/module/shared/components/boundary/portal/utils/offset-style.js.map +1 -0
  153. package/lib/module/shared/components/boundary/portal/utils/teleport-control.js +11 -0
  154. package/lib/module/shared/components/boundary/portal/utils/teleport-control.js.map +1 -0
  155. package/lib/module/shared/components/boundary/providers/boundary-owner.provider.js +60 -0
  156. package/lib/module/shared/components/boundary/providers/boundary-owner.provider.js.map +1 -0
  157. package/lib/module/shared/components/boundary/types.js.map +1 -0
  158. package/lib/module/shared/components/boundary/utils/destination-signals.js +20 -0
  159. package/lib/module/shared/components/boundary/utils/destination-signals.js.map +1 -0
  160. package/lib/module/shared/components/{create-boundary-component → boundary}/utils/measured-bounds.js +16 -7
  161. package/lib/module/shared/components/boundary/utils/measured-bounds.js.map +1 -0
  162. package/lib/module/shared/components/boundary/utils/refresh-signals.js +100 -0
  163. package/lib/module/shared/components/boundary/utils/refresh-signals.js.map +1 -0
  164. package/lib/module/shared/components/boundary/utils/source-signals.js +43 -0
  165. package/lib/module/shared/components/boundary/utils/source-signals.js.map +1 -0
  166. package/lib/module/shared/components/create-transition-aware-component.js +8 -3
  167. package/lib/module/shared/components/create-transition-aware-component.js.map +1 -1
  168. package/lib/module/shared/components/{integrations/masked-view.js → masked-view.js} +2 -2
  169. package/lib/module/shared/components/masked-view.js.map +1 -0
  170. package/lib/module/shared/components/screen-container/layers/content.js +10 -6
  171. package/lib/module/shared/components/screen-container/layers/content.js.map +1 -1
  172. package/lib/module/shared/configs/presets.js +6 -6
  173. package/lib/module/shared/configs/presets.js.map +1 -1
  174. package/lib/module/shared/index.js +2 -2
  175. package/lib/module/shared/index.js.map +1 -1
  176. package/lib/module/shared/providers/helpers/measured-bounds-writes.js +4 -2
  177. package/lib/module/shared/providers/helpers/measured-bounds-writes.js.map +1 -1
  178. package/lib/module/shared/providers/screen/descriptors/descriptors.provider.js +8 -4
  179. package/lib/module/shared/providers/screen/descriptors/descriptors.provider.js.map +1 -1
  180. package/lib/module/shared/providers/screen/descriptors/helpers/derive-descriptor-derivations.js +8 -1
  181. package/lib/module/shared/providers/screen/descriptors/helpers/derive-descriptor-derivations.js.map +1 -1
  182. package/lib/module/shared/providers/screen/descriptors/helpers/get-ancestor-keys.js +20 -6
  183. package/lib/module/shared/providers/screen/descriptors/helpers/get-ancestor-keys.js.map +1 -1
  184. package/lib/module/shared/providers/screen/origin.provider.js +33 -0
  185. package/lib/module/shared/providers/screen/origin.provider.js.map +1 -0
  186. package/lib/module/shared/providers/screen/styles/constants.js +2 -0
  187. package/lib/module/shared/providers/screen/styles/constants.js.map +1 -1
  188. package/lib/module/shared/providers/screen/styles/helpers/resolve-slot-styles/are-resettable-states-equal.js +53 -0
  189. package/lib/module/shared/providers/screen/styles/helpers/resolve-slot-styles/are-resettable-states-equal.js.map +1 -0
  190. package/lib/module/shared/providers/screen/styles/helpers/resolve-slot-styles/index.js +1 -0
  191. package/lib/module/shared/providers/screen/styles/helpers/resolve-slot-styles/index.js.map +1 -1
  192. package/lib/module/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js +2 -1
  193. package/lib/module/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js.map +1 -1
  194. package/lib/module/shared/providers/screen/styles/styles.provider.js +7 -5
  195. package/lib/module/shared/providers/screen/styles/styles.provider.js.map +1 -1
  196. package/lib/module/shared/stores/bounds/helpers/link-pairs.helpers.js +1 -8
  197. package/lib/module/shared/stores/bounds/helpers/link-pairs.helpers.js.map +1 -1
  198. package/lib/module/shared/stores/bounds/index.js.map +1 -1
  199. package/lib/module/shared/stores/bounds/internals/entries.js.map +1 -1
  200. package/lib/module/shared/stores/bounds/internals/links.js +36 -19
  201. package/lib/module/shared/stores/bounds/internals/links.js.map +1 -1
  202. package/lib/module/shared/stores/bounds/internals/resolver.js +6 -4
  203. package/lib/module/shared/stores/bounds/internals/resolver.js.map +1 -1
  204. package/lib/module/shared/stores/bounds/internals/state.js.map +1 -1
  205. package/lib/module/shared/stores/scroll.store.js +50 -0
  206. package/lib/module/shared/stores/scroll.store.js.map +1 -1
  207. package/lib/module/shared/types/animation.types.js.map +1 -1
  208. package/lib/module/shared/types/bounds.types.js.map +1 -1
  209. package/lib/module/shared/utils/bounds/helpers/create-bound-tag.js +36 -3
  210. package/lib/module/shared/utils/bounds/helpers/create-bound-tag.js.map +1 -1
  211. package/lib/module/shared/utils/bounds/helpers/create-bounds-accessor-core.js +42 -89
  212. package/lib/module/shared/utils/bounds/helpers/create-bounds-accessor-core.js.map +1 -1
  213. package/lib/module/shared/utils/bounds/helpers/create-link-accessor.js +6 -67
  214. package/lib/module/shared/utils/bounds/helpers/create-link-accessor.js.map +1 -1
  215. package/lib/module/shared/utils/bounds/helpers/prepare-bound-styles.js +8 -13
  216. package/lib/module/shared/utils/bounds/helpers/prepare-bound-styles.js.map +1 -1
  217. package/lib/module/shared/utils/bounds/helpers/styles/composers.js +236 -69
  218. package/lib/module/shared/utils/bounds/helpers/styles/composers.js.map +1 -1
  219. package/lib/module/shared/utils/bounds/helpers/styles/compute.js +74 -4
  220. package/lib/module/shared/utils/bounds/helpers/styles/compute.js.map +1 -1
  221. package/lib/module/shared/utils/bounds/navigation/reveal/build.js +5 -9
  222. package/lib/module/shared/utils/bounds/navigation/reveal/build.js.map +1 -1
  223. package/lib/module/shared/utils/bounds/navigation/zoom/build.js +5 -10
  224. package/lib/module/shared/utils/bounds/navigation/zoom/build.js.map +1 -1
  225. package/lib/typescript/blank-stack/components/stack-view.d.ts.map +1 -1
  226. package/lib/typescript/shared/components/boundary/components/boundary-target.d.ts.map +1 -0
  227. package/lib/typescript/shared/components/boundary/create-boundary-component.d.ts.map +1 -0
  228. package/lib/typescript/shared/components/boundary/hooks/use-boundary-presence.d.ts.map +1 -0
  229. package/lib/typescript/shared/components/{create-boundary-component → boundary}/hooks/use-initial-destination-measurement.d.ts +1 -4
  230. package/lib/typescript/shared/components/boundary/hooks/use-initial-destination-measurement.d.ts.map +1 -0
  231. package/lib/typescript/shared/components/{create-boundary-component → boundary}/hooks/use-initial-source-measurement.d.ts +0 -2
  232. package/lib/typescript/shared/components/boundary/hooks/use-initial-source-measurement.d.ts.map +1 -0
  233. package/lib/typescript/shared/components/{create-boundary-component → boundary}/hooks/use-measurer.d.ts +4 -2
  234. package/lib/typescript/shared/components/boundary/hooks/use-measurer.d.ts.map +1 -0
  235. package/lib/typescript/shared/components/boundary/hooks/use-refresh-boundary.d.ts +10 -0
  236. package/lib/typescript/shared/components/boundary/hooks/use-refresh-boundary.d.ts.map +1 -0
  237. package/lib/typescript/shared/components/{create-boundary-component → boundary}/index.d.ts +8 -2
  238. package/lib/typescript/shared/components/boundary/index.d.ts.map +1 -0
  239. package/lib/typescript/shared/components/boundary/portal/components/host.d.ts +7 -0
  240. package/lib/typescript/shared/components/boundary/portal/components/host.d.ts.map +1 -0
  241. package/lib/typescript/shared/components/boundary/portal/components/portal-boundary-host.d.ts +9 -0
  242. package/lib/typescript/shared/components/boundary/portal/components/portal-boundary-host.d.ts.map +1 -0
  243. package/lib/typescript/shared/components/boundary/portal/components/portal-provider.d.ts +4 -0
  244. package/lib/typescript/shared/components/boundary/portal/components/portal-provider.d.ts.map +1 -0
  245. package/lib/typescript/shared/components/boundary/portal/components/portal.d.ts +19 -0
  246. package/lib/typescript/shared/components/boundary/portal/components/portal.d.ts.map +1 -0
  247. package/lib/typescript/shared/components/boundary/portal/hooks/use-host-measurement.d.ts +13 -0
  248. package/lib/typescript/shared/components/boundary/portal/hooks/use-host-measurement.d.ts.map +1 -0
  249. package/lib/typescript/shared/components/boundary/portal/index.d.ts +4 -0
  250. package/lib/typescript/shared/components/boundary/portal/index.d.ts.map +1 -0
  251. package/lib/typescript/shared/components/boundary/portal/stores/host-bounds.store.d.ts +9 -0
  252. package/lib/typescript/shared/components/boundary/portal/stores/host-bounds.store.d.ts.map +1 -0
  253. package/lib/typescript/shared/components/boundary/portal/stores/host-registry.store.d.ts +19 -0
  254. package/lib/typescript/shared/components/boundary/portal/stores/host-registry.store.d.ts.map +1 -0
  255. package/lib/typescript/shared/components/boundary/portal/stores/portal-boundary-host.store.d.ts +11 -0
  256. package/lib/typescript/shared/components/boundary/portal/stores/portal-boundary-host.store.d.ts.map +1 -0
  257. package/lib/typescript/shared/components/boundary/portal/utils/attachment.d.ts +21 -0
  258. package/lib/typescript/shared/components/boundary/portal/utils/attachment.d.ts.map +1 -0
  259. package/lib/typescript/shared/components/boundary/portal/utils/naming.d.ts +3 -0
  260. package/lib/typescript/shared/components/boundary/portal/utils/naming.d.ts.map +1 -0
  261. package/lib/typescript/shared/components/boundary/portal/utils/offset-style.d.ts +37 -0
  262. package/lib/typescript/shared/components/boundary/portal/utils/offset-style.d.ts.map +1 -0
  263. package/lib/typescript/shared/components/boundary/portal/utils/teleport-control.d.ts +3 -0
  264. package/lib/typescript/shared/components/boundary/portal/utils/teleport-control.d.ts.map +1 -0
  265. package/lib/typescript/shared/components/{create-boundary-component → boundary}/providers/boundary-owner.provider.d.ts +14 -6
  266. package/lib/typescript/shared/components/boundary/providers/boundary-owner.provider.d.ts.map +1 -0
  267. package/lib/typescript/shared/components/boundary/types.d.ts +78 -0
  268. package/lib/typescript/shared/components/boundary/types.d.ts.map +1 -0
  269. package/lib/typescript/shared/components/{create-boundary-component → boundary}/utils/destination-signals.d.ts +2 -3
  270. package/lib/typescript/shared/components/boundary/utils/destination-signals.d.ts.map +1 -0
  271. package/lib/typescript/shared/components/boundary/utils/measured-bounds.d.ts +12 -0
  272. package/lib/typescript/shared/components/boundary/utils/measured-bounds.d.ts.map +1 -0
  273. package/lib/typescript/shared/components/{create-boundary-component → boundary}/utils/refresh-signals.d.ts +4 -3
  274. package/lib/typescript/shared/components/boundary/utils/refresh-signals.d.ts.map +1 -0
  275. package/lib/typescript/shared/components/{create-boundary-component → boundary}/utils/source-signals.d.ts +1 -2
  276. package/lib/typescript/shared/components/boundary/utils/source-signals.d.ts.map +1 -0
  277. package/lib/typescript/shared/components/create-transition-aware-component.d.ts.map +1 -1
  278. package/lib/typescript/shared/components/masked-view.d.ts.map +1 -0
  279. package/lib/typescript/shared/components/screen-container/layers/content.d.ts.map +1 -1
  280. package/lib/typescript/shared/configs/presets.d.ts.map +1 -1
  281. package/lib/typescript/shared/index.d.ts +19 -17
  282. package/lib/typescript/shared/index.d.ts.map +1 -1
  283. package/lib/typescript/shared/providers/helpers/measured-bounds-writes.d.ts +3 -1
  284. package/lib/typescript/shared/providers/helpers/measured-bounds-writes.d.ts.map +1 -1
  285. package/lib/typescript/shared/providers/screen/descriptors/descriptors.provider.d.ts.map +1 -1
  286. package/lib/typescript/shared/providers/screen/descriptors/helpers/derive-descriptor-derivations.d.ts +6 -1
  287. package/lib/typescript/shared/providers/screen/descriptors/helpers/derive-descriptor-derivations.d.ts.map +1 -1
  288. package/lib/typescript/shared/providers/screen/descriptors/helpers/get-ancestor-keys.d.ts +9 -3
  289. package/lib/typescript/shared/providers/screen/descriptors/helpers/get-ancestor-keys.d.ts.map +1 -1
  290. package/lib/typescript/shared/providers/screen/origin.provider.d.ts +11 -0
  291. package/lib/typescript/shared/providers/screen/origin.provider.d.ts.map +1 -0
  292. package/lib/typescript/shared/providers/screen/styles/constants.d.ts.map +1 -1
  293. package/lib/typescript/shared/providers/screen/styles/helpers/resolve-slot-styles/are-resettable-states-equal.d.ts +3 -0
  294. package/lib/typescript/shared/providers/screen/styles/helpers/resolve-slot-styles/are-resettable-states-equal.d.ts.map +1 -0
  295. package/lib/typescript/shared/providers/screen/styles/helpers/resolve-slot-styles/index.d.ts +1 -0
  296. package/lib/typescript/shared/providers/screen/styles/helpers/resolve-slot-styles/index.d.ts.map +1 -1
  297. package/lib/typescript/shared/providers/screen/styles/hooks/use-maybe-block-visibility.d.ts +1 -0
  298. package/lib/typescript/shared/providers/screen/styles/hooks/use-maybe-block-visibility.d.ts.map +1 -1
  299. package/lib/typescript/shared/providers/screen/styles/styles.provider.d.ts +1 -0
  300. package/lib/typescript/shared/providers/screen/styles/styles.provider.d.ts.map +1 -1
  301. package/lib/typescript/shared/stores/bounds/helpers/link-pairs.helpers.d.ts +1 -3
  302. package/lib/typescript/shared/stores/bounds/helpers/link-pairs.helpers.d.ts.map +1 -1
  303. package/lib/typescript/shared/stores/bounds/index.d.ts +1 -1
  304. package/lib/typescript/shared/stores/bounds/index.d.ts.map +1 -1
  305. package/lib/typescript/shared/stores/bounds/internals/entries.d.ts +2 -2
  306. package/lib/typescript/shared/stores/bounds/internals/entries.d.ts.map +1 -1
  307. package/lib/typescript/shared/stores/bounds/internals/links.d.ts +2 -2
  308. package/lib/typescript/shared/stores/bounds/internals/links.d.ts.map +1 -1
  309. package/lib/typescript/shared/stores/bounds/internals/resolver.d.ts.map +1 -1
  310. package/lib/typescript/shared/stores/bounds/internals/state.d.ts +4 -2
  311. package/lib/typescript/shared/stores/bounds/internals/state.d.ts.map +1 -1
  312. package/lib/typescript/shared/stores/bounds/types.d.ts +47 -12
  313. package/lib/typescript/shared/stores/bounds/types.d.ts.map +1 -1
  314. package/lib/typescript/shared/stores/scroll.store.d.ts +12 -1
  315. package/lib/typescript/shared/stores/scroll.store.d.ts.map +1 -1
  316. package/lib/typescript/shared/types/animation.types.d.ts +13 -2
  317. package/lib/typescript/shared/types/animation.types.d.ts.map +1 -1
  318. package/lib/typescript/shared/types/bounds.types.d.ts +10 -40
  319. package/lib/typescript/shared/types/bounds.types.d.ts.map +1 -1
  320. package/lib/typescript/shared/types/index.d.ts +2 -2
  321. package/lib/typescript/shared/types/index.d.ts.map +1 -1
  322. package/lib/typescript/shared/utils/bounds/helpers/create-bound-tag.d.ts +2 -1
  323. package/lib/typescript/shared/utils/bounds/helpers/create-bound-tag.d.ts.map +1 -1
  324. package/lib/typescript/shared/utils/bounds/helpers/create-bounds-accessor-core.d.ts +7 -11
  325. package/lib/typescript/shared/utils/bounds/helpers/create-bounds-accessor-core.d.ts.map +1 -1
  326. package/lib/typescript/shared/utils/bounds/helpers/create-link-accessor.d.ts +0 -3
  327. package/lib/typescript/shared/utils/bounds/helpers/create-link-accessor.d.ts.map +1 -1
  328. package/lib/typescript/shared/utils/bounds/helpers/prepare-bound-styles.d.ts +7 -3
  329. package/lib/typescript/shared/utils/bounds/helpers/prepare-bound-styles.d.ts.map +1 -1
  330. package/lib/typescript/shared/utils/bounds/helpers/styles/composers.d.ts +3 -0
  331. package/lib/typescript/shared/utils/bounds/helpers/styles/composers.d.ts.map +1 -1
  332. package/lib/typescript/shared/utils/bounds/helpers/styles/compute.d.ts +1 -1
  333. package/lib/typescript/shared/utils/bounds/helpers/styles/compute.d.ts.map +1 -1
  334. package/lib/typescript/shared/utils/bounds/navigation/reveal/build.d.ts.map +1 -1
  335. package/lib/typescript/shared/utils/bounds/navigation/zoom/build.d.ts.map +1 -1
  336. package/lib/typescript/shared/utils/bounds/types/options.d.ts +93 -6
  337. package/lib/typescript/shared/utils/bounds/types/options.d.ts.map +1 -1
  338. package/package.json +3 -2
  339. package/src/blank-stack/components/stack-view.tsx +4 -3
  340. package/src/shared/components/{create-boundary-component → boundary}/components/boundary-target.tsx +28 -11
  341. package/src/shared/components/{create-boundary-component → boundary}/create-boundary-component.tsx +20 -31
  342. package/src/shared/components/boundary/hooks/use-initial-destination-measurement.ts +156 -0
  343. package/src/shared/components/{create-boundary-component → boundary}/hooks/use-initial-source-measurement.ts +5 -14
  344. package/src/shared/components/{create-boundary-component → boundary}/hooks/use-measurer.ts +42 -46
  345. package/src/shared/components/{create-boundary-component → boundary}/hooks/use-refresh-boundary.ts +16 -11
  346. package/src/shared/components/{create-boundary-component → boundary}/index.tsx +12 -0
  347. package/src/shared/components/boundary/portal/components/host.tsx +114 -0
  348. package/src/shared/components/boundary/portal/components/portal-boundary-host.tsx +90 -0
  349. package/src/shared/components/boundary/portal/components/portal-provider.tsx +10 -0
  350. package/src/shared/components/boundary/portal/components/portal.tsx +278 -0
  351. package/src/shared/components/boundary/portal/hooks/use-host-measurement.ts +102 -0
  352. package/src/shared/components/boundary/portal/index.ts +3 -0
  353. package/src/shared/components/boundary/portal/stores/host-bounds.store.ts +45 -0
  354. package/src/shared/components/boundary/portal/stores/host-registry.store.ts +182 -0
  355. package/src/shared/components/boundary/portal/stores/portal-boundary-host.store.ts +91 -0
  356. package/src/shared/components/boundary/portal/utils/attachment.ts +48 -0
  357. package/src/shared/components/boundary/portal/utils/naming.ts +10 -0
  358. package/src/shared/components/boundary/portal/utils/offset-style.ts +171 -0
  359. package/src/shared/components/boundary/portal/utils/teleport-control.ts +13 -0
  360. package/src/shared/components/{create-boundary-component → boundary}/providers/boundary-owner.provider.tsx +41 -33
  361. package/src/shared/components/boundary/types.ts +92 -0
  362. package/src/shared/components/boundary/utils/destination-signals.ts +31 -0
  363. package/src/shared/components/{create-boundary-component → boundary}/utils/measured-bounds.ts +34 -11
  364. package/src/shared/components/boundary/utils/refresh-signals.ts +175 -0
  365. package/src/shared/components/boundary/utils/source-signals.ts +63 -0
  366. package/src/shared/components/create-transition-aware-component.tsx +8 -3
  367. package/src/shared/components/{integrations/masked-view.tsx → masked-view.tsx} +2 -2
  368. package/src/shared/components/screen-container/layers/content.tsx +12 -7
  369. package/src/shared/configs/presets.ts +2 -6
  370. package/src/shared/index.ts +13 -5
  371. package/src/shared/providers/helpers/measured-bounds-writes.ts +11 -1
  372. package/src/shared/providers/screen/descriptors/descriptors.provider.tsx +7 -3
  373. package/src/shared/providers/screen/descriptors/helpers/derive-descriptor-derivations.ts +16 -0
  374. package/src/shared/providers/screen/descriptors/helpers/get-ancestor-keys.ts +31 -6
  375. package/src/shared/providers/screen/origin.provider.tsx +38 -0
  376. package/src/shared/providers/screen/styles/constants.ts +2 -0
  377. package/src/shared/providers/screen/styles/helpers/resolve-slot-styles/are-resettable-states-equal.ts +74 -0
  378. package/src/shared/providers/screen/styles/helpers/resolve-slot-styles/index.ts +1 -0
  379. package/src/shared/providers/screen/styles/hooks/use-maybe-block-visibility.tsx +1 -0
  380. package/src/shared/providers/screen/styles/styles.provider.tsx +5 -3
  381. package/src/shared/stores/bounds/helpers/link-pairs.helpers.ts +1 -10
  382. package/src/shared/stores/bounds/index.ts +2 -4
  383. package/src/shared/stores/bounds/internals/entries.ts +4 -4
  384. package/src/shared/stores/bounds/internals/links.ts +52 -18
  385. package/src/shared/stores/bounds/internals/resolver.ts +5 -3
  386. package/src/shared/stores/bounds/internals/state.ts +5 -2
  387. package/src/shared/stores/bounds/types.ts +59 -15
  388. package/src/shared/stores/scroll.store.ts +68 -0
  389. package/src/shared/types/animation.types.ts +17 -2
  390. package/src/shared/types/bounds.types.ts +22 -60
  391. package/src/shared/types/index.ts +5 -0
  392. package/src/shared/utils/bounds/helpers/create-bound-tag.ts +46 -4
  393. package/src/shared/utils/bounds/helpers/create-bounds-accessor-core.ts +65 -116
  394. package/src/shared/utils/bounds/helpers/create-link-accessor.ts +10 -80
  395. package/src/shared/utils/bounds/helpers/prepare-bound-styles.ts +10 -13
  396. package/src/shared/utils/bounds/helpers/styles/composers.ts +269 -46
  397. package/src/shared/utils/bounds/helpers/styles/compute.ts +134 -2
  398. package/src/shared/utils/bounds/navigation/reveal/build.ts +5 -7
  399. package/src/shared/utils/bounds/navigation/zoom/build.ts +5 -8
  400. package/src/shared/utils/bounds/types/options.ts +105 -6
  401. package/lib/commonjs/shared/components/create-boundary-component/components/boundary-target.js.map +0 -1
  402. package/lib/commonjs/shared/components/create-boundary-component/create-boundary-component.js.map +0 -1
  403. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-boundary-presence.js.map +0 -1
  404. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-initial-destination-measurement.js +0 -99
  405. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-initial-destination-measurement.js.map +0 -1
  406. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-initial-source-measurement.js.map +0 -1
  407. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-measurer.js.map +0 -1
  408. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-refresh-boundary.js.map +0 -1
  409. package/lib/commonjs/shared/components/create-boundary-component/index.js.map +0 -1
  410. package/lib/commonjs/shared/components/create-boundary-component/providers/boundary-owner.provider.js.map +0 -1
  411. package/lib/commonjs/shared/components/create-boundary-component/types.js.map +0 -1
  412. package/lib/commonjs/shared/components/create-boundary-component/utils/destination-signals.js +0 -75
  413. package/lib/commonjs/shared/components/create-boundary-component/utils/destination-signals.js.map +0 -1
  414. package/lib/commonjs/shared/components/create-boundary-component/utils/measured-bounds.js.map +0 -1
  415. package/lib/commonjs/shared/components/create-boundary-component/utils/refresh-signals.js +0 -103
  416. package/lib/commonjs/shared/components/create-boundary-component/utils/refresh-signals.js.map +0 -1
  417. package/lib/commonjs/shared/components/create-boundary-component/utils/source-signals.js +0 -52
  418. package/lib/commonjs/shared/components/create-boundary-component/utils/source-signals.js.map +0 -1
  419. package/lib/commonjs/shared/components/integrations/masked-view.js.map +0 -1
  420. package/lib/commonjs/shared/utils/bounds/helpers/create-interpolators.js +0 -68
  421. package/lib/commonjs/shared/utils/bounds/helpers/create-interpolators.js.map +0 -1
  422. package/lib/commonjs/shared/utils/bounds/helpers/styles/interpolate-link-style.js +0 -30
  423. package/lib/commonjs/shared/utils/bounds/helpers/styles/interpolate-link-style.js.map +0 -1
  424. package/lib/module/shared/components/create-boundary-component/components/boundary-target.js.map +0 -1
  425. package/lib/module/shared/components/create-boundary-component/create-boundary-component.js.map +0 -1
  426. package/lib/module/shared/components/create-boundary-component/hooks/use-boundary-presence.js.map +0 -1
  427. package/lib/module/shared/components/create-boundary-component/hooks/use-initial-destination-measurement.js +0 -94
  428. package/lib/module/shared/components/create-boundary-component/hooks/use-initial-destination-measurement.js.map +0 -1
  429. package/lib/module/shared/components/create-boundary-component/hooks/use-initial-source-measurement.js.map +0 -1
  430. package/lib/module/shared/components/create-boundary-component/hooks/use-measurer.js.map +0 -1
  431. package/lib/module/shared/components/create-boundary-component/hooks/use-refresh-boundary.js.map +0 -1
  432. package/lib/module/shared/components/create-boundary-component/index.js.map +0 -1
  433. package/lib/module/shared/components/create-boundary-component/providers/boundary-owner.provider.js +0 -60
  434. package/lib/module/shared/components/create-boundary-component/providers/boundary-owner.provider.js.map +0 -1
  435. package/lib/module/shared/components/create-boundary-component/types.js.map +0 -1
  436. package/lib/module/shared/components/create-boundary-component/utils/destination-signals.js +0 -70
  437. package/lib/module/shared/components/create-boundary-component/utils/destination-signals.js.map +0 -1
  438. package/lib/module/shared/components/create-boundary-component/utils/measured-bounds.js.map +0 -1
  439. package/lib/module/shared/components/create-boundary-component/utils/refresh-signals.js +0 -98
  440. package/lib/module/shared/components/create-boundary-component/utils/refresh-signals.js.map +0 -1
  441. package/lib/module/shared/components/create-boundary-component/utils/source-signals.js +0 -47
  442. package/lib/module/shared/components/create-boundary-component/utils/source-signals.js.map +0 -1
  443. package/lib/module/shared/components/integrations/masked-view.js.map +0 -1
  444. package/lib/module/shared/utils/bounds/helpers/create-interpolators.js +0 -63
  445. package/lib/module/shared/utils/bounds/helpers/create-interpolators.js.map +0 -1
  446. package/lib/module/shared/utils/bounds/helpers/styles/interpolate-link-style.js +0 -26
  447. package/lib/module/shared/utils/bounds/helpers/styles/interpolate-link-style.js.map +0 -1
  448. package/lib/typescript/shared/components/create-boundary-component/components/boundary-target.d.ts.map +0 -1
  449. package/lib/typescript/shared/components/create-boundary-component/create-boundary-component.d.ts.map +0 -1
  450. package/lib/typescript/shared/components/create-boundary-component/hooks/use-boundary-presence.d.ts.map +0 -1
  451. package/lib/typescript/shared/components/create-boundary-component/hooks/use-initial-destination-measurement.d.ts.map +0 -1
  452. package/lib/typescript/shared/components/create-boundary-component/hooks/use-initial-source-measurement.d.ts.map +0 -1
  453. package/lib/typescript/shared/components/create-boundary-component/hooks/use-measurer.d.ts.map +0 -1
  454. package/lib/typescript/shared/components/create-boundary-component/hooks/use-refresh-boundary.d.ts +0 -14
  455. package/lib/typescript/shared/components/create-boundary-component/hooks/use-refresh-boundary.d.ts.map +0 -1
  456. package/lib/typescript/shared/components/create-boundary-component/index.d.ts.map +0 -1
  457. package/lib/typescript/shared/components/create-boundary-component/providers/boundary-owner.provider.d.ts.map +0 -1
  458. package/lib/typescript/shared/components/create-boundary-component/types.d.ts +0 -37
  459. package/lib/typescript/shared/components/create-boundary-component/types.d.ts.map +0 -1
  460. package/lib/typescript/shared/components/create-boundary-component/utils/destination-signals.d.ts.map +0 -1
  461. package/lib/typescript/shared/components/create-boundary-component/utils/measured-bounds.d.ts +0 -8
  462. package/lib/typescript/shared/components/create-boundary-component/utils/measured-bounds.d.ts.map +0 -1
  463. package/lib/typescript/shared/components/create-boundary-component/utils/refresh-signals.d.ts.map +0 -1
  464. package/lib/typescript/shared/components/create-boundary-component/utils/source-signals.d.ts.map +0 -1
  465. package/lib/typescript/shared/components/integrations/masked-view.d.ts.map +0 -1
  466. package/lib/typescript/shared/utils/bounds/helpers/create-interpolators.d.ts +0 -14
  467. package/lib/typescript/shared/utils/bounds/helpers/create-interpolators.d.ts.map +0 -1
  468. package/lib/typescript/shared/utils/bounds/helpers/styles/interpolate-link-style.d.ts +0 -17
  469. package/lib/typescript/shared/utils/bounds/helpers/styles/interpolate-link-style.d.ts.map +0 -1
  470. package/src/shared/components/create-boundary-component/hooks/use-initial-destination-measurement.ts +0 -130
  471. package/src/shared/components/create-boundary-component/types.ts +0 -48
  472. package/src/shared/components/create-boundary-component/utils/destination-signals.ts +0 -129
  473. package/src/shared/components/create-boundary-component/utils/refresh-signals.ts +0 -164
  474. package/src/shared/components/create-boundary-component/utils/source-signals.ts +0 -72
  475. package/src/shared/utils/bounds/helpers/create-interpolators.ts +0 -117
  476. package/src/shared/utils/bounds/helpers/styles/interpolate-link-style.ts +0 -43
  477. /package/lib/commonjs/shared/components/{create-boundary-component → boundary}/hooks/use-boundary-presence.js +0 -0
  478. /package/lib/commonjs/shared/components/{create-boundary-component → boundary}/types.js +0 -0
  479. /package/lib/module/shared/components/{create-boundary-component → boundary}/hooks/use-boundary-presence.js +0 -0
  480. /package/lib/module/shared/components/{create-boundary-component → boundary}/types.js +0 -0
  481. /package/lib/typescript/shared/components/{create-boundary-component → boundary}/components/boundary-target.d.ts +0 -0
  482. /package/lib/typescript/shared/components/{create-boundary-component → boundary}/create-boundary-component.d.ts +0 -0
  483. /package/lib/typescript/shared/components/{create-boundary-component → boundary}/hooks/use-boundary-presence.d.ts +0 -0
  484. /package/lib/typescript/shared/components/{integrations/masked-view.d.ts → masked-view.d.ts} +0 -0
  485. /package/src/shared/components/{create-boundary-component → boundary}/hooks/use-boundary-presence.ts +0 -0
@@ -0,0 +1,99 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ScreenFallbackHost = exports.Host = void 0;
7
+ var _react = require("react");
8
+ var _reactNative = require("react-native");
9
+ var _reactNativeReanimated = _interopRequireDefault(require("react-native-reanimated"));
10
+ var _descriptors = require("../../../../providers/screen/descriptors");
11
+ var _useHostMeasurement = require("../hooks/use-host-measurement");
12
+ var _hostRegistry = require("../stores/host-registry.store");
13
+ var _portalBoundaryHost = require("../stores/portal-boundary-host.store");
14
+ var _portalBoundaryHost2 = require("./portal-boundary-host");
15
+ var _jsxRuntime = require("react/jsx-runtime");
16
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
17
+ let nextHostId = 0;
18
+ function HostImpl({
19
+ fallback = false,
20
+ style
21
+ }) {
22
+ const screenKey = (0, _descriptors.useDescriptorsStore)(s => s.derivations.currentScreenKey);
23
+ const generatedHostKeyRef = (0, _react.useRef)(null);
24
+ if (generatedHostKeyRef.current === null) {
25
+ generatedHostKeyRef.current = `${screenKey}-host-${nextHostId++}`;
26
+ }
27
+ const hostKey = fallback ? screenKey : generatedHostKeyRef.current;
28
+ const capturesScroll = !fallback;
29
+ const activeBoundaryHosts = (0, _portalBoundaryHost.useActivePortalBoundaryHosts)(hostKey);
30
+ const {
31
+ height: viewportHeight,
32
+ width: viewportWidth
33
+ } = (0, _reactNative.useWindowDimensions)();
34
+ const measurement = (0, _useHostMeasurement.useHostMeasurement)({
35
+ capturesScroll,
36
+ enabled: activeBoundaryHosts.length > 0,
37
+ hostKey,
38
+ screenKey
39
+ });
40
+ (0, _react.useLayoutEffect)(() => {
41
+ (0, _hostRegistry.registerHost)({
42
+ capturesScroll,
43
+ fallback,
44
+ hostKey,
45
+ screenKey
46
+ });
47
+ return () => {
48
+ (0, _hostRegistry.unregisterHost)(screenKey, hostKey);
49
+ };
50
+ }, [capturesScroll, fallback, hostKey, screenKey]);
51
+ const boundaryHosts = measurement.canRenderHosts ? activeBoundaryHosts.map(host => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
52
+ pointerEvents: "box-none",
53
+ style: [styles.boundaryHostViewport, {
54
+ width: viewportWidth,
55
+ height: viewportHeight
56
+ }],
57
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_portalBoundaryHost2.PortalBoundaryHost, {
58
+ host: host,
59
+ style: _reactNative.StyleSheet.absoluteFill
60
+ })
61
+ }, host.boundaryId)) : null;
62
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeReanimated.default.View, {
63
+ ref: measurement.hostRef,
64
+ pointerEvents: "box-none",
65
+ style: [styles.host, {
66
+ width: viewportWidth,
67
+ height: viewportHeight
68
+ }, style],
69
+ collapsable: false,
70
+ children: boundaryHosts
71
+ });
72
+ }
73
+ const Host = exports.Host = /*#__PURE__*/(0, _react.memo)(function Host(props) {
74
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(HostImpl, {
75
+ ...props
76
+ });
77
+ });
78
+ const ScreenFallbackHost = exports.ScreenFallbackHost = /*#__PURE__*/(0, _react.memo)(function ScreenFallbackHost() {
79
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(HostImpl, {
80
+ fallback: true
81
+ });
82
+ });
83
+ const styles = _reactNative.StyleSheet.create({
84
+ host: {
85
+ elevation: 999999,
86
+ left: 0,
87
+ overflow: "visible",
88
+ position: "absolute",
89
+ top: 0,
90
+ zIndex: 999999
91
+ },
92
+ boundaryHostViewport: {
93
+ left: 0,
94
+ overflow: "visible",
95
+ position: "absolute",
96
+ top: 0
97
+ }
98
+ });
99
+ //# sourceMappingURL=host.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","require","_reactNative","_reactNativeReanimated","_interopRequireDefault","_descriptors","_useHostMeasurement","_hostRegistry","_portalBoundaryHost","_portalBoundaryHost2","_jsxRuntime","e","__esModule","default","nextHostId","HostImpl","fallback","style","screenKey","useDescriptorsStore","s","derivations","currentScreenKey","generatedHostKeyRef","useRef","current","hostKey","capturesScroll","activeBoundaryHosts","useActivePortalBoundaryHosts","height","viewportHeight","width","viewportWidth","useWindowDimensions","measurement","useHostMeasurement","enabled","length","useLayoutEffect","registerHost","unregisterHost","boundaryHosts","canRenderHosts","map","host","jsx","View","pointerEvents","styles","boundaryHostViewport","children","PortalBoundaryHost","StyleSheet","absoluteFill","boundaryId","ref","hostRef","collapsable","Host","exports","memo","props","ScreenFallbackHost","create","elevation","left","overflow","position","top","zIndex"],"sourceRoot":"../../../../../../../src","sources":["shared/components/boundary/portal/components/host.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAOA,IAAAE,sBAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,mBAAA,GAAAL,OAAA;AACA,IAAAM,aAAA,GAAAN,OAAA;AACA,IAAAO,mBAAA,GAAAP,OAAA;AACA,IAAAQ,oBAAA,GAAAR,OAAA;AAA4D,IAAAS,WAAA,GAAAT,OAAA;AAAA,SAAAG,uBAAAO,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE5D,IAAIG,UAAU,GAAG,CAAC;AAUlB,SAASC,QAAQA,CAAC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CAAC;IACPC,QAAQ,EAAE,SAAS;IACnBC,QAAQ,EAAE,UAAU;IACpBC,GAAG,EAAE,CAAC;IACNC,MAAM,EAAE;EACT,CAAC;EACDpB,oBAAoB,EAAE;IACrBgB,IAAI,EAAE,CAAC;IACPC,QAAQ,EAAE,SAAS;IACnBC,QAAQ,EAAE,UAAU;IACpBC,GAAG,EAAE;EACN;AACD,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.PortalBoundaryHost = void 0;
7
+ var _react = require("react");
8
+ var _reactNativeReanimated = _interopRequireWildcard(require("react-native-reanimated"));
9
+ var _reactNativeTeleport = require("react-native-teleport");
10
+ var _constants = require("../../../../constants");
11
+ var _animation = require("../../../../stores/animation.store");
12
+ var _linkPairs = require("../../../../stores/bounds/helpers/link-pairs.helpers");
13
+ var _links = require("../../../../stores/bounds/internals/links");
14
+ var _gesture = require("../../../../stores/gesture.store");
15
+ var _scroll = require("../../../../stores/scroll.store");
16
+ var _naming = require("../utils/naming");
17
+ var _offsetStyle = require("../utils/offset-style");
18
+ var _jsxRuntime = require("react/jsx-runtime");
19
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
20
+ const AnimatedPortalBoundaryHost = _reactNativeReanimated.default.createAnimatedComponent(_reactNativeTeleport.PortalHost);
21
+ const PortalBoundaryHost = exports.PortalBoundaryHost = /*#__PURE__*/(0, _react.memo)(function PortalBoundaryHost({
22
+ host,
23
+ style
24
+ }) {
25
+ const hostName = (0, _naming.createPortalBoundaryHostName)(host.hostKey, host.boundaryId);
26
+ const hostClosing = _animation.AnimationStore.getValue(host.screenKey, "closing");
27
+ const hostProgress = _animation.AnimationStore.getValue(host.screenKey, "transitionProgress");
28
+ const hostGestureDismissing = _gesture.GestureStore.getValue(host.screenKey, "dismissing");
29
+ const hostScrollMetadata = _scroll.ScrollStore.getValue(host.screenKey, "metadata");
30
+ const sourceScrollMetadata = _scroll.ScrollStore.getValue((0, _linkPairs.getSourceScreenKeyFromPairKey)(host.pairKey), "metadata");
31
+ const hostStyle = (0, _reactNativeReanimated.useAnimatedStyle)(() => {
32
+ "worklet";
33
+
34
+ // Strict per-member lookup — a fallback member's source rect would
35
+ // misplace this host's teleported content.
36
+ const link = (0, _links.getLink)(host.pairKey, host.boundaryId);
37
+ if (!link?.source || !link.destination) {
38
+ return _constants.NO_STYLES;
39
+ }
40
+
41
+ // Make the coordinate case explicit before resolving the host offset.
42
+ // The resolver owns the math; this component decides which screen/scroll
43
+ // relationship the active portal is in.
44
+ const isCrossScreenPortal = link.source.screenKey !== host.screenKey;
45
+ const isHostClosing = hostClosing.get() === 1 || hostGestureDismissing.get() === 1;
46
+ const placement = !isCrossScreenPortal ? "same-screen" : isHostClosing ? "cross-screen-close" : "cross-screen-open";
47
+
48
+ // A source that originated inside its own scroll host moves with that
49
+ // ScrollView while this portal stays attached over here. Shifting the
50
+ // source rect by the clamped source scroll travel keeps the return
51
+ // landing point on the live placeholder, so the close detach is seamless.
52
+ const trackSourceScroll = isCrossScreenPortal && link.source.sourceHost?.capturesScroll === true;
53
+ return (0, _offsetStyle.resolvePortalOffsetStyle)({
54
+ bounds: link.source.bounds,
55
+ hostCurrentScroll: placement === "cross-screen-close" ? hostScrollMetadata.get() : null,
56
+ hostKey: host.hostKey,
57
+ placement,
58
+ sourceCurrentScroll: trackSourceScroll ? sourceScrollMetadata.get() : null,
59
+ hostProgress: hostProgress.get(),
60
+ trackSourceScroll
61
+ });
62
+ });
63
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(AnimatedPortalBoundaryHost, {
64
+ name: hostName,
65
+ style: [style, hostStyle]
66
+ });
67
+ });
68
+ //# sourceMappingURL=portal-boundary-host.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","require","_reactNativeReanimated","_interopRequireWildcard","_reactNativeTeleport","_constants","_animation","_linkPairs","_links","_gesture","_scroll","_naming","_offsetStyle","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","AnimatedPortalBoundaryHost","Animated","createAnimatedComponent","NativePortalHost","PortalBoundaryHost","exports","memo","host","style","hostName","createPortalBoundaryHostName","hostKey","boundaryId","hostClosing","AnimationStore","getValue","screenKey","hostProgress","hostGestureDismissing","GestureStore","hostScrollMetadata","ScrollStore","sourceScrollMetadata","getSourceScreenKeyFromPairKey","pairKey","hostStyle","useAnimatedStyle","link","getLink","source","destination","NO_STYLES","isCrossScreenPortal","isHostClosing","placement","trackSourceScroll","sourceHost","capturesScroll","resolvePortalOffsetStyle","bounds","hostCurrentScroll","sourceCurrentScroll","jsx","name"],"sourceRoot":"../../../../../../../src","sources":["shared/components/boundary/portal/components/portal-boundary-host.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAAC,sBAAA,GAAAC,uBAAA,CAAAF,OAAA;AACA,IAAAG,oBAAA,GAAAH,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AACA,IAAAK,UAAA,GAAAL,OAAA;AACA,IAAAM,UAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,QAAA,GAAAR,OAAA;AACA,IAAAS,OAAA,GAAAT,OAAA;AAEA,IAAAU,OAAA,GAAAV,OAAA;AACA,IAAAW,YAAA,GAAAX,OAAA;AAG+B,IAAAY,W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c,KAAK,IAAI;IAEvE,OAAO,IAAAC,qCAAwB,EAAC;MAC/BC,MAAM,EAAEZ,IAAI,CAACE,MAAM,CAACU,MAAM;MAC1BC,iBAAiB,EAChBN,SAAS,KAAK,oBAAoB,GAAGd,kBAAkB,CAAC3B,GAAG,CAAC,CAAC,GAAG,IAAI;MACrEkB,OAAO,EAAEJ,IAAI,CAACI,OAAO;MACrBuB,SAAS;MACTO,mBAAmB,EAAEN,iBAAiB,GACnCb,oBAAoB,CAAC7B,GAAG,CAAC,CAAC,GAC1B,IAAI;MACPwB,YAAY,EAAEA,YAAY,CAACxB,GAAG,CAAC,CAAC;MAChC0C;IACD,CAAC,CAAC;EACH,CAAC,CAAC;EAEF,oBACC,IAAAvD,WAAA,CAAA8D,GAAA,EAAC1C,0BAA0B;IAAC2C,IAAI,EAAElC,QAAS;IAACD,KAAK,EAAE,CAACA,KAAK,EAAEiB,SAAS;EAAE,CAAE,CAAC;AAE3E,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.PortalProvider = void 0;
7
+ var _react = require("react");
8
+ var _reactNativeTeleport = require("react-native-teleport");
9
+ var _jsxRuntime = require("react/jsx-runtime");
10
+ const PortalProvider = exports.PortalProvider = /*#__PURE__*/(0, _react.memo)(function PortalProvider({
11
+ children
12
+ }) {
13
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeTeleport.PortalProvider, {
14
+ children: children
15
+ });
16
+ });
17
+ //# sourceMappingURL=portal-provider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","require","_reactNativeTeleport","_jsxRuntime","PortalProvider","exports","memo","children","jsx"],"sourceRoot":"../../../../../../../src","sources":["shared/components/boundary/portal/components/portal-provider.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,oBAAA,GAAAD,OAAA;AAA+E,IAAAE,WAAA,GAAAF,OAAA;AAExE,MAAMG,cAAc,GAAAC,OAAA,CAAAD,cAAA,gBAAG,IAAAE,WAAI,EAAC,SAASF,cAAcA,CAAC;EAC1DG;AAGD,CAAC,EAAE;EACF,oBAAO,IAAAJ,WAAA,CAAAK,GAAA,EAACN,oBAAA,CAAAE,cAAoB;IAAAG,QAAA,EAAEA;EAAQ,CAAuB,CAAC;AAC/D,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,195 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.Portal = void 0;
7
+ var _react = require("react");
8
+ var _reactNativeReanimated = _interopRequireWildcard(require("react-native-reanimated"));
9
+ var _reactNativeTeleport = require("react-native-teleport");
10
+ var _descriptors = require("../../../../providers/screen/descriptors");
11
+ var _styles = require("../../../../providers/screen/styles");
12
+ var _animation = require("../../../../stores/animation.store");
13
+ var _linkPairs = require("../../../../stores/bounds/helpers/link-pairs.helpers");
14
+ var _links = require("../../../../stores/bounds/internals/links");
15
+ var _state = require("../../../../stores/bounds/internals/state");
16
+ var _createTransitionAwareComponent = require("../../../create-transition-aware-component");
17
+ var _hostRegistry = require("../stores/host-registry.store");
18
+ var _portalBoundaryHost = require("../stores/portal-boundary-host.store");
19
+ var _attachment = require("../utils/attachment");
20
+ var _naming = require("../utils/naming");
21
+ var _teleportControl = require("../utils/teleport-control");
22
+ var _jsxRuntime = require("react/jsx-runtime");
23
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
24
+ const TransitionAwareTeleport = (0, _createTransitionAwareComponent.createTransitionAwareComponent)(_reactNativeTeleport.Portal);
25
+ const Portal = exports.Portal = /*#__PURE__*/(0, _react.memo)(function Portal({
26
+ id = "my-id",
27
+ children,
28
+ mode = false,
29
+ placeholderRef
30
+ }) {
31
+ const isPortalEnabled = !!mode;
32
+ const portalAttachTarget = !mode || mode === true ? "current-screen" : mode.attachTo ?? "current-screen";
33
+ const {
34
+ stylesMap
35
+ } = (0, _styles.useScreenStyles)();
36
+ const sourcePairKey = (0, _descriptors.useDescriptorsStore)(s => s.derivations.sourcePairKey);
37
+ const currentScreenKey = (0, _descriptors.useDescriptorsStore)(s => s.derivations.currentScreenKey);
38
+ const nextScreenKey = (0, _descriptors.useDescriptorsStore)(s => s.derivations.nextScreenKey);
39
+ const [attachment, setAttachment] = (0, _react.useState)(_naming.PORTAL_HOST_NAME_RESET_VALUE);
40
+ const attachedHostName = (0, _reactNativeReanimated.useSharedValue)(_naming.PORTAL_HOST_NAME_RESET_VALUE);
41
+ const placeholderWidth = (0, _reactNativeReanimated.useSharedValue)(0);
42
+ const placeholderHeight = (0, _reactNativeReanimated.useSharedValue)(0);
43
+ const {
44
+ progressScreenKey,
45
+ targetScreenKey
46
+ } = (0, _attachment.resolvePortalAttachmentTargets)({
47
+ attachment,
48
+ currentScreenKey,
49
+ nextScreenKey,
50
+ portalAttachTarget,
51
+ sourcePairKey
52
+ });
53
+ const activeHostKey = (0, _hostRegistry.useActiveHostKey)(targetScreenKey);
54
+ const activeHostCapturesScroll = activeHostKey ? (0, _hostRegistry.getHostCapturesScroll)(activeHostKey) : false;
55
+ const progress = _animation.AnimationStore.getValue(progressScreenKey ?? "", "transitionProgress");
56
+ const closing = _animation.AnimationStore.getValue(progressScreenKey ?? "", "closing");
57
+ const updatePortalAttachment = (0, _react.useCallback)((matchedScreenKey, pairKey) => {
58
+ if (matchedScreenKey && pairKey) {
59
+ setAttachment(current => {
60
+ if (current?.matchedScreenKey === matchedScreenKey && current.pairKey === pairKey) {
61
+ return current;
62
+ }
63
+ return {
64
+ matchedScreenKey,
65
+ pairKey
66
+ };
67
+ });
68
+ return;
69
+ }
70
+ setAttachment(current => current ? null : current);
71
+ }, []);
72
+ (0, _react.useLayoutEffect)(() => {
73
+ if (!isPortalEnabled || !attachment || !activeHostKey || !targetScreenKey) {
74
+ attachedHostName.set(_naming.PORTAL_HOST_NAME_RESET_VALUE);
75
+ return;
76
+ }
77
+ (0, _portalBoundaryHost.mountPortalBoundaryHost)({
78
+ boundaryId: id,
79
+ capturesScroll: activeHostCapturesScroll,
80
+ hostKey: activeHostKey,
81
+ pairKey: attachment.pairKey,
82
+ screenKey: targetScreenKey
83
+ });
84
+
85
+ // The native registry parks portals whose host has not registered yet and
86
+ // re-parents the moment it does, so the host name can be handed over
87
+ // immediately — ordering belongs to the registry, not to frame counting.
88
+ // hostName rides animated props, so the handover needs no React commit.
89
+ attachedHostName.set((0, _naming.createPortalBoundaryHostName)(activeHostKey, id));
90
+ }, [activeHostKey, activeHostCapturesScroll, attachedHostName, attachment, id, isPortalEnabled, targetScreenKey]);
91
+ (0, _react.useLayoutEffect)(() => {
92
+ return () => {
93
+ attachedHostName.set(_naming.PORTAL_HOST_NAME_RESET_VALUE);
94
+ (0, _portalBoundaryHost.unmountPortalBoundaryHost)(id);
95
+ };
96
+ }, [attachedHostName, id]);
97
+ (0, _reactNativeReanimated.useAnimatedReaction)(() => {
98
+ "worklet";
99
+
100
+ if (!isPortalEnabled || !sourcePairKey) {
101
+ return null;
102
+ }
103
+ _state.pairs.get();
104
+ // Strict per-member lookup: getResolvedLink's group fallback borrows
105
+ // the initial member's link for style resolution, which would make
106
+ // every inactive group member's portal see a "complete" link and
107
+ // attach. A portal may only teleport on its OWN member's link.
108
+ const link = (0, _links.getLink)(sourcePairKey, id);
109
+ if (link?.status !== "complete") {
110
+ return null;
111
+ }
112
+
113
+ // Grouped portals teleport only while their member is the group's
114
+ // active id — retargeting detaches the previous member (its content
115
+ // returns home) and attaches the new one. Exactly one grouped member
116
+ // is teleported at a time.
117
+ if (link.group) {
118
+ const activeId = _state.pairs.get()[sourcePairKey]?.groups?.[link.group]?.activeId;
119
+ if (activeId && activeId !== (0, _linkPairs.getLinkKeyFromTag)(id)) {
120
+ return null;
121
+ }
122
+ }
123
+ return link.destination.screenKey;
124
+ }, (matchedScreenKey, previousMatchedScreenKey) => {
125
+ "worklet";
126
+
127
+ if (matchedScreenKey === previousMatchedScreenKey) {
128
+ return;
129
+ }
130
+ (0, _reactNativeReanimated.runOnJS)(updatePortalAttachment)(matchedScreenKey, sourcePairKey);
131
+ });
132
+ const teleportProps = (0, _reactNativeReanimated.useAnimatedProps)(() => {
133
+ "worklet";
134
+
135
+ // Opening waits for the destination transition to start so content is not
136
+ // re-parented before the host is visually ready. Closing stays attached
137
+ // through progress 0 so the final frame can land in the matched host.
138
+ const attachThreshold = closing.get() === 1 ? 0 : 0.001;
139
+ const {
140
+ teleport,
141
+ ...slotProps
142
+ } = stylesMap.get()[id]?.props ?? {};
143
+ const shouldTeleport = (0, _teleportControl.isTeleportEnabled)(teleport);
144
+ return {
145
+ // Preserve portal slot props from the interpolator while keeping
146
+ // hostName owned by the attachment gate below.
147
+ ...slotProps,
148
+ hostName: shouldTeleport && progress.get() >= attachThreshold ? attachedHostName.get() : _naming.PORTAL_HOST_NAME_RESET_VALUE
149
+ };
150
+ });
151
+
152
+ // Pin the placeholder to its measured size while content lives in the host,
153
+ // in the same UI frame the host name flips — no commit in between. Until the
154
+ // first layout lands (dims 0) sizing stays natural so an instant attach
155
+ // cannot collapse the slot.
156
+ const placeholderStyle = (0, _reactNativeReanimated.useAnimatedStyle)(() => {
157
+ "worklet";
158
+
159
+ const hostName = attachedHostName.get();
160
+ const isAttached = hostName !== null;
161
+ const width = placeholderWidth.get();
162
+ const height = placeholderHeight.get();
163
+ if (!isAttached || width === 0) {
164
+ return {
165
+ width: "auto",
166
+ height: "auto"
167
+ };
168
+ }
169
+ return {
170
+ width,
171
+ height
172
+ };
173
+ });
174
+ if (isPortalEnabled) {
175
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeReanimated.default.View, {
176
+ ref: placeholderRef,
177
+ onLayout: event => {
178
+ placeholderWidth.set(event.nativeEvent.layout.width);
179
+ placeholderHeight.set(event.nativeEvent.layout.height);
180
+ },
181
+ style: placeholderStyle,
182
+ collapsable: false,
183
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(TransitionAwareTeleport, {
184
+ animatedProps: teleportProps,
185
+ name: id,
186
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeReanimated.default.View, {
187
+ style: placeholderStyle,
188
+ children: children
189
+ })
190
+ })
191
+ });
192
+ }
193
+ return children;
194
+ });
195
+ //# sourceMappingURL=portal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","require","_reactNativeReanimated","_interopRequireWildcard","_reactNativeTeleport","_descriptors","_styles","_animation","_linkPairs","_links","_state","_createTransitionAwareComponent","_hostRegistry","_portalBoundaryHost","_attachment","_naming","_teleportControl","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","TransitionAwareTeleport","createTransitionAwareComponent","NativePortal","Portal","exports","memo","id","children","mode","placeholderRef","isPortalEnabled","portalAttachTarget","attachTo","stylesMap","useScreenStyles","sourcePairKey","useDescriptorsStore","s","derivations","currentScreenKey","nextScreenKey","attachment","setAttachment","useState","PORTAL_HOST_NAME_RESET_VALUE","attachedHostName","useSharedValue","placeholderWidth","placeholderHeight","progressScreenKey","targetScreenKey","resolvePortalAttachmentTargets","activeHostKey","useActiveHostKey","activeHostCapturesScroll","getHostCapturesScroll","progress","AnimationStore","getValue","closing","updatePortalAttachment","useCallback","matchedScreenKey","pairKey","current","useLayoutEffect","mountPortalBoundaryHost","boundaryId","capturesScroll","hostKey","screenKey","createPortalBoundaryHostName","unmountPortalBoundaryHost","useAnimatedReaction","pairs","link","getLink","status","group","activeId","groups","getLinkKeyFromTag","destination","previousMatchedScreenKey","runOnJS","teleportProps","useAnimatedProps","attachThreshold","teleport","slotProps","props","shouldTeleport","isTeleportEnabled","hostName","placeholderStyle","useAnimatedStyle","isAttached","width","height","jsx","View","ref","onLayout","event","nativeEvent","layout","style","collapsable","animatedProps","name"],"sourceRoot":"../../../../../../../src","sources":["shared/components/boundary/portal/components/portal.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAUA,IAAAC,sBAAA,GAAAC,uBAAA,CAAAF,OAAA;AAQA,IAAAG,oBAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,UAAA,GAAAN,OAAA;AACA,IAAAO,UAAA,GAAAP,OAAA;AACA,IAAAQ,MAAA,GAAAR,OAAA;AACA,IAAAS,MAAA,GAAAT,OAAA;AACA,IAAAU,+BAAA,GAAAV,OAAA;AAEA,IAAAW,aAAA,GAAAX,OAAA;AAIA,IAAAY,mBAAA,GAAAZ,OAAA;AAIA,IAAAa,WAAA,GAAAb,OAAA;AAIA,IAAAc,OAAA,GAAAd,OAAA;AAIA,IAAAe,gBAAA,GAAAf,OAAA;AAA8D,IAAAgB,WAAA,GAAAhB,OAAA;AAAA,SAAAE,wBAAAe,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAjB,uBAAA,YAAAA,CAAAe,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,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+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useHostMeasurement = void 0;
7
+ var _react = require("react");
8
+ var _reactNativeReanimated = require("react-native-reanimated");
9
+ var _origin = require("../../../../providers/screen/origin.provider");
10
+ var _scroll = require("../../../../stores/scroll.store");
11
+ var _measuredBounds = require("../../utils/measured-bounds");
12
+ var _hostBounds = require("../stores/host-bounds.store");
13
+ const useHostMeasurement = ({
14
+ capturesScroll,
15
+ enabled,
16
+ hostKey,
17
+ screenKey
18
+ }) => {
19
+ const hostRef = (0, _reactNativeReanimated.useAnimatedRef)();
20
+ const scrollMetadata = _scroll.ScrollStore.getValue(screenKey, "metadata");
21
+ const [canRenderHosts, setCanRenderHosts] = (0, _react.useState)(false);
22
+ const {
23
+ originRef
24
+ } = (0, _origin.useOriginContext)();
25
+ const hasMeasuredHost = (0, _reactNativeReanimated.useSharedValue)(false);
26
+ (0, _reactNativeReanimated.useAnimatedReaction)(() => {
27
+ "worklet";
28
+
29
+ if (!enabled) {
30
+ return null;
31
+ }
32
+ return hasMeasuredHost.get();
33
+ }, hasAlreadyMeasured => {
34
+ "worklet";
35
+
36
+ if (!enabled || hasAlreadyMeasured) {
37
+ return;
38
+ }
39
+ const measured = (0, _reactNativeReanimated.measure)(hostRef);
40
+ const measuredOrigin = (0, _reactNativeReanimated.measure)(originRef);
41
+ if (!measured || !measuredOrigin) {
42
+ return;
43
+ }
44
+ hasMeasuredHost.set(true);
45
+
46
+ // A measurement taken mid rubber-band would bake the transient
47
+ // overscroll displacement into the host frame. Store the at-rest
48
+ // position instead; clamped scroll deltas share that basis.
49
+ const currentScroll = scrollMetadata.get();
50
+ const overscrollNormalized = capturesScroll ? (0, _measuredBounds.adjustedMeasuredBoundsForOverscrollDeltas)(measured, currentScroll) : measured;
51
+ const normalizedMeasured = (0, _measuredBounds.normalizeMeasuredBoundsToOrigin)(overscrollNormalized, measuredOrigin);
52
+ (0, _hostBounds.setPortalHostBounds)(hostKey, {
53
+ x: normalizedMeasured.x,
54
+ y: normalizedMeasured.y,
55
+ width: normalizedMeasured.width,
56
+ height: normalizedMeasured.height,
57
+ pageX: normalizedMeasured.pageX,
58
+ pageY: normalizedMeasured.pageY,
59
+ scroll: capturesScroll ? currentScroll : null
60
+ });
61
+ (0, _reactNativeReanimated.runOnJS)(setCanRenderHosts)(true);
62
+ });
63
+ (0, _react.useLayoutEffect)(() => {
64
+ return () => {
65
+ (0, _reactNativeReanimated.runOnUI)(_hostBounds.clearPortalHostBounds)(hostKey);
66
+ };
67
+ }, [hostKey]);
68
+ return {
69
+ canRenderHosts,
70
+ hostRef
71
+ };
72
+ };
73
+ exports.useHostMeasurement = useHostMeasurement;
74
+ //# sourceMappingURL=use-host-measurement.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","require","_reactNativeReanimated","_origin","_scroll","_measuredBounds","_hostBounds","useHostMeasurement","capturesScroll","enabled","hostKey","screenKey","hostRef","useAnimatedRef","scrollMetadata","ScrollStore","getValue","canRenderHosts","setCanRenderHosts","useState","originRef","useOriginContext","hasMeasuredHost","useSharedValue","useAnimatedReaction","get","hasAlreadyMeasured","measured","measure","measuredOrigin","set","currentScroll","overscrollNormalized","adjustedMeasuredBoundsForOverscrollDeltas","normalizedMeasured","normalizeMeasuredBoundsToOrigin","setPortalHostBounds","x","y","width","height","pageX","pageY","scroll","runOnJS","useLayoutEffect","runOnUI","clearPortalHostBounds","exports"],"sourceRoot":"../../../../../../../src","sources":["shared/components/boundary/portal/hooks/use-host-measurement.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAAC,sBAAA,GAAAD,OAAA;AAQA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,eAAA,GAAAJ,OAAA;AAIA,IAAAK,WAAA,GAAAL,OAAA;AAYO,MAAMM,kBAAkB,GAAGA,CAAC;EAClCC,cAAc;EACdC,OAAO;EACPC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,KAAK,EAAEL,kBAAkB,CAACK,KAAK;MAC/BC,MAAM,EAAEN,kBAAkB,CAACM,MAAM;MACjCC,KAAK,EAAEP,kBAAkB,CAACO,KAAK;MAC/BC,KAAK,EAAER,kBAAkB,CAACQ,KAAK;MAC/BC,MAAM,EAAEnC,cAAc,GAAGuB,aAAa,GAAG;IAC1C,CAAC,CAAC;IAEF,IAAAa,8BAAO,EAAC1B,iBAAiB,CAAC,CAAC,IAAI,CAAC;EACjC,CACD,CAAC;EAED,IAAA2B,sBAAe,EAAC,MAAM;IACrB,OAAO,MAAM;MACZ,IAAAC,8BAAO,EAACC,iCAAqB,CAAC,CAACrC,OAAO,CAAC;IACxC,CAAC;EACF,CAAC,EAAE,CAACA,OAAO,CAAC,CAAC;EAEb,OAAO;IACNO,cAAc;IACdL;EACD,CAAC;AACF,CAAC;AAACoC,OAAA,CAAAzC,kBAAA,GAAAA,kBAAA","ignoreList":[]}
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "Host", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _host.Host;
10
+ }
11
+ });
12
+ Object.defineProperty(exports, "Portal", {
13
+ enumerable: true,
14
+ get: function () {
15
+ return _portal.Portal;
16
+ }
17
+ });
18
+ Object.defineProperty(exports, "PortalProvider", {
19
+ enumerable: true,
20
+ get: function () {
21
+ return _portalProvider.PortalProvider;
22
+ }
23
+ });
24
+ var _host = require("./components/host");
25
+ var _portal = require("./components/portal");
26
+ var _portalProvider = require("./components/portal-provider");
27
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_host","require","_portal","_portalProvider"],"sourceRoot":"../../../../../../src","sources":["shared/components/boundary/portal/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,eAAA,GAAAF,OAAA","ignoreList":[]}
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.setPortalHostBounds = exports.getPortalHostBounds = exports.clearPortalHostBounds = void 0;
7
+ var _reactNativeReanimated = require("react-native-reanimated");
8
+ var _scroll = require("../../../../stores/scroll.store");
9
+ const portalHostBounds = (0, _reactNativeReanimated.makeMutable)({});
10
+ const getPortalHostBounds = hostKey => {
11
+ "worklet";
12
+
13
+ return portalHostBounds.get()[hostKey] ?? null;
14
+ };
15
+ exports.getPortalHostBounds = getPortalHostBounds;
16
+ const setPortalHostBounds = (hostKey, bounds) => {
17
+ "worklet";
18
+
19
+ const nextBounds = {
20
+ ...bounds,
21
+ scroll: (0, _scroll.cloneScrollMetadataState)(bounds.scroll)
22
+ };
23
+ portalHostBounds.set(state => {
24
+ "worklet";
25
+
26
+ return {
27
+ ...state,
28
+ [hostKey]: nextBounds
29
+ };
30
+ });
31
+ };
32
+ exports.setPortalHostBounds = setPortalHostBounds;
33
+ const clearPortalHostBounds = hostKey => {
34
+ "worklet";
35
+
36
+ portalHostBounds.set(state => {
37
+ "worklet";
38
+
39
+ const nextState = {
40
+ ...state
41
+ };
42
+ delete nextState[hostKey];
43
+ return nextState;
44
+ });
45
+ };
46
+ exports.clearPortalHostBounds = clearPortalHostBounds;
47
+ //# sourceMappingURL=host-bounds.store.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNativeReanimated","require","_scroll","portalHostBounds","makeMutable","getPortalHostBounds","hostKey","get","exports","setPortalHostBounds","bounds","nextBounds","scroll","cloneScrollMetadataState","set","state","clearPortalHostBounds","nextState"],"sourceRoot":"../../../../../../../src","sources":["shared/components/boundary/portal/stores/host-bounds.store.ts"],"mappings":";;;;;;AAAA,IAAAA,sBAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AASA,MAAME,gBAAgB,GAAG,IAAAC,kCAAW,EAAwB,CAAC,CAAC,CAAC;AAExD,MAAMC,mBAAmB,GAAIC,OAAe,IAAK;EACvD,SAAS;;EACT,OAAOH,gBAAgB,CAACI,GAAG,CAAC,CAAC,CAACD,OAAO,CAAC,IAAI,IAAI;AAC/C,CAAC;AAACE,OAAA,CAAAH,mBAAA,GAAAA,mBAAA;AAEK,MAAMI,mBAAmB,GAAGA,CAClCH,OAAe,EACfI,MAAwB,KACpB;EACJ,SAAS;;EACT,MAAMC,UAA4B,GAAG;IACpC,GAAGD,MAAM;IACTE,MAAM,EAAE,IAAAC,gCAAwB,EAACH,MAAM,CAACE,MAAM;EAC/C,CAAC;EAEDT,gBAAgB,CAACW,GAAG,CAAEC,KAAK,IAAK;IAC/B,SAAS;;IACT,OAAO;MACN,GAAGA,KAAK;MACR,CAACT,OAAO,GAAGK;IACZ,CAAC;EACF,CAAC,CAAC;AACH,CAAC;AAACH,OAAA,CAAAC,mBAAA,GAAAA,mBAAA;AAEK,MAAMO,qBAAqB,GAAIV,OAAe,IAAK;EACzD,SAAS;;EACTH,gBAAgB,CAACW,GAAG,CAAEC,KAAK,IAAK;IAC/B,SAAS;;IACT,MAAME,SAAgC,GAAG;MAAE,GAAGF;IAAM,CAAC;IACrD,OAAOE,SAAS,CAACX,OAAO,CAAC;IACzB,OAAOW,SAAS;EACjB,CAAC,CAAC;AACH,CAAC;AAACT,OAAA,CAAAQ,qBAAA,GAAAA,qBAAA","ignoreList":[]}