react-native-screen-transitions 3.8.0 → 3.9.0-alpha.1

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 (528) 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 +18 -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 +74 -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 +20 -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 +198 -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/teleport.js +23 -0
  37. package/lib/commonjs/shared/components/boundary/portal/teleport.js.map +1 -0
  38. package/lib/commonjs/shared/components/boundary/portal/utils/attachment.js +40 -0
  39. package/lib/commonjs/shared/components/boundary/portal/utils/attachment.js.map +1 -0
  40. package/lib/commonjs/shared/components/boundary/portal/utils/naming.js +15 -0
  41. package/lib/commonjs/shared/components/boundary/portal/utils/naming.js.map +1 -0
  42. package/lib/commonjs/shared/components/boundary/portal/utils/offset-style.js +71 -0
  43. package/lib/commonjs/shared/components/boundary/portal/utils/offset-style.js.map +1 -0
  44. package/lib/commonjs/shared/components/boundary/portal/utils/teleport-control.js +16 -0
  45. package/lib/commonjs/shared/components/boundary/portal/utils/teleport-control.js.map +1 -0
  46. package/lib/commonjs/shared/components/{create-boundary-component → boundary}/providers/boundary-owner.provider.js +26 -25
  47. package/lib/commonjs/shared/components/boundary/providers/boundary-owner.provider.js.map +1 -0
  48. package/lib/commonjs/shared/components/boundary/types.js.map +1 -0
  49. package/lib/commonjs/shared/components/boundary/utils/destination-signals.js +25 -0
  50. package/lib/commonjs/shared/components/boundary/utils/destination-signals.js.map +1 -0
  51. package/lib/commonjs/shared/components/{create-boundary-component → boundary}/utils/measured-bounds.js +19 -9
  52. package/lib/commonjs/shared/components/boundary/utils/measured-bounds.js.map +1 -0
  53. package/lib/commonjs/shared/components/boundary/utils/refresh-signals.js +105 -0
  54. package/lib/commonjs/shared/components/boundary/utils/refresh-signals.js.map +1 -0
  55. package/lib/commonjs/shared/components/boundary/utils/source-signals.js +48 -0
  56. package/lib/commonjs/shared/components/boundary/utils/source-signals.js.map +1 -0
  57. package/lib/commonjs/shared/components/create-transition-aware-component.js +8 -3
  58. package/lib/commonjs/shared/components/create-transition-aware-component.js.map +1 -1
  59. package/lib/commonjs/shared/components/{integrations/masked-view.js → masked-view.js} +2 -2
  60. package/lib/commonjs/shared/components/masked-view.js.map +1 -0
  61. package/lib/commonjs/shared/components/screen-container/layers/content.js +9 -5
  62. package/lib/commonjs/shared/components/screen-container/layers/content.js.map +1 -1
  63. package/lib/commonjs/shared/configs/presets.js +6 -6
  64. package/lib/commonjs/shared/configs/presets.js.map +1 -1
  65. package/lib/commonjs/shared/hooks/navigation/use-stack.js +17 -2
  66. package/lib/commonjs/shared/hooks/navigation/use-stack.js.map +1 -1
  67. package/lib/commonjs/shared/index.js +4 -4
  68. package/lib/commonjs/shared/index.js.map +1 -1
  69. package/lib/commonjs/shared/providers/helpers/measured-bounds-writes.js +4 -2
  70. package/lib/commonjs/shared/providers/helpers/measured-bounds-writes.js.map +1 -1
  71. package/lib/commonjs/shared/providers/screen/animation/helpers/pipeline.js +4 -13
  72. package/lib/commonjs/shared/providers/screen/animation/helpers/pipeline.js.map +1 -1
  73. package/lib/commonjs/shared/providers/screen/animation/helpers/stack-progress.js +23 -12
  74. package/lib/commonjs/shared/providers/screen/animation/helpers/stack-progress.js.map +1 -1
  75. package/lib/commonjs/shared/providers/screen/animation/helpers/use-build-transition-state.js +1 -0
  76. package/lib/commonjs/shared/providers/screen/animation/helpers/use-build-transition-state.js.map +1 -1
  77. package/lib/commonjs/shared/providers/screen/descriptors/descriptors.provider.js +7 -3
  78. package/lib/commonjs/shared/providers/screen/descriptors/descriptors.provider.js.map +1 -1
  79. package/lib/commonjs/shared/providers/screen/descriptors/helpers/derive-descriptor-derivations.js +8 -1
  80. package/lib/commonjs/shared/providers/screen/descriptors/helpers/derive-descriptor-derivations.js.map +1 -1
  81. package/lib/commonjs/shared/providers/screen/descriptors/helpers/get-ancestor-keys.js +21 -6
  82. package/lib/commonjs/shared/providers/screen/descriptors/helpers/get-ancestor-keys.js.map +1 -1
  83. package/lib/commonjs/shared/providers/screen/origin.provider.js +41 -0
  84. package/lib/commonjs/shared/providers/screen/origin.provider.js.map +1 -0
  85. package/lib/commonjs/shared/providers/screen/styles/constants.js +2 -0
  86. package/lib/commonjs/shared/providers/screen/styles/constants.js.map +1 -1
  87. package/lib/commonjs/shared/providers/screen/styles/helpers/resolve-slot-styles/are-resettable-states-equal.js +58 -0
  88. package/lib/commonjs/shared/providers/screen/styles/helpers/resolve-slot-styles/are-resettable-states-equal.js.map +1 -0
  89. package/lib/commonjs/shared/providers/screen/styles/helpers/resolve-slot-styles/index.js +7 -0
  90. package/lib/commonjs/shared/providers/screen/styles/helpers/resolve-slot-styles/index.js.map +1 -1
  91. package/lib/commonjs/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js +2 -1
  92. package/lib/commonjs/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js.map +1 -1
  93. package/lib/commonjs/shared/providers/screen/styles/styles.provider.js +7 -5
  94. package/lib/commonjs/shared/providers/screen/styles/styles.provider.js.map +1 -1
  95. package/lib/commonjs/shared/stores/animation.store.js +2 -0
  96. package/lib/commonjs/shared/stores/animation.store.js.map +1 -1
  97. package/lib/commonjs/shared/stores/bounds/helpers/link-pairs.helpers.js +1 -10
  98. package/lib/commonjs/shared/stores/bounds/helpers/link-pairs.helpers.js.map +1 -1
  99. package/lib/commonjs/shared/stores/bounds/index.js.map +1 -1
  100. package/lib/commonjs/shared/stores/bounds/internals/entries.js.map +1 -1
  101. package/lib/commonjs/shared/stores/bounds/internals/links.js +36 -19
  102. package/lib/commonjs/shared/stores/bounds/internals/links.js.map +1 -1
  103. package/lib/commonjs/shared/stores/bounds/internals/resolver.js +6 -4
  104. package/lib/commonjs/shared/stores/bounds/internals/resolver.js.map +1 -1
  105. package/lib/commonjs/shared/stores/bounds/internals/state.js.map +1 -1
  106. package/lib/commonjs/shared/stores/scroll.store.js +54 -1
  107. package/lib/commonjs/shared/stores/scroll.store.js.map +1 -1
  108. package/lib/commonjs/shared/utils/bounds/helpers/create-bound-tag.js +38 -4
  109. package/lib/commonjs/shared/utils/bounds/helpers/create-bound-tag.js.map +1 -1
  110. package/lib/commonjs/shared/utils/bounds/helpers/create-bounds-accessor-core.js +40 -87
  111. package/lib/commonjs/shared/utils/bounds/helpers/create-bounds-accessor-core.js.map +1 -1
  112. package/lib/commonjs/shared/utils/bounds/helpers/create-link-accessor.js +6 -67
  113. package/lib/commonjs/shared/utils/bounds/helpers/create-link-accessor.js.map +1 -1
  114. package/lib/commonjs/shared/utils/bounds/helpers/prepare-bound-styles.js +8 -12
  115. package/lib/commonjs/shared/utils/bounds/helpers/prepare-bound-styles.js.map +1 -1
  116. package/lib/commonjs/shared/utils/bounds/helpers/styles/composers.js +235 -68
  117. package/lib/commonjs/shared/utils/bounds/helpers/styles/composers.js.map +1 -1
  118. package/lib/commonjs/shared/utils/bounds/helpers/styles/compute.js +74 -4
  119. package/lib/commonjs/shared/utils/bounds/helpers/styles/compute.js.map +1 -1
  120. package/lib/commonjs/shared/utils/bounds/navigation/reveal/build.js +5 -9
  121. package/lib/commonjs/shared/utils/bounds/navigation/reveal/build.js.map +1 -1
  122. package/lib/commonjs/shared/utils/bounds/navigation/zoom/build.js +5 -10
  123. package/lib/commonjs/shared/utils/bounds/navigation/zoom/build.js.map +1 -1
  124. package/lib/module/blank-stack/components/stack-view.js +3 -2
  125. package/lib/module/blank-stack/components/stack-view.js.map +1 -1
  126. package/lib/module/shared/components/{create-boundary-component → boundary}/components/boundary-target.js +21 -8
  127. package/lib/module/shared/components/boundary/components/boundary-target.js.map +1 -0
  128. package/lib/module/shared/components/{create-boundary-component → boundary}/create-boundary-component.js +20 -26
  129. package/lib/module/shared/components/boundary/create-boundary-component.js.map +1 -0
  130. package/lib/module/shared/components/boundary/hooks/use-boundary-presence.js.map +1 -0
  131. package/lib/module/shared/components/boundary/hooks/use-initial-destination-measurement.js +110 -0
  132. package/lib/module/shared/components/boundary/hooks/use-initial-destination-measurement.js.map +1 -0
  133. package/lib/module/shared/components/{create-boundary-component → boundary}/hooks/use-initial-source-measurement.js +4 -5
  134. package/lib/module/shared/components/boundary/hooks/use-initial-source-measurement.js.map +1 -0
  135. package/lib/module/shared/components/{create-boundary-component → boundary}/hooks/use-measurer.js +27 -23
  136. package/lib/module/shared/components/boundary/hooks/use-measurer.js.map +1 -0
  137. package/lib/module/shared/components/{create-boundary-component → boundary}/hooks/use-refresh-boundary.js +10 -7
  138. package/lib/module/shared/components/boundary/hooks/use-refresh-boundary.js.map +1 -0
  139. package/lib/module/shared/components/{create-boundary-component → boundary}/index.js +8 -1
  140. package/lib/module/shared/components/boundary/index.js.map +1 -0
  141. package/lib/module/shared/components/boundary/portal/components/host.js +94 -0
  142. package/lib/module/shared/components/boundary/portal/components/host.js.map +1 -0
  143. package/lib/module/shared/components/boundary/portal/components/portal-boundary-host.js +69 -0
  144. package/lib/module/shared/components/boundary/portal/components/portal-boundary-host.js.map +1 -0
  145. package/lib/module/shared/components/boundary/portal/components/portal-provider.js +16 -0
  146. package/lib/module/shared/components/boundary/portal/components/portal-provider.js.map +1 -0
  147. package/lib/module/shared/components/boundary/portal/components/portal.js +193 -0
  148. package/lib/module/shared/components/boundary/portal/components/portal.js.map +1 -0
  149. package/lib/module/shared/components/boundary/portal/hooks/use-host-measurement.js +69 -0
  150. package/lib/module/shared/components/boundary/portal/hooks/use-host-measurement.js.map +1 -0
  151. package/lib/module/shared/components/boundary/portal/index.js +6 -0
  152. package/lib/module/shared/components/boundary/portal/index.js.map +1 -0
  153. package/lib/module/shared/components/boundary/portal/stores/host-bounds.store.js +40 -0
  154. package/lib/module/shared/components/boundary/portal/stores/host-bounds.store.js.map +1 -0
  155. package/lib/module/shared/components/boundary/portal/stores/host-registry.store.js +126 -0
  156. package/lib/module/shared/components/boundary/portal/stores/host-registry.store.js.map +1 -0
  157. package/lib/module/shared/components/boundary/portal/stores/portal-boundary-host.store.js +53 -0
  158. package/lib/module/shared/components/boundary/portal/stores/portal-boundary-host.store.js.map +1 -0
  159. package/lib/module/shared/components/boundary/portal/teleport.js +19 -0
  160. package/lib/module/shared/components/boundary/portal/teleport.js.map +1 -0
  161. package/lib/module/shared/components/boundary/portal/utils/attachment.js +35 -0
  162. package/lib/module/shared/components/boundary/portal/utils/attachment.js.map +1 -0
  163. package/lib/module/shared/components/boundary/portal/utils/naming.js +10 -0
  164. package/lib/module/shared/components/boundary/portal/utils/naming.js.map +1 -0
  165. package/lib/module/shared/components/boundary/portal/utils/offset-style.js +66 -0
  166. package/lib/module/shared/components/boundary/portal/utils/offset-style.js.map +1 -0
  167. package/lib/module/shared/components/boundary/portal/utils/teleport-control.js +11 -0
  168. package/lib/module/shared/components/boundary/portal/utils/teleport-control.js.map +1 -0
  169. package/lib/module/shared/components/boundary/providers/boundary-owner.provider.js +60 -0
  170. package/lib/module/shared/components/boundary/providers/boundary-owner.provider.js.map +1 -0
  171. package/lib/module/shared/components/boundary/types.js.map +1 -0
  172. package/lib/module/shared/components/boundary/utils/destination-signals.js +20 -0
  173. package/lib/module/shared/components/boundary/utils/destination-signals.js.map +1 -0
  174. package/lib/module/shared/components/{create-boundary-component → boundary}/utils/measured-bounds.js +16 -7
  175. package/lib/module/shared/components/boundary/utils/measured-bounds.js.map +1 -0
  176. package/lib/module/shared/components/boundary/utils/refresh-signals.js +100 -0
  177. package/lib/module/shared/components/boundary/utils/refresh-signals.js.map +1 -0
  178. package/lib/module/shared/components/boundary/utils/source-signals.js +43 -0
  179. package/lib/module/shared/components/boundary/utils/source-signals.js.map +1 -0
  180. package/lib/module/shared/components/create-transition-aware-component.js +8 -3
  181. package/lib/module/shared/components/create-transition-aware-component.js.map +1 -1
  182. package/lib/module/shared/components/{integrations/masked-view.js → masked-view.js} +2 -2
  183. package/lib/module/shared/components/masked-view.js.map +1 -0
  184. package/lib/module/shared/components/screen-container/layers/content.js +10 -6
  185. package/lib/module/shared/components/screen-container/layers/content.js.map +1 -1
  186. package/lib/module/shared/configs/presets.js +6 -6
  187. package/lib/module/shared/configs/presets.js.map +1 -1
  188. package/lib/module/shared/hooks/navigation/use-stack.js +19 -4
  189. package/lib/module/shared/hooks/navigation/use-stack.js.map +1 -1
  190. package/lib/module/shared/index.js +2 -2
  191. package/lib/module/shared/index.js.map +1 -1
  192. package/lib/module/shared/providers/helpers/measured-bounds-writes.js +4 -2
  193. package/lib/module/shared/providers/helpers/measured-bounds-writes.js.map +1 -1
  194. package/lib/module/shared/providers/screen/animation/helpers/pipeline.js +5 -14
  195. package/lib/module/shared/providers/screen/animation/helpers/pipeline.js.map +1 -1
  196. package/lib/module/shared/providers/screen/animation/helpers/stack-progress.js +20 -10
  197. package/lib/module/shared/providers/screen/animation/helpers/stack-progress.js.map +1 -1
  198. package/lib/module/shared/providers/screen/animation/helpers/use-build-transition-state.js +1 -0
  199. package/lib/module/shared/providers/screen/animation/helpers/use-build-transition-state.js.map +1 -1
  200. package/lib/module/shared/providers/screen/descriptors/descriptors.provider.js +8 -4
  201. package/lib/module/shared/providers/screen/descriptors/descriptors.provider.js.map +1 -1
  202. package/lib/module/shared/providers/screen/descriptors/helpers/derive-descriptor-derivations.js +8 -1
  203. package/lib/module/shared/providers/screen/descriptors/helpers/derive-descriptor-derivations.js.map +1 -1
  204. package/lib/module/shared/providers/screen/descriptors/helpers/get-ancestor-keys.js +20 -6
  205. package/lib/module/shared/providers/screen/descriptors/helpers/get-ancestor-keys.js.map +1 -1
  206. package/lib/module/shared/providers/screen/origin.provider.js +33 -0
  207. package/lib/module/shared/providers/screen/origin.provider.js.map +1 -0
  208. package/lib/module/shared/providers/screen/styles/constants.js +2 -0
  209. package/lib/module/shared/providers/screen/styles/constants.js.map +1 -1
  210. package/lib/module/shared/providers/screen/styles/helpers/resolve-slot-styles/are-resettable-states-equal.js +53 -0
  211. package/lib/module/shared/providers/screen/styles/helpers/resolve-slot-styles/are-resettable-states-equal.js.map +1 -0
  212. package/lib/module/shared/providers/screen/styles/helpers/resolve-slot-styles/index.js +1 -0
  213. package/lib/module/shared/providers/screen/styles/helpers/resolve-slot-styles/index.js.map +1 -1
  214. package/lib/module/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js +2 -1
  215. package/lib/module/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js.map +1 -1
  216. package/lib/module/shared/providers/screen/styles/styles.provider.js +7 -5
  217. package/lib/module/shared/providers/screen/styles/styles.provider.js.map +1 -1
  218. package/lib/module/shared/stores/animation.store.js +2 -0
  219. package/lib/module/shared/stores/animation.store.js.map +1 -1
  220. package/lib/module/shared/stores/bounds/helpers/link-pairs.helpers.js +1 -8
  221. package/lib/module/shared/stores/bounds/helpers/link-pairs.helpers.js.map +1 -1
  222. package/lib/module/shared/stores/bounds/index.js.map +1 -1
  223. package/lib/module/shared/stores/bounds/internals/entries.js.map +1 -1
  224. package/lib/module/shared/stores/bounds/internals/links.js +36 -19
  225. package/lib/module/shared/stores/bounds/internals/links.js.map +1 -1
  226. package/lib/module/shared/stores/bounds/internals/resolver.js +6 -4
  227. package/lib/module/shared/stores/bounds/internals/resolver.js.map +1 -1
  228. package/lib/module/shared/stores/bounds/internals/state.js.map +1 -1
  229. package/lib/module/shared/stores/scroll.store.js +50 -0
  230. package/lib/module/shared/stores/scroll.store.js.map +1 -1
  231. package/lib/module/shared/types/animation.types.js.map +1 -1
  232. package/lib/module/shared/types/bounds.types.js.map +1 -1
  233. package/lib/module/shared/utils/bounds/helpers/create-bound-tag.js +36 -3
  234. package/lib/module/shared/utils/bounds/helpers/create-bound-tag.js.map +1 -1
  235. package/lib/module/shared/utils/bounds/helpers/create-bounds-accessor-core.js +42 -89
  236. package/lib/module/shared/utils/bounds/helpers/create-bounds-accessor-core.js.map +1 -1
  237. package/lib/module/shared/utils/bounds/helpers/create-link-accessor.js +6 -67
  238. package/lib/module/shared/utils/bounds/helpers/create-link-accessor.js.map +1 -1
  239. package/lib/module/shared/utils/bounds/helpers/prepare-bound-styles.js +8 -13
  240. package/lib/module/shared/utils/bounds/helpers/prepare-bound-styles.js.map +1 -1
  241. package/lib/module/shared/utils/bounds/helpers/styles/composers.js +236 -69
  242. package/lib/module/shared/utils/bounds/helpers/styles/composers.js.map +1 -1
  243. package/lib/module/shared/utils/bounds/helpers/styles/compute.js +74 -4
  244. package/lib/module/shared/utils/bounds/helpers/styles/compute.js.map +1 -1
  245. package/lib/module/shared/utils/bounds/navigation/reveal/build.js +5 -9
  246. package/lib/module/shared/utils/bounds/navigation/reveal/build.js.map +1 -1
  247. package/lib/module/shared/utils/bounds/navigation/zoom/build.js +5 -10
  248. package/lib/module/shared/utils/bounds/navigation/zoom/build.js.map +1 -1
  249. package/lib/typescript/blank-stack/components/stack-view.d.ts.map +1 -1
  250. package/lib/typescript/shared/components/boundary/components/boundary-target.d.ts.map +1 -0
  251. package/lib/typescript/shared/components/boundary/create-boundary-component.d.ts.map +1 -0
  252. package/lib/typescript/shared/components/boundary/hooks/use-boundary-presence.d.ts.map +1 -0
  253. package/lib/typescript/shared/components/{create-boundary-component → boundary}/hooks/use-initial-destination-measurement.d.ts +1 -4
  254. package/lib/typescript/shared/components/boundary/hooks/use-initial-destination-measurement.d.ts.map +1 -0
  255. package/lib/typescript/shared/components/{create-boundary-component → boundary}/hooks/use-initial-source-measurement.d.ts +0 -2
  256. package/lib/typescript/shared/components/boundary/hooks/use-initial-source-measurement.d.ts.map +1 -0
  257. package/lib/typescript/shared/components/{create-boundary-component → boundary}/hooks/use-measurer.d.ts +4 -2
  258. package/lib/typescript/shared/components/boundary/hooks/use-measurer.d.ts.map +1 -0
  259. package/lib/typescript/shared/components/boundary/hooks/use-refresh-boundary.d.ts +10 -0
  260. package/lib/typescript/shared/components/boundary/hooks/use-refresh-boundary.d.ts.map +1 -0
  261. package/lib/typescript/shared/components/{create-boundary-component → boundary}/index.d.ts +8 -2
  262. package/lib/typescript/shared/components/boundary/index.d.ts.map +1 -0
  263. package/lib/typescript/shared/components/boundary/portal/components/host.d.ts +7 -0
  264. package/lib/typescript/shared/components/boundary/portal/components/host.d.ts.map +1 -0
  265. package/lib/typescript/shared/components/boundary/portal/components/portal-boundary-host.d.ts +9 -0
  266. package/lib/typescript/shared/components/boundary/portal/components/portal-boundary-host.d.ts.map +1 -0
  267. package/lib/typescript/shared/components/boundary/portal/components/portal-provider.d.ts +4 -0
  268. package/lib/typescript/shared/components/boundary/portal/components/portal-provider.d.ts.map +1 -0
  269. package/lib/typescript/shared/components/boundary/portal/components/portal.d.ts +19 -0
  270. package/lib/typescript/shared/components/boundary/portal/components/portal.d.ts.map +1 -0
  271. package/lib/typescript/shared/components/boundary/portal/hooks/use-host-measurement.d.ts +13 -0
  272. package/lib/typescript/shared/components/boundary/portal/hooks/use-host-measurement.d.ts.map +1 -0
  273. package/lib/typescript/shared/components/boundary/portal/index.d.ts +4 -0
  274. package/lib/typescript/shared/components/boundary/portal/index.d.ts.map +1 -0
  275. package/lib/typescript/shared/components/boundary/portal/stores/host-bounds.store.d.ts +9 -0
  276. package/lib/typescript/shared/components/boundary/portal/stores/host-bounds.store.d.ts.map +1 -0
  277. package/lib/typescript/shared/components/boundary/portal/stores/host-registry.store.d.ts +19 -0
  278. package/lib/typescript/shared/components/boundary/portal/stores/host-registry.store.d.ts.map +1 -0
  279. package/lib/typescript/shared/components/boundary/portal/stores/portal-boundary-host.store.d.ts +11 -0
  280. package/lib/typescript/shared/components/boundary/portal/stores/portal-boundary-host.store.d.ts.map +1 -0
  281. package/lib/typescript/shared/components/boundary/portal/teleport.d.ts +6 -0
  282. package/lib/typescript/shared/components/boundary/portal/teleport.d.ts.map +1 -0
  283. package/lib/typescript/shared/components/boundary/portal/utils/attachment.d.ts +21 -0
  284. package/lib/typescript/shared/components/boundary/portal/utils/attachment.d.ts.map +1 -0
  285. package/lib/typescript/shared/components/boundary/portal/utils/naming.d.ts +3 -0
  286. package/lib/typescript/shared/components/boundary/portal/utils/naming.d.ts.map +1 -0
  287. package/lib/typescript/shared/components/boundary/portal/utils/offset-style.d.ts +37 -0
  288. package/lib/typescript/shared/components/boundary/portal/utils/offset-style.d.ts.map +1 -0
  289. package/lib/typescript/shared/components/boundary/portal/utils/teleport-control.d.ts +3 -0
  290. package/lib/typescript/shared/components/boundary/portal/utils/teleport-control.d.ts.map +1 -0
  291. package/lib/typescript/shared/components/{create-boundary-component → boundary}/providers/boundary-owner.provider.d.ts +14 -6
  292. package/lib/typescript/shared/components/boundary/providers/boundary-owner.provider.d.ts.map +1 -0
  293. package/lib/typescript/shared/components/boundary/types.d.ts +78 -0
  294. package/lib/typescript/shared/components/boundary/types.d.ts.map +1 -0
  295. package/lib/typescript/shared/components/{create-boundary-component → boundary}/utils/destination-signals.d.ts +2 -3
  296. package/lib/typescript/shared/components/boundary/utils/destination-signals.d.ts.map +1 -0
  297. package/lib/typescript/shared/components/boundary/utils/measured-bounds.d.ts +12 -0
  298. package/lib/typescript/shared/components/boundary/utils/measured-bounds.d.ts.map +1 -0
  299. package/lib/typescript/shared/components/{create-boundary-component → boundary}/utils/refresh-signals.d.ts +4 -3
  300. package/lib/typescript/shared/components/boundary/utils/refresh-signals.d.ts.map +1 -0
  301. package/lib/typescript/shared/components/{create-boundary-component → boundary}/utils/source-signals.d.ts +1 -2
  302. package/lib/typescript/shared/components/boundary/utils/source-signals.d.ts.map +1 -0
  303. package/lib/typescript/shared/components/create-transition-aware-component.d.ts.map +1 -1
  304. package/lib/typescript/shared/components/masked-view.d.ts.map +1 -0
  305. package/lib/typescript/shared/components/screen-container/layers/content.d.ts.map +1 -1
  306. package/lib/typescript/shared/configs/presets.d.ts.map +1 -1
  307. package/lib/typescript/shared/hooks/navigation/use-stack.d.ts.map +1 -1
  308. package/lib/typescript/shared/index.d.ts +19 -17
  309. package/lib/typescript/shared/index.d.ts.map +1 -1
  310. package/lib/typescript/shared/providers/helpers/measured-bounds-writes.d.ts +3 -1
  311. package/lib/typescript/shared/providers/helpers/measured-bounds-writes.d.ts.map +1 -1
  312. package/lib/typescript/shared/providers/screen/animation/helpers/hydrate-transition-state/types.d.ts +1 -0
  313. package/lib/typescript/shared/providers/screen/animation/helpers/hydrate-transition-state/types.d.ts.map +1 -1
  314. package/lib/typescript/shared/providers/screen/animation/helpers/pipeline.d.ts.map +1 -1
  315. package/lib/typescript/shared/providers/screen/animation/helpers/stack-progress.d.ts +2 -1
  316. package/lib/typescript/shared/providers/screen/animation/helpers/stack-progress.d.ts.map +1 -1
  317. package/lib/typescript/shared/providers/screen/animation/helpers/use-build-transition-state.d.ts +1 -0
  318. package/lib/typescript/shared/providers/screen/animation/helpers/use-build-transition-state.d.ts.map +1 -1
  319. package/lib/typescript/shared/providers/screen/descriptors/descriptors.provider.d.ts.map +1 -1
  320. package/lib/typescript/shared/providers/screen/descriptors/helpers/derive-descriptor-derivations.d.ts +6 -1
  321. package/lib/typescript/shared/providers/screen/descriptors/helpers/derive-descriptor-derivations.d.ts.map +1 -1
  322. package/lib/typescript/shared/providers/screen/descriptors/helpers/get-ancestor-keys.d.ts +9 -3
  323. package/lib/typescript/shared/providers/screen/descriptors/helpers/get-ancestor-keys.d.ts.map +1 -1
  324. package/lib/typescript/shared/providers/screen/origin.provider.d.ts +11 -0
  325. package/lib/typescript/shared/providers/screen/origin.provider.d.ts.map +1 -0
  326. package/lib/typescript/shared/providers/screen/styles/constants.d.ts.map +1 -1
  327. package/lib/typescript/shared/providers/screen/styles/helpers/resolve-slot-styles/are-resettable-states-equal.d.ts +3 -0
  328. package/lib/typescript/shared/providers/screen/styles/helpers/resolve-slot-styles/are-resettable-states-equal.d.ts.map +1 -0
  329. package/lib/typescript/shared/providers/screen/styles/helpers/resolve-slot-styles/index.d.ts +1 -0
  330. package/lib/typescript/shared/providers/screen/styles/helpers/resolve-slot-styles/index.d.ts.map +1 -1
  331. package/lib/typescript/shared/providers/screen/styles/hooks/use-maybe-block-visibility.d.ts +1 -0
  332. package/lib/typescript/shared/providers/screen/styles/hooks/use-maybe-block-visibility.d.ts.map +1 -1
  333. package/lib/typescript/shared/providers/screen/styles/styles.provider.d.ts +1 -0
  334. package/lib/typescript/shared/providers/screen/styles/styles.provider.d.ts.map +1 -1
  335. package/lib/typescript/shared/stores/animation.store.d.ts +1 -0
  336. package/lib/typescript/shared/stores/animation.store.d.ts.map +1 -1
  337. package/lib/typescript/shared/stores/bounds/helpers/link-pairs.helpers.d.ts +1 -3
  338. package/lib/typescript/shared/stores/bounds/helpers/link-pairs.helpers.d.ts.map +1 -1
  339. package/lib/typescript/shared/stores/bounds/index.d.ts +1 -1
  340. package/lib/typescript/shared/stores/bounds/index.d.ts.map +1 -1
  341. package/lib/typescript/shared/stores/bounds/internals/entries.d.ts +2 -2
  342. package/lib/typescript/shared/stores/bounds/internals/entries.d.ts.map +1 -1
  343. package/lib/typescript/shared/stores/bounds/internals/links.d.ts +2 -2
  344. package/lib/typescript/shared/stores/bounds/internals/links.d.ts.map +1 -1
  345. package/lib/typescript/shared/stores/bounds/internals/resolver.d.ts.map +1 -1
  346. package/lib/typescript/shared/stores/bounds/internals/state.d.ts +4 -2
  347. package/lib/typescript/shared/stores/bounds/internals/state.d.ts.map +1 -1
  348. package/lib/typescript/shared/stores/bounds/types.d.ts +47 -12
  349. package/lib/typescript/shared/stores/bounds/types.d.ts.map +1 -1
  350. package/lib/typescript/shared/stores/scroll.store.d.ts +12 -1
  351. package/lib/typescript/shared/stores/scroll.store.d.ts.map +1 -1
  352. package/lib/typescript/shared/types/animation.types.d.ts +13 -2
  353. package/lib/typescript/shared/types/animation.types.d.ts.map +1 -1
  354. package/lib/typescript/shared/types/bounds.types.d.ts +10 -40
  355. package/lib/typescript/shared/types/bounds.types.d.ts.map +1 -1
  356. package/lib/typescript/shared/types/index.d.ts +2 -2
  357. package/lib/typescript/shared/types/index.d.ts.map +1 -1
  358. package/lib/typescript/shared/utils/bounds/helpers/create-bound-tag.d.ts +2 -1
  359. package/lib/typescript/shared/utils/bounds/helpers/create-bound-tag.d.ts.map +1 -1
  360. package/lib/typescript/shared/utils/bounds/helpers/create-bounds-accessor-core.d.ts +7 -11
  361. package/lib/typescript/shared/utils/bounds/helpers/create-bounds-accessor-core.d.ts.map +1 -1
  362. package/lib/typescript/shared/utils/bounds/helpers/create-link-accessor.d.ts +0 -3
  363. package/lib/typescript/shared/utils/bounds/helpers/create-link-accessor.d.ts.map +1 -1
  364. package/lib/typescript/shared/utils/bounds/helpers/prepare-bound-styles.d.ts +7 -3
  365. package/lib/typescript/shared/utils/bounds/helpers/prepare-bound-styles.d.ts.map +1 -1
  366. package/lib/typescript/shared/utils/bounds/helpers/styles/composers.d.ts +3 -0
  367. package/lib/typescript/shared/utils/bounds/helpers/styles/composers.d.ts.map +1 -1
  368. package/lib/typescript/shared/utils/bounds/helpers/styles/compute.d.ts +1 -1
  369. package/lib/typescript/shared/utils/bounds/helpers/styles/compute.d.ts.map +1 -1
  370. package/lib/typescript/shared/utils/bounds/navigation/reveal/build.d.ts.map +1 -1
  371. package/lib/typescript/shared/utils/bounds/navigation/zoom/build.d.ts.map +1 -1
  372. package/lib/typescript/shared/utils/bounds/types/options.d.ts +93 -6
  373. package/lib/typescript/shared/utils/bounds/types/options.d.ts.map +1 -1
  374. package/package.json +8 -2
  375. package/src/blank-stack/components/stack-view.tsx +4 -3
  376. package/src/shared/components/{create-boundary-component → boundary}/components/boundary-target.tsx +28 -11
  377. package/src/shared/components/{create-boundary-component → boundary}/create-boundary-component.tsx +33 -31
  378. package/src/shared/components/boundary/hooks/use-initial-destination-measurement.ts +156 -0
  379. package/src/shared/components/{create-boundary-component → boundary}/hooks/use-initial-source-measurement.ts +5 -14
  380. package/src/shared/components/{create-boundary-component → boundary}/hooks/use-measurer.ts +42 -46
  381. package/src/shared/components/{create-boundary-component → boundary}/hooks/use-refresh-boundary.ts +16 -11
  382. package/src/shared/components/{create-boundary-component → boundary}/index.tsx +12 -0
  383. package/src/shared/components/boundary/portal/components/host.tsx +114 -0
  384. package/src/shared/components/boundary/portal/components/portal-boundary-host.tsx +97 -0
  385. package/src/shared/components/boundary/portal/components/portal-provider.tsx +14 -0
  386. package/src/shared/components/boundary/portal/components/portal.tsx +283 -0
  387. package/src/shared/components/boundary/portal/hooks/use-host-measurement.ts +102 -0
  388. package/src/shared/components/boundary/portal/index.ts +3 -0
  389. package/src/shared/components/boundary/portal/stores/host-bounds.store.ts +45 -0
  390. package/src/shared/components/boundary/portal/stores/host-registry.store.ts +182 -0
  391. package/src/shared/components/boundary/portal/stores/portal-boundary-host.store.ts +91 -0
  392. package/src/shared/components/boundary/portal/teleport.ts +21 -0
  393. package/src/shared/components/boundary/portal/utils/attachment.ts +48 -0
  394. package/src/shared/components/boundary/portal/utils/naming.ts +10 -0
  395. package/src/shared/components/boundary/portal/utils/offset-style.ts +171 -0
  396. package/src/shared/components/boundary/portal/utils/teleport-control.ts +13 -0
  397. package/src/shared/components/{create-boundary-component → boundary}/providers/boundary-owner.provider.tsx +41 -33
  398. package/src/shared/components/boundary/types.ts +92 -0
  399. package/src/shared/components/boundary/utils/destination-signals.ts +31 -0
  400. package/src/shared/components/{create-boundary-component → boundary}/utils/measured-bounds.ts +34 -11
  401. package/src/shared/components/boundary/utils/refresh-signals.ts +175 -0
  402. package/src/shared/components/boundary/utils/source-signals.ts +63 -0
  403. package/src/shared/components/create-transition-aware-component.tsx +8 -3
  404. package/src/shared/components/{integrations/masked-view.tsx → masked-view.tsx} +2 -2
  405. package/src/shared/components/screen-container/layers/content.tsx +12 -7
  406. package/src/shared/configs/presets.ts +2 -6
  407. package/src/shared/hooks/navigation/use-stack.tsx +32 -1
  408. package/src/shared/index.ts +13 -5
  409. package/src/shared/providers/helpers/measured-bounds-writes.ts +11 -1
  410. package/src/shared/providers/screen/animation/helpers/hydrate-transition-state/types.ts +1 -0
  411. package/src/shared/providers/screen/animation/helpers/pipeline.ts +13 -19
  412. package/src/shared/providers/screen/animation/helpers/stack-progress.ts +31 -16
  413. package/src/shared/providers/screen/animation/helpers/use-build-transition-state.ts +2 -0
  414. package/src/shared/providers/screen/descriptors/descriptors.provider.tsx +7 -3
  415. package/src/shared/providers/screen/descriptors/helpers/derive-descriptor-derivations.ts +16 -0
  416. package/src/shared/providers/screen/descriptors/helpers/get-ancestor-keys.ts +31 -6
  417. package/src/shared/providers/screen/origin.provider.tsx +38 -0
  418. package/src/shared/providers/screen/styles/constants.ts +2 -0
  419. package/src/shared/providers/screen/styles/helpers/resolve-slot-styles/are-resettable-states-equal.ts +74 -0
  420. package/src/shared/providers/screen/styles/helpers/resolve-slot-styles/index.ts +1 -0
  421. package/src/shared/providers/screen/styles/hooks/use-maybe-block-visibility.tsx +1 -0
  422. package/src/shared/providers/screen/styles/styles.provider.tsx +5 -3
  423. package/src/shared/stores/animation.store.ts +3 -0
  424. package/src/shared/stores/bounds/helpers/link-pairs.helpers.ts +1 -10
  425. package/src/shared/stores/bounds/index.ts +2 -4
  426. package/src/shared/stores/bounds/internals/entries.ts +4 -4
  427. package/src/shared/stores/bounds/internals/links.ts +52 -18
  428. package/src/shared/stores/bounds/internals/resolver.ts +5 -3
  429. package/src/shared/stores/bounds/internals/state.ts +5 -2
  430. package/src/shared/stores/bounds/types.ts +59 -15
  431. package/src/shared/stores/scroll.store.ts +68 -0
  432. package/src/shared/types/animation.types.ts +17 -2
  433. package/src/shared/types/bounds.types.ts +22 -60
  434. package/src/shared/types/index.ts +5 -0
  435. package/src/shared/utils/bounds/helpers/create-bound-tag.ts +46 -4
  436. package/src/shared/utils/bounds/helpers/create-bounds-accessor-core.ts +65 -116
  437. package/src/shared/utils/bounds/helpers/create-link-accessor.ts +10 -80
  438. package/src/shared/utils/bounds/helpers/prepare-bound-styles.ts +10 -13
  439. package/src/shared/utils/bounds/helpers/styles/composers.ts +269 -46
  440. package/src/shared/utils/bounds/helpers/styles/compute.ts +134 -2
  441. package/src/shared/utils/bounds/navigation/reveal/build.ts +5 -7
  442. package/src/shared/utils/bounds/navigation/zoom/build.ts +5 -8
  443. package/src/shared/utils/bounds/types/options.ts +105 -6
  444. package/lib/commonjs/shared/components/create-boundary-component/components/boundary-target.js.map +0 -1
  445. package/lib/commonjs/shared/components/create-boundary-component/create-boundary-component.js.map +0 -1
  446. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-boundary-presence.js.map +0 -1
  447. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-initial-destination-measurement.js +0 -99
  448. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-initial-destination-measurement.js.map +0 -1
  449. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-initial-source-measurement.js.map +0 -1
  450. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-measurer.js.map +0 -1
  451. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-refresh-boundary.js.map +0 -1
  452. package/lib/commonjs/shared/components/create-boundary-component/index.js.map +0 -1
  453. package/lib/commonjs/shared/components/create-boundary-component/providers/boundary-owner.provider.js.map +0 -1
  454. package/lib/commonjs/shared/components/create-boundary-component/types.js.map +0 -1
  455. package/lib/commonjs/shared/components/create-boundary-component/utils/destination-signals.js +0 -75
  456. package/lib/commonjs/shared/components/create-boundary-component/utils/destination-signals.js.map +0 -1
  457. package/lib/commonjs/shared/components/create-boundary-component/utils/measured-bounds.js.map +0 -1
  458. package/lib/commonjs/shared/components/create-boundary-component/utils/refresh-signals.js +0 -103
  459. package/lib/commonjs/shared/components/create-boundary-component/utils/refresh-signals.js.map +0 -1
  460. package/lib/commonjs/shared/components/create-boundary-component/utils/source-signals.js +0 -52
  461. package/lib/commonjs/shared/components/create-boundary-component/utils/source-signals.js.map +0 -1
  462. package/lib/commonjs/shared/components/integrations/masked-view.js.map +0 -1
  463. package/lib/commonjs/shared/utils/bounds/helpers/create-interpolators.js +0 -68
  464. package/lib/commonjs/shared/utils/bounds/helpers/create-interpolators.js.map +0 -1
  465. package/lib/commonjs/shared/utils/bounds/helpers/styles/interpolate-link-style.js +0 -30
  466. package/lib/commonjs/shared/utils/bounds/helpers/styles/interpolate-link-style.js.map +0 -1
  467. package/lib/module/shared/components/create-boundary-component/components/boundary-target.js.map +0 -1
  468. package/lib/module/shared/components/create-boundary-component/create-boundary-component.js.map +0 -1
  469. package/lib/module/shared/components/create-boundary-component/hooks/use-boundary-presence.js.map +0 -1
  470. package/lib/module/shared/components/create-boundary-component/hooks/use-initial-destination-measurement.js +0 -94
  471. package/lib/module/shared/components/create-boundary-component/hooks/use-initial-destination-measurement.js.map +0 -1
  472. package/lib/module/shared/components/create-boundary-component/hooks/use-initial-source-measurement.js.map +0 -1
  473. package/lib/module/shared/components/create-boundary-component/hooks/use-measurer.js.map +0 -1
  474. package/lib/module/shared/components/create-boundary-component/hooks/use-refresh-boundary.js.map +0 -1
  475. package/lib/module/shared/components/create-boundary-component/index.js.map +0 -1
  476. package/lib/module/shared/components/create-boundary-component/providers/boundary-owner.provider.js +0 -60
  477. package/lib/module/shared/components/create-boundary-component/providers/boundary-owner.provider.js.map +0 -1
  478. package/lib/module/shared/components/create-boundary-component/types.js.map +0 -1
  479. package/lib/module/shared/components/create-boundary-component/utils/destination-signals.js +0 -70
  480. package/lib/module/shared/components/create-boundary-component/utils/destination-signals.js.map +0 -1
  481. package/lib/module/shared/components/create-boundary-component/utils/measured-bounds.js.map +0 -1
  482. package/lib/module/shared/components/create-boundary-component/utils/refresh-signals.js +0 -98
  483. package/lib/module/shared/components/create-boundary-component/utils/refresh-signals.js.map +0 -1
  484. package/lib/module/shared/components/create-boundary-component/utils/source-signals.js +0 -47
  485. package/lib/module/shared/components/create-boundary-component/utils/source-signals.js.map +0 -1
  486. package/lib/module/shared/components/integrations/masked-view.js.map +0 -1
  487. package/lib/module/shared/utils/bounds/helpers/create-interpolators.js +0 -63
  488. package/lib/module/shared/utils/bounds/helpers/create-interpolators.js.map +0 -1
  489. package/lib/module/shared/utils/bounds/helpers/styles/interpolate-link-style.js +0 -26
  490. package/lib/module/shared/utils/bounds/helpers/styles/interpolate-link-style.js.map +0 -1
  491. package/lib/typescript/shared/components/create-boundary-component/components/boundary-target.d.ts.map +0 -1
  492. package/lib/typescript/shared/components/create-boundary-component/create-boundary-component.d.ts.map +0 -1
  493. package/lib/typescript/shared/components/create-boundary-component/hooks/use-boundary-presence.d.ts.map +0 -1
  494. package/lib/typescript/shared/components/create-boundary-component/hooks/use-initial-destination-measurement.d.ts.map +0 -1
  495. package/lib/typescript/shared/components/create-boundary-component/hooks/use-initial-source-measurement.d.ts.map +0 -1
  496. package/lib/typescript/shared/components/create-boundary-component/hooks/use-measurer.d.ts.map +0 -1
  497. package/lib/typescript/shared/components/create-boundary-component/hooks/use-refresh-boundary.d.ts +0 -14
  498. package/lib/typescript/shared/components/create-boundary-component/hooks/use-refresh-boundary.d.ts.map +0 -1
  499. package/lib/typescript/shared/components/create-boundary-component/index.d.ts.map +0 -1
  500. package/lib/typescript/shared/components/create-boundary-component/providers/boundary-owner.provider.d.ts.map +0 -1
  501. package/lib/typescript/shared/components/create-boundary-component/types.d.ts +0 -37
  502. package/lib/typescript/shared/components/create-boundary-component/types.d.ts.map +0 -1
  503. package/lib/typescript/shared/components/create-boundary-component/utils/destination-signals.d.ts.map +0 -1
  504. package/lib/typescript/shared/components/create-boundary-component/utils/measured-bounds.d.ts +0 -8
  505. package/lib/typescript/shared/components/create-boundary-component/utils/measured-bounds.d.ts.map +0 -1
  506. package/lib/typescript/shared/components/create-boundary-component/utils/refresh-signals.d.ts.map +0 -1
  507. package/lib/typescript/shared/components/create-boundary-component/utils/source-signals.d.ts.map +0 -1
  508. package/lib/typescript/shared/components/integrations/masked-view.d.ts.map +0 -1
  509. package/lib/typescript/shared/utils/bounds/helpers/create-interpolators.d.ts +0 -14
  510. package/lib/typescript/shared/utils/bounds/helpers/create-interpolators.d.ts.map +0 -1
  511. package/lib/typescript/shared/utils/bounds/helpers/styles/interpolate-link-style.d.ts +0 -17
  512. package/lib/typescript/shared/utils/bounds/helpers/styles/interpolate-link-style.d.ts.map +0 -1
  513. package/src/shared/components/create-boundary-component/hooks/use-initial-destination-measurement.ts +0 -130
  514. package/src/shared/components/create-boundary-component/types.ts +0 -48
  515. package/src/shared/components/create-boundary-component/utils/destination-signals.ts +0 -129
  516. package/src/shared/components/create-boundary-component/utils/refresh-signals.ts +0 -164
  517. package/src/shared/components/create-boundary-component/utils/source-signals.ts +0 -72
  518. package/src/shared/utils/bounds/helpers/create-interpolators.ts +0 -117
  519. package/src/shared/utils/bounds/helpers/styles/interpolate-link-style.ts +0 -43
  520. /package/lib/commonjs/shared/components/{create-boundary-component → boundary}/hooks/use-boundary-presence.js +0 -0
  521. /package/lib/commonjs/shared/components/{create-boundary-component → boundary}/types.js +0 -0
  522. /package/lib/module/shared/components/{create-boundary-component → boundary}/hooks/use-boundary-presence.js +0 -0
  523. /package/lib/module/shared/components/{create-boundary-component → boundary}/types.js +0 -0
  524. /package/lib/typescript/shared/components/{create-boundary-component → boundary}/components/boundary-target.d.ts +0 -0
  525. /package/lib/typescript/shared/components/{create-boundary-component → boundary}/create-boundary-component.d.ts +0 -0
  526. /package/lib/typescript/shared/components/{create-boundary-component → boundary}/hooks/use-boundary-presence.d.ts +0 -0
  527. /package/lib/typescript/shared/components/{integrations/masked-view.d.ts → masked-view.d.ts} +0 -0
  528. /package/src/shared/components/{create-boundary-component → boundary}/hooks/use-boundary-presence.ts +0 -0
