react-native-screen-transitions 3.4.0-alpha.6 → 3.4.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (353) hide show
  1. package/README.md +136 -46
  2. package/lib/commonjs/blank-stack/navigators/create-blank-stack-navigator.js +27 -45
  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 +1 -1
  5. package/lib/commonjs/shared/components/create-boundary-component/components/boundary-target.js +41 -0
  6. package/lib/commonjs/shared/components/create-boundary-component/components/boundary-target.js.map +1 -0
  7. package/lib/commonjs/shared/components/create-boundary-component/create-boundary-component.js +193 -0
  8. package/lib/commonjs/shared/components/create-boundary-component/create-boundary-component.js.map +1 -0
  9. package/lib/commonjs/shared/components/create-boundary-component/helpers/resolve-pending-source-key.js +1 -1
  10. package/lib/commonjs/shared/components/create-boundary-component/helpers/resolve-pending-source-key.js.map +1 -1
  11. package/lib/commonjs/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js +53 -43
  12. package/lib/commonjs/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js.map +1 -1
  13. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-auto-source-measurement.js +7 -1
  14. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-auto-source-measurement.js.map +1 -1
  15. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.js +8 -26
  16. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.js.map +1 -1
  17. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-pending-destination-measurement.js +84 -2
  18. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-pending-destination-measurement.js.map +1 -1
  19. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-prepare-transition-measurement.js +67 -0
  20. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-prepare-transition-measurement.js.map +1 -0
  21. package/lib/commonjs/shared/components/create-boundary-component/index.js +27 -216
  22. package/lib/commonjs/shared/components/create-boundary-component/index.js.map +1 -1
  23. package/lib/commonjs/shared/components/create-boundary-component/providers/boundary-owner.provider.js +63 -0
  24. package/lib/commonjs/shared/components/create-boundary-component/providers/boundary-owner.provider.js.map +1 -0
  25. package/lib/commonjs/shared/components/create-transition-aware-component.js +37 -39
  26. package/lib/commonjs/shared/components/create-transition-aware-component.js.map +1 -1
  27. package/lib/commonjs/shared/components/overlay/variations/float-overlay.js +1 -1
  28. package/lib/commonjs/shared/components/screen-container/hooks/use-content-layout.js +11 -9
  29. package/lib/commonjs/shared/components/screen-container/hooks/use-content-layout.js.map +1 -1
  30. package/lib/commonjs/shared/components/screen-container/index.js +8 -12
  31. package/lib/commonjs/shared/components/screen-container/index.js.map +1 -1
  32. package/lib/commonjs/shared/components/screen-container/layers/backdrop.js +11 -9
  33. package/lib/commonjs/shared/components/screen-container/layers/backdrop.js.map +1 -1
  34. package/lib/commonjs/shared/components/screen-container/layers/content.js +4 -4
  35. package/lib/commonjs/shared/components/screen-container/layers/content.js.map +1 -1
  36. package/lib/commonjs/shared/components/screen-container/layers/maybe-masked-navigation-container.js +4 -4
  37. package/lib/commonjs/shared/components/screen-container/layers/maybe-masked-navigation-container.js.map +1 -1
  38. package/lib/commonjs/shared/components/screen-container/layers/surface-container.js +4 -4
  39. package/lib/commonjs/shared/components/screen-container/layers/surface-container.js.map +1 -1
  40. package/lib/commonjs/shared/components/screen-lifecycle/index.js +3 -1
  41. package/lib/commonjs/shared/components/screen-lifecycle/index.js.map +1 -1
  42. package/lib/commonjs/shared/constants.js +18 -2
  43. package/lib/commonjs/shared/constants.js.map +1 -1
  44. package/lib/commonjs/shared/hooks/reanimated/use-animated-debounce.js +43 -0
  45. package/lib/commonjs/shared/hooks/reanimated/use-animated-debounce.js.map +1 -0
  46. package/lib/commonjs/shared/index.js +6 -0
  47. package/lib/commonjs/shared/index.js.map +1 -1
  48. package/lib/commonjs/shared/providers/gestures/handlers/use-handlers.js +7 -0
  49. package/lib/commonjs/shared/providers/gestures/handlers/use-handlers.js.map +1 -1
  50. package/lib/commonjs/shared/providers/screen/animation/helpers/hydrate-transition-state.js +23 -1
  51. package/lib/commonjs/shared/providers/screen/animation/helpers/hydrate-transition-state.js.map +1 -1
  52. package/lib/commonjs/shared/providers/screen/animation/helpers/use-build-transition-state.js +3 -0
  53. package/lib/commonjs/shared/providers/screen/animation/helpers/use-build-transition-state.js.map +1 -1
  54. package/lib/commonjs/shared/providers/screen/screen-composer.js +1 -1
  55. package/lib/commonjs/shared/providers/screen/screen-composer.js.map +1 -1
  56. package/lib/commonjs/shared/providers/screen/styles/helpers/build-resolved-style-map.js +144 -0
  57. package/lib/commonjs/shared/providers/screen/styles/helpers/build-resolved-style-map.js.map +1 -0
  58. package/lib/commonjs/shared/providers/screen/styles/helpers/resolve-interpolated-style-output.js +28 -0
  59. package/lib/commonjs/shared/providers/screen/styles/helpers/resolve-interpolated-style-output.js.map +1 -0
  60. package/lib/commonjs/shared/providers/screen/styles/helpers/split-normalized-style-maps.js +39 -0
  61. package/lib/commonjs/shared/providers/screen/styles/helpers/split-normalized-style-maps.js.map +1 -0
  62. package/lib/commonjs/shared/providers/screen/styles/index.js +25 -0
  63. package/lib/commonjs/shared/providers/screen/styles/index.js.map +1 -0
  64. package/lib/commonjs/shared/providers/screen/{styles.provider.js → styles/styles.provider.js} +37 -39
  65. package/lib/commonjs/shared/providers/screen/styles/styles.provider.js.map +1 -0
  66. package/lib/commonjs/shared/stores/animation.store.js +9 -3
  67. package/lib/commonjs/shared/stores/animation.store.js.map +1 -1
  68. package/lib/commonjs/shared/stores/bounds/internals/registry.js +18 -2
  69. package/lib/commonjs/shared/stores/bounds/internals/registry.js.map +1 -1
  70. package/lib/commonjs/shared/stores/bounds/internals/resolver.js +7 -48
  71. package/lib/commonjs/shared/stores/bounds/internals/resolver.js.map +1 -1
  72. package/lib/commonjs/shared/utils/animation/animate-to-progress.js +10 -0
  73. package/lib/commonjs/shared/utils/animation/animate-to-progress.js.map +1 -1
  74. package/lib/commonjs/shared/utils/bounds/helpers/compute-bounds-styles.js +6 -12
  75. package/lib/commonjs/shared/utils/bounds/helpers/compute-bounds-styles.js.map +1 -1
  76. package/lib/commonjs/shared/utils/bounds/helpers/style-composers.js +21 -10
  77. package/lib/commonjs/shared/utils/bounds/helpers/style-composers.js.map +1 -1
  78. package/lib/commonjs/shared/utils/bounds/zoom/build.js +158 -52
  79. package/lib/commonjs/shared/utils/bounds/zoom/build.js.map +1 -1
  80. package/lib/commonjs/shared/utils/bounds/zoom/config.js +3 -1
  81. package/lib/commonjs/shared/utils/bounds/zoom/config.js.map +1 -1
  82. package/lib/module/blank-stack/navigators/create-blank-stack-navigator.js +27 -45
  83. package/lib/module/blank-stack/navigators/create-blank-stack-navigator.js.map +1 -1
  84. package/lib/module/component-stack/navigators/create-component-stack-navigator.js +1 -1
  85. package/lib/module/shared/components/create-boundary-component/components/boundary-target.js +36 -0
  86. package/lib/module/shared/components/create-boundary-component/components/boundary-target.js.map +1 -0
  87. package/lib/module/shared/components/create-boundary-component/create-boundary-component.js +188 -0
  88. package/lib/module/shared/components/create-boundary-component/create-boundary-component.js.map +1 -0
  89. package/lib/module/shared/components/create-boundary-component/helpers/resolve-pending-source-key.js +1 -1
  90. package/lib/module/shared/components/create-boundary-component/helpers/resolve-pending-source-key.js.map +1 -1
  91. package/lib/module/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js +51 -41
  92. package/lib/module/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js.map +1 -1
  93. package/lib/module/shared/components/create-boundary-component/hooks/use-auto-source-measurement.js +7 -1
  94. package/lib/module/shared/components/create-boundary-component/hooks/use-auto-source-measurement.js.map +1 -1
  95. package/lib/module/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.js +8 -26
  96. package/lib/module/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.js.map +1 -1
  97. package/lib/module/shared/components/create-boundary-component/hooks/use-pending-destination-measurement.js +86 -4
  98. package/lib/module/shared/components/create-boundary-component/hooks/use-pending-destination-measurement.js.map +1 -1
  99. package/lib/module/shared/components/create-boundary-component/hooks/use-prepare-transition-measurement.js +62 -0
  100. package/lib/module/shared/components/create-boundary-component/hooks/use-prepare-transition-measurement.js.map +1 -0
  101. package/lib/module/shared/components/create-boundary-component/index.js +23 -215
  102. package/lib/module/shared/components/create-boundary-component/index.js.map +1 -1
  103. package/lib/module/shared/components/create-boundary-component/providers/boundary-owner.provider.js +56 -0
  104. package/lib/module/shared/components/create-boundary-component/providers/boundary-owner.provider.js.map +1 -0
  105. package/lib/module/shared/components/create-transition-aware-component.js +39 -41
  106. package/lib/module/shared/components/create-transition-aware-component.js.map +1 -1
  107. package/lib/module/shared/components/overlay/variations/float-overlay.js +1 -1
  108. package/lib/module/shared/components/overlay/variations/float-overlay.js.map +1 -1
  109. package/lib/module/shared/components/screen-container/hooks/use-content-layout.js +11 -9
  110. package/lib/module/shared/components/screen-container/hooks/use-content-layout.js.map +1 -1
  111. package/lib/module/shared/components/screen-container/index.js +8 -12
  112. package/lib/module/shared/components/screen-container/index.js.map +1 -1
  113. package/lib/module/shared/components/screen-container/layers/backdrop.js +11 -9
  114. package/lib/module/shared/components/screen-container/layers/backdrop.js.map +1 -1
  115. package/lib/module/shared/components/screen-container/layers/content.js +4 -4
  116. package/lib/module/shared/components/screen-container/layers/content.js.map +1 -1
  117. package/lib/module/shared/components/screen-container/layers/maybe-masked-navigation-container.js +4 -4
  118. package/lib/module/shared/components/screen-container/layers/maybe-masked-navigation-container.js.map +1 -1
  119. package/lib/module/shared/components/screen-container/layers/surface-container.js +4 -4
  120. package/lib/module/shared/components/screen-container/layers/surface-container.js.map +1 -1
  121. package/lib/module/shared/components/screen-lifecycle/index.js +3 -1
  122. package/lib/module/shared/components/screen-lifecycle/index.js.map +1 -1
  123. package/lib/module/shared/constants.js +17 -1
  124. package/lib/module/shared/constants.js.map +1 -1
  125. package/lib/module/shared/hooks/reanimated/use-animated-debounce.js +39 -0
  126. package/lib/module/shared/hooks/reanimated/use-animated-debounce.js.map +1 -0
  127. package/lib/module/shared/index.js +1 -1
  128. package/lib/module/shared/index.js.map +1 -1
  129. package/lib/module/shared/providers/gestures/handlers/use-handlers.js +7 -0
  130. package/lib/module/shared/providers/gestures/handlers/use-handlers.js.map +1 -1
  131. package/lib/module/shared/providers/screen/animation/helpers/hydrate-transition-state.js +23 -1
  132. package/lib/module/shared/providers/screen/animation/helpers/hydrate-transition-state.js.map +1 -1
  133. package/lib/module/shared/providers/screen/animation/helpers/use-build-transition-state.js +3 -0
  134. package/lib/module/shared/providers/screen/animation/helpers/use-build-transition-state.js.map +1 -1
  135. package/lib/module/shared/providers/screen/screen-composer.js +1 -1
  136. package/lib/module/shared/providers/screen/screen-composer.js.map +1 -1
  137. package/lib/module/shared/providers/screen/styles/helpers/build-resolved-style-map.js +139 -0
  138. package/lib/module/shared/providers/screen/styles/helpers/build-resolved-style-map.js.map +1 -0
  139. package/lib/module/shared/providers/screen/styles/helpers/resolve-interpolated-style-output.js +23 -0
  140. package/lib/module/shared/providers/screen/styles/helpers/resolve-interpolated-style-output.js.map +1 -0
  141. package/lib/module/shared/providers/screen/styles/helpers/split-normalized-style-maps.js +34 -0
  142. package/lib/module/shared/providers/screen/styles/helpers/split-normalized-style-maps.js.map +1 -0
  143. package/lib/module/shared/providers/screen/styles/index.js +4 -0
  144. package/lib/module/shared/providers/screen/styles/index.js.map +1 -0
  145. package/lib/module/shared/providers/screen/{styles.provider.js → styles/styles.provider.js} +38 -40
  146. package/lib/module/shared/providers/screen/styles/styles.provider.js.map +1 -0
  147. package/lib/module/shared/stores/animation.store.js +9 -3
  148. package/lib/module/shared/stores/animation.store.js.map +1 -1
  149. package/lib/module/shared/stores/bounds/internals/registry.js +18 -2
  150. package/lib/module/shared/stores/bounds/internals/registry.js.map +1 -1
  151. package/lib/module/shared/stores/bounds/internals/resolver.js +7 -48
  152. package/lib/module/shared/stores/bounds/internals/resolver.js.map +1 -1
  153. package/lib/module/shared/utils/animation/animate-to-progress.js +10 -0
  154. package/lib/module/shared/utils/animation/animate-to-progress.js.map +1 -1
  155. package/lib/module/shared/utils/bounds/helpers/compute-bounds-styles.js +7 -13
  156. package/lib/module/shared/utils/bounds/helpers/compute-bounds-styles.js.map +1 -1
  157. package/lib/module/shared/utils/bounds/helpers/style-composers.js +21 -10
  158. package/lib/module/shared/utils/bounds/helpers/style-composers.js.map +1 -1
  159. package/lib/module/shared/utils/bounds/zoom/build.js +159 -52
  160. package/lib/module/shared/utils/bounds/zoom/build.js.map +1 -1
  161. package/lib/module/shared/utils/bounds/zoom/config.js +2 -0
  162. package/lib/module/shared/utils/bounds/zoom/config.js.map +1 -1
  163. package/lib/typescript/blank-stack/navigators/create-blank-stack-navigator.d.ts +9 -15
  164. package/lib/typescript/blank-stack/navigators/create-blank-stack-navigator.d.ts.map +1 -1
  165. package/lib/typescript/blank-stack/types.d.ts +6 -4
  166. package/lib/typescript/blank-stack/types.d.ts.map +1 -1
  167. package/lib/typescript/component-stack/navigators/create-component-stack-navigator.d.ts +1 -1
  168. package/lib/typescript/shared/components/create-boundary-component/components/boundary-target.d.ts +209 -0
  169. package/lib/typescript/shared/components/create-boundary-component/components/boundary-target.d.ts.map +1 -0
  170. package/lib/typescript/shared/components/create-boundary-component/create-boundary-component.d.ts +8 -0
  171. package/lib/typescript/shared/components/create-boundary-component/create-boundary-component.d.ts.map +1 -0
  172. package/lib/typescript/shared/components/create-boundary-component/helpers/resolve-pending-source-key.d.ts.map +1 -1
  173. package/lib/typescript/shared/components/create-boundary-component/hooks/helpers/measurement-rules.d.ts +16 -11
  174. package/lib/typescript/shared/components/create-boundary-component/hooks/helpers/measurement-rules.d.ts.map +1 -1
  175. package/lib/typescript/shared/components/create-boundary-component/hooks/use-auto-source-measurement.d.ts +3 -1
  176. package/lib/typescript/shared/components/create-boundary-component/hooks/use-auto-source-measurement.d.ts.map +1 -1
  177. package/lib/typescript/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.d.ts +2 -9
  178. package/lib/typescript/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.d.ts.map +1 -1
  179. package/lib/typescript/shared/components/create-boundary-component/hooks/use-pending-destination-measurement.d.ts +6 -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-prepare-transition-measurement.d.ts +12 -0
  182. package/lib/typescript/shared/components/create-boundary-component/hooks/use-prepare-transition-measurement.d.ts.map +1 -0
  183. package/lib/typescript/shared/components/create-boundary-component/index.d.ts +224 -14
  184. package/lib/typescript/shared/components/create-boundary-component/index.d.ts.map +1 -1
  185. package/lib/typescript/shared/components/create-boundary-component/providers/boundary-owner.provider.d.ts +35 -0
  186. package/lib/typescript/shared/components/create-boundary-component/providers/boundary-owner.provider.d.ts.map +1 -0
  187. package/lib/typescript/shared/components/create-boundary-component/types.d.ts +1 -1
  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.map +1 -1
  190. package/lib/typescript/shared/components/screen-container/hooks/use-content-layout.d.ts.map +1 -1
  191. package/lib/typescript/shared/components/screen-container/index.d.ts.map +1 -1
  192. package/lib/typescript/shared/components/screen-container/layers/backdrop.d.ts.map +1 -1
  193. package/lib/typescript/shared/components/screen-container/layers/maybe-masked-navigation-container.d.ts.map +1 -1
  194. package/lib/typescript/shared/components/screen-lifecycle/index.d.ts.map +1 -1
  195. package/lib/typescript/shared/constants.d.ts +34 -0
  196. package/lib/typescript/shared/constants.d.ts.map +1 -1
  197. package/lib/typescript/shared/hooks/reanimated/use-animated-debounce.d.ts +13 -0
  198. package/lib/typescript/shared/hooks/reanimated/use-animated-debounce.d.ts.map +1 -0
  199. package/lib/typescript/shared/index.d.ts +210 -3
  200. package/lib/typescript/shared/index.d.ts.map +1 -1
  201. package/lib/typescript/shared/providers/gestures/handlers/use-handlers.d.ts.map +1 -1
  202. package/lib/typescript/shared/providers/screen/animation/helpers/hydrate-transition-state.d.ts +3 -0
  203. package/lib/typescript/shared/providers/screen/animation/helpers/hydrate-transition-state.d.ts.map +1 -1
  204. package/lib/typescript/shared/providers/screen/animation/helpers/use-build-transition-state.d.ts +3 -0
  205. package/lib/typescript/shared/providers/screen/animation/helpers/use-build-transition-state.d.ts.map +1 -1
  206. package/lib/typescript/shared/providers/screen/styles/helpers/build-resolved-style-map.d.ts +11 -0
  207. package/lib/typescript/shared/providers/screen/styles/helpers/build-resolved-style-map.d.ts.map +1 -0
  208. package/lib/typescript/shared/providers/screen/styles/helpers/resolve-interpolated-style-output.d.ts +7 -0
  209. package/lib/typescript/shared/providers/screen/styles/helpers/resolve-interpolated-style-output.d.ts.map +1 -0
  210. package/lib/typescript/shared/providers/screen/styles/helpers/split-normalized-style-maps.d.ts +6 -0
  211. package/lib/typescript/shared/providers/screen/styles/helpers/split-normalized-style-maps.d.ts.map +1 -0
  212. package/lib/typescript/shared/providers/screen/styles/index.d.ts +2 -0
  213. package/lib/typescript/shared/providers/screen/styles/index.d.ts.map +1 -0
  214. package/lib/typescript/shared/providers/screen/{styles.provider.d.ts → styles/styles.provider.d.ts} +3 -5
  215. package/lib/typescript/shared/providers/screen/styles/styles.provider.d.ts.map +1 -0
  216. package/lib/typescript/shared/stores/animation.store.d.ts +5 -2
  217. package/lib/typescript/shared/stores/animation.store.d.ts.map +1 -1
  218. package/lib/typescript/shared/stores/bounds/internals/registry.d.ts.map +1 -1
  219. package/lib/typescript/shared/stores/bounds/internals/resolver.d.ts.map +1 -1
  220. package/lib/typescript/shared/stores/bounds/types.d.ts +0 -2
  221. package/lib/typescript/shared/stores/bounds/types.d.ts.map +1 -1
  222. package/lib/typescript/shared/types/animation.types.d.ts +14 -9
  223. package/lib/typescript/shared/types/animation.types.d.ts.map +1 -1
  224. package/lib/typescript/shared/types/bounds.types.d.ts +34 -1
  225. package/lib/typescript/shared/types/bounds.types.d.ts.map +1 -1
  226. package/lib/typescript/shared/types/index.d.ts +1 -1
  227. package/lib/typescript/shared/types/index.d.ts.map +1 -1
  228. package/lib/typescript/shared/types/screen.types.d.ts +2 -4
  229. package/lib/typescript/shared/types/screen.types.d.ts.map +1 -1
  230. package/lib/typescript/shared/utils/animation/animate-to-progress.d.ts +2 -1
  231. package/lib/typescript/shared/utils/animation/animate-to-progress.d.ts.map +1 -1
  232. package/lib/typescript/shared/utils/bounds/helpers/compute-bounds-styles.d.ts +1 -11
  233. package/lib/typescript/shared/utils/bounds/helpers/compute-bounds-styles.d.ts.map +1 -1
  234. package/lib/typescript/shared/utils/bounds/helpers/style-composers.d.ts.map +1 -1
  235. package/lib/typescript/shared/utils/bounds/zoom/build.d.ts +1 -1
  236. package/lib/typescript/shared/utils/bounds/zoom/build.d.ts.map +1 -1
  237. package/lib/typescript/shared/utils/bounds/zoom/config.d.ts +2 -0
  238. package/lib/typescript/shared/utils/bounds/zoom/config.d.ts.map +1 -1
  239. package/package.json +1 -1
  240. package/src/blank-stack/navigators/create-blank-stack-navigator.tsx +37 -80
  241. package/src/blank-stack/types.ts +7 -4
  242. package/src/component-stack/navigators/create-component-stack-navigator.tsx +1 -1
  243. package/src/shared/components/create-boundary-component/components/boundary-target.tsx +47 -0
  244. package/src/shared/components/create-boundary-component/create-boundary-component.tsx +249 -0
  245. package/src/shared/components/create-boundary-component/helpers/resolve-pending-source-key.ts +5 -1
  246. package/src/shared/components/create-boundary-component/hooks/helpers/measurement-rules.ts +68 -59
  247. package/src/shared/components/create-boundary-component/hooks/use-auto-source-measurement.ts +19 -3
  248. package/src/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.ts +11 -44
  249. package/src/shared/components/create-boundary-component/hooks/use-pending-destination-measurement.ts +165 -6
  250. package/src/shared/components/create-boundary-component/hooks/use-prepare-transition-measurement.ts +107 -0
  251. package/src/shared/components/create-boundary-component/index.tsx +23 -254
  252. package/src/shared/components/create-boundary-component/providers/boundary-owner.provider.tsx +109 -0
  253. package/src/shared/components/create-boundary-component/types.ts +1 -2
  254. package/src/shared/components/create-transition-aware-component.tsx +43 -52
  255. package/src/shared/components/overlay/variations/float-overlay.tsx +1 -1
  256. package/src/shared/components/screen-container/hooks/use-content-layout.ts +10 -17
  257. package/src/shared/components/screen-container/index.tsx +10 -13
  258. package/src/shared/components/screen-container/layers/backdrop.tsx +10 -13
  259. package/src/shared/components/screen-container/layers/content.tsx +4 -4
  260. package/src/shared/components/screen-container/layers/maybe-masked-navigation-container.tsx +6 -4
  261. package/src/shared/components/screen-container/layers/surface-container.tsx +4 -4
  262. package/src/shared/components/screen-lifecycle/index.tsx +1 -4
  263. package/src/shared/constants.ts +12 -0
  264. package/src/shared/hooks/reanimated/use-animated-debounce.ts +56 -0
  265. package/src/shared/index.ts +1 -1
  266. package/src/shared/providers/gestures/handlers/use-handlers.ts +9 -0
  267. package/src/shared/providers/screen/animation/helpers/hydrate-transition-state.ts +27 -1
  268. package/src/shared/providers/screen/animation/helpers/use-build-transition-state.ts +6 -0
  269. package/src/shared/providers/screen/screen-composer.tsx +1 -1
  270. package/src/shared/providers/screen/styles/helpers/build-resolved-style-map.ts +185 -0
  271. package/src/shared/providers/screen/styles/helpers/resolve-interpolated-style-output.ts +31 -0
  272. package/src/shared/providers/screen/styles/helpers/split-normalized-style-maps.ts +44 -0
  273. package/src/shared/providers/screen/styles/index.tsx +5 -0
  274. package/src/shared/providers/screen/{styles.provider.tsx → styles/styles.provider.tsx} +54 -56
  275. package/src/shared/stores/animation.store.ts +11 -2
  276. package/src/shared/stores/bounds/internals/registry.ts +24 -3
  277. package/src/shared/stores/bounds/internals/resolver.ts +6 -75
  278. package/src/shared/stores/bounds/types.ts +0 -2
  279. package/src/shared/types/animation.types.ts +16 -10
  280. package/src/shared/types/bounds.types.ts +34 -1
  281. package/src/shared/types/index.ts +0 -1
  282. package/src/shared/types/screen.types.ts +2 -4
  283. package/src/shared/utils/animation/animate-to-progress.ts +11 -1
  284. package/src/shared/utils/bounds/helpers/compute-bounds-styles.ts +3 -12
  285. package/src/shared/utils/bounds/helpers/style-composers.ts +11 -0
  286. package/src/shared/utils/bounds/zoom/build.ts +228 -100
  287. package/src/shared/utils/bounds/zoom/config.ts +2 -0
  288. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.js +0 -54
  289. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.js.map +0 -1
  290. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-group-active-measurement.js +0 -122
  291. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-group-active-measurement.js.map +0 -1
  292. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.js +0 -72
  293. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.js.map +0 -1
  294. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-initial-layout-handler.js +0 -66
  295. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-initial-layout-handler.js.map +0 -1
  296. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.js +0 -57
  297. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.js.map +0 -1
  298. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.js +0 -53
  299. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.js.map +0 -1
  300. package/lib/commonjs/shared/components/screen-container/deferred-visibility-host.js +0 -45
  301. package/lib/commonjs/shared/components/screen-container/deferred-visibility-host.js.map +0 -1
  302. package/lib/commonjs/shared/hooks/animation/use-associated-style.js +0 -234
  303. package/lib/commonjs/shared/hooks/animation/use-associated-style.js.map +0 -1
  304. package/lib/commonjs/shared/providers/screen/helpers/resolve-interpolated-style-output.js +0 -50
  305. package/lib/commonjs/shared/providers/screen/helpers/resolve-interpolated-style-output.js.map +0 -1
  306. package/lib/commonjs/shared/providers/screen/styles.provider.js.map +0 -1
  307. package/lib/module/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.js +0 -49
  308. package/lib/module/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.js.map +0 -1
  309. package/lib/module/shared/components/create-boundary-component/hooks/use-group-active-measurement.js +0 -118
  310. package/lib/module/shared/components/create-boundary-component/hooks/use-group-active-measurement.js.map +0 -1
  311. package/lib/module/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.js +0 -67
  312. package/lib/module/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.js.map +0 -1
  313. package/lib/module/shared/components/create-boundary-component/hooks/use-initial-layout-handler.js +0 -61
  314. package/lib/module/shared/components/create-boundary-component/hooks/use-initial-layout-handler.js.map +0 -1
  315. package/lib/module/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.js +0 -52
  316. package/lib/module/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.js.map +0 -1
  317. package/lib/module/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.js +0 -48
  318. package/lib/module/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.js.map +0 -1
  319. package/lib/module/shared/components/screen-container/deferred-visibility-host.js +0 -40
  320. package/lib/module/shared/components/screen-container/deferred-visibility-host.js.map +0 -1
  321. package/lib/module/shared/hooks/animation/use-associated-style.js +0 -229
  322. package/lib/module/shared/hooks/animation/use-associated-style.js.map +0 -1
  323. package/lib/module/shared/providers/screen/helpers/resolve-interpolated-style-output.js +0 -44
  324. package/lib/module/shared/providers/screen/helpers/resolve-interpolated-style-output.js.map +0 -1
  325. package/lib/module/shared/providers/screen/styles.provider.js.map +0 -1
  326. package/lib/typescript/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.d.ts +0 -11
  327. package/lib/typescript/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.d.ts.map +0 -1
  328. package/lib/typescript/shared/components/create-boundary-component/hooks/use-group-active-measurement.d.ts +0 -17
  329. package/lib/typescript/shared/components/create-boundary-component/hooks/use-group-active-measurement.d.ts.map +0 -1
  330. package/lib/typescript/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.d.ts +0 -11
  331. package/lib/typescript/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.d.ts.map +0 -1
  332. package/lib/typescript/shared/components/create-boundary-component/hooks/use-initial-layout-handler.d.ts +0 -10
  333. package/lib/typescript/shared/components/create-boundary-component/hooks/use-initial-layout-handler.d.ts.map +0 -1
  334. package/lib/typescript/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.d.ts +0 -12
  335. package/lib/typescript/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.d.ts.map +0 -1
  336. package/lib/typescript/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.d.ts +0 -10
  337. package/lib/typescript/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.d.ts.map +0 -1
  338. package/lib/typescript/shared/components/screen-container/deferred-visibility-host.d.ts +0 -14
  339. package/lib/typescript/shared/components/screen-container/deferred-visibility-host.d.ts.map +0 -1
  340. package/lib/typescript/shared/hooks/animation/use-associated-style.d.ts +0 -32
  341. package/lib/typescript/shared/hooks/animation/use-associated-style.d.ts.map +0 -1
  342. package/lib/typescript/shared/providers/screen/helpers/resolve-interpolated-style-output.d.ts +0 -14
  343. package/lib/typescript/shared/providers/screen/helpers/resolve-interpolated-style-output.d.ts.map +0 -1
  344. package/lib/typescript/shared/providers/screen/styles.provider.d.ts.map +0 -1
  345. package/src/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.ts +0 -58
  346. package/src/shared/components/create-boundary-component/hooks/use-group-active-measurement.ts +0 -162
  347. package/src/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.ts +0 -82
  348. package/src/shared/components/create-boundary-component/hooks/use-initial-layout-handler.ts +0 -92
  349. package/src/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.ts +0 -86
  350. package/src/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.ts +0 -49
  351. package/src/shared/components/screen-container/deferred-visibility-host.tsx +0 -44
  352. package/src/shared/hooks/animation/use-associated-style.ts +0 -297
  353. package/src/shared/providers/screen/helpers/resolve-interpolated-style-output.ts +0 -61
@@ -2,6 +2,7 @@
2
2
 
3
3
  import { measure } from "react-native-reanimated";
4
4
  import useStableCallbackValue from "../../../hooks/use-stable-callback-value";
5
+ import { useLayoutAnchorContext } from "../../../providers/layout-anchor.provider";
5
6
  import { BoundStore } from "../../../stores/bounds";
6
7
  import { applyMeasuredBoundsWrites } from "../../../stores/bounds/helpers/apply-measured-bounds-writes";
7
8
  import { resolvePendingSourceKey } from "../helpers/resolve-pending-source-key";
@@ -21,11 +22,10 @@ export const useBoundaryMeasureAndStore = params => {
21
22
  ancestorKeys,
22
23
  navigatorKey,
23
24
  ancestorNavigatorKeys,
24
- isAnimating,
25
25
  preparedStyles,
26
- animatedRef,
27
- layoutAnchor
26
+ measuredAnimatedRef
28
27
  } = params;
28
+ const layoutAnchor = useLayoutAnchorContext();
29
29
  return useStableCallbackValue(({
30
30
  intent
31
31
  } = {}) => {
@@ -34,39 +34,21 @@ export const useBoundaryMeasureAndStore = params => {
34
34
  if (!enabled) return;
35
35
  const intents = getMeasurementIntentFlags(intent);
36
36
  const expectedSourceScreenKey = resolvePendingSourceKey(sharedBoundTag, preferredSourceScreenKey) || undefined;
37
- if (intents.captureSource && isAnimating.get()) {
38
- const existing = BoundStore.getSnapshot(sharedBoundTag, currentScreenKey);
39
- if (existing) {
40
- applyMeasuredBoundsWrites({
41
- sharedBoundTag,
42
- ancestorKeys,
43
- navigatorKey,
44
- ancestorNavigatorKeys,
45
- currentScreenKey,
46
- measured: existing.bounds,
47
- preparedStyles,
48
- shouldSetSource: true
49
- });
50
- return;
51
- }
52
-
53
- // No cached snapshot while animating.
54
- // Fall through to a live measurement so rapid retargeting still
55
- // captures a valid source link.
56
- }
57
37
  const hasPendingLink = expectedSourceScreenKey ? BoundStore.hasPendingLinkFromSource(sharedBoundTag, expectedSourceScreenKey) : BoundStore.hasPendingLink(sharedBoundTag);
38
+ const hasAttachableSourceLink = expectedSourceScreenKey ? BoundStore.hasSourceLink(sharedBoundTag, expectedSourceScreenKey) : false;
58
39
  const hasSourceLink = BoundStore.hasSourceLink(sharedBoundTag, currentScreenKey);
59
40
  const hasDestinationLink = BoundStore.hasDestinationLink(sharedBoundTag, currentScreenKey);
60
41
  const writePlan = resolveMeasurementWritePlan({
61
42
  intents,
62
43
  hasPendingLink,
63
44
  hasSourceLink,
64
- hasDestinationLink
45
+ hasDestinationLink,
46
+ hasAttachableSourceLink
65
47
  });
66
48
  if (!writePlan.writesAny) {
67
49
  return;
68
50
  }
69
- const measured = measure(animatedRef);
51
+ const measured = measure(measuredAnimatedRef);
70
52
  if (!measured) return;
71
53
  const correctedMeasured = layoutAnchor ? layoutAnchor.correctMeasurement(measured) : measured;
72
54
  const destinationInViewport = !writePlan.wantsDestinationWrite || !layoutAnchor || !layoutAnchor.isMeasurementInViewport || layoutAnchor.isMeasurementInViewport(correctedMeasured);
@@ -75,7 +57,7 @@ export const useBoundaryMeasureAndStore = params => {
75
57
  }
76
58
  const existingSnapshot = BoundStore.getSnapshot(sharedBoundTag, currentScreenKey);
77
59
  const hasSnapshotChanged = !existingSnapshot || !areMeasurementsEqual(existingSnapshot.bounds, correctedMeasured);
78
- const shouldWriteSnapshot = hasSnapshotChanged && (writePlan.registerSnapshot || writePlan.captureSource || writePlan.completeDestination || writePlan.refreshSource || writePlan.refreshDestination);
60
+ const shouldWriteSnapshot = hasSnapshotChanged;
79
61
  applyMeasuredBoundsWrites({
80
62
  sharedBoundTag,
81
63
  currentScreenKey,
@@ -1 +1 @@
1
- {"version":3,"names":["measure","useStableCallbackValue","BoundStore","applyMeasuredBoundsWrites","resolvePendingSourceKey","getMeasurementIntentFlags","resolveMeasurementWritePlan","SNAPSHOT_EPSILON","areMeasurementsEqual","a","b","Math","abs","x","y","pageX","pageY","width","height","useBoundaryMeasureAndStore","params","enabled","sharedBoundTag","preferredSourceScreenKey","currentScreenKey","ancestorKeys","navigatorKey","ancestorNavigatorKeys","isAnimating","preparedStyles","animatedRef","layoutAnchor","intent","intents","expectedSourceScreenKey","undefined","captureSource","get","existing","getSnapshot","measured","bounds","shouldSetSource","hasPendingLink","hasPendingLinkFromSource","hasSourceLink","hasDestinationLink","writePlan","writesAny","correctedMeasured","correctMeasurement","destinationInViewport","wantsDestinationWrite","isMeasurementInViewport","refreshSource","existingSnapshot","hasSnapshotChanged","shouldWriteSnapshot","registerSnapshot","completeDestination","refreshDestination","shouldRegisterSnapshot","shouldUpdateSource","shouldUpdateDestination","shouldSetDestination"],"sourceRoot":"../../../../../../src","sources":["shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.ts"],"mappings":";;AACA,SAGCA,OAAO,QAGD,yBAAyB;AAChC,OAAOC,sBAAsB,MAAM,0CAA0C;AAC7E,SAASC,UAAU,QAAQ,wBAAwB;AACnD,SAASC,yBAAyB,QAAQ,6DAA6D;AACvG,SAASC,uBAAuB,QAAQ,uCAAuC;AAE/E,SACCC,yBAAyB,EACzBC,2BAA2B,QACrB,6BAA6B;AAOpC,MAAMC,gBAAgB,GAAG,GAAG;AAE5B,MAAMC,oBAAoB,GAAGA,CAC5BC,CAAqB,EACrBC,CAAqB,KACR;EACb,SAAS;;EAET,OACCC,IAAI,CAACC,GAAG,CAACH,CAAC,CAACI,CAAC,GAAGH,CAAC,CAACG,CAAC,CAAC,IAAIN,gBAAgB,IACvCI,IAAI,CAACC,GAAG,CAACH,CAAC,CAACK,CAAC,GAAGJ,CAAC,CAACI,CAAC,CAAC,IAAIP,gBAAgB,IACvCI,IAAI,CAACC,GAAG,CAACH,CAAC,CAACM,KAAK,GAAGL,CAAC,CAACK,KAAK,CAAC,IAAIR,gBAAgB,IAC/CI,IAAI,CAACC,GAAG,CAACH,CAAC,CAACO,KAAK,GAAGN,CAAC,CAACM,KAAK,CAAC,IAAIT,gBAAgB,IAC/CI,IAAI,CAACC,GAAG,CAACH,CAAC,CAACQ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C,YAAY;MACZC,qBAAqB;MACrBO,uBAAuB;MACvB2B,sBAAsB,EAAEJ,mBAAmB;MAC3Cf,eAAe,EAAEK,SAAS,CAACX,aAAa;MACxC0B,kBAAkB,EAAEf,SAAS,CAACO,aAAa,IAAIE,kBAAkB;MACjEO,uBAAuB,EACtBhB,SAAS,CAACa,kBAAkB,IAC5BT,qBAAqB,IACrBK,kBAAkB;MACnBQ,oBAAoB,EACnBjB,SAAS,CAACY,mBAAmB,IAAIR;IACnC,CAAC,CAAC;EACH,CACD,CAAC;AACF,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["measure","useStableCallbackValue","useLayoutAnchorContext","BoundStore","applyMeasuredBoundsWrites","resolvePendingSourceKey","getMeasurementIntentFlags","resolveMeasurementWritePlan","SNAPSHOT_EPSILON","areMeasurementsEqual","a","b","Math","abs","x","y","pageX","pageY","width","height","useBoundaryMeasureAndStore","params","enabled","sharedBoundTag","preferredSourceScreenKey","currentScreenKey","ancestorKeys","navigatorKey","ancestorNavigatorKeys","preparedStyles","measuredAnimatedRef","layoutAnchor","intent","intents","expectedSourceScreenKey","undefined","hasPendingLink","hasPendingLinkFromSource","hasAttachableSourceLink","hasSourceLink","hasDestinationLink","writePlan","writesAny","measured","correctedMeasured","correctMeasurement","destinationInViewport","wantsDestinationWrite","isMeasurementInViewport","captureSource","refreshSource","existingSnapshot","getSnapshot","hasSnapshotChanged","bounds","shouldWriteSnapshot","shouldRegisterSnapshot","shouldSetSource","shouldUpdateSource","shouldUpdateDestination","refreshDestination","shouldSetDestination","completeDestination"],"sourceRoot":"../../../../../../src","sources":["shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.ts"],"mappings":";;AACA,SAGCA,OAAO,QAED,yBAAyB;AAChC,OAAOC,sBAAsB,MAAM,0CAA0C;AAC7E,SAASC,sBAAsB,QAAQ,2CAA2C;AAClF,SAASC,UAAU,QAAQ,wBAAwB;AACnD,SAASC,yBAAyB,QAAQ,6DAA6D;AACvG,SAASC,uBAAuB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AAC1C,oBAAoB,CAAC0C,gBAAgB,CAACG,MAAM,EAAEV,iBAAiB,CAAC;IAClE,MAAMW,mBAAmB,GAAGF,kBAAkB;IAE9CjD,yBAAyB,CAAC;MACzBmB,cAAc;MACdE,gBAAgB;MAChBkB,QAAQ,EAAEC,iBAAiB;MAC3Bf,cAAc;MACdH,YAAY;MACZC,YAAY;MACZC,qBAAqB;MACrBM,uBAAuB;MACvBsB,sBAAsB,EAAED,mBAAmB;MAC3CE,eAAe,EAAEhB,SAAS,CAACQ,aAAa;MACxCS,kBAAkB,EAAEjB,SAAS,CAACS,aAAa,IAAIG,kBAAkB;MACjEM,uBAAuB,EACtBlB,SAAS,CAACmB,kBAAkB,IAC5Bd,qBAAqB,IACrBO,kBAAkB;MACnBQ,oBAAoB,EACnBpB,SAAS,CAACqB,mBAAmB,IAAIhB;IACnC,CAAC,CAAC;EACH,CACD,CAAC;AACF,CAAC","ignoreList":[]}
@@ -1,24 +1,65 @@
1
1
  "use strict";
2
2
 
3
- import { useAnimatedReaction } from "react-native-reanimated";
3
+ import { useLayoutEffect } from "react";
4
+ import { runOnUI, useAnimatedReaction, useSharedValue } from "react-native-reanimated";
5
+ import { AnimationStore } from "../../../stores/animation.store";
4
6
  import { BoundStore } from "../../../stores/bounds";
5
7
  import { resolvePendingSourceKey } from "../helpers/resolve-pending-source-key";
6
- import { resolvePendingDestinationCaptureSignal } from "./helpers/measurement-rules";
8
+ import { resolvePendingDestinationCaptureSignal, resolvePendingDestinationRetrySignal } from "./helpers/measurement-rules";
7
9
  export const usePendingDestinationMeasurement = params => {
8
10
  const {
9
11
  sharedBoundTag,
10
12
  enabled,
13
+ id,
14
+ group,
15
+ currentScreenKey,
11
16
  expectedSourceScreenKey,
17
+ animating,
12
18
  maybeMeasureAndStore
13
19
  } = params;
20
+ const progress = AnimationStore.getValue(currentScreenKey, "progress");
21
+ const closing = AnimationStore.getValue(currentScreenKey, "closing");
22
+ const retryCount = useSharedValue(0);
23
+ const MAX_RETRIES = 4;
24
+ const RETRY_PROGRESS_BUCKETS = 8;
25
+ const RETRY_PROGRESS_MAX = 1.05;
26
+ useLayoutEffect(() => {
27
+ if (!enabled) return;
28
+ runOnUI(() => {
29
+ "worklet";
30
+
31
+ if (closing.get()) {
32
+ return;
33
+ }
34
+ const currentGroupActiveId = group ? BoundStore.getGroupActiveId(group) : null;
35
+ if (group && currentGroupActiveId !== String(id)) {
36
+ return;
37
+ }
38
+ const resolvedSourceKey = resolvePendingSourceKey(sharedBoundTag, expectedSourceScreenKey);
39
+ const hasAttachableSourceLink = resolvedSourceKey ? BoundStore.hasPendingLinkFromSource(sharedBoundTag, resolvedSourceKey) || BoundStore.hasSourceLink(sharedBoundTag, resolvedSourceKey) : false;
40
+ if (!hasAttachableSourceLink) {
41
+ return;
42
+ }
43
+ if (BoundStore.hasDestinationLink(sharedBoundTag, currentScreenKey)) {
44
+ return;
45
+ }
46
+ maybeMeasureAndStore({
47
+ intent: "complete-destination"
48
+ });
49
+ })();
50
+ }, [enabled, id, group, sharedBoundTag, currentScreenKey, expectedSourceScreenKey, closing, maybeMeasureAndStore]);
14
51
  useAnimatedReaction(() => {
15
52
  "worklet";
16
53
 
54
+ if (closing.get()) {
55
+ return 0;
56
+ }
17
57
  const resolvedSourceKey = resolvePendingSourceKey(sharedBoundTag, expectedSourceScreenKey);
18
58
  return resolvePendingDestinationCaptureSignal({
19
59
  enabled,
20
60
  resolvedSourceKey,
21
- hasPendingLinkFromSource: resolvedSourceKey ? BoundStore.hasPendingLinkFromSource(sharedBoundTag, resolvedSourceKey) : false
61
+ hasAttachableSourceLink: resolvedSourceKey ? BoundStore.hasPendingLinkFromSource(sharedBoundTag, resolvedSourceKey) || BoundStore.hasSourceLink(sharedBoundTag, resolvedSourceKey) : false,
62
+ hasDestinationLink: BoundStore.hasDestinationLink(sharedBoundTag, currentScreenKey)
22
63
  });
23
64
  }, (captureSignal, previousCaptureSignal) => {
24
65
  "worklet";
@@ -27,9 +68,50 @@ export const usePendingDestinationMeasurement = params => {
27
68
  if (!captureSignal || captureSignal === previousCaptureSignal) {
28
69
  return;
29
70
  }
71
+ const currentGroupActiveId = group ? BoundStore.getGroupActiveId(group) : null;
72
+ if (group && currentGroupActiveId !== String(id)) {
73
+ return;
74
+ }
75
+ maybeMeasureAndStore({
76
+ intent: "complete-destination"
77
+ });
78
+ }, [enabled, id, group, sharedBoundTag, expectedSourceScreenKey, closing, maybeMeasureAndStore]);
79
+ useAnimatedReaction(() => {
80
+ "worklet";
81
+
82
+ if (closing.get()) {
83
+ return 0;
84
+ }
85
+ const resolvedSourceKey = resolvePendingSourceKey(sharedBoundTag, expectedSourceScreenKey);
86
+ return resolvePendingDestinationRetrySignal({
87
+ enabled,
88
+ retryCount: retryCount.get(),
89
+ maxRetries: MAX_RETRIES,
90
+ isAnimating: !!animating.get(),
91
+ hasDestinationLink: BoundStore.hasDestinationLink(sharedBoundTag, currentScreenKey),
92
+ progress: progress.get(),
93
+ retryProgressMax: RETRY_PROGRESS_MAX,
94
+ retryProgressBuckets: RETRY_PROGRESS_BUCKETS,
95
+ resolvedSourceKey,
96
+ hasAttachableSourceLink: resolvedSourceKey ? BoundStore.hasPendingLinkFromSource(sharedBoundTag, resolvedSourceKey) || BoundStore.hasSourceLink(sharedBoundTag, resolvedSourceKey) : false
97
+ });
98
+ }, captureSignal => {
99
+ "worklet";
100
+
101
+ if (!enabled) return;
102
+ if (!captureSignal) {
103
+ retryCount.set(0);
104
+ return;
105
+ }
106
+ const currentGroupActiveId = group ? BoundStore.getGroupActiveId(group) : null;
107
+ if (group && currentGroupActiveId !== String(id)) {
108
+ return;
109
+ }
110
+ if (retryCount.get() >= MAX_RETRIES) return;
111
+ retryCount.set(retryCount.get() + 1);
30
112
  maybeMeasureAndStore({
31
113
  intent: "complete-destination"
32
114
  });
33
- }, [enabled, sharedBoundTag, expectedSourceScreenKey, maybeMeasureAndStore]);
115
+ }, [enabled, id, group, sharedBoundTag, currentScreenKey, expectedSourceScreenKey, progress, animating, closing, maybeMeasureAndStore, retryCount]);
34
116
  };
35
117
  //# sourceMappingURL=use-pending-destination-measurement.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["useAnimatedReaction","BoundStore","resolvePendingSourceKey","resolvePendingDestinationCaptureSignal","usePendingDestinationMeasurement","params","sharedBoundTag","enabled","expectedSourceScreenKey","maybeMeasureAndStore","resolvedSourceKey","hasPendingLinkFromSource","captureSignal","previousCaptureSignal","intent"],"sourceRoot":"../../../../../../src","sources":["shared/components/create-boundary-component/hooks/use-pending-destination-measurement.ts"],"mappings":";;AAAA,SAASA,mBAAmB,QAAQ,yBAAyB;AAC7D,SAASC,UAAU,QAAQ,wBAAwB;AACnD,SAASC,uBAAuB,QAAQ,uCAAuC;AAE/E,SAASC,sCAAsC,QAAQ,6BAA6B;AAEpF,OAAO,MAAMC,gCAAgC,GAAIC,MAKhD,IAAK;EACL,MAAM;IACLC,cAAc;IACdC,OAAO;IACPC,uBAAuB;IACvBC;EACD,CAAC,GAAGJ,MAAM;EAEVL,mBAAmB,CAClB,MAAM;IACL,SAAS;;IACT,MAAMU,iBAAiB,GAAGR,uBAAuB,CAChDI,cAAc,EACdE,uBACD,CAAC;IACD,OAAOL,sCAAsC,CAAC;MAC7CI,OAAO;MACPG,iBAAiB;MACjBC,wBAAwB,EAAED,iBAAiB,GACxCT,UAAU,CAACU,wBAAwB,CACnCL,cAAc,EACdI,iBACD,CAAC,GACA;IACJ,CAAC,CAAC;EACH,CAAC,EACD,CAACE,aAAa,EAAEC,qBAAqB,KAAK;IACzC,SAAS;;IACT,IAAI,CAACN,OAAO,EAAE;IACd,IAAI,CAACK,aAAa,IAAIA,aAAa,KAAKC,qBAAqB,EAAE;MAC9D;IACD;IAEAJ,oBAAoB,CAAC;MAAEK,MAAM,EAAE;IAAuB,CAAC,CAAC;EACzD,CAAC,EACD,CAACP,OAAO,EAAED,cAAc,EAAEE,uBAAuB,EAAEC,oBAAoB,CACxE,CAAC;AACF,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["useLayoutEffect","runOnUI","useAnimatedReaction","useSharedValue","AnimationStore","BoundStore","resolvePendingSourceKey","resolvePendingDestinationCaptureSignal","resolvePendingDestinationRetrySignal","usePendingDestinationMeasurement","params","sharedBoundTag","enabled","id","group","currentScreenKey","expectedSourceScreenKey","animating","maybeMeasureAndStore","progress","getValue","closing","retryCount","MAX_RETRIES","RETRY_PROGRESS_BUCKETS","RETRY_PROGRESS_MAX","get","currentGroupActiveId","getGroupActiveId","String","resolvedSourceKey","hasAttachableSourceLink","hasPendingLinkFromSource","hasSourceLink","hasDestinationLink","intent","captureSignal","previousCaptureSignal","maxRetries","isAnimating","retryProgressMax","retryProgressBuckets","set"],"sourceRoot":"../../../../../../src","sources":["shared/components/create-boundary-component/hooks/use-pending-destination-measurement.ts"],"mappings":";;AAAA,SAASA,eAAe,QAAQ,OAAO;AACvC,SACCC,OAAO,EAEPC,mBAAmB,EACnBC,cAAc,QACR,yBAAyB;AAChC,SAASC,cAAc,QAAQ,iCAAiC;AAChE,SAASC,UAAU,QAAQ,wBAAwB;AACnD,SAASC,uBAAuB,QAAQ,uCAAuC;AAE/E,SACCC,sCAAsC,EACtCC,oCAAoC,QAC9B,6BAA6B;AAEpC,OAAO,MAAMC,gCAAgC,GAAIC,MAShD,IAAK;EACL,MAAM;IACLC,cAAc;IACdC,OAAO;IACPC,EAAE;IACFC,KAAK;IACLC,gBAAgB;IAChBC,uBAAuB;IACvBC,SAAS;IACTC;EACD,CAAC,GAAGR,MAAM;EAEV,MAAMS,QAAQ,GAAGf,cAAc,CAACgB,QAAQ,CAACL,gBAAgB,EAAE,UAAU,CAAC;EACtE,MAAMM,OAAO,GAAGjB,cAAc,CAACgB,QAAQ,CAACL,gBAAgB,EAAE,SAAS,CAAC;EAEpE,MAAMO,UAAU,GAAGnB,cAAc,CAAC,CAAC,CAAC;EACpC,MAAMoB,WAAW,GAAG,CAAC;EACrB,MAAMC,sBAAsB,GAAG,CAAC;EAChC,MAAMC,kBAAkB,G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AAC,CAAC;MACxBc,gBAAgB,EAAEf,kBAAkB;MACpCgB,oBAAoB,EAAEjB,sBAAsB;MAC5CM,iBAAiB;MACjBC,uBAAuB,EAAED,iBAAiB,GACvCzB,UAAU,CAAC2B,wBAAwB,CACnCrB,cAAc,EACdmB,iBACD,CAAC,IAAIzB,UAAU,CAAC4B,aAAa,CAACtB,cAAc,EAAEmB,iBAAiB,CAAC,GAC/D;IACJ,CAAC,CAAC;EACH,CAAC,EACAM,aAAa,IAAK;IAClB,SAAS;;IACT,IAAI,CAACxB,OAAO,EAAE;IACd,IAAI,CAACwB,aAAa,EAAE;MACnBd,UAAU,CAACoB,GAAG,CAAC,CAAC,CAAC;MACjB;IACD;IACA,MAAMf,oBAAoB,GAAGb,KAAK,GAC/BT,UAAU,CAACuB,gBAAgB,CAACd,KAAK,CAAC,GAClC,IAAI;IACP,IAAIA,KAAK,IAAIa,oBAAoB,KAAKE,MAAM,CAAChB,EAAE,CAAC,EAAE;MACjD;IACD;IAEA,IAAIS,UAAU,CAACI,GAAG,CAAC,CAAC,IAAIH,WAAW,EAAE;IACrCD,UAAU,CAACoB,GAAG,CAACpB,UAAU,CAACI,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;IACpCR,oBAAoB,CAAC;MAAEiB,MAAM,EAAE;IAAuB,CAAC,CAAC;EACzD,CAAC,EACD,CACCvB,OAAO,EACPC,EAAE,EACFC,KAAK,EACLH,cAAc,EACdI,gBAAgB,EAChBC,uBAAuB,EACvBG,QAAQ,EACRF,SAAS,EACTI,OAAO,EACPH,oBAAoB,EACpBI,UAAU,CAEZ,CAAC;AACF,CAAC","ignoreList":[]}
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+
3
+ import { useAnimatedReaction } from "react-native-reanimated";
4
+ import { AnimationStore } from "../../../stores/animation.store";
5
+ import { BoundStore } from "../../../stores/bounds";
6
+ import { GestureStore } from "../../../stores/gesture.store";
7
+ import { PREPARE_DESTINATION_MEASUREMENT_INTENT, resolvePrepareSourceMeasurementIntent } from "./helpers/measurement-rules";
8
+ export const usePrepareTransitionMeasurement = params => {
9
+ const {
10
+ enabled,
11
+ sharedBoundTag,
12
+ id,
13
+ group,
14
+ currentScreenKey,
15
+ nextScreenKey,
16
+ hasNextScreen,
17
+ maybeMeasureAndStore
18
+ } = params;
19
+ const currentWillAnimate = AnimationStore.getValue(currentScreenKey, "willAnimate");
20
+ const currentAnimating = AnimationStore.getValue(currentScreenKey, "animating");
21
+ const currentDragging = GestureStore.getValue(currentScreenKey, "dragging");
22
+ const nextWillAnimate = nextScreenKey ? AnimationStore.getValue(nextScreenKey, "willAnimate") : null;
23
+ const nextAnimating = nextScreenKey ? AnimationStore.getValue(nextScreenKey, "animating") : null;
24
+ const nextDragging = nextScreenKey ? GestureStore.getValue(nextScreenKey, "dragging") : null;
25
+ useAnimatedReaction(() => hasNextScreen ? nextWillAnimate?.get() ?? 0 : 0, (nextValue, previousValue) => {
26
+ "worklet";
27
+
28
+ if (!enabled || !hasNextScreen) return;
29
+ if (nextValue === 0 || nextValue === previousValue) return;
30
+ const currentGroupActiveId = group ? BoundStore.getGroupActiveId(group) : null;
31
+ if (group && currentGroupActiveId !== String(id)) {
32
+ return;
33
+ }
34
+ const shouldCancelMeasurement = !!nextAnimating?.get() && !!nextDragging?.get();
35
+ if (shouldCancelMeasurement) {
36
+ return;
37
+ }
38
+ const intent = resolvePrepareSourceMeasurementIntent({
39
+ hasSourceLink: BoundStore.hasSourceLink(sharedBoundTag, currentScreenKey)
40
+ });
41
+ if (!intent) {
42
+ return;
43
+ }
44
+ maybeMeasureAndStore({
45
+ intent
46
+ });
47
+ });
48
+ useAnimatedReaction(() => !hasNextScreen ? currentWillAnimate.get() : 0, (nextValue, previousValue) => {
49
+ "worklet";
50
+
51
+ if (!enabled || hasNextScreen) return;
52
+ if (nextValue === 0 || nextValue === previousValue) return;
53
+ const currentGroupActiveId = group ? BoundStore.getGroupActiveId(group) : null;
54
+ if (group && currentGroupActiveId !== String(id)) return;
55
+ const shouldCancelMeasurement = !!currentAnimating.get() && !!currentDragging.get();
56
+ if (shouldCancelMeasurement) return;
57
+ maybeMeasureAndStore({
58
+ intent: PREPARE_DESTINATION_MEASUREMENT_INTENT
59
+ });
60
+ });
61
+ };
62
+ //# sourceMappingURL=use-prepare-transition-measurement.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useAnimatedReaction","AnimationStore","BoundStore","GestureStore","PREPARE_DESTINATION_MEASUREMENT_INTENT","resolvePrepareSourceMeasurementIntent","usePrepareTransitionMeasurement","params","enabled","sharedBoundTag","id","group","currentScreenKey","nextScreenKey","hasNextScreen","maybeMeasureAndStore","currentWillAnimate","getValue","currentAnimating","currentDragging","nextWillAnimate","nextAnimating","nextDragging","get","nextValue","previousValue","currentGroupActiveId","getGroupActiveId","String","shouldCancelMeasurement","intent","hasSourceLink"],"sourceRoot":"../../../../../../src","sources":["shared/components/create-boundary-component/hooks/use-prepare-transition-measurement.ts"],"mappings":";;AAAA,SAASA,mBAAmB,QAAQ,yBAAyB;AAC7D,SAASC,cAAc,QAAQ,iCAAiC;AAChE,SAASC,UAAU,QAAQ,wBAAwB;AACnD,SAASC,YAAY,QAAQ,+BAA+B;AAE5D,SACCC,sCAAsC,EACtCC,qCAAqC,QAC/B,6BAA6B;AAEpC,OAAO,MAAMC,+BAA+B,GAAIC,MAS/C,IAAK;EACL,MAAM;IACLC,OAAO;IACPC,cAAc;IACdC,EAAE;IACFC,KAAK;IACLC,gBAAgB;IAChBC,aAAa;IACbC,aAAa;IACbC;EACD,CAAC,GAAGR,MAAM;EAEV,MAAMS,kBAAkB,GAAGf,cAAc,CAACgB,QAAQ,CACjDL,gBAAgB,EAChB,aACD,CAAC;EACD,MAAMM,gBAAgB,GAAGjB,cAAc,CAACgB,QAAQ,CAC/CL,gBAAgB,EAChB,WACD,CAAC;EACD,MAAMO,eAAe,GAAGhB,YAAY,CAACc,QAAQ,CAACL,gBAAgB,EAAE,UAAU,CAAC;EAC3E,MAAMQ,eAA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CAACC,SAAS,EAAEC,aAAa,KAAK;IAC7B,SAAS;;IACT,IAAI,CAACjB,OAAO,IAAIM,aAAa,EAAE;IAC/B,IAAIU,SAAS,KAAK,CAAC,IAAIA,SAAS,KAAKC,aAAa,EAAE;IACpD,MAAMC,oBAAoB,GAAGf,KAAK,GAC/BT,UAAU,CAACyB,gBAAgB,CAAChB,KAAK,CAAC,GAClC,IAAI;IACP,IAAIA,KAAK,IAAIe,oBAAoB,KAAKE,MAAM,CAAClB,EAAE,CAAC,EAAE;IAElD,MAAMmB,uBAAuB,GAC5B,CAAC,CAACX,gBAAgB,CAACK,GAAG,CAAC,CAAC,IAAI,CAAC,CAACJ,eAAe,CAACI,GAAG,CAAC,CAAC;IACpD,IAAIM,uBAAuB,EAAE;IAE7Bd,oBAAoB,CAAC;MACpBe,MAAM,EAAE1B;IACT,CAAC,CAAC;EACH,CACD,CAAC;AACF,CAAC","ignoreList":[]}
@@ -1,215 +1,14 @@
1
1
  "use strict";
2
2
 
3
- import { forwardRef, memo, useCallback, useMemo } from "react";
4
- import { Pressable, View as RNView } from "react-native";
5
- import Animated, { runOnUI, useAnimatedRef } from "react-native-reanimated";
6
- import { useAssociatedStyles } from "../../hooks/animation/use-associated-style";
7
- import { useLayoutAnchorContext } from "../../providers/layout-anchor.provider";
8
- import { useDescriptorDerivations } from "../../providers/screen/descriptors";
9
- import { AnimationStore } from "../../stores/animation.store";
10
- import { BoundStore } from "../../stores/bounds";
11
- import { prepareStyleForBounds } from "../../utils/bounds/helpers/styles";
12
- import { useAutoSourceMeasurement } from "./hooks/use-auto-source-measurement";
13
- import { useBoundaryMeasureAndStore } from "./hooks/use-boundary-measure-and-store";
14
- import { useBoundaryPresence } from "./hooks/use-boundary-presence";
15
- import { useGroupActiveMeasurement } from "./hooks/use-group-active-measurement";
16
- import { useGroupActiveSourceMeasurement } from "./hooks/use-group-active-source-measurement";
17
- import { useInitialLayoutHandler } from "./hooks/use-initial-layout-handler";
18
- import { usePendingDestinationMeasurement } from "./hooks/use-pending-destination-measurement";
19
- import { usePendingDestinationRetryMeasurement } from "./hooks/use-pending-destination-retry-measurement";
20
- import { useScrollSettledMeasurement } from "./hooks/use-scroll-settled-measurement";
21
- import { buildBoundaryMatchKey } from "./utils/build-boundary-match-key";
22
- import { jsx as _jsx } from "react/jsx-runtime";
23
- const setGroupSelectionOnUI = (group, id) => {
24
- "worklet";
25
-
26
- BoundStore.setGroupActiveId(group, id);
27
- };
28
- export function createBoundaryComponent(Wrapped, options = {}) {
29
- const {
30
- alreadyAnimated = false
31
- } = options;
32
- const AnimatedComponent = alreadyAnimated ? Wrapped : Animated.createAnimatedComponent(Wrapped);
33
- const Inner = /*#__PURE__*/forwardRef((props, _ref) => {
34
- const {
35
- enabled = true,
36
- group,
37
- id,
38
- anchor,
39
- scaleMode,
40
- target,
41
- method,
42
- style,
43
- onPress,
44
- ...rest
45
- } = props;
46
- const sharedBoundTag = buildBoundaryMatchKey({
47
- group,
48
- id
49
- });
50
- const animatedRef = useAnimatedRef();
51
- const {
52
- previousScreenKey: preferredSourceScreenKey,
53
- currentScreenKey,
54
- nextScreenKey,
55
- ancestorKeys,
56
- navigatorKey,
57
- ancestorNavigatorKeys,
58
- hasConfiguredInterpolator
59
- } = useDescriptorDerivations();
60
- const runtimeEnabled = enabled && hasConfiguredInterpolator;
61
- const hasNextScreen = !!nextScreenKey;
62
- const shouldUpdateDestination = !hasNextScreen;
63
- const layoutAnchor = useLayoutAnchorContext();
64
- const boundaryConfig = useMemo(() => {
65
- if (anchor === undefined && scaleMode === undefined && target === undefined && method === undefined) {
66
- return undefined;
67
- }
68
- return {
69
- anchor,
70
- scaleMode,
71
- target,
72
- method
73
- };
74
- }, [anchor, scaleMode, target, method]);
75
- const isAnimating = AnimationStore.getValue(currentScreenKey, "animating");
76
- const progress = AnimationStore.getValue(currentScreenKey, "progress");
77
- const preparedStyles = useMemo(() => prepareStyleForBounds(style), [style]);
78
- const {
79
- associatedStyles
80
- } = useAssociatedStyles({
81
- id: sharedBoundTag,
82
- resetTransformOnUnset: true
83
- });
84
- const maybeMeasureAndStore = useBoundaryMeasureAndStore({
85
- enabled,
86
- sharedBoundTag,
87
- preferredSourceScreenKey,
88
- currentScreenKey,
89
- ancestorKeys,
90
- navigatorKey,
91
- ancestorNavigatorKeys,
92
- isAnimating,
93
- preparedStyles,
94
- animatedRef,
95
- layoutAnchor
96
- });
97
- const shouldRunDestinationEffects = runtimeEnabled && !hasNextScreen;
98
-
99
- // Register/unregister this boundary in the presence map so source/destination
100
- // matching can resolve across screens (including ancestor relationships).
101
- useBoundaryPresence({
102
- enabled: runtimeEnabled,
103
- sharedBoundTag,
104
- currentScreenKey,
105
- ancestorKeys,
106
- navigatorKey,
107
- ancestorNavigatorKeys,
108
- boundaryConfig
109
- });
110
-
111
- // On the source screen, capture source bounds when a matching destination
112
- // appears on the next screen.
113
- useAutoSourceMeasurement({
114
- enabled: runtimeEnabled,
115
- sharedBoundTag,
116
- nextScreenKey,
117
- maybeMeasureAndStore
118
- });
119
-
120
- // Primary destination capture: once a pending source link exists for this tag,
121
- // measure destination bounds and complete the pair.
122
- usePendingDestinationMeasurement({
123
- sharedBoundTag,
124
- enabled: shouldRunDestinationEffects,
125
- expectedSourceScreenKey: preferredSourceScreenKey,
126
- maybeMeasureAndStore
127
- });
128
-
129
- // Reliability fallback: retry destination capture during transition progress
130
- // when the initial pending-destination attempt happens before layout is ready.
131
- usePendingDestinationRetryMeasurement({
132
- sharedBoundTag,
133
- enabled: shouldRunDestinationEffects,
134
- currentScreenKey,
135
- expectedSourceScreenKey: preferredSourceScreenKey,
136
- progress,
137
- animating: isAnimating,
138
- maybeMeasureAndStore
139
- });
140
-
141
- // Grouped boundaries (e.g. paged/detail UIs): re-measure when this boundary
142
- // becomes the active member so destination bounds stay accurate.
143
- useGroupActiveMeasurement({
144
- enabled: runtimeEnabled,
145
- group,
146
- id,
147
- currentScreenKey,
148
- shouldUpdateDestination,
149
- maybeMeasureAndStore
150
- });
151
-
152
- // Source-side grouped retargeting: when an unfocused/source boundary
153
- // becomes the active member, refresh its snapshot and source link so
154
- // close transitions do not use stale pre-scroll geometry.
155
- useGroupActiveSourceMeasurement({
156
- enabled: runtimeEnabled,
157
- group,
158
- id,
159
- hasNextScreen,
160
- isAnimating,
161
- maybeMeasureAndStore
162
- });
163
-
164
- // While idle on source screens, re-measure after scroll settles so a later
165
- // close transition starts from up-to-date source geometry.
166
- useScrollSettledMeasurement({
167
- enabled: runtimeEnabled,
168
- group,
169
- hasNextScreen,
170
- isAnimating,
171
- maybeMeasureAndStore
172
- });
173
-
174
- // Destination mount-time capture path: onLayout schedules a one-time UI-thread
175
- // initial measurement when transitions are active.
176
- useInitialLayoutHandler({
177
- enabled: runtimeEnabled,
178
- sharedBoundTag,
179
- currentScreenKey,
180
- ancestorKeys,
181
- expectedSourceScreenKey: preferredSourceScreenKey,
182
- maybeMeasureAndStore
183
- });
184
- const handlePress = useCallback((...args) => {
185
- // Press path has priority: capture source before user onPress/navigation.
186
- if (group) {
187
- runOnUI(setGroupSelectionOnUI)(group, String(id));
188
- }
189
- runOnUI(maybeMeasureAndStore)({
190
- intent: "capture-source"
191
- });
192
- if (typeof onPress === "function") {
193
- onPress(...args);
194
- }
195
- }, [group, id, maybeMeasureAndStore, onPress]);
196
- const resolvedOnPress = typeof onPress === "function" ? handlePress : undefined;
197
- return /*#__PURE__*/_jsx(AnimatedComponent, {
198
- ...rest,
199
- ref: animatedRef,
200
- style: [style, enabled ? associatedStyles : undefined],
201
- onPress: resolvedOnPress,
202
- collapsable: false
203
- });
204
- });
205
- return /*#__PURE__*/memo(Inner);
206
- }
207
-
208
- // Pre-built boundary component variants
209
- const BoundaryView = createBoundaryComponent(RNView);
3
+ import { Pressable, View } from "react-native";
4
+ import { BoundaryTarget } from "./components/boundary-target";
5
+ import { createBoundaryComponent } from "./create-boundary-component";
6
+ export { createBoundaryComponent };
7
+ const BoundaryView = createBoundaryComponent(View);
8
+ const BoundaryTrigger = createBoundaryComponent(Pressable);
210
9
  BoundaryView.displayName = "Transition.Boundary.View";
211
- const BoundaryPressable = createBoundaryComponent(Pressable);
212
- BoundaryPressable.displayName = "Transition.Boundary.Pressable";
10
+ BoundaryTrigger.displayName = "Transition.Boundary.Trigger";
11
+ BoundaryTarget.displayName = "Transition.Boundary.Target";
213
12
 
214
13
  /**
215
14
  * Shared-boundary components.
@@ -219,19 +18,28 @@ BoundaryPressable.displayName = "Transition.Boundary.Pressable";
219
18
  * 2. Destination screen captures bounds for the same tag.
220
19
  * 3. The link is updated as layout changes (group-active + scroll-settled paths).
221
20
  *
222
- * Press behavior:
223
- * - When a boundary has `onPress` (typically `Boundary.Pressable`), source
21
+ * Trigger behavior:
22
+ * - When a boundary has `onPress` (typically `Boundary.Trigger`), source
224
23
  * measurement runs before the user callback. This gives navigation transitions
225
24
  * fresh source geometry on the first frame.
226
25
  *
227
26
  * Use:
228
27
  * - `Boundary.View` for passive/shared elements.
229
- * - `Boundary.Pressable` for tappable elements that start navigation.
28
+ * - `Boundary.Trigger` for tappable elements that start navigation.
29
+ * - `Boundary.Target` to measure a nested descendant instead of the owner.
230
30
  */
231
31
  export const Boundary = {
232
- /** Passive boundary wrapper (no built-in press semantics). */
32
+ /**
33
+ * Passive boundary wrapper (no built-in press semantics).
34
+ */
233
35
  View: BoundaryView,
234
- /** Pressable boundary wrapper with press-priority source capture. */
235
- Pressable: BoundaryPressable
36
+ /**
37
+ * Pressable boundary wrapper with press-priority source capture.
38
+ */
39
+ Trigger: BoundaryTrigger,
40
+ /**
41
+ * Optional nested measurement override inside a boundary owner.
42
+ */
43
+ Target: BoundaryTarget
236
44
  };
237
45
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["forwardRef","memo","useCallback","useMemo","Pressable","View","RNView","Animated","runOnUI","useAnimatedRef","useAssociatedStyles","useLayoutAnchorContext","useDescriptorDerivations","AnimationStore","BoundStore","prepareStyleForBounds","useAutoSourceMeasurement","useBoundaryMeasureAndStore","useBoundaryPresence","useGroupActiveMeasurement","useGroupActiveSourceMeasurement","useInitialLayoutHandler","usePendingDestinationMeasurement","usePendingDestinationRetryMeasurement","useScrollSettledMeasurement","buildBoundaryMatchKey","jsx","_jsx","setGroupSelectionOnUI","group","id","setGroupActiveId","createBoundaryComponent","Wrapped","options","alreadyAnimated","AnimatedComponent","createAnimatedComponent","Inner","props","_ref","enabled","anchor","scaleMode","target","method","style","onPress","rest","sharedBoundTag","animatedRef","previousScreenKey","preferredSourceScreenKey","currentScreenKey","nextScreenKey","ancestorKeys","navigatorKey","ancestorNavigatorKeys","hasConfiguredInterpolator","runtimeEnabled","hasNextScreen","shouldUpdateDestination","layoutAnchor","boundaryConfig","undefined","isAnimating","getValue","progress","preparedStyles","associatedStyles","resetTransformOnUnset","maybeMeasureAndStore","shouldRunDestinationEffects","expectedSourceScreenKey","animating","handlePress","args","String","intent","resolvedOnPress","ref","collapsable","BoundaryView","displayName","BoundaryPressable","Boundary"],"sourceRoot":"../../../../../src","sources":["shared/components/create-boundary-component/index.tsx"],"mappings":";;AAAA,SAECA,UAAU,EACVC,IAAI,EACJC,WAAW,EACXC,OAAO,QACD,OAAO;AACd,SAASC,SAAS,EAAEC,IAAI,IAAIC,MAAM,QAAmB,cAAc;AACnE,OAAOC,QAAQ,IAAIC,OAAO,EAAEC,cAAc,QAAQ,yBAAyB;AAC3E,SAASC,mBAAmB,QAAQ,4CAA4C;AAChF,SAASC,sBAAsB,QAAQ,wCAAwC;AAC/E,SAASC,wBAAwB,QAAQ,oCAAoC;AAC7E,SAASC,cAAc,QAAQ,8BAA8B;AAC7D,SAASC,UAAU,QAAQ,qBAAqB;AAChD,SAASC,qBAAqB,QAAQ,mCAAmC;AACzE,SAASC,wBAAwB,QAAQ,qCAAqC;AAC9E,SAASC,0BAA0B,QAAQ,wCAAwC;AACnF,SAASC,mBAAmB,QAAQ,+BAA+B;AACnE,SAASC,yBAAyB,QAAQ,sCAAsC;AAChF,SAASC,+BAA+B,QAAQ,6CAA6C;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AC+D,oBAAoB,CAAC,CAAC;QAAEO,MAAM,EAAE;MAAiB,CAAC,CAAC;MAE3D,IAAI,OAAO/B,OAAO,KAAK,UAAU,EAAE;QAClCA,OAAO,CAAC,GAAG6B,IAAI,CAAC;MACjB;IACD,CAAC,EACD,CAAC/C,KAAK,EAAEC,EAAE,EAAEyC,oBAAoB,EAAExB,OAAO,CAC1C,CAAC;IAED,MAAMgC,eAAe,GACpB,OAAOhC,OAAO,KAAK,UAAU,GAAG4B,WAAW,GAAGX,SAAS;IAExD,oBACCrC,IAAA,CAACS,iBAAiB;MAAA,GACZY,IAAI;MACTgC,GAAG,EAAE9B,WAAY;MACjBJ,KAAK,EAAE,CAACA,KAAK,EAAEL,OAAO,GAAG4B,gBAAgB,GAAGL,SAAS,CAAE;MACvDjB,OAAO,EAAEgC,eAAgB;MACzBE,WAAW,EAAE;IAAM,CACnB,CAAC;EAEJ,CAAC,CAAC;EAEF,oBAAOhF,IAAI,CAACqC,KAAK,CAAC;AAMnB;;AAEA;AACA,MAAM4C,YAAY,GAAGlD,uBAAuB,CAAC1B,MAAM,CAAC;AACpD4E,YAAY,CAACC,WAAW,GAAG,0BAA0B;AAErD,MAAMC,iBAAiB,GAAGpD,uBAAuB,CAAC5B,SAAS,CAAC;AAC5DgF,iBAAiB,CAACD,WAAW,GAAG,+BAA+B;;AAE/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAME,QAAQ,GAAG;EACvB;EACAhF,IAAI,EAAE6E,YAAY;EAClB;EACA9E,SAAS,EAAEgF;AACZ,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["Pressable","View","BoundaryTarget","createBoundaryComponent","BoundaryView","BoundaryTrigger","displayName","Boundary","Trigger","Target"],"sourceRoot":"../../../../../src","sources":["shared/components/create-boundary-component/index.tsx"],"mappings":";;AAAA,SAASA,SAAS,EAAEC,IAAI,QAAQ,cAAc;AAC9C,SAASC,cAAc,QAAQ,8BAA8B;AAC7D,SAASC,uBAAuB,QAAQ,6BAA6B;AAErE,SAASA,uBAAuB;AAEhC,MAAMC,YAAY,GAAGD,uBAAuB,CAACF,IAAI,CAAC;AAClD,MAAMI,eAAe,GAAGF,uBAAuB,CAACH,SAAS,CAAC;AAC1DI,YAAY,CAACE,WAAW,GAAG,0BAA0B;AACrDD,eAAe,CAACC,WAAW,GAAG,6BAA6B;AAC3DJ,cAAc,CAACI,WAAW,GAAG,4BAA4B;;AAEzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,QAAQ,GAAG;EACvB;AACD;AACA;EACCN,IAAI,EAAEG,YAAY;EAClB;AACD;AACA;EACCI,OAAO,EAAEH,eAAe;EACxB;AACD;AACA;EACCI,MAAM,EAAEP;AACT,CAAC","ignoreList":[]}
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+
3
+ import { createContext, useCallback, useContext, useMemo, useRef, useState } from "react";
4
+ import { jsx as _jsx } from "react/jsx-runtime";
5
+ const BoundaryOwnerContext = /*#__PURE__*/createContext(null);
6
+ const MULTIPLE_TARGETS_WARNING = "[react-native-screen-transitions] Multiple Boundary.Target elements were rendered under the same boundary owner. The first registered target will be measured.";
7
+ export const TARGET_OUTSIDE_OWNER_WARNING = "[react-native-screen-transitions] Boundary.Target must be rendered inside a Boundary owner (Boundary.View, Boundary.Trigger, or a component created by createBoundaryComponent).";
8
+ export const BoundaryOwnerProvider = props => {
9
+ const {
10
+ value,
11
+ children
12
+ } = props;
13
+ return /*#__PURE__*/_jsx(BoundaryOwnerContext.Provider, {
14
+ value: value,
15
+ children: children
16
+ });
17
+ };
18
+ export const useBoundaryOwnerContext = () => {
19
+ return useContext(BoundaryOwnerContext);
20
+ };
21
+ export const useBoundaryOwner = params => {
22
+ const {
23
+ ownerRef,
24
+ associatedTargetStyles
25
+ } = params;
26
+ const warnedAboutMultipleTargetsRef = useRef(false);
27
+ const [targetRefs, setTargetRefs] = useState([]);
28
+ const registerTargetRef = useCallback(targetRef => {
29
+ setTargetRefs(prev => {
30
+ if (prev.includes(targetRef)) {
31
+ return prev;
32
+ }
33
+ if (__DEV__ && prev.length > 0 && !warnedAboutMultipleTargetsRef.current) {
34
+ warnedAboutMultipleTargetsRef.current = true;
35
+ console.warn(MULTIPLE_TARGETS_WARNING);
36
+ }
37
+ return [...prev, targetRef];
38
+ });
39
+ }, []);
40
+ const unregisterTargetRef = useCallback(targetRef => {
41
+ setTargetRefs(prev => prev.filter(existingRef => existingRef !== targetRef));
42
+ }, []);
43
+ const contextValue = useMemo(() => ({
44
+ ownerRef,
45
+ registerTargetRef,
46
+ unregisterTargetRef,
47
+ activeTargetRef: targetRefs[0] ?? null,
48
+ associatedTargetStyles
49
+ }), [ownerRef, registerTargetRef, unregisterTargetRef, targetRefs, associatedTargetStyles]);
50
+ return {
51
+ contextValue,
52
+ hasActiveTarget: targetRefs.length > 0,
53
+ measuredRef: targetRefs[0] ?? ownerRef
54
+ };
55
+ };
56
+ //# sourceMappingURL=boundary-owner.provider.js.map