react-native-screen-transitions 3.12.0 → 3.13.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (336) hide show
  1. package/lib/commonjs/shared/components/activity/variants/activity-screen.js +1 -1
  2. package/lib/commonjs/shared/components/activity/variants/activity-screen.js.map +1 -1
  3. package/lib/commonjs/shared/components/boundary/components/boundary-lifecycle.js +0 -3
  4. package/lib/commonjs/shared/components/boundary/components/boundary-lifecycle.js.map +1 -1
  5. package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-boundary-measurement-request.js +69 -0
  6. package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-boundary-measurement-request.js.map +1 -0
  7. package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-boundary-presence.js +11 -10
  8. package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-boundary-presence.js.map +1 -1
  9. package/lib/commonjs/shared/components/boundary/hooks/use-boundary-measurement.js +3 -19
  10. package/lib/commonjs/shared/components/boundary/hooks/use-boundary-measurement.js.map +1 -1
  11. package/lib/commonjs/shared/components/boundary/hooks/use-measurer.js +6 -16
  12. package/lib/commonjs/shared/components/boundary/hooks/use-measurer.js.map +1 -1
  13. package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/helpers/active-handoff-receiver.js +27 -1
  14. package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/helpers/active-handoff-receiver.js.map +1 -1
  15. package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js +26 -8
  16. package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js.map +1 -1
  17. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.js +8 -1
  18. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.js.map +1 -1
  19. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/helpers/attachment.js +19 -0
  20. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/helpers/attachment.js.map +1 -0
  21. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/helpers/host-readiness.js +18 -0
  22. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/helpers/host-readiness.js.map +1 -0
  23. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/helpers/local-measurement.js +22 -1
  24. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/helpers/local-measurement.js.map +1 -1
  25. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/hooks/use-active-portal-boundary-host.js +10 -10
  26. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/hooks/use-active-portal-boundary-host.js.map +1 -1
  27. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js +18 -6
  28. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js.map +1 -1
  29. package/lib/commonjs/shared/providers/helpers/measured-bounds-writes.js +4 -0
  30. package/lib/commonjs/shared/providers/helpers/measured-bounds-writes.js.map +1 -1
  31. package/lib/commonjs/shared/providers/screen/animation/animation.provider.js +4 -1
  32. package/lib/commonjs/shared/providers/screen/animation/animation.provider.js.map +1 -1
  33. package/lib/commonjs/shared/providers/screen/animation/helpers/hydrate-transition-state/index.js +5 -1
  34. package/lib/commonjs/shared/providers/screen/animation/helpers/hydrate-transition-state/index.js.map +1 -1
  35. package/lib/commonjs/shared/providers/screen/animation/helpers/interpolator-participation.js +9 -0
  36. package/lib/commonjs/shared/providers/screen/animation/helpers/interpolator-participation.js.map +1 -0
  37. package/lib/commonjs/shared/providers/screen/animation/helpers/pipeline.js +13 -2
  38. package/lib/commonjs/shared/providers/screen/animation/helpers/pipeline.js.map +1 -1
  39. package/lib/commonjs/shared/providers/screen/descriptors/descriptors.provider.js +40 -8
  40. package/lib/commonjs/shared/providers/screen/descriptors/descriptors.provider.js.map +1 -1
  41. package/lib/commonjs/shared/providers/screen/descriptors/helpers/derive-descriptor-derivations.js +2 -0
  42. package/lib/commonjs/shared/providers/screen/descriptors/helpers/derive-descriptor-derivations.js.map +1 -1
  43. package/lib/commonjs/shared/providers/screen/descriptors/helpers/derive-structural-ancestor-keys.js +12 -0
  44. package/lib/commonjs/shared/providers/screen/descriptors/helpers/derive-structural-ancestor-keys.js.map +1 -0
  45. package/lib/commonjs/shared/providers/screen/gestures/pan/behavior/pan-lifecycle.js +1 -0
  46. package/lib/commonjs/shared/providers/screen/gestures/pan/behavior/pan-lifecycle.js.map +1 -1
  47. package/lib/commonjs/shared/providers/screen/gestures/pan/behavior/pan-release.js +9 -2
  48. package/lib/commonjs/shared/providers/screen/gestures/pan/behavior/pan-release.js.map +1 -1
  49. package/lib/commonjs/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.js +1 -0
  50. package/lib/commonjs/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.js.map +1 -1
  51. package/lib/commonjs/shared/providers/screen/styles/constants.js +2 -1
  52. package/lib/commonjs/shared/providers/screen/styles/constants.js.map +1 -1
  53. package/lib/commonjs/shared/providers/screen/styles/helpers/visibility-block-ownership.js +19 -0
  54. package/lib/commonjs/shared/providers/screen/styles/helpers/visibility-block-ownership.js.map +1 -0
  55. package/lib/commonjs/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js +35 -15
  56. package/lib/commonjs/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js.map +1 -1
  57. package/lib/commonjs/shared/providers/screen/styles/slot.provider.js +15 -6
  58. package/lib/commonjs/shared/providers/screen/styles/slot.provider.js.map +1 -1
  59. package/lib/commonjs/shared/stores/bounds/helpers/link-pairs.helpers.js +11 -1
  60. package/lib/commonjs/shared/stores/bounds/helpers/link-pairs.helpers.js.map +1 -1
  61. package/lib/commonjs/shared/stores/bounds/internals/clear.js +6 -0
  62. package/lib/commonjs/shared/stores/bounds/internals/clear.js.map +1 -1
  63. package/lib/commonjs/shared/stores/bounds/internals/coordinator.js +298 -0
  64. package/lib/commonjs/shared/stores/bounds/internals/coordinator.js.map +1 -0
  65. package/lib/commonjs/shared/stores/bounds/internals/entries.js +0 -27
  66. package/lib/commonjs/shared/stores/bounds/internals/entries.js.map +1 -1
  67. package/lib/commonjs/shared/stores/bounds/internals/links.js +22 -32
  68. package/lib/commonjs/shared/stores/bounds/internals/links.js.map +1 -1
  69. package/lib/commonjs/shared/stores/bounds/internals/screen-graph.js +45 -0
  70. package/lib/commonjs/shared/stores/bounds/internals/screen-graph.js.map +1 -0
  71. package/lib/commonjs/shared/stores/bounds/internals/state.js +4 -1
  72. package/lib/commonjs/shared/stores/bounds/internals/state.js.map +1 -1
  73. package/lib/commonjs/shared/utils/bounds/helpers/create-bounds-accessor-core.js +7 -3
  74. package/lib/commonjs/shared/utils/bounds/helpers/create-bounds-accessor-core.js.map +1 -1
  75. package/lib/commonjs/shared/utils/bounds/helpers/create-link-accessor.js +11 -0
  76. package/lib/commonjs/shared/utils/bounds/helpers/create-link-accessor.js.map +1 -1
  77. package/lib/commonjs/shared/utils/bounds/helpers/prepare-bound-styles.js +6 -2
  78. package/lib/commonjs/shared/utils/bounds/helpers/prepare-bound-styles.js.map +1 -1
  79. package/lib/commonjs/shared/utils/bounds/helpers/resolve-bounds-pair-key.js.map +1 -1
  80. package/lib/commonjs/shared/utils/bounds/helpers/styles/compute.js +11 -5
  81. package/lib/commonjs/shared/utils/bounds/helpers/styles/compute.js.map +1 -1
  82. package/lib/module/shared/components/activity/variants/activity-screen.js +1 -1
  83. package/lib/module/shared/components/activity/variants/activity-screen.js.map +1 -1
  84. package/lib/module/shared/components/boundary/components/boundary-lifecycle.js +0 -3
  85. package/lib/module/shared/components/boundary/components/boundary-lifecycle.js.map +1 -1
  86. package/lib/module/shared/components/boundary/hooks/lifecycles/use-boundary-measurement-request.js +64 -0
  87. package/lib/module/shared/components/boundary/hooks/lifecycles/use-boundary-measurement-request.js.map +1 -0
  88. package/lib/module/shared/components/boundary/hooks/lifecycles/use-boundary-presence.js +11 -10
  89. package/lib/module/shared/components/boundary/hooks/lifecycles/use-boundary-presence.js.map +1 -1
  90. package/lib/module/shared/components/boundary/hooks/use-boundary-measurement.js +3 -19
  91. package/lib/module/shared/components/boundary/hooks/use-boundary-measurement.js.map +1 -1
  92. package/lib/module/shared/components/boundary/hooks/use-measurer.js +6 -16
  93. package/lib/module/shared/components/boundary/hooks/use-measurer.js.map +1 -1
  94. package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/helpers/active-handoff-receiver.js +24 -0
  95. package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/helpers/active-handoff-receiver.js.map +1 -1
  96. package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js +27 -9
  97. package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js.map +1 -1
  98. package/lib/module/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.js +8 -1
  99. package/lib/module/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.js.map +1 -1
  100. package/lib/module/shared/components/boundary/portal/components/boundary-portal/helpers/attachment.js +14 -0
  101. package/lib/module/shared/components/boundary/portal/components/boundary-portal/helpers/attachment.js.map +1 -0
  102. package/lib/module/shared/components/boundary/portal/components/boundary-portal/helpers/host-readiness.js +13 -0
  103. package/lib/module/shared/components/boundary/portal/components/boundary-portal/helpers/host-readiness.js.map +1 -0
  104. package/lib/module/shared/components/boundary/portal/components/boundary-portal/helpers/local-measurement.js +19 -0
  105. package/lib/module/shared/components/boundary/portal/components/boundary-portal/helpers/local-measurement.js.map +1 -1
  106. package/lib/module/shared/components/boundary/portal/components/boundary-portal/hooks/use-active-portal-boundary-host.js +10 -10
  107. package/lib/module/shared/components/boundary/portal/components/boundary-portal/hooks/use-active-portal-boundary-host.js.map +1 -1
  108. package/lib/module/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js +18 -6
  109. package/lib/module/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js.map +1 -1
  110. package/lib/module/shared/providers/helpers/measured-bounds-writes.js +4 -0
  111. package/lib/module/shared/providers/helpers/measured-bounds-writes.js.map +1 -1
  112. package/lib/module/shared/providers/screen/animation/animation.provider.js +4 -1
  113. package/lib/module/shared/providers/screen/animation/animation.provider.js.map +1 -1
  114. package/lib/module/shared/providers/screen/animation/helpers/hydrate-transition-state/index.js +5 -1
  115. package/lib/module/shared/providers/screen/animation/helpers/hydrate-transition-state/index.js.map +1 -1
  116. package/lib/module/shared/providers/screen/animation/helpers/interpolator-participation.js +4 -0
  117. package/lib/module/shared/providers/screen/animation/helpers/interpolator-participation.js.map +1 -0
  118. package/lib/module/shared/providers/screen/animation/helpers/pipeline.js +13 -2
  119. package/lib/module/shared/providers/screen/animation/helpers/pipeline.js.map +1 -1
  120. package/lib/module/shared/providers/screen/descriptors/descriptors.provider.js +41 -9
  121. package/lib/module/shared/providers/screen/descriptors/descriptors.provider.js.map +1 -1
  122. package/lib/module/shared/providers/screen/descriptors/helpers/derive-descriptor-derivations.js +2 -0
  123. package/lib/module/shared/providers/screen/descriptors/helpers/derive-descriptor-derivations.js.map +1 -1
  124. package/lib/module/shared/providers/screen/descriptors/helpers/derive-structural-ancestor-keys.js +7 -0
  125. package/lib/module/shared/providers/screen/descriptors/helpers/derive-structural-ancestor-keys.js.map +1 -0
  126. package/lib/module/shared/providers/screen/gestures/pan/behavior/pan-lifecycle.js +1 -0
  127. package/lib/module/shared/providers/screen/gestures/pan/behavior/pan-lifecycle.js.map +1 -1
  128. package/lib/module/shared/providers/screen/gestures/pan/behavior/pan-release.js +9 -2
  129. package/lib/module/shared/providers/screen/gestures/pan/behavior/pan-release.js.map +1 -1
  130. package/lib/module/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.js +1 -0
  131. package/lib/module/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.js.map +1 -1
  132. package/lib/module/shared/providers/screen/styles/constants.js +2 -1
  133. package/lib/module/shared/providers/screen/styles/constants.js.map +1 -1
  134. package/lib/module/shared/providers/screen/styles/helpers/visibility-block-ownership.js +14 -0
  135. package/lib/module/shared/providers/screen/styles/helpers/visibility-block-ownership.js.map +1 -0
  136. package/lib/module/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js +35 -15
  137. package/lib/module/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js.map +1 -1
  138. package/lib/module/shared/providers/screen/styles/slot.provider.js +13 -5
  139. package/lib/module/shared/providers/screen/styles/slot.provider.js.map +1 -1
  140. package/lib/module/shared/stores/bounds/helpers/link-pairs.helpers.js +9 -0
  141. package/lib/module/shared/stores/bounds/helpers/link-pairs.helpers.js.map +1 -1
  142. package/lib/module/shared/stores/bounds/internals/clear.js +7 -1
  143. package/lib/module/shared/stores/bounds/internals/clear.js.map +1 -1
  144. package/lib/module/shared/stores/bounds/internals/coordinator.js +286 -0
  145. package/lib/module/shared/stores/bounds/internals/coordinator.js.map +1 -0
  146. package/lib/module/shared/stores/bounds/internals/entries.js +1 -27
  147. package/lib/module/shared/stores/bounds/internals/entries.js.map +1 -1
  148. package/lib/module/shared/stores/bounds/internals/links.js +24 -32
  149. package/lib/module/shared/stores/bounds/internals/links.js.map +1 -1
  150. package/lib/module/shared/stores/bounds/internals/screen-graph.js +39 -0
  151. package/lib/module/shared/stores/bounds/internals/screen-graph.js.map +1 -0
  152. package/lib/module/shared/stores/bounds/internals/state.js +3 -0
  153. package/lib/module/shared/stores/bounds/internals/state.js.map +1 -1
  154. package/lib/module/shared/utils/bounds/helpers/create-bounds-accessor-core.js +7 -3
  155. package/lib/module/shared/utils/bounds/helpers/create-bounds-accessor-core.js.map +1 -1
  156. package/lib/module/shared/utils/bounds/helpers/create-link-accessor.js +11 -0
  157. package/lib/module/shared/utils/bounds/helpers/create-link-accessor.js.map +1 -1
  158. package/lib/module/shared/utils/bounds/helpers/prepare-bound-styles.js +6 -2
  159. package/lib/module/shared/utils/bounds/helpers/prepare-bound-styles.js.map +1 -1
  160. package/lib/module/shared/utils/bounds/helpers/resolve-bounds-pair-key.js.map +1 -1
  161. package/lib/module/shared/utils/bounds/helpers/styles/compute.js +11 -5
  162. package/lib/module/shared/utils/bounds/helpers/styles/compute.js.map +1 -1
  163. package/lib/typescript/native-stack/views/useHeaderConfigProps.d.ts +1 -1
  164. package/lib/typescript/shared/components/boundary/components/boundary-lifecycle.d.ts.map +1 -1
  165. package/lib/typescript/shared/components/boundary/hooks/lifecycles/{use-initial-source-measurement.d.ts → use-boundary-measurement-request.d.ts} +4 -3
  166. package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-boundary-measurement-request.d.ts.map +1 -0
  167. package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-boundary-presence.d.ts.map +1 -1
  168. package/lib/typescript/shared/components/boundary/hooks/use-boundary-measurement.d.ts +1 -3
  169. package/lib/typescript/shared/components/boundary/hooks/use-boundary-measurement.d.ts.map +1 -1
  170. package/lib/typescript/shared/components/boundary/hooks/use-measurer.d.ts.map +1 -1
  171. package/lib/typescript/shared/components/boundary/portal/components/boundary-content-portal/helpers/active-handoff-receiver.d.ts +12 -0
  172. package/lib/typescript/shared/components/boundary/portal/components/boundary-content-portal/helpers/active-handoff-receiver.d.ts.map +1 -1
  173. package/lib/typescript/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.d.ts.map +1 -1
  174. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.d.ts.map +1 -1
  175. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/helpers/attachment.d.ts +8 -0
  176. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/helpers/attachment.d.ts.map +1 -0
  177. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/helpers/host-readiness.d.ts +6 -0
  178. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/helpers/host-readiness.d.ts.map +1 -0
  179. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/helpers/local-measurement.d.ts +4 -1
  180. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/helpers/local-measurement.d.ts.map +1 -1
  181. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/hooks/use-active-portal-boundary-host.d.ts +2 -3
  182. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/hooks/use-active-portal-boundary-host.d.ts.map +1 -1
  183. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.d.ts.map +1 -1
  184. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/hooks/use-placeholder-styles.d.ts +2 -2
  185. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/stores/portal-boundary-host.store.d.ts +1 -1
  186. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/stores/portal-boundary-host.store.d.ts.map +1 -1
  187. package/lib/typescript/shared/components/boundary/types.d.ts +1 -1
  188. package/lib/typescript/shared/components/boundary/types.d.ts.map +1 -1
  189. package/lib/typescript/shared/components/create-transition-aware-component.d.ts +5 -6
  190. package/lib/typescript/shared/components/create-transition-aware-component.d.ts.map +1 -1
  191. package/lib/typescript/shared/components/overlay/hooks/use-overlay-slot.d.ts +1 -1
  192. package/lib/typescript/shared/index.d.ts +651 -703
  193. package/lib/typescript/shared/index.d.ts.map +1 -1
  194. package/lib/typescript/shared/providers/helpers/measured-bounds-writes.d.ts.map +1 -1
  195. package/lib/typescript/shared/providers/screen/animation/animation.provider.d.ts.map +1 -1
  196. package/lib/typescript/shared/providers/screen/animation/helpers/hydrate-transition-state/index.d.ts.map +1 -1
  197. package/lib/typescript/shared/providers/screen/animation/helpers/interpolator-participation.d.ts +3 -0
  198. package/lib/typescript/shared/providers/screen/animation/helpers/interpolator-participation.d.ts.map +1 -0
  199. package/lib/typescript/shared/providers/screen/animation/helpers/pipeline.d.ts +2 -1
  200. package/lib/typescript/shared/providers/screen/animation/helpers/pipeline.d.ts.map +1 -1
  201. package/lib/typescript/shared/providers/screen/descriptors/descriptors.provider.d.ts.map +1 -1
  202. package/lib/typescript/shared/providers/screen/descriptors/helpers/derive-descriptor-derivations.d.ts +4 -0
  203. package/lib/typescript/shared/providers/screen/descriptors/helpers/derive-descriptor-derivations.d.ts.map +1 -1
  204. package/lib/typescript/shared/providers/screen/descriptors/helpers/derive-structural-ancestor-keys.d.ts +5 -0
  205. package/lib/typescript/shared/providers/screen/descriptors/helpers/derive-structural-ancestor-keys.d.ts.map +1 -0
  206. package/lib/typescript/shared/providers/screen/gestures/pan/behavior/pan-lifecycle.d.ts.map +1 -1
  207. package/lib/typescript/shared/providers/screen/gestures/pan/behavior/pan-release.d.ts.map +1 -1
  208. package/lib/typescript/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.d.ts.map +1 -1
  209. package/lib/typescript/shared/providers/screen/gestures/types.d.ts +1 -0
  210. package/lib/typescript/shared/providers/screen/gestures/types.d.ts.map +1 -1
  211. package/lib/typescript/shared/providers/screen/styles/constants.d.ts.map +1 -1
  212. package/lib/typescript/shared/providers/screen/styles/helpers/visibility-block-ownership.d.ts +10 -0
  213. package/lib/typescript/shared/providers/screen/styles/helpers/visibility-block-ownership.d.ts.map +1 -0
  214. package/lib/typescript/shared/providers/screen/styles/hooks/slot-resolvers.d.ts +4 -4
  215. package/lib/typescript/shared/providers/screen/styles/hooks/slot-resolvers.d.ts.map +1 -1
  216. package/lib/typescript/shared/providers/screen/styles/hooks/use-maybe-block-visibility.d.ts +10 -4
  217. package/lib/typescript/shared/providers/screen/styles/hooks/use-maybe-block-visibility.d.ts.map +1 -1
  218. package/lib/typescript/shared/providers/screen/styles/slot.provider.d.ts +1 -0
  219. package/lib/typescript/shared/providers/screen/styles/slot.provider.d.ts.map +1 -1
  220. package/lib/typescript/shared/stores/bounds/helpers/link-pairs.helpers.d.ts +1 -0
  221. package/lib/typescript/shared/stores/bounds/helpers/link-pairs.helpers.d.ts.map +1 -1
  222. package/lib/typescript/shared/stores/bounds/internals/clear.d.ts.map +1 -1
  223. package/lib/typescript/shared/stores/bounds/internals/coordinator.d.ts +36 -0
  224. package/lib/typescript/shared/stores/bounds/internals/coordinator.d.ts.map +1 -0
  225. package/lib/typescript/shared/stores/bounds/internals/entries.d.ts +1 -2
  226. package/lib/typescript/shared/stores/bounds/internals/entries.d.ts.map +1 -1
  227. package/lib/typescript/shared/stores/bounds/internals/links.d.ts +1 -3
  228. package/lib/typescript/shared/stores/bounds/internals/links.d.ts.map +1 -1
  229. package/lib/typescript/shared/stores/bounds/internals/screen-graph.d.ts +5 -0
  230. package/lib/typescript/shared/stores/bounds/internals/screen-graph.d.ts.map +1 -0
  231. package/lib/typescript/shared/stores/bounds/internals/state.d.ts +3 -1
  232. package/lib/typescript/shared/stores/bounds/internals/state.d.ts.map +1 -1
  233. package/lib/typescript/shared/stores/bounds/types.d.ts +13 -1
  234. package/lib/typescript/shared/stores/bounds/types.d.ts.map +1 -1
  235. package/lib/typescript/shared/types/screen.types.d.ts +9 -0
  236. package/lib/typescript/shared/types/screen.types.d.ts.map +1 -1
  237. package/lib/typescript/shared/utils/bounds/helpers/create-bounds-accessor-core.d.ts.map +1 -1
  238. package/lib/typescript/shared/utils/bounds/helpers/create-link-accessor.d.ts.map +1 -1
  239. package/lib/typescript/shared/utils/bounds/helpers/prepare-bound-styles.d.ts.map +1 -1
  240. package/lib/typescript/shared/utils/bounds/helpers/resolve-bounds-pair-key.d.ts.map +1 -1
  241. package/lib/typescript/shared/utils/bounds/helpers/styles/compute.d.ts.map +1 -1
  242. package/package.json +1 -1
  243. package/src/shared/components/activity/variants/activity-screen.tsx +1 -1
  244. package/src/shared/components/boundary/components/boundary-lifecycle.tsx +0 -6
  245. package/src/shared/components/boundary/hooks/lifecycles/use-boundary-measurement-request.ts +102 -0
  246. package/src/shared/components/boundary/hooks/lifecycles/use-boundary-presence.ts +20 -11
  247. package/src/shared/components/boundary/hooks/use-boundary-measurement.ts +3 -22
  248. package/src/shared/components/boundary/hooks/use-measurer.ts +5 -20
  249. package/src/shared/components/boundary/portal/components/boundary-content-portal/helpers/active-handoff-receiver.ts +40 -0
  250. package/src/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.ts +68 -20
  251. package/src/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.tsx +10 -1
  252. package/src/shared/components/boundary/portal/components/boundary-portal/helpers/attachment.ts +19 -0
  253. package/src/shared/components/boundary/portal/components/boundary-portal/helpers/host-readiness.ts +14 -0
  254. package/src/shared/components/boundary/portal/components/boundary-portal/helpers/local-measurement.ts +36 -1
  255. package/src/shared/components/boundary/portal/components/boundary-portal/hooks/use-active-portal-boundary-host.ts +22 -13
  256. package/src/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.ts +26 -9
  257. package/src/shared/components/boundary/portal/components/boundary-portal/stores/portal-boundary-host.store.ts +1 -1
  258. package/src/shared/components/boundary/types.ts +1 -1
  259. package/src/shared/providers/helpers/measured-bounds-writes.ts +5 -0
  260. package/src/shared/providers/screen/animation/animation.provider.tsx +7 -1
  261. package/src/shared/providers/screen/animation/helpers/hydrate-transition-state/index.ts +18 -3
  262. package/src/shared/providers/screen/animation/helpers/interpolator-participation.ts +6 -0
  263. package/src/shared/providers/screen/animation/helpers/pipeline.ts +54 -32
  264. package/src/shared/providers/screen/descriptors/descriptors.provider.tsx +80 -14
  265. package/src/shared/providers/screen/descriptors/helpers/derive-descriptor-derivations.ts +6 -0
  266. package/src/shared/providers/screen/descriptors/helpers/derive-structural-ancestor-keys.ts +13 -0
  267. package/src/shared/providers/screen/gestures/pan/behavior/pan-lifecycle.ts +1 -0
  268. package/src/shared/providers/screen/gestures/pan/behavior/pan-release.ts +12 -2
  269. package/src/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.ts +1 -0
  270. package/src/shared/providers/screen/gestures/types.ts +1 -0
  271. package/src/shared/providers/screen/styles/constants.ts +1 -0
  272. package/src/shared/providers/screen/styles/helpers/visibility-block-ownership.ts +16 -0
  273. package/src/shared/providers/screen/styles/hooks/use-maybe-block-visibility.tsx +40 -15
  274. package/src/shared/providers/screen/styles/slot.provider.tsx +19 -5
  275. package/src/shared/stores/bounds/helpers/link-pairs.helpers.ts +12 -0
  276. package/src/shared/stores/bounds/internals/clear.ts +12 -1
  277. package/src/shared/stores/bounds/internals/coordinator.ts +403 -0
  278. package/src/shared/stores/bounds/internals/entries.ts +1 -38
  279. package/src/shared/stores/bounds/internals/links.ts +28 -38
  280. package/src/shared/stores/bounds/internals/screen-graph.ts +45 -0
  281. package/src/shared/stores/bounds/internals/state.ts +10 -1
  282. package/src/shared/stores/bounds/types.ts +19 -1
  283. package/src/shared/types/screen.types.ts +10 -0
  284. package/src/shared/utils/bounds/helpers/create-bounds-accessor-core.ts +8 -3
  285. package/src/shared/utils/bounds/helpers/create-link-accessor.ts +11 -0
  286. package/src/shared/utils/bounds/helpers/prepare-bound-styles.ts +3 -2
  287. package/src/shared/utils/bounds/helpers/resolve-bounds-pair-key.ts +0 -1
  288. package/src/shared/utils/bounds/helpers/styles/compute.ts +12 -5
  289. package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js +0 -177
  290. package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js.map +0 -1
  291. package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-initial-source-measurement.js +0 -49
  292. package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-initial-source-measurement.js.map +0 -1
  293. package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-refresh-boundary.js +0 -69
  294. package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-refresh-boundary.js.map +0 -1
  295. package/lib/commonjs/shared/components/boundary/utils/destination-signals.js +0 -68
  296. package/lib/commonjs/shared/components/boundary/utils/destination-signals.js.map +0 -1
  297. package/lib/commonjs/shared/components/boundary/utils/refresh-signals.js +0 -97
  298. package/lib/commonjs/shared/components/boundary/utils/refresh-signals.js.map +0 -1
  299. package/lib/commonjs/shared/components/boundary/utils/source-signals.js +0 -43
  300. package/lib/commonjs/shared/components/boundary/utils/source-signals.js.map +0 -1
  301. package/lib/commonjs/shared/providers/screen/descriptors/helpers/get-ancestor-keys.js +0 -29
  302. package/lib/commonjs/shared/providers/screen/descriptors/helpers/get-ancestor-keys.js.map +0 -1
  303. package/lib/module/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js +0 -173
  304. package/lib/module/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js.map +0 -1
  305. package/lib/module/shared/components/boundary/hooks/lifecycles/use-initial-source-measurement.js +0 -44
  306. package/lib/module/shared/components/boundary/hooks/lifecycles/use-initial-source-measurement.js.map +0 -1
  307. package/lib/module/shared/components/boundary/hooks/lifecycles/use-refresh-boundary.js +0 -64
  308. package/lib/module/shared/components/boundary/hooks/lifecycles/use-refresh-boundary.js.map +0 -1
  309. package/lib/module/shared/components/boundary/utils/destination-signals.js +0 -63
  310. package/lib/module/shared/components/boundary/utils/destination-signals.js.map +0 -1
  311. package/lib/module/shared/components/boundary/utils/refresh-signals.js +0 -92
  312. package/lib/module/shared/components/boundary/utils/refresh-signals.js.map +0 -1
  313. package/lib/module/shared/components/boundary/utils/source-signals.js +0 -38
  314. package/lib/module/shared/components/boundary/utils/source-signals.js.map +0 -1
  315. package/lib/module/shared/providers/screen/descriptors/helpers/get-ancestor-keys.js +0 -25
  316. package/lib/module/shared/providers/screen/descriptors/helpers/get-ancestor-keys.js.map +0 -1
  317. package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.d.ts +0 -10
  318. package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.d.ts.map +0 -1
  319. package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-initial-source-measurement.d.ts.map +0 -1
  320. package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-refresh-boundary.d.ts +0 -10
  321. package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-refresh-boundary.d.ts.map +0 -1
  322. package/lib/typescript/shared/components/boundary/utils/destination-signals.d.ts +0 -16
  323. package/lib/typescript/shared/components/boundary/utils/destination-signals.d.ts.map +0 -1
  324. package/lib/typescript/shared/components/boundary/utils/refresh-signals.d.ts +0 -19
  325. package/lib/typescript/shared/components/boundary/utils/refresh-signals.d.ts.map +0 -1
  326. package/lib/typescript/shared/components/boundary/utils/source-signals.d.ts +0 -14
  327. package/lib/typescript/shared/components/boundary/utils/source-signals.d.ts.map +0 -1
  328. package/lib/typescript/shared/providers/screen/descriptors/helpers/get-ancestor-keys.d.ts +0 -6
  329. package/lib/typescript/shared/providers/screen/descriptors/helpers/get-ancestor-keys.d.ts.map +0 -1
  330. package/src/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.ts +0 -267
  331. package/src/shared/components/boundary/hooks/lifecycles/use-initial-source-measurement.ts +0 -51
  332. package/src/shared/components/boundary/hooks/lifecycles/use-refresh-boundary.ts +0 -90
  333. package/src/shared/components/boundary/utils/destination-signals.ts +0 -75
  334. package/src/shared/components/boundary/utils/refresh-signals.ts +0 -164
  335. package/src/shared/components/boundary/utils/source-signals.ts +0 -51
  336. package/src/shared/providers/screen/descriptors/helpers/get-ancestor-keys.ts +0 -28