@@ -2,12 +2,13 @@
2
2
 
3
3
  import { useCallback } from "react";
4
4
  import { useWindowDimensions } from "react-native";
5
- import { setEntry } from "../../../stores/bounds/internals/entries";
6
- import { setDestination, setSource } from "../../../stores/bounds/internals/links";
5
+ import { measure } from "react-native-reanimated";
6
+ import { applyMeasuredBoundsWrites } from "../../../providers/helpers/measured-bounds-writes";
7
+ import { useOriginContext } from "../../../providers/screen/origin.provider";
7
8
  import { ScrollStore } from "../../../stores/scroll.store";
8
9
  import { SystemStore } from "../../../stores/system.store";
9
- import { getVisibilityBlockOffset } from "../../../utils/visibility-block-offset";
10
- import { applyVisibilityBlockOffset, isMeasurementInViewport, measureWithOverscrollAwareness } from "../utils/measured-bounds";
10
+ import { getActiveScrollHost } from "../portal/stores/host-registry.store";
11
+ import { attachScrollSnapshotToMeasuredBounds, isMeasurementInViewport, measureWithOverscrollAwareness, normalizeMeasuredBoundsToOrigin } from "../utils/measured-bounds";
11
12
  export const useMeasurer = ({
12
13
  enabled,
13
14
  entryTag,
@@ -15,25 +16,27 @@ export const useMeasurer = ({
15
16
  group,
16
17
  currentScreenKey,
17
18
  preparedStyles,
18
- measuredAnimatedRef
19
+ measuredAnimatedRef,
20
+ portalHost
19
21
  }) => {
20
22
  const {
21
23
  width: viewportWidth,
22
24
  height: viewportHeight
23
25
  } = useWindowDimensions();
24
26
  const scrollState = ScrollStore.getValue(currentScreenKey, "coordination");
27
+ const scrollMetadata = ScrollStore.getValue(currentScreenKey, "metadata");
25
28
  const pendingLifecycleStartBlockCount = SystemStore.getValue(currentScreenKey, "pendingLifecycleStartBlockCount");
29
+ const {
30
+ originRef
31
+ } = useOriginContext();
26
32
  return useCallback(target => {
27
33
  "worklet";
28
34
 
29
35
  if (!enabled) return;
30
36
  const measured = measureWithOverscrollAwareness(measuredAnimatedRef, scrollState.get());
31
- if (!measured) return;
32
-
33
- // Source boundaries do not need offset correction. Only destination
34
- // captures can measure while the visibility gate is still blocked.
35
- const shouldAdjustBlockedDestination = target.type === "destination" && pendingLifecycleStartBlockCount.get() > 0;
36
- const normalizedMeasured = shouldAdjustBlockedDestination ? applyVisibilityBlockOffset(measured, getVisibilityBlockOffset(viewportHeight)) : measured;
37
+ const measuredOrigin = measure(originRef);
38
+ if (!measured || !measuredOrigin) return;
39
+ const normalizedMeasured = normalizeMeasuredBoundsToOrigin(measured, measuredOrigin);
37
40
 
38
41
  /**
39
42
  * - Destination Pass -
@@ -45,18 +48,19 @@ export const useMeasurer = ({
45
48
  const shouldGuardDestinationViewport = pendingLifecycleStartBlockCount.get() > 0 || !!group;
46
49
  const viewportAllowsDestinationWrite = target.type !== "destination" || !shouldGuardDestinationViewport || isMeasurementInViewport(normalizedMeasured, viewportWidth, viewportHeight);
47
50
  if (!viewportAllowsDestinationWrite) return;
48
-
49
- // Set the bounds entry on every measure to avoid any stale measurements
50
- // for the public read API.
51
- setEntry(entryTag, currentScreenKey, {
52
- bounds: normalizedMeasured
51
+ const measuredWithScroll = attachScrollSnapshotToMeasuredBounds(normalizedMeasured, scrollMetadata.get());
52
+ const sourceHost = target.type === "source" ? getActiveScrollHost(currentScreenKey) ?? undefined : undefined;
53
+ applyMeasuredBoundsWrites({
54
+ entryTag,
55
+ linkId,
56
+ group,
57
+ currentScreenKey,
58
+ measured: measuredWithScroll,
59
+ preparedStyles,
60
+ linkWrite: target,
61
+ portalHost,
62
+ sourceHost
53
63
  });
54
- if (target.type === "source") {
55
- setSource(target.pairKey, linkId, currentScreenKey, normalizedMeasured, preparedStyles, group);
56
- }
57
- if (target.type === "destination") {
58
- setDestination(target.pairKey, linkId, currentScreenKey, normalizedMeasured, preparedStyles, group);
59
- }
60
- }, [enabled, entryTag, linkId, group, currentScreenKey, preparedStyles, measuredAnimatedRef, viewportWidth, viewportHeight, scrollState, pendingLifecycleStartBlockCount]);
64
+ }, [enabled, entryTag, linkId, group, currentScreenKey, preparedStyles, measuredAnimatedRef, portalHost, viewportWidth, viewportHeight, scrollState, scrollMetadata, pendingLifecycleStartBlockCount, originRef]);
61
65
  };
62
66
  //# sourceMappingURL=use-measurer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useCallback","useWindowDimensions","measure","applyMeasuredBoundsWrites","useOriginContext","ScrollStore","SystemStore","getActiveScrollHost","attachScrollSnapshotToMeasuredBounds","isMeasurementInViewport","measureWithOverscrollAwareness","normalizeMeasuredBoundsToOrigin","useMeasurer","enabled","entryTag","linkId","group","currentScreenKey","preparedStyles","measuredAnimatedRef","portalHost","width","viewportWidth","height","viewportHeight","scrollState","getValue","scrollMetadata","pendingLifecycleStartBlockCount","originRef","target","measured","get","measuredOrigin","normalizedMeasured","shouldGuardDestinationViewport","viewportAllowsDestinationWrite","type","measuredWithScroll","sourceHost","undefined","linkWrite"],"sourceRoot":"../../../../../../src","sources":["shared/components/boundary/hooks/use-measurer.ts"],"mappings":";;AAAA,SAASA,WAAW,QAAQ,OAAO;AAEnC,SAASC,mBAAmB,QAAQ,cAAc;AAClD,SAECC,OAAO,QAED,yBAAyB;AAChC,SAASC,yBAAyB,QAAQ,mDAAmD;AAC7F,SAASC,gBAAgB,QAAQ,2CAA2C;AAE5E,SAASC,WAAW,QAAQ,8BAA8B;AAC1D,SAASC,WAAW,QAAQ,8BAA8B;AAC1D,SAASC,mBAAmB,QAAQ,sCAAsC;AAE1E,SACCC,oCAAoC,EACpCC,uBAAuB,EACvBC,8BAA8B,EAC9BC,+BAA+B,QACzB,0BAA0B;AAajC,OAAO,MAAMC,WAAW,GAAGA,CAAC;EAC3BC,OAAO;EACPC,QAAQ;EACRC,MAAM;EACNC,KAAK;EACLC,gBAAgB;EAChBC,cAAc;EACdC,mBAAmB;EACnBC;AACkB,CAAC,KAAsB;EACzC,MAAM;IAAEC,KAAK,EAAEC,aAAa;IAAEC,MAAM,EAAEC;EAAe,CAAC,GACrDvB,mBAAmB,CAAC,CAAC;EAEtB,MAAMwB,WAAW,GAAGpB,WAAW,CAACqB,QAAQ,CAACT,gBAAgB,EAAE,cAAc,CAAC;EAC1E,MAAMU,cAAc,GAAGtB,WAAW,CAACqB,QAAQ,CAACT,gBAAgB,EAAE,UAAU,CAAC;EAC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B,OAAO,EACPC,QAAQ,EACRC,MAAM,EACNC,KAAK,EACLC,gBAAgB,EAChBC,cAAc,EACdC,mBAAmB,EACnBC,UAAU,EACVE,aAAa,EACbE,cAAc,EACdC,WAAW,EACXE,cAAc,EACdC,+BAA+B,EAC/BC,SAAS,CAEX,CAAC;AACF,CAAC","ignoreList":[]}
@@ -1,19 +1,21 @@
1
1
  "use strict";
2
2
 
3
3
  import { useAnimatedReaction } from "react-native-reanimated";
4
+ import { useDescriptorsStore } from "../../../providers/screen/descriptors";
4
5
  import { AnimationStore } from "../../../stores/animation.store";
5
6
  import { pairs } from "../../../stores/bounds/internals/state";
6
7
  import { getRefreshBoundarySignal } from "../utils/refresh-signals";
7
8
  export const useRefreshBoundary = ({
8
9
  enabled,
9
- currentScreenKey,
10
- preferredSourceScreenKey,
11
- nextScreenKey,
12
10
  linkId,
13
11
  group,
14
- ancestorScreenKeys,
15
12
  measureBoundary
16
13
  }) => {
14
+ const currentScreenKey = useDescriptorsStore(s => s.derivations.currentScreenKey);
15
+ const nextScreenKey = useDescriptorsStore(s => s.derivations.nextScreenKey);
16
+ const sourcePairKey = useDescriptorsStore(s => s.derivations.sourcePairKey);
17
+ const destinationPairKey = useDescriptorsStore(s => s.derivations.destinationPairKey);
18
+ const ancestorDestinationPairKey = useDescriptorsStore(s => s.derivations.ancestorDestinationPairKey);
17
19
  // Source-side boundaries refresh from the next screen's lifecycle pulse.
18
20
  // Destination-side boundaries have no next screen, so they refresh from self.
19
21
  const refreshScreenKey = nextScreenKey ?? currentScreenKey;
@@ -28,17 +30,18 @@ export const useRefreshBoundary = ({
28
30
  return getRefreshBoundarySignal({
29
31
  enabled,
30
32
  currentScreenKey,
31
- preferredSourceScreenKey,
33
+ sourcePairKey,
34
+ destinationPairKey,
35
+ ancestorDestinationPairKey,
32
36
  nextScreenKey,
33
37
  linkId,
34
38
  group,
35
- ancestorScreenKeys,
36
39
  shouldRefresh: !!refreshWillAnimate.get(),
37
40
  closing: !!refreshClosing.get(),
38
41
  entering: !!refreshEntering.get(),
39
42
  animating: !!refreshAnimating.get(),
40
43
  progress: refreshProgress.get(),
41
- linkState: group || ancestorScreenKeys.length ? pairs.get() : undefined
44
+ linkState: pairs.get()
42
45
  });
43
46
  }, (refreshSignal, prevRefreshSignal) => {
44
47
  "worklet";
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useAnimatedReaction","useDescriptorsStore","AnimationStore","pairs","getRefreshBoundarySignal","useRefreshBoundary","enabled","linkId","group","measureBoundary","currentScreenKey","s","derivations","nextScreenKey","sourcePairKey","destinationPairKey","ancestorDestinationPairKey","refreshScreenKey","refreshWillAnimate","getValue","refreshClosing","refreshEntering","refreshAnimating","refreshProgress","shouldRefresh","get","closing","entering","animating","progress","linkState","refreshSignal","prevRefreshSignal","signal","type","pairKey"],"sourceRoot":"../../../../../../src","sources":["shared/components/boundary/hooks/use-refresh-boundary.ts"],"mappings":";;AAAA,SAASA,mBAAmB,QAAQ,yBAAyB;AAC7D,SAASC,mBAAmB,QAAQ,uCAAuC;AAC3E,SAASC,cAAc,QAAQ,iCAAiC;AAChE,SAASC,KAAK,QAAQ,wCAAwC;AAE9D,SAASC,wBAAwB,QAAQ,0BAA0B;AASnE,OAAO,MAAMC,kBAAkB,GAAGA,CAAC;EAClCC,OAAO;EACPC,MAAM;EACNC,KAAK;EACLC;AACyB,CAAC,KAAK;EAC/B,MAAMC,gBAAgB,GAAGT,mBAAmB,CAC1CU,CAAC,IAAKA,CAAC,CAACC,WAAW,CAACF,gBACtB,CAAC;EACD,MAAMG,aAAa,GAAGZ,mBAAmB,CAAEU,CAAC,IAAKA,CAAC,CAACC,WAAW,CAACC,aAAa,CAAC;EAC7E,MAAMC,aAAa,GAAGb,mBAAmB,CAAEU,CAAC,IAAKA,CAAC,CAACC,WAAW,CAACE,aAAa,CAAC;EAC7E,MAAMC,kBAAkB,GAAGd,mBAAmB,CAC5CU,CAAC,IAAKA,CAAC,CAACC,WAAW,CAACG,kBACtB,CAAC;EACD,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AiB,EAAEC,MAAM,EACjD;MACD;IACD;IAEAxB,eAAe,CAAC;MACfyB,IAAI,EAAEH,aAAa,CAACG,IAAI;MACxBC,OAAO,EAAEJ,aAAa,CAACI;IACxB,CAAC,CAAC;EACH,CACD,CAAC;AACF,CAAC","ignoreList":[]}
@@ -3,6 +3,7 @@
3
3
  import { Pressable, View } from "react-native";
4
4
  import { BoundaryTarget } from "./components/boundary-target";
5
5
  import { createBoundaryComponent } from "./create-boundary-component";
6
+ import { Host } from "./portal";
6
7
  export { createBoundaryComponent };
7
8
  const BoundaryView = createBoundaryComponent(View, {
8
9
  shouldAutoMeasure: true
@@ -11,6 +12,7 @@ const BoundaryTrigger = createBoundaryComponent(Pressable);
11
12
  BoundaryView.displayName = "Transition.Boundary.View";
12
13
  BoundaryTrigger.displayName = "Transition.Boundary.Trigger";
13
14
  BoundaryTarget.displayName = "Transition.Boundary.Target";
15
+ Host.displayName = "Transition.Boundary.Host";
14
16
 
15
17
  /**
16
18
  * Shared-boundary components.
@@ -29,6 +31,7 @@ BoundaryTarget.displayName = "Transition.Boundary.Target";
29
31
  * - `Boundary.View` for passive/shared elements.
30
32
  * - `Boundary.Trigger` for tappable elements that start navigation.
31
33
  * - `Boundary.Target` to measure a nested descendant instead of the owner.
34
+ * - `Boundary.Host` to make nested portal placement explicit.
32
35
  */
33
36
  export const Boundary = {
34
37
  /**
@@ -42,6 +45,10 @@ export const Boundary = {
42
45
  /**
43
46
  * Optional nested measurement override inside a boundary owner.
44
47
  */
45
- Target: BoundaryTarget
48
+ Target: BoundaryTarget,
49
+ /**
50
+ * Explicit portal host for scrollable or otherwise clipped coordinate spaces.
51
+ */
52
+ Host: Host
46
53
  };
47
54
  //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Pressable","View","BoundaryTarget","createBoundaryComponent","Host","BoundaryView","shouldAutoMeasure","BoundaryTrigger","displayName","Boundary","Trigger","Target"],"sourceRoot":"../../../../../src","sources":["shared/components/boundary/index.tsx"],"mappings":";;AAAA,SAASA,SAAS,EAAEC,IAAI,QAAQ,cAAc;AAC9C,SAASC,cAAc,QAAQ,8BAA8B;AAC7D,SAASC,uBAAuB,QAAQ,6BAA6B;AACrE,SAASC,IAAI,QAAQ,UAAU;AAO/B,SAASD,uBAAuB;AAEhC,MAAME,YAAY,GAAGF,uBAAuB,CAACF,IAAI,EAAE;EAClDK,iBAAiB,EAAE;AACpB,CAAC,CAAC;AACF,MAAMC,eAAe,GAAGJ,uBAAuB,CAACH,SAAS,CAAC;AAC1DK,YAAY,CAACG,WAAW,GAAG,0BAA0B;AACrDD,eAAe,CAACC,WAAW,GAAG,6BAA6B;AAC3DN,cAAc,CAACM,WAAW,GAAG,4BAA4B;AACzDJ,IAAI,CAACI,WAAW,GAAG,0BAA0B;;AAE7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,QAAQ,GAAG;EACvB;AACD;AACA;EACCR,IAAI,EAAEI,YAAY;EAClB;AACD;AACA;EACCK,OAAO,EAAEH,eAAe;EACxB;AACD;AACA;EACCI,MAAM,EAAET,cAAc;EACtB;AACD;AACA;EACCE,IAAI,EAAEA;AACP,CAAC","ignoreList":[]}
@@ -0,0 +1,94 @@
1
+ "use strict";
2
+
3
+ import { memo, useLayoutEffect, useRef } from "react";
4
+ import { StyleSheet, useWindowDimensions, View } from "react-native";
5
+ import Animated from "react-native-reanimated";
6
+ import { useDescriptorsStore } from "../../../../providers/screen/descriptors";
7
+ import { useHostMeasurement } from "../hooks/use-host-measurement";
8
+ import { registerHost, unregisterHost } from "../stores/host-registry.store";
9
+ import { useActivePortalBoundaryHosts } from "../stores/portal-boundary-host.store";
10
+ import { PortalBoundaryHost } from "./portal-boundary-host";
11
+ import { jsx as _jsx } from "react/jsx-runtime";
12
+ let nextHostId = 0;
13
+ function HostImpl({
14
+ fallback = false,
15
+ style
16
+ }) {
17
+ const screenKey = useDescriptorsStore(s => s.derivations.currentScreenKey);
18
+ const generatedHostKeyRef = useRef(null);
19
+ if (generatedHostKeyRef.current === null) {
20
+ generatedHostKeyRef.current = `${screenKey}-host-${nextHostId++}`;
21
+ }
22
+ const hostKey = fallback ? screenKey : generatedHostKeyRef.current;
23
+ const capturesScroll = !fallback;
24
+ const activeBoundaryHosts = useActivePortalBoundaryHosts(hostKey);
25
+ const {
26
+ height: viewportHeight,
27
+ width: viewportWidth
28
+ } = useWindowDimensions();
29
+ const measurement = useHostMeasurement({
30
+ capturesScroll,
31
+ enabled: activeBoundaryHosts.length > 0,
32
+ hostKey,
33
+ screenKey
34
+ });
35
+ useLayoutEffect(() => {
36
+ registerHost({
37
+ capturesScroll,
38
+ fallback,
39
+ hostKey,
40
+ screenKey
41
+ });
42
+ return () => {
43
+ unregisterHost(screenKey, hostKey);
44
+ };
45
+ }, [capturesScroll, fallback, hostKey, screenKey]);
46
+ const boundaryHosts = measurement.canRenderHosts ? activeBoundaryHosts.map(host => /*#__PURE__*/_jsx(View, {
47
+ pointerEvents: "box-none",
48
+ style: [styles.boundaryHostViewport, {
49
+ width: viewportWidth,
50
+ height: viewportHeight
51
+ }],
52
+ children: /*#__PURE__*/_jsx(PortalBoundaryHost, {
53
+ host: host,
54
+ style: StyleSheet.absoluteFill
55
+ })
56
+ }, host.boundaryId)) : null;
57
+ return /*#__PURE__*/_jsx(Animated.View, {
58
+ ref: measurement.hostRef,
59
+ pointerEvents: "box-none",
60
+ style: [styles.host, {
61
+ width: viewportWidth,
62
+ height: viewportHeight
63
+ }, style],
64
+ collapsable: false,
65
+ children: boundaryHosts
66
+ });
67
+ }
68
+ export const Host = /*#__PURE__*/memo(function Host(props) {
69
+ return /*#__PURE__*/_jsx(HostImpl, {
70
+ ...props
71
+ });
72
+ });
73
+ export const ScreenFallbackHost = /*#__PURE__*/memo(function ScreenFallbackHost() {
74
+ return /*#__PURE__*/_jsx(HostImpl, {
75
+ fallback: true
76
+ });
77
+ });
78
+ const styles = StyleSheet.create({
79
+ host: {
80
+ elevation: 999999,
81
+ left: 0,
82
+ overflow: "visible",
83
+ position: "absolute",
84
+ top: 0,
85
+ zIndex: 999999
86
+ },
87
+ boundaryHostViewport: {
88
+ left: 0,
89
+ overflow: "visible",
90
+ position: "absolute",
91
+ top: 0
92
+ }
93
+ });
94
+ //# sourceMappingURL=host.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["memo","useLayoutEffect","useRef","StyleSheet","useWindowDimensions","View","Animated","useDescriptorsStore","useHostMeasurement","registerHost","unregisterHost","useActivePortalBoundaryHosts","PortalBoundaryHost","jsx","_jsx","nextHostId","HostImpl","fallback","style","screenKey","s","derivations","currentScreenKey","generatedHostKeyRef","current","hostKey","capturesScroll","activeBoundaryHosts","height","viewportHeight","width","viewportWidth","measurement","enabled","length","boundaryHosts","canRenderHosts","map","host","pointerEvents","styles","boundaryHostViewport","children","absoluteFill","boundaryId","ref","hostRef","collapsable","Host","props","ScreenFallbackHost","create","elevation","left","overflow","position","top","zIndex"],"sourceRoot":"../../../../../../../src","sources":["shared/components/boundary/portal/components/host.tsx"],"mappings":";;AAAA,SAASA,IAAI,EAAEC,eAAe,EAAEC,MAAM,QAAQ,OAAO;AACrD,SAECC,UAAU,EACVC,mBAAmB,EACnBC,IAAI,QAEE,cAAc;AACrB,OAAOC,QAAQ,MAAM,yBAAyB;AAC9C,SAASC,mBAAmB,QAAQ,0CAA0C;AAC9E,SAASC,kBAAkB,QAAQ,+BAA+B;AAClE,SAASC,YAAY,EAAEC,cAAc,QAAQ,+BAA+B;AAC5E,SAASC,4BAA4B,QAAQ,sCAAsC;AACnF,SAASC,kBAAkB,QAAQ,wBAAwB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE5D,IAAIC,UAAU,GAAG,CAAC;AAUlB,SAASC,QAAQA,CAAC;EAAEC,QAAQ,GAAG,KAAK;EAAEC;AAAqB,CAAC,EAAE;EAC7D,MAAMC,SAAS,GAAGZ,mBAAmB,C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;MAAC0B,IAAI,EAAEA,IAAK;MAACpB,KAAK,EAAEf,UAAU,CAACwC;IAAa,CAAE;EAAC,GAP7DL,IAAI,CAACM,UAQL,CACN,CAAC,GACD,IAAI;EAEP,oBACC9B,IAAA,CAACR,QAAQ,CAACD,IAAI;IACbwC,GAAG,EAAEb,WAAW,CAACc,OAAQ;IACzBP,aAAa,EAAC,UAAU;IACxBrB,KAAK,EAAE,CACNsB,MAAM,CAACF,IAAI,EACX;MAAER,KAAK,EAAEC,aAAa;MAAEH,MAAM,EAAEC;IAAe,CAAC,EAChDX,KAAK,CACJ;IACF6B,WAAW,EAAE,KAAM;IAAAL,QAAA,EAElBP;EAAa,CACA,CAAC;AAElB;AAEA,OAAO,MAAMa,IAAI,gBAAGhD,IAAI,CAAC,SAASgD,IAAIA,CAACC,KAAsB,EAAE;EAC9D,oBAAOnC,IAAA,CAACE,QAAQ;IAAA,GAAKiC;EAAK,CAAG,CAAC;AAC/B,CAAC,CAAC;AAEF,OAAO,MAAMC,kBAAkB,gBAAGlD,IAAI,CAAC,SAASkD,kBAAkBA,CAAA,EAAG;EACpE,oBAAOpC,IAAA,CAACE,QAAQ;IAACC,QAAQ;EAAA,CAAE,CAAC;AAC7B,CAAC,CAAC;AAEF,MAAMuB,MAAM,GAAGrC,UAAU,CAACgD,MAAM,CAAC;EAChCb,IAAI,EAAE;IACLc,SAAS,EAAE,MAAM;IACjBC,IAAI,EAAE,CAAC;IACPC,QAAQ,EAAE,SAAS;IACnBC,QAAQ,EAAE,UAAU;IACpBC,GAAG,EAAE,CAAC;IACNC,MAAM,EAAE;EACT,CAAC;EACDhB,oBAAoB,EAAE;IACrBY,IAAI,EAAE,CAAC;IACPC,QAAQ,EAAE,SAAS;IACnBC,QAAQ,EAAE,UAAU;IACpBC,GAAG,EAAE;EACN;AACD,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+
3
+ import { memo } from "react";
4
+ import Animated, { useAnimatedStyle } from "react-native-reanimated";
5
+ import { NO_STYLES } from "../../../../constants";
6
+ import { AnimationStore } from "../../../../stores/animation.store";
7
+ import { getSourceScreenKeyFromPairKey } from "../../../../stores/bounds/helpers/link-pairs.helpers";
8
+ import { getLink } from "../../../../stores/bounds/internals/links";
9
+ import { GestureStore } from "../../../../stores/gesture.store";
10
+ import { ScrollStore } from "../../../../stores/scroll.store";
11
+ import { NativePortalHost } from "../teleport";
12
+ import { createPortalBoundaryHostName } from "../utils/naming";
13
+ import { resolvePortalOffsetStyle } from "../utils/offset-style";
14
+ import { jsx as _jsx } from "react/jsx-runtime";
15
+ const AnimatedPortalBoundaryHost = NativePortalHost ? Animated.createAnimatedComponent(NativePortalHost) : null;
16
+ export const PortalBoundaryHost = /*#__PURE__*/memo(function PortalBoundaryHost({
17
+ host,
18
+ style
19
+ }) {
20
+ const hostName = createPortalBoundaryHostName(host.hostKey, host.boundaryId);
21
+ const hostClosing = AnimationStore.getValue(host.screenKey, "closing");
22
+ const hostProgress = AnimationStore.getValue(host.screenKey, "transitionProgress");
23
+ const hostGestureDismissing = GestureStore.getValue(host.screenKey, "dismissing");
24
+ const hostScrollMetadata = ScrollStore.getValue(host.screenKey, "metadata");
25
+ const sourceScrollMetadata = ScrollStore.getValue(getSourceScreenKeyFromPairKey(host.pairKey), "metadata");
26
+ const hostStyle = useAnimatedStyle(() => {
27
+ "worklet";
28
+
29
+ // Strict per-member lookup — a fallback member's source rect would
30
+ // misplace this host's teleported content.
31
+ const link = getLink(host.pairKey, host.boundaryId);
32
+ if (!link?.source || !link.destination) {
33
+ return NO_STYLES;
34
+ }
35
+
36
+ // Make the coordinate case explicit before resolving the host offset.
37
+ // The resolver owns the math; this component decides which screen/scroll
38
+ // relationship the active portal is in.
39
+ const isCrossScreenPortal = link.source.screenKey !== host.screenKey;
40
+ const isHostClosing = hostClosing.get() === 1 || hostGestureDismissing.get() === 1;
41
+ const placement = !isCrossScreenPortal ? "same-screen" : isHostClosing ? "cross-screen-close" : "cross-screen-open";
42
+
43
+ // A source that originated inside its own scroll host moves with that
44
+ // ScrollView while this portal stays attached over here. Shifting the
45
+ // source rect by the clamped source scroll travel keeps the return
46
+ // landing point on the live placeholder, so the close detach is seamless.
47
+ const trackSourceScroll = isCrossScreenPortal && link.source.sourceHost?.capturesScroll === true;
48
+ return resolvePortalOffsetStyle({
49
+ bounds: link.source.bounds,
50
+ hostCurrentScroll: placement === "cross-screen-close" ? hostScrollMetadata.get() : null,
51
+ hostKey: host.hostKey,
52
+ placement,
53
+ sourceCurrentScroll: trackSourceScroll ? sourceScrollMetadata.get() : null,
54
+ hostProgress: hostProgress.get(),
55
+ trackSourceScroll
56
+ });
57
+ });
58
+
59
+ // Without `react-native-teleport` no portal ever mounts a boundary host, so
60
+ // this never renders — the guard just narrows the nullable animated host.
61
+ if (!AnimatedPortalBoundaryHost) {
62
+ return null;
63
+ }
64
+ return /*#__PURE__*/_jsx(AnimatedPortalBoundaryHost, {
65
+ name: hostName,
66
+ style: [style, hostStyle]
67
+ });
68
+ });
69
+ //# sourceMappingURL=portal-boundary-host.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["memo","Animated","useAnimatedStyle","NO_STYLES","AnimationStore","getSourceScreenKeyFromPairKey","getLink","GestureStore","ScrollStore","NativePortalHost","createPortalBoundaryHostName","resolvePortalOffsetStyle","jsx","_jsx","AnimatedPortalBoundaryHost","createAnimatedComponent","PortalBoundaryHost","host","style","hostName","hostKey","boundaryId","hostClosing","getValue","screenKey","hostProgress","hostGestureDismissing","hostScrollMetadata","sourceScrollMetadata","pairKey","hostStyle","link","source","destination","isCrossScreenPortal","isHostClosing","get","placement","trackSourceScroll","sourceHost","capturesScroll","bounds","hostCurrentScroll","sourceCurrentScroll","name"],"sourceRoot":"../../../../../../../src","sources":["shared/components/boundary/portal/components/portal-boundary-host.tsx"],"mappings":";;AAAA,SAASA,IAAI,QAAQ,OAAO;AAE5B,OAAOC,QAAQ,IAAIC,gBAAgB,QAAQ,yBAAyB;AACpE,SAASC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@
1
+ "use strict";
2
+
3
+ import { memo } from "react";
4
+ import { NativePortalProvider } from "../teleport";
5
+ import { jsx as _jsx } from "react/jsx-runtime";
6
+ export const PortalProvider = /*#__PURE__*/memo(function PortalProvider({
7
+ children
8
+ }) {
9
+ if (!NativePortalProvider) {
10
+ return children;
11
+ }
12
+ return /*#__PURE__*/_jsx(NativePortalProvider, {
13
+ children: children
14
+ });
15
+ });
16
+ //# sourceMappingURL=portal-provider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["memo","NativePortalProvider","jsx","_jsx","PortalProvider","children"],"sourceRoot":"../../../../../../../src","sources":["shared/components/boundary/portal/components/portal-provider.tsx"],"mappings":";;AAAA,SAASA,IAAI,QAAQ,OAAO;AAC5B,SAASC,oBAAoB,QAAQ,aAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEnD,OAAO,MAAMC,cAAc,gBAAGJ,IAAI,CAAC,SAASI,cAAcA,CAAC;EAC1DC;AAGD,CAAC,EAAE;EACF,IAAI,CAACJ,oBAAoB,EAAE;IAC1B,OAAOI,QAAQ;EAChB;EAEA,oBAAOF,IAAA,CAACF,oBAAoB;IAAAI,QAAA,EAAEA;EAAQ,CAAuB,CAAC;AAC/D,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,193 @@
1
+ "use strict";
2
+
3
+ import { memo, useCallback, useLayoutEffect, useState } from "react";
4
+ import Animated, { runOnJS, useAnimatedProps, useAnimatedReaction, useAnimatedStyle, useSharedValue } from "react-native-reanimated";
5
+ import { useDescriptorsStore } from "../../../../providers/screen/descriptors";
6
+ import { useScreenStyles } from "../../../../providers/screen/styles";
7
+ 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
+ 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";
14
+ import { isTeleportAvailable, NativePortal } from "../teleport";
15
+ import { resolvePortalAttachmentTargets } from "../utils/attachment";
16
+ import { createPortalBoundaryHostName, PORTAL_HOST_NAME_RESET_VALUE } from "../utils/naming";
17
+ import { isTeleportEnabled } from "../utils/teleport-control";
18
+ import { jsx as _jsx } from "react/jsx-runtime";
19
+ const TransitionAwareTeleport = NativePortal ? createTransitionAwareComponent(NativePortal) : null;
20
+ export const Portal = /*#__PURE__*/memo(function Portal({
21
+ id = "my-id",
22
+ children,
23
+ mode = false,
24
+ placeholderRef
25
+ }) {
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
+ stylesMap
33
+ } = useScreenStyles();
34
+ const sourcePairKey = useDescriptorsStore(s => s.derivations.sourcePairKey);
35
+ 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);
41
+ const {
42
+ progressScreenKey,
43
+ targetScreenKey
44
+ } = resolvePortalAttachmentTargets({
45
+ attachment,
46
+ currentScreenKey,
47
+ nextScreenKey,
48
+ portalAttachTarget,
49
+ sourcePairKey
50
+ });
51
+ const activeHostKey = useActiveHostKey(targetScreenKey);
52
+ const activeHostCapturesScroll = activeHostKey ? getHostCapturesScroll(activeHostKey) : false;
53
+ const progress = AnimationStore.getValue(progressScreenKey ?? "", "transitionProgress");
54
+ const closing = AnimationStore.getValue(progressScreenKey ?? "", "closing");
55
+ const updatePortalAttachment = useCallback((matchedScreenKey, pairKey) => {
56
+ if (matchedScreenKey && pairKey) {
57
+ setAttachment(current => {
58
+ if (current?.matchedScreenKey === matchedScreenKey && current.pairKey === pairKey) {
59
+ return current;
60
+ }
61
+ return {
62
+ matchedScreenKey,
63
+ pairKey
64
+ };
65
+ });
66
+ return;
67
+ }
68
+ setAttachment(current => current ? null : current);
69
+ }, []);
70
+ useLayoutEffect(() => {
71
+ if (!isPortalEnabled || !attachment || !activeHostKey || !targetScreenKey) {
72
+ attachedHostName.set(PORTAL_HOST_NAME_RESET_VALUE);
73
+ return;
74
+ }
75
+ mountPortalBoundaryHost({
76
+ boundaryId: id,
77
+ capturesScroll: activeHostCapturesScroll,
78
+ hostKey: activeHostKey,
79
+ pairKey: attachment.pairKey,
80
+ screenKey: targetScreenKey
81
+ });
82
+
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]);
89
+ useLayoutEffect(() => {
90
+ return () => {
91
+ attachedHostName.set(PORTAL_HOST_NAME_RESET_VALUE);
92
+ unmountPortalBoundaryHost(id);
93
+ };
94
+ }, [attachedHostName, id]);
95
+ useAnimatedReaction(() => {
96
+ "worklet";
97
+
98
+ 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;
109
+ }
110
+
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;
119
+ }
120
+ }
121
+ return link.destination.screenKey;
122
+ }, (matchedScreenKey, previousMatchedScreenKey) => {
123
+ "worklet";
124
+
125
+ if (matchedScreenKey === previousMatchedScreenKey) {
126
+ return;
127
+ }
128
+ runOnJS(updatePortalAttachment)(matchedScreenKey, sourcePairKey);
129
+ });
130
+ const teleportProps = useAnimatedProps(() => {
131
+ "worklet";
132
+
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;
137
+ const {
138
+ teleport,
139
+ ...slotProps
140
+ } = stylesMap.get()[id]?.props ?? {};
141
+ const shouldTeleport = isTeleportEnabled(teleport);
142
+ return {
143
+ // Preserve portal slot props from the interpolator while keeping
144
+ // hostName owned by the attachment gate below.
145
+ ...slotProps,
146
+ hostName: shouldTeleport && progress.get() >= attachThreshold ? attachedHostName.get() : PORTAL_HOST_NAME_RESET_VALUE
147
+ };
148
+ });
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
+ };
171
+ });
172
+ if (isPortalEnabled && TransitionAwareTeleport) {
173
+ return /*#__PURE__*/_jsx(Animated.View, {
174
+ ref: placeholderRef,
175
+ onLayout: event => {
176
+ placeholderWidth.set(event.nativeEvent.layout.width);
177
+ placeholderHeight.set(event.nativeEvent.layout.height);
178
+ },
179
+ style: placeholderStyle,
180
+ collapsable: false,
181
+ children: /*#__PURE__*/_jsx(TransitionAwareTeleport, {
182
+ animatedProps: teleportProps,
183
+ name: id,
184
+ children: /*#__PURE__*/_jsx(Animated.View, {
185
+ style: placeholderStyle,
186
+ children: children
187
+ })
188
+ })
189
+ });
190
+ }
191
+ return children;
192
+ });
193
+ //# sourceMappingURL=portal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["memo","useCallback","useLayoutEffect","useState","Animated","runOnJS","useAnimatedProps","useAnimatedReaction","useAnimatedStyle","useSharedValue","useDescriptorsStore","useScreenStyles","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","stylesMap","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"],"m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