react-native-screen-transitions 3.4.0-alpha.1 → 3.4.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 (297) hide show
  1. package/README.md +11 -1109
  2. package/lib/commonjs/blank-stack/navigators/create-blank-stack-navigator.js +69 -2
  3. package/lib/commonjs/blank-stack/navigators/create-blank-stack-navigator.js.map +1 -1
  4. package/lib/commonjs/component-stack/navigators/create-component-stack-navigator.js +9 -0
  5. package/lib/commonjs/component-stack/navigators/create-component-stack-navigator.js.map +1 -1
  6. package/lib/commonjs/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js +195 -0
  7. package/lib/commonjs/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js.map +1 -0
  8. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-auto-source-measurement.js +7 -14
  9. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-auto-source-measurement.js.map +1 -1
  10. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.js +19 -18
  11. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.js.map +1 -1
  12. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.js +54 -0
  13. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.js.map +1 -0
  14. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-group-active-measurement.js +40 -8
  15. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-group-active-measurement.js.map +1 -1
  16. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.js +72 -0
  17. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.js.map +1 -0
  18. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-initial-layout-handler.js +16 -7
  19. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-initial-layout-handler.js.map +1 -1
  20. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-pending-destination-measurement.js +7 -4
  21. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-pending-destination-measurement.js.map +1 -1
  22. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.js +14 -15
  23. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.js.map +1 -1
  24. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.js +27 -9
  25. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.js.map +1 -1
  26. package/lib/commonjs/shared/components/create-boundary-component/index.js +23 -10
  27. package/lib/commonjs/shared/components/create-boundary-component/index.js.map +1 -1
  28. package/lib/commonjs/shared/components/create-transition-aware-component.js +4 -4
  29. package/lib/commonjs/shared/components/create-transition-aware-component.js.map +1 -1
  30. package/lib/commonjs/shared/components/native-screen-container.js +12 -6
  31. package/lib/commonjs/shared/components/native-screen-container.js.map +1 -1
  32. package/lib/commonjs/shared/components/native-screen.js +35 -8
  33. package/lib/commonjs/shared/components/native-screen.js.map +1 -1
  34. package/lib/commonjs/shared/components/screen-container/deferred-visibility-host.js +43 -0
  35. package/lib/commonjs/shared/components/screen-container/deferred-visibility-host.js.map +1 -0
  36. package/lib/commonjs/shared/components/screen-container/hooks/use-content-layout.js +60 -0
  37. package/lib/commonjs/shared/components/screen-container/hooks/use-content-layout.js.map +1 -0
  38. package/lib/commonjs/shared/components/screen-container/index.js +7 -4
  39. package/lib/commonjs/shared/components/screen-container/index.js.map +1 -1
  40. package/lib/commonjs/shared/components/screen-container/layers/content.js +32 -48
  41. package/lib/commonjs/shared/components/screen-container/layers/content.js.map +1 -1
  42. package/lib/commonjs/shared/components/screen-container/layers/maybe-masked-navigation-container.js +9 -20
  43. package/lib/commonjs/shared/components/screen-container/layers/maybe-masked-navigation-container.js.map +1 -1
  44. package/lib/commonjs/shared/configs/presets.js +6 -6
  45. package/lib/commonjs/shared/configs/presets.js.map +1 -1
  46. package/lib/commonjs/shared/constants.js +10 -4
  47. package/lib/commonjs/shared/constants.js.map +1 -1
  48. package/lib/commonjs/shared/hooks/animation/use-associated-style.js +9 -34
  49. package/lib/commonjs/shared/hooks/animation/use-associated-style.js.map +1 -1
  50. package/lib/commonjs/shared/index.js +4 -10
  51. package/lib/commonjs/shared/index.js.map +1 -1
  52. package/lib/commonjs/shared/providers/gestures/handlers/use-handlers.js +6 -7
  53. package/lib/commonjs/shared/providers/gestures/handlers/use-handlers.js.map +1 -1
  54. package/lib/commonjs/shared/providers/gestures/helpers/gesture-activation.js +11 -6
  55. package/lib/commonjs/shared/providers/gestures/helpers/gesture-activation.js.map +1 -1
  56. package/lib/commonjs/shared/providers/layout-anchor.provider.js +4 -6
  57. package/lib/commonjs/shared/providers/layout-anchor.provider.js.map +1 -1
  58. package/lib/commonjs/shared/providers/screen/animation/helpers/pipeline.js +14 -7
  59. package/lib/commonjs/shared/providers/screen/animation/helpers/pipeline.js.map +1 -1
  60. package/lib/commonjs/shared/providers/screen/helpers/resolve-interpolated-style-output.js +36 -0
  61. package/lib/commonjs/shared/providers/screen/helpers/resolve-interpolated-style-output.js.map +1 -0
  62. package/lib/commonjs/shared/providers/screen/styles.provider.js +31 -10
  63. package/lib/commonjs/shared/providers/screen/styles.provider.js.map +1 -1
  64. package/lib/commonjs/shared/providers/stack/core.provider.js +14 -21
  65. package/lib/commonjs/shared/providers/stack/core.provider.js.map +1 -1
  66. package/lib/commonjs/shared/stores/animation.store.js +3 -1
  67. package/lib/commonjs/shared/stores/animation.store.js.map +1 -1
  68. package/lib/commonjs/shared/stores/bounds/internals/presence.js.map +1 -1
  69. package/lib/commonjs/shared/utils/bounds/helpers/compute-bounds-styles.js +16 -7
  70. package/lib/commonjs/shared/utils/bounds/helpers/compute-bounds-styles.js.map +1 -1
  71. package/lib/commonjs/shared/utils/bounds/helpers/resolve-bound-tag.js +0 -5
  72. package/lib/commonjs/shared/utils/bounds/helpers/resolve-bound-tag.js.map +1 -1
  73. package/lib/commonjs/shared/utils/bounds/index.js +10 -0
  74. package/lib/commonjs/shared/utils/bounds/index.js.map +1 -1
  75. package/lib/commonjs/shared/utils/bounds/types/frame-props.js +6 -0
  76. package/lib/commonjs/shared/utils/bounds/types/frame-props.js.map +1 -0
  77. package/lib/commonjs/shared/utils/bounds/zoom/build.js +34 -31
  78. package/lib/commonjs/shared/utils/bounds/zoom/build.js.map +1 -1
  79. package/lib/commonjs/shared/utils/resolve-screen-transition-options.js +25 -0
  80. package/lib/commonjs/shared/utils/resolve-screen-transition-options.js.map +1 -0
  81. package/lib/module/blank-stack/navigators/create-blank-stack-navigator.js +69 -3
  82. package/lib/module/blank-stack/navigators/create-blank-stack-navigator.js.map +1 -1
  83. package/lib/module/component-stack/navigators/create-component-stack-navigator.js +9 -0
  84. package/lib/module/component-stack/navigators/create-component-stack-navigator.js.map +1 -1
  85. package/lib/module/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js +182 -0
  86. package/lib/module/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js.map +1 -0
  87. package/lib/module/shared/components/create-boundary-component/hooks/use-auto-source-measurement.js +7 -14
  88. package/lib/module/shared/components/create-boundary-component/hooks/use-auto-source-measurement.js.map +1 -1
  89. package/lib/module/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.js +19 -18
  90. package/lib/module/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.js.map +1 -1
  91. package/lib/module/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.js +49 -0
  92. package/lib/module/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.js.map +1 -0
  93. package/lib/module/shared/components/create-boundary-component/hooks/use-group-active-measurement.js +41 -8
  94. package/lib/module/shared/components/create-boundary-component/hooks/use-group-active-measurement.js.map +1 -1
  95. package/lib/module/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.js +67 -0
  96. package/lib/module/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.js.map +1 -0
  97. package/lib/module/shared/components/create-boundary-component/hooks/use-initial-layout-handler.js +16 -7
  98. package/lib/module/shared/components/create-boundary-component/hooks/use-initial-layout-handler.js.map +1 -1
  99. package/lib/module/shared/components/create-boundary-component/hooks/use-pending-destination-measurement.js +7 -4
  100. package/lib/module/shared/components/create-boundary-component/hooks/use-pending-destination-measurement.js.map +1 -1
  101. package/lib/module/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.js +14 -15
  102. package/lib/module/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.js.map +1 -1
  103. package/lib/module/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.js +27 -9
  104. package/lib/module/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.js.map +1 -1
  105. package/lib/module/shared/components/create-boundary-component/index.js +23 -10
  106. package/lib/module/shared/components/create-boundary-component/index.js.map +1 -1
  107. package/lib/module/shared/components/create-transition-aware-component.js +4 -4
  108. package/lib/module/shared/components/create-transition-aware-component.js.map +1 -1
  109. package/lib/module/shared/components/native-screen-container.js +12 -6
  110. package/lib/module/shared/components/native-screen-container.js.map +1 -1
  111. package/lib/module/shared/components/native-screen.js +35 -8
  112. package/lib/module/shared/components/native-screen.js.map +1 -1
  113. package/lib/module/shared/components/screen-container/deferred-visibility-host.js +38 -0
  114. package/lib/module/shared/components/screen-container/deferred-visibility-host.js.map +1 -0
  115. package/lib/module/shared/components/screen-container/hooks/use-content-layout.js +56 -0
  116. package/lib/module/shared/components/screen-container/hooks/use-content-layout.js.map +1 -0
  117. package/lib/module/shared/components/screen-container/index.js +7 -4
  118. package/lib/module/shared/components/screen-container/index.js.map +1 -1
  119. package/lib/module/shared/components/screen-container/layers/content.js +37 -53
  120. package/lib/module/shared/components/screen-container/layers/content.js.map +1 -1
  121. package/lib/module/shared/components/screen-container/layers/maybe-masked-navigation-container.js +10 -21
  122. package/lib/module/shared/components/screen-container/layers/maybe-masked-navigation-container.js.map +1 -1
  123. package/lib/module/shared/configs/presets.js +7 -7
  124. package/lib/module/shared/configs/presets.js.map +1 -1
  125. package/lib/module/shared/constants.js +9 -3
  126. package/lib/module/shared/constants.js.map +1 -1
  127. package/lib/module/shared/hooks/animation/use-associated-style.js +10 -35
  128. package/lib/module/shared/hooks/animation/use-associated-style.js.map +1 -1
  129. package/lib/module/shared/index.js +1 -1
  130. package/lib/module/shared/index.js.map +1 -1
  131. package/lib/module/shared/providers/gestures/handlers/use-handlers.js +6 -7
  132. package/lib/module/shared/providers/gestures/handlers/use-handlers.js.map +1 -1
  133. package/lib/module/shared/providers/gestures/helpers/gesture-activation.js +11 -6
  134. package/lib/module/shared/providers/gestures/helpers/gesture-activation.js.map +1 -1
  135. package/lib/module/shared/providers/layout-anchor.provider.js +4 -6
  136. package/lib/module/shared/providers/layout-anchor.provider.js.map +1 -1
  137. package/lib/module/shared/providers/screen/animation/helpers/pipeline.js +14 -7
  138. package/lib/module/shared/providers/screen/animation/helpers/pipeline.js.map +1 -1
  139. package/lib/module/shared/providers/screen/helpers/resolve-interpolated-style-output.js +31 -0
  140. package/lib/module/shared/providers/screen/helpers/resolve-interpolated-style-output.js.map +1 -0
  141. package/lib/module/shared/providers/screen/styles.provider.js +30 -11
  142. package/lib/module/shared/providers/screen/styles.provider.js.map +1 -1
  143. package/lib/module/shared/providers/stack/core.provider.js +14 -21
  144. package/lib/module/shared/providers/stack/core.provider.js.map +1 -1
  145. package/lib/module/shared/stores/animation.store.js +3 -1
  146. package/lib/module/shared/stores/animation.store.js.map +1 -1
  147. package/lib/module/shared/stores/bounds/internals/presence.js.map +1 -1
  148. package/lib/module/shared/utils/bounds/helpers/compute-bounds-styles.js +17 -8
  149. package/lib/module/shared/utils/bounds/helpers/compute-bounds-styles.js.map +1 -1
  150. package/lib/module/shared/utils/bounds/helpers/resolve-bound-tag.js +0 -5
  151. package/lib/module/shared/utils/bounds/helpers/resolve-bound-tag.js.map +1 -1
  152. package/lib/module/shared/utils/bounds/index.js +10 -0
  153. package/lib/module/shared/utils/bounds/index.js.map +1 -1
  154. package/lib/module/shared/utils/bounds/types/frame-props.js +4 -0
  155. package/lib/module/shared/utils/bounds/types/frame-props.js.map +1 -0
  156. package/lib/module/shared/utils/bounds/zoom/build.js +35 -32
  157. package/lib/module/shared/utils/bounds/zoom/build.js.map +1 -1
  158. package/lib/module/shared/utils/resolve-screen-transition-options.js +19 -0
  159. package/lib/module/shared/utils/resolve-screen-transition-options.js.map +1 -0
  160. package/lib/typescript/blank-stack/index.d.ts +1 -1
  161. package/lib/typescript/blank-stack/index.d.ts.map +1 -1
  162. package/lib/typescript/blank-stack/navigators/create-blank-stack-navigator.d.ts +29 -4
  163. package/lib/typescript/blank-stack/navigators/create-blank-stack-navigator.d.ts.map +1 -1
  164. package/lib/typescript/blank-stack/types.d.ts +33 -4
  165. package/lib/typescript/blank-stack/types.d.ts.map +1 -1
  166. package/lib/typescript/component-stack/navigators/create-component-stack-navigator.d.ts +8 -0
  167. package/lib/typescript/component-stack/navigators/create-component-stack-navigator.d.ts.map +1 -1
  168. package/lib/typescript/shared/components/create-boundary-component/hooks/helpers/measurement-rules.d.ts +81 -0
  169. package/lib/typescript/shared/components/create-boundary-component/hooks/helpers/measurement-rules.d.ts.map +1 -0
  170. package/lib/typescript/shared/components/create-boundary-component/hooks/use-auto-source-measurement.d.ts.map +1 -1
  171. package/lib/typescript/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.d.ts +2 -3
  172. package/lib/typescript/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.d.ts.map +1 -1
  173. package/lib/typescript/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.d.ts +11 -0
  174. package/lib/typescript/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.d.ts.map +1 -0
  175. package/lib/typescript/shared/components/create-boundary-component/hooks/use-group-active-measurement.d.ts +2 -2
  176. package/lib/typescript/shared/components/create-boundary-component/hooks/use-group-active-measurement.d.ts.map +1 -1
  177. package/lib/typescript/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.d.ts +11 -0
  178. package/lib/typescript/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.d.ts.map +1 -0
  179. package/lib/typescript/shared/components/create-boundary-component/hooks/use-initial-layout-handler.d.ts.map +1 -1
  180. package/lib/typescript/shared/components/create-boundary-component/hooks/use-pending-destination-measurement.d.ts.map +1 -1
  181. package/lib/typescript/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.d.ts +3 -3
  182. package/lib/typescript/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.d.ts.map +1 -1
  183. package/lib/typescript/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.d.ts +2 -2
  184. package/lib/typescript/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.d.ts.map +1 -1
  185. package/lib/typescript/shared/components/create-boundary-component/index.d.ts +5 -3
  186. package/lib/typescript/shared/components/create-boundary-component/index.d.ts.map +1 -1
  187. package/lib/typescript/shared/components/create-boundary-component/types.d.ts +2 -4
  188. package/lib/typescript/shared/components/create-boundary-component/types.d.ts.map +1 -1
  189. package/lib/typescript/shared/components/create-transition-aware-component.d.ts +1 -0
  190. package/lib/typescript/shared/components/create-transition-aware-component.d.ts.map +1 -1
  191. package/lib/typescript/shared/components/native-screen-container.d.ts.map +1 -1
  192. package/lib/typescript/shared/components/native-screen.d.ts.map +1 -1
  193. package/lib/typescript/shared/components/screen-container/deferred-visibility-host.d.ts +13 -0
  194. package/lib/typescript/shared/components/screen-container/deferred-visibility-host.d.ts.map +1 -0
  195. package/lib/typescript/shared/components/screen-container/hooks/use-content-layout.d.ts +3 -0
  196. package/lib/typescript/shared/components/screen-container/hooks/use-content-layout.d.ts.map +1 -0
  197. package/lib/typescript/shared/components/screen-container/index.d.ts.map +1 -1
  198. package/lib/typescript/shared/components/screen-container/layers/content.d.ts.map +1 -1
  199. package/lib/typescript/shared/components/screen-container/layers/maybe-masked-navigation-container.d.ts +3 -1
  200. package/lib/typescript/shared/components/screen-container/layers/maybe-masked-navigation-container.d.ts.map +1 -1
  201. package/lib/typescript/shared/configs/index.d.ts.map +1 -1
  202. package/lib/typescript/shared/constants.d.ts +9 -3
  203. package/lib/typescript/shared/constants.d.ts.map +1 -1
  204. package/lib/typescript/shared/hooks/animation/use-associated-style.d.ts +5 -11
  205. package/lib/typescript/shared/hooks/animation/use-associated-style.d.ts.map +1 -1
  206. package/lib/typescript/shared/index.d.ts +1 -2
  207. package/lib/typescript/shared/index.d.ts.map +1 -1
  208. package/lib/typescript/shared/providers/gestures/handlers/use-handlers.d.ts +1 -1
  209. package/lib/typescript/shared/providers/gestures/handlers/use-handlers.d.ts.map +1 -1
  210. package/lib/typescript/shared/providers/gestures/helpers/gesture-activation.d.ts.map +1 -1
  211. package/lib/typescript/shared/providers/layout-anchor.provider.d.ts +1 -1
  212. package/lib/typescript/shared/providers/layout-anchor.provider.d.ts.map +1 -1
  213. package/lib/typescript/shared/providers/screen/animation/helpers/pipeline.d.ts.map +1 -1
  214. package/lib/typescript/shared/providers/screen/helpers/resolve-interpolated-style-output.d.ts +10 -0
  215. package/lib/typescript/shared/providers/screen/helpers/resolve-interpolated-style-output.d.ts.map +1 -0
  216. package/lib/typescript/shared/providers/screen/styles.provider.d.ts +4 -2
  217. package/lib/typescript/shared/providers/screen/styles.provider.d.ts.map +1 -1
  218. package/lib/typescript/shared/providers/stack/core.provider.d.ts +2 -0
  219. package/lib/typescript/shared/providers/stack/core.provider.d.ts.map +1 -1
  220. package/lib/typescript/shared/stores/animation.store.d.ts +5 -3
  221. package/lib/typescript/shared/stores/animation.store.d.ts.map +1 -1
  222. package/lib/typescript/shared/stores/bounds/internals/presence.d.ts.map +1 -1
  223. package/lib/typescript/shared/types/animation.types.d.ts +13 -1
  224. package/lib/typescript/shared/types/animation.types.d.ts.map +1 -1
  225. package/lib/typescript/shared/types/screen.types.d.ts +51 -22
  226. package/lib/typescript/shared/types/screen.types.d.ts.map +1 -1
  227. package/lib/typescript/shared/utils/bounds/helpers/compute-bounds-styles.d.ts +11 -1
  228. package/lib/typescript/shared/utils/bounds/helpers/compute-bounds-styles.d.ts.map +1 -1
  229. package/lib/typescript/shared/utils/bounds/helpers/resolve-bound-tag.d.ts.map +1 -1
  230. package/lib/typescript/shared/utils/bounds/index.d.ts +2 -2
  231. package/lib/typescript/shared/utils/bounds/index.d.ts.map +1 -1
  232. package/lib/typescript/shared/utils/bounds/types/frame-props.d.ts +5 -0
  233. package/lib/typescript/shared/utils/bounds/types/frame-props.d.ts.map +1 -0
  234. package/lib/typescript/shared/utils/bounds/zoom/accessor.d.ts +4 -4
  235. package/lib/typescript/shared/utils/bounds/zoom/accessor.d.ts.map +1 -1
  236. package/lib/typescript/shared/utils/bounds/zoom/build.d.ts +2 -2
  237. package/lib/typescript/shared/utils/bounds/zoom/build.d.ts.map +1 -1
  238. package/lib/typescript/shared/utils/bounds/zoom/types.d.ts +3 -3
  239. package/lib/typescript/shared/utils/bounds/zoom/types.d.ts.map +1 -1
  240. package/lib/typescript/shared/utils/resolve-screen-transition-options.d.ts +5 -0
  241. package/lib/typescript/shared/utils/resolve-screen-transition-options.d.ts.map +1 -0
  242. package/package.json +2 -1
  243. package/src/blank-stack/index.ts +1 -0
  244. package/src/blank-stack/navigators/create-blank-stack-navigator.tsx +138 -19
  245. package/src/blank-stack/types.ts +33 -5
  246. package/src/component-stack/navigators/create-component-stack-navigator.tsx +8 -0
  247. package/src/shared/components/create-boundary-component/hooks/helpers/measurement-rules.ts +258 -0
  248. package/src/shared/components/create-boundary-component/hooks/use-auto-source-measurement.ts +7 -17
  249. package/src/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.ts +38 -28
  250. package/src/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.ts +58 -0
  251. package/src/shared/components/create-boundary-component/hooks/use-group-active-measurement.ts +41 -10
  252. package/src/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.ts +82 -0
  253. package/src/shared/components/create-boundary-component/hooks/use-initial-layout-handler.ts +24 -12
  254. package/src/shared/components/create-boundary-component/hooks/use-pending-destination-measurement.ts +11 -9
  255. package/src/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.ts +29 -26
  256. package/src/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.ts +26 -17
  257. package/src/shared/components/create-boundary-component/index.tsx +25 -7
  258. package/src/shared/components/create-boundary-component/types.ts +8 -4
  259. package/src/shared/components/create-transition-aware-component.tsx +5 -3
  260. package/src/shared/components/native-screen-container.tsx +11 -3
  261. package/src/shared/components/native-screen.tsx +65 -20
  262. package/src/shared/components/screen-container/deferred-visibility-host.tsx +37 -0
  263. package/src/shared/components/screen-container/hooks/use-content-layout.ts +82 -0
  264. package/src/shared/components/screen-container/index.tsx +5 -2
  265. package/src/shared/components/screen-container/layers/content.tsx +53 -80
  266. package/src/shared/components/screen-container/layers/maybe-masked-navigation-container.tsx +12 -27
  267. package/src/shared/configs/presets.ts +10 -10
  268. package/src/shared/constants.ts +5 -3
  269. package/src/shared/hooks/animation/use-associated-style.ts +10 -54
  270. package/src/shared/index.ts +2 -3
  271. package/src/shared/providers/gestures/handlers/use-handlers.ts +8 -5
  272. package/src/shared/providers/gestures/helpers/gesture-activation.ts +11 -6
  273. package/src/shared/providers/layout-anchor.provider.tsx +2 -5
  274. package/src/shared/providers/register-bounds.provider.tsx +1 -1
  275. package/src/shared/providers/screen/animation/helpers/pipeline.ts +24 -8
  276. package/src/shared/providers/screen/helpers/resolve-interpolated-style-output.ts +41 -0
  277. package/src/shared/providers/screen/styles.provider.tsx +95 -72
  278. package/src/shared/providers/stack/core.provider.tsx +27 -14
  279. package/src/shared/stores/animation.store.ts +11 -7
  280. package/src/shared/stores/bounds/internals/presence.ts +3 -1
  281. package/src/shared/types/animation.types.ts +13 -1
  282. package/src/shared/types/screen.types.ts +55 -22
  283. package/src/shared/utils/bounds/helpers/compute-bounds-styles.ts +17 -3
  284. package/src/shared/utils/bounds/helpers/resolve-bound-tag.ts +0 -6
  285. package/src/shared/utils/bounds/index.ts +16 -5
  286. package/src/shared/utils/bounds/types/frame-props.ts +5 -0
  287. package/src/shared/utils/bounds/zoom/accessor.ts +3 -3
  288. package/src/shared/utils/bounds/zoom/build.ts +46 -32
  289. package/src/shared/utils/bounds/zoom/types.ts +3 -3
  290. package/src/shared/utils/resolve-screen-transition-options.ts +37 -0
  291. package/lib/commonjs/shared/providers/viewport.provider.js +0 -33
  292. package/lib/commonjs/shared/providers/viewport.provider.js.map +0 -1
  293. package/lib/module/shared/providers/viewport.provider.js +0 -27
  294. package/lib/module/shared/providers/viewport.provider.js.map +0 -1
  295. package/lib/typescript/shared/providers/viewport.provider.d.ts +0 -13
  296. package/lib/typescript/shared/providers/viewport.provider.d.ts.map +0 -1
  297. package/src/shared/providers/viewport.provider.tsx +0 -39
@@ -52,42 +52,74 @@ export const NativeScreen = ({
52
52
  const { activeScreensLimit, backdropBehaviors } = useManagedStackContext();
53
53
 
54
54
  const routesLength = routes.length;
55
+ const topIndex = routesLength - 1;
56
+ const topRouteKey = routes[topIndex]?.key ?? routeKey;
55
57
  const screenRef = useAnimatedRef<View>();
56
58
 
57
- const sceneProgress = AnimationStore.getRouteAnimation(routeKey, "progress");
58
59
  const sceneClosing = AnimationStore.getRouteAnimation(routeKey, "closing");
60
+ const topSceneProgress = AnimationStore.getRouteAnimation(
61
+ topRouteKey,
62
+ "progress",
63
+ );
64
+ const topSceneClosing = AnimationStore.getRouteAnimation(
65
+ topRouteKey,
66
+ "closing",
67
+ );
59
68
  const screenActivity = useSharedValue<ScreenActivity>(
60
69
  ScreenActivity.TRANSITIONING_OR_BELOW_TOP,
61
70
  );
62
71
 
63
72
  useDerivedValue(() => {
64
- if (!sceneProgress) {
73
+ if (!topSceneProgress) {
65
74
  screenActivity.set(ScreenActivity.TRANSITIONING_OR_BELOW_TOP);
66
75
  return;
67
76
  }
68
77
 
69
78
  if (index < routesLength - activeScreensLimit - 1 || isPreloaded) {
70
79
  screenActivity.set(ScreenActivity.INACTIVE);
71
- } else {
72
- const outputValue =
73
- index === routesLength - 1
80
+ return;
81
+ }
82
+
83
+ const focusedIndex = optimisticFocusedIndex.value;
84
+ const topIsClosing =
85
+ topSceneClosing.get() > 0 && focusedIndex >= 0 && focusedIndex < topIndex;
86
+
87
+ if (topIsClosing) {
88
+ const postCloseActiveStart = Math.max(
89
+ 0,
90
+ focusedIndex - activeScreensLimit + 1,
91
+ );
92
+ const next =
93
+ index === topIndex
74
94
  ? ScreenActivity.ON_TOP
75
- : index >= routesLength - activeScreensLimit
95
+ : index > focusedIndex || index >= postCloseActiveStart
76
96
  ? ScreenActivity.TRANSITIONING_OR_BELOW_TOP
77
97
  : ScreenActivity.INACTIVE;
78
98
 
79
- const v = interpolate(
80
- sceneProgress.get(),
81
- [0, 1 - EPSILON, 1],
82
- [1, 1, outputValue],
83
- Extrapolation.CLAMP,
84
- );
85
-
86
- const next = Math.trunc(v) ?? ScreenActivity.TRANSITIONING_OR_BELOW_TOP;
87
-
88
99
  if (next !== screenActivity.get()) {
89
100
  screenActivity.set(next);
90
101
  }
102
+ return;
103
+ }
104
+
105
+ const outputValue =
106
+ index === topIndex
107
+ ? ScreenActivity.ON_TOP
108
+ : index >= routesLength - activeScreensLimit
109
+ ? ScreenActivity.TRANSITIONING_OR_BELOW_TOP
110
+ : ScreenActivity.INACTIVE;
111
+
112
+ const v = interpolate(
113
+ topSceneProgress.get(),
114
+ [0, 1 - EPSILON, 1],
115
+ [1, 1, outputValue],
116
+ Extrapolation.CLAMP,
117
+ );
118
+
119
+ const next = Math.trunc(v) ?? ScreenActivity.TRANSITIONING_OR_BELOW_TOP;
120
+
121
+ if (next !== screenActivity.get()) {
122
+ screenActivity.set(next);
91
123
  }
92
124
  });
93
125
 
@@ -126,12 +158,25 @@ export const NativeScreen = ({
126
158
  };
127
159
  });
128
160
 
129
- const NativeScreenComponent = !DISABLE_NATIVE_SCREENS
130
- ? AnimatedNativeScreen
131
- : Animated.View;
161
+ if (DISABLE_NATIVE_SCREENS) {
162
+ return (
163
+ <Animated.View
164
+ ref={screenRef}
165
+ // Keep a native boundary per screen when falling back to plain views.
166
+ // Android release builds can otherwise flatten sibling screens together.
167
+ collapsable={false}
168
+ style={StyleSheet.absoluteFill}
169
+ animatedProps={animatedProps}
170
+ >
171
+ <LayoutAnchorProvider anchorRef={screenRef}>
172
+ {children}
173
+ </LayoutAnchorProvider>
174
+ </Animated.View>
175
+ );
176
+ }
132
177
 
133
178
  return (
134
- <NativeScreenComponent
179
+ <AnimatedNativeScreen
135
180
  enabled
136
181
  ref={screenRef}
137
182
  style={StyleSheet.absoluteFill}
@@ -141,6 +186,6 @@ export const NativeScreen = ({
141
186
  <LayoutAnchorProvider anchorRef={screenRef}>
142
187
  {children}
143
188
  </LayoutAnchorProvider>
144
- </NativeScreenComponent>
189
+ </AnimatedNativeScreen>
145
190
  );
146
191
  };
@@ -0,0 +1,37 @@
1
+ import { memo } from "react";
2
+ import { StyleSheet } from "react-native";
3
+ import Animated, { useAnimatedStyle } from "react-native-reanimated";
4
+ import { HIDDEN_STYLE, NO_STYLES } from "../../constants";
5
+ import { useScreenStyles } from "../../providers/screen/styles.provider";
6
+
7
+ type Props = {
8
+ children: React.ReactNode;
9
+ };
10
+
11
+ /**
12
+ * Hides the full screen visual subtree while an interpolator explicitly reports
13
+ * that it is not safe to reveal yet.
14
+ *
15
+ * This sits above backdrop/content/mask/surface so a deferred transition does
16
+ * not leak raw first-paint UI from nested layers.
17
+ */
18
+ export const DeferredVisibilityHost = memo(({ children }: Props) => {
19
+ const { resolutionMode } = useScreenStyles();
20
+
21
+ const animatedStyle = useAnimatedStyle(() => {
22
+ "worklet";
23
+ return resolutionMode.value === "deferred" ? HIDDEN_STYLE : NO_STYLES;
24
+ });
25
+
26
+ return (
27
+ <Animated.View collapsable={false} style={[styles.host, animatedStyle]}>
28
+ {children}
29
+ </Animated.View>
30
+ );
31
+ });
32
+
33
+ const styles = StyleSheet.create({
34
+ host: {
35
+ flex: 1,
36
+ },
37
+ });
@@ -0,0 +1,82 @@
1
+ import { useCallback } from "react";
2
+ import { type LayoutChangeEvent, useWindowDimensions } from "react-native";
3
+ import { runOnUI } from "react-native-reanimated";
4
+ import {
5
+ useDescriptorDerivations,
6
+ useDescriptors,
7
+ } from "../../../providers/screen/descriptors";
8
+ import { AnimationStore } from "../../../stores/animation.store";
9
+ import { animateToProgress } from "../../../utils/animation/animate-to-progress";
10
+
11
+ export function useContentLayout() {
12
+ const { current } = useDescriptors();
13
+ const { isFirstKey } = useDescriptorDerivations();
14
+ const { height: screenHeight } = useWindowDimensions();
15
+ const routeKey = current.route.key;
16
+ const animations = AnimationStore.getRouteAnimations(routeKey);
17
+ const autoSnapPointValue = AnimationStore.getAnimation(
18
+ routeKey,
19
+ "autoSnapPoint",
20
+ );
21
+ const contentLayoutValue = AnimationStore.getAnimation(
22
+ routeKey,
23
+ "contentLayout",
24
+ );
25
+
26
+ return useCallback(
27
+ (event: LayoutChangeEvent) => {
28
+ const { width, height } = event.nativeEvent.layout;
29
+ if (width <= 0 || height <= 0) return;
30
+
31
+ const fraction = Math.min(height / screenHeight, 1);
32
+ const transitionSpec = current.options.transitionSpec;
33
+
34
+ runOnUI(
35
+ (
36
+ nextWidth: number,
37
+ nextHeight: number,
38
+ nextFraction: number,
39
+ isInitialScreen: boolean,
40
+ spec: typeof transitionSpec,
41
+ ) => {
42
+ "worklet";
43
+ contentLayoutValue.value = {
44
+ width: nextWidth,
45
+ height: nextHeight,
46
+ };
47
+
48
+ const isFirstMeasurement = autoSnapPointValue.value <= 0;
49
+ autoSnapPointValue.value = nextFraction;
50
+
51
+ if (
52
+ !isFirstMeasurement ||
53
+ animations.progress.value !== 0 ||
54
+ animations.animating.value !== 0
55
+ ) {
56
+ return;
57
+ }
58
+
59
+ if (isInitialScreen) {
60
+ animations.targetProgress.value = nextFraction;
61
+ animations.progress.value = nextFraction;
62
+ return;
63
+ }
64
+
65
+ animateToProgress({
66
+ target: nextFraction,
67
+ spec,
68
+ animations,
69
+ });
70
+ },
71
+ )(width, height, fraction, isFirstKey, transitionSpec);
72
+ },
73
+ [
74
+ animations,
75
+ autoSnapPointValue,
76
+ contentLayoutValue,
77
+ current.options.transitionSpec,
78
+ isFirstKey,
79
+ screenHeight,
80
+ ],
81
+ );
82
+ }
@@ -1,5 +1,6 @@
1
1
  import { memo } from "react";
2
2
  import { StyleSheet, View } from "react-native";
3
+ import { DeferredVisibilityHost } from "./deferred-visibility-host";
3
4
  import { useBackdropPointerEvents } from "./hooks/use-backdrop-pointer-events";
4
5
  import { BackdropLayer } from "./layers/backdrop";
5
6
  import { ContentLayer } from "./layers/content";
@@ -13,8 +14,10 @@ export const ScreenContainer = memo(({ children }: Props) => {
13
14
 
14
15
  return (
15
16
  <View style={styles.container} pointerEvents={pointerEvents}>
16
- <BackdropLayer />
17
- <ContentLayer>{children}</ContentLayer>
17
+ <DeferredVisibilityHost>
18
+ <BackdropLayer />
19
+ <ContentLayer>{children}</ContentLayer>
20
+ </DeferredVisibilityHost>
18
21
  </View>
19
22
  );
20
23
  });
@@ -1,27 +1,22 @@
1
1
  /** biome-ignore-all lint/style/noNonNullAssertion: <Screen gesture is under the gesture context, so this will always exist.> */
2
- import { memo, useCallback } from "react";
3
- import {
4
- type LayoutChangeEvent,
5
- StyleSheet,
6
- useWindowDimensions,
7
- View,
8
- } from "react-native";
2
+ import { memo } from "react";
3
+ import { StyleSheet, View } from "react-native";
9
4
  import { GestureDetector } from "react-native-gesture-handler";
10
5
  import Animated, {
11
- runOnUI,
12
6
  useAnimatedProps,
13
7
  useAnimatedStyle,
14
8
  } from "react-native-reanimated";
15
- import { NO_PROPS, NO_STYLES } from "../../../constants";
16
- import { useGestureContext } from "../../../providers/gestures";
17
9
  import {
18
- useDescriptorDerivations,
19
- useDescriptors,
20
- } from "../../../providers/screen/descriptors";
10
+ NAVIGATION_MASK_CONTAINER_STYLE_ID,
11
+ NO_PROPS,
12
+ NO_STYLES,
13
+ } from "../../../constants";
14
+ import { useGestureContext } from "../../../providers/gestures";
15
+ import { useDescriptors } from "../../../providers/screen/descriptors";
21
16
  import { useScreenStyles } from "../../../providers/screen/styles.provider";
22
- import { AnimationStore } from "../../../stores/animation.store";
23
- import { animateToProgress } from "../../../utils/animation/animate-to-progress";
17
+ import { resolveNavigationMaskEnabled } from "../../../utils/resolve-screen-transition-options";
24
18
  import { useBackdropPointerEvents } from "../hooks/use-backdrop-pointer-events";
19
+ import { useContentLayout } from "../hooks/use-content-layout";
25
20
  import { MaybeMaskedNavigationContainer } from "./maybe-masked-navigation-container";
26
21
  import { SurfaceContainer } from "./surface-container";
27
22
 
@@ -32,78 +27,63 @@ type Props = {
32
27
  export const ContentLayer = memo(({ children }: Props) => {
33
28
  const { stylesMap } = useScreenStyles();
34
29
  const { current } = useDescriptors();
35
- const { isFirstKey } = useDescriptorDerivations();
36
30
  const { pointerEvents, isBackdropActive } = useBackdropPointerEvents();
37
31
  const gestureContext = useGestureContext();
38
- const { height: screenHeight } = useWindowDimensions();
39
- const isNavigationMaskEnabled = !!current.options.maskEnabled;
32
+ const isNavigationMaskEnabled = resolveNavigationMaskEnabled(current.options);
40
33
  const contentPointerEvents = isBackdropActive ? "box-none" : pointerEvents;
41
- const routeKey = current.route.key;
42
- const animations = AnimationStore.getRouteAnimations(routeKey);
43
- const autoSnapPointValue = AnimationStore.getAnimation(
44
- routeKey,
45
- "autoSnapPoint",
46
- );
47
34
  const hasAutoSnapPoint =
48
35
  current.options.snapPoints?.includes("auto") ?? false;
49
36
 
37
+ const handleContentLayout = useContentLayout();
38
+
50
39
  const animatedContentStyle = useAnimatedStyle(() => {
51
40
  "worklet";
52
41
  return stylesMap.value.content?.style || NO_STYLES;
53
42
  });
54
43
 
44
+ const animatedNavigationContainerStyle = useAnimatedStyle(() => {
45
+ "worklet";
46
+ return (
47
+ stylesMap.value[NAVIGATION_MASK_CONTAINER_STYLE_ID]?.style || NO_STYLES
48
+ );
49
+ });
50
+
55
51
  const animatedContentProps = useAnimatedProps(() => {
56
52
  "worklet";
57
53
  return stylesMap.value.content?.props ?? NO_PROPS;
58
54
  });
59
55
 
60
- const handleContentLayout = useCallback(
61
- (event: LayoutChangeEvent) => {
62
- const contentHeight = event.nativeEvent.layout.height;
63
- if (contentHeight <= 0) return;
64
-
65
- const fraction = Math.min(contentHeight / screenHeight, 1);
66
- const transitionSpec = current.options.transitionSpec;
67
-
68
- runOnUI(
69
- (
70
- nextFraction: number,
71
- isInitialScreen: boolean,
72
- spec: typeof transitionSpec,
73
- ) => {
74
- "worklet";
75
- const isFirstMeasurement = autoSnapPointValue.value <= 0;
76
- autoSnapPointValue.value = nextFraction;
77
-
78
- if (
79
- !isFirstMeasurement ||
80
- animations.progress.value !== 0 ||
81
- animations.animating.value !== 0
82
- ) {
83
- return;
84
- }
56
+ const surfaceChildren = (
57
+ <SurfaceContainer pointerEvents={contentPointerEvents}>
58
+ {hasAutoSnapPoint ? (
59
+ <View collapsable={false} onLayout={handleContentLayout}>
60
+ {children}
61
+ </View>
62
+ ) : (
63
+ children
64
+ )}
65
+ </SurfaceContainer>
66
+ );
85
67
 
86
- if (isInitialScreen) {
87
- animations.targetProgress.value = nextFraction;
88
- animations.progress.value = nextFraction;
89
- return;
90
- }
68
+ const navigationContainer = (
69
+ <Animated.View
70
+ style={[styles.navigationContainer, animatedNavigationContainerStyle]}
71
+ pointerEvents={contentPointerEvents}
72
+ collapsable={false}
73
+ >
74
+ {surfaceChildren}
75
+ </Animated.View>
76
+ );
91
77
 
92
- animateToProgress({
93
- target: nextFraction,
94
- spec,
95
- animations,
96
- });
97
- },
98
- )(fraction, isFirstKey, transitionSpec);
99
- },
100
- [
101
- animations,
102
- autoSnapPointValue,
103
- current.options.transitionSpec,
104
- isFirstKey,
105
- screenHeight,
106
- ],
78
+ const navigationScopedChildren = isNavigationMaskEnabled ? (
79
+ <MaybeMaskedNavigationContainer
80
+ pointerEvents={contentPointerEvents}
81
+ enabled={isNavigationMaskEnabled}
82
+ >
83
+ {navigationContainer}
84
+ </MaybeMaskedNavigationContainer>
85
+ ) : (
86
+ navigationContainer
107
87
  );
108
88
 
109
89
  return (
@@ -113,17 +93,7 @@ export const ContentLayer = memo(({ children }: Props) => {
113
93
  animatedProps={animatedContentProps}
114
94
  pointerEvents={contentPointerEvents}
115
95
  >
116
- <MaybeMaskedNavigationContainer enabled={isNavigationMaskEnabled}>
117
- <SurfaceContainer pointerEvents={contentPointerEvents}>
118
- {hasAutoSnapPoint ? (
119
- <View collapsable={false} onLayout={handleContentLayout}>
120
- {children}
121
- </View>
122
- ) : (
123
- children
124
- )}
125
- </SurfaceContainer>
126
- </MaybeMaskedNavigationContainer>
96
+ {navigationScopedChildren}
127
97
  </Animated.View>
128
98
  </GestureDetector>
129
99
  );
@@ -133,4 +103,7 @@ const styles = StyleSheet.create({
133
103
  content: {
134
104
  flex: 1,
135
105
  },
106
+ navigationContainer: {
107
+ flex: 1,
108
+ },
136
109
  });
@@ -1,9 +1,8 @@
1
1
  import { memo, useEffect } from "react";
2
- import { StyleSheet, View } from "react-native";
2
+ import { StyleSheet, View, type ViewProps } from "react-native";
3
3
  import Animated, { useAnimatedStyle } from "react-native-reanimated";
4
4
  import {
5
- NAVIGATION_CONTAINER_STYLE_ID,
6
- NAVIGATION_MASK_STYLE_ID,
5
+ NAVIGATION_MASK_ELEMENT_STYLE_ID,
7
6
  NO_STYLES,
8
7
  } from "../../../constants";
9
8
  import { useScreenStyles } from "../../../providers/screen/styles.provider";
@@ -12,6 +11,7 @@ import { logger } from "../../../utils/logger";
12
11
  type Props = {
13
12
  enabled: boolean;
14
13
  children: React.ReactNode;
14
+ pointerEvents: ViewProps["pointerEvents"];
15
15
  };
16
16
 
17
17
  let LazyMaskedView = View;
@@ -25,16 +25,13 @@ try {
25
25
  let hasWarnedMissingMaskedView = false;
26
26
 
27
27
  export const MaybeMaskedNavigationContainer = memo(
28
- ({ enabled, children }: Props) => {
28
+ ({ enabled, children, pointerEvents }: Props) => {
29
29
  const { stylesMap } = useScreenStyles();
30
- const animatedNavigationContainerStyle = useAnimatedStyle(() => {
31
- "worklet";
32
- return stylesMap.value[NAVIGATION_CONTAINER_STYLE_ID]?.style || NO_STYLES;
33
- });
34
-
35
30
  const animatedNavigationMaskStyle = useAnimatedStyle(() => {
36
31
  "worklet";
37
- return stylesMap.value[NAVIGATION_MASK_STYLE_ID]?.style || NO_STYLES;
32
+ return (
33
+ stylesMap.value[NAVIGATION_MASK_ELEMENT_STYLE_ID]?.style || NO_STYLES
34
+ );
38
35
  });
39
36
 
40
37
  useEffect(() => {
@@ -44,20 +41,13 @@ export const MaybeMaskedNavigationContainer = memo(
44
41
 
45
42
  hasWarnedMissingMaskedView = true;
46
43
  logger.warn(
47
- "maskEnabled requires @react-native-masked-view/masked-view. Install it to enable navigation bounds masking.",
44
+ "navigationMaskEnabled requires @react-native-masked-view/masked-view. Install it to enable navigation bounds masking.",
48
45
  );
49
46
  }, [enabled]);
50
-
51
47
  if (!enabled) return children;
52
48
 
53
49
  if (LazyMaskedView === View) {
54
- return (
55
- <Animated.View
56
- style={[styles.navigationContainer, animatedNavigationContainerStyle]}
57
- >
58
- {children}
59
- </Animated.View>
60
- );
50
+ return children;
61
51
  }
62
52
 
63
53
  return (
@@ -67,14 +57,12 @@ export const MaybeMaskedNavigationContainer = memo(
67
57
  maskElement={
68
58
  <Animated.View
69
59
  style={[styles.navigationMaskElement, animatedNavigationMaskStyle]}
60
+ pointerEvents="none"
70
61
  />
71
62
  }
63
+ pointerEvents={pointerEvents}
72
64
  >
73
- <Animated.View
74
- style={[styles.navigationContainer, animatedNavigationContainerStyle]}
75
- >
76
- {children}
77
- </Animated.View>
65
+ {children}
78
66
  </LazyMaskedView>
79
67
  );
80
68
  },
@@ -87,7 +75,4 @@ const styles = StyleSheet.create({
87
75
  navigationMaskElement: {
88
76
  backgroundColor: "white",
89
77
  },
90
- navigationContainer: {
91
- flex: 1,
92
- },
93
78
  });
@@ -5,8 +5,8 @@ import {
5
5
  interpolateColor,
6
6
  } from "react-native-reanimated";
7
7
  import {
8
- NAVIGATION_CONTAINER_STYLE_ID,
9
- NAVIGATION_MASK_STYLE_ID,
8
+ NAVIGATION_MASK_CONTAINER_STYLE_ID,
9
+ NAVIGATION_MASK_ELEMENT_STYLE_ID,
10
10
  } from "../constants";
11
11
  import type { ScreenTransitionConfig } from "../types/screen.types";
12
12
  import { normalizeInterpolatedStyle } from "../utils/normalize-interpolated-style";
@@ -286,10 +286,10 @@ export const SharedIGImage = ({
286
286
  const sourceStyle = navigationStyles[sharedBoundTag] as
287
287
  | Record<string, unknown>
288
288
  | undefined;
289
- const containerStyle = navigationStyles[NAVIGATION_CONTAINER_STYLE_ID] as
290
- | Record<string, unknown>
291
- | undefined;
292
- const maskStyle = navigationStyles[NAVIGATION_MASK_STYLE_ID] as
289
+ const containerStyle = navigationStyles[
290
+ NAVIGATION_MASK_CONTAINER_STYLE_ID
291
+ ] as Record<string, unknown> | undefined;
292
+ const maskStyle = navigationStyles[NAVIGATION_MASK_ELEMENT_STYLE_ID] as
293
293
  | Record<string, unknown>
294
294
  | undefined;
295
295
 
@@ -317,7 +317,7 @@ export const SharedIGImage = ({
317
317
  ],
318
318
  },
319
319
  },
320
- [NAVIGATION_CONTAINER_STYLE_ID]: containerStyle
320
+ [NAVIGATION_MASK_CONTAINER_STYLE_ID]: containerStyle
321
321
  ? {
322
322
  style: {
323
323
  ...containerStyle,
@@ -329,7 +329,7 @@ export const SharedIGImage = ({
329
329
  },
330
330
  }
331
331
  : undefined,
332
- [NAVIGATION_MASK_STYLE_ID]: maskStyle
332
+ [NAVIGATION_MASK_ELEMENT_STYLE_ID]: maskStyle
333
333
  ? {
334
334
  style: {
335
335
  ...maskStyle,
@@ -623,7 +623,7 @@ export const SharedXImage = ({
623
623
  const navigationStyles = bounds({
624
624
  id: sharedBoundTag,
625
625
  }).navigation.zoom();
626
- const maskStyle = navigationStyles[NAVIGATION_MASK_STYLE_ID] as
626
+ const maskStyle = navigationStyles[NAVIGATION_MASK_ELEMENT_STYLE_ID] as
627
627
  | Record<string, unknown>
628
628
  | undefined;
629
629
 
@@ -654,7 +654,7 @@ export const SharedXImage = ({
654
654
 
655
655
  return {
656
656
  ...normalizedNav,
657
- [NAVIGATION_MASK_STYLE_ID]: maskStyle
657
+ [NAVIGATION_MASK_ELEMENT_STYLE_ID]: maskStyle
658
658
  ? {
659
659
  style: {
660
660
  ...maskStyle,
@@ -8,6 +8,7 @@ import type { BaseStackRoute } from "./types/stack.types";
8
8
 
9
9
  /**
10
10
  * Masked view integration
11
+ * @deprecated No longer in use. Use {@link NAVIGATION_MASK_ELEMENT_STYLE_ID} and {@link NAVIGATION_MASK_CONTAINER_STYLE_ID} instead.
11
12
  */
12
13
  export const MASK_STYLE_ID = "_ROOT_MASKED";
13
14
  export const CONTAINER_STYLE_ID = "_ROOT_CONTAINER";
@@ -15,14 +16,15 @@ export const CONTAINER_STYLE_ID = "_ROOT_CONTAINER";
15
16
  /**
16
17
  * Navigation mask integration
17
18
  */
18
- export const NAVIGATION_MASK_HOST_FLAG_STYLE_ID = "_NAVIGATION_MASK_HOST";
19
- export const NAVIGATION_MASK_STYLE_ID = "_NAVIGATION_ROOT_MASK";
20
- export const NAVIGATION_CONTAINER_STYLE_ID = "_NAVIGATION_ROOT_CONTAINER";
19
+ export const NAVIGATION_MASK_ELEMENT_STYLE_ID = "_NAVIGATION_ROOT_MASK";
20
+ export const NAVIGATION_MASK_CONTAINER_STYLE_ID = "_NAVIGATION_ROOT_CONTAINER";
21
21
 
22
22
  /**
23
23
  * Styles
24
24
  */
25
25
  export const NO_STYLES = Object.freeze({});
26
+ export const HIDDEN_STYLE = Object.freeze({ opacity: 0 });
27
+ export const VISIBLE_STYLE = Object.freeze({ opacity: 1 });
26
28
  export const NO_PROPS = Object.freeze({});
27
29
 
28
30
  /**