@@ -1,9 +1,12 @@
1
+ import { useIsFocused } from "@react-navigation/native";
1
2
  import { useAnimatedProps, useSharedValue } from "react-native-reanimated";
2
3
  import { useDescriptorsStore } from "../../../../../../providers/screen/descriptors";
3
4
  import { useScreenSlots } from "../../../../../../providers/screen/styles";
5
+ import { pairs } from "../../../../../../stores/bounds/internals/state";
4
6
  import { useBoundaryRootStore } from "../../../../providers/boundary-root.provider";
5
7
  import { PORTAL_HOST_NAME_RESET_VALUE } from "../../../utils/naming";
6
- import { isTeleportEnabled } from "../../../utils/teleport-control";
8
+ import { shouldAttachBoundaryPortal } from "../helpers/attachment";
9
+ import { resolveActiveBoundaryPortalPairKey } from "../helpers/local-measurement";
7
10
  import { useActiveHostKey } from "../stores/host-registry.store";
8
11
  import { useActivePortalBoundaryHost } from "./use-active-portal-boundary-host";
9
12
 
@@ -24,14 +27,17 @@ export const useBoundaryPortalAttachment = ({
24
27
  const currentScreenKey = useDescriptorsStore(
25
28
  (s) => s.derivations.currentScreenKey,
26
29
  );
30
+ // React Navigation resolves focus through the entire parent navigator chain.
31
+ // A leaf that is still selected in its own one-screen stack becomes unfocused
32
+ // when any ancestor route is covered.
33
+ const focused = useIsFocused();
27
34
  const { slotsMap } = useScreenSlots();
28
35
  const portalHostName = useSharedValue<string | null>(null);
29
- const portalHostReady = useSharedValue(false);
36
+ const portalHostReady = useSharedValue<string | null>(null);
30
37
  const escapeHostKey = useActiveHostKey(currentScreenKey);
31
38
 
32
39
  useActivePortalBoundaryHost({
33
40
  boundaryId,
34
- currentScreenKey,
35
41
  escapeHostKey,
36
42
  localMeasurement,
37
43
  portalHostName,
@@ -49,20 +55,31 @@ export const useBoundaryPortalAttachment = ({
49
55
  ...slotProps
50
56
  } = slot?.props ?? {};
51
57
 
52
- const shouldAttach =
53
- slot !== undefined &&
54
- isTeleportEnabled(teleport) &&
55
- portalHostReady.get();
58
+ const activePortalHostName = portalHostName.get();
59
+ const shouldAttach = shouldAttachBoundaryPortal({
60
+ focused,
61
+ portalHostReady:
62
+ activePortalHostName !== null &&
63
+ portalHostReady.get() === activePortalHostName,
64
+ slotActive:
65
+ resolveActiveBoundaryPortalPairKey(
66
+ localMeasurement.get(),
67
+ slot,
68
+ boundaryId,
69
+ pairs.get(),
70
+ ) !== null && slot !== undefined,
71
+ teleport,
72
+ });
56
73
 
57
74
  const hostName = shouldAttach
58
- ? portalHostName.get()
75
+ ? activePortalHostName
59
76
  : PORTAL_HOST_NAME_RESET_VALUE;
60
77
 
61
78
  return {
62
79
  ...slotProps,
63
80
  hostName,
64
81
  };
65
- });
82
+ }, [focused]);
66
83
 
67
84
  return { teleportProps };
68
85
  };
@@ -9,7 +9,7 @@ export type ActivePortalBoundaryHost = {
9
9
  localMeasurement: BoundaryLocalMeasurementValue;
10
10
  pairKey: string;
11
11
  portalHostName: string;
12
- portalHostReady: SharedValue<boolean>;
12
+ portalHostReady: SharedValue<string | null>;
13
13
  slotsMap: SharedValue<NormalizedTransitionInterpolatedStyle>;
14
14
  };
15
15
 
@@ -60,7 +60,7 @@ export type MeasureTarget =
60
60
  pairKey: ScreenPairKey;
61
61
  };
62
62
 
63
- export type MeasureBoundary = (target: MeasureTarget) => void;
63
+ export type MeasureBoundary = (target: MeasureTarget) => boolean;
64
64
 
65
65
  export type BoundaryLocalMeasurement = {
66
66
  bounds: MeasuredDimensions;
@@ -1,4 +1,5 @@
1
1
  import type { MeasuredDimensions, StyleProps } from "react-native-reanimated";
2
+ import { completeBoundaryMeasurement } from "../../stores/bounds/internals/coordinator";
2
3
  import { setEntry } from "../../stores/bounds/internals/entries";
3
4
  import { setDestination, setSource } from "../../stores/bounds/internals/links";
4
5
  import type { ScreenPairKey } from "../../stores/bounds/types";
@@ -70,4 +71,8 @@ export const applyMeasuredBoundsWrites = (
70
71
  { handoff },
71
72
  );
72
73
  }
74
+
75
+ if (linkWrite) {
76
+ completeBoundaryMeasurement(linkWrite, entryTag);
77
+ }
73
78
  };
@@ -57,13 +57,18 @@ export const { ScreenAnimationProvider, useScreenAnimationStore } =
57
57
  parentContext?.ancestorDescendantScreenAnimationRegistrars,
58
58
  );
59
59
 
60
+ const parentInterpolatorUpdatesEnabled = useParentStore(
61
+ (parentContext) => parentContext?.interpolatorUpdatesEnabled,
62
+ );
63
+
60
64
  const {
65
+ interpolatorUpdatesEnabled,
61
66
  screenInterpolatorProps,
62
67
  screenInterpolatorPropsRevision,
63
68
  selectedInterpolatorOptions,
64
69
  nextInterpolator,
65
70
  currentInterpolator,
66
- } = useScreenAnimationPipeline();
71
+ } = useScreenAnimationPipeline(parentInterpolatorUpdatesEnabled ?? true);
67
72
 
68
73
  const selfScreenAnimationSource = useMemo<ScreenAnimationSource>(
69
74
  () => ({
@@ -206,6 +211,7 @@ export const { ScreenAnimationProvider, useScreenAnimationStore } =
206
211
  return {
207
212
  key: currentScreenKey,
208
213
  value: {
214
+ interpolatorUpdatesEnabled,
209
215
  screenInterpolatorProps,
210
216
  screenInterpolatorPropsRevision,
211
217
  selectedInterpolatorOptions,
@@ -210,14 +210,29 @@ export const hydrateTransitionState = (
210
210
  const resolvedAutoSnap =
211
211
  s.hasAutoSnapPoint && autoSnapPoint > 0 ? autoSnapPoint : null;
212
212
 
213
+ const targetProgress = s.targetProgress.get();
214
+ const lockedSnapPoint = s.gesture.internal.lockedSnapPoint.get();
215
+
216
+ const isSettlingToLockedSnapPoint =
217
+ out.gesture.settling && targetProgress === lockedSnapPoint;
218
+
219
+ const isLockedGestureLifecycle =
220
+ options.gestureSnapLocked &&
221
+ lockedSnapPoint !== null &&
222
+ (out.gesture.dragging ||
223
+ isSettlingToLockedSnapPoint ||
224
+ out.gesture.dismissing);
225
+
226
+ const animatedSnapProgress = isLockedGestureLifecycle
227
+ ? lockedSnapPoint
228
+ : out.progress;
229
+
213
230
  out.animatedSnapIndex = computeAnimatedSnapIndex(
214
- out.progress,
231
+ animatedSnapProgress,
215
232
  s.sortedNumericSnapPoints,
216
233
  resolvedAutoSnap,
217
234
  );
218
235
 
219
- const targetProgress = s.targetProgress.get();
220
-
221
236
  out.snapIndex = computeTargetSnapIndex(
222
237
  targetProgress,
223
238
  s.sortedNumericSnapPoints,
@@ -0,0 +1,6 @@
1
+ import type { StackSceneActivity } from "../../../../types/stack.types";
2
+
3
+ export const shouldUpdateScreenInterpolator = (
4
+ activity: StackSceneActivity,
5
+ updateInactiveInterpolators: boolean,
6
+ ) => activity !== "inactive" || updateInactiveInterpolators;
@@ -23,6 +23,7 @@ import { buildScreenTransitionOptions } from "./build-screen-transition-options"
23
23
  import { updateDerivations } from "./derivations";
24
24
  import { hasTransitionsEnabled } from "./has-transitions-enabled";
25
25
  import { hydrateTransitionState } from "./hydrate-transition-state";
26
+ import { shouldUpdateScreenInterpolator } from "./interpolator-participation";
26
27
  import type { SelectedInterpolatorOptions } from "./selected-interpolator-options";
27
28
  import { resolveStackProgress } from "./stack-progress";
28
29
  import { useBuildTransitionState } from "./use-build-transition-state";
@@ -34,6 +35,7 @@ export type ScreenInterpolatorFrame = Omit<
34
35
  >;
35
36
 
36
37
  interface ScreenAnimationPipeline {
38
+ interpolatorUpdatesEnabled: boolean;
37
39
  screenInterpolatorProps: SharedValue<ScreenInterpolatorFrame>;
38
40
  screenInterpolatorPropsRevision: DerivedValue<number>;
39
41
  selectedInterpolatorOptions: SharedValue<SelectedInterpolatorOptions>;
@@ -273,7 +275,9 @@ const hydrateInterpolatorFrame = <TFrame extends ScreenInterpolatorFrame>({
273
275
  return frame;
274
276
  };
275
277
 
276
- export function useScreenAnimationPipeline(): ScreenAnimationPipeline {
278
+ export function useScreenAnimationPipeline(
279
+ parentInterpolatorUpdatesEnabled = true,
280
+ ): ScreenAnimationPipeline {
277
281
  const transitionsAlwaysOn = useStack(
278
282
  (stack) => stack.flags.TRANSITIONS_ALWAYS_ON,
279
283
  );
@@ -283,6 +287,16 @@ export function useScreenAnimationPipeline(): ScreenAnimationPipeline {
283
287
  const currDescriptor = useDescriptorsStore((store) => store.current);
284
288
  const nextDescriptor = useDescriptorsStore((store) => store.next);
285
289
  const prevDescriptor = useDescriptorsStore((store) => store.previous);
290
+ const currentActivity = useStack((stack) => {
291
+ const routeIndex = stack.routeKeys.indexOf(currDescriptor.route.key);
292
+ return stack.scenes[routeIndex]?.activity;
293
+ });
294
+ const interpolatorUpdatesEnabled =
295
+ parentInterpolatorUpdatesEnabled &&
296
+ shouldUpdateScreenInterpolator(
297
+ currentActivity ?? "active",
298
+ currDescriptor.options.experimental_updateInactiveInterpolators === true,
299
+ );
286
300
 
287
301
  const currentAnimation = useBuildTransitionState(currDescriptor);
288
302
  const nextAnimation = useBuildTransitionState(nextDescriptor);
@@ -312,42 +326,50 @@ export function useScreenAnimationPipeline(): ScreenAnimationPipeline {
312
326
  });
313
327
 
314
328
  const propsRevisionState = useSharedValue({ value: 0 });
315
- const screenInterpolatorPropsRevision = useDerivedValue<number>(() => {
316
- "worklet";
317
- screenInterpolatorProps.modify((frame) => {
318
- "worklet";
319
- const interpolatorOptions = selectedInterpolatorOptions.get();
320
- return hydrateInterpolatorFrame({
321
- frame,
322
- dimensions,
323
- insets,
324
- currentAnimation,
325
- nextAnimation,
326
- prevAnimation,
327
- nextHasTransitions,
328
- interpolatorOptions,
329
- });
330
- }, false);
331
-
332
- // Critical reactive dependency for `screenInterpolatorProps`.
333
- //
334
- // `screenInterpolatorProps` is mutated in place to avoid allocating a large
335
- // interpolator frame every tick. Consumers must read this revision before
336
- // reading `screenInterpolatorProps`, otherwise Reanimated may not subscribe
337
- // to frame updates and can observe stale transition state.
338
- propsRevisionState.modify((revision) => {
339
- "worklet";
340
- revision.value += 1;
341
- return revision;
342
- }, false);
343
-
344
- return propsRevisionState.get().value;
345
- });
329
+ const screenInterpolatorPropsRevision = useDerivedValue<number>(
330
+ interpolatorUpdatesEnabled
331
+ ? () => {
332
+ "worklet";
333
+ screenInterpolatorProps.modify((frame) => {
334
+ "worklet";
335
+ const interpolatorOptions = selectedInterpolatorOptions.get();
336
+ return hydrateInterpolatorFrame({
337
+ frame,
338
+ dimensions,
339
+ insets,
340
+ currentAnimation,
341
+ nextAnimation,
342
+ prevAnimation,
343
+ nextHasTransitions,
344
+ interpolatorOptions,
345
+ });
346
+ }, false);
347
+
348
+ // Critical reactive dependency for `screenInterpolatorProps`.
349
+ //
350
+ // `screenInterpolatorProps` is mutated in place to avoid allocating a large
351
+ // interpolator frame every tick. Consumers must read this revision before
352
+ // reading `screenInterpolatorProps`, otherwise Reanimated may not subscribe
353
+ // to frame updates and can observe stale transition state.
354
+ propsRevisionState.modify((revision) => {
355
+ "worklet";
356
+ revision.value += 1;
357
+ return revision;
358
+ }, false);
359
+
360
+ return propsRevisionState.get().value;
361
+ }
362
+ : () => {
363
+ "worklet";
364
+ return propsRevisionState.get().value;
365
+ },
366
+ );
346
367
 
347
368
  const nextInterpolator = nextDescriptor?.options.screenStyleInterpolator;
348
369
  const currentInterpolator = currDescriptor?.options.screenStyleInterpolator;
349
370
 
350
371
  return {
372
+ interpolatorUpdatesEnabled,
351
373
  screenInterpolatorProps,
352
374
  screenInterpolatorPropsRevision,
353
375
  selectedInterpolatorOptions,
@@ -1,12 +1,18 @@
1
1
  import type { ReactNode } from "react";
2
- import { useMemo } from "react";
2
+ import { useLayoutEffect, useMemo } from "react";
3
+ import { runOnUI } from "react-native-reanimated";
3
4
  import { useScreenTransitionsAdapterOptionalContext } from "../../../adapters/with-screen-transitions/context";
4
5
  import { useBlankStackStore } from "../../../providers/stack/blank-stack.provider";
6
+ import {
7
+ registerScreen,
8
+ unregisterScreen,
9
+ } from "../../../stores/bounds/internals/coordinator";
10
+ import { SystemStore } from "../../../stores/system.store";
5
11
  import type { BaseStackDescriptor } from "../../../types/stack.types";
6
12
  import createProvider from "../../../utils/create-provider";
7
13
  import type { DescriptorDerivations } from "./helpers/derive-descriptor-derivations";
8
14
  import { deriveDescriptorDerivations } from "./helpers/derive-descriptor-derivations";
9
- import { getAncestorKeys } from "./helpers/get-ancestor-keys";
15
+ import { deriveStructuralAncestorKeys } from "./helpers/derive-structural-ancestor-keys";
10
16
 
11
17
  /**
12
18
  * Base descriptor interface - minimal contract for all stack types.
@@ -45,7 +51,19 @@ export const { DescriptorsProvider, useDescriptorsStore } = createProvider(
45
51
  "Descriptors",
46
52
  { guarded: true },
47
53
  )<DescriptorsProviderProps, DescriptorStoreValue<BaseDescriptor>>(
48
- ({ previous, current, next, routeKey, children }) => {
54
+ ({ previous, current, next, routeKey, children }, { useParentStore }) => {
55
+ const parentScreenKey = useParentStore(
56
+ (store) => store?.derivations.currentScreenKey,
57
+ );
58
+ const parentAncestorKeys = useParentStore(
59
+ (store) => store?.derivations.ancestorKeys,
60
+ );
61
+ const parentTransitionSourcePairKey = useParentStore(
62
+ (store) => store?.derivations.transitionSourcePairKey,
63
+ );
64
+ const parentTransitionDestinationScreenKey = useParentStore(
65
+ (store) => store?.derivations.transitionDestinationScreenKey,
66
+ );
49
67
  const blankStackCurrent = useBlankStackStore((store) =>
50
68
  routeKey ? store?.scenesByKey[routeKey]?.descriptor : undefined,
51
69
  );
@@ -85,20 +103,68 @@ export const { DescriptorsProvider, useDescriptorsStore } = createProvider(
85
103
  );
86
104
 
87
105
  const ancestorKeys = useMemo(
88
- () => getAncestorKeys(resolvedCurrent),
89
- [resolvedCurrent],
106
+ () =>
107
+ deriveStructuralAncestorKeys(
108
+ parentScreenKey
109
+ ? {
110
+ currentScreenKey: parentScreenKey,
111
+ ancestorKeys: parentAncestorKeys ?? [],
112
+ }
113
+ : null,
114
+ ),
115
+ [parentAncestorKeys, parentScreenKey],
90
116
  );
91
117
 
92
- const derivations = useMemo(
93
- () =>
94
- deriveDescriptorDerivations({
95
- previous: resolvedPrevious,
96
- current: resolvedCurrent,
97
- next: resolvedNext,
98
- ancestorKeys,
99
- }),
100
- [resolvedPrevious, resolvedCurrent, resolvedNext, ancestorKeys],
118
+ const derivations = useMemo(() => {
119
+ const localDerivations = deriveDescriptorDerivations({
120
+ previous: resolvedPrevious,
121
+ current: resolvedCurrent,
122
+ next: resolvedNext,
123
+ ancestorKeys,
124
+ });
125
+
126
+ return {
127
+ ...localDerivations,
128
+ transitionSourcePairKey:
129
+ localDerivations.sourcePairKey ?? parentTransitionSourcePairKey,
130
+ transitionDestinationScreenKey:
131
+ localDerivations.nextScreenKey ??
132
+ parentTransitionDestinationScreenKey,
133
+ };
134
+ }, [
135
+ resolvedPrevious,
136
+ resolvedCurrent,
137
+ resolvedNext,
138
+ ancestorKeys,
139
+ parentTransitionSourcePairKey,
140
+ parentTransitionDestinationScreenKey,
141
+ ]);
142
+ const animationProgress = SystemStore.getValue(
143
+ derivations.currentScreenKey,
144
+ "animationProgress",
101
145
  );
146
+ const pendingLifecycleStartBlockCount = SystemStore.getValue(
147
+ derivations.currentScreenKey,
148
+ "pendingLifecycleStartBlockCount",
149
+ );
150
+
151
+ useLayoutEffect(() => {
152
+ runOnUI(registerScreen)({
153
+ screenKey: derivations.currentScreenKey,
154
+ parentScreenKey: derivations.parentScreenKey,
155
+ animationProgress,
156
+ pendingLifecycleStartBlockCount,
157
+ });
158
+
159
+ return () => {
160
+ runOnUI(unregisterScreen)(derivations.currentScreenKey);
161
+ };
162
+ }, [
163
+ animationProgress,
164
+ derivations.currentScreenKey,
165
+ derivations.parentScreenKey,
166
+ pendingLifecycleStartBlockCount,
167
+ ]);
102
168
 
103
169
  return {
104
170
  value: {
@@ -7,6 +7,10 @@ export interface DescriptorDerivations {
7
7
  currentScreenKey: string;
8
8
  nextScreenKey?: string;
9
9
  sourcePairKey?: ScreenPairKey;
10
+ /** Nearest source pair owned by this screen or one of its ancestors. */
11
+ transitionSourcePairKey?: ScreenPairKey;
12
+ /** Destination root for the nearest source pair. */
13
+ transitionDestinationScreenKey?: string;
10
14
  destinationPairKey?: ScreenPairKey;
11
15
  parentScreenKey?: string;
12
16
  isFirstKey: boolean;
@@ -52,6 +56,8 @@ export function deriveDescriptorDerivations({
52
56
  currentScreenKey,
53
57
  nextScreenKey,
54
58
  sourcePairKey,
59
+ transitionSourcePairKey: sourcePairKey,
60
+ transitionDestinationScreenKey: nextScreenKey,
55
61
  destinationPairKey,
56
62
  parentScreenKey: ancestorKeys[0],
57
63
  isFirstKey,
@@ -0,0 +1,13 @@
1
+ import type { DescriptorDerivationsContextValue } from "../descriptors.provider";
2
+
3
+ type ParentDescriptorState = Pick<
4
+ DescriptorDerivationsContextValue,
5
+ "currentScreenKey" | "ancestorKeys"
6
+ >;
7
+
8
+ export const deriveStructuralAncestorKeys = (
9
+ parent: ParentDescriptorState | null,
10
+ ): string[] => {
11
+ if (!parent) return [];
12
+ return [parent.currentScreenKey, ...parent.ancestorKeys];
13
+ };
@@ -109,6 +109,7 @@ export const finalizePanRelease = (
109
109
  : {
110
110
  target: animations.transitionProgress.get(),
111
111
  shouldDismiss: false,
112
+ isCancelled: true,
112
113
  initialVelocity: 0,
113
114
  transitionSpec: undefined,
114
115
  resetSpec: policy.transitionSpec?.open,
@@ -1,4 +1,5 @@
1
1
  import { clamp } from "react-native-reanimated";
2
+ import { EPSILON } from "../../../../../constants";
2
3
  import {
3
4
  getPanSnapAxisConfigForDirection,
4
5
  isResolvedPanGestureDirection,
@@ -111,6 +112,7 @@ const buildInactivePanSnapRelease = (
111
112
  return {
112
113
  target: stores.animations.transitionProgress.get(),
113
114
  shouldDismiss: false,
115
+ isCancelled: true,
114
116
  initialVelocity: 0,
115
117
  transitionSpec: policy.transitionSpec,
116
118
  resetSpec: policy.transitionSpec?.open,
@@ -146,6 +148,7 @@ export const resolvePanRelease = (
146
148
  return {
147
149
  target: shouldDismiss ? 0 : 1,
148
150
  shouldDismiss,
151
+ isCancelled: !shouldDismiss,
149
152
  initialVelocity: getPanReleaseProgressVelocity({
150
153
  animations,
151
154
  shouldDismiss,
@@ -205,9 +208,16 @@ export const resolveSnapPanRelease = (
205
208
  const shouldDismiss = participation.canDismiss && result.shouldDismiss;
206
209
  const target = shouldDismiss ? 0 : result.targetProgress;
207
210
 
211
+ // Compare against the gesture's starting snap so only true snap-backs lose velocity.
212
+ const initialTarget = policy.gestureSnapLocked
213
+ ? (runtime.stores.gestures.internal.lockedSnapPoint.get() ??
214
+ runtime.stores.system.targetProgress.get())
215
+ : runtime.stores.system.targetProgress.get();
216
+
208
217
  return {
209
218
  target,
210
219
  shouldDismiss,
220
+ isCancelled: !shouldDismiss && Math.abs(target - initialTarget) <= EPSILON,
211
221
  initialVelocity: getProgressVelocityTowardTarget({
212
222
  handoffVelocity: getPanReleaseHandoffVelocity(
213
223
  axisVelocity,
@@ -238,7 +248,7 @@ export const buildPanReleasePlan = (
238
248
  "worklet";
239
249
  const { policy } = runtime;
240
250
  const releaseVelocityScale = Math.max(0, policy.gestureReleaseVelocityScale);
241
- const resetVelocityScale = releaseVelocityScale;
251
+ const resetVelocityScale = release.isCancelled ? 0 : releaseVelocityScale;
242
252
  const resetVelocityX =
243
253
  resetVelocityScale === 0 ? 0 : rawEvent.velocityX * resetVelocityScale;
244
254
  const resetVelocityY =
@@ -264,7 +274,7 @@ export const buildPanReleasePlan = (
264
274
  return {
265
275
  target: release.target,
266
276
  shouldDismiss: release.shouldDismiss,
267
- progressVelocity: release.initialVelocity,
277
+ progressVelocity: release.isCancelled ? 0 : release.initialVelocity,
268
278
  resetVelocityX,
269
279
  resetVelocityY,
270
280
  resetVelocityNormX: resetVelocityX / Math.max(1, dimensions.width),
@@ -97,6 +97,7 @@ export const usePanBehavior = (
97
97
  ? {
98
98
  target: latestRuntime.stores.animations.transitionProgress.get(),
99
99
  shouldDismiss: false,
100
+ isCancelled: true,
100
101
  initialVelocity: 0,
101
102
  transitionSpec: undefined,
102
103
  resetSpec: latestRuntime.policy.transitionSpec?.open,
@@ -172,6 +172,7 @@ export interface PinchTrackState {
172
172
  export interface PanReleaseResult {
173
173
  target: number;
174
174
  shouldDismiss: boolean;
175
+ isCancelled: boolean;
175
176
  initialVelocity: number;
176
177
  commitProgress?: number;
177
178
  transitionSpec: TransitionSpec | undefined;
@@ -62,6 +62,7 @@ export const STYLE_RESET_VALUES: Record<string, unknown> = {
62
62
  export const PROP_RESET_VALUES: Record<string, unknown> = {
63
63
  hostName: PORTAL_HOST_NAME_RESET_VALUE,
64
64
  pointerEvents: "auto",
65
+ teleport: false,
65
66
  };
66
67
 
67
68
  const RESERVED_STYLE_SLOT_IDS = {
@@ -0,0 +1,16 @@
1
+ type VisibilityBlockOwnershipParams = {
2
+ localBlocked: boolean;
3
+ ancestorBlocked: boolean;
4
+ };
5
+
6
+ export const resolveVisibilityBlockOwnership = ({
7
+ localBlocked,
8
+ ancestorBlocked,
9
+ }: VisibilityBlockOwnershipParams) => {
10
+ "worklet";
11
+
12
+ return {
13
+ appliesOffset: localBlocked && !ancestorBlocked,
14
+ effectiveBlocked: localBlocked || ancestorBlocked,
15
+ };
16
+ };