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

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 (344) hide show
  1. package/lib/commonjs/shared/components/boundary/components/boundary-target.js +10 -10
  2. package/lib/commonjs/shared/components/boundary/components/boundary-target.js.map +1 -1
  3. package/lib/commonjs/shared/components/boundary/create-boundary-component.js +45 -101
  4. package/lib/commonjs/shared/components/boundary/create-boundary-component.js.map +1 -1
  5. package/lib/commonjs/shared/components/boundary/hooks/use-boundary-measurement.js +103 -0
  6. package/lib/commonjs/shared/components/boundary/hooks/use-boundary-measurement.js.map +1 -0
  7. package/lib/commonjs/shared/components/boundary/hooks/use-boundary-presence.js +7 -4
  8. package/lib/commonjs/shared/components/boundary/hooks/use-boundary-presence.js.map +1 -1
  9. package/lib/commonjs/shared/components/boundary/hooks/use-initial-destination-measurement.js +24 -14
  10. package/lib/commonjs/shared/components/boundary/hooks/use-initial-destination-measurement.js.map +1 -1
  11. package/lib/commonjs/shared/components/boundary/hooks/use-initial-source-measurement.js +3 -4
  12. package/lib/commonjs/shared/components/boundary/hooks/use-initial-source-measurement.js.map +1 -1
  13. package/lib/commonjs/shared/components/boundary/hooks/use-measurer.js +6 -8
  14. package/lib/commonjs/shared/components/boundary/hooks/use-measurer.js.map +1 -1
  15. package/lib/commonjs/shared/components/boundary/hooks/use-refresh-boundary.js +6 -3
  16. package/lib/commonjs/shared/components/boundary/hooks/use-refresh-boundary.js.map +1 -1
  17. package/lib/commonjs/shared/components/boundary/index.js +2 -2
  18. package/lib/commonjs/shared/components/boundary/portal/components/portal-boundary-host.js +8 -2
  19. package/lib/commonjs/shared/components/boundary/portal/components/portal-boundary-host.js.map +1 -1
  20. package/lib/commonjs/shared/components/boundary/portal/components/portal-provider.js +5 -2
  21. package/lib/commonjs/shared/components/boundary/portal/components/portal-provider.js.map +1 -1
  22. package/lib/commonjs/shared/components/boundary/portal/components/portal.js +10 -7
  23. package/lib/commonjs/shared/components/boundary/portal/components/portal.js.map +1 -1
  24. package/lib/commonjs/shared/components/boundary/portal/resolve-portal.js +36 -0
  25. package/lib/commonjs/shared/components/boundary/portal/resolve-portal.js.map +1 -0
  26. package/lib/commonjs/shared/components/boundary/portal/teleport.js +23 -0
  27. package/lib/commonjs/shared/components/boundary/portal/teleport.js.map +1 -0
  28. package/lib/commonjs/shared/components/boundary/providers/{boundary-owner.provider.js → boundary-root.provider.js} +21 -23
  29. package/lib/commonjs/shared/components/boundary/providers/boundary-root.provider.js.map +1 -0
  30. package/lib/commonjs/shared/components/boundary/utils/destination-signals.js +33 -2
  31. package/lib/commonjs/shared/components/boundary/utils/destination-signals.js.map +1 -1
  32. package/lib/commonjs/shared/components/create-transition-aware-component.js +2 -20
  33. package/lib/commonjs/shared/components/create-transition-aware-component.js.map +1 -1
  34. package/lib/commonjs/shared/components/overlay/variations/float-overlay.js +1 -1
  35. package/lib/commonjs/shared/components/overlay/variations/float-overlay.js.map +1 -1
  36. package/lib/commonjs/shared/components/screen-container/layers/backdrop.js +2 -14
  37. package/lib/commonjs/shared/components/screen-container/layers/backdrop.js.map +1 -1
  38. package/lib/commonjs/shared/components/screen-container/layers/content.js +4 -16
  39. package/lib/commonjs/shared/components/screen-container/layers/content.js.map +1 -1
  40. package/lib/commonjs/shared/components/screen-container/layers/maybe-masked-navigation-container.js +4 -15
  41. package/lib/commonjs/shared/components/screen-container/layers/maybe-masked-navigation-container.js.map +1 -1
  42. package/lib/commonjs/shared/components/screen-container/layers/surface-container.js +4 -16
  43. package/lib/commonjs/shared/components/screen-container/layers/surface-container.js.map +1 -1
  44. package/lib/commonjs/shared/hooks/navigation/use-stack.js +17 -2
  45. package/lib/commonjs/shared/hooks/navigation/use-stack.js.map +1 -1
  46. package/lib/commonjs/shared/providers/screen/animation/helpers/pipeline.js +142 -33
  47. package/lib/commonjs/shared/providers/screen/animation/helpers/pipeline.js.map +1 -1
  48. package/lib/commonjs/shared/providers/screen/animation/helpers/stack-progress.js +23 -12
  49. package/lib/commonjs/shared/providers/screen/animation/helpers/stack-progress.js.map +1 -1
  50. package/lib/commonjs/shared/providers/screen/animation/helpers/use-build-transition-state.js +1 -0
  51. package/lib/commonjs/shared/providers/screen/animation/helpers/use-build-transition-state.js.map +1 -1
  52. package/lib/commonjs/shared/providers/screen/screen-composer.js +1 -1
  53. package/lib/commonjs/shared/providers/screen/screen-composer.js.map +1 -1
  54. package/lib/commonjs/shared/providers/screen/styles/helpers/opening-phase.js +32 -0
  55. package/lib/commonjs/shared/providers/screen/styles/helpers/opening-phase.js.map +1 -0
  56. package/lib/commonjs/shared/providers/screen/styles/helpers/resolve-slot-styles/index.js +7 -8
  57. package/lib/commonjs/shared/providers/screen/styles/helpers/resolve-slot-styles/index.js.map +1 -1
  58. package/lib/commonjs/shared/providers/screen/styles/helpers/resolve-slot-styles/materialize-slot.js.map +1 -1
  59. package/lib/commonjs/shared/providers/screen/styles/helpers/resolve-slot-styles/slot-state.js +1 -20
  60. package/lib/commonjs/shared/providers/screen/styles/helpers/resolve-slot-styles/slot-state.js.map +1 -1
  61. package/lib/commonjs/shared/providers/screen/styles/helpers/visibility-gate.js +1 -11
  62. package/lib/commonjs/shared/providers/screen/styles/helpers/visibility-gate.js.map +1 -1
  63. package/lib/commonjs/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js +23 -36
  64. package/lib/commonjs/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js.map +1 -1
  65. package/lib/commonjs/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js +1 -19
  66. package/lib/commonjs/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js.map +1 -1
  67. package/lib/commonjs/shared/providers/screen/styles/hooks/use-resolved-slot-style-map.js +8 -3
  68. package/lib/commonjs/shared/providers/screen/styles/hooks/use-resolved-slot-style-map.js.map +1 -1
  69. package/lib/commonjs/shared/providers/screen/styles/index.js +25 -7
  70. package/lib/commonjs/shared/providers/screen/styles/index.js.map +1 -1
  71. package/lib/commonjs/shared/providers/screen/styles/slot.provider.js +103 -0
  72. package/lib/commonjs/shared/providers/screen/styles/slot.provider.js.map +1 -0
  73. package/lib/commonjs/shared/stores/animation.store.js +2 -0
  74. package/lib/commonjs/shared/stores/animation.store.js.map +1 -1
  75. package/lib/commonjs/shared/stores/bounds/helpers/link-pairs.helpers.js +16 -1
  76. package/lib/commonjs/shared/stores/bounds/helpers/link-pairs.helpers.js.map +1 -1
  77. package/lib/commonjs/shared/utils/bounds/navigation/zoom/build.js +8 -1
  78. package/lib/commonjs/shared/utils/bounds/navigation/zoom/build.js.map +1 -1
  79. package/lib/commonjs/shared/utils/bounds/navigation/zoom/helpers.js +59 -0
  80. package/lib/commonjs/shared/utils/bounds/navigation/zoom/helpers.js.map +1 -1
  81. package/lib/commonjs/shared/utils/logger.js +11 -0
  82. package/lib/commonjs/shared/utils/logger.js.map +1 -1
  83. package/lib/module/shared/components/boundary/components/boundary-target.js +10 -10
  84. package/lib/module/shared/components/boundary/components/boundary-target.js.map +1 -1
  85. package/lib/module/shared/components/boundary/create-boundary-component.js +47 -103
  86. package/lib/module/shared/components/boundary/create-boundary-component.js.map +1 -1
  87. package/lib/module/shared/components/boundary/hooks/use-boundary-measurement.js +98 -0
  88. package/lib/module/shared/components/boundary/hooks/use-boundary-measurement.js.map +1 -0
  89. package/lib/module/shared/components/boundary/hooks/use-boundary-presence.js +7 -4
  90. package/lib/module/shared/components/boundary/hooks/use-boundary-presence.js.map +1 -1
  91. package/lib/module/shared/components/boundary/hooks/use-initial-destination-measurement.js +24 -14
  92. package/lib/module/shared/components/boundary/hooks/use-initial-destination-measurement.js.map +1 -1
  93. package/lib/module/shared/components/boundary/hooks/use-initial-source-measurement.js +3 -4
  94. package/lib/module/shared/components/boundary/hooks/use-initial-source-measurement.js.map +1 -1
  95. package/lib/module/shared/components/boundary/hooks/use-measurer.js +6 -8
  96. package/lib/module/shared/components/boundary/hooks/use-measurer.js.map +1 -1
  97. package/lib/module/shared/components/boundary/hooks/use-refresh-boundary.js +6 -3
  98. package/lib/module/shared/components/boundary/hooks/use-refresh-boundary.js.map +1 -1
  99. package/lib/module/shared/components/boundary/index.js +2 -2
  100. package/lib/module/shared/components/boundary/portal/components/portal-boundary-host.js +8 -2
  101. package/lib/module/shared/components/boundary/portal/components/portal-boundary-host.js.map +1 -1
  102. package/lib/module/shared/components/boundary/portal/components/portal-provider.js +4 -1
  103. package/lib/module/shared/components/boundary/portal/components/portal-provider.js.map +1 -1
  104. package/lib/module/shared/components/boundary/portal/components/portal.js +11 -8
  105. package/lib/module/shared/components/boundary/portal/components/portal.js.map +1 -1
  106. package/lib/module/shared/components/boundary/portal/resolve-portal.js +31 -0
  107. package/lib/module/shared/components/boundary/portal/resolve-portal.js.map +1 -0
  108. package/lib/module/shared/components/boundary/portal/teleport.js +19 -0
  109. package/lib/module/shared/components/boundary/portal/teleport.js.map +1 -0
  110. package/lib/module/shared/components/boundary/providers/{boundary-owner.provider.js → boundary-root.provider.js} +18 -20
  111. package/lib/module/shared/components/boundary/providers/boundary-root.provider.js.map +1 -0
  112. package/lib/module/shared/components/boundary/utils/destination-signals.js +33 -2
  113. package/lib/module/shared/components/boundary/utils/destination-signals.js.map +1 -1
  114. package/lib/module/shared/components/create-transition-aware-component.js +4 -22
  115. package/lib/module/shared/components/create-transition-aware-component.js.map +1 -1
  116. package/lib/module/shared/components/overlay/variations/float-overlay.js +2 -2
  117. package/lib/module/shared/components/overlay/variations/float-overlay.js.map +1 -1
  118. package/lib/module/shared/components/screen-container/layers/backdrop.js +4 -16
  119. package/lib/module/shared/components/screen-container/layers/backdrop.js.map +1 -1
  120. package/lib/module/shared/components/screen-container/layers/content.js +4 -16
  121. package/lib/module/shared/components/screen-container/layers/content.js.map +1 -1
  122. package/lib/module/shared/components/screen-container/layers/maybe-masked-navigation-container.js +5 -16
  123. package/lib/module/shared/components/screen-container/layers/maybe-masked-navigation-container.js.map +1 -1
  124. package/lib/module/shared/components/screen-container/layers/surface-container.js +4 -16
  125. package/lib/module/shared/components/screen-container/layers/surface-container.js.map +1 -1
  126. package/lib/module/shared/hooks/navigation/use-stack.js +19 -4
  127. package/lib/module/shared/hooks/navigation/use-stack.js.map +1 -1
  128. package/lib/module/shared/providers/screen/animation/helpers/pipeline.js +144 -35
  129. package/lib/module/shared/providers/screen/animation/helpers/pipeline.js.map +1 -1
  130. package/lib/module/shared/providers/screen/animation/helpers/stack-progress.js +20 -10
  131. package/lib/module/shared/providers/screen/animation/helpers/stack-progress.js.map +1 -1
  132. package/lib/module/shared/providers/screen/animation/helpers/use-build-transition-state.js +1 -0
  133. package/lib/module/shared/providers/screen/animation/helpers/use-build-transition-state.js.map +1 -1
  134. package/lib/module/shared/providers/screen/screen-composer.js +2 -2
  135. package/lib/module/shared/providers/screen/screen-composer.js.map +1 -1
  136. package/lib/module/shared/providers/screen/styles/helpers/opening-phase.js +26 -0
  137. package/lib/module/shared/providers/screen/styles/helpers/opening-phase.js.map +1 -0
  138. package/lib/module/shared/providers/screen/styles/helpers/resolve-slot-styles/index.js +7 -8
  139. package/lib/module/shared/providers/screen/styles/helpers/resolve-slot-styles/index.js.map +1 -1
  140. package/lib/module/shared/providers/screen/styles/helpers/resolve-slot-styles/materialize-slot.js.map +1 -1
  141. package/lib/module/shared/providers/screen/styles/helpers/resolve-slot-styles/slot-state.js +0 -18
  142. package/lib/module/shared/providers/screen/styles/helpers/resolve-slot-styles/slot-state.js.map +1 -1
  143. package/lib/module/shared/providers/screen/styles/helpers/visibility-gate.js +0 -9
  144. package/lib/module/shared/providers/screen/styles/helpers/visibility-gate.js.map +1 -1
  145. package/lib/module/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js +22 -35
  146. package/lib/module/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js.map +1 -1
  147. package/lib/module/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js +1 -19
  148. package/lib/module/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js.map +1 -1
  149. package/lib/module/shared/providers/screen/styles/hooks/use-resolved-slot-style-map.js +9 -4
  150. package/lib/module/shared/providers/screen/styles/hooks/use-resolved-slot-style-map.js.map +1 -1
  151. package/lib/module/shared/providers/screen/styles/index.js +1 -1
  152. package/lib/module/shared/providers/screen/styles/index.js.map +1 -1
  153. package/lib/module/shared/providers/screen/styles/slot.provider.js +91 -0
  154. package/lib/module/shared/providers/screen/styles/slot.provider.js.map +1 -0
  155. package/lib/module/shared/stores/animation.store.js +2 -0
  156. package/lib/module/shared/stores/animation.store.js.map +1 -1
  157. package/lib/module/shared/stores/bounds/helpers/link-pairs.helpers.js +14 -0
  158. package/lib/module/shared/stores/bounds/helpers/link-pairs.helpers.js.map +1 -1
  159. package/lib/module/shared/utils/bounds/navigation/zoom/build.js +9 -2
  160. package/lib/module/shared/utils/bounds/navigation/zoom/build.js.map +1 -1
  161. package/lib/module/shared/utils/bounds/navigation/zoom/helpers.js +58 -0
  162. package/lib/module/shared/utils/bounds/navigation/zoom/helpers.js.map +1 -1
  163. package/lib/module/shared/utils/logger.js +11 -0
  164. package/lib/module/shared/utils/logger.js.map +1 -1
  165. package/lib/typescript/blank-stack/navigators/create-blank-stack-navigator.d.ts +2 -1
  166. package/lib/typescript/blank-stack/navigators/create-blank-stack-navigator.d.ts.map +1 -1
  167. package/lib/typescript/component-stack/components/component-screen.d.ts +1 -1
  168. package/lib/typescript/component-stack/components/component-screen.d.ts.map +1 -1
  169. package/lib/typescript/component-stack/navigators/create-component-stack-navigator.d.ts +2 -1
  170. package/lib/typescript/component-stack/navigators/create-component-stack-navigator.d.ts.map +1 -1
  171. package/lib/typescript/native-stack/navigators/createNativeStackNavigator.d.ts +1 -1
  172. package/lib/typescript/native-stack/navigators/createNativeStackNavigator.d.ts.map +1 -1
  173. package/lib/typescript/native-stack/views/NativeStackView.d.ts +2 -1
  174. package/lib/typescript/native-stack/views/NativeStackView.d.ts.map +1 -1
  175. package/lib/typescript/native-stack/views/useHeaderConfigProps.d.ts +2 -2
  176. package/lib/typescript/shared/adapters/with-screen-transitions/context.d.ts +1 -1
  177. package/lib/typescript/shared/adapters/with-screen-transitions/context.d.ts.map +1 -1
  178. package/lib/typescript/shared/adapters/with-screen-transitions/stack-layout.d.ts +1 -1
  179. package/lib/typescript/shared/adapters/with-screen-transitions/stack-layout.d.ts.map +1 -1
  180. package/lib/typescript/shared/components/activity/variants/activity-container.d.ts +1 -1
  181. package/lib/typescript/shared/components/activity/variants/activity-container.d.ts.map +1 -1
  182. package/lib/typescript/shared/components/activity/variants/activity-screen.d.ts +1 -1
  183. package/lib/typescript/shared/components/activity/variants/activity-screen.d.ts.map +1 -1
  184. package/lib/typescript/shared/components/boundary/components/boundary-target.d.ts +1 -1
  185. package/lib/typescript/shared/components/boundary/components/boundary-target.d.ts.map +1 -1
  186. package/lib/typescript/shared/components/boundary/create-boundary-component.d.ts.map +1 -1
  187. package/lib/typescript/shared/components/boundary/hooks/use-boundary-measurement.d.ts +32 -0
  188. package/lib/typescript/shared/components/boundary/hooks/use-boundary-measurement.d.ts.map +1 -0
  189. package/lib/typescript/shared/components/boundary/hooks/use-boundary-presence.d.ts +2 -1
  190. package/lib/typescript/shared/components/boundary/hooks/use-boundary-presence.d.ts.map +1 -1
  191. package/lib/typescript/shared/components/boundary/hooks/use-initial-destination-measurement.d.ts +3 -2
  192. package/lib/typescript/shared/components/boundary/hooks/use-initial-destination-measurement.d.ts.map +1 -1
  193. package/lib/typescript/shared/components/boundary/hooks/use-initial-source-measurement.d.ts +2 -2
  194. package/lib/typescript/shared/components/boundary/hooks/use-initial-source-measurement.d.ts.map +1 -1
  195. package/lib/typescript/shared/components/boundary/hooks/use-measurer.d.ts +3 -5
  196. package/lib/typescript/shared/components/boundary/hooks/use-measurer.d.ts.map +1 -1
  197. package/lib/typescript/shared/components/boundary/hooks/use-refresh-boundary.d.ts +3 -3
  198. package/lib/typescript/shared/components/boundary/hooks/use-refresh-boundary.d.ts.map +1 -1
  199. package/lib/typescript/shared/components/boundary/index.d.ts +7 -211
  200. package/lib/typescript/shared/components/boundary/index.d.ts.map +1 -1
  201. package/lib/typescript/shared/components/boundary/portal/components/host.d.ts +2 -2
  202. package/lib/typescript/shared/components/boundary/portal/components/host.d.ts.map +1 -1
  203. package/lib/typescript/shared/components/boundary/portal/components/portal-boundary-host.d.ts +1 -1
  204. package/lib/typescript/shared/components/boundary/portal/components/portal-boundary-host.d.ts.map +1 -1
  205. package/lib/typescript/shared/components/boundary/portal/components/portal-provider.d.ts +1 -1
  206. package/lib/typescript/shared/components/boundary/portal/components/portal-provider.d.ts.map +1 -1
  207. package/lib/typescript/shared/components/boundary/portal/components/portal.d.ts +1 -1
  208. package/lib/typescript/shared/components/boundary/portal/components/portal.d.ts.map +1 -1
  209. package/lib/typescript/shared/components/boundary/portal/resolve-portal.d.ts +14 -0
  210. package/lib/typescript/shared/components/boundary/portal/resolve-portal.d.ts.map +1 -0
  211. package/lib/typescript/shared/components/boundary/portal/teleport.d.ts +6 -0
  212. package/lib/typescript/shared/components/boundary/portal/teleport.d.ts.map +1 -0
  213. package/lib/typescript/shared/components/boundary/providers/{boundary-owner.provider.d.ts → boundary-root.provider.d.ts} +12 -14
  214. package/lib/typescript/shared/components/boundary/providers/boundary-root.provider.d.ts.map +1 -0
  215. package/lib/typescript/shared/components/boundary/utils/destination-signals.d.ts +1 -0
  216. package/lib/typescript/shared/components/boundary/utils/destination-signals.d.ts.map +1 -1
  217. package/lib/typescript/shared/components/create-transition-aware-component.d.ts +5 -6
  218. package/lib/typescript/shared/components/create-transition-aware-component.d.ts.map +1 -1
  219. package/lib/typescript/shared/components/masked-view.d.ts +1 -1
  220. package/lib/typescript/shared/components/masked-view.d.ts.map +1 -1
  221. package/lib/typescript/shared/components/overlay/variations/float-overlay.d.ts +1 -1
  222. package/lib/typescript/shared/components/overlay/variations/float-overlay.d.ts.map +1 -1
  223. package/lib/typescript/shared/components/overlay/variations/overlay-host.d.ts +1 -1
  224. package/lib/typescript/shared/components/overlay/variations/overlay-host.d.ts.map +1 -1
  225. package/lib/typescript/shared/components/scene-view.d.ts +1 -1
  226. package/lib/typescript/shared/components/scene-view.d.ts.map +1 -1
  227. package/lib/typescript/shared/components/screen-container/index.d.ts +1 -1
  228. package/lib/typescript/shared/components/screen-container/index.d.ts.map +1 -1
  229. package/lib/typescript/shared/components/screen-container/layers/backdrop.d.ts +1 -1
  230. package/lib/typescript/shared/components/screen-container/layers/backdrop.d.ts.map +1 -1
  231. package/lib/typescript/shared/components/screen-container/layers/content.d.ts +1 -1
  232. package/lib/typescript/shared/components/screen-container/layers/content.d.ts.map +1 -1
  233. package/lib/typescript/shared/components/screen-container/layers/maybe-masked-navigation-container.d.ts +1 -1
  234. package/lib/typescript/shared/components/screen-container/layers/maybe-masked-navigation-container.d.ts.map +1 -1
  235. package/lib/typescript/shared/components/screen-container/layers/surface-container.d.ts +1 -1
  236. package/lib/typescript/shared/components/screen-container/layers/surface-container.d.ts.map +1 -1
  237. package/lib/typescript/shared/hooks/navigation/use-stack.d.ts +1 -1
  238. package/lib/typescript/shared/hooks/navigation/use-stack.d.ts.map +1 -1
  239. package/lib/typescript/shared/index.d.ts +663 -919
  240. package/lib/typescript/shared/index.d.ts.map +1 -1
  241. package/lib/typescript/shared/providers/screen/animation/helpers/hydrate-transition-state/types.d.ts +1 -0
  242. package/lib/typescript/shared/providers/screen/animation/helpers/hydrate-transition-state/types.d.ts.map +1 -1
  243. package/lib/typescript/shared/providers/screen/animation/helpers/pipeline.d.ts.map +1 -1
  244. package/lib/typescript/shared/providers/screen/animation/helpers/stack-progress.d.ts +2 -1
  245. package/lib/typescript/shared/providers/screen/animation/helpers/stack-progress.d.ts.map +1 -1
  246. package/lib/typescript/shared/providers/screen/animation/helpers/use-build-transition-state.d.ts +1 -0
  247. package/lib/typescript/shared/providers/screen/animation/helpers/use-build-transition-state.d.ts.map +1 -1
  248. package/lib/typescript/shared/providers/screen/descriptors/descriptors.provider.d.ts +1 -1
  249. package/lib/typescript/shared/providers/screen/descriptors/descriptors.provider.d.ts.map +1 -1
  250. package/lib/typescript/shared/providers/screen/screen-composer.d.ts +1 -1
  251. package/lib/typescript/shared/providers/screen/screen-composer.d.ts.map +1 -1
  252. package/lib/typescript/shared/providers/screen/styles/components/floating-overlay-layer.d.ts +1 -1
  253. package/lib/typescript/shared/providers/screen/styles/components/floating-overlay-layer.d.ts.map +1 -1
  254. package/lib/typescript/shared/providers/screen/styles/helpers/opening-phase.d.ts +16 -0
  255. package/lib/typescript/shared/providers/screen/styles/helpers/opening-phase.d.ts.map +1 -0
  256. package/lib/typescript/shared/providers/screen/styles/helpers/resolve-slot-styles/index.d.ts +3 -4
  257. package/lib/typescript/shared/providers/screen/styles/helpers/resolve-slot-styles/index.d.ts.map +1 -1
  258. package/lib/typescript/shared/providers/screen/styles/helpers/resolve-slot-styles/materialize-slot.d.ts.map +1 -1
  259. package/lib/typescript/shared/providers/screen/styles/helpers/resolve-slot-styles/slot-state.d.ts +0 -1
  260. package/lib/typescript/shared/providers/screen/styles/helpers/resolve-slot-styles/slot-state.d.ts.map +1 -1
  261. package/lib/typescript/shared/providers/screen/styles/helpers/visibility-gate.d.ts +0 -1
  262. package/lib/typescript/shared/providers/screen/styles/helpers/visibility-gate.d.ts.map +1 -1
  263. package/lib/typescript/shared/providers/screen/styles/hooks/use-interpolated-style-maps.d.ts +0 -5
  264. package/lib/typescript/shared/providers/screen/styles/hooks/use-interpolated-style-maps.d.ts.map +1 -1
  265. package/lib/typescript/shared/providers/screen/styles/hooks/use-maybe-block-visibility.d.ts +2 -3
  266. package/lib/typescript/shared/providers/screen/styles/hooks/use-maybe-block-visibility.d.ts.map +1 -1
  267. package/lib/typescript/shared/providers/screen/styles/hooks/use-resolved-slot-style-map.d.ts.map +1 -1
  268. package/lib/typescript/shared/providers/screen/styles/index.d.ts +1 -1
  269. package/lib/typescript/shared/providers/screen/styles/index.d.ts.map +1 -1
  270. package/lib/typescript/shared/providers/screen/styles/slot.provider.d.ts +23 -0
  271. package/lib/typescript/shared/providers/screen/styles/slot.provider.d.ts.map +1 -0
  272. package/lib/typescript/shared/stores/animation.store.d.ts +1 -0
  273. package/lib/typescript/shared/stores/animation.store.d.ts.map +1 -1
  274. package/lib/typescript/shared/stores/bounds/helpers/link-pairs.helpers.d.ts +6 -1
  275. package/lib/typescript/shared/stores/bounds/helpers/link-pairs.helpers.d.ts.map +1 -1
  276. package/lib/typescript/shared/stores/bounds/types.d.ts +13 -0
  277. package/lib/typescript/shared/stores/bounds/types.d.ts.map +1 -1
  278. package/lib/typescript/shared/utils/bounds/navigation/zoom/build.d.ts.map +1 -1
  279. package/lib/typescript/shared/utils/bounds/navigation/zoom/helpers.d.ts +9 -0
  280. package/lib/typescript/shared/utils/bounds/navigation/zoom/helpers.d.ts.map +1 -1
  281. package/lib/typescript/shared/utils/logger.d.ts +6 -0
  282. package/lib/typescript/shared/utils/logger.d.ts.map +1 -1
  283. package/package.json +6 -1
  284. package/src/shared/components/boundary/components/boundary-target.tsx +12 -12
  285. package/src/shared/components/boundary/create-boundary-component.tsx +59 -142
  286. package/src/shared/components/boundary/hooks/use-boundary-measurement.ts +127 -0
  287. package/src/shared/components/boundary/hooks/use-boundary-presence.ts +7 -5
  288. package/src/shared/components/boundary/hooks/use-initial-destination-measurement.ts +27 -11
  289. package/src/shared/components/boundary/hooks/use-initial-source-measurement.ts +5 -5
  290. package/src/shared/components/boundary/hooks/use-measurer.ts +11 -14
  291. package/src/shared/components/boundary/hooks/use-refresh-boundary.ts +5 -5
  292. package/src/shared/components/boundary/index.tsx +2 -2
  293. package/src/shared/components/boundary/portal/components/portal-boundary-host.tsx +10 -3
  294. package/src/shared/components/boundary/portal/components/portal-provider.tsx +5 -1
  295. package/src/shared/components/boundary/portal/components/portal.tsx +15 -10
  296. package/src/shared/components/boundary/portal/resolve-portal.ts +40 -0
  297. package/src/shared/components/boundary/portal/teleport.ts +21 -0
  298. package/src/shared/components/boundary/providers/{boundary-owner.provider.tsx → boundary-root.provider.tsx} +27 -32
  299. package/src/shared/components/boundary/utils/destination-signals.ts +53 -2
  300. package/src/shared/components/create-transition-aware-component.tsx +3 -25
  301. package/src/shared/components/overlay/variations/float-overlay.tsx +3 -3
  302. package/src/shared/components/screen-container/layers/backdrop.tsx +4 -17
  303. package/src/shared/components/screen-container/layers/content.tsx +4 -16
  304. package/src/shared/components/screen-container/layers/maybe-masked-navigation-container.tsx +8 -18
  305. package/src/shared/components/screen-container/layers/surface-container.tsx +4 -17
  306. package/src/shared/hooks/navigation/use-stack.tsx +32 -1
  307. package/src/shared/providers/screen/animation/helpers/hydrate-transition-state/types.ts +1 -0
  308. package/src/shared/providers/screen/animation/helpers/pipeline.ts +253 -77
  309. package/src/shared/providers/screen/animation/helpers/stack-progress.ts +31 -16
  310. package/src/shared/providers/screen/animation/helpers/use-build-transition-state.ts +2 -0
  311. package/src/shared/providers/screen/screen-composer.tsx +3 -3
  312. package/src/shared/providers/screen/styles/helpers/opening-phase.ts +25 -0
  313. package/src/shared/providers/screen/styles/helpers/resolve-slot-styles/index.ts +8 -10
  314. package/src/shared/providers/screen/styles/helpers/resolve-slot-styles/materialize-slot.ts +0 -1
  315. package/src/shared/providers/screen/styles/helpers/resolve-slot-styles/slot-state.ts +0 -24
  316. package/src/shared/providers/screen/styles/helpers/visibility-gate.ts +0 -12
  317. package/src/shared/providers/screen/styles/hooks/use-interpolated-style-maps.tsx +29 -37
  318. package/src/shared/providers/screen/styles/hooks/use-maybe-block-visibility.tsx +0 -18
  319. package/src/shared/providers/screen/styles/hooks/use-resolved-slot-style-map.tsx +17 -4
  320. package/src/shared/providers/screen/styles/index.tsx +8 -4
  321. package/src/shared/providers/screen/styles/slot.provider.tsx +111 -0
  322. package/src/shared/stores/animation.store.ts +3 -0
  323. package/src/shared/stores/bounds/helpers/link-pairs.helpers.ts +17 -0
  324. package/src/shared/stores/bounds/types.ts +14 -0
  325. package/src/shared/utils/bounds/navigation/zoom/build.ts +9 -1
  326. package/src/shared/utils/bounds/navigation/zoom/helpers.ts +96 -0
  327. package/src/shared/utils/logger.ts +12 -0
  328. package/lib/commonjs/shared/components/boundary/providers/boundary-owner.provider.js.map +0 -1
  329. package/lib/commonjs/shared/providers/screen/styles/helpers/preserve-animated-props-only.js +0 -26
  330. package/lib/commonjs/shared/providers/screen/styles/helpers/preserve-animated-props-only.js.map +0 -1
  331. package/lib/commonjs/shared/providers/screen/styles/styles.provider.js +0 -61
  332. package/lib/commonjs/shared/providers/screen/styles/styles.provider.js.map +0 -1
  333. package/lib/module/shared/components/boundary/providers/boundary-owner.provider.js.map +0 -1
  334. package/lib/module/shared/providers/screen/styles/helpers/preserve-animated-props-only.js +0 -21
  335. package/lib/module/shared/providers/screen/styles/helpers/preserve-animated-props-only.js.map +0 -1
  336. package/lib/module/shared/providers/screen/styles/styles.provider.js +0 -53
  337. package/lib/module/shared/providers/screen/styles/styles.provider.js.map +0 -1
  338. package/lib/typescript/shared/components/boundary/providers/boundary-owner.provider.d.ts.map +0 -1
  339. package/lib/typescript/shared/providers/screen/styles/helpers/preserve-animated-props-only.d.ts +0 -3
  340. package/lib/typescript/shared/providers/screen/styles/helpers/preserve-animated-props-only.d.ts.map +0 -1
  341. package/lib/typescript/shared/providers/screen/styles/styles.provider.d.ts +0 -14
  342. package/lib/typescript/shared/providers/screen/styles/styles.provider.d.ts.map +0 -1
  343. package/src/shared/providers/screen/styles/helpers/preserve-animated-props-only.ts +0 -22
  344. package/src/shared/providers/screen/styles/styles.provider.tsx +0 -60
@@ -1,7 +1,6 @@
1
1
  import { memo } from "react";
2
2
  import type { StyleProp, ViewStyle } from "react-native";
3
3
  import Animated, { useAnimatedStyle } from "react-native-reanimated";
4
- import { PortalHost as NativePortalHost } from "react-native-teleport";
5
4
  import { NO_STYLES } from "../../../../constants";
6
5
  import { AnimationStore } from "../../../../stores/animation.store";
7
6
  import { getSourceScreenKeyFromPairKey } from "../../../../stores/bounds/helpers/link-pairs.helpers";
@@ -9,14 +8,16 @@ import { getLink } from "../../../../stores/bounds/internals/links";
9
8
  import { GestureStore } from "../../../../stores/gesture.store";
10
9
  import { ScrollStore } from "../../../../stores/scroll.store";
11
10
  import type { ActivePortalBoundaryHost } from "../stores/portal-boundary-host.store";
11
+ import { NativePortalHost } from "../teleport";
12
12
  import { createPortalBoundaryHostName } from "../utils/naming";
13
13
  import {
14
14
  type PortalOffsetPlacement,
15
15
  resolvePortalOffsetStyle,
16
16
  } from "../utils/offset-style";
17
17
 
18
- const AnimatedPortalBoundaryHost =
19
- Animated.createAnimatedComponent(NativePortalHost);
18
+ const AnimatedPortalBoundaryHost = NativePortalHost
19
+ ? Animated.createAnimatedComponent(NativePortalHost)
20
+ : null;
20
21
 
21
22
  type PortalBoundaryHostProps = {
22
23
  host: ActivePortalBoundaryHost;
@@ -84,6 +85,12 @@ export const PortalBoundaryHost = memo(function PortalBoundaryHost({
84
85
  });
85
86
  });
86
87
 
88
+ // Without `react-native-teleport` no portal ever mounts a boundary host, so
89
+ // this never renders — the guard just narrows the nullable animated host.
90
+ if (!AnimatedPortalBoundaryHost) {
91
+ return null;
92
+ }
93
+
87
94
  return (
88
95
  <AnimatedPortalBoundaryHost name={hostName} style={[style, hostStyle]} />
89
96
  );
@@ -1,10 +1,14 @@
1
1
  import { memo } from "react";
2
- import { PortalProvider as NativePortalProvider } from "react-native-teleport";
2
+ import { NativePortalProvider } from "../teleport";
3
3
 
4
4
  export const PortalProvider = memo(function PortalProvider({
5
5
  children,
6
6
  }: {
7
7
  children: React.ReactNode;
8
8
  }) {
9
+ if (!NativePortalProvider) {
10
+ return children;
11
+ }
12
+
9
13
  return <NativePortalProvider>{children}</NativePortalProvider>;
10
14
  });
@@ -16,9 +16,8 @@ import Animated, {
16
16
  useAnimatedStyle,
17
17
  useSharedValue,
18
18
  } from "react-native-reanimated";
19
- import { Portal as NativePortal } from "react-native-teleport";
20
19
  import { useDescriptorsStore } from "../../../../providers/screen/descriptors";
21
- import { useScreenStyles } from "../../../../providers/screen/styles";
20
+ import { useScreenSlots } from "../../../../providers/screen/styles";
22
21
  import { AnimationStore } from "../../../../stores/animation.store";
23
22
  import { getLinkKeyFromTag } from "../../../../stores/bounds/helpers/link-pairs.helpers";
24
23
  import { getLink } from "../../../../stores/bounds/internals/links";
@@ -33,6 +32,7 @@ import {
33
32
  mountPortalBoundaryHost,
34
33
  unmountPortalBoundaryHost,
35
34
  } from "../stores/portal-boundary-host.store";
35
+ import { isTeleportAvailable, NativePortal } from "../teleport";
36
36
  import {
37
37
  type PortalAttachment,
38
38
  resolvePortalAttachmentTargets,
@@ -44,15 +44,17 @@ import {
44
44
  import { isTeleportEnabled } from "../utils/teleport-control";
45
45
 
46
46
  type NullableHostNamePortalProps = Omit<
47
- ComponentProps<typeof NativePortal>,
47
+ ComponentProps<NonNullable<typeof NativePortal>>,
48
48
  "hostName"
49
49
  > & {
50
50
  hostName?: string | null;
51
51
  };
52
52
 
53
- const TransitionAwareTeleport = createTransitionAwareComponent(
54
- NativePortal as ComponentType<NullableHostNamePortalProps>,
55
- );
53
+ const TransitionAwareTeleport = NativePortal
54
+ ? createTransitionAwareComponent(
55
+ NativePortal as ComponentType<NullableHostNamePortalProps>,
56
+ )
57
+ : null;
56
58
 
57
59
  interface PortalProps {
58
60
  id?: string;
@@ -73,12 +75,15 @@ export const Portal = memo(function Portal({
73
75
  mode = false,
74
76
  placeholderRef,
75
77
  }: PortalProps) {
76
- const isPortalEnabled = !!mode;
78
+ // Teleporting requires the optional `react-native-teleport` peer. Without it,
79
+ // a portal-enabled boundary degrades to inline rendering (the `return
80
+ // children` path below).
81
+ const isPortalEnabled = !!mode && isTeleportAvailable;
77
82
  const portalAttachTarget: BoundaryPortalAttachTarget =
78
83
  !mode || mode === true
79
84
  ? "current-screen"
80
85
  : (mode.attachTo ?? "current-screen");
81
- const { stylesMap } = useScreenStyles();
86
+ const { slotsMap } = useScreenSlots();
82
87
  const sourcePairKey = useDescriptorsStore((s) => s.derivations.sourcePairKey);
83
88
  const currentScreenKey = useDescriptorsStore(
84
89
  (s) => s.derivations.currentScreenKey,
@@ -224,7 +229,7 @@ export const Portal = memo(function Portal({
224
229
  // re-parented before the host is visually ready. Closing stays attached
225
230
  // through progress 0 so the final frame can land in the matched host.
226
231
  const attachThreshold = closing.get() === 1 ? 0 : 0.001;
227
- const { teleport, ...slotProps } = stylesMap.get()[id]?.props ?? {};
232
+ const { teleport, ...slotProps } = slotsMap.get()[id]?.props ?? {};
228
233
  const shouldTeleport = isTeleportEnabled(teleport);
229
234
 
230
235
  return {
@@ -256,7 +261,7 @@ export const Portal = memo(function Portal({
256
261
  return { width, height };
257
262
  });
258
263
 
259
- if (isPortalEnabled) {
264
+ if (isPortalEnabled && TransitionAwareTeleport) {
260
265
  return (
261
266
  <Animated.View
262
267
  ref={placeholderRef}
@@ -0,0 +1,40 @@
1
+ import type { BoundsPortalAttachTarget } from "../../../stores/bounds/types";
2
+ import { logger } from "../../../utils/logger";
3
+ import type { BoundaryPortal } from "../types";
4
+ import { isTeleportAvailable } from "./teleport";
5
+
6
+ /**
7
+ * Resolves the `portal` prop against teleport availability. When
8
+ * `react-native-teleport` is missing, portal boundaries degrade to inline
9
+ * rendering and we warn once for the whole app.
10
+ */
11
+ export const resolveBoundaryPortal = (
12
+ portal?: BoundaryPortal,
13
+ ): BoundaryPortal | undefined => {
14
+ if (isTeleportAvailable) {
15
+ return portal;
16
+ }
17
+
18
+ if (portal) {
19
+ logger.warnOnce(
20
+ "boundary:teleport-missing",
21
+ "react-native-teleport is not installed and will fallback to default behavior.",
22
+ );
23
+ }
24
+
25
+ return undefined;
26
+ };
27
+
28
+ /**
29
+ * Resolves which screen host a portal'd boundary attaches to. Object form may
30
+ * pin an explicit `attachTo`; bare `true` defaults to the current screen.
31
+ */
32
+ export const resolvePortalHost = (
33
+ portal?: BoundaryPortal,
34
+ ): BoundsPortalAttachTarget | undefined => {
35
+ if (typeof portal === "object") {
36
+ return portal.attachTo ?? "current-screen";
37
+ }
38
+
39
+ return portal ? "current-screen" : undefined;
40
+ };
@@ -0,0 +1,21 @@
1
+ import type { ComponentType } from "react";
2
+
3
+ /**
4
+ * `react-native-teleport` is an optional peer dependency. The require sits in a
5
+ * try/catch so Metro treats it as an optional dependency — an absent module no
6
+ * longer fails the bundle, it throws at runtime and the catch swallows it.
7
+ *
8
+ * When teleport is missing, `portal`-enabled boundaries degrade to inline
9
+ * rendering; everything else keeps working.
10
+ */
11
+ let mod: any = null;
12
+ try {
13
+ mod = require("react-native-teleport");
14
+ } catch {}
15
+
16
+ export const isTeleportAvailable = mod !== null;
17
+ export const NativePortal: ComponentType<any> | null = mod?.Portal ?? null;
18
+ export const NativePortalProvider: ComponentType<any> | null =
19
+ mod?.PortalProvider ?? null;
20
+ export const NativePortalHost: ComponentType<any> | null =
21
+ mod?.PortalHost ?? null;
@@ -1,8 +1,10 @@
1
1
  import type React from "react";
2
- import { type ReactNode, useCallback, useMemo, useRef, useState } from "react";
2
+ import { type ReactNode, useCallback, useMemo, useState } from "react";
3
3
  import type { View } from "react-native";
4
4
  import type Animated from "react-native-reanimated";
5
5
  import type { AnimatedRef, StyleProps } from "react-native-reanimated";
6
+ import { useAnimatedRef } from "react-native-reanimated";
7
+ import type { BoundTag } from "../../../stores/bounds/types";
6
8
  import createProvider from "../../../utils/create-provider";
7
9
  import { logger } from "../../../utils/logger";
8
10
  import type { BoundaryPortal } from "../types";
@@ -11,8 +13,7 @@ type BoundaryAssociatedStyle = React.ComponentProps<
11
13
  typeof Animated.View
12
14
  >["style"];
13
15
 
14
- interface BoundaryOwnerContextValue {
15
- ownerRef: AnimatedRef<View>;
16
+ interface BoundaryRootContextValue {
16
17
  registerTargetRef: (
17
18
  targetRef: AnimatedRef<View>,
18
19
  preparedStyles: StyleProps,
@@ -21,7 +22,7 @@ interface BoundaryOwnerContextValue {
21
22
  unregisterTargetRef: (targetRef: AnimatedRef<View>) => void;
22
23
  activeTargetRef: AnimatedRef<View> | null;
23
24
  associatedTargetStyles?: BoundaryAssociatedStyle;
24
- entryTag: string;
25
+ boundTag: BoundTag;
25
26
  portal?: BoundaryPortal;
26
27
  }
27
28
 
@@ -34,30 +35,28 @@ type BoundaryTargetEntry = {
34
35
 
35
36
  // logger.warn prepends the library prefix.
36
37
  const MULTIPLE_TARGETS_WARNING =
37
- "Multiple Boundary.Target elements were rendered under the same boundary owner. The first registered target will be measured.";
38
+ "Multiple Boundary.Target elements were rendered under the same boundary root. The first registered target will be measured.";
38
39
 
39
- export const TARGET_OUTSIDE_OWNER_WARNING =
40
- "Boundary.Target must be rendered inside a Boundary owner (Boundary.View, Boundary.Trigger, or a component created by createBoundaryComponent).";
40
+ export const TARGET_OUTSIDE_ROOT_WARNING =
41
+ "Boundary.Target must be rendered inside a Boundary root (Boundary.View, Boundary.Trigger, or a component created by createBoundaryComponent).";
41
42
 
42
- interface BoundaryOwnerProps {
43
- value: BoundaryOwnerContextValue;
43
+ interface BoundaryRootProps {
44
+ value: BoundaryRootContextValue;
44
45
  children: ReactNode;
45
46
  }
46
47
 
47
- export const { BoundaryOwnerProvider, useBoundaryOwnerContext } =
48
- createProvider("BoundaryOwner", { guarded: false })<
49
- BoundaryOwnerProps,
50
- BoundaryOwnerContextValue
51
- >((props) => props);
48
+ export const { BoundaryRootProvider, useBoundaryRootContext } = createProvider(
49
+ "BoundaryRoot",
50
+ { guarded: false },
51
+ )<BoundaryRootProps, BoundaryRootContextValue>((props) => props);
52
52
 
53
- export const useBoundaryOwner = (params: {
54
- ownerRef: AnimatedRef<View>;
53
+ export const useBoundaryRootState = (params: {
55
54
  associatedTargetStyles?: BoundaryAssociatedStyle;
56
- entryTag: string;
55
+ boundTag: BoundTag;
57
56
  portal?: BoundaryPortal;
58
57
  }) => {
59
- const { ownerRef, associatedTargetStyles, entryTag, portal } = params;
60
- const warnedAboutMultipleTargetsRef = useRef(false);
58
+ const { associatedTargetStyles, boundTag, portal } = params;
59
+ const rootRef = useAnimatedRef<View>();
61
60
  const [targetEntry, setTargetEntry] = useState<BoundaryTargetEntry | null>(
62
61
  null,
63
62
  );
@@ -73,13 +72,11 @@ export const useBoundaryOwner = (params: {
73
72
  return prev;
74
73
  }
75
74
 
76
- if (
77
- __DEV__ &&
78
- prev !== null &&
79
- !warnedAboutMultipleTargetsRef.current
80
- ) {
81
- warnedAboutMultipleTargetsRef.current = true;
82
- logger.warn(MULTIPLE_TARGETS_WARNING);
75
+ if (__DEV__ && prev !== null) {
76
+ logger.warnOnce(
77
+ "boundary:multiple-targets",
78
+ MULTIPLE_TARGETS_WARNING,
79
+ );
83
80
  }
84
81
 
85
82
  return (
@@ -100,30 +97,28 @@ export const useBoundaryOwner = (params: {
100
97
 
101
98
  const contextValue = useMemo(
102
99
  () => ({
103
- ownerRef,
104
100
  registerTargetRef,
105
101
  unregisterTargetRef,
106
102
  activeTargetRef: targetEntry?.ref ?? null,
107
103
  associatedTargetStyles,
108
- entryTag,
104
+ boundTag,
109
105
  portal,
110
106
  }),
111
107
  [
112
- ownerRef,
113
108
  registerTargetRef,
114
109
  unregisterTargetRef,
115
110
  targetEntry,
116
111
  associatedTargetStyles,
117
- entryTag,
112
+ boundTag,
118
113
  portal,
119
114
  ],
120
115
  );
121
116
 
122
117
  return {
118
+ ref: rootRef,
123
119
  contextValue,
124
120
  hasActiveTarget: targetEntry !== null,
125
- measuredRef: targetEntry?.measurementRef ?? ownerRef,
121
+ measuredRef: targetEntry?.measurementRef ?? rootRef,
126
122
  targetPreparedStyles: targetEntry?.preparedStyles,
127
- portal,
128
123
  };
129
124
  };
@@ -1,13 +1,40 @@
1
+ import {
2
+ createPendingPairKey,
3
+ getActiveGroupId,
4
+ getLinkKeyFromTag,
5
+ getSourceScreenKeyFromPairKey,
6
+ } from "../../../stores/bounds/helpers/link-pairs.helpers";
1
7
  import type {
2
8
  LinkPairsState,
3
9
  ScreenPairKey,
4
10
  } from "../../../stores/bounds/types";
5
11
 
12
+ const hasPendingSourceLinks = (
13
+ linkState: LinkPairsState | undefined,
14
+ pendingPairKey: ScreenPairKey,
15
+ ) => {
16
+ "worklet";
17
+ const links = linkState?.[pendingPairKey]?.links;
18
+
19
+ if (!links) {
20
+ return false;
21
+ }
22
+
23
+ for (const key in links) {
24
+ if (links[key]?.source) {
25
+ return true;
26
+ }
27
+ }
28
+
29
+ return false;
30
+ };
31
+
6
32
  export const getInitialDestinationMeasurePairKey = (params: {
7
33
  enabled: boolean;
8
34
  destinationPairKey?: ScreenPairKey;
9
35
  ancestorDestinationPairKey?: ScreenPairKey;
10
36
  linkId: string;
37
+ group?: string;
11
38
  linkState?: LinkPairsState;
12
39
  }): ScreenPairKey | null => {
13
40
  "worklet";
@@ -16,6 +43,7 @@ export const getInitialDestinationMeasurePairKey = (params: {
16
43
  destinationPairKey,
17
44
  ancestorDestinationPairKey,
18
45
  linkId,
46
+ group,
19
47
  linkState,
20
48
  } = params;
21
49
  const measurePairKey = destinationPairKey ?? ancestorDestinationPairKey;
@@ -24,8 +52,31 @@ export const getInitialDestinationMeasurePairKey = (params: {
24
52
  return null;
25
53
  }
26
54
 
55
+ const linkKey = getLinkKeyFromTag(linkId);
27
56
  const hasDestination =
28
- linkState?.[measurePairKey]?.links?.[linkId]?.destination;
57
+ linkState?.[measurePairKey]?.links?.[linkKey]?.destination;
58
+
59
+ if (hasDestination) {
60
+ return null;
61
+ }
62
+
63
+ const sourceScreenKey = getSourceScreenKeyFromPairKey(measurePairKey);
64
+ const pendingPairKey = createPendingPairKey(sourceScreenKey);
65
+ const hasPendingSources = hasPendingSourceLinks(linkState, pendingPairKey);
66
+ const pendingSource = linkState?.[pendingPairKey]?.links?.[linkKey]?.source;
67
+
68
+ if (hasPendingSources && !pendingSource) {
69
+ return null;
70
+ }
71
+
72
+ const activeGroupId =
73
+ group && linkState
74
+ ? getActiveGroupId(linkState, measurePairKey, group)
75
+ : null;
76
+
77
+ if (!hasPendingSources && activeGroupId && activeGroupId !== linkKey) {
78
+ return null;
79
+ }
29
80
 
30
- return hasDestination ? null : measurePairKey;
81
+ return measurePairKey;
31
82
  };
@@ -5,18 +5,15 @@ import type { View } from "react-native";
5
5
  import { GestureDetector } from "react-native-gesture-handler";
6
6
  import Animated, {
7
7
  runOnUI,
8
- useAnimatedProps,
9
8
  useAnimatedRef,
10
- useAnimatedStyle,
11
9
  useComposedEventHandler,
12
10
  } from "react-native-reanimated";
13
- import { NO_PROPS, NO_STYLES } from "../constants";
14
11
  import { RegisterBoundsProvider } from "../providers/register-bounds.provider";
15
12
  import {
16
13
  ScrollMetadataOwnerProvider,
17
14
  useScrollGestureCoordination,
18
15
  } from "../providers/screen/gestures/scroll-coordination";
19
- import { useScreenStyles } from "../providers/screen/styles";
16
+ import { useSlotProps, useSlotStyles } from "../providers/screen/styles";
20
17
  import type { TransitionAwareProps } from "../types/screen.types";
21
18
 
22
19
  interface CreateTransitionAwareComponentOptions {
@@ -128,28 +125,9 @@ export function createTransitionAwareComponent<P extends object>(
128
125
  } = props as any;
129
126
 
130
127
  const animatedRef = useAnimatedRef<View>();
131
- const { stylesMap } = useScreenStyles();
132
128
  const associatedId = sharedBoundTag || styleId;
133
-
134
- const associatedStyles = useAnimatedStyle(() => {
135
- "worklet";
136
-
137
- if (!associatedId) {
138
- return NO_STYLES;
139
- }
140
-
141
- return stylesMap.get()[associatedId]?.style ?? NO_STYLES;
142
- });
143
-
144
- const associatedProps = useAnimatedProps(() => {
145
- "worklet";
146
-
147
- if (!associatedId) {
148
- return NO_PROPS;
149
- }
150
-
151
- return stylesMap.get()[associatedId]?.props ?? NO_PROPS;
152
- });
129
+ const associatedStyles = useSlotStyles(associatedId);
130
+ const associatedProps = useSlotProps(associatedId);
153
131
 
154
132
  return (
155
133
  <RegisterBoundsProvider
@@ -5,7 +5,7 @@ import { ScreenAnimationProvider } from "../../../providers/screen/animation";
5
5
  import type { BaseDescriptor } from "../../../providers/screen/descriptors";
6
6
  import { DescriptorsProvider } from "../../../providers/screen/descriptors";
7
7
  import { ScreenOptionsProvider } from "../../../providers/screen/options";
8
- import { ScreenStylesProvider } from "../../../providers/screen/styles";
8
+ import { ScreenSlotProvider } from "../../../providers/screen/styles";
9
9
  import type { OverlayScreenState } from "../../../types/overlay.types";
10
10
 
11
11
  import { getActiveFloatOverlay } from "../helpers/get-active-overlay";
@@ -67,12 +67,12 @@ export function FloatOverlay() {
67
67
  <DescriptorsProvider current={current} previous={previous} next={next}>
68
68
  <ScreenOptionsProvider>
69
69
  <ScreenAnimationProvider>
70
- <ScreenStylesProvider isFloatingOverlay>
70
+ <ScreenSlotProvider isFloatingOverlay>
71
71
  <OverlayHost
72
72
  scene={scene}
73
73
  overlayScreenState={overlayScreenState}
74
74
  />
75
- </ScreenStylesProvider>
75
+ </ScreenSlotProvider>
76
76
  </ScreenAnimationProvider>
77
77
  </ScreenOptionsProvider>
78
78
  </DescriptorsProvider>
@@ -1,15 +1,10 @@
1
1
  import { memo, useCallback, useMemo } from "react";
2
2
  import { Pressable, StyleSheet } from "react-native";
3
- import Animated, {
4
- runOnUI,
5
- useAnimatedProps,
6
- useAnimatedStyle,
7
- } from "react-native-reanimated";
3
+ import Animated, { runOnUI } from "react-native-reanimated";
8
4
  import { DefaultSnapSpec } from "../../../configs/specs";
9
- import { NO_PROPS, NO_STYLES } from "../../../constants";
10
5
  import { useNavigationHelpers } from "../../../hooks/navigation/use-navigation-helpers";
11
6
  import { useDescriptors } from "../../../providers/screen/descriptors";
12
- import { useScreenStyles } from "../../../providers/screen/styles";
7
+ import { useSlotProps, useSlotStyles } from "../../../providers/screen/styles";
13
8
  import { AnimationStore } from "../../../stores/animation.store";
14
9
  import { GestureStore } from "../../../stores/gesture.store";
15
10
  import { SystemStore } from "../../../stores/system.store";
@@ -24,7 +19,6 @@ export const BackdropLayer = memo(function BackdropLayer({
24
19
  backdropBehavior: BackdropBehavior;
25
20
  isBackdropActive: boolean;
26
21
  }) {
27
- const { stylesMap } = useScreenStyles();
28
22
  const { current } = useDescriptors();
29
23
  const { dismissScreen } = useNavigationHelpers();
30
24
 
@@ -112,15 +106,8 @@ export const BackdropLayer = memo(function BackdropLayer({
112
106
  routeKey,
113
107
  ]);
114
108
 
115
- const animatedBackdropStyle = useAnimatedStyle(() => {
116
- "worklet";
117
- return stylesMap.get().backdrop?.style ?? NO_STYLES;
118
- });
119
-
120
- const animatedBackdropProps = useAnimatedProps(() => {
121
- "worklet";
122
- return stylesMap.get().backdrop?.props ?? NO_PROPS;
123
- });
109
+ const animatedBackdropStyle = useSlotStyles("backdrop");
110
+ const animatedBackdropProps = useSlotProps("backdrop");
124
111
 
125
112
  return (
126
113
  <Pressable
@@ -2,15 +2,11 @@
2
2
  import { memo } from "react";
3
3
  import { StyleSheet, View } from "react-native";
4
4
  import { GestureDetector } from "react-native-gesture-handler";
5
- import Animated, {
6
- useAnimatedProps,
7
- useAnimatedStyle,
8
- } from "react-native-reanimated";
9
- import { NO_PROPS, NO_STYLES } from "../../../constants";
5
+ import Animated from "react-native-reanimated";
10
6
  import { useDescriptors } from "../../../providers/screen/descriptors";
11
7
  import { useGestureContext } from "../../../providers/screen/gestures";
12
8
  import { OriginProvider } from "../../../providers/screen/origin.provider";
13
- import { useScreenStyles } from "../../../providers/screen/styles";
9
+ import { useSlotProps, useSlotStyles } from "../../../providers/screen/styles";
14
10
  import { ScreenFallbackHost } from "../../boundary/portal/components/host";
15
11
  import { useContentLayout } from "../hooks/use-content-layout";
16
12
  import { MaybeMaskedNavigationContainer } from "./maybe-masked-navigation-container";
@@ -24,7 +20,6 @@ type Props = {
24
20
 
25
21
  export const ContentLayer = memo(
26
22
  ({ children, pointerEvents, isBackdropActive }: Props) => {
27
- const { stylesMap } = useScreenStyles();
28
23
  const { current } = useDescriptors();
29
24
 
30
25
  const gestureContext = useGestureContext();
@@ -36,15 +31,8 @@ export const ContentLayer = memo(
36
31
 
37
32
  const handleContentLayout = useContentLayout();
38
33
 
39
- const animatedContentStyle = useAnimatedStyle(() => {
40
- "worklet";
41
- return stylesMap.get().content?.style || NO_STYLES;
42
- });
43
-
44
- const animatedContentProps = useAnimatedProps(() => {
45
- "worklet";
46
- return stylesMap.get().content?.props ?? NO_PROPS;
47
- });
34
+ const animatedContentStyle = useSlotStyles("content");
35
+ const animatedContentProps = useSlotProps("content");
48
36
 
49
37
  return (
50
38
  <GestureDetector gesture={gestureContext!.detectorGesture}>
@@ -1,12 +1,11 @@
1
1
  import { memo, useCallback } from "react";
2
2
  import { StyleSheet, View, type ViewProps } from "react-native";
3
- import Animated, { useAnimatedStyle } from "react-native-reanimated";
3
+ import Animated from "react-native-reanimated";
4
4
  import {
5
5
  NAVIGATION_MASK_CONTAINER_STYLE_ID,
6
6
  NAVIGATION_MASK_ELEMENT_STYLE_ID,
7
- NO_STYLES,
8
7
  } from "../../../constants";
9
- import { useScreenStyles } from "../../../providers/screen/styles";
8
+ import { useSlotStyles } from "../../../providers/screen/styles";
10
9
  import { logger } from "../../../utils/logger";
11
10
 
12
11
  type Props = {
@@ -47,8 +46,6 @@ const MaskedNavigationContainer = memo(
47
46
  children: React.ReactNode;
48
47
  pointerEvents: ViewProps["pointerEvents"];
49
48
  }) => {
50
- const { stylesMap } = useScreenStyles();
51
-
52
49
  const maybeLogWarning = useCallback(() => {
53
50
  if (LazyMaskedView !== View) return;
54
51
  if (hasWarnedMissingMaskedView) return;
@@ -59,19 +56,12 @@ const MaskedNavigationContainer = memo(
59
56
  );
60
57
  }, []);
61
58
 
62
- const animatedNavigationMaskStyle = useAnimatedStyle(() => {
63
- "worklet";
64
- return (
65
- stylesMap.get()[NAVIGATION_MASK_ELEMENT_STYLE_ID]?.style || NO_STYLES
66
- );
67
- });
68
-
69
- const animatedNavigationMaskContainerStyle = useAnimatedStyle(() => {
70
- "worklet";
71
- return (
72
- stylesMap.get()[NAVIGATION_MASK_CONTAINER_STYLE_ID]?.style || NO_STYLES
73
- );
74
- });
59
+ const animatedNavigationMaskStyle = useSlotStyles(
60
+ NAVIGATION_MASK_ELEMENT_STYLE_ID,
61
+ );
62
+ const animatedNavigationMaskContainerStyle = useSlotStyles(
63
+ NAVIGATION_MASK_CONTAINER_STYLE_ID,
64
+ );
75
65
 
76
66
  return (
77
67
  <LazyMaskedView
@@ -1,12 +1,8 @@
1
1
  import { type ComponentType, memo, useMemo } from "react";
2
2
  import { StyleSheet, type ViewProps } from "react-native";
3
- import Animated, {
4
- useAnimatedProps,
5
- useAnimatedStyle,
6
- } from "react-native-reanimated";
7
- import { NO_PROPS, NO_STYLES } from "../../../constants";
3
+ import Animated from "react-native-reanimated";
8
4
  import { useDescriptors } from "../../../providers/screen/descriptors";
9
- import { useScreenStyles } from "../../../providers/screen/styles";
5
+ import { useSlotProps, useSlotStyles } from "../../../providers/screen/styles";
10
6
 
11
7
  type Props = {
12
8
  children: React.ReactNode;
@@ -44,17 +40,8 @@ type AnimatedSurfaceProps = {
44
40
 
45
41
  const AnimatedSurface = memo(
46
42
  ({ children, pointerEvents, SurfaceComponent }: AnimatedSurfaceProps) => {
47
- const { stylesMap } = useScreenStyles();
48
-
49
- const animatedSurfaceStyle = useAnimatedStyle(() => {
50
- "worklet";
51
- return stylesMap.get().surface?.style ?? NO_STYLES;
52
- });
53
-
54
- const animatedSurfaceProps = useAnimatedProps(() => {
55
- "worklet";
56
- return stylesMap.get().surface?.props ?? NO_PROPS;
57
- });
43
+ const animatedSurfaceStyle = useSlotStyles("surface");
44
+ const animatedSurfaceProps = useSlotProps("surface");
58
45
 
59
46
  return (
60
47
  <SurfaceComponent