react-native-screen-transitions 3.9.0-alpha.1 → 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 (298) 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 -109
  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.js +3 -3
  19. package/lib/commonjs/shared/components/boundary/portal/components/portal.js.map +1 -1
  20. package/lib/commonjs/shared/components/boundary/portal/resolve-portal.js +36 -0
  21. package/lib/commonjs/shared/components/boundary/portal/resolve-portal.js.map +1 -0
  22. package/lib/commonjs/shared/components/boundary/providers/{boundary-owner.provider.js → boundary-root.provider.js} +21 -23
  23. package/lib/commonjs/shared/components/boundary/providers/boundary-root.provider.js.map +1 -0
  24. package/lib/commonjs/shared/components/boundary/utils/destination-signals.js +33 -2
  25. package/lib/commonjs/shared/components/boundary/utils/destination-signals.js.map +1 -1
  26. package/lib/commonjs/shared/components/create-transition-aware-component.js +2 -20
  27. package/lib/commonjs/shared/components/create-transition-aware-component.js.map +1 -1
  28. package/lib/commonjs/shared/components/overlay/variations/float-overlay.js +1 -1
  29. package/lib/commonjs/shared/components/overlay/variations/float-overlay.js.map +1 -1
  30. package/lib/commonjs/shared/components/screen-container/layers/backdrop.js +2 -14
  31. package/lib/commonjs/shared/components/screen-container/layers/backdrop.js.map +1 -1
  32. package/lib/commonjs/shared/components/screen-container/layers/content.js +4 -16
  33. package/lib/commonjs/shared/components/screen-container/layers/content.js.map +1 -1
  34. package/lib/commonjs/shared/components/screen-container/layers/maybe-masked-navigation-container.js +4 -15
  35. package/lib/commonjs/shared/components/screen-container/layers/maybe-masked-navigation-container.js.map +1 -1
  36. package/lib/commonjs/shared/components/screen-container/layers/surface-container.js +4 -16
  37. package/lib/commonjs/shared/components/screen-container/layers/surface-container.js.map +1 -1
  38. package/lib/commonjs/shared/providers/screen/animation/helpers/pipeline.js +142 -24
  39. package/lib/commonjs/shared/providers/screen/animation/helpers/pipeline.js.map +1 -1
  40. package/lib/commonjs/shared/providers/screen/screen-composer.js +1 -1
  41. package/lib/commonjs/shared/providers/screen/screen-composer.js.map +1 -1
  42. package/lib/commonjs/shared/providers/screen/styles/helpers/opening-phase.js +32 -0
  43. package/lib/commonjs/shared/providers/screen/styles/helpers/opening-phase.js.map +1 -0
  44. package/lib/commonjs/shared/providers/screen/styles/helpers/resolve-slot-styles/index.js +7 -8
  45. package/lib/commonjs/shared/providers/screen/styles/helpers/resolve-slot-styles/index.js.map +1 -1
  46. package/lib/commonjs/shared/providers/screen/styles/helpers/resolve-slot-styles/materialize-slot.js.map +1 -1
  47. package/lib/commonjs/shared/providers/screen/styles/helpers/resolve-slot-styles/slot-state.js +1 -20
  48. package/lib/commonjs/shared/providers/screen/styles/helpers/resolve-slot-styles/slot-state.js.map +1 -1
  49. package/lib/commonjs/shared/providers/screen/styles/helpers/visibility-gate.js +1 -11
  50. package/lib/commonjs/shared/providers/screen/styles/helpers/visibility-gate.js.map +1 -1
  51. package/lib/commonjs/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js +23 -36
  52. package/lib/commonjs/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js.map +1 -1
  53. package/lib/commonjs/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js +1 -19
  54. package/lib/commonjs/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js.map +1 -1
  55. package/lib/commonjs/shared/providers/screen/styles/hooks/use-resolved-slot-style-map.js +8 -3
  56. package/lib/commonjs/shared/providers/screen/styles/hooks/use-resolved-slot-style-map.js.map +1 -1
  57. package/lib/commonjs/shared/providers/screen/styles/index.js +25 -7
  58. package/lib/commonjs/shared/providers/screen/styles/index.js.map +1 -1
  59. package/lib/commonjs/shared/providers/screen/styles/slot.provider.js +103 -0
  60. package/lib/commonjs/shared/providers/screen/styles/slot.provider.js.map +1 -0
  61. package/lib/commonjs/shared/stores/bounds/helpers/link-pairs.helpers.js +16 -1
  62. package/lib/commonjs/shared/stores/bounds/helpers/link-pairs.helpers.js.map +1 -1
  63. package/lib/commonjs/shared/utils/bounds/navigation/zoom/build.js +8 -1
  64. package/lib/commonjs/shared/utils/bounds/navigation/zoom/build.js.map +1 -1
  65. package/lib/commonjs/shared/utils/bounds/navigation/zoom/helpers.js +59 -0
  66. package/lib/commonjs/shared/utils/bounds/navigation/zoom/helpers.js.map +1 -1
  67. package/lib/commonjs/shared/utils/logger.js +11 -0
  68. package/lib/commonjs/shared/utils/logger.js.map +1 -1
  69. package/lib/module/shared/components/boundary/components/boundary-target.js +10 -10
  70. package/lib/module/shared/components/boundary/components/boundary-target.js.map +1 -1
  71. package/lib/module/shared/components/boundary/create-boundary-component.js +47 -111
  72. package/lib/module/shared/components/boundary/create-boundary-component.js.map +1 -1
  73. package/lib/module/shared/components/boundary/hooks/use-boundary-measurement.js +98 -0
  74. package/lib/module/shared/components/boundary/hooks/use-boundary-measurement.js.map +1 -0
  75. package/lib/module/shared/components/boundary/hooks/use-boundary-presence.js +7 -4
  76. package/lib/module/shared/components/boundary/hooks/use-boundary-presence.js.map +1 -1
  77. package/lib/module/shared/components/boundary/hooks/use-initial-destination-measurement.js +24 -14
  78. package/lib/module/shared/components/boundary/hooks/use-initial-destination-measurement.js.map +1 -1
  79. package/lib/module/shared/components/boundary/hooks/use-initial-source-measurement.js +3 -4
  80. package/lib/module/shared/components/boundary/hooks/use-initial-source-measurement.js.map +1 -1
  81. package/lib/module/shared/components/boundary/hooks/use-measurer.js +6 -8
  82. package/lib/module/shared/components/boundary/hooks/use-measurer.js.map +1 -1
  83. package/lib/module/shared/components/boundary/hooks/use-refresh-boundary.js +6 -3
  84. package/lib/module/shared/components/boundary/hooks/use-refresh-boundary.js.map +1 -1
  85. package/lib/module/shared/components/boundary/index.js +2 -2
  86. package/lib/module/shared/components/boundary/portal/components/portal.js +4 -4
  87. package/lib/module/shared/components/boundary/portal/components/portal.js.map +1 -1
  88. package/lib/module/shared/components/boundary/portal/resolve-portal.js +31 -0
  89. package/lib/module/shared/components/boundary/portal/resolve-portal.js.map +1 -0
  90. package/lib/module/shared/components/boundary/providers/{boundary-owner.provider.js → boundary-root.provider.js} +18 -20
  91. package/lib/module/shared/components/boundary/providers/boundary-root.provider.js.map +1 -0
  92. package/lib/module/shared/components/boundary/utils/destination-signals.js +33 -2
  93. package/lib/module/shared/components/boundary/utils/destination-signals.js.map +1 -1
  94. package/lib/module/shared/components/create-transition-aware-component.js +4 -22
  95. package/lib/module/shared/components/create-transition-aware-component.js.map +1 -1
  96. package/lib/module/shared/components/overlay/variations/float-overlay.js +2 -2
  97. package/lib/module/shared/components/overlay/variations/float-overlay.js.map +1 -1
  98. package/lib/module/shared/components/screen-container/layers/backdrop.js +4 -16
  99. package/lib/module/shared/components/screen-container/layers/backdrop.js.map +1 -1
  100. package/lib/module/shared/components/screen-container/layers/content.js +4 -16
  101. package/lib/module/shared/components/screen-container/layers/content.js.map +1 -1
  102. package/lib/module/shared/components/screen-container/layers/maybe-masked-navigation-container.js +5 -16
  103. package/lib/module/shared/components/screen-container/layers/maybe-masked-navigation-container.js.map +1 -1
  104. package/lib/module/shared/components/screen-container/layers/surface-container.js +4 -16
  105. package/lib/module/shared/components/screen-container/layers/surface-container.js.map +1 -1
  106. package/lib/module/shared/providers/screen/animation/helpers/pipeline.js +143 -25
  107. package/lib/module/shared/providers/screen/animation/helpers/pipeline.js.map +1 -1
  108. package/lib/module/shared/providers/screen/screen-composer.js +2 -2
  109. package/lib/module/shared/providers/screen/screen-composer.js.map +1 -1
  110. package/lib/module/shared/providers/screen/styles/helpers/opening-phase.js +26 -0
  111. package/lib/module/shared/providers/screen/styles/helpers/opening-phase.js.map +1 -0
  112. package/lib/module/shared/providers/screen/styles/helpers/resolve-slot-styles/index.js +7 -8
  113. package/lib/module/shared/providers/screen/styles/helpers/resolve-slot-styles/index.js.map +1 -1
  114. package/lib/module/shared/providers/screen/styles/helpers/resolve-slot-styles/materialize-slot.js.map +1 -1
  115. package/lib/module/shared/providers/screen/styles/helpers/resolve-slot-styles/slot-state.js +0 -18
  116. package/lib/module/shared/providers/screen/styles/helpers/resolve-slot-styles/slot-state.js.map +1 -1
  117. package/lib/module/shared/providers/screen/styles/helpers/visibility-gate.js +0 -9
  118. package/lib/module/shared/providers/screen/styles/helpers/visibility-gate.js.map +1 -1
  119. package/lib/module/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js +22 -35
  120. package/lib/module/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js.map +1 -1
  121. package/lib/module/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js +1 -19
  122. package/lib/module/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js.map +1 -1
  123. package/lib/module/shared/providers/screen/styles/hooks/use-resolved-slot-style-map.js +9 -4
  124. package/lib/module/shared/providers/screen/styles/hooks/use-resolved-slot-style-map.js.map +1 -1
  125. package/lib/module/shared/providers/screen/styles/index.js +1 -1
  126. package/lib/module/shared/providers/screen/styles/index.js.map +1 -1
  127. package/lib/module/shared/providers/screen/styles/slot.provider.js +91 -0
  128. package/lib/module/shared/providers/screen/styles/slot.provider.js.map +1 -0
  129. package/lib/module/shared/stores/bounds/helpers/link-pairs.helpers.js +14 -0
  130. package/lib/module/shared/stores/bounds/helpers/link-pairs.helpers.js.map +1 -1
  131. package/lib/module/shared/utils/bounds/navigation/zoom/build.js +9 -2
  132. package/lib/module/shared/utils/bounds/navigation/zoom/build.js.map +1 -1
  133. package/lib/module/shared/utils/bounds/navigation/zoom/helpers.js +58 -0
  134. package/lib/module/shared/utils/bounds/navigation/zoom/helpers.js.map +1 -1
  135. package/lib/module/shared/utils/logger.js +11 -0
  136. package/lib/module/shared/utils/logger.js.map +1 -1
  137. package/lib/typescript/blank-stack/navigators/create-blank-stack-navigator.d.ts +2 -1
  138. package/lib/typescript/blank-stack/navigators/create-blank-stack-navigator.d.ts.map +1 -1
  139. package/lib/typescript/component-stack/components/component-screen.d.ts +1 -1
  140. package/lib/typescript/component-stack/components/component-screen.d.ts.map +1 -1
  141. package/lib/typescript/component-stack/navigators/create-component-stack-navigator.d.ts +2 -1
  142. package/lib/typescript/component-stack/navigators/create-component-stack-navigator.d.ts.map +1 -1
  143. package/lib/typescript/native-stack/navigators/createNativeStackNavigator.d.ts +1 -1
  144. package/lib/typescript/native-stack/navigators/createNativeStackNavigator.d.ts.map +1 -1
  145. package/lib/typescript/native-stack/views/NativeStackView.d.ts +2 -1
  146. package/lib/typescript/native-stack/views/NativeStackView.d.ts.map +1 -1
  147. package/lib/typescript/native-stack/views/useHeaderConfigProps.d.ts +2 -2
  148. package/lib/typescript/shared/adapters/with-screen-transitions/context.d.ts +1 -1
  149. package/lib/typescript/shared/adapters/with-screen-transitions/context.d.ts.map +1 -1
  150. package/lib/typescript/shared/adapters/with-screen-transitions/stack-layout.d.ts +1 -1
  151. package/lib/typescript/shared/adapters/with-screen-transitions/stack-layout.d.ts.map +1 -1
  152. package/lib/typescript/shared/components/activity/variants/activity-container.d.ts +1 -1
  153. package/lib/typescript/shared/components/activity/variants/activity-container.d.ts.map +1 -1
  154. package/lib/typescript/shared/components/activity/variants/activity-screen.d.ts +1 -1
  155. package/lib/typescript/shared/components/activity/variants/activity-screen.d.ts.map +1 -1
  156. package/lib/typescript/shared/components/boundary/components/boundary-target.d.ts +1 -1
  157. package/lib/typescript/shared/components/boundary/components/boundary-target.d.ts.map +1 -1
  158. package/lib/typescript/shared/components/boundary/create-boundary-component.d.ts.map +1 -1
  159. package/lib/typescript/shared/components/boundary/hooks/use-boundary-measurement.d.ts +32 -0
  160. package/lib/typescript/shared/components/boundary/hooks/use-boundary-measurement.d.ts.map +1 -0
  161. package/lib/typescript/shared/components/boundary/hooks/use-boundary-presence.d.ts +2 -1
  162. package/lib/typescript/shared/components/boundary/hooks/use-boundary-presence.d.ts.map +1 -1
  163. package/lib/typescript/shared/components/boundary/hooks/use-initial-destination-measurement.d.ts +3 -2
  164. package/lib/typescript/shared/components/boundary/hooks/use-initial-destination-measurement.d.ts.map +1 -1
  165. package/lib/typescript/shared/components/boundary/hooks/use-initial-source-measurement.d.ts +2 -2
  166. package/lib/typescript/shared/components/boundary/hooks/use-initial-source-measurement.d.ts.map +1 -1
  167. package/lib/typescript/shared/components/boundary/hooks/use-measurer.d.ts +3 -5
  168. package/lib/typescript/shared/components/boundary/hooks/use-measurer.d.ts.map +1 -1
  169. package/lib/typescript/shared/components/boundary/hooks/use-refresh-boundary.d.ts +3 -3
  170. package/lib/typescript/shared/components/boundary/hooks/use-refresh-boundary.d.ts.map +1 -1
  171. package/lib/typescript/shared/components/boundary/index.d.ts +7 -211
  172. package/lib/typescript/shared/components/boundary/index.d.ts.map +1 -1
  173. package/lib/typescript/shared/components/boundary/portal/components/host.d.ts +2 -2
  174. package/lib/typescript/shared/components/boundary/portal/components/host.d.ts.map +1 -1
  175. package/lib/typescript/shared/components/boundary/portal/components/portal-boundary-host.d.ts +1 -1
  176. package/lib/typescript/shared/components/boundary/portal/components/portal-boundary-host.d.ts.map +1 -1
  177. package/lib/typescript/shared/components/boundary/portal/components/portal-provider.d.ts +1 -1
  178. package/lib/typescript/shared/components/boundary/portal/components/portal-provider.d.ts.map +1 -1
  179. package/lib/typescript/shared/components/boundary/portal/components/portal.d.ts +1 -1
  180. package/lib/typescript/shared/components/boundary/portal/components/portal.d.ts.map +1 -1
  181. package/lib/typescript/shared/components/boundary/portal/resolve-portal.d.ts +14 -0
  182. package/lib/typescript/shared/components/boundary/portal/resolve-portal.d.ts.map +1 -0
  183. package/lib/typescript/shared/components/boundary/providers/{boundary-owner.provider.d.ts → boundary-root.provider.d.ts} +12 -14
  184. package/lib/typescript/shared/components/boundary/providers/boundary-root.provider.d.ts.map +1 -0
  185. package/lib/typescript/shared/components/boundary/utils/destination-signals.d.ts +1 -0
  186. package/lib/typescript/shared/components/boundary/utils/destination-signals.d.ts.map +1 -1
  187. package/lib/typescript/shared/components/create-transition-aware-component.d.ts +5 -6
  188. package/lib/typescript/shared/components/create-transition-aware-component.d.ts.map +1 -1
  189. package/lib/typescript/shared/components/masked-view.d.ts +1 -1
  190. package/lib/typescript/shared/components/masked-view.d.ts.map +1 -1
  191. package/lib/typescript/shared/components/overlay/variations/float-overlay.d.ts +1 -1
  192. package/lib/typescript/shared/components/overlay/variations/float-overlay.d.ts.map +1 -1
  193. package/lib/typescript/shared/components/overlay/variations/overlay-host.d.ts +1 -1
  194. package/lib/typescript/shared/components/overlay/variations/overlay-host.d.ts.map +1 -1
  195. package/lib/typescript/shared/components/scene-view.d.ts +1 -1
  196. package/lib/typescript/shared/components/scene-view.d.ts.map +1 -1
  197. package/lib/typescript/shared/components/screen-container/index.d.ts +1 -1
  198. package/lib/typescript/shared/components/screen-container/index.d.ts.map +1 -1
  199. package/lib/typescript/shared/components/screen-container/layers/backdrop.d.ts +1 -1
  200. package/lib/typescript/shared/components/screen-container/layers/backdrop.d.ts.map +1 -1
  201. package/lib/typescript/shared/components/screen-container/layers/content.d.ts +1 -1
  202. package/lib/typescript/shared/components/screen-container/layers/content.d.ts.map +1 -1
  203. package/lib/typescript/shared/components/screen-container/layers/maybe-masked-navigation-container.d.ts +1 -1
  204. package/lib/typescript/shared/components/screen-container/layers/maybe-masked-navigation-container.d.ts.map +1 -1
  205. package/lib/typescript/shared/components/screen-container/layers/surface-container.d.ts +1 -1
  206. package/lib/typescript/shared/components/screen-container/layers/surface-container.d.ts.map +1 -1
  207. package/lib/typescript/shared/hooks/navigation/use-stack.d.ts +1 -1
  208. package/lib/typescript/shared/hooks/navigation/use-stack.d.ts.map +1 -1
  209. package/lib/typescript/shared/index.d.ts +663 -919
  210. package/lib/typescript/shared/index.d.ts.map +1 -1
  211. package/lib/typescript/shared/providers/screen/animation/helpers/pipeline.d.ts.map +1 -1
  212. package/lib/typescript/shared/providers/screen/descriptors/descriptors.provider.d.ts +1 -1
  213. package/lib/typescript/shared/providers/screen/descriptors/descriptors.provider.d.ts.map +1 -1
  214. package/lib/typescript/shared/providers/screen/screen-composer.d.ts +1 -1
  215. package/lib/typescript/shared/providers/screen/screen-composer.d.ts.map +1 -1
  216. package/lib/typescript/shared/providers/screen/styles/components/floating-overlay-layer.d.ts +1 -1
  217. package/lib/typescript/shared/providers/screen/styles/components/floating-overlay-layer.d.ts.map +1 -1
  218. package/lib/typescript/shared/providers/screen/styles/helpers/opening-phase.d.ts +16 -0
  219. package/lib/typescript/shared/providers/screen/styles/helpers/opening-phase.d.ts.map +1 -0
  220. package/lib/typescript/shared/providers/screen/styles/helpers/resolve-slot-styles/index.d.ts +3 -4
  221. package/lib/typescript/shared/providers/screen/styles/helpers/resolve-slot-styles/index.d.ts.map +1 -1
  222. package/lib/typescript/shared/providers/screen/styles/helpers/resolve-slot-styles/materialize-slot.d.ts.map +1 -1
  223. package/lib/typescript/shared/providers/screen/styles/helpers/resolve-slot-styles/slot-state.d.ts +0 -1
  224. package/lib/typescript/shared/providers/screen/styles/helpers/resolve-slot-styles/slot-state.d.ts.map +1 -1
  225. package/lib/typescript/shared/providers/screen/styles/helpers/visibility-gate.d.ts +0 -1
  226. package/lib/typescript/shared/providers/screen/styles/helpers/visibility-gate.d.ts.map +1 -1
  227. package/lib/typescript/shared/providers/screen/styles/hooks/use-interpolated-style-maps.d.ts +0 -5
  228. package/lib/typescript/shared/providers/screen/styles/hooks/use-interpolated-style-maps.d.ts.map +1 -1
  229. package/lib/typescript/shared/providers/screen/styles/hooks/use-maybe-block-visibility.d.ts +2 -3
  230. package/lib/typescript/shared/providers/screen/styles/hooks/use-maybe-block-visibility.d.ts.map +1 -1
  231. package/lib/typescript/shared/providers/screen/styles/hooks/use-resolved-slot-style-map.d.ts.map +1 -1
  232. package/lib/typescript/shared/providers/screen/styles/index.d.ts +1 -1
  233. package/lib/typescript/shared/providers/screen/styles/index.d.ts.map +1 -1
  234. package/lib/typescript/shared/providers/screen/styles/slot.provider.d.ts +23 -0
  235. package/lib/typescript/shared/providers/screen/styles/slot.provider.d.ts.map +1 -0
  236. package/lib/typescript/shared/stores/bounds/helpers/link-pairs.helpers.d.ts +6 -1
  237. package/lib/typescript/shared/stores/bounds/helpers/link-pairs.helpers.d.ts.map +1 -1
  238. package/lib/typescript/shared/stores/bounds/types.d.ts +13 -0
  239. package/lib/typescript/shared/stores/bounds/types.d.ts.map +1 -1
  240. package/lib/typescript/shared/utils/bounds/navigation/zoom/build.d.ts.map +1 -1
  241. package/lib/typescript/shared/utils/bounds/navigation/zoom/helpers.d.ts +9 -0
  242. package/lib/typescript/shared/utils/bounds/navigation/zoom/helpers.d.ts.map +1 -1
  243. package/lib/typescript/shared/utils/logger.d.ts +6 -0
  244. package/lib/typescript/shared/utils/logger.d.ts.map +1 -1
  245. package/package.json +1 -1
  246. package/src/shared/components/boundary/components/boundary-target.tsx +12 -12
  247. package/src/shared/components/boundary/create-boundary-component.tsx +59 -155
  248. package/src/shared/components/boundary/hooks/use-boundary-measurement.ts +127 -0
  249. package/src/shared/components/boundary/hooks/use-boundary-presence.ts +7 -5
  250. package/src/shared/components/boundary/hooks/use-initial-destination-measurement.ts +27 -11
  251. package/src/shared/components/boundary/hooks/use-initial-source-measurement.ts +5 -5
  252. package/src/shared/components/boundary/hooks/use-measurer.ts +11 -14
  253. package/src/shared/components/boundary/hooks/use-refresh-boundary.ts +5 -5
  254. package/src/shared/components/boundary/index.tsx +2 -2
  255. package/src/shared/components/boundary/portal/components/portal.tsx +3 -3
  256. package/src/shared/components/boundary/portal/resolve-portal.ts +40 -0
  257. package/src/shared/components/boundary/providers/{boundary-owner.provider.tsx → boundary-root.provider.tsx} +27 -32
  258. package/src/shared/components/boundary/utils/destination-signals.ts +53 -2
  259. package/src/shared/components/create-transition-aware-component.tsx +3 -25
  260. package/src/shared/components/overlay/variations/float-overlay.tsx +3 -3
  261. package/src/shared/components/screen-container/layers/backdrop.tsx +4 -17
  262. package/src/shared/components/screen-container/layers/content.tsx +4 -16
  263. package/src/shared/components/screen-container/layers/maybe-masked-navigation-container.tsx +8 -18
  264. package/src/shared/components/screen-container/layers/surface-container.tsx +4 -17
  265. package/src/shared/providers/screen/animation/helpers/pipeline.ts +250 -68
  266. package/src/shared/providers/screen/screen-composer.tsx +3 -3
  267. package/src/shared/providers/screen/styles/helpers/opening-phase.ts +25 -0
  268. package/src/shared/providers/screen/styles/helpers/resolve-slot-styles/index.ts +8 -10
  269. package/src/shared/providers/screen/styles/helpers/resolve-slot-styles/materialize-slot.ts +0 -1
  270. package/src/shared/providers/screen/styles/helpers/resolve-slot-styles/slot-state.ts +0 -24
  271. package/src/shared/providers/screen/styles/helpers/visibility-gate.ts +0 -12
  272. package/src/shared/providers/screen/styles/hooks/use-interpolated-style-maps.tsx +29 -37
  273. package/src/shared/providers/screen/styles/hooks/use-maybe-block-visibility.tsx +0 -18
  274. package/src/shared/providers/screen/styles/hooks/use-resolved-slot-style-map.tsx +17 -4
  275. package/src/shared/providers/screen/styles/index.tsx +8 -4
  276. package/src/shared/providers/screen/styles/slot.provider.tsx +111 -0
  277. package/src/shared/stores/bounds/helpers/link-pairs.helpers.ts +17 -0
  278. package/src/shared/stores/bounds/types.ts +14 -0
  279. package/src/shared/utils/bounds/navigation/zoom/build.ts +9 -1
  280. package/src/shared/utils/bounds/navigation/zoom/helpers.ts +96 -0
  281. package/src/shared/utils/logger.ts +12 -0
  282. package/lib/commonjs/shared/components/boundary/providers/boundary-owner.provider.js.map +0 -1
  283. package/lib/commonjs/shared/providers/screen/styles/helpers/preserve-animated-props-only.js +0 -26
  284. package/lib/commonjs/shared/providers/screen/styles/helpers/preserve-animated-props-only.js.map +0 -1
  285. package/lib/commonjs/shared/providers/screen/styles/styles.provider.js +0 -61
  286. package/lib/commonjs/shared/providers/screen/styles/styles.provider.js.map +0 -1
  287. package/lib/module/shared/components/boundary/providers/boundary-owner.provider.js.map +0 -1
  288. package/lib/module/shared/providers/screen/styles/helpers/preserve-animated-props-only.js +0 -21
  289. package/lib/module/shared/providers/screen/styles/helpers/preserve-animated-props-only.js.map +0 -1
  290. package/lib/module/shared/providers/screen/styles/styles.provider.js +0 -53
  291. package/lib/module/shared/providers/screen/styles/styles.provider.js.map +0 -1
  292. package/lib/typescript/shared/components/boundary/providers/boundary-owner.provider.d.ts.map +0 -1
  293. package/lib/typescript/shared/providers/screen/styles/helpers/preserve-animated-props-only.d.ts +0 -3
  294. package/lib/typescript/shared/providers/screen/styles/helpers/preserve-animated-props-only.d.ts.map +0 -1
  295. package/lib/typescript/shared/providers/screen/styles/styles.provider.d.ts +0 -14
  296. package/lib/typescript/shared/providers/screen/styles/styles.provider.d.ts.map +0 -1
  297. package/src/shared/providers/screen/styles/helpers/preserve-animated-props-only.ts +0 -22
  298. package/src/shared/providers/screen/styles/styles.provider.tsx +0 -60
@@ -1,6 +1,6 @@
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
4
  import type {
5
5
  NormalizedTransitionInterpolatedStyle,
6
6
  ScreenStyleInterpolator,
@@ -13,13 +13,13 @@ import { useBuildTransitionAccessor } from "../../animation/helpers/accessors/us
13
13
  import type { ScreenInterpolatorFrame } from "../../animation/helpers/pipeline";
14
14
  import { readScreenAnimationRevisions } from "../../animation/helpers/read-screen-animation-revisions";
15
15
  import { syncSelectedInterpolatorOptions } from "../../animation/helpers/selected-interpolator-options";
16
- import { useDescriptorDerivations } from "../../descriptors";
16
+ import { useDescriptorsStore } from "../../descriptors";
17
17
  import {
18
18
  syncScreenOptionsOverrides,
19
19
  useScreenOptionsContext,
20
20
  } from "../../options";
21
21
  import { normalizeSlots } from "../helpers/normalize-slots";
22
- import { preserveAnimatedPropsOnly } from "../helpers/preserve-animated-props-only";
22
+ import { isOpeningBeforeStart } from "../helpers/opening-phase";
23
23
  import type { LocalStyleLayers } from "../helpers/resolve-slot-styles";
24
24
  import { stripInterpolatorOptions } from "../helpers/strip-interpolator-options";
25
25
 
@@ -37,12 +37,10 @@ type RunInterpolatorParams = {
37
37
  next: ScreenInterpolatorFrame["next"];
38
38
  bounds: Parameters<ScreenStyleInterpolator>[0]["bounds"];
39
39
  transition: Parameters<ScreenStyleInterpolator>[0]["transition"];
40
- shouldDeferStyleBuckets: boolean;
41
40
  };
42
41
 
43
42
  const normalizeRawStyleMap = (
44
43
  rawStyleMap: TransitionInterpolatedStyle | undefined,
45
- shouldDeferStyleBuckets: boolean,
46
44
  ) => {
47
45
  "worklet";
48
46
 
@@ -52,9 +50,7 @@ const normalizeRawStyleMap = (
52
50
 
53
51
  const stylesMap = normalizeSlots(stripInterpolatorOptions(rawStyleMap));
54
52
 
55
- return shouldDeferStyleBuckets
56
- ? preserveAnimatedPropsOnly(stylesMap)
57
- : stylesMap;
53
+ return stylesMap;
58
54
  };
59
55
 
60
56
  const runInterpolator = ({
@@ -64,7 +60,6 @@ const runInterpolator = ({
64
60
  next,
65
61
  bounds,
66
62
  transition,
67
- shouldDeferStyleBuckets,
68
63
  }: RunInterpolatorParams): InterpolatorResult | undefined => {
69
64
  "worklet";
70
65
 
@@ -86,7 +81,7 @@ const runInterpolator = ({
86
81
 
87
82
  return {
88
83
  rawStyleMap,
89
- stylesMap: normalizeRawStyleMap(rawStyleMap, shouldDeferStyleBuckets),
84
+ stylesMap: normalizeRawStyleMap(rawStyleMap),
90
85
  };
91
86
  } catch (_) {
92
87
  if (__DEV__) {
@@ -124,17 +119,15 @@ const appendLayer = (
124
119
  * normal interpolator selection once the gesture-driven close is no longer in
125
120
  * play.
126
121
  *
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
122
  * The result is ordered from lowest to highest priority. Resolution happens
133
123
  * downstream, where slot ids determine whether slots inherit from ancestors and
134
124
  * where higher owner layers override lower owner layers per key.
135
125
  */
136
126
  export const useInterpolatedStylesMap = () => {
137
- const { currentScreenKey } = useDescriptorDerivations();
127
+ const currentScreenKey = useDescriptorsStore(
128
+ (s) => s.derivations.currentScreenKey,
129
+ );
130
+ const nextScreenKey = useDescriptorsStore((s) => s.derivations.nextScreenKey);
138
131
  const screenOptions = useScreenOptionsContext();
139
132
  const {
140
133
  screenInterpolatorProps,
@@ -147,10 +140,11 @@ export const useInterpolatedStylesMap = () => {
147
140
  } = useScreenAnimationContext();
148
141
  const boundsAccessor = useBuildBoundsAccessor();
149
142
  const transition = useBuildTransitionAccessor();
150
- const pendingLifecycleStartBlockCount = SystemStore.getValue(
151
- currentScreenKey,
152
- "pendingLifecycleStartBlockCount",
153
- );
143
+
144
+ const {
145
+ entering: activeEntering,
146
+ transitionProgress: activeTransitionProgress,
147
+ } = AnimationStore.getBag(nextScreenKey ?? currentScreenKey);
154
148
 
155
149
  const isGesturingDuringCloseAnimation = useSharedValue(false);
156
150
 
@@ -163,19 +157,6 @@ export const useInterpolatedStylesMap = () => {
163
157
  );
164
158
  const props = screenInterpolatorProps.get();
165
159
 
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
160
  const { current, next, progress } = props;
180
161
  const isDragging = current.gesture.dragging;
181
162
  const isNextClosing = !!next?.closing;
@@ -194,8 +175,21 @@ export const useInterpolatedStylesMap = () => {
194
175
  const isInGestureMode =
195
176
  !!isDragging || isGesturingDuringCloseAnimation.get();
196
177
 
197
- const interpolatorOptionsOwner =
198
- isInGestureMode || !nextInterpolator ? "current" : "next";
178
+ // The current screen keeps interpolator ownership until the next screen is
179
+ // genuinely live: never during a gesture-driven close, never before a next
180
+ // interpolator exists, and never in the next screen's pre-start window
181
+ // (entering, but no transformed frame yet). Only then does "next" take over.
182
+ const currentOwnsInterpolator =
183
+ isInGestureMode ||
184
+ !nextInterpolator ||
185
+ isOpeningBeforeStart(
186
+ activeEntering.get(),
187
+ activeTransitionProgress.get(),
188
+ );
189
+
190
+ const interpolatorOptionsOwner = currentOwnsInterpolator
191
+ ? "current"
192
+ : "next";
199
193
 
200
194
  let selectedProgress = progress;
201
195
  let selectedNext = next;
@@ -212,7 +206,6 @@ export const useInterpolatedStylesMap = () => {
212
206
  next: selectedNext,
213
207
  bounds: boundsAccessor,
214
208
  transition,
215
- shouldDeferStyleBuckets,
216
209
  });
217
210
 
218
211
  if (interpolatorOptionsOwner === "current") {
@@ -237,7 +230,6 @@ export const useInterpolatedStylesMap = () => {
237
230
  next: selectedNext,
238
231
  bounds: boundsAccessor,
239
232
  transition,
240
- shouldDeferStyleBuckets,
241
233
  });
242
234
 
243
235
  syncSelectedInterpolatorOptions(
@@ -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,9 @@
1
1
  export {
2
- ScreenStylesContext,
3
- ScreenStylesProvider,
4
- useScreenStyles,
5
- } from "./styles.provider";
2
+ ScreenSlotContext,
3
+ type ScreenSlotName,
4
+ ScreenSlotProvider,
5
+ useScreenSlots,
6
+ useSlotProps,
7
+ useSlotStackingStyles,
8
+ useSlotStyles,
9
+ } from "./slot.provider";
@@ -0,0 +1,111 @@
1
+ import { type ReactNode, useContext } from "react";
2
+ import { StyleSheet } from "react-native";
3
+ import Animated, {
4
+ type SharedValue,
5
+ useAnimatedProps,
6
+ useAnimatedStyle,
7
+ } from "react-native-reanimated";
8
+ import {
9
+ type NAVIGATION_MASK_CONTAINER_STYLE_ID,
10
+ type NAVIGATION_MASK_ELEMENT_STYLE_ID,
11
+ NO_PROPS,
12
+ NO_STYLES,
13
+ } from "../../../constants";
14
+ import type { NormalizedTransitionInterpolatedStyle } from "../../../types/animation.types";
15
+ import createProvider from "../../../utils/create-provider";
16
+ import { FloatingOverlayLayer } from "./components/floating-overlay-layer";
17
+ import { useInterpolatedStylesMap } from "./hooks/use-interpolated-style-maps";
18
+ import { useMaybeBlockVisibility } from "./hooks/use-maybe-block-visibility";
19
+ import { useResolvedStylesMap } from "./hooks/use-resolved-slot-style-map";
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
+ type ScreenSlotContextValue = {
34
+ slotsMap: SharedValue<NormalizedTransitionInterpolatedStyle>;
35
+ };
36
+
37
+ export const {
38
+ ScreenSlotProvider,
39
+ ScreenSlotContext,
40
+ useScreenSlotContext: useScreenSlots,
41
+ } = createProvider("ScreenSlot", {
42
+ guarded: true,
43
+ })<Props, ScreenSlotContextValue>(({ children, isFloatingOverlay }) => {
44
+ const parentContext = useContext(ScreenSlotContext);
45
+
46
+ const rawStylesMaps = useInterpolatedStylesMap();
47
+
48
+ const slotsMap = useResolvedStylesMap({
49
+ localStylesMaps: rawStylesMaps,
50
+ ancestorStylesMap: parentContext?.slotsMap,
51
+ });
52
+ const { animatedStyle, animatedProps } =
53
+ useMaybeBlockVisibility(isFloatingOverlay);
54
+
55
+ return {
56
+ value: {
57
+ slotsMap,
58
+ },
59
+ children: (
60
+ <FloatingOverlayLayer enabled={isFloatingOverlay}>
61
+ <Animated.View
62
+ style={[styles.container, animatedStyle]}
63
+ animatedProps={animatedProps}
64
+ >
65
+ {children}
66
+ </Animated.View>
67
+ </FloatingOverlayLayer>
68
+ ),
69
+ };
70
+ });
71
+
72
+ const styles = StyleSheet.create({
73
+ container: { flex: 1 },
74
+ });
75
+
76
+ export const useSlotStyles = (slotId: string | undefined) => {
77
+ const { slotsMap } = useScreenSlots();
78
+
79
+ return useAnimatedStyle(() => {
80
+ return (slotId ? slotsMap.get()[slotId]?.style : undefined) ?? NO_STYLES;
81
+ });
82
+ };
83
+
84
+ /**
85
+ * Stacking-only slice (`zIndex`/`elevation`) of a slot's style. Returned
86
+ * separately so an owner can keep just its stacking context while a nested
87
+ * target takes the full associated style. Yields `NO_STYLES` when neither is set.
88
+ */
89
+ export const useSlotStackingStyles = (slotId: string | undefined) => {
90
+ const { slotsMap } = useScreenSlots();
91
+
92
+ return useAnimatedStyle(() => {
93
+ const baseStyle = slotId ? slotsMap.get()[slotId]?.style : undefined;
94
+ const zIndex = baseStyle?.zIndex ?? 0;
95
+ const elevation = baseStyle?.elevation ?? 0;
96
+
97
+ if (zIndex === 0 && elevation === 0) {
98
+ return NO_STYLES;
99
+ }
100
+
101
+ return { zIndex, elevation };
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,4 +1,5 @@
1
1
  import type {
2
+ BoundTag,
2
3
  GroupKey,
3
4
  LinkGroupState,
4
5
  LinkKey,
@@ -66,6 +67,22 @@ export const createGroupTag = (group: GroupKey, linkKey: LinkKey): string => {
66
67
  return `${group}:${linkKey}`;
67
68
  };
68
69
 
70
+ /**
71
+ * Builds the {@link BoundTag} identity for a boundary. The combined `tag` is
72
+ * group-prefixed only when a group is present, matching how links are keyed.
73
+ */
74
+ export const createBoundTag = (
75
+ linkKey: LinkKey,
76
+ group?: GroupKey,
77
+ ): BoundTag => {
78
+ "worklet";
79
+ return {
80
+ tag: group ? createGroupTag(group, linkKey) : linkKey,
81
+ linkKey,
82
+ group,
83
+ };
84
+ };
85
+
69
86
  const ensurePairState = (
70
87
  state: LinkPairsState,
71
88
  pairKey: ScreenPairKey,
@@ -10,6 +10,20 @@ export type TagID = string;
10
10
  export type LinkKey = string;
11
11
  export type GroupKey = string;
12
12
  export type ScreenPairKey = string;
13
+
14
+ /**
15
+ * A boundary's identity, carried as one value instead of the
16
+ * `{ tag, linkKey, group }` clump that used to thread through every hook.
17
+ *
18
+ * - `tag`: the combined entry tag (`group:linkKey` when grouped, else `linkKey`).
19
+ * - `linkKey`: the bare member key used to address links within a screen pair.
20
+ * - `group`: the optional collection name.
21
+ */
22
+ export interface BoundTag {
23
+ tag: string;
24
+ linkKey: LinkKey;
25
+ group?: GroupKey;
26
+ }
13
27
  export type BoundsPortalAttachTarget = "current-screen" | "matched-screen";
14
28
  export type { ScreenKey } from "../../types/screen.types";
15
29
 
@@ -33,6 +33,7 @@ import {
33
33
  resolveBackgroundScale,
34
34
  resolveDragScaleTuple,
35
35
  resolveDragTranslationTuple,
36
+ resolveZoomPanGestureDirection,
36
37
  } from "./helpers";
37
38
  import { resolveDirectionalDragTranslation } from "./math";
38
39
  import type { BuildZoomStylesParams, ZoomInterpolatedStyle } from "./types";
@@ -139,7 +140,14 @@ export function buildZoomStyles({
139
140
  const gestureHandoff = liveGesture.handoff;
140
141
  const normX = gestureHandoff.normX;
141
142
  const normY = gestureHandoff.normY;
142
- const initialGesture = gestureHandoff.active ?? gestureHandoff.direction;
143
+ const initialGesture = resolveZoomPanGestureDirection({
144
+ active: gestureHandoff.active,
145
+ direction: gestureHandoff.direction,
146
+ normX,
147
+ normY,
148
+ rawNormX: gestureHandoff.raw.normX,
149
+ rawNormY: gestureHandoff.raw.normY,
150
+ });
143
151
  const isHorizontalDismiss =
144
152
  initialGesture === "horizontal" || initialGesture === "horizontal-inverted";
145
153
  const isVerticalDismiss =
@@ -1,5 +1,10 @@
1
1
  import { interpolate } from "react-native-reanimated";
2
+ import { EPSILON } from "../../../../constants";
2
3
  import type { BoundsLink } from "../../../../types/bounds.types";
4
+ import type {
5
+ ActiveGesture,
6
+ ResolvedPanGestureDirection,
7
+ } from "../../../../types/gesture.types";
3
8
  import type { Layout } from "../../../../types/screen.types";
4
9
  import type { BoundsOptions } from "../../types/options";
5
10
  import {
@@ -94,6 +99,97 @@ export function resolveBackgroundScale(value: number | undefined) {
94
99
  return value ?? ZOOM_BACKGROUND_SCALE;
95
100
  }
96
101
 
102
+ const isResolvedPanDirection = (
103
+ direction: ActiveGesture | null | undefined,
104
+ ): direction is ResolvedPanGestureDirection => {
105
+ "worklet";
106
+ return (
107
+ direction === "horizontal" ||
108
+ direction === "horizontal-inverted" ||
109
+ direction === "vertical" ||
110
+ direction === "vertical-inverted"
111
+ );
112
+ };
113
+
114
+ const resolveMotionDirection = ({
115
+ normX,
116
+ normY,
117
+ rawNormX,
118
+ rawNormY,
119
+ }: {
120
+ normX: number;
121
+ normY: number;
122
+ rawNormX: number;
123
+ rawNormY: number;
124
+ }): ResolvedPanGestureDirection | null => {
125
+ "worklet";
126
+ const motionX = Math.max(Math.abs(normX), Math.abs(rawNormX));
127
+ const motionY = Math.max(Math.abs(normY), Math.abs(rawNormY));
128
+
129
+ if (motionX <= EPSILON && motionY <= EPSILON) {
130
+ return null;
131
+ }
132
+
133
+ if (motionY > motionX + EPSILON) {
134
+ return normY < 0 || rawNormY < 0 ? "vertical-inverted" : "vertical";
135
+ }
136
+
137
+ if (motionX > motionY + EPSILON) {
138
+ return normX < 0 || rawNormX < 0 ? "horizontal-inverted" : "horizontal";
139
+ }
140
+
141
+ return null;
142
+ };
143
+
144
+ export function resolveZoomPanGestureDirection({
145
+ active,
146
+ direction,
147
+ normX,
148
+ normY,
149
+ rawNormX,
150
+ rawNormY,
151
+ }: {
152
+ active: ActiveGesture | null | undefined;
153
+ direction: ActiveGesture | null | undefined;
154
+ normX: number;
155
+ normY: number;
156
+ rawNormX: number;
157
+ rawNormY: number;
158
+ }): ResolvedPanGestureDirection | null {
159
+ "worklet";
160
+ const storedDirection = active ?? direction;
161
+ const motionDirection = resolveMotionDirection({
162
+ normX,
163
+ normY,
164
+ rawNormX,
165
+ rawNormY,
166
+ });
167
+
168
+ if (!isResolvedPanDirection(storedDirection)) {
169
+ return motionDirection;
170
+ }
171
+
172
+ if (!motionDirection) {
173
+ return storedDirection;
174
+ }
175
+
176
+ const storedIsHorizontal =
177
+ storedDirection === "horizontal" ||
178
+ storedDirection === "horizontal-inverted";
179
+ const storedMotion = storedIsHorizontal
180
+ ? Math.max(Math.abs(normX), Math.abs(rawNormX))
181
+ : Math.max(Math.abs(normY), Math.abs(rawNormY));
182
+ const oppositeMotion = storedIsHorizontal
183
+ ? Math.max(Math.abs(normY), Math.abs(rawNormY))
184
+ : Math.max(Math.abs(normX), Math.abs(rawNormX));
185
+
186
+ if (oppositeMotion > storedMotion + EPSILON) {
187
+ return motionDirection;
188
+ }
189
+
190
+ return storedDirection;
191
+ }
192
+
97
193
  export function interpolateOpacityRange(params: {
98
194
  progress: number;
99
195
  range: {
@@ -1,5 +1,7 @@
1
1
  const LIBRARY_NAME = "react-native-screen-transitions";
2
2
 
3
+ const warnedKeys = new Set<string>();
4
+
3
5
  export const logger = {
4
6
  error(message: string) {
5
7
  "worklet";
@@ -9,4 +11,14 @@ export const logger = {
9
11
  "worklet";
10
12
  console.warn(`[${LIBRARY_NAME}] ${message}`);
11
13
  },
14
+ /**
15
+ * Warns at most once per `key` for the lifetime of the JS context. Use for
16
+ * install/config-level conditions that would otherwise spam every render or
17
+ * every mounted instance. JS-thread only (not a worklet).
18
+ */
19
+ warnOnce(key: string, message: string) {
20
+ if (warnedKeys.has(key)) return;
21
+ warnedKeys.add(key);
22
+ console.warn(`[${LIBRARY_NAME}] ${message}`);
23
+ },
12
24
  };
@@ -1 +0,0 @@
1
- {"version":3,"names":["_react","require","_createProvider","_interopRequireDefault","_logger","e","__esModule","default","MULTIPLE_TARGETS_WARNING","TARGET_OUTSIDE_OWNER_WARNING","exports","BoundaryOwnerProvider","useBoundaryOwnerContext","createProvider","guarded","props","useBoundaryOwner","params","ownerRef","associatedTargetStyles","entryTag","portal","warnedAboutMultipleTargetsRef","useRef","targetEntry","setTargetEntry","useState","registerTargetRef","useCallback","targetRef","preparedStyles","measurementRef","prev","ref","__DEV__","current","logger","warn","unregisterTargetRef","contextValue","useMemo","activeTargetRef","hasActiveTarget","measuredRef","targetPreparedStyles"],"sourceRoot":"../../../../../../src","sources":["shared/components/boundary/providers/boundary-owner.provider.tsx"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AAIA,IAAAC,eAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AAA+C,SAAAE,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AA4B/C;AACA,MAAMG,wBAAwB,GAC7B,8HAA8H;AAExH,MAAMC,4BAA4B,GAAAC,OAAA,CAAAD,4BAAA,GACxC,gJAAgJ;AAO1I,MAAM;EAAEE,qBAAqB;EAAEC;AAAwB,CAAC,GAC9D,IAAAC,uBAAc,EAAC,eAAe,EAAE;EAAEC,OAAO,EAAE;AAAM,CAAC,CAAC,CAGhDC,KAAK,IAAKA,KAAK,CAAC;AAACL,OAAA,CAAAE,uBAAA,GAAAA,uBAAA;AAAAF,OAAA,CAAAC,qBAAA,GAAAA,qBAAA;AAEd,MAAMK,gBAAgB,GAAIC,MAKhC,IAAK;EACL,MAAM;IAAEC,QAAQ;IAAEC,sBAAsB;IAAEC,QAAQ;IAAEC;EAAO,CAAC,GAAGJ,MAAM;EACrE,MAAMK,6BAA6B,GAAG,IAAAC,aAAM,EAAC,KAAK,CAAC;EACnD,MAAM,CAACC,WAAW,EAAEC,cAAc,CAAC,GAAG,IAAAC,eAAQ,EAC7C,IACD,CAAC;EAED,MAAMC,iBAAiB,GAAG,IAAAC,kBAAW,EACpC,CACCC,SAA4B,EAC5BC,cAA0B,EAC1BC,cAAkC,KAC9B;IACJN,cAAc,CAAEO,IAAI,IAAK;MACxB,IAAIA,IAAI,EAAEC,GAAG,KAAKJ,SAAS,EAAE;QAC5B,OAAOG,IAAI;MACZ;MAEA,IACCE,OAAO,IACPF,IAAI,KAAK,IAAI,IACb,CAACV,6BAA6B,CAACa,OAAO,EACrC;QACDb,6BAA6B,CAACa,OAAO,GAAG,IAAI;QAC5CC,cAAM,CAACC,IAAI,CAAC7B,wBAAwB,CAAC;MACtC;MAEA,OACCwB,IAAI,IAAI;QACPC,GAAG,EAAEJ,SAAS;QACdE,cAAc,EAAEA,cAAc,IAAIF,SAAS;QAC3CC;MACD,CAAC;IAEH,CAAC,CAAC;EACH,CAAC,EACD,EACD,CAAC;EAED,MAAMQ,mBAAmB,GAAG,IAAAV,kBAAW,EAAEC,SAA4B,IAAK;IACzEJ,cAAc,CAAEO,IAAI,IAAMA,IAAI,EAAEC,GAAG,KAAKJ,SAAS,GAAG,IAAI,GAAGG,IAAK,CAAC;EAClE,CAAC,EAAE,EAAE,CAAC;EAEN,MAAMO,YAAY,GAAG,IAAAC,cAAO,EAC3B,OAAO;IACNtB,QAAQ;IACRS,iBAAiB;IACjBW,mBAAmB;IACnBG,eAAe,EAAEjB,WAAW,EAAES,GAAG,IAAI,IAAI;IACzCd,sBAAsB;IACtBC,QAAQ;IACRC;EACD,CAAC,CAAC,EACF,CACCH,QAAQ,EACRS,iBAAiB,EACjBW,mBAAmB,EACnBd,WAAW,EACXL,sBAAsB,EACtBC,QAAQ,EACRC,MAAM,CAER,CAAC;EAED,OAAO;IACNkB,YAAY;IACZG,eAAe,EAAElB,WAAW,KAAK,IAAI;IACrCmB,WAAW,EAAEnB,WAAW,EAAEO,cAAc,IAAIb,QAAQ;IACpD0B,oBAAoB,EAAEpB,WAAW,EAAEM,cAAc;IACjDT;EACD,CAAC;AACF,CAAC;AAACX,OAAA,CAAAM,gBAAA,GAAAA,gBAAA","ignoreList":[]}
@@ -1,26 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.preserveAnimatedPropsOnly = void 0;
7
- var _constants = require("../../../../constants");
8
- const preserveAnimatedPropsOnly = stylesMap => {
9
- "worklet";
10
-
11
- let hasProps = false;
12
- const propsOnly = {};
13
- for (const slotId in stylesMap) {
14
- const slot = stylesMap[slotId];
15
- if (!slot || slot.props === undefined) {
16
- continue;
17
- }
18
- propsOnly[slotId] = {
19
- props: slot.props
20
- };
21
- hasProps = true;
22
- }
23
- return hasProps ? propsOnly : _constants.NO_STYLES;
24
- };
25
- exports.preserveAnimatedPropsOnly = preserveAnimatedPropsOnly;
26
- //# sourceMappingURL=preserve-animated-props-only.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_constants","require","preserveAnimatedPropsOnly","stylesMap","hasProps","propsOnly","slotId","slot","props","undefined","NO_STYLES","exports"],"sourceRoot":"../../../../../../../src","sources":["shared/providers/screen/styles/helpers/preserve-animated-props-only.ts"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAGO,MAAMC,yBAAyB,GACrCC,SAAgD,IACL;EAC3C,SAAS;;EACT,IAAIC,QAAQ,GAAG,KAAK;EACpB,MAAMC,SAAgD,GAAG,CAAC,CAAC;EAE3D,KAAK,MAAMC,MAAM,IAAIH,SAAS,EAAE;IAC/B,MAAMI,IAAI,GAAGJ,SAAS,CAACG,MAAM,CAAC;IAC9B,IAAI,CAACC,IAAI,IAAIA,IAAI,CAACC,KAAK,KAAKC,SAAS,EAAE;MACtC;IACD;IAEAJ,SAAS,CAACC,MAAM,CAAC,GAAG;MAAEE,KAAK,EAAED,IAAI,CAACC;IAAM,CAAC;IACzCJ,QAAQ,GAAG,IAAI;EAChB;EAEA,OAAOA,QAAQ,GAAGC,SAAS,GAAGK,oBAAS;AACxC,CAAC;AAACC,OAAA,CAAAT,yBAAA,GAAAA,yBAAA","ignoreList":[]}
@@ -1,61 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.useScreenStyles = exports.ScreenStylesProvider = exports.ScreenStylesContext = void 0;
7
- var _react = require("react");
8
- var _reactNative = require("react-native");
9
- var _reactNativeReanimated = _interopRequireDefault(require("react-native-reanimated"));
10
- var _createProvider = _interopRequireDefault(require("../../../utils/create-provider"));
11
- var _floatingOverlayLayer = require("./components/floating-overlay-layer");
12
- var _useInterpolatedStyleMaps = require("./hooks/use-interpolated-style-maps");
13
- var _useMaybeBlockVisibility = require("./hooks/use-maybe-block-visibility");
14
- var _useResolvedSlotStyleMap = require("./hooks/use-resolved-slot-style-map");
15
- var _jsxRuntime = require("react/jsx-runtime");
16
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
17
- const {
18
- ScreenStylesProvider,
19
- ScreenStylesContext,
20
- useScreenStylesContext: useScreenStyles
21
- } = (0, _createProvider.default)("ScreenStyles", {
22
- guarded: true
23
- })(({
24
- children,
25
- isFloatingOverlay
26
- }) => {
27
- const parentContext = (0, _react.useContext)(ScreenStylesContext);
28
- const rawStylesMaps = (0, _useInterpolatedStyleMaps.useInterpolatedStylesMap)();
29
- const {
30
- animatedStyle,
31
- animatedProps,
32
- shouldBlockVisibility
33
- } = (0, _useMaybeBlockVisibility.useMaybeBlockVisibility)(isFloatingOverlay);
34
- const stylesMap = (0, _useResolvedSlotStyleMap.useResolvedStylesMap)({
35
- localStylesMaps: rawStylesMaps,
36
- ancestorStylesMap: parentContext?.stylesMap
37
- });
38
- return {
39
- value: {
40
- stylesMap,
41
- shouldBlockVisibility
42
- },
43
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_floatingOverlayLayer.FloatingOverlayLayer, {
44
- enabled: isFloatingOverlay,
45
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeReanimated.default.View, {
46
- style: [styles.container, animatedStyle],
47
- animatedProps: animatedProps,
48
- children: children
49
- })
50
- })
51
- };
52
- });
53
- exports.useScreenStyles = useScreenStyles;
54
- exports.ScreenStylesContext = ScreenStylesContext;
55
- exports.ScreenStylesProvider = ScreenStylesProvider;
56
- const styles = _reactNative.StyleSheet.create({
57
- container: {
58
- flex: 1
59
- }
60
- });
61
- //# sourceMappingURL=styles.provider.js.map