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

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 (481) hide show
  1. package/lib/commonjs/shared/components/boundary/components/boundary-target.js +21 -16
  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 +88 -114
  4. package/lib/commonjs/shared/components/boundary/create-boundary-component.js.map +1 -1
  5. package/lib/commonjs/shared/components/boundary/hooks/{use-boundary-presence.js → lifecycles/use-boundary-presence.js} +14 -7
  6. package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-boundary-presence.js.map +1 -0
  7. package/lib/commonjs/shared/components/boundary/hooks/{use-initial-destination-measurement.js → lifecycles/use-initial-destination-measurement.js} +51 -24
  8. package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js.map +1 -0
  9. package/lib/commonjs/shared/components/boundary/hooks/{use-initial-source-measurement.js → lifecycles/use-initial-source-measurement.js} +7 -10
  10. package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-initial-source-measurement.js.map +1 -0
  11. package/lib/commonjs/shared/components/boundary/hooks/{use-refresh-boundary.js → lifecycles/use-refresh-boundary.js} +10 -7
  12. package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-refresh-boundary.js.map +1 -0
  13. package/lib/commonjs/shared/components/boundary/hooks/use-boundary-measurement.js +82 -0
  14. package/lib/commonjs/shared/components/boundary/hooks/use-boundary-measurement.js.map +1 -0
  15. package/lib/commonjs/shared/components/boundary/hooks/use-measurer.js +10 -13
  16. package/lib/commonjs/shared/components/boundary/hooks/use-measurer.js.map +1 -1
  17. package/lib/commonjs/shared/components/boundary/index.js +27 -30
  18. package/lib/commonjs/shared/components/boundary/index.js.map +1 -1
  19. package/lib/commonjs/shared/components/boundary/portal/components/boundary-local-portal-host.js +58 -0
  20. package/lib/commonjs/shared/components/boundary/portal/components/boundary-local-portal-host.js.map +1 -0
  21. package/lib/commonjs/shared/components/boundary/portal/components/host.js +20 -4
  22. package/lib/commonjs/shared/components/boundary/portal/components/host.js.map +1 -1
  23. package/lib/commonjs/shared/components/boundary/portal/components/portal-boundary-host.js +53 -32
  24. package/lib/commonjs/shared/components/boundary/portal/components/portal-boundary-host.js.map +1 -1
  25. package/lib/commonjs/shared/components/boundary/portal/components/portal.js +206 -96
  26. package/lib/commonjs/shared/components/boundary/portal/components/portal.js.map +1 -1
  27. package/lib/commonjs/shared/components/boundary/portal/hooks/use-host-measurement.js +14 -2
  28. package/lib/commonjs/shared/components/boundary/portal/hooks/use-host-measurement.js.map +1 -1
  29. package/lib/commonjs/shared/components/boundary/portal/stores/host-registry.store.js +5 -44
  30. package/lib/commonjs/shared/components/boundary/portal/stores/host-registry.store.js.map +1 -1
  31. package/lib/commonjs/shared/components/boundary/portal/stores/portal-boundary-host.store.js +37 -5
  32. package/lib/commonjs/shared/components/boundary/portal/stores/portal-boundary-host.store.js.map +1 -1
  33. package/lib/commonjs/shared/components/boundary/portal/teleport.js +15 -2
  34. package/lib/commonjs/shared/components/boundary/portal/teleport.js.map +1 -1
  35. package/lib/commonjs/shared/components/boundary/portal/utils/has-local-slot.js +18 -0
  36. package/lib/commonjs/shared/components/boundary/portal/utils/has-local-slot.js.map +1 -0
  37. package/lib/commonjs/shared/components/boundary/portal/utils/naming.js +10 -3
  38. package/lib/commonjs/shared/components/boundary/portal/utils/naming.js.map +1 -1
  39. package/lib/commonjs/shared/components/boundary/portal/utils/offset-style.js +28 -49
  40. package/lib/commonjs/shared/components/boundary/portal/utils/offset-style.js.map +1 -1
  41. package/lib/commonjs/shared/components/boundary/portal/utils/ownership.js +254 -0
  42. package/lib/commonjs/shared/components/boundary/portal/utils/ownership.js.map +1 -0
  43. package/lib/commonjs/shared/components/boundary/portal/utils/resolve-portal.js +38 -0
  44. package/lib/commonjs/shared/components/boundary/portal/utils/resolve-portal.js.map +1 -0
  45. package/lib/commonjs/shared/components/boundary/portal/utils/shallow-equal.js +29 -0
  46. package/lib/commonjs/shared/components/boundary/portal/utils/shallow-equal.js.map +1 -0
  47. package/lib/commonjs/shared/components/boundary/portal/utils/teleport-control.js +10 -1
  48. package/lib/commonjs/shared/components/boundary/portal/utils/teleport-control.js.map +1 -1
  49. package/lib/commonjs/shared/components/boundary/portal/utils/visible-host.js +25 -0
  50. package/lib/commonjs/shared/components/boundary/portal/utils/visible-host.js.map +1 -0
  51. package/lib/commonjs/shared/components/boundary/providers/boundary-root.provider.js +65 -0
  52. package/lib/commonjs/shared/components/boundary/providers/boundary-root.provider.js.map +1 -0
  53. package/lib/commonjs/shared/components/boundary/utils/destination-signals.js +12 -2
  54. package/lib/commonjs/shared/components/boundary/utils/destination-signals.js.map +1 -1
  55. package/lib/commonjs/shared/components/boundary/utils/refresh-signals.js +0 -21
  56. package/lib/commonjs/shared/components/boundary/utils/refresh-signals.js.map +1 -1
  57. package/lib/commonjs/shared/components/boundary/utils/source-signals.js +4 -9
  58. package/lib/commonjs/shared/components/boundary/utils/source-signals.js.map +1 -1
  59. package/lib/commonjs/shared/components/create-transition-aware-component.js +2 -20
  60. package/lib/commonjs/shared/components/create-transition-aware-component.js.map +1 -1
  61. package/lib/commonjs/shared/components/overlay/variations/float-overlay.js +1 -1
  62. package/lib/commonjs/shared/components/overlay/variations/float-overlay.js.map +1 -1
  63. package/lib/commonjs/shared/components/screen-container/layers/backdrop.js +2 -14
  64. package/lib/commonjs/shared/components/screen-container/layers/backdrop.js.map +1 -1
  65. package/lib/commonjs/shared/components/screen-container/layers/content.js +4 -16
  66. package/lib/commonjs/shared/components/screen-container/layers/content.js.map +1 -1
  67. package/lib/commonjs/shared/components/screen-container/layers/maybe-masked-navigation-container.js +4 -15
  68. package/lib/commonjs/shared/components/screen-container/layers/maybe-masked-navigation-container.js.map +1 -1
  69. package/lib/commonjs/shared/components/screen-container/layers/surface-container.js +4 -16
  70. package/lib/commonjs/shared/components/screen-container/layers/surface-container.js.map +1 -1
  71. package/lib/commonjs/shared/index.js.map +1 -1
  72. package/lib/commonjs/shared/providers/helpers/measured-bounds-writes.js +6 -3
  73. package/lib/commonjs/shared/providers/helpers/measured-bounds-writes.js.map +1 -1
  74. package/lib/commonjs/shared/providers/screen/animation/helpers/derivations.js +1 -0
  75. package/lib/commonjs/shared/providers/screen/animation/helpers/derivations.js.map +1 -1
  76. package/lib/commonjs/shared/providers/screen/animation/helpers/pipeline.js +143 -24
  77. package/lib/commonjs/shared/providers/screen/animation/helpers/pipeline.js.map +1 -1
  78. package/lib/commonjs/shared/providers/screen/screen-composer.js +1 -1
  79. package/lib/commonjs/shared/providers/screen/screen-composer.js.map +1 -1
  80. package/lib/commonjs/shared/providers/screen/styles/helpers/compose-slot-style.js +95 -0
  81. package/lib/commonjs/shared/providers/screen/styles/helpers/compose-slot-style.js.map +1 -0
  82. package/lib/commonjs/shared/providers/screen/styles/helpers/normalize-slots.js +30 -9
  83. package/lib/commonjs/shared/providers/screen/styles/helpers/normalize-slots.js.map +1 -1
  84. package/lib/commonjs/shared/providers/screen/styles/helpers/opening-phase.js +32 -0
  85. package/lib/commonjs/shared/providers/screen/styles/helpers/opening-phase.js.map +1 -0
  86. package/lib/commonjs/shared/providers/screen/styles/helpers/resolve-slot-styles/index.js +16 -11
  87. package/lib/commonjs/shared/providers/screen/styles/helpers/resolve-slot-styles/index.js.map +1 -1
  88. package/lib/commonjs/shared/providers/screen/styles/helpers/resolve-slot-styles/materialize-slot.js +2 -0
  89. package/lib/commonjs/shared/providers/screen/styles/helpers/resolve-slot-styles/materialize-slot.js.map +1 -1
  90. package/lib/commonjs/shared/providers/screen/styles/helpers/resolve-slot-styles/slot-state.js +1 -20
  91. package/lib/commonjs/shared/providers/screen/styles/helpers/resolve-slot-styles/slot-state.js.map +1 -1
  92. package/lib/commonjs/shared/providers/screen/styles/helpers/visibility-gate.js +1 -11
  93. package/lib/commonjs/shared/providers/screen/styles/helpers/visibility-gate.js.map +1 -1
  94. package/lib/commonjs/shared/providers/screen/styles/hooks/slot-resolvers.js +96 -0
  95. package/lib/commonjs/shared/providers/screen/styles/hooks/slot-resolvers.js.map +1 -0
  96. package/lib/commonjs/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js +36 -36
  97. package/lib/commonjs/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js.map +1 -1
  98. package/lib/commonjs/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js +1 -19
  99. package/lib/commonjs/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js.map +1 -1
  100. package/lib/commonjs/shared/providers/screen/styles/hooks/use-resolved-slot-style-map.js +8 -3
  101. package/lib/commonjs/shared/providers/screen/styles/hooks/use-resolved-slot-style-map.js.map +1 -1
  102. package/lib/commonjs/shared/providers/screen/styles/index.js +38 -7
  103. package/lib/commonjs/shared/providers/screen/styles/index.js.map +1 -1
  104. package/lib/commonjs/shared/providers/screen/styles/{styles.provider.js → slot.provider.js} +34 -21
  105. package/lib/commonjs/shared/providers/screen/styles/slot.provider.js.map +1 -0
  106. package/lib/commonjs/shared/providers/screen/styles/stores/slot-references.store.js +53 -0
  107. package/lib/commonjs/shared/providers/screen/styles/stores/slot-references.store.js.map +1 -0
  108. package/lib/commonjs/shared/stores/bounds/helpers/link-pairs.helpers.js +37 -2
  109. package/lib/commonjs/shared/stores/bounds/helpers/link-pairs.helpers.js.map +1 -1
  110. package/lib/commonjs/shared/stores/bounds/internals/entries.js +11 -4
  111. package/lib/commonjs/shared/stores/bounds/internals/entries.js.map +1 -1
  112. package/lib/commonjs/shared/stores/bounds/internals/links.js +134 -51
  113. package/lib/commonjs/shared/stores/bounds/internals/links.js.map +1 -1
  114. package/lib/commonjs/shared/stores/bounds/internals/resolver.js +1 -3
  115. package/lib/commonjs/shared/stores/bounds/internals/resolver.js.map +1 -1
  116. package/lib/commonjs/shared/stores/system.store.js +5 -0
  117. package/lib/commonjs/shared/stores/system.store.js.map +1 -1
  118. package/lib/commonjs/shared/utils/bounds/helpers/styles/compute.js +10 -69
  119. package/lib/commonjs/shared/utils/bounds/helpers/styles/compute.js.map +1 -1
  120. package/lib/commonjs/shared/utils/bounds/helpers/styles/local-transform.js +59 -0
  121. package/lib/commonjs/shared/utils/bounds/helpers/styles/local-transform.js.map +1 -0
  122. package/lib/commonjs/shared/utils/bounds/navigation/zoom/build.js +8 -1
  123. package/lib/commonjs/shared/utils/bounds/navigation/zoom/build.js.map +1 -1
  124. package/lib/commonjs/shared/utils/bounds/navigation/zoom/helpers.js +59 -0
  125. package/lib/commonjs/shared/utils/bounds/navigation/zoom/helpers.js.map +1 -1
  126. package/lib/commonjs/shared/utils/logger.js +11 -0
  127. package/lib/commonjs/shared/utils/logger.js.map +1 -1
  128. package/lib/module/shared/components/boundary/components/boundary-target.js +19 -14
  129. package/lib/module/shared/components/boundary/components/boundary-target.js.map +1 -1
  130. package/lib/module/shared/components/boundary/create-boundary-component.js +93 -119
  131. package/lib/module/shared/components/boundary/create-boundary-component.js.map +1 -1
  132. package/lib/module/shared/components/boundary/hooks/lifecycles/use-boundary-presence.js +30 -0
  133. package/lib/module/shared/components/boundary/hooks/lifecycles/use-boundary-presence.js.map +1 -0
  134. package/lib/module/shared/components/boundary/hooks/{use-initial-destination-measurement.js → lifecycles/use-initial-destination-measurement.js} +51 -24
  135. package/lib/module/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js.map +1 -0
  136. package/lib/module/shared/components/boundary/hooks/{use-initial-source-measurement.js → lifecycles/use-initial-source-measurement.js} +7 -10
  137. package/lib/module/shared/components/boundary/hooks/lifecycles/use-initial-source-measurement.js.map +1 -0
  138. package/lib/module/shared/components/boundary/hooks/{use-refresh-boundary.js → lifecycles/use-refresh-boundary.js} +10 -7
  139. package/lib/module/shared/components/boundary/hooks/lifecycles/use-refresh-boundary.js.map +1 -0
  140. package/lib/module/shared/components/boundary/hooks/use-boundary-measurement.js +77 -0
  141. package/lib/module/shared/components/boundary/hooks/use-boundary-measurement.js.map +1 -0
  142. package/lib/module/shared/components/boundary/hooks/use-measurer.js +10 -13
  143. package/lib/module/shared/components/boundary/hooks/use-measurer.js.map +1 -1
  144. package/lib/module/shared/components/boundary/index.js +27 -30
  145. package/lib/module/shared/components/boundary/index.js.map +1 -1
  146. package/lib/module/shared/components/boundary/portal/components/boundary-local-portal-host.js +53 -0
  147. package/lib/module/shared/components/boundary/portal/components/boundary-local-portal-host.js.map +1 -0
  148. package/lib/module/shared/components/boundary/portal/components/host.js +21 -5
  149. package/lib/module/shared/components/boundary/portal/components/host.js.map +1 -1
  150. package/lib/module/shared/components/boundary/portal/components/portal-boundary-host.js +53 -32
  151. package/lib/module/shared/components/boundary/portal/components/portal-boundary-host.js.map +1 -1
  152. package/lib/module/shared/components/boundary/portal/components/portal.js +213 -103
  153. package/lib/module/shared/components/boundary/portal/components/portal.js.map +1 -1
  154. package/lib/module/shared/components/boundary/portal/hooks/use-host-measurement.js +15 -3
  155. package/lib/module/shared/components/boundary/portal/hooks/use-host-measurement.js.map +1 -1
  156. package/lib/module/shared/components/boundary/portal/stores/host-registry.store.js +4 -41
  157. package/lib/module/shared/components/boundary/portal/stores/host-registry.store.js.map +1 -1
  158. package/lib/module/shared/components/boundary/portal/stores/portal-boundary-host.store.js +35 -4
  159. package/lib/module/shared/components/boundary/portal/stores/portal-boundary-host.store.js.map +1 -1
  160. package/lib/module/shared/components/boundary/portal/teleport.js +16 -2
  161. package/lib/module/shared/components/boundary/portal/teleport.js.map +1 -1
  162. package/lib/module/shared/components/boundary/portal/utils/has-local-slot.js +13 -0
  163. package/lib/module/shared/components/boundary/portal/utils/has-local-slot.js.map +1 -0
  164. package/lib/module/shared/components/boundary/portal/utils/naming.js +8 -2
  165. package/lib/module/shared/components/boundary/portal/utils/naming.js.map +1 -1
  166. package/lib/module/shared/components/boundary/portal/utils/offset-style.js +29 -49
  167. package/lib/module/shared/components/boundary/portal/utils/offset-style.js.map +1 -1
  168. package/lib/module/shared/components/boundary/portal/utils/ownership.js +246 -0
  169. package/lib/module/shared/components/boundary/portal/utils/ownership.js.map +1 -0
  170. package/lib/module/shared/components/boundary/portal/utils/resolve-portal.js +33 -0
  171. package/lib/module/shared/components/boundary/portal/utils/resolve-portal.js.map +1 -0
  172. package/lib/module/shared/components/boundary/portal/utils/shallow-equal.js +24 -0
  173. package/lib/module/shared/components/boundary/portal/utils/shallow-equal.js.map +1 -0
  174. package/lib/module/shared/components/boundary/portal/utils/teleport-control.js +8 -0
  175. package/lib/module/shared/components/boundary/portal/utils/teleport-control.js.map +1 -1
  176. package/lib/module/shared/components/boundary/portal/utils/visible-host.js +20 -0
  177. package/lib/module/shared/components/boundary/portal/utils/visible-host.js.map +1 -0
  178. package/lib/module/shared/components/boundary/providers/boundary-root.provider.js +57 -0
  179. package/lib/module/shared/components/boundary/providers/boundary-root.provider.js.map +1 -0
  180. package/lib/module/shared/components/boundary/utils/destination-signals.js +12 -2
  181. package/lib/module/shared/components/boundary/utils/destination-signals.js.map +1 -1
  182. package/lib/module/shared/components/boundary/utils/refresh-signals.js +0 -21
  183. package/lib/module/shared/components/boundary/utils/refresh-signals.js.map +1 -1
  184. package/lib/module/shared/components/boundary/utils/source-signals.js +4 -9
  185. package/lib/module/shared/components/boundary/utils/source-signals.js.map +1 -1
  186. package/lib/module/shared/components/create-transition-aware-component.js +4 -22
  187. package/lib/module/shared/components/create-transition-aware-component.js.map +1 -1
  188. package/lib/module/shared/components/overlay/variations/float-overlay.js +2 -2
  189. package/lib/module/shared/components/overlay/variations/float-overlay.js.map +1 -1
  190. package/lib/module/shared/components/screen-container/layers/backdrop.js +4 -16
  191. package/lib/module/shared/components/screen-container/layers/backdrop.js.map +1 -1
  192. package/lib/module/shared/components/screen-container/layers/content.js +4 -16
  193. package/lib/module/shared/components/screen-container/layers/content.js.map +1 -1
  194. package/lib/module/shared/components/screen-container/layers/maybe-masked-navigation-container.js +5 -16
  195. package/lib/module/shared/components/screen-container/layers/maybe-masked-navigation-container.js.map +1 -1
  196. package/lib/module/shared/components/screen-container/layers/surface-container.js +4 -16
  197. package/lib/module/shared/components/screen-container/layers/surface-container.js.map +1 -1
  198. package/lib/module/shared/index.js.map +1 -1
  199. package/lib/module/shared/providers/helpers/measured-bounds-writes.js +6 -3
  200. package/lib/module/shared/providers/helpers/measured-bounds-writes.js.map +1 -1
  201. package/lib/module/shared/providers/screen/animation/helpers/derivations.js +1 -0
  202. package/lib/module/shared/providers/screen/animation/helpers/derivations.js.map +1 -1
  203. package/lib/module/shared/providers/screen/animation/helpers/pipeline.js +144 -25
  204. package/lib/module/shared/providers/screen/animation/helpers/pipeline.js.map +1 -1
  205. package/lib/module/shared/providers/screen/screen-composer.js +2 -2
  206. package/lib/module/shared/providers/screen/screen-composer.js.map +1 -1
  207. package/lib/module/shared/providers/screen/styles/helpers/compose-slot-style.js +89 -0
  208. package/lib/module/shared/providers/screen/styles/helpers/compose-slot-style.js.map +1 -0
  209. package/lib/module/shared/providers/screen/styles/helpers/normalize-slots.js +30 -9
  210. package/lib/module/shared/providers/screen/styles/helpers/normalize-slots.js.map +1 -1
  211. package/lib/module/shared/providers/screen/styles/helpers/opening-phase.js +26 -0
  212. package/lib/module/shared/providers/screen/styles/helpers/opening-phase.js.map +1 -0
  213. package/lib/module/shared/providers/screen/styles/helpers/resolve-slot-styles/index.js +16 -11
  214. package/lib/module/shared/providers/screen/styles/helpers/resolve-slot-styles/index.js.map +1 -1
  215. package/lib/module/shared/providers/screen/styles/helpers/resolve-slot-styles/materialize-slot.js +2 -0
  216. package/lib/module/shared/providers/screen/styles/helpers/resolve-slot-styles/materialize-slot.js.map +1 -1
  217. package/lib/module/shared/providers/screen/styles/helpers/resolve-slot-styles/slot-state.js +0 -18
  218. package/lib/module/shared/providers/screen/styles/helpers/resolve-slot-styles/slot-state.js.map +1 -1
  219. package/lib/module/shared/providers/screen/styles/helpers/visibility-gate.js +0 -9
  220. package/lib/module/shared/providers/screen/styles/helpers/visibility-gate.js.map +1 -1
  221. package/lib/module/shared/providers/screen/styles/hooks/slot-resolvers.js +87 -0
  222. package/lib/module/shared/providers/screen/styles/hooks/slot-resolvers.js.map +1 -0
  223. package/lib/module/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js +36 -36
  224. package/lib/module/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js.map +1 -1
  225. package/lib/module/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js +1 -19
  226. package/lib/module/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js.map +1 -1
  227. package/lib/module/shared/providers/screen/styles/hooks/use-resolved-slot-style-map.js +9 -4
  228. package/lib/module/shared/providers/screen/styles/hooks/use-resolved-slot-style-map.js.map +1 -1
  229. package/lib/module/shared/providers/screen/styles/index.js +2 -1
  230. package/lib/module/shared/providers/screen/styles/index.js.map +1 -1
  231. package/lib/module/shared/providers/screen/styles/slot.provider.js +66 -0
  232. package/lib/module/shared/providers/screen/styles/slot.provider.js.map +1 -0
  233. package/lib/module/shared/providers/screen/styles/stores/slot-references.store.js +47 -0
  234. package/lib/module/shared/providers/screen/styles/stores/slot-references.store.js.map +1 -0
  235. package/lib/module/shared/stores/bounds/helpers/link-pairs.helpers.js +33 -1
  236. package/lib/module/shared/stores/bounds/helpers/link-pairs.helpers.js.map +1 -1
  237. package/lib/module/shared/stores/bounds/internals/entries.js +11 -4
  238. package/lib/module/shared/stores/bounds/internals/entries.js.map +1 -1
  239. package/lib/module/shared/stores/bounds/internals/links.js +135 -53
  240. package/lib/module/shared/stores/bounds/internals/links.js.map +1 -1
  241. package/lib/module/shared/stores/bounds/internals/resolver.js +1 -3
  242. package/lib/module/shared/stores/bounds/internals/resolver.js.map +1 -1
  243. package/lib/module/shared/stores/system.store.js +5 -0
  244. package/lib/module/shared/stores/system.store.js.map +1 -1
  245. package/lib/module/shared/types/animation.types.js.map +1 -1
  246. package/lib/module/shared/utils/bounds/helpers/styles/compute.js +10 -69
  247. package/lib/module/shared/utils/bounds/helpers/styles/compute.js.map +1 -1
  248. package/lib/module/shared/utils/bounds/helpers/styles/local-transform.js +52 -0
  249. package/lib/module/shared/utils/bounds/helpers/styles/local-transform.js.map +1 -0
  250. package/lib/module/shared/utils/bounds/navigation/zoom/build.js +9 -2
  251. package/lib/module/shared/utils/bounds/navigation/zoom/build.js.map +1 -1
  252. package/lib/module/shared/utils/bounds/navigation/zoom/helpers.js +58 -0
  253. package/lib/module/shared/utils/bounds/navigation/zoom/helpers.js.map +1 -1
  254. package/lib/module/shared/utils/logger.js +11 -0
  255. package/lib/module/shared/utils/logger.js.map +1 -1
  256. package/lib/typescript/shared/components/boundary/components/boundary-target.d.ts.map +1 -1
  257. package/lib/typescript/shared/components/boundary/create-boundary-component.d.ts +0 -1
  258. package/lib/typescript/shared/components/boundary/create-boundary-component.d.ts.map +1 -1
  259. package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-boundary-presence.d.ts +11 -0
  260. package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-boundary-presence.d.ts.map +1 -0
  261. package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.d.ts +10 -0
  262. package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.d.ts.map +1 -0
  263. package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-initial-source-measurement.d.ts +8 -0
  264. package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-initial-source-measurement.d.ts.map +1 -0
  265. package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-refresh-boundary.d.ts +10 -0
  266. package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-refresh-boundary.d.ts.map +1 -0
  267. package/lib/typescript/shared/components/boundary/hooks/use-boundary-measurement.d.ts +28 -0
  268. package/lib/typescript/shared/components/boundary/hooks/use-boundary-measurement.d.ts.map +1 -0
  269. package/lib/typescript/shared/components/boundary/hooks/use-measurer.d.ts +5 -6
  270. package/lib/typescript/shared/components/boundary/hooks/use-measurer.d.ts.map +1 -1
  271. package/lib/typescript/shared/components/boundary/index.d.ts +36 -229
  272. package/lib/typescript/shared/components/boundary/index.d.ts.map +1 -1
  273. package/lib/typescript/shared/components/boundary/portal/components/boundary-local-portal-host.d.ts +8 -0
  274. package/lib/typescript/shared/components/boundary/portal/components/boundary-local-portal-host.d.ts.map +1 -0
  275. package/lib/typescript/shared/components/boundary/portal/components/host.d.ts.map +1 -1
  276. package/lib/typescript/shared/components/boundary/portal/components/portal-boundary-host.d.ts +1 -1
  277. package/lib/typescript/shared/components/boundary/portal/components/portal-boundary-host.d.ts.map +1 -1
  278. package/lib/typescript/shared/components/boundary/portal/components/portal.d.ts +4 -3
  279. package/lib/typescript/shared/components/boundary/portal/components/portal.d.ts.map +1 -1
  280. package/lib/typescript/shared/components/boundary/portal/hooks/use-host-measurement.d.ts.map +1 -1
  281. package/lib/typescript/shared/components/boundary/portal/stores/host-registry.store.d.ts +0 -7
  282. package/lib/typescript/shared/components/boundary/portal/stores/host-registry.store.d.ts.map +1 -1
  283. package/lib/typescript/shared/components/boundary/portal/stores/portal-boundary-host.store.d.ts +16 -1
  284. package/lib/typescript/shared/components/boundary/portal/stores/portal-boundary-host.store.d.ts.map +1 -1
  285. package/lib/typescript/shared/components/boundary/portal/teleport.d.ts +1 -1
  286. package/lib/typescript/shared/components/boundary/portal/teleport.d.ts.map +1 -1
  287. package/lib/typescript/shared/components/boundary/portal/utils/has-local-slot.d.ts +3 -0
  288. package/lib/typescript/shared/components/boundary/portal/utils/has-local-slot.d.ts.map +1 -0
  289. package/lib/typescript/shared/components/boundary/portal/utils/naming.d.ts +2 -1
  290. package/lib/typescript/shared/components/boundary/portal/utils/naming.d.ts.map +1 -1
  291. package/lib/typescript/shared/components/boundary/portal/utils/offset-style.d.ts +16 -32
  292. package/lib/typescript/shared/components/boundary/portal/utils/offset-style.d.ts.map +1 -1
  293. package/lib/typescript/shared/components/boundary/portal/utils/ownership.d.ts +35 -0
  294. package/lib/typescript/shared/components/boundary/portal/utils/ownership.d.ts.map +1 -0
  295. package/lib/typescript/shared/components/boundary/portal/utils/resolve-portal.d.ts +12 -0
  296. package/lib/typescript/shared/components/boundary/portal/utils/resolve-portal.d.ts.map +1 -0
  297. package/lib/typescript/shared/components/boundary/portal/utils/shallow-equal.d.ts +8 -0
  298. package/lib/typescript/shared/components/boundary/portal/utils/shallow-equal.d.ts.map +1 -0
  299. package/lib/typescript/shared/components/boundary/portal/utils/teleport-control.d.ts +4 -0
  300. package/lib/typescript/shared/components/boundary/portal/utils/teleport-control.d.ts.map +1 -1
  301. package/lib/typescript/shared/components/boundary/portal/utils/visible-host.d.ts +8 -0
  302. package/lib/typescript/shared/components/boundary/portal/utils/visible-host.d.ts.map +1 -0
  303. package/lib/typescript/shared/components/boundary/providers/boundary-root.provider.d.ts +37 -0
  304. package/lib/typescript/shared/components/boundary/providers/boundary-root.provider.d.ts.map +1 -0
  305. package/lib/typescript/shared/components/boundary/types.d.ts +9 -36
  306. package/lib/typescript/shared/components/boundary/types.d.ts.map +1 -1
  307. package/lib/typescript/shared/components/boundary/utils/destination-signals.d.ts +1 -0
  308. package/lib/typescript/shared/components/boundary/utils/destination-signals.d.ts.map +1 -1
  309. package/lib/typescript/shared/components/boundary/utils/refresh-signals.d.ts.map +1 -1
  310. package/lib/typescript/shared/components/boundary/utils/source-signals.d.ts +0 -1
  311. package/lib/typescript/shared/components/boundary/utils/source-signals.d.ts.map +1 -1
  312. package/lib/typescript/shared/components/create-transition-aware-component.d.ts.map +1 -1
  313. package/lib/typescript/shared/components/screen-container/layers/backdrop.d.ts.map +1 -1
  314. package/lib/typescript/shared/components/screen-container/layers/content.d.ts.map +1 -1
  315. package/lib/typescript/shared/components/screen-container/layers/maybe-masked-navigation-container.d.ts.map +1 -1
  316. package/lib/typescript/shared/components/screen-container/layers/surface-container.d.ts.map +1 -1
  317. package/lib/typescript/shared/index.d.ts +3 -215
  318. package/lib/typescript/shared/index.d.ts.map +1 -1
  319. package/lib/typescript/shared/providers/helpers/measured-bounds-writes.d.ts +3 -3
  320. package/lib/typescript/shared/providers/helpers/measured-bounds-writes.d.ts.map +1 -1
  321. package/lib/typescript/shared/providers/screen/animation/helpers/derivations.d.ts +1 -0
  322. package/lib/typescript/shared/providers/screen/animation/helpers/derivations.d.ts.map +1 -1
  323. package/lib/typescript/shared/providers/screen/animation/helpers/pipeline.d.ts.map +1 -1
  324. package/lib/typescript/shared/providers/screen/styles/helpers/compose-slot-style.d.ts +4 -0
  325. package/lib/typescript/shared/providers/screen/styles/helpers/compose-slot-style.d.ts.map +1 -0
  326. package/lib/typescript/shared/providers/screen/styles/helpers/normalize-slots.d.ts.map +1 -1
  327. package/lib/typescript/shared/providers/screen/styles/helpers/opening-phase.d.ts +16 -0
  328. package/lib/typescript/shared/providers/screen/styles/helpers/opening-phase.d.ts.map +1 -0
  329. package/lib/typescript/shared/providers/screen/styles/helpers/resolve-slot-styles/index.d.ts +3 -4
  330. package/lib/typescript/shared/providers/screen/styles/helpers/resolve-slot-styles/index.d.ts.map +1 -1
  331. package/lib/typescript/shared/providers/screen/styles/helpers/resolve-slot-styles/materialize-slot.d.ts +2 -1
  332. package/lib/typescript/shared/providers/screen/styles/helpers/resolve-slot-styles/materialize-slot.d.ts.map +1 -1
  333. package/lib/typescript/shared/providers/screen/styles/helpers/resolve-slot-styles/slot-state.d.ts +0 -1
  334. package/lib/typescript/shared/providers/screen/styles/helpers/resolve-slot-styles/slot-state.d.ts.map +1 -1
  335. package/lib/typescript/shared/providers/screen/styles/helpers/visibility-gate.d.ts +0 -1
  336. package/lib/typescript/shared/providers/screen/styles/helpers/visibility-gate.d.ts.map +1 -1
  337. package/lib/typescript/shared/providers/screen/styles/hooks/slot-resolvers.d.ts +11 -0
  338. package/lib/typescript/shared/providers/screen/styles/hooks/slot-resolvers.d.ts.map +1 -0
  339. package/lib/typescript/shared/providers/screen/styles/hooks/use-interpolated-style-maps.d.ts +4 -6
  340. package/lib/typescript/shared/providers/screen/styles/hooks/use-interpolated-style-maps.d.ts.map +1 -1
  341. package/lib/typescript/shared/providers/screen/styles/hooks/use-maybe-block-visibility.d.ts +0 -1
  342. package/lib/typescript/shared/providers/screen/styles/hooks/use-maybe-block-visibility.d.ts.map +1 -1
  343. package/lib/typescript/shared/providers/screen/styles/hooks/use-resolved-slot-style-map.d.ts.map +1 -1
  344. package/lib/typescript/shared/providers/screen/styles/index.d.ts +2 -1
  345. package/lib/typescript/shared/providers/screen/styles/index.d.ts.map +1 -1
  346. package/lib/typescript/shared/providers/screen/styles/slot.provider.d.ts +18 -0
  347. package/lib/typescript/shared/providers/screen/styles/slot.provider.d.ts.map +1 -0
  348. package/lib/typescript/shared/providers/screen/styles/stores/slot-references.store.d.ts +6 -0
  349. package/lib/typescript/shared/providers/screen/styles/stores/slot-references.store.d.ts.map +1 -0
  350. package/lib/typescript/shared/stores/bounds/helpers/link-pairs.helpers.d.ts +8 -1
  351. package/lib/typescript/shared/stores/bounds/helpers/link-pairs.helpers.d.ts.map +1 -1
  352. package/lib/typescript/shared/stores/bounds/internals/entries.d.ts.map +1 -1
  353. package/lib/typescript/shared/stores/bounds/internals/links.d.ts +4 -3
  354. package/lib/typescript/shared/stores/bounds/internals/links.d.ts.map +1 -1
  355. package/lib/typescript/shared/stores/bounds/internals/resolver.d.ts.map +1 -1
  356. package/lib/typescript/shared/stores/bounds/types.d.ts +22 -20
  357. package/lib/typescript/shared/stores/bounds/types.d.ts.map +1 -1
  358. package/lib/typescript/shared/stores/system.store.d.ts +1 -0
  359. package/lib/typescript/shared/stores/system.store.d.ts.map +1 -1
  360. package/lib/typescript/shared/types/animation.types.d.ts +7 -1
  361. package/lib/typescript/shared/types/animation.types.d.ts.map +1 -1
  362. package/lib/typescript/shared/utils/bounds/helpers/styles/compute.d.ts.map +1 -1
  363. package/lib/typescript/shared/utils/bounds/helpers/styles/local-transform.d.ts +6 -0
  364. package/lib/typescript/shared/utils/bounds/helpers/styles/local-transform.d.ts.map +1 -0
  365. package/lib/typescript/shared/utils/bounds/navigation/zoom/build.d.ts.map +1 -1
  366. package/lib/typescript/shared/utils/bounds/navigation/zoom/helpers.d.ts +9 -0
  367. package/lib/typescript/shared/utils/bounds/navigation/zoom/helpers.d.ts.map +1 -1
  368. package/lib/typescript/shared/utils/logger.d.ts +6 -0
  369. package/lib/typescript/shared/utils/logger.d.ts.map +1 -1
  370. package/package.json +1 -1
  371. package/src/shared/components/boundary/components/boundary-target.tsx +30 -16
  372. package/src/shared/components/boundary/create-boundary-component.tsx +132 -164
  373. package/src/shared/components/boundary/hooks/lifecycles/use-boundary-presence.ts +41 -0
  374. package/src/shared/components/boundary/hooks/{use-initial-destination-measurement.ts → lifecycles/use-initial-destination-measurement.ts} +65 -22
  375. package/src/shared/components/boundary/hooks/{use-initial-source-measurement.ts → lifecycles/use-initial-source-measurement.ts} +10 -12
  376. package/src/shared/components/boundary/hooks/{use-refresh-boundary.ts → lifecycles/use-refresh-boundary.ts} +10 -10
  377. package/src/shared/components/boundary/hooks/use-boundary-measurement.ts +97 -0
  378. package/src/shared/components/boundary/hooks/use-measurer.ts +16 -24
  379. package/src/shared/components/boundary/index.tsx +56 -30
  380. package/src/shared/components/boundary/portal/components/boundary-local-portal-host.tsx +66 -0
  381. package/src/shared/components/boundary/portal/components/host.tsx +20 -5
  382. package/src/shared/components/boundary/portal/components/portal-boundary-host.tsx +67 -52
  383. package/src/shared/components/boundary/portal/components/portal.tsx +281 -120
  384. package/src/shared/components/boundary/portal/hooks/use-host-measurement.ts +23 -2
  385. package/src/shared/components/boundary/portal/stores/host-registry.store.ts +4 -51
  386. package/src/shared/components/boundary/portal/stores/portal-boundary-host.store.ts +59 -6
  387. package/src/shared/components/boundary/portal/teleport.ts +28 -3
  388. package/src/shared/components/boundary/portal/utils/has-local-slot.ts +16 -0
  389. package/src/shared/components/boundary/portal/utils/naming.ts +11 -1
  390. package/src/shared/components/boundary/portal/utils/offset-style.ts +37 -139
  391. package/src/shared/components/boundary/portal/utils/ownership.ts +371 -0
  392. package/src/shared/components/boundary/portal/utils/resolve-portal.ts +50 -0
  393. package/src/shared/components/boundary/portal/utils/shallow-equal.ts +25 -0
  394. package/src/shared/components/boundary/portal/utils/teleport-control.ts +12 -0
  395. package/src/shared/components/boundary/portal/utils/visible-host.ts +24 -0
  396. package/src/shared/components/boundary/providers/{boundary-owner.provider.tsx → boundary-root.provider.tsx} +33 -47
  397. package/src/shared/components/boundary/types.ts +9 -39
  398. package/src/shared/components/boundary/utils/destination-signals.ts +22 -2
  399. package/src/shared/components/boundary/utils/refresh-signals.ts +0 -41
  400. package/src/shared/components/boundary/utils/source-signals.ts +5 -17
  401. package/src/shared/components/create-transition-aware-component.tsx +3 -25
  402. package/src/shared/components/overlay/variations/float-overlay.tsx +3 -3
  403. package/src/shared/components/screen-container/layers/backdrop.tsx +4 -17
  404. package/src/shared/components/screen-container/layers/content.tsx +4 -16
  405. package/src/shared/components/screen-container/layers/maybe-masked-navigation-container.tsx +8 -18
  406. package/src/shared/components/screen-container/layers/surface-container.tsx +4 -17
  407. package/src/shared/index.ts +0 -5
  408. package/src/shared/providers/helpers/measured-bounds-writes.ts +6 -11
  409. package/src/shared/providers/screen/animation/helpers/derivations.ts +3 -0
  410. package/src/shared/providers/screen/animation/helpers/pipeline.ts +251 -68
  411. package/src/shared/providers/screen/screen-composer.tsx +3 -3
  412. package/src/shared/providers/screen/styles/helpers/compose-slot-style.ts +129 -0
  413. package/src/shared/providers/screen/styles/helpers/normalize-slots.ts +45 -8
  414. package/src/shared/providers/screen/styles/helpers/opening-phase.ts +25 -0
  415. package/src/shared/providers/screen/styles/helpers/resolve-slot-styles/index.ts +22 -12
  416. package/src/shared/providers/screen/styles/helpers/resolve-slot-styles/materialize-slot.ts +3 -1
  417. package/src/shared/providers/screen/styles/helpers/resolve-slot-styles/slot-state.ts +0 -24
  418. package/src/shared/providers/screen/styles/helpers/visibility-gate.ts +0 -12
  419. package/src/shared/providers/screen/styles/hooks/slot-resolvers.tsx +111 -0
  420. package/src/shared/providers/screen/styles/hooks/use-interpolated-style-maps.tsx +48 -38
  421. package/src/shared/providers/screen/styles/hooks/use-maybe-block-visibility.tsx +0 -18
  422. package/src/shared/providers/screen/styles/hooks/use-resolved-slot-style-map.tsx +17 -4
  423. package/src/shared/providers/screen/styles/index.tsx +13 -4
  424. package/src/shared/providers/screen/styles/slot.provider.tsx +93 -0
  425. package/src/shared/providers/screen/styles/stores/slot-references.store.ts +71 -0
  426. package/src/shared/stores/bounds/helpers/link-pairs.helpers.ts +41 -1
  427. package/src/shared/stores/bounds/internals/entries.ts +13 -5
  428. package/src/shared/stores/bounds/internals/links.ts +167 -85
  429. package/src/shared/stores/bounds/internals/resolver.ts +0 -2
  430. package/src/shared/stores/bounds/types.ts +24 -22
  431. package/src/shared/stores/system.store.ts +6 -0
  432. package/src/shared/types/animation.types.ts +8 -1
  433. package/src/shared/utils/bounds/helpers/styles/compute.ts +22 -124
  434. package/src/shared/utils/bounds/helpers/styles/local-transform.ts +86 -0
  435. package/src/shared/utils/bounds/navigation/zoom/build.ts +9 -1
  436. package/src/shared/utils/bounds/navigation/zoom/helpers.ts +96 -0
  437. package/src/shared/utils/logger.ts +12 -0
  438. package/lib/commonjs/shared/components/boundary/hooks/use-boundary-presence.js.map +0 -1
  439. package/lib/commonjs/shared/components/boundary/hooks/use-initial-destination-measurement.js.map +0 -1
  440. package/lib/commonjs/shared/components/boundary/hooks/use-initial-source-measurement.js.map +0 -1
  441. package/lib/commonjs/shared/components/boundary/hooks/use-refresh-boundary.js.map +0 -1
  442. package/lib/commonjs/shared/components/boundary/portal/utils/attachment.js +0 -40
  443. package/lib/commonjs/shared/components/boundary/portal/utils/attachment.js.map +0 -1
  444. package/lib/commonjs/shared/components/boundary/providers/boundary-owner.provider.js +0 -68
  445. package/lib/commonjs/shared/components/boundary/providers/boundary-owner.provider.js.map +0 -1
  446. package/lib/commonjs/shared/providers/screen/styles/helpers/preserve-animated-props-only.js +0 -26
  447. package/lib/commonjs/shared/providers/screen/styles/helpers/preserve-animated-props-only.js.map +0 -1
  448. package/lib/commonjs/shared/providers/screen/styles/styles.provider.js.map +0 -1
  449. package/lib/module/shared/components/boundary/hooks/use-boundary-presence.js +0 -23
  450. package/lib/module/shared/components/boundary/hooks/use-boundary-presence.js.map +0 -1
  451. package/lib/module/shared/components/boundary/hooks/use-initial-destination-measurement.js.map +0 -1
  452. package/lib/module/shared/components/boundary/hooks/use-initial-source-measurement.js.map +0 -1
  453. package/lib/module/shared/components/boundary/hooks/use-refresh-boundary.js.map +0 -1
  454. package/lib/module/shared/components/boundary/portal/utils/attachment.js +0 -35
  455. package/lib/module/shared/components/boundary/portal/utils/attachment.js.map +0 -1
  456. package/lib/module/shared/components/boundary/providers/boundary-owner.provider.js +0 -60
  457. package/lib/module/shared/components/boundary/providers/boundary-owner.provider.js.map +0 -1
  458. package/lib/module/shared/providers/screen/styles/helpers/preserve-animated-props-only.js +0 -21
  459. package/lib/module/shared/providers/screen/styles/helpers/preserve-animated-props-only.js.map +0 -1
  460. package/lib/module/shared/providers/screen/styles/styles.provider.js +0 -53
  461. package/lib/module/shared/providers/screen/styles/styles.provider.js.map +0 -1
  462. package/lib/typescript/shared/components/boundary/hooks/use-boundary-presence.d.ts +0 -8
  463. package/lib/typescript/shared/components/boundary/hooks/use-boundary-presence.d.ts.map +0 -1
  464. package/lib/typescript/shared/components/boundary/hooks/use-initial-destination-measurement.d.ts +0 -9
  465. package/lib/typescript/shared/components/boundary/hooks/use-initial-destination-measurement.d.ts.map +0 -1
  466. package/lib/typescript/shared/components/boundary/hooks/use-initial-source-measurement.d.ts +0 -9
  467. package/lib/typescript/shared/components/boundary/hooks/use-initial-source-measurement.d.ts.map +0 -1
  468. package/lib/typescript/shared/components/boundary/hooks/use-refresh-boundary.d.ts +0 -10
  469. package/lib/typescript/shared/components/boundary/hooks/use-refresh-boundary.d.ts.map +0 -1
  470. package/lib/typescript/shared/components/boundary/portal/utils/attachment.d.ts +0 -21
  471. package/lib/typescript/shared/components/boundary/portal/utils/attachment.d.ts.map +0 -1
  472. package/lib/typescript/shared/components/boundary/providers/boundary-owner.provider.d.ts +0 -44
  473. package/lib/typescript/shared/components/boundary/providers/boundary-owner.provider.d.ts.map +0 -1
  474. package/lib/typescript/shared/providers/screen/styles/helpers/preserve-animated-props-only.d.ts +0 -3
  475. package/lib/typescript/shared/providers/screen/styles/helpers/preserve-animated-props-only.d.ts.map +0 -1
  476. package/lib/typescript/shared/providers/screen/styles/styles.provider.d.ts +0 -14
  477. package/lib/typescript/shared/providers/screen/styles/styles.provider.d.ts.map +0 -1
  478. package/src/shared/components/boundary/hooks/use-boundary-presence.ts +0 -28
  479. package/src/shared/components/boundary/portal/utils/attachment.ts +0 -48
  480. package/src/shared/providers/screen/styles/helpers/preserve-animated-props-only.ts +0 -22
  481. package/src/shared/providers/screen/styles/styles.provider.tsx +0 -60
@@ -35,6 +35,11 @@ const getForwardedSlot = (
35
35
  return slot;
36
36
  };
37
37
 
38
+ const hasDefinedBucketValue = (value: unknown) => {
39
+ "worklet";
40
+ return value !== undefined && value !== null;
41
+ };
42
+
38
43
  const hasEitherResetPatch = (
39
44
  hasStyleResetPatch: boolean,
40
45
  hasPropResetPatch: boolean,
@@ -43,11 +48,6 @@ const hasEitherResetPatch = (
43
48
  return hasStyleResetPatch || hasPropResetPatch;
44
49
  };
45
50
 
46
- const hasDefinedBucketValue = (value: unknown) => {
47
- "worklet";
48
- return value !== undefined && value !== null;
49
- };
50
-
51
51
  const hasResettableDisappearedKeys = (
52
52
  previousKeys: Record<string, true> | undefined,
53
53
  previousResetValues: Record<string, unknown> | undefined,
@@ -81,7 +81,6 @@ const getResolvedSlotOutput = ({
81
81
  }) => {
82
82
  "worklet";
83
83
  const state = getResolvedSlotState(slot);
84
-
85
84
  const hasStyleResetPatch = hasResettableDisappearedKeys(
86
85
  previousState?.styleKeys,
87
86
  previousState?.styleResetValues,
@@ -108,6 +107,7 @@ const getResolvedSlotOutput = ({
108
107
  resolvedSlot: materializeResolvedSlot({
109
108
  baseStyle: state.baseStyle,
110
109
  baseProps: state.baseProps,
110
+ boundsLocalTransform: slot?.boundsLocalTransform,
111
111
  previousState,
112
112
  styleKeys: state.styleKeys,
113
113
  propKeys: state.propKeys,
@@ -165,6 +165,9 @@ const getMergedLocalSlot = (
165
165
  "worklet";
166
166
  let mergedStyle: Record<string, unknown> | undefined;
167
167
  let mergedProps: Record<string, unknown> | undefined;
168
+ let boundsLocalTransform:
169
+ | NormalizedTransitionSlotStyle["boundsLocalTransform"]
170
+ | undefined;
168
171
 
169
172
  for (let index = 0; index < context.localStylesMaps.length; index++) {
170
173
  const slot = context.localStylesMaps[index]?.[slotId];
@@ -178,15 +181,19 @@ const getMergedLocalSlot = (
178
181
  slot.style as Record<string, unknown> | undefined,
179
182
  );
180
183
  mergedProps = mergeBucket(mergedProps, slot.props);
184
+ if (slot.boundsLocalTransform?.length) {
185
+ boundsLocalTransform = slot.boundsLocalTransform;
186
+ }
181
187
  }
182
188
 
183
- if (!mergedStyle && !mergedProps) {
189
+ if (!mergedStyle && !mergedProps && !boundsLocalTransform) {
184
190
  return undefined;
185
191
  }
186
192
 
187
193
  return {
188
194
  style: mergedStyle,
189
195
  props: mergedProps,
196
+ boundsLocalTransform,
190
197
  };
191
198
  };
192
199
 
@@ -344,7 +351,11 @@ const areSlotsEqual = (
344
351
 
345
352
  return (
346
353
  areFlatObjectsEqual(left.style, right.style) &&
347
- areFlatObjectsEqual(left.props, right.props)
354
+ areFlatObjectsEqual(left.props, right.props) &&
355
+ areTransformArraysEqual(
356
+ left.boundsLocalTransform,
357
+ right.boundsLocalTransform,
358
+ )
348
359
  );
349
360
  };
350
361
 
@@ -459,10 +470,9 @@ const appendPreviousSlots = (context: ResolveSlotStylesContext) => {
459
470
  };
460
471
 
461
472
  /**
462
- * Resolves slot styles for the current screen pass and resets keys a slot
463
- * emitted previously but no longer returns. Reanimated does not reliably clear
464
- * animated values with undefined, so known keys and numeric values are reset to
465
- * concrete identity values.
473
+ * Resolves slot styles for the current screen pass and emits reset values for
474
+ * transition-owned keys that existed in the previous resolved map but no longer
475
+ * exist in the current one.
466
476
  */
467
477
  export const resolveSlotStyles = ({
468
478
  localStylesMaps,
@@ -111,6 +111,7 @@ const materializeResolvedProps = ({
111
111
  export const materializeResolvedSlot = ({
112
112
  baseStyle,
113
113
  baseProps,
114
+ boundsLocalTransform,
114
115
  previousState,
115
116
  styleKeys,
116
117
  propKeys,
@@ -121,6 +122,7 @@ export const materializeResolvedSlot = ({
121
122
  }: {
122
123
  baseStyle: Record<string, unknown> | undefined;
123
124
  baseProps: Record<string, unknown> | undefined;
125
+ boundsLocalTransform: NormalizedTransitionSlotStyle["boundsLocalTransform"];
124
126
  previousState: ResettableStyleState | undefined;
125
127
  styleKeys: Record<string, true> | undefined;
126
128
  propKeys: Record<string, true> | undefined;
@@ -139,7 +141,6 @@ export const materializeResolvedSlot = ({
139
141
  hasAnyStyleKeys,
140
142
  hasStyleResetPatch,
141
143
  });
142
-
143
144
  const resolvedProps = materializeResolvedProps({
144
145
  baseProps,
145
146
  previousState,
@@ -150,6 +151,7 @@ export const materializeResolvedSlot = ({
150
151
 
151
152
  resolvedSlot.style = resolvedStyle;
152
153
  resolvedSlot.props = resolvedProps;
154
+ resolvedSlot.boundsLocalTransform = boundsLocalTransform;
153
155
 
154
156
  if (!resolvedSlot.style && !resolvedSlot.props) {
155
157
  return undefined;
@@ -2,11 +2,6 @@ import type { NormalizedTransitionSlotStyle } from "../../../../../types/animati
2
2
  import { getPropResetValue, getStyleResetValue } from "./reset-values";
3
3
  import type { ResettableStyleState } from "./types";
4
4
 
5
- const hasTrackedKey = (keys: Record<string, true> | undefined, key: string) => {
6
- "worklet";
7
- return keys !== undefined && keys[key] === true;
8
- };
9
-
10
5
  const isDefinedStyleValue = (value: unknown) => {
11
6
  "worklet";
12
7
  return value !== undefined && value !== null;
@@ -52,25 +47,6 @@ const collectDefinedKeys = ({
52
47
  };
53
48
  };
54
49
 
55
- export const hasDisappearedKeys = (
56
- previousKeys: Record<string, true> | undefined,
57
- currentKeys: Record<string, true> | undefined,
58
- ) => {
59
- "worklet";
60
-
61
- if (!previousKeys) {
62
- return false;
63
- }
64
-
65
- for (const key in previousKeys) {
66
- if (!hasTrackedKey(currentKeys, key)) {
67
- return true;
68
- }
69
- }
70
-
71
- return false;
72
- };
73
-
74
50
  const hasEitherKeySet = (
75
51
  styleKeys: Record<string, true> | undefined,
76
52
  propKeys: Record<string, true> | undefined,
@@ -34,12 +34,7 @@ export const resolveScreenVisibilityGate = ({
34
34
  const isPendingOpen =
35
35
  pendingLifecycleRequestKind === LifecycleTransitionRequestKind.Open;
36
36
  const isOpening = isPendingOpen || !!entering;
37
-
38
- // Keep the screen hidden until the first transformed opening frame exists.
39
- // The lifecycle request is cleared before the RAF-scheduled progress
40
- // animation starts, so `entering` carries the gate through that one-frame gap.
41
37
  const isWaitingForOpenToStart = progress <= 0;
42
-
43
38
  const shouldBlock =
44
39
  (hasPendingLifecycleBlock || isWaitingForOpenToStart) && isOpening;
45
40
 
@@ -48,10 +43,3 @@ export const resolveScreenVisibilityGate = ({
48
43
  shouldOpenGate: !shouldBlock && progress > 0,
49
44
  };
50
45
  };
51
-
52
- export const shouldBlockScreenVisibility = (
53
- state: ScreenVisibilityGateState,
54
- ) => {
55
- "worklet";
56
- return resolveScreenVisibilityGate(state).shouldBlock;
57
- };
@@ -0,0 +1,111 @@
1
+ import { useMemo } from "react";
2
+ import { useAnimatedProps, useAnimatedStyle } from "react-native-reanimated";
3
+ import { NO_PROPS, NO_STYLES } from "../../../../constants";
4
+ import {
5
+ composeSlotStyleWithLocalTransform,
6
+ getLocalTransformForSlotComposition,
7
+ } from "../helpers/compose-slot-style";
8
+ import { useScreenSlots } from "../slot.provider";
9
+
10
+ export const useSlotStyles = (slotId: string | undefined) => {
11
+ const { slotsMap } = useScreenSlots();
12
+
13
+ return useAnimatedStyle(() => {
14
+ const slot = slotId ? slotsMap.get()[slotId] : undefined;
15
+ const slotStyle = slot?.style ?? NO_STYLES;
16
+
17
+ return composeSlotStyleWithLocalTransform(
18
+ slotStyle,
19
+ undefined,
20
+ slot?.boundsLocalTransform,
21
+ );
22
+ });
23
+ };
24
+
25
+ export const useComposedSlotStyles = (
26
+ slotId: string | undefined,
27
+ style: unknown,
28
+ ) => {
29
+ const { slotsMap } = useScreenSlots();
30
+ const localTransform = useMemo(
31
+ () => getLocalTransformForSlotComposition(style),
32
+ [style],
33
+ );
34
+
35
+ return useAnimatedStyle(() => {
36
+ const slot = slotId ? slotsMap.get()[slotId] : undefined;
37
+ const slotStyle = slot?.style ?? NO_STYLES;
38
+
39
+ return composeSlotStyleWithLocalTransform(
40
+ slotStyle,
41
+ localTransform,
42
+ slot?.boundsLocalTransform,
43
+ );
44
+ });
45
+ };
46
+
47
+ /**
48
+ * Stacking-only slice (`zIndex`/`elevation`) of a slot's style. Returned
49
+ * separately so an owner can keep just its stacking context while a nested
50
+ * target takes the full associated style. Yields `NO_STYLES` when neither is set.
51
+ */
52
+ export const useSlotStackingStyles = (slotId: string | undefined) => {
53
+ const { slotsMap } = useScreenSlots();
54
+
55
+ return useAnimatedStyle(() => {
56
+ const baseStyle = slotId ? slotsMap.get()[slotId]?.style : undefined;
57
+ const zIndex = baseStyle?.zIndex ?? 0;
58
+ const elevation = baseStyle?.elevation ?? 0;
59
+
60
+ if (zIndex === 0 && elevation === 0) {
61
+ return NO_STYLES;
62
+ }
63
+
64
+ return { zIndex, elevation };
65
+ });
66
+ };
67
+
68
+ export const useSlotLayoutStyles = (slotId: string | undefined) => {
69
+ const { slotsMap } = useScreenSlots();
70
+
71
+ return useAnimatedStyle(() => {
72
+ const baseStyle = slotId ? slotsMap.get()[slotId]?.style : undefined;
73
+ const width = baseStyle?.width;
74
+ const height = baseStyle?.height;
75
+ const minWidth = baseStyle?.minWidth;
76
+ const minHeight = baseStyle?.minHeight;
77
+ const maxWidth = baseStyle?.maxWidth;
78
+ const maxHeight = baseStyle?.maxHeight;
79
+ const aspectRatio = baseStyle?.aspectRatio;
80
+
81
+ if (
82
+ width === undefined &&
83
+ height === undefined &&
84
+ minWidth === undefined &&
85
+ minHeight === undefined &&
86
+ maxWidth === undefined &&
87
+ maxHeight === undefined &&
88
+ aspectRatio === undefined
89
+ ) {
90
+ return NO_STYLES;
91
+ }
92
+
93
+ return {
94
+ width,
95
+ height,
96
+ minWidth,
97
+ minHeight,
98
+ maxWidth,
99
+ maxHeight,
100
+ aspectRatio,
101
+ };
102
+ });
103
+ };
104
+
105
+ export const useSlotProps = (slotId: string | undefined) => {
106
+ const { slotsMap } = useScreenSlots();
107
+
108
+ return useAnimatedProps(() => {
109
+ return (slotId ? slotsMap.get()[slotId]?.props : undefined) ?? NO_PROPS;
110
+ });
111
+ };
@@ -1,6 +1,10 @@
1
1
  import { useDerivedValue, useSharedValue } from "react-native-reanimated";
2
2
  import { NO_STYLES } from "../../../../constants";
3
- import { SystemStore } from "../../../../stores/system.store";
3
+ import { AnimationStore } from "../../../../stores/animation.store";
4
+ import {
5
+ LifecycleTransitionRequestKind,
6
+ SystemStore,
7
+ } from "../../../../stores/system.store";
4
8
  import type {
5
9
  NormalizedTransitionInterpolatedStyle,
6
10
  ScreenStyleInterpolator,
@@ -13,13 +17,13 @@ import { useBuildTransitionAccessor } from "../../animation/helpers/accessors/us
13
17
  import type { ScreenInterpolatorFrame } from "../../animation/helpers/pipeline";
14
18
  import { readScreenAnimationRevisions } from "../../animation/helpers/read-screen-animation-revisions";
15
19
  import { syncSelectedInterpolatorOptions } from "../../animation/helpers/selected-interpolator-options";
16
- import { useDescriptorDerivations } from "../../descriptors";
20
+ import { useDescriptorsStore } from "../../descriptors";
17
21
  import {
18
22
  syncScreenOptionsOverrides,
19
23
  useScreenOptionsContext,
20
24
  } from "../../options";
21
25
  import { normalizeSlots } from "../helpers/normalize-slots";
22
- import { preserveAnimatedPropsOnly } from "../helpers/preserve-animated-props-only";
26
+ import { isOpeningBeforeStart } from "../helpers/opening-phase";
23
27
  import type { LocalStyleLayers } from "../helpers/resolve-slot-styles";
24
28
  import { stripInterpolatorOptions } from "../helpers/strip-interpolator-options";
25
29
 
@@ -37,12 +41,10 @@ type RunInterpolatorParams = {
37
41
  next: ScreenInterpolatorFrame["next"];
38
42
  bounds: Parameters<ScreenStyleInterpolator>[0]["bounds"];
39
43
  transition: Parameters<ScreenStyleInterpolator>[0]["transition"];
40
- shouldDeferStyleBuckets: boolean;
41
44
  };
42
45
 
43
46
  const normalizeRawStyleMap = (
44
47
  rawStyleMap: TransitionInterpolatedStyle | undefined,
45
- shouldDeferStyleBuckets: boolean,
46
48
  ) => {
47
49
  "worklet";
48
50
 
@@ -52,9 +54,7 @@ const normalizeRawStyleMap = (
52
54
 
53
55
  const stylesMap = normalizeSlots(stripInterpolatorOptions(rawStyleMap));
54
56
 
55
- return shouldDeferStyleBuckets
56
- ? preserveAnimatedPropsOnly(stylesMap)
57
- : stylesMap;
57
+ return stylesMap;
58
58
  };
59
59
 
60
60
  const runInterpolator = ({
@@ -64,7 +64,6 @@ const runInterpolator = ({
64
64
  next,
65
65
  bounds,
66
66
  transition,
67
- shouldDeferStyleBuckets,
68
67
  }: RunInterpolatorParams): InterpolatorResult | undefined => {
69
68
  "worklet";
70
69
 
@@ -86,7 +85,7 @@ const runInterpolator = ({
86
85
 
87
86
  return {
88
87
  rawStyleMap,
89
- stylesMap: normalizeRawStyleMap(rawStyleMap, shouldDeferStyleBuckets),
88
+ stylesMap: normalizeRawStyleMap(rawStyleMap),
90
89
  };
91
90
  } catch (_) {
92
91
  if (__DEV__) {
@@ -124,17 +123,15 @@ const appendLayer = (
124
123
  * normal interpolator selection once the gesture-driven close is no longer in
125
124
  * play.
126
125
  *
127
- * Visibility gating happens downstream while lifecycle start is blocked for
128
- * pending destination measurement. We still run the interpolator during that
129
- * hidden window so animated props and runtime options stay warm, but defer style
130
- * buckets so measurement sees the final untransformed layout.
131
- *
132
126
  * The result is ordered from lowest to highest priority. Resolution happens
133
127
  * downstream, where slot ids determine whether slots inherit from ancestors and
134
128
  * where higher owner layers override lower owner layers per key.
135
129
  */
136
130
  export const useInterpolatedStylesMap = () => {
137
- const { currentScreenKey } = useDescriptorDerivations();
131
+ const currentScreenKey = useDescriptorsStore(
132
+ (s) => s.derivations.currentScreenKey,
133
+ );
134
+ const nextScreenKey = useDescriptorsStore((s) => s.derivations.nextScreenKey);
138
135
  const screenOptions = useScreenOptionsContext();
139
136
  const {
140
137
  screenInterpolatorProps,
@@ -147,14 +144,19 @@ export const useInterpolatedStylesMap = () => {
147
144
  } = useScreenAnimationContext();
148
145
  const boundsAccessor = useBuildBoundsAccessor();
149
146
  const transition = useBuildTransitionAccessor();
150
- const pendingLifecycleStartBlockCount = SystemStore.getValue(
151
- currentScreenKey,
152
- "pendingLifecycleStartBlockCount",
153
- );
147
+ const nextInterpolatorReady = useSharedValue(0);
148
+
149
+ const activeScreenKey = nextScreenKey ?? currentScreenKey;
150
+ const {
151
+ entering: activeEntering,
152
+ transitionProgress: activeTransitionProgress,
153
+ } = AnimationStore.getBag(activeScreenKey);
154
+ const { pendingLifecycleRequestKind: activePendingLifecycleRequestKind } =
155
+ SystemStore.getBag(activeScreenKey);
154
156
 
155
157
  const isGesturingDuringCloseAnimation = useSharedValue(false);
156
158
 
157
- return useDerivedValue<LocalStyleLayers>(() => {
159
+ const localStylesMaps = useDerivedValue<LocalStyleLayers>(() => {
158
160
  "worklet";
159
161
  readScreenAnimationRevisions(
160
162
  screenInterpolatorPropsRevision,
@@ -163,19 +165,6 @@ export const useInterpolatedStylesMap = () => {
163
165
  );
164
166
  const props = screenInterpolatorProps.get();
165
167
 
166
- /**
167
- * There is a niche case where bounds can be attached to a view that's styles are out of viewport.
168
- * Due to our blocking mechanism and ensuring accurate measurement, this boundary measurement
169
- * will be blocked and the screen will never be visible. To mitigate this, we:
170
- *
171
- * - Defer the style buckets (props are fine), to ensure we get the correct position of the boundary
172
- *
173
- * Again this is very niche, and since we're not marketing ourselves as a proper shared element transition
174
- * package, we won't spend time finding a better solution for this.
175
- *
176
- */
177
- const shouldDeferStyleBuckets = pendingLifecycleStartBlockCount.get() > 0;
178
-
179
168
  const { current, next, progress } = props;
180
169
  const isDragging = current.gesture.dragging;
181
170
  const isNextClosing = !!next?.closing;
@@ -194,8 +183,26 @@ export const useInterpolatedStylesMap = () => {
194
183
  const isInGestureMode =
195
184
  !!isDragging || isGesturingDuringCloseAnimation.get();
196
185
 
197
- const interpolatorOptionsOwner =
198
- isInGestureMode || !nextInterpolator ? "current" : "next";
186
+ // The current screen keeps interpolator ownership until the next screen is
187
+ // genuinely live: never during a gesture-driven close, never before a next
188
+ // interpolator exists, and never in the next screen's pre-start window
189
+ // (entering, but no transformed frame yet). Only then does "next" take over.
190
+ const isPendingOpen =
191
+ activePendingLifecycleRequestKind.get() ===
192
+ LifecycleTransitionRequestKind.Open;
193
+ const activeOpening = isPendingOpen || !!activeEntering.get();
194
+ const currentOwnsInterpolator =
195
+ isInGestureMode ||
196
+ !nextInterpolator ||
197
+ isOpeningBeforeStart(
198
+ activeOpening ? 1 : 0,
199
+ activeTransitionProgress.get(),
200
+ );
201
+ nextInterpolatorReady.set(currentOwnsInterpolator ? 0 : 1);
202
+
203
+ const interpolatorOptionsOwner = currentOwnsInterpolator
204
+ ? "current"
205
+ : "next";
199
206
 
200
207
  let selectedProgress = progress;
201
208
  let selectedNext = next;
@@ -212,7 +219,6 @@ export const useInterpolatedStylesMap = () => {
212
219
  next: selectedNext,
213
220
  bounds: boundsAccessor,
214
221
  transition,
215
- shouldDeferStyleBuckets,
216
222
  });
217
223
 
218
224
  if (interpolatorOptionsOwner === "current") {
@@ -237,7 +243,6 @@ export const useInterpolatedStylesMap = () => {
237
243
  next: selectedNext,
238
244
  bounds: boundsAccessor,
239
245
  transition,
240
- shouldDeferStyleBuckets,
241
246
  });
242
247
 
243
248
  syncSelectedInterpolatorOptions(
@@ -258,4 +263,9 @@ export const useInterpolatedStylesMap = () => {
258
263
 
259
264
  return layers;
260
265
  });
266
+
267
+ return {
268
+ localStylesMaps,
269
+ nextInterpolatorReady,
270
+ };
261
271
  };
@@ -16,22 +16,12 @@ export const useMaybeBlockVisibility = (isFloatingOverlay?: boolean) => {
16
16
  const { currentScreenKey } = useDescriptorDerivations();
17
17
  const { entering, transitionProgress } =
18
18
  AnimationStore.getBag(currentScreenKey);
19
-
20
19
  const { pendingLifecycleStartBlockCount, pendingLifecycleRequestKind } =
21
20
  SystemStore.getBag(currentScreenKey);
22
21
 
23
22
  const hasVisibilityGateOpened = useSharedValue(false);
24
23
  const shouldBlockVisibility = useSharedValue(!isFloatingOverlay);
25
24
 
26
- /**
27
- * Visibility has to start blocked before the first animated style pass.
28
- *
29
- * `useDerivedValue` can publish its computed value after `useAnimatedStyle`
30
- * has already read the initial one, which briefly exposes an unhydrated
31
- * screen. Keep the visible state in an eagerly initialized shared value, then
32
- * let the reaction open it once the visibility gate allows the first
33
- * transformed frame to render.
34
- */
35
25
  useAnimatedReaction(
36
26
  () => {
37
27
  "worklet";
@@ -58,13 +48,6 @@ export const useMaybeBlockVisibility = (isFloatingOverlay?: boolean) => {
58
48
 
59
49
  const animatedStyle = useAnimatedStyle(() => {
60
50
  "worklet";
61
- /**
62
- * Keep blocked screens physically offscreen. On physical devices,
63
- * opacity: 0 can break Liquid Glass sampling.
64
- *
65
- * See: https://github.com/expo/expo/issues/41024
66
- *
67
- */
68
51
  const offset = getVisibilityBlockOffset(height);
69
52
 
70
53
  return {
@@ -88,6 +71,5 @@ export const useMaybeBlockVisibility = (isFloatingOverlay?: boolean) => {
88
71
  return {
89
72
  animatedStyle,
90
73
  animatedProps,
91
- shouldBlockVisibility,
92
74
  };
93
75
  };
@@ -6,6 +6,7 @@ import {
6
6
  import { NO_PROPS, NO_STYLES } from "../../../../constants";
7
7
  import type { NormalizedTransitionInterpolatedStyle } from "../../../../types/animation.types";
8
8
  import {
9
+ areResettableStatesBySlotEqual,
9
10
  type LocalStyleLayers,
10
11
  type ResettableStyleStatesBySlot,
11
12
  resolveSlotStyles,
@@ -26,7 +27,7 @@ export const useResolvedStylesMap = ({
26
27
  const previousResolvedStylesMap =
27
28
  useSharedValue<NormalizedTransitionInterpolatedStyle>(NO_STYLES);
28
29
 
29
- return useDerivedValue(() => {
30
+ return useDerivedValue<NormalizedTransitionInterpolatedStyle>(() => {
30
31
  "worklet";
31
32
  const { resolvedStylesMap, nextPreviousStyleStatesBySlot } =
32
33
  resolveSlotStyles({
@@ -35,12 +36,24 @@ export const useResolvedStylesMap = ({
35
36
  previousStyleStatesBySlot: previousStyleStatesBySlot.get(),
36
37
  });
37
38
 
38
- previousStyleStatesBySlot.set(nextPreviousStyleStatesBySlot);
39
+ if (
40
+ !areResettableStatesBySlotEqual(
41
+ previousStyleStatesBySlot.get(),
42
+ nextPreviousStyleStatesBySlot,
43
+ )
44
+ ) {
45
+ previousStyleStatesBySlot.set(nextPreviousStyleStatesBySlot);
46
+ }
47
+
48
+ const previousResolvedStyles = previousResolvedStylesMap.get();
39
49
  const stableResolvedStylesMap = reuseEqualResolvedSlots({
40
50
  resolvedStylesMap,
41
- previousResolvedStylesMap: previousResolvedStylesMap.get(),
51
+ previousResolvedStylesMap: previousResolvedStyles,
42
52
  });
43
- previousResolvedStylesMap.set(stableResolvedStylesMap);
53
+
54
+ if (stableResolvedStylesMap !== previousResolvedStyles) {
55
+ previousResolvedStylesMap.set(stableResolvedStylesMap);
56
+ }
44
57
 
45
58
  return stableResolvedStylesMap;
46
59
  });
@@ -1,5 +1,14 @@
1
1
  export {
2
- ScreenStylesContext,
3
- ScreenStylesProvider,
4
- useScreenStyles,
5
- } from "./styles.provider";
2
+ useComposedSlotStyles,
3
+ useSlotLayoutStyles,
4
+ useSlotProps,
5
+ useSlotStackingStyles,
6
+ useSlotStyles,
7
+ } from "./hooks/slot-resolvers";
8
+
9
+ export {
10
+ ScreenSlotContext,
11
+ type ScreenSlotName,
12
+ ScreenSlotProvider,
13
+ useScreenSlots,
14
+ } from "./slot.provider";
@@ -0,0 +1,93 @@
1
+ import { type ReactNode, useContext, useLayoutEffect, useMemo } from "react";
2
+ import { StyleSheet } from "react-native";
3
+ import Animated, { type SharedValue } from "react-native-reanimated";
4
+ import type {
5
+ NAVIGATION_MASK_CONTAINER_STYLE_ID,
6
+ NAVIGATION_MASK_ELEMENT_STYLE_ID,
7
+ } from "../../../constants";
8
+ import type { NormalizedTransitionInterpolatedStyle } from "../../../types/animation.types";
9
+ import createProvider from "../../../utils/create-provider";
10
+ import { useDescriptorsStore } from "../descriptors";
11
+ import { FloatingOverlayLayer } from "./components/floating-overlay-layer";
12
+ import type { LocalStyleLayers } from "./helpers/resolve-slot-styles";
13
+ import { useInterpolatedStylesMap } from "./hooks/use-interpolated-style-maps";
14
+ import { useMaybeBlockVisibility } from "./hooks/use-maybe-block-visibility";
15
+ import { useResolvedStylesMap } from "./hooks/use-resolved-slot-style-map";
16
+ import {
17
+ registerScreenSlots,
18
+ unregisterScreenSlots,
19
+ } from "./stores/slot-references.store";
20
+
21
+ type Props = {
22
+ children: ReactNode;
23
+ isFloatingOverlay?: boolean;
24
+ };
25
+
26
+ export type ScreenSlotName =
27
+ | "content"
28
+ | "backdrop"
29
+ | "surface"
30
+ | typeof NAVIGATION_MASK_CONTAINER_STYLE_ID
31
+ | typeof NAVIGATION_MASK_ELEMENT_STYLE_ID;
32
+
33
+ export type ScreenSlotContextValue = {
34
+ localStylesMaps: SharedValue<LocalStyleLayers>;
35
+ nextInterpolatorReady: SharedValue<number>;
36
+ slotsMap: SharedValue<NormalizedTransitionInterpolatedStyle>;
37
+ };
38
+
39
+ export const {
40
+ ScreenSlotProvider,
41
+ ScreenSlotContext,
42
+ useScreenSlotContext: useScreenSlots,
43
+ } = createProvider("ScreenSlot", {
44
+ guarded: true,
45
+ })<Props, ScreenSlotContextValue>(({ children, isFloatingOverlay }) => {
46
+ const parentContext = useContext(ScreenSlotContext);
47
+ const currentScreenKey = useDescriptorsStore(
48
+ (s) => s.derivations.currentScreenKey,
49
+ );
50
+
51
+ const { localStylesMaps, nextInterpolatorReady } = useInterpolatedStylesMap();
52
+
53
+ const slotsMap = useResolvedStylesMap({
54
+ localStylesMaps,
55
+ ancestorStylesMap: parentContext?.slotsMap,
56
+ });
57
+ const { animatedStyle, animatedProps } =
58
+ useMaybeBlockVisibility(isFloatingOverlay);
59
+ const value = useMemo(
60
+ () => ({
61
+ localStylesMaps,
62
+ nextInterpolatorReady,
63
+ slotsMap,
64
+ }),
65
+ [localStylesMaps, nextInterpolatorReady, slotsMap],
66
+ );
67
+
68
+ useLayoutEffect(() => {
69
+ registerScreenSlots(currentScreenKey, value);
70
+
71
+ return () => {
72
+ unregisterScreenSlots(currentScreenKey, value);
73
+ };
74
+ }, [currentScreenKey, value]);
75
+
76
+ return {
77
+ value,
78
+ children: (
79
+ <FloatingOverlayLayer enabled={isFloatingOverlay}>
80
+ <Animated.View
81
+ style={[styles.container, animatedStyle]}
82
+ animatedProps={animatedProps}
83
+ >
84
+ {children}
85
+ </Animated.View>
86
+ </FloatingOverlayLayer>
87
+ ),
88
+ };
89
+ });
90
+
91
+ const styles = StyleSheet.create({
92
+ container: { flex: 1 },
93
+ });