react-native-reanimated 3.8.1 → 3.9.0-layout-animation-experimental

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 (420) hide show
  1. package/Common/cpp/Fabric/ShadowTreeCloner.cpp +5 -2
  2. package/Common/cpp/LayoutAnimations/LayoutAnimationsManager.cpp +42 -32
  3. package/Common/cpp/LayoutAnimations/LayoutAnimationsManager.h +5 -7
  4. package/Common/cpp/LayoutAnimations/LayoutAnimationsProxy.cpp +565 -0
  5. package/Common/cpp/LayoutAnimations/LayoutAnimationsProxy.h +74 -0
  6. package/Common/cpp/LayoutAnimations/LayoutAnimationsUtils.h +140 -0
  7. package/Common/cpp/NativeModules/NativeReanimatedModule.cpp +216 -58
  8. package/Common/cpp/NativeModules/NativeReanimatedModule.h +32 -11
  9. package/Common/cpp/NativeModules/NativeReanimatedModuleSpec.cpp +2 -17
  10. package/Common/cpp/NativeModules/NativeReanimatedModuleSpec.h +6 -8
  11. package/Common/cpp/ReanimatedRuntime/RNRuntimeDecorator.cpp +3 -0
  12. package/Common/cpp/ReanimatedRuntime/WorkletRuntime.cpp +3 -4
  13. package/Common/cpp/ReanimatedRuntime/WorkletRuntimeDecorator.cpp +8 -3
  14. package/Common/cpp/SharedItems/Shareables.cpp +31 -5
  15. package/Common/cpp/SharedItems/Shareables.h +18 -2
  16. package/Common/cpp/Tools/JSScheduler.cpp +29 -5
  17. package/Common/cpp/Tools/JSScheduler.h +21 -4
  18. package/Common/cpp/Tools/PlatformDepMethodsHolder.h +6 -2
  19. package/Common/cpp/Tools/UIRuntimeDecorator.cpp +6 -0
  20. package/Common/cpp/Tools/UIRuntimeDecorator.h +1 -0
  21. package/android/CMakeLists.txt +3 -0
  22. package/android/build.gradle +17 -5
  23. package/android/src/main/cpp/NativeProxy.cpp +77 -12
  24. package/android/src/main/cpp/NativeProxy.h +35 -1
  25. package/android/src/main/java/com/swmansion/reanimated/NodesManager.java +58 -19
  26. package/android/src/main/java/com/swmansion/reanimated/ReanimatedPackage.java +7 -2
  27. package/android/src/{reactNativeVersionPatch/ReanimatedUIManager/latest → main/java}/com/swmansion/reanimated/ReanimatedUIManagerFactory.java +5 -5
  28. package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/AnimationsManager.java +10 -6
  29. package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/ReanimatedNativeHierarchyManager.java +18 -1
  30. package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/SharedTransitionManager.java +105 -17
  31. package/android/src/main/java/com/swmansion/reanimated/sensor/ReanimatedSensor.java +2 -1
  32. package/android/src/paper/java/com/swmansion/reanimated/NativeReanimatedModuleSpec.java +37 -0
  33. package/android/src/{main/java/com/swmansion/reanimated → reactNativeVersionPatch/ReanimatedUIManager/73/com/swmansion}/ReanimatedModule.java +4 -3
  34. package/android/src/reactNativeVersionPatch/ReanimatedUIManager/{70 → 73}/com/swmansion/reanimated/layoutReanimation/ReanimatedUIManager.java +1 -22
  35. package/android/src/reactNativeVersionPatch/ReanimatedUIManager/latest/com/swmansion/reanimated/ReanimatedModule.java +176 -0
  36. package/android/src/reactNativeVersionPatch/ReanimatedUIManager/latest/com/swmansion/reanimated/layoutReanimation/ReanimatedUIManager.java +0 -26
  37. package/android/src/{fabric/java → reactNativeVersionPatch/RuntimeExecutor/73}/com/swmansion/reanimated/NativeProxy.java +16 -4
  38. package/android/src/reactNativeVersionPatch/RuntimeExecutor/latest/com/swmansion/reanimated/NativeProxy.java +143 -0
  39. package/apple/LayoutReanimation/REAAnimationsManager.h +3 -0
  40. package/apple/LayoutReanimation/REAAnimationsManager.m +11 -0
  41. package/apple/LayoutReanimation/REASharedTransitionManager.m +99 -23
  42. package/apple/LayoutReanimation/REASnapshot.h +1 -0
  43. package/apple/LayoutReanimation/REASnapshot.m +78 -37
  44. package/apple/REAModule.h +22 -2
  45. package/apple/REAModule.mm +97 -46
  46. package/apple/REANodesManager.h +3 -3
  47. package/apple/REANodesManager.mm +46 -22
  48. package/apple/native/NativeProxy.h +28 -2
  49. package/apple/native/NativeProxy.mm +65 -195
  50. package/apple/native/PlatformDepMethodsHolderImpl.h +59 -0
  51. package/apple/native/PlatformDepMethodsHolderImpl.mm +429 -0
  52. package/apple/sensor/ReanimatedSensor.m +5 -5
  53. package/lib/module/Animated.js.map +1 -1
  54. package/lib/module/ConfigHelper.js +1 -1
  55. package/lib/module/ConfigHelper.js.map +1 -1
  56. package/lib/module/animationBuilder.js.map +1 -1
  57. package/lib/module/createAnimatedComponent/InlinePropManager.js +4 -4
  58. package/lib/module/createAnimatedComponent/InlinePropManager.js.map +1 -1
  59. package/lib/module/createAnimatedComponent/JSPropsUpdater.js +9 -6
  60. package/lib/module/createAnimatedComponent/JSPropsUpdater.js.map +1 -1
  61. package/lib/module/createAnimatedComponent/JSPropsUpdater.web.js +11 -0
  62. package/lib/module/createAnimatedComponent/JSPropsUpdater.web.js.map +1 -0
  63. package/lib/module/createAnimatedComponent/PropsFilter.js +25 -9
  64. package/lib/module/createAnimatedComponent/PropsFilter.js.map +1 -1
  65. package/lib/module/createAnimatedComponent/commonTypes.js.map +1 -1
  66. package/lib/module/createAnimatedComponent/createAnimatedComponent.js +83 -52
  67. package/lib/module/createAnimatedComponent/createAnimatedComponent.js.map +1 -1
  68. package/lib/module/createAnimatedComponent/getViewInfo.js +37 -0
  69. package/lib/module/createAnimatedComponent/getViewInfo.js.map +1 -0
  70. package/lib/module/createAnimatedComponent/index.js.map +1 -1
  71. package/lib/module/createAnimatedComponent/setAndForwardRef.js +4 -5
  72. package/lib/module/createAnimatedComponent/setAndForwardRef.js.map +1 -1
  73. package/lib/module/createAnimatedComponent/utils.js.map +1 -1
  74. package/lib/module/index.js.map +1 -1
  75. package/lib/module/index.web.js +1 -2
  76. package/lib/module/index.web.js.map +1 -1
  77. package/lib/module/mock.js +3 -8
  78. package/lib/module/mock.js.map +1 -1
  79. package/lib/module/propsAllowlists.js.map +1 -1
  80. package/lib/module/reanimated2/Bezier.js.map +1 -1
  81. package/lib/module/reanimated2/Colors.js +4 -11
  82. package/lib/module/reanimated2/Colors.js.map +1 -1
  83. package/lib/module/reanimated2/Easing.js +3 -7
  84. package/lib/module/reanimated2/Easing.js.map +1 -1
  85. package/lib/module/reanimated2/NativeReanimated/NativeReanimated.js +16 -13
  86. package/lib/module/reanimated2/NativeReanimated/NativeReanimated.js.map +1 -1
  87. package/lib/module/reanimated2/NativeReanimated/index.js.map +1 -1
  88. package/lib/module/reanimated2/NativeReanimated/index.web.js.map +1 -1
  89. package/lib/module/reanimated2/PlatformChecker.js +2 -1
  90. package/lib/module/reanimated2/PlatformChecker.js.map +1 -1
  91. package/lib/module/reanimated2/PropAdapters.js +1 -1
  92. package/lib/module/reanimated2/PropAdapters.js.map +1 -1
  93. package/lib/module/reanimated2/PropsRegistry.js +1 -2
  94. package/lib/module/reanimated2/PropsRegistry.js.map +1 -1
  95. package/lib/module/reanimated2/Sensor.js +2 -2
  96. package/lib/module/reanimated2/Sensor.js.map +1 -1
  97. package/lib/module/reanimated2/SensorContainer.js +2 -2
  98. package/lib/module/reanimated2/SensorContainer.js.map +1 -1
  99. package/lib/module/reanimated2/UpdateLayoutAnimations.js +30 -8
  100. package/lib/module/reanimated2/UpdateLayoutAnimations.js.map +1 -1
  101. package/lib/module/reanimated2/UpdateProps.js.map +1 -1
  102. package/lib/module/reanimated2/ViewDescriptorsSet.js.map +1 -1
  103. package/lib/module/reanimated2/WorkletEventHandler.js +74 -31
  104. package/lib/module/reanimated2/WorkletEventHandler.js.map +1 -1
  105. package/lib/module/reanimated2/animation/clamp.js.map +1 -1
  106. package/lib/module/reanimated2/animation/commonTypes.js.map +1 -1
  107. package/lib/module/reanimated2/animation/decay/decay.js.map +1 -1
  108. package/lib/module/reanimated2/animation/decay/index.js.map +1 -1
  109. package/lib/module/reanimated2/animation/decay/rigidDecay.js.map +1 -1
  110. package/lib/module/reanimated2/animation/decay/rubberBandDecay.js.map +1 -1
  111. package/lib/module/reanimated2/animation/decay/utils.js.map +1 -1
  112. package/lib/module/reanimated2/animation/delay.js.map +1 -1
  113. package/lib/module/reanimated2/animation/index.js.map +1 -1
  114. package/lib/module/reanimated2/animation/repeat.js +1 -6
  115. package/lib/module/reanimated2/animation/repeat.js.map +1 -1
  116. package/lib/module/reanimated2/animation/sequence.js +1 -5
  117. package/lib/module/reanimated2/animation/sequence.js.map +1 -1
  118. package/lib/module/reanimated2/animation/spring.js.map +1 -1
  119. package/lib/module/reanimated2/animation/springUtils.js +8 -10
  120. package/lib/module/reanimated2/animation/springUtils.js.map +1 -1
  121. package/lib/module/reanimated2/animation/styleAnimation.js +5 -4
  122. package/lib/module/reanimated2/animation/styleAnimation.js.map +1 -1
  123. package/lib/module/reanimated2/animation/timing.js +4 -1
  124. package/lib/module/reanimated2/animation/timing.js.map +1 -1
  125. package/lib/module/reanimated2/animation/transformationMatrix/matrixUtils.js +1 -2
  126. package/lib/module/reanimated2/animation/transformationMatrix/matrixUtils.js.map +1 -1
  127. package/lib/module/reanimated2/animation/util.js +22 -2
  128. package/lib/module/reanimated2/animation/util.js.map +1 -1
  129. package/lib/module/reanimated2/commonTypes.js +3 -1
  130. package/lib/module/reanimated2/commonTypes.js.map +1 -1
  131. package/lib/module/reanimated2/component/FlatList.js +1 -0
  132. package/lib/module/reanimated2/component/FlatList.js.map +1 -1
  133. package/lib/module/reanimated2/component/Image.js +1 -0
  134. package/lib/module/reanimated2/component/Image.js.map +1 -1
  135. package/lib/module/reanimated2/component/LayoutAnimationConfig.js +1 -0
  136. package/lib/module/reanimated2/component/LayoutAnimationConfig.js.map +1 -1
  137. package/lib/module/reanimated2/component/PerformanceMonitor.js +169 -0
  138. package/lib/module/reanimated2/component/PerformanceMonitor.js.map +1 -0
  139. package/lib/module/reanimated2/component/ScrollView.js +1 -0
  140. package/lib/module/reanimated2/component/ScrollView.js.map +1 -1
  141. package/lib/module/reanimated2/component/Text.js +1 -0
  142. package/lib/module/reanimated2/component/Text.js.map +1 -1
  143. package/lib/module/reanimated2/component/View.js +1 -0
  144. package/lib/module/reanimated2/component/View.js.map +1 -1
  145. package/lib/module/reanimated2/core.js +6 -15
  146. package/lib/module/reanimated2/core.js.map +1 -1
  147. package/lib/module/reanimated2/errors.js +8 -8
  148. package/lib/module/reanimated2/errors.js.map +1 -1
  149. package/lib/module/reanimated2/fabricUtils.js +33 -8
  150. package/lib/module/reanimated2/fabricUtils.js.map +1 -1
  151. package/lib/module/reanimated2/fabricUtils.web.js.map +1 -1
  152. package/lib/module/reanimated2/frameCallback/FrameCallbackRegistryJS.js +2 -2
  153. package/lib/module/reanimated2/frameCallback/FrameCallbackRegistryJS.js.map +1 -1
  154. package/lib/module/reanimated2/frameCallback/FrameCallbackRegistryUI.js.map +1 -1
  155. package/lib/module/reanimated2/frameCallback/index.js.map +1 -1
  156. package/lib/module/reanimated2/globals.d.js.map +1 -1
  157. package/lib/module/reanimated2/helperTypes.js.map +1 -1
  158. package/lib/module/reanimated2/hook/commonTypes.js.map +1 -1
  159. package/lib/module/reanimated2/hook/index.js.map +1 -1
  160. package/lib/module/reanimated2/hook/useAnimatedGestureHandler.js +1 -0
  161. package/lib/module/reanimated2/hook/useAnimatedGestureHandler.js.map +1 -1
  162. package/lib/module/reanimated2/hook/useAnimatedKeyboard.js +3 -4
  163. package/lib/module/reanimated2/hook/useAnimatedKeyboard.js.map +1 -1
  164. package/lib/module/reanimated2/hook/useAnimatedProps.js.map +1 -1
  165. package/lib/module/reanimated2/hook/useAnimatedReaction.js +1 -0
  166. package/lib/module/reanimated2/hook/useAnimatedReaction.js.map +1 -1
  167. package/lib/module/reanimated2/hook/useAnimatedRef.js +12 -7
  168. package/lib/module/reanimated2/hook/useAnimatedRef.js.map +1 -1
  169. package/lib/module/reanimated2/hook/useAnimatedScrollHandler.js +3 -1
  170. package/lib/module/reanimated2/hook/useAnimatedScrollHandler.js.map +1 -1
  171. package/lib/module/reanimated2/hook/useAnimatedSensor.js.map +1 -1
  172. package/lib/module/reanimated2/hook/useAnimatedStyle.js +3 -6
  173. package/lib/module/reanimated2/hook/useAnimatedStyle.js.map +1 -1
  174. package/lib/module/reanimated2/hook/useDerivedValue.js +3 -1
  175. package/lib/module/reanimated2/hook/useDerivedValue.js.map +1 -1
  176. package/lib/module/reanimated2/hook/useEvent.js +4 -5
  177. package/lib/module/reanimated2/hook/useEvent.js.map +1 -1
  178. package/lib/module/reanimated2/hook/useFrameCallback.js +1 -2
  179. package/lib/module/reanimated2/hook/useFrameCallback.js.map +1 -1
  180. package/lib/module/reanimated2/hook/useHandler.js +3 -1
  181. package/lib/module/reanimated2/hook/useHandler.js.map +1 -1
  182. package/lib/module/reanimated2/hook/useReducedMotion.js.map +1 -1
  183. package/lib/module/reanimated2/hook/useScrollViewOffset.js +60 -16
  184. package/lib/module/reanimated2/hook/useScrollViewOffset.js.map +1 -1
  185. package/lib/module/reanimated2/hook/useSharedValue.js.map +1 -1
  186. package/lib/module/reanimated2/hook/useWorkletCallback.js.map +1 -1
  187. package/lib/module/reanimated2/hook/utils.js.map +1 -1
  188. package/lib/module/reanimated2/index.js +2 -0
  189. package/lib/module/reanimated2/index.js.map +1 -1
  190. package/lib/module/reanimated2/initializers.js +1 -5
  191. package/lib/module/reanimated2/initializers.js.map +1 -1
  192. package/lib/module/reanimated2/interpolateColor.js +2 -6
  193. package/lib/module/reanimated2/interpolateColor.js.map +1 -1
  194. package/lib/module/reanimated2/interpolation.js +1 -1
  195. package/lib/module/reanimated2/interpolation.js.map +1 -1
  196. package/lib/module/reanimated2/isSharedValue.js.map +1 -1
  197. package/lib/module/reanimated2/jestUtils.js +3 -6
  198. package/lib/module/reanimated2/jestUtils.js.map +1 -1
  199. package/lib/module/reanimated2/jestUtils.web.js.map +1 -1
  200. package/lib/module/reanimated2/js-reanimated/JSReanimated.js +5 -9
  201. package/lib/module/reanimated2/js-reanimated/JSReanimated.js.map +1 -1
  202. package/lib/module/reanimated2/js-reanimated/WebSensor.js.map +1 -1
  203. package/lib/module/reanimated2/js-reanimated/index.js +2 -2
  204. package/lib/module/reanimated2/js-reanimated/index.js.map +1 -1
  205. package/lib/module/reanimated2/js-reanimated/react-native-web.d.js.map +1 -1
  206. package/lib/module/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.js +4 -2
  207. package/lib/module/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.js.map +1 -1
  208. package/lib/module/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.js +12 -11
  209. package/lib/module/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.js.map +1 -1
  210. package/lib/module/reanimated2/layoutReanimation/animationBuilder/Keyframe.js +12 -10
  211. package/lib/module/reanimated2/layoutReanimation/animationBuilder/Keyframe.js.map +1 -1
  212. package/lib/module/reanimated2/layoutReanimation/animationBuilder/commonTypes.js.map +1 -1
  213. package/lib/module/reanimated2/layoutReanimation/animationBuilder/index.js.map +1 -1
  214. package/lib/module/reanimated2/layoutReanimation/animationsManager.js +11 -4
  215. package/lib/module/reanimated2/layoutReanimation/animationsManager.js.map +1 -1
  216. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Bounce.js +22 -22
  217. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Bounce.js.map +1 -1
  218. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Fade.js +22 -22
  219. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Fade.js.map +1 -1
  220. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Flip.js +26 -26
  221. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Flip.js.map +1 -1
  222. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.js +10 -10
  223. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.js.map +1 -1
  224. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.js +6 -6
  225. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.js.map +1 -1
  226. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Roll.js +10 -10
  227. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Roll.js.map +1 -1
  228. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Rotate.js +18 -18
  229. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Rotate.js.map +1 -1
  230. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Slide.js +18 -18
  231. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Slide.js.map +1 -1
  232. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Stretch.js +10 -10
  233. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Stretch.js.map +1 -1
  234. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Zoom.js +34 -34
  235. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Zoom.js.map +1 -1
  236. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/index.js.map +1 -1
  237. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.js +17 -4
  238. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.js.map +1 -1
  239. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.js +4 -4
  240. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.js.map +1 -1
  241. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.js +4 -4
  242. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.js.map +1 -1
  243. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.js +4 -4
  244. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.js.map +1 -1
  245. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.js +4 -4
  246. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.js.map +1 -1
  247. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.js +4 -4
  248. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.js.map +1 -1
  249. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/index.js.map +1 -1
  250. package/lib/module/reanimated2/layoutReanimation/index.js.map +1 -1
  251. package/lib/module/reanimated2/layoutReanimation/sharedTransitions/ProgressTransitionManager.js +16 -12
  252. package/lib/module/reanimated2/layoutReanimation/sharedTransitions/ProgressTransitionManager.js.map +1 -1
  253. package/lib/module/reanimated2/layoutReanimation/sharedTransitions/SharedTransition.js +13 -7
  254. package/lib/module/reanimated2/layoutReanimation/sharedTransitions/SharedTransition.js.map +1 -1
  255. package/lib/module/reanimated2/layoutReanimation/sharedTransitions/SharedTransition.web.js.map +1 -1
  256. package/lib/module/reanimated2/layoutReanimation/sharedTransitions/index.js.map +1 -1
  257. package/lib/module/reanimated2/layoutReanimation/web/animation/Bounce.web.js.map +1 -1
  258. package/lib/module/reanimated2/layoutReanimation/web/animation/Fade.web.js.map +1 -1
  259. package/lib/module/reanimated2/layoutReanimation/web/animation/Flip.web.js.map +1 -1
  260. package/lib/module/reanimated2/layoutReanimation/web/animation/Lightspeed.web.js.map +1 -1
  261. package/lib/module/reanimated2/layoutReanimation/web/animation/Pinwheel.web.js.map +1 -1
  262. package/lib/module/reanimated2/layoutReanimation/web/animation/Roll.web.js.map +1 -1
  263. package/lib/module/reanimated2/layoutReanimation/web/animation/Rotate.web.js.map +1 -1
  264. package/lib/module/reanimated2/layoutReanimation/web/animation/Slide.web.js.map +1 -1
  265. package/lib/module/reanimated2/layoutReanimation/web/animation/Stretch.web.js.map +1 -1
  266. package/lib/module/reanimated2/layoutReanimation/web/animation/Zoom.web.js.map +1 -1
  267. package/lib/module/reanimated2/layoutReanimation/web/animationParser.js +0 -2
  268. package/lib/module/reanimated2/layoutReanimation/web/animationParser.js.map +1 -1
  269. package/lib/module/reanimated2/layoutReanimation/web/animationsManager.js +1 -2
  270. package/lib/module/reanimated2/layoutReanimation/web/animationsManager.js.map +1 -1
  271. package/lib/module/reanimated2/layoutReanimation/web/componentStyle.js +3 -1
  272. package/lib/module/reanimated2/layoutReanimation/web/componentStyle.js.map +1 -1
  273. package/lib/module/reanimated2/layoutReanimation/web/componentUtils.js +6 -7
  274. package/lib/module/reanimated2/layoutReanimation/web/componentUtils.js.map +1 -1
  275. package/lib/module/reanimated2/layoutReanimation/web/config.js.map +1 -1
  276. package/lib/module/reanimated2/layoutReanimation/web/createAnimation.js +2 -2
  277. package/lib/module/reanimated2/layoutReanimation/web/createAnimation.js.map +1 -1
  278. package/lib/module/reanimated2/layoutReanimation/web/domUtils.js +4 -4
  279. package/lib/module/reanimated2/layoutReanimation/web/domUtils.js.map +1 -1
  280. package/lib/module/reanimated2/layoutReanimation/web/index.js.map +1 -1
  281. package/lib/module/reanimated2/layoutReanimation/web/transition/Fading.web.js.map +1 -1
  282. package/lib/module/reanimated2/layoutReanimation/web/transition/Linear.web.js.map +1 -1
  283. package/lib/module/reanimated2/layoutReanimation/web/transition/Sequenced.web.js.map +1 -1
  284. package/lib/module/reanimated2/mappers.js +2 -4
  285. package/lib/module/reanimated2/mappers.js.map +1 -1
  286. package/lib/module/reanimated2/mockedRequestAnimationFrame.js.map +1 -1
  287. package/lib/module/reanimated2/mutables.js +2 -4
  288. package/lib/module/reanimated2/mutables.js.map +1 -1
  289. package/lib/module/reanimated2/platform-specific/RNRenderer.js.map +1 -1
  290. package/lib/module/reanimated2/platform-specific/RNRenderer.web.js.map +1 -1
  291. package/lib/module/reanimated2/platform-specific/checkCppVersion.js.map +1 -1
  292. package/lib/module/reanimated2/platform-specific/jsVersion.js +1 -1
  293. package/lib/module/reanimated2/platform-specific/jsVersion.js.map +1 -1
  294. package/lib/module/reanimated2/platformFunctions/dispatchCommand.js +2 -4
  295. package/lib/module/reanimated2/platformFunctions/dispatchCommand.js.map +1 -1
  296. package/lib/module/reanimated2/platformFunctions/dispatchCommand.web.js.map +1 -1
  297. package/lib/module/reanimated2/platformFunctions/getRelativeCoords.js +2 -2
  298. package/lib/module/reanimated2/platformFunctions/getRelativeCoords.js.map +1 -1
  299. package/lib/module/reanimated2/platformFunctions/index.js.map +1 -1
  300. package/lib/module/reanimated2/platformFunctions/measure.js.map +1 -1
  301. package/lib/module/reanimated2/platformFunctions/measure.web.js.map +1 -1
  302. package/lib/module/reanimated2/platformFunctions/scrollTo.js.map +1 -1
  303. package/lib/module/reanimated2/platformFunctions/scrollTo.web.js +1 -1
  304. package/lib/module/reanimated2/platformFunctions/scrollTo.web.js.map +1 -1
  305. package/lib/module/reanimated2/platformFunctions/setGestureState.js.map +1 -1
  306. package/lib/module/reanimated2/platformFunctions/setGestureState.web.js.map +1 -1
  307. package/lib/module/reanimated2/platformFunctions/setNativeProps.js.map +1 -1
  308. package/lib/module/reanimated2/platformFunctions/setNativeProps.web.js.map +1 -1
  309. package/lib/module/reanimated2/pluginUtils.js.map +1 -1
  310. package/lib/module/reanimated2/publicGlobals.js.map +1 -1
  311. package/lib/module/reanimated2/runtimes.js +11 -19
  312. package/lib/module/reanimated2/runtimes.js.map +1 -1
  313. package/lib/module/reanimated2/screenTransition/RNScreensTurboModule.js +20 -0
  314. package/lib/module/reanimated2/screenTransition/RNScreensTurboModule.js.map +1 -0
  315. package/lib/module/reanimated2/screenTransition/animationManager.js +41 -0
  316. package/lib/module/reanimated2/screenTransition/animationManager.js.map +1 -0
  317. package/lib/module/reanimated2/screenTransition/commonTypes.js +4 -0
  318. package/lib/module/reanimated2/screenTransition/commonTypes.js.map +1 -0
  319. package/lib/module/reanimated2/screenTransition/index.js +5 -0
  320. package/lib/module/reanimated2/screenTransition/index.js.map +1 -0
  321. package/lib/module/reanimated2/screenTransition/presets.js +157 -0
  322. package/lib/module/reanimated2/screenTransition/presets.js.map +1 -0
  323. package/lib/module/reanimated2/screenTransition/styleUpdater.js +62 -0
  324. package/lib/module/reanimated2/screenTransition/styleUpdater.js.map +1 -0
  325. package/lib/module/reanimated2/screenTransition/swipeSimulator.js +190 -0
  326. package/lib/module/reanimated2/screenTransition/swipeSimulator.js.map +1 -0
  327. package/lib/module/reanimated2/shareableMappingCache.js.map +1 -1
  328. package/lib/module/reanimated2/shareables.js +27 -10
  329. package/lib/module/reanimated2/shareables.js.map +1 -1
  330. package/lib/module/reanimated2/threads.js +9 -34
  331. package/lib/module/reanimated2/threads.js.map +1 -1
  332. package/lib/module/reanimated2/valueSetter.js +1 -2
  333. package/lib/module/reanimated2/valueSetter.js.map +1 -1
  334. package/lib/module/reanimated2/valueUnpacker.js +4 -3
  335. package/lib/module/reanimated2/valueUnpacker.js.map +1 -1
  336. package/lib/module/specs/NativeReanimatedModule.js +5 -0
  337. package/lib/module/specs/NativeReanimatedModule.js.map +1 -0
  338. package/lib/typescript/ConfigHelper.d.ts +1 -0
  339. package/lib/typescript/createAnimatedComponent/InlinePropManager.d.ts +1 -1
  340. package/lib/typescript/createAnimatedComponent/JSPropsUpdater.web.d.ts +6 -0
  341. package/lib/typescript/createAnimatedComponent/PropsFilter.d.ts +3 -0
  342. package/lib/typescript/createAnimatedComponent/getViewInfo.d.ts +9 -0
  343. package/lib/typescript/reanimated2/NativeReanimated/NativeReanimated.d.ts +8 -13
  344. package/lib/typescript/reanimated2/UpdateLayoutAnimations.d.ts +12 -1
  345. package/lib/typescript/reanimated2/WorkletEventHandler.d.ts +16 -9
  346. package/lib/typescript/reanimated2/animation/util.d.ts +2 -0
  347. package/lib/typescript/reanimated2/component/LayoutAnimationConfig.d.ts +1 -1
  348. package/lib/typescript/reanimated2/component/PerformanceMonitor.d.ts +2 -0
  349. package/lib/typescript/reanimated2/core.d.ts +3 -4
  350. package/lib/typescript/reanimated2/hook/commonTypes.d.ts +6 -0
  351. package/lib/typescript/reanimated2/hook/useEvent.d.ts +2 -3
  352. package/lib/typescript/reanimated2/hook/useScrollViewOffset.d.ts +3 -1
  353. package/lib/typescript/reanimated2/index.d.ts +3 -0
  354. package/lib/typescript/reanimated2/js-reanimated/JSReanimated.d.ts +2 -2
  355. package/lib/typescript/reanimated2/layoutReanimation/animationBuilder/commonTypes.d.ts +2 -1
  356. package/lib/typescript/reanimated2/layoutReanimation/sharedTransitions/ProgressTransitionManager.d.ts +2 -2
  357. package/lib/typescript/reanimated2/layoutReanimation/sharedTransitions/SharedTransition.d.ts +2 -2
  358. package/lib/typescript/reanimated2/platform-specific/jsVersion.d.ts +1 -1
  359. package/lib/typescript/reanimated2/screenTransition/RNScreensTurboModule.d.ts +2 -0
  360. package/lib/typescript/reanimated2/screenTransition/animationManager.d.ts +3 -0
  361. package/lib/typescript/reanimated2/screenTransition/commonTypes.d.ts +38 -0
  362. package/lib/typescript/reanimated2/screenTransition/index.d.ts +3 -0
  363. package/lib/typescript/reanimated2/screenTransition/presets.d.ts +11 -0
  364. package/lib/typescript/reanimated2/screenTransition/styleUpdater.d.ts +3 -0
  365. package/lib/typescript/reanimated2/screenTransition/swipeSimulator.d.ts +2 -0
  366. package/lib/typescript/specs/NativeReanimatedModule.d.ts +6 -0
  367. package/package.json +29 -17
  368. package/plugin/build/plugin.js +7 -2
  369. package/src/ConfigHelper.ts +1 -1
  370. package/src/createAnimatedComponent/InlinePropManager.ts +2 -2
  371. package/src/createAnimatedComponent/JSPropsUpdater.ts +7 -6
  372. package/src/createAnimatedComponent/JSPropsUpdater.web.ts +26 -0
  373. package/src/createAnimatedComponent/PropsFilter.tsx +31 -6
  374. package/src/createAnimatedComponent/createAnimatedComponent.tsx +108 -60
  375. package/src/createAnimatedComponent/getViewInfo.ts +39 -0
  376. package/src/reanimated2/NativeReanimated/NativeReanimated.ts +33 -35
  377. package/src/reanimated2/PlatformChecker.ts +3 -2
  378. package/src/reanimated2/PropsRegistry.ts +1 -3
  379. package/src/reanimated2/UpdateLayoutAnimations.ts +53 -13
  380. package/src/reanimated2/WorkletEventHandler.ts +98 -39
  381. package/src/reanimated2/animation/styleAnimation.ts +8 -6
  382. package/src/reanimated2/animation/timing.ts +9 -1
  383. package/src/reanimated2/animation/util.ts +28 -3
  384. package/src/reanimated2/commonTypes.ts +4 -1
  385. package/src/reanimated2/component/PerformanceMonitor.tsx +216 -0
  386. package/src/reanimated2/core.ts +9 -31
  387. package/src/reanimated2/errors.ts +1 -0
  388. package/src/reanimated2/fabricUtils.ts +43 -18
  389. package/src/reanimated2/globals.d.ts +11 -1
  390. package/src/reanimated2/hook/commonTypes.ts +10 -0
  391. package/src/reanimated2/hook/useAnimatedRef.ts +20 -11
  392. package/src/reanimated2/hook/useEvent.ts +4 -4
  393. package/src/reanimated2/hook/useScrollViewOffset.ts +94 -23
  394. package/src/reanimated2/index.ts +11 -0
  395. package/src/reanimated2/js-reanimated/JSReanimated.ts +7 -7
  396. package/src/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.ts +4 -0
  397. package/src/reanimated2/layoutReanimation/animationBuilder/Keyframe.ts +9 -1
  398. package/src/reanimated2/layoutReanimation/animationBuilder/commonTypes.ts +9 -1
  399. package/src/reanimated2/layoutReanimation/animationsManager.ts +10 -2
  400. package/src/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.ts +13 -0
  401. package/src/reanimated2/layoutReanimation/sharedTransitions/ProgressTransitionManager.ts +17 -8
  402. package/src/reanimated2/layoutReanimation/sharedTransitions/SharedTransition.ts +26 -7
  403. package/src/reanimated2/layoutReanimation/web/animationsManager.ts +1 -1
  404. package/src/reanimated2/layoutReanimation/web/componentStyle.ts +3 -1
  405. package/src/reanimated2/layoutReanimation/web/componentUtils.ts +1 -1
  406. package/src/reanimated2/layoutReanimation/web/createAnimation.ts +2 -2
  407. package/src/reanimated2/platform-specific/jsVersion.ts +1 -1
  408. package/src/reanimated2/platformFunctions/getRelativeCoords.ts +2 -2
  409. package/src/reanimated2/screenTransition/RNScreensTurboModule.ts +29 -0
  410. package/src/reanimated2/screenTransition/animationManager.ts +45 -0
  411. package/src/reanimated2/screenTransition/commonTypes.ts +63 -0
  412. package/src/reanimated2/screenTransition/index.ts +12 -0
  413. package/src/reanimated2/screenTransition/presets.ts +137 -0
  414. package/src/reanimated2/screenTransition/styleUpdater.ts +73 -0
  415. package/src/reanimated2/screenTransition/swipeSimulator.ts +238 -0
  416. package/src/reanimated2/shareables.ts +29 -6
  417. package/src/reanimated2/valueUnpacker.ts +10 -3
  418. package/src/specs/NativeReanimatedModule.ts +9 -0
  419. package/android/src/reactNativeVersionPatch/ReanimatedUIManager/70/com/swmansion/reanimated/ReanimatedUIManagerFactory.java +0 -16
  420. package/android/src/reactNativeVersionPatch/messageQueueThread/67/com/swmansion/reanimated/ReanimatedMessageQueueThread.java +0 -12
@@ -33,8 +33,7 @@ export function makeUIMutable(initial) {
33
33
  get _value() {
34
34
  return value;
35
35
  },
36
- modify: function (modifier) {
37
- let forceUpdate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
36
+ modify: (modifier, forceUpdate = true) => {
38
37
  valueSetter(self, modifier !== undefined ? modifier(value) : value, forceUpdate);
39
38
  },
40
39
  addListener: (id, listener) => {
@@ -93,8 +92,7 @@ export function makeMutable(initial) {
93
92
  }
94
93
  throw new Error('[Reanimated] Reading from `_value` directly is only possible on the UI runtime. Perhaps you passed an Animated Style to a non-animated component?');
95
94
  },
96
- modify: function (modifier) {
97
- let forceUpdate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
95
+ modify: (modifier, forceUpdate = true) => {
98
96
  if (!SHOULD_BE_USE_WEB) {
99
97
  runOnUI(() => {
100
98
  mutable.modify(modifier, forceUpdate);
@@ -1 +1 @@
1
- {"version":3,"names":["shouldBeUseWeb","makeShareableCloneRecursive","shareableMappingCache","executeOnUIRuntimeSync","runOnUI","valueSetter","SHOULD_BE_USE_WEB","makeUIMutable","initial","listeners","Map","value","self","newValue","_value","forEach","listener","modify","modifier","forceUpdate","arguments","length","undefined","addListener","id","set","removeListener","delete","_animation","_isReanimatedSharedValue","makeMutable","handle","__init","mutable","uiValueGetter","sv","Error"],"sources":["mutables.ts"],"sourcesContent":["'use strict';\nimport { shouldBeUseWeb } from './PlatformChecker';\nimport type { Mutable } from './commonTypes';\nimport { makeShareableCloneRecursive } from './shareables';\nimport { shareableMappingCache } from './shareableMappingCache';\nimport { executeOnUIRuntimeSync, runOnUI } from './threads';\nimport { valueSetter } from './valueSetter';\n\nconst SHOULD_BE_USE_WEB = shouldBeUseWeb();\n\ntype Listener<Value> = (newValue: Value) => void;\n\nexport function makeUIMutable<Value>(initial: Value): Mutable<Value> {\n 'worklet';\n\n const listeners = new Map<number, Listener<Value>>();\n let value = initial;\n\n const self: Mutable<Value> = {\n set value(newValue) {\n valueSetter(self, newValue);\n },\n get value() {\n return value;\n },\n /**\n * _value prop should only be accessed by the valueSetter implementation\n * which may make the decision about updating the mutable value depending\n * on the provided new value. All other places should only attempt to modify\n * the mutable by assigning to value prop directly.\n */\n set _value(newValue: Value) {\n value = newValue;\n listeners.forEach((listener) => {\n listener(newValue);\n });\n },\n get _value(): Value {\n return value;\n },\n modify: (modifier, forceUpdate = true) => {\n valueSetter(\n self,\n modifier !== undefined ? modifier(value) : value,\n forceUpdate\n );\n },\n addListener: (id: number, listener: Listener<Value>) => {\n listeners.set(id, listener);\n },\n removeListener: (id: number) => {\n listeners.delete(id);\n },\n _animation: null,\n _isReanimatedSharedValue: true,\n };\n return self;\n}\n\nexport function makeMutable<Value>(initial: Value): Mutable<Value> {\n let value: Value = initial;\n const handle = makeShareableCloneRecursive({\n __init: () => {\n 'worklet';\n return makeUIMutable(initial);\n },\n });\n // listeners can only work on JS thread on Web and jest environments\n const listeners = SHOULD_BE_USE_WEB\n ? new Map<number, Listener<Value>>()\n : undefined;\n const mutable: Mutable<Value> = {\n set value(newValue) {\n if (SHOULD_BE_USE_WEB) {\n valueSetter(mutable, newValue);\n } else {\n runOnUI(() => {\n mutable.value = newValue;\n })();\n }\n },\n get value(): Value {\n if (SHOULD_BE_USE_WEB) {\n return value;\n }\n const uiValueGetter = executeOnUIRuntimeSync((sv: Mutable<Value>) => {\n return sv.value;\n });\n return uiValueGetter(mutable);\n },\n set _value(newValue: Value) {\n if (!SHOULD_BE_USE_WEB) {\n throw new Error(\n '[Reanimated] Setting `_value` directly is only possible on the UI runtime. Perhaps you want to assign to `value` instead?'\n );\n }\n value = newValue;\n listeners!.forEach((listener) => {\n listener(newValue);\n });\n },\n get _value(): Value {\n if (SHOULD_BE_USE_WEB) {\n return value;\n }\n throw new Error(\n '[Reanimated] Reading from `_value` directly is only possible on the UI runtime. Perhaps you passed an Animated Style to a non-animated component?'\n );\n },\n\n modify: (modifier, forceUpdate = true) => {\n if (!SHOULD_BE_USE_WEB) {\n runOnUI(() => {\n mutable.modify(modifier, forceUpdate);\n })();\n } else {\n valueSetter(\n mutable,\n modifier !== undefined ? modifier(mutable.value) : mutable.value,\n forceUpdate\n );\n }\n },\n addListener: (id: number, listener: Listener<Value>) => {\n if (!SHOULD_BE_USE_WEB) {\n throw new Error(\n '[Reanimated] Adding listeners is only possible on the UI runtime.'\n );\n }\n listeners!.set(id, listener);\n },\n removeListener: (id: number) => {\n if (!SHOULD_BE_USE_WEB) {\n throw new Error(\n '[Reanimated] Removing listeners is only possible on the UI runtime.'\n );\n }\n listeners!.delete(id);\n },\n _isReanimatedSharedValue: true,\n };\n shareableMappingCache.set(mutable, handle);\n return mutable;\n}\n"],"mappings":"AAAA,YAAY;;AACZ,SAASA,cAAc,QAAQ,mBAAmB;AAElD,SAASC,2BAA2B,QAAQ,cAAc;AAC1D,SAASC,qBAAqB,QAAQ,yBAAyB;AAC/D,SAASC,sBAAsB,EAAEC,OAAO,QAAQ,WAAW;AAC3D,SAASC,WAAW,QAAQ,eAAe;AAE3C,MAAMC,iBAAiB,GAAGN,cAAc,EAAE;AAI1C,OAAO,SAASO,aAAaA,CAAQC,OAAc,EAAkB;EACnE,SAAS;;EAET,MAAMC,SAAS,GAAG,IAAIC,GAAG,EAA2B;EACpD,IAAIC,KAAK,GAAGH,OAAO;EAEnB,MAAMI,IAAoB,GAAG;IAC3B,IAAID,KAAKA,CAACE,QAAQ,EAAE;MAClBR,WAAW,CAACO,IAAI,EAAEC,QAAQ,CAAC;IAC7B,CAAC;IACD,IAAIF,KAAKA,CAAA,EAAG;MACV,OAA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OAAO,CAACtB,KAAK,CAAC,GAAGsB,OAAO,CAACtB,KAAK,EAChEQ,WAAW,CACZ;MACH;IACF,CAAC;IACDI,WAAW,EAAEA,CAACC,EAAU,EAAER,QAAyB,KAAK;MACtD,IAAI,CAACV,iBAAiB,EAAE;QACtB,MAAM,IAAI8B,KAAK,CACb,mEAAmE,CACpE;MACH;MACA3B,SAAS,CAAEgB,GAAG,CAACD,EAAE,EAAER,QAAQ,CAAC;IAC9B,CAAC;IACDU,cAAc,EAAGF,EAAU,IAAK;MAC9B,IAAI,CAAClB,iBAAiB,EAAE;QACtB,MAAM,IAAI8B,KAAK,CACb,qEAAqE,CACtE;MACH;MACA3B,SAAS,CAAEkB,MAAM,CAACH,EAAE,CAAC;IACvB,CAAC;IACDK,wBAAwB,EAAE;EAC5B,CAAC;EACD3B,qBAAqB,CAACuB,GAAG,CAACQ,OAAO,EAAEF,MAAM,CAAC;EAC1C,OAAOE,OAAO;AAChB"}
1
+ {"version":3,"names":["shouldBeUseWeb","makeShareableCloneRecursive","shareableMappingCache","executeOnUIRuntimeSync","runOnUI","valueSetter","SHOULD_BE_USE_WEB","makeUIMutable","initial","listeners","Map","value","self","newValue","_value","forEach","listener","modify","modifier","forceUpdate","undefined","addListener","id","set","removeListener","delete","_animation","_isReanimatedSharedValue","makeMutable","handle","__init","mutable","uiValueGetter","sv","Error"],"sources":["mutables.ts"],"sourcesContent":["'use strict';\nimport { shouldBeUseWeb } from './PlatformChecker';\nimport type { Mutable } from './commonTypes';\nimport { makeShareableCloneRecursive } from './shareables';\nimport { shareableMappingCache } from './shareableMappingCache';\nimport { executeOnUIRuntimeSync, runOnUI } from './threads';\nimport { valueSetter } from './valueSetter';\n\nconst SHOULD_BE_USE_WEB = shouldBeUseWeb();\n\ntype Listener<Value> = (newValue: Value) => void;\n\nexport function makeUIMutable<Value>(initial: Value): Mutable<Value> {\n 'worklet';\n\n const listeners = new Map<number, Listener<Value>>();\n let value = initial;\n\n const self: Mutable<Value> = {\n set value(newValue) {\n valueSetter(self, newValue);\n },\n get value() {\n return value;\n },\n /**\n * _value prop should only be accessed by the valueSetter implementation\n * which may make the decision about updating the mutable value depending\n * on the provided new value. All other places should only attempt to modify\n * the mutable by assigning to value prop directly.\n */\n set _value(newValue: Value) {\n value = newValue;\n listeners.forEach((listener) => {\n listener(newValue);\n });\n },\n get _value(): Value {\n return value;\n },\n modify: (modifier, forceUpdate = true) => {\n valueSetter(\n self,\n modifier !== undefined ? modifier(value) : value,\n forceUpdate\n );\n },\n addListener: (id: number, listener: Listener<Value>) => {\n listeners.set(id, listener);\n },\n removeListener: (id: number) => {\n listeners.delete(id);\n },\n _animation: null,\n _isReanimatedSharedValue: true,\n };\n return self;\n}\n\nexport function makeMutable<Value>(initial: Value): Mutable<Value> {\n let value: Value = initial;\n const handle = makeShareableCloneRecursive({\n __init: () => {\n 'worklet';\n return makeUIMutable(initial);\n },\n });\n // listeners can only work on JS thread on Web and jest environments\n const listeners = SHOULD_BE_USE_WEB\n ? new Map<number, Listener<Value>>()\n : undefined;\n const mutable: Mutable<Value> = {\n set value(newValue) {\n if (SHOULD_BE_USE_WEB) {\n valueSetter(mutable, newValue);\n } else {\n runOnUI(() => {\n mutable.value = newValue;\n })();\n }\n },\n get value(): Value {\n if (SHOULD_BE_USE_WEB) {\n return value;\n }\n const uiValueGetter = executeOnUIRuntimeSync((sv: Mutable<Value>) => {\n return sv.value;\n });\n return uiValueGetter(mutable);\n },\n set _value(newValue: Value) {\n if (!SHOULD_BE_USE_WEB) {\n throw new Error(\n '[Reanimated] Setting `_value` directly is only possible on the UI runtime. Perhaps you want to assign to `value` instead?'\n );\n }\n value = newValue;\n listeners!.forEach((listener) => {\n listener(newValue);\n });\n },\n get _value(): Value {\n if (SHOULD_BE_USE_WEB) {\n return value;\n }\n throw new Error(\n '[Reanimated] Reading from `_value` directly is only possible on the UI runtime. Perhaps you passed an Animated Style to a non-animated component?'\n );\n },\n\n modify: (modifier, forceUpdate = true) => {\n if (!SHOULD_BE_USE_WEB) {\n runOnUI(() => {\n mutable.modify(modifier, forceUpdate);\n })();\n } else {\n valueSetter(\n mutable,\n modifier !== undefined ? modifier(mutable.value) : mutable.value,\n forceUpdate\n );\n }\n },\n addListener: (id: number, listener: Listener<Value>) => {\n if (!SHOULD_BE_USE_WEB) {\n throw new Error(\n '[Reanimated] Adding listeners is only possible on the UI runtime.'\n );\n }\n listeners!.set(id, listener);\n },\n removeListener: (id: number) => {\n if (!SHOULD_BE_USE_WEB) {\n throw new Error(\n '[Reanimated] Removing listeners is only possible on the UI runtime.'\n );\n }\n listeners!.delete(id);\n },\n _isReanimatedSharedValue: true,\n };\n shareableMappingCache.set(mutable, handle);\n return mutable;\n}\n"],"mappings":"AAAA,YAAY;;AACZ,SAASA,cAAc,QAAQ,mBAAmB;AAElD,SAASC,2BAA2B,QAAQ,cAAc;AAC1D,SAASC,qBAAqB,QAAQ,yBAAyB;AAC/D,SAASC,sBAAsB,EAAEC,OAAO,QAAQ,WAAW;AAC3D,SAASC,WAAW,QAAQ,eAAe;AAE3C,MAAMC,iBAAiB,GAAGN,cAAc,CAAC,CAAC;AAI1C,OAAO,SAASO,aAAaA,CAAQC,OAAc,EAAkB;EACnE,SAAS;;EAET,MAAMC,SAAS,GAAG,IAAIC,GAAG,CAA0B,CAAC;EACpD,IAAIC,KAAK,GAAGH,OAAO;EAEnB,MAAMI,IAAoB,GAAG;IAC3B,IAAID,KAAKA,CAACE,QAAQ,EAAE;MAClBR,WAAW,CAACO,IAAI,EAAEC,QAAQ,CAAC;IAC7B,CAAC;IACD,IAAIF,KAAKA,CAAA,EAAG;MACV,OAAOA,KAAK;IACd,CAAC;IACD;AACJ;AACA;AACA;AACA;AACA;IACI,IAAIG,MAAMA,CAACD,QAAe,EAAE;MAC1BF,KAAK,GAAGE,QAAQ;MAChBJ,SAAS,CAACM,OAAO,CAAEC,QAAQ,IAAK;QAC9BA,QAAQ,CAACH,QAAQ,CAAC;MACpB,CAAC,CAAC;IACJ,CAAC;IACD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CACb,qEACF,CAAC;MACH;MACAzB,SAAS,CAAEgB,MAAM,CAACH,EAAE,CAAC;IACvB,CAAC;IACDK,wBAAwB,EAAE;EAC5B,CAAC;EACDzB,qBAAqB,CAACqB,GAAG,CAACQ,OAAO,EAAEF,MAAM,CAAC;EAC1C,OAAOE,OAAO;AAChB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["default","RNRenderer"],"sources":["RNRenderer.ts"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-nocheck\n'use strict';\nexport { default as RNRenderer } from 'react-native/Libraries/Renderer/shims/ReactNative';\n"],"mappings":"AAAA;AACA;AACA,YAAY;;AACZ,SAASA,OAAO,IAAIC,UAAU,QAAQ,mDAAmD"}
1
+ {"version":3,"names":["default","RNRenderer"],"sources":["RNRenderer.ts"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-nocheck\n'use strict';\nexport { default as RNRenderer } from 'react-native/Libraries/Renderer/shims/ReactNative';\n"],"mappings":"AAAA;AACA;AACA,YAAY;;AACZ,SAASA,OAAO,IAAIC,UAAU,QAAQ,mDAAmD","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["module","exports"],"sources":["RNRenderer.web.ts"],"sourcesContent":["'use strict';\n// RNRender is not used for web. An export is still defined to eliminate warnings from bundlers such as esbuild.\nmodule.exports = null;\n"],"mappings":"AAAA,YAAY;;AACZ;AACAA,MAAM,CAACC,OAAO,GAAG,IAAI"}
1
+ {"version":3,"names":["module","exports"],"sources":["RNRenderer.web.ts"],"sourcesContent":["'use strict';\n// RNRender is not used for web. An export is still defined to eliminate warnings from bundlers such as esbuild.\nmodule.exports = null;\n"],"mappings":"AAAA,YAAY;;AACZ;AACAA,MAAM,CAACC,OAAO,GAAG,IAAI","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["jsVersion","checkCppVersion","cppVersion","global","_REANIMATED_VERSION_CPP","undefined","console","warn","ok","matchVersion","Error","version1","version2","match","major1","minor1","split","major2","minor2"],"sources":["checkCppVersion.ts"],"sourcesContent":["'use strict';\nimport { jsVersion } from './jsVersion';\n\nexport function checkCppVersion() {\n const cppVersion = global._REANIMATED_VERSION_CPP;\n if (cppVersion === undefined) {\n console.warn(\n `[Reanimated] Couldn't determine the version of the native part of Reanimated.\n See \\`https://docs.swmansion.com/react-native-reanimated/docs/guides/troubleshooting#couldnt-determine-the-version-of-the-native-part-of-reanimated\\` for more details.`\n );\n return;\n }\n const ok = matchVersion(jsVersion, cppVersion);\n if (!ok) {\n throw new Error(\n `[Reanimated] Mismatch between JavaScript part and native part of Reanimated (${jsVersion} vs ${cppVersion}).\n See \\`https://docs.swmansion.com/react-native-reanimated/docs/guides/troubleshooting#mismatch-between-javascript-part-and-native-part-of-reanimated\\` for more details.`\n );\n }\n}\n\n// This is used only in test files, therefore it is reported by ts-prune (which is desired)\n// ts-prune-ignore-next\nexport function matchVersion(version1: string, version2: string) {\n if (version1.match(/^\\d+\\.\\d+\\.\\d+$/) && version2.match(/^\\d+\\.\\d+\\.\\d+$/)) {\n // x.y.z, compare only major and minor, skip patch\n const [major1, minor1] = version1.split('.');\n const [major2, minor2] = version2.split('.');\n return major1 === major2 && minor1 === minor2;\n } else {\n // alpha, beta or rc, compare everything\n return version1 === version2;\n }\n}\n"],"mappings":"AAAA,YAAY;;AACZ,SAASA,SAAS,QAAQ,aAAa;AAEvC,OAAO,SAASC,eAAeA,CAAA,EAAG;EAChC,MAAMC,UAAU,GAAGC,MAAM,CAACC,uBAAuB;EACjD,IAAIF,UAAU,KAAKG,SAAS,EAAE;IAC5BC,OAAO,CAACC,IAAI,CACT;AACP,4KAA4K,CACvK;IACD;EACF;EACA,MAAMC,EAAE,GAAGC,YAAY,CAACT,SAAS,EAAEE,UAAU,CAAC;EAC9C,IAAI,CAACM,EAAE,EAAE;IACP,MAAM,IAAIE,KAAK,CACZ,gFAA+EV,SAAU,OAAME,UAAW;AACjH,4KAA4K,CACvK;EACH;AACF;;AAEA;AACA;AACA,OAAO,SAASO,YAAYA,CAACE,QAAgB,EAAEC,QAAgB,EAAE;EAC/D,IAAID,QAAQ,CAACE,KAAK,CAAC,iBAAiB,CAAC,IAAID,QAAQ,CAACC,KAAK,CAAC,iBAAiB,CAAC,EAAE;IAC1E;IACA,MAAM,CAACC,MAAM,EAAEC,MAAM,CAAC,GAAGJ,QAAQ,CAACK,KAAK,CAAC,GAAG,CAAC;IAC5C,MAAM,CAACC,MAAM,EAAEC,MAAM,CAAC,GAAGN,QAAQ,CAACI,KAAK,CAAC,GAAG,CAAC;IAC5C,OAAOF,MAAM,KAAKG,MAAM,IAAIF,MAAM,KAAKG,MAAM;EAC/C,CAAC,MAAM;IACL;IACA,OAAOP,QAAQ,KAAKC,QAAQ;EAC9B;AACF"}
1
+ {"version":3,"names":["jsVersion","checkCppVersion","cppVersion","global","_REANIMATED_VERSION_CPP","undefined","console","warn","ok","matchVersion","Error","version1","version2","match","major1","minor1","split","major2","minor2"],"sources":["checkCppVersion.ts"],"sourcesContent":["'use strict';\nimport { jsVersion } from './jsVersion';\n\nexport function checkCppVersion() {\n const cppVersion = global._REANIMATED_VERSION_CPP;\n if (cppVersion === undefined) {\n console.warn(\n `[Reanimated] Couldn't determine the version of the native part of Reanimated.\n See \\`https://docs.swmansion.com/react-native-reanimated/docs/guides/troubleshooting#couldnt-determine-the-version-of-the-native-part-of-reanimated\\` for more details.`\n );\n return;\n }\n const ok = matchVersion(jsVersion, cppVersion);\n if (!ok) {\n throw new Error(\n `[Reanimated] Mismatch between JavaScript part and native part of Reanimated (${jsVersion} vs ${cppVersion}).\n See \\`https://docs.swmansion.com/react-native-reanimated/docs/guides/troubleshooting#mismatch-between-javascript-part-and-native-part-of-reanimated\\` for more details.`\n );\n }\n}\n\n// This is used only in test files, therefore it is reported by ts-prune (which is desired)\n// ts-prune-ignore-next\nexport function matchVersion(version1: string, version2: string) {\n if (version1.match(/^\\d+\\.\\d+\\.\\d+$/) && version2.match(/^\\d+\\.\\d+\\.\\d+$/)) {\n // x.y.z, compare only major and minor, skip patch\n const [major1, minor1] = version1.split('.');\n const [major2, minor2] = version2.split('.');\n return major1 === major2 && minor1 === minor2;\n } else {\n // alpha, beta or rc, compare everything\n return version1 === version2;\n }\n}\n"],"mappings":"AAAA,YAAY;;AACZ,SAASA,SAAS,QAAQ,aAAa;AAEvC,OAAO,SAASC,eAAeA,CAAA,EAAG;EAChC,MAAMC,UAAU,GAAGC,MAAM,CAACC,uBAAuB;EACjD,IAAIF,UAAU,KAAKG,SAAS,EAAE;IAC5BC,OAAO,CAACC,IAAI,CACT;AACP,4KACI,CAAC;IACD;EACF;EACA,MAAMC,EAAE,GAAGC,YAAY,CAACT,SAAS,EAAEE,UAAU,CAAC;EAC9C,IAAI,CAACM,EAAE,EAAE;IACP,MAAM,IAAIE,KAAK,CACZ,gFAA+EV,SAAU,OAAME,UAAW;AACjH,4KACI,CAAC;EACH;AACF;;AAEA;AACA;AACA,OAAO,SAASO,YAAYA,CAACE,QAAgB,EAAEC,QAAgB,EAAE;EAC/D,IAAID,QAAQ,CAACE,KAAK,CAAC,iBAAiB,CAAC,IAAID,QAAQ,CAACC,KAAK,CAAC,iBAAiB,CAAC,EAAE;IAC1E;IACA,MAAM,CAACC,MAAM,EAAEC,MAAM,CAAC,GAAGJ,QAAQ,CAACK,KAAK,CAAC,GAAG,CAAC;IAC5C,MAAM,CAACC,MAAM,EAAEC,MAAM,CAAC,GAAGN,QAAQ,CAACI,KAAK,CAAC,GAAG,CAAC;IAC5C,OAAOF,MAAM,KAAKG,MAAM,IAAIF,MAAM,KAAKG,MAAM;EAC/C,CAAC,MAAM;IACL;IACA,OAAOP,QAAQ,KAAKC,QAAQ;EAC9B;AACF","ignoreList":[]}
@@ -5,5 +5,5 @@
5
5
  * with the version used to build the native part of the library in runtime.
6
6
  * Remember to keep this in sync with the version declared in `package.json`
7
7
  */
8
- export const jsVersion = '3.8.1';
8
+ export const jsVersion = '3.9.0-layout-animation-experimental';
9
9
  //# sourceMappingURL=jsVersion.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["jsVersion"],"sources":["jsVersion.ts"],"sourcesContent":["'use strict';\n/**\n * We hardcode the version of Reanimated here in order to compare it\n * with the version used to build the native part of the library in runtime.\n * Remember to keep this in sync with the version declared in `package.json`\n */\nexport const jsVersion = '3.8.1';\n"],"mappings":"AAAA,YAAY;;AACZ;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,SAAS,GAAG,OAAO"}
1
+ {"version":3,"names":["jsVersion"],"sources":["jsVersion.ts"],"sourcesContent":["'use strict';\n/**\n * We hardcode the version of Reanimated here in order to compare it\n * with the version used to build the native part of the library in runtime.\n * Remember to keep this in sync with the version declared in `package.json`\n */\nexport const jsVersion = '3.9.0-layout-animation-experimental';\n"],"mappings":"AAAA,YAAY;;AACZ;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,SAAS,GAAG,qCAAqC","ignoreList":[]}
@@ -10,20 +10,18 @@ import { isChromeDebugger, isFabric, isJest, shouldBeUseWeb } from '../PlatformC
10
10
  * @see https://docs.swmansion.com/react-native-reanimated/docs/advanced/dispatchCommand
11
11
  */
12
12
  export let dispatchCommand;
13
- function dispatchCommandFabric(animatedRef, commandName) {
13
+ function dispatchCommandFabric(animatedRef, commandName, args = []) {
14
14
  'worklet';
15
15
 
16
- let args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
17
16
  if (!_WORKLET) {
18
17
  return;
19
18
  }
20
19
  const shadowNodeWrapper = animatedRef();
21
20
  global._dispatchCommandFabric(shadowNodeWrapper, commandName, args);
22
21
  }
23
- function dispatchCommandPaper(animatedRef, commandName) {
22
+ function dispatchCommandPaper(animatedRef, commandName, args = []) {
24
23
  'worklet';
25
24
 
26
- let args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
27
25
  if (!_WORKLET) {
28
26
  return;
29
27
  }
@@ -1 +1 @@
1
- {"version":3,"names":["isChromeDebugger","isFabric","isJest","shouldBeUseWeb","dispatchCommand","dispatchCommandFabric","animatedRef","commandName","args","arguments","length","undefined","_WORKLET","shadowNodeWrapper","global","_dispatchCommandFabric","dispatchCommandPaper","viewTag","_dispatchCommandPaper","dispatchCommandJest","console","warn","dispatchCommandChromeDebugger","dispatchCommandDefault"],"sources":["dispatchCommand.ts"],"sourcesContent":["'use strict';\nimport type { ShadowNodeWrapper } from '../commonTypes';\nimport {\n isChromeDebugger,\n isFabric,\n isJest,\n shouldBeUseWeb,\n} from '../PlatformChecker';\nimport type {\n AnimatedRef,\n AnimatedRefOnJS,\n AnimatedRefOnUI,\n} from '../hook/commonTypes';\nimport type { Component } from 'react';\n\ntype DispatchCommand = <T extends Component>(\n animatedRef: AnimatedRef<T>,\n commandName: string,\n args?: unknown[]\n) => void;\n\n/**\n * Lets you synchronously call a command of a native component.\n *\n * @param animatedRef - An [animated ref](https://docs.swmansion.com/react-native-reanimated/docs/core/useAnimatedRef#returns) connected to the component you'd want to call the command on.\n * @param commandName - The name of the command to dispatch (e.g. `\"focus\"` or `\"scrollToEnd\"`).\n * @param args - An optional array of arguments for the command.\n * @see https://docs.swmansion.com/react-native-reanimated/docs/advanced/dispatchCommand\n */\nexport let dispatchCommand: DispatchCommand;\n\nfunction dispatchCommandFabric(\n animatedRef: AnimatedRefOnJS | AnimatedRefOnUI,\n commandName: string,\n args: Array<unknown> = []\n) {\n 'worklet';\n if (!_WORKLET) {\n return;\n }\n\n const shadowNodeWrapper = animatedRef() as ShadowNodeWrapper;\n global._dispatchCommandFabric!(shadowNodeWrapper, commandName, args);\n}\n\nfunction dispatchCommandPaper(\n animatedRef: AnimatedRefOnJS | AnimatedRefOnUI,\n commandName: string,\n args: Array<unknown> = []\n) {\n 'worklet';\n if (!_WORKLET) {\n return;\n }\n\n const viewTag = animatedRef() as number;\n global._dispatchCommandPaper!(viewTag, commandName, args);\n}\n\nfunction dispatchCommandJest() {\n console.warn('[Reanimated] dispatchCommand() is not supported with Jest.');\n}\n\nfunction dispatchCommandChromeDebugger() {\n console.warn(\n '[Reanimated] dispatchCommand() is not supported with Chrome Debugger.'\n );\n}\n\nfunction dispatchCommandDefault() {\n console.warn(\n '[Reanimated] dispatchCommand() is not supported on this configuration.'\n );\n}\n\nif (!shouldBeUseWeb()) {\n // Those assertions are actually correct since on Native platforms `AnimatedRef` is\n // mapped as a different function in `shareableMappingCache` and\n // TypeScript is not able to infer that.\n if (isFabric()) {\n dispatchCommand = dispatchCommandFabric as unknown as DispatchCommand;\n } else {\n dispatchCommand = dispatchCommandPaper as unknown as DispatchCommand;\n }\n} else if (isJest()) {\n dispatchCommand = dispatchCommandJest;\n} else if (isChromeDebugger()) {\n dispatchCommand = dispatchCommandChromeDebugger;\n} else {\n dispatchCommand = dispatchCommandDefault;\n}\n"],"mappings":"AAAA,YAAY;;AAEZ,SACEA,gBAAgB,EAChBC,QAAQ,EACRC,MAAM,EACNC,cAAc,QACT,oBAAoB;AAc3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,IAAIC,eAAgC;AAE3C,SAASC,qBAAqBA,CAC5BC,WAA8C,EAC9CC,WAAmB,EAEnB;EACA,SAAS;;EAAC,IAFVC,IAAoB,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,EAAE;EAGzB,IAAI,CAACG,QAAQ,EAAE;IACb;EACF;EAEA,MAAMC,iBAAiB,GAAGP,WAAW,EAAuB;EAC5DQ,MAAM,CAACC,sBAAsB,CAAEF,iBAAiB,EAAEN,WAAW,EAAEC,IAAI,CAAC;AACtE;AAEA,SAASQ,oBAAoBA,CAC3BV,WAA8C,EAC9CC,WAAmB,EAEnB;EACA,SAAS;;EAAC,IAFVC,IAAoB,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,EAAE;EAGzB,IAAI,CAACG,QAAQ,EAAE;IACb;EACF;EAEA,MAAMK,OAAO,GAAGX,WAAW,EAAY;EACvCQ,MAAM,CAACI,qBAAqB,CAAED,OAAO,EAAEV,WAAW,EAAEC,IAAI,CAAC;AAC3D;AAEA,SAASW,mBAAmBA,CAAA,EAAG;EAC7BC,OAAO,CAACC,IAAI,CAAC,4DAA4D,CAAC;AAC5E;AAEA,SAASC,6BAA6BA,CAAA,EAAG;EACvCF,OAAO,CAACC,IAAI,CACV,uEAAuE,CACxE;AACH;AAEA,SAASE,sBAAsBA,CAAA,EAAG;EAChCH,OAAO,CAACC,IAAI,CACV,wEAAwE,CACzE;AACH;AAEA,IAAI,CAAClB,cAAc,EAAE,EAAE;EACrB;EACA;EACA;EACA,IAAIF,QAAQ,EAAE,EAAE;IACdG,eAAe,GAAGC,qBAAmD;EACvE,CAAC,MAAM;IACLD,eAAe,GAAGY,oBAAkD;EACtE;AACF,CAAC,MAAM,IAAId,MAAM,EAAE,EAAE;EACnBE,eAAe,GAAGe,mBAAmB;AACvC,CAAC,MAAM,IAAInB,gBAAgB,EAAE,EAAE;EAC7BI,eAAe,GAAGkB,6BAA6B;AACjD,CAAC,MAAM;EACLlB,eAAe,GAAGmB,sBAAsB;AAC1C"}
1
+ {"version":3,"names":["isChromeDebugger","isFabric","isJest","shouldBeUseWeb","dispatchCommand","dispatchCommandFabric","animatedRef","commandName","args","_WORKLET","shadowNodeWrapper","global","_dispatchCommandFabric","dispatchCommandPaper","viewTag","_dispatchCommandPaper","dispatchCommandJest","console","warn","dispatchCommandChromeDebugger","dispatchCommandDefault"],"sources":["dispatchCommand.ts"],"sourcesContent":["'use strict';\nimport type { ShadowNodeWrapper } from '../commonTypes';\nimport {\n isChromeDebugger,\n isFabric,\n isJest,\n shouldBeUseWeb,\n} from '../PlatformChecker';\nimport type {\n AnimatedRef,\n AnimatedRefOnJS,\n AnimatedRefOnUI,\n} from '../hook/commonTypes';\nimport type { Component } from 'react';\n\ntype DispatchCommand = <T extends Component>(\n animatedRef: AnimatedRef<T>,\n commandName: string,\n args?: unknown[]\n) => void;\n\n/**\n * Lets you synchronously call a command of a native component.\n *\n * @param animatedRef - An [animated ref](https://docs.swmansion.com/react-native-reanimated/docs/core/useAnimatedRef#returns) connected to the component you'd want to call the command on.\n * @param commandName - The name of the command to dispatch (e.g. `\"focus\"` or `\"scrollToEnd\"`).\n * @param args - An optional array of arguments for the command.\n * @see https://docs.swmansion.com/react-native-reanimated/docs/advanced/dispatchCommand\n */\nexport let dispatchCommand: DispatchCommand;\n\nfunction dispatchCommandFabric(\n animatedRef: AnimatedRefOnJS | AnimatedRefOnUI,\n commandName: string,\n args: Array<unknown> = []\n) {\n 'worklet';\n if (!_WORKLET) {\n return;\n }\n\n const shadowNodeWrapper = animatedRef() as ShadowNodeWrapper;\n global._dispatchCommandFabric!(shadowNodeWrapper, commandName, args);\n}\n\nfunction dispatchCommandPaper(\n animatedRef: AnimatedRefOnJS | AnimatedRefOnUI,\n commandName: string,\n args: Array<unknown> = []\n) {\n 'worklet';\n if (!_WORKLET) {\n return;\n }\n\n const viewTag = animatedRef() as number;\n global._dispatchCommandPaper!(viewTag, commandName, args);\n}\n\nfunction dispatchCommandJest() {\n console.warn('[Reanimated] dispatchCommand() is not supported with Jest.');\n}\n\nfunction dispatchCommandChromeDebugger() {\n console.warn(\n '[Reanimated] dispatchCommand() is not supported with Chrome Debugger.'\n );\n}\n\nfunction dispatchCommandDefault() {\n console.warn(\n '[Reanimated] dispatchCommand() is not supported on this configuration.'\n );\n}\n\nif (!shouldBeUseWeb()) {\n // Those assertions are actually correct since on Native platforms `AnimatedRef` is\n // mapped as a different function in `shareableMappingCache` and\n // TypeScript is not able to infer that.\n if (isFabric()) {\n dispatchCommand = dispatchCommandFabric as unknown as DispatchCommand;\n } else {\n dispatchCommand = dispatchCommandPaper as unknown as DispatchCommand;\n }\n} else if (isJest()) {\n dispatchCommand = dispatchCommandJest;\n} else if (isChromeDebugger()) {\n dispatchCommand = dispatchCommandChromeDebugger;\n} else {\n dispatchCommand = dispatchCommandDefault;\n}\n"],"mappings":"AAAA,YAAY;;AAE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AAe,GAAGe,6BAA6B;AACjD,CAAC,MAAM;EACLf,eAAe,GAAGgB,sBAAsB;AAC1C","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["dispatchCommand","console","warn"],"sources":["dispatchCommand.web.ts"],"sourcesContent":["'use strict';\n\nexport function dispatchCommand() {\n console.warn('[Reanimated] dispatchCommand() is not supported on web.');\n}\n"],"mappings":"AAAA,YAAY;;AAEZ,OAAO,SAASA,eAAeA,CAAA,EAAG;EAChCC,OAAO,CAACC,IAAI,CAAC,yDAAyD,CAAC;AACzE"}
1
+ {"version":3,"names":["dispatchCommand","console","warn"],"sources":["dispatchCommand.web.ts"],"sourcesContent":["'use strict';\n\nexport function dispatchCommand() {\n console.warn('[Reanimated] dispatchCommand() is not supported on web.');\n}\n"],"mappings":"AAAA,YAAY;;AAEZ,OAAO,SAASA,eAAeA,CAAA,EAAG;EAChCC,OAAO,CAACC,IAAI,CAAC,yDAAyD,CAAC;AACzE","ignoreList":[]}
@@ -23,8 +23,8 @@ export function getRelativeCoords(animatedRef, absoluteX, absoluteY) {
23
23
  return null;
24
24
  }
25
25
  return {
26
- x: absoluteX - parentCoords.x,
27
- y: absoluteY - parentCoords.y
26
+ x: absoluteX - parentCoords.pageX,
27
+ y: absoluteY - parentCoords.pageY
28
28
  };
29
29
  }
30
30
  //# sourceMappingURL=getRelativeCoords.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["measure","getRelativeCoords","animatedRef","absoluteX","absoluteY","parentCoords","x","y"],"sources":["getRelativeCoords.ts"],"sourcesContent":["'use strict';\nimport type { Component } from 'react';\nimport { measure } from './measure';\nimport type { AnimatedRef } from '../hook/commonTypes';\n\n/**\n * An object which contains relative coordinates.\n */\nexport interface ComponentCoords {\n x: number;\n y: number;\n}\n\n/**\n * Lets you determines the location on the screen, relative to the given view.\n *\n * @param animatedRef - An [animated ref](https://docs.swmansion.com/react-native-reanimated/docs/core/useAnimatedRef#returns) connected to the component you'd want to get the coordinates from.\n * @param absoluteX - A number which is an absolute x coordinate.\n * @param absoluteY - A number which is an absolute y coordinate.\n * @returns An object which contains relative coordinates - {@link ComponentCoords}.\n * @see https://docs.swmansion.com/react-native-reanimated/docs/utilities/getRelativeCoords\n */\nexport function getRelativeCoords(\n animatedRef: AnimatedRef<Component>,\n absoluteX: number,\n absoluteY: number\n): ComponentCoords | null {\n 'worklet';\n const parentCoords = measure(animatedRef);\n if (parentCoords === null) {\n return null;\n }\n return {\n x: absoluteX - parentCoords.x,\n y: absoluteY - parentCoords.y,\n };\n}\n"],"mappings":"AAAA,YAAY;;AAEZ,SAASA,OAAO,QAAQ,WAAW;;AAGnC;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,iBAAiBA,CAC/BC,WAAmC,EACnCC,SAAiB,EACjBC,SAAiB,EACO;EACxB,SAAS;;EACT,MAAMC,YAAY,GAAGL,OAAO,CAACE,WAAW,CAAC;EACzC,IAAIG,YAAY,KAAK,IAAI,EAAE;IACzB,OAAO,IAAI;EACb;EACA,OAAO;IACLC,CAAC,EAAEH,SAAS,GAAGE,YAAY,CAACC,CAAC;IAC7BC,CAAC,EAAEH,SAAS,GAAGC,YAAY,CAACE;EAC9B,CAAC;AACH"}
1
+ {"version":3,"names":["measure","getRelativeCoords","animatedRef","absoluteX","absoluteY","parentCoords","x","pageX","y","pageY"],"sources":["getRelativeCoords.ts"],"sourcesContent":["'use strict';\nimport type { Component } from 'react';\nimport { measure } from './measure';\nimport type { AnimatedRef } from '../hook/commonTypes';\n\n/**\n * An object which contains relative coordinates.\n */\nexport interface ComponentCoords {\n x: number;\n y: number;\n}\n\n/**\n * Lets you determines the location on the screen, relative to the given view.\n *\n * @param animatedRef - An [animated ref](https://docs.swmansion.com/react-native-reanimated/docs/core/useAnimatedRef#returns) connected to the component you'd want to get the coordinates from.\n * @param absoluteX - A number which is an absolute x coordinate.\n * @param absoluteY - A number which is an absolute y coordinate.\n * @returns An object which contains relative coordinates - {@link ComponentCoords}.\n * @see https://docs.swmansion.com/react-native-reanimated/docs/utilities/getRelativeCoords\n */\nexport function getRelativeCoords(\n animatedRef: AnimatedRef<Component>,\n absoluteX: number,\n absoluteY: number\n): ComponentCoords | null {\n 'worklet';\n const parentCoords = measure(animatedRef);\n if (parentCoords === null) {\n return null;\n }\n return {\n x: absoluteX - parentCoords.pageX,\n y: absoluteY - parentCoords.pageY,\n };\n}\n"],"mappings":"AAAA,YAAY;;AAEZ,SAASA,OAAO,QAAQ,WAAW;;AAGnC;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,iBAAiBA,CAC/BC,WAAmC,EACnCC,SAAiB,EACjBC,SAAiB,EACO;EACxB,SAAS;;EACT,MAAMC,YAAY,GAAGL,OAAO,CAACE,WAAW,CAAC;EACzC,IAAIG,YAAY,KAAK,IAAI,EAAE;IACzB,OAAO,IAAI;EACb;EACA,OAAO;IACLC,CAAC,EAAEH,SAAS,GAAGE,YAAY,CAACE,KAAK;IACjCC,CAAC,EAAEJ,SAAS,GAAGC,YAAY,CAACI;EAC9B,CAAC;AACH","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["dispatchCommand","measure","scrollTo","setGestureState","setNativeProps","getRelativeCoords"],"sources":["index.ts"],"sourcesContent":["'use strict';\nexport { dispatchCommand } from './dispatchCommand';\nexport { measure } from './measure';\nexport { scrollTo } from './scrollTo';\nexport { setGestureState } from './setGestureState';\nexport { setNativeProps } from './setNativeProps';\nexport { getRelativeCoords } from './getRelativeCoords';\nexport type { ComponentCoords } from './getRelativeCoords';\n"],"mappings":"AAAA,YAAY;;AACZ,SAASA,eAAe,QAAQ,mBAAmB;AACnD,SAASC,OAAO,QAAQ,WAAW;AACnC,SAASC,QAAQ,QAAQ,YAAY;AACrC,SAASC,eAAe,QAAQ,mBAAmB;AACnD,SAASC,cAAc,QAAQ,kBAAkB;AACjD,SAASC,iBAAiB,QAAQ,qBAAqB"}
1
+ {"version":3,"names":["dispatchCommand","measure","scrollTo","setGestureState","setNativeProps","getRelativeCoords"],"sources":["index.ts"],"sourcesContent":["'use strict';\nexport { dispatchCommand } from './dispatchCommand';\nexport { measure } from './measure';\nexport { scrollTo } from './scrollTo';\nexport { setGestureState } from './setGestureState';\nexport { setNativeProps } from './setNativeProps';\nexport { getRelativeCoords } from './getRelativeCoords';\nexport type { ComponentCoords } from './getRelativeCoords';\n"],"mappings":"AAAA,YAAY;;AACZ,SAASA,eAAe,QAAQ,mBAAmB;AACnD,SAASC,OAAO,QAAQ,WAAW;AACnC,SAASC,QAAQ,QAAQ,YAAY;AACrC,SAASC,eAAe,QAAQ,mBAAmB;AACnD,SAASC,cAAc,QAAQ,kBAAkB;AACjD,SAASC,iBAAiB,QAAQ,qBAAqB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["isChromeDebugger","isFabric","isJest","shouldBeUseWeb","measure","measureFabric","animatedRef","_WORKLET","viewTag","console","warn","measured","global","_measureFabric","x","isNaN","measurePaper","_measurePaper","measureJest","measureChromeDebugger","measureDefault"],"sources":["measure.ts"],"sourcesContent":["'use strict';\nimport type { MeasuredDimensions, ShadowNodeWrapper } from '../commonTypes';\nimport {\n isChromeDebugger,\n isFabric,\n isJest,\n shouldBeUseWeb,\n} from '../PlatformChecker';\nimport type {\n AnimatedRef,\n AnimatedRefOnJS,\n AnimatedRefOnUI,\n} from '../hook/commonTypes';\nimport type { Component } from 'react';\n\ntype Measure = <T extends Component>(\n animatedRef: AnimatedRef<T>\n) => MeasuredDimensions | null;\n\n/**\n * Lets you synchronously get the dimensions and position of a view on the screen.\n *\n * @param animatedRef - An [animated ref](https://docs.swmansion.com/react-native-reanimated/docs/core/useAnimatedRef#returns) connected to the component you'd want to get the measurements from.\n * @returns An object containing component measurements or null when the measurement couldn't be performed- {@link MeasuredDimensions}.\n * @see https://docs.swmansion.com/react-native-reanimated/docs/advanced/measure/\n */\nexport let measure: Measure;\n\nfunction measureFabric(animatedRef: AnimatedRefOnJS | AnimatedRefOnUI) {\n 'worklet';\n if (!_WORKLET) {\n return null;\n }\n\n const viewTag = animatedRef();\n if (viewTag === -1) {\n console.warn(\n `[Reanimated] The view with tag ${viewTag} is not a valid argument for measure(). This may be because the view is not currently rendered, which may not be a bug (e.g. an off-screen FlatList item).`\n );\n return null;\n }\n\n const measured = global._measureFabric!(viewTag as ShadowNodeWrapper);\n if (measured === null) {\n console.warn(\n `[Reanimated] The view has some undefined, not-yet-computed or meaningless value of \\`LayoutMetrics\\` type. This may be because the view is not currently rendered, which may not be a bug (e.g. an off-screen FlatList item).`\n );\n return null;\n } else if (measured.x === -1234567) {\n console.warn(\n `[Reanimated] The view returned an invalid measurement response. Please make sure the view is currently rendered.`\n );\n return null;\n } else if (isNaN(measured.x)) {\n console.warn(\n `[Reanimated] The view gets view-flattened on Android. To disable view-flattening, set \\`collapsable={false}\\` on this component.`\n );\n return null;\n } else {\n return measured;\n }\n}\n\nfunction measurePaper(animatedRef: AnimatedRefOnJS | AnimatedRefOnUI) {\n 'worklet';\n if (!_WORKLET) {\n return null;\n }\n\n const viewTag = animatedRef();\n if (viewTag === -1) {\n console.warn(\n `[Reanimated] The view with tag ${viewTag} is not a valid argument for measure(). This may be because the view is not currently rendered, which may not be a bug (e.g. an off-screen FlatList item).`\n );\n return null;\n }\n\n const measured = global._measurePaper!(viewTag as number);\n if (measured === null) {\n console.warn(\n `[Reanimated] The view with tag ${\n viewTag as number\n } has some undefined, not-yet-computed or meaningless value of \\`LayoutMetrics\\` type. This may be because the view is not currently rendered, which may not be a bug (e.g. an off-screen FlatList item).`\n );\n return null;\n } else if (measured.x === -1234567) {\n console.warn(\n `[Reanimated] The view with tag ${\n viewTag as number\n } returned an invalid measurement response. Please make sure the view is currently rendered.`\n );\n return null;\n } else if (isNaN(measured.x)) {\n console.warn(\n `[Reanimated] The view with tag ${\n viewTag as number\n } gets view-flattened on Android. To disable view-flattening, set \\`collapsable={false}\\` on this component.`\n );\n return null;\n } else {\n return measured;\n }\n}\n\nfunction measureJest() {\n console.warn('[Reanimated] measure() cannot be used with Jest.');\n return null;\n}\n\nfunction measureChromeDebugger() {\n console.warn('[Reanimated] measure() cannot be used with Chrome Debugger.');\n return null;\n}\n\nfunction measureDefault() {\n console.warn(\n '[Reanimated] measure() is not supported on this configuration.'\n );\n return null;\n}\n\nif (!shouldBeUseWeb()) {\n // Those assertions are actually correct since on Native platforms `AnimatedRef` is\n // mapped as a different function in `shareableMappingCache` and\n // TypeScript is not able to infer that.\n if (isFabric()) {\n measure = measureFabric as unknown as Measure;\n } else {\n measure = measurePaper as unknown as Measure;\n }\n} else if (isJest()) {\n measure = measureJest;\n} else if (isChromeDebugger()) {\n measure = measureChromeDebugger;\n} else {\n measure = measureDefault;\n}\n"],"mappings":"AAAA,YAAY;;AAEZ,SACEA,gBAAgB,EAChBC,QAAQ,EACRC,MAAM,EACNC,cAAc,QACT,oBAAoB;AAY3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,IAAIC,OAAgB;AAE3B,SAASC,aAAaA,CAACC,WAA8C,EAAE;EACrE,SAAS;;EACT,IAAI,CAACC,QAAQ,EAAE;IACb,OAAO,IAAI;EACb;EAEA,MAAMC,OAAO,GAAGF,WAAW,EAAE;EAC7B,IAAIE,OAAO,KAAK,CAAC,CAAC,EAAE;IAClBC,OAAO,CAACC,IAAI,CACT,kCAAiCF,OAAQ,4JAA2J,CACtM;IACD,OAAO,IAAI;EACb;EAEA,MAAMG,QAAQ,GAAGC,MAAM,CAACC,cAAc,CAAEL,OAAO,CAAsB;EACrE,IAAIG,QAAQ,KAAK,IAAI,EAAE;IACrBF,OAAO,CAACC,IAAI,CACT,+NAA8N,CAChO;IACD,OAAO,IAAI;EACb,CAAC,MAAM,IAAIC,QAAQ,CAACG,CAAC,KAAK,CAAC,OAAO,EAAE;IAClCL,OAAO,CAACC,IAAI,CACT,kHAAiH,CACnH;IACD,OAAO,IAAI;EACb,CAAC,MAAM,IAAIK,KAAK,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EA,IAAI,CAACP,cAAc,EAAE,EAAE;EACrB;EACA;EACA;EACA,IAAIF,QAAQ,EAAE,EAAE;IACdG,OAAO,GAAGC,aAAmC;EAC/C,CAAC,MAAM;IACLD,OAAO,GAAGY,YAAkC;EAC9C;AACF,CAAC,MAAM,IAAId,MAAM,EAAE,EAAE;EACnBE,OAAO,GAAGc,WAAW;AACvB,CAAC,MAAM,IAAIlB,gBAAgB,EAAE,EAAE;EAC7BI,OAAO,GAAGe,qBAAqB;AACjC,CAAC,MAAM;EACLf,OAAO,GAAGgB,cAAc;AAC1B"}
1
+ {"version":3,"names":["isChromeDebugger","isFabric","isJest","shouldBeUseWeb","measure","measureFabric","animatedRef","_WORKLET","viewTag","console","warn","measured","global","_measureFabric","x","isNaN","measurePaper","_measurePaper","measureJest","measureChromeDebugger","measureDefault"],"sources":["measure.ts"],"sourcesContent":["'use strict';\nimport type { MeasuredDimensions, ShadowNodeWrapper } from '../commonTypes';\nimport {\n isChromeDebugger,\n isFabric,\n isJest,\n shouldBeUseWeb,\n} from '../PlatformChecker';\nimport type {\n AnimatedRef,\n AnimatedRefOnJS,\n AnimatedRefOnUI,\n} from '../hook/commonTypes';\nimport type { Component } from 'react';\n\ntype Measure = <T extends Component>(\n animatedRef: AnimatedRef<T>\n) => MeasuredDimensions | null;\n\n/**\n * Lets you synchronously get the dimensions and position of a view on the screen.\n *\n * @param animatedRef - An [animated ref](https://docs.swmansion.com/react-native-reanimated/docs/core/useAnimatedRef#returns) connected to the component you'd want to get the measurements from.\n * @returns An object containing component measurements or null when the measurement couldn't be performed- {@link MeasuredDimensions}.\n * @see https://docs.swmansion.com/react-native-reanimated/docs/advanced/measure/\n */\nexport let measure: Measure;\n\nfunction measureFabric(animatedRef: AnimatedRefOnJS | AnimatedRefOnUI) {\n 'worklet';\n if (!_WORKLET) {\n return null;\n }\n\n const viewTag = animatedRef();\n if (viewTag === -1) {\n console.warn(\n `[Reanimated] The view with tag ${viewTag} is not a valid argument for measure(). This may be because the view is not currently rendered, which may not be a bug (e.g. an off-screen FlatList item).`\n );\n return null;\n }\n\n const measured = global._measureFabric!(viewTag as ShadowNodeWrapper);\n if (measured === null) {\n console.warn(\n `[Reanimated] The view has some undefined, not-yet-computed or meaningless value of \\`LayoutMetrics\\` type. This may be because the view is not currently rendered, which may not be a bug (e.g. an off-screen FlatList item).`\n );\n return null;\n } else if (measured.x === -1234567) {\n console.warn(\n `[Reanimated] The view returned an invalid measurement response. Please make sure the view is currently rendered.`\n );\n return null;\n } else if (isNaN(measured.x)) {\n console.warn(\n `[Reanimated] The view gets view-flattened on Android. To disable view-flattening, set \\`collapsable={false}\\` on this component.`\n );\n return null;\n } else {\n return measured;\n }\n}\n\nfunction measurePaper(animatedRef: AnimatedRefOnJS | AnimatedRefOnUI) {\n 'worklet';\n if (!_WORKLET) {\n return null;\n }\n\n const viewTag = animatedRef();\n if (viewTag === -1) {\n console.warn(\n `[Reanimated] The view with tag ${viewTag} is not a valid argument for measure(). This may be because the view is not currently rendered, which may not be a bug (e.g. an off-screen FlatList item).`\n );\n return null;\n }\n\n const measured = global._measurePaper!(viewTag as number);\n if (measured === null) {\n console.warn(\n `[Reanimated] The view with tag ${\n viewTag as number\n } has some undefined, not-yet-computed or meaningless value of \\`LayoutMetrics\\` type. This may be because the view is not currently rendered, which may not be a bug (e.g. an off-screen FlatList item).`\n );\n return null;\n } else if (measured.x === -1234567) {\n console.warn(\n `[Reanimated] The view with tag ${\n viewTag as number\n } returned an invalid measurement response. Please make sure the view is currently rendered.`\n );\n return null;\n } else if (isNaN(measured.x)) {\n console.warn(\n `[Reanimated] The view with tag ${\n viewTag as number\n } gets view-flattened on Android. To disable view-flattening, set \\`collapsable={false}\\` on this component.`\n );\n return null;\n } else {\n return measured;\n }\n}\n\nfunction measureJest() {\n console.warn('[Reanimated] measure() cannot be used with Jest.');\n return null;\n}\n\nfunction measureChromeDebugger() {\n console.warn('[Reanimated] measure() cannot be used with Chrome Debugger.');\n return null;\n}\n\nfunction measureDefault() {\n console.warn(\n '[Reanimated] measure() is not supported on this configuration.'\n );\n return null;\n}\n\nif (!shouldBeUseWeb()) {\n // Those assertions are actually correct since on Native platforms `AnimatedRef` is\n // mapped as a different function in `shareableMappingCache` and\n // TypeScript is not able to infer that.\n if (isFabric()) {\n measure = measureFabric as unknown as Measure;\n } else {\n measure = measurePaper as unknown as Measure;\n }\n} else if (isJest()) {\n measure = measureJest;\n} else if (isChromeDebugger()) {\n measure = measureChromeDebugger;\n} else {\n measure = measureDefault;\n}\n"],"mappings":"AAAA,YAAY;;AAEZ,SACEA,gBAAgB,EAChBC,QAAQ,EACRC,MAAM,EACNC,cAAc,QACT,oBAAoB;AAY3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,IAAIC,OAAgB;AAE3B,SAASC,aAAaA,CAACC,WAA8C,EAAE;EACrE,SAAS;;EACT,IAAI,CAACC,QAAQ,EAAE;IACb,OAAO,IAAI;EACb;EAEA,MAAMC,OAAO,GAAGF,WAAW,CAAC,CAAC;EAC7B,IAAIE,OAAO,KAAK,CAAC,CAAC,EAAE;IAClBC,OAAO,CAACC,IAAI,CACT,kCAAiCF,OAAQ,4JAC5C,CAAC;IACD,OAAO,IAAI;EACb;EAEA,MAAMG,QAAQ,GAAGC,MAAM,CAACC,cAAc,CAAEL,OAA4B,CAAC;EACrE,IAAIG,QAAQ,KAAK,IAAI,EAAE;IACrBF,OAAO,CAACC,IAAI,CACT,+NACH,CAAC;IACD,OAAO,IAAI;EACb,CAAC,MAAM,IAAIC,QAAQ,CAACG,CAAC,KAAK,CAAC,OAAO,EAAE;IAClCL,OAAO,CAACC,IAAI,CACT,kHACH,CAAC;IACD,OAAO,IAAI;EACb,CAAC,MAAM,IAAIK,KAAK,CAACJ,QAAQ,CAACG,CAAC,CAAC,EAAE;IAC5BL,OAAO,CAACC,IAAI,CACT,kIACH,CAAC;IACD,OAAO,IAAI;EACb,CAAC,MAAM;IACL,OAAOC,QAAQ;EACjB;AACF;AAEA,SAASK,YA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9C;AACF,CAAC,MAAM,IAAId,MAAM,CAAC,CAAC,EAAE;EACnBE,OAAO,GAAGc,WAAW;AACvB,CAAC,MAAM,IAAIlB,gBAAgB,CAAC,CAAC,EAAE;EAC7BI,OAAO,GAAGe,qBAAqB;AACjC,CAAC,MAAM;EACLf,OAAO,GAAGgB,cAAc;AAC1B","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["measure","animatedRef","element","console","warn","viewportOffset","getBoundingClientRect","width","offsetWidth","height","offsetHeight","x","offsetLeft","y","offsetTop","pageX","left","pageY","top"],"sources":["measure.web.ts"],"sourcesContent":["'use strict';\nimport type { MeasuredDimensions } from '../commonTypes';\nimport type { AnimatedRef } from '../hook/commonTypes';\nimport type { Component } from 'react';\n\nexport function measure<T extends Component>(\n animatedRef: AnimatedRef<T>\n): MeasuredDimensions | null {\n const element = animatedRef() as HTMLElement | -1;\n\n if (element === -1) {\n console.warn(\n `[Reanimated] The view with tag ${element} is not a valid argument for measure(). This may be because the view is not currently rendered, which may not be a bug (e.g. an off-screen FlatList item).`\n );\n return null;\n }\n\n const viewportOffset = element.getBoundingClientRect();\n return {\n width: element.offsetWidth,\n height: element.offsetHeight,\n x: element.offsetLeft,\n y: element.offsetTop,\n pageX: viewportOffset.left,\n pageY: viewportOffset.top,\n };\n}\n"],"mappings":"AAAA,YAAY;;AAKZ,OAAO,SAASA,OAAOA,CACrBC,WAA2B,EACA;EAC3B,MAAMC,OAAO,GAAGD,WAAW,EAAsB;EAEjD,IAAIC,OAAO,KAAK,CAAC,CAAC,EAAE;IAClBC,OAAO,CAACC,IAAI,CACT,kCAAiCF,OAAQ,4JAA2J,CACtM;IACD,OAAO,IAAI;EACb;EAEA,MAAMG,cAAc,GAAGH,OAAO,CAACI,qBAAqB,EAAE;EACtD,OAAO;IACLC,KAAK,EAAEL,OAAO,CAACM,WAAW;IAC1BC,MAAM,EAAEP,OAAO,CAACQ,YAAY;IAC5BC,CAAC,EAAET,OAAO,CAACU,UAAU;IACrBC,CAAC,EAAEX,OAAO,CAACY,SAAS;IACpBC,KAAK,EAAEV,cAAc,CAACW,IAAI;IAC1BC,KAAK,EAAEZ,cAAc,CAACa;EACxB,CAAC;AACH"}
1
+ {"version":3,"names":["measure","animatedRef","element","console","warn","viewportOffset","getBoundingClientRect","width","offsetWidth","height","offsetHeight","x","offsetLeft","y","offsetTop","pageX","left","pageY","top"],"sources":["measure.web.ts"],"sourcesContent":["'use strict';\nimport type { MeasuredDimensions } from '../commonTypes';\nimport type { AnimatedRef } from '../hook/commonTypes';\nimport type { Component } from 'react';\n\nexport function measure<T extends Component>(\n animatedRef: AnimatedRef<T>\n): MeasuredDimensions | null {\n const element = animatedRef() as HTMLElement | -1;\n\n if (element === -1) {\n console.warn(\n `[Reanimated] The view with tag ${element} is not a valid argument for measure(). This may be because the view is not currently rendered, which may not be a bug (e.g. an off-screen FlatList item).`\n );\n return null;\n }\n\n const viewportOffset = element.getBoundingClientRect();\n return {\n width: element.offsetWidth,\n height: element.offsetHeight,\n x: element.offsetLeft,\n y: element.offsetTop,\n pageX: viewportOffset.left,\n pageY: viewportOffset.top,\n };\n}\n"],"mappings":"AAAA,YAAY;;AAKZ,OAAO,SAASA,OAAOA,CACrBC,WAA2B,EACA;EAC3B,MAAMC,OAAO,GAAGD,WAAW,CAAC,CAAqB;EAEjD,IAAIC,OAAO,KAAK,CAAC,CAAC,EAAE;IAClBC,OAAO,CAACC,IAAI,CACT,kCAAiCF,OAAQ,4JAC5C,CAAC;IACD,OAAO,IAAI;EACb;EAEA,MAAMG,cAAc,GAAGH,OAAO,CAACI,qBAAqB,CAAC,CAAC;EACtD,OAAO;IACLC,KAAK,EAAEL,OAAO,CAACM,WAAW;IAC1BC,MAAM,EAAEP,OAAO,CAACQ,YAAY;IAC5BC,CAAC,EAAET,OAAO,CAACU,UAAU;IACrBC,CAAC,EAAEX,OAAO,CAACY,SAAS;IACpBC,KAAK,EAAEV,cAAc,CAACW,IAAI;IAC1BC,KAAK,EAAEZ,cAAc,CAACa;EACxB,CAAC;AACH","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["isChromeDebugger","isFabric","isJest","shouldBeUseWeb","dispatchCommand","scrollTo","scrollToFabric","animatedRef","x","y","animated","scrollToPaper","_WORKLET","viewTag","global","_scrollToPaper","scrollToJest","console","warn","scrollToChromeDebugger","scrollToDefault"],"sources":["scrollTo.ts"],"sourcesContent":["'use strict';\nimport {\n isChromeDebugger,\n isFabric,\n isJest,\n shouldBeUseWeb,\n} from '../PlatformChecker';\nimport { dispatchCommand } from './dispatchCommand';\nimport type {\n AnimatedRef,\n AnimatedRefOnJS,\n AnimatedRefOnUI,\n} from '../hook/commonTypes';\nimport type { Component } from 'react';\n\ntype ScrollTo = <T extends Component>(\n animatedRef: AnimatedRef<T>,\n x: number,\n y: number,\n animated: boolean\n) => void;\n\n/**\n * Lets you synchronously scroll to a given position of a `ScrollView`.\n *\n * @param animatedRef - An [animated ref](https://docs.swmansion.com/react-native-reanimated/docs/core/useAnimatedRef) attached to an `Animated.ScrollView` component.\n * @param x - The x position you want to scroll to.\n * @param y - The y position you want to scroll to.\n * @param animated - Whether the scrolling should be smooth or instant.\n * @see https://docs.swmansion.com/react-native-reanimated/docs/scroll/scrollTo\n */\nexport let scrollTo: ScrollTo;\n\nfunction scrollToFabric(\n animatedRef: AnimatedRefOnJS | AnimatedRefOnUI,\n x: number,\n y: number,\n animated: boolean\n) {\n 'worklet';\n dispatchCommand(\n // This assertion is needed to comply to `dispatchCommand` interface\n animatedRef as unknown as AnimatedRef<Component>,\n 'scrollTo',\n [x, y, animated]\n );\n}\n\nfunction scrollToPaper(\n animatedRef: AnimatedRefOnJS | AnimatedRefOnUI,\n x: number,\n y: number,\n animated: boolean\n) {\n 'worklet';\n if (!_WORKLET) {\n return;\n }\n\n const viewTag = animatedRef() as number;\n global._scrollToPaper!(viewTag, x, y, animated);\n}\n\nfunction scrollToJest() {\n console.warn('[Reanimated] scrollTo() is not supported with Jest.');\n}\n\nfunction scrollToChromeDebugger() {\n console.warn(\n '[Reanimated] scrollTo() is not supported with Chrome Debugger.'\n );\n}\n\nfunction scrollToDefault() {\n console.warn(\n '[Reanimated] scrollTo() is not supported on this configuration.'\n );\n}\n\nif (!shouldBeUseWeb()) {\n // Those assertions are actually correct since on Native platforms `AnimatedRef` is\n // mapped as a different function in `shareableMappingCache` and\n // TypeScript is not able to infer that.\n if (isFabric()) {\n scrollTo = scrollToFabric as unknown as ScrollTo;\n } else {\n scrollTo = scrollToPaper as unknown as ScrollTo;\n }\n} else if (isJest()) {\n scrollTo = scrollToJest;\n} else if (isChromeDebugger()) {\n scrollTo = scrollToChromeDebugger;\n} else {\n scrollTo = scrollToDefault;\n}\n"],"mappings":"AAAA,YAAY;;AACZ,SACEA,gBAAgB,EAChBC,QAAQ,EACRC,MAAM,EACNC,cAAc,QACT,oBAAoB;AAC3B,SAASC,eAAe,QAAQ,mBAAmB;AAenD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,IAAIC,QAAkB;AAE7B,SAASC,cAAcA,CACrBC,WAA8C,EAC9CC,CAAS,EACTC,CAAS,EACTC,QAAiB,EACjB;EACA,SAAS;;EACTN,eAAe;EACb;EACAG,WAAW,EACX,UAAU,EACV,CAACC,CAAC,EAAEC,CAAC,EAAEC,QAAQ,CAAC,CACjB;AACH;AAEA,SAASC,aAAaA,CACpBJ,WAA8C,EAC9CC,CAAS,EACTC,CAAS,EACTC,QAAiB,EACjB;EACA,SAAS;;EACT,IAAI,CAACE,QAAQ,EAAE;IACb;EACF;EAEA,MAAMC,OAAO,GAAGN,WAAW,EAAY;EACvCO,MAAM,CAACC,cAAc,CAAEF,OAAO,EAAEL,CAAC,EAAEC,CAAC,EAAEC,QAAQ,CAAC;AACjD;AAEA,SAASM,YAAYA,CAAA,EAAG;EACtBC,OAAO,CAACC,IAAI,CAAC,qDAAqD,CAAC;AACrE;AAEA,SAASC,sBAAsBA,CAAA,EAAG;EAChCF,OAAO,CAACC,IAAI,CACV,gEAAgE,CACjE;AACH;AAEA,SAASE,eAAeA,CAAA,EAAG;EACzBH,OAAO,CAACC,IAAI,CACV,iEAAiE,CAClE;AACH;AAEA,IAAI,CAACf,cAAc,EAAE,EAAE;EACrB;EACA;EACA;EACA,IAAIF,QAAQ,EAAE,EAAE;IACdI,QAAQ,GAAGC,cAAqC;EAClD,CAAC,MAAM;IACLD,QAAQ,GAAGM,aAAoC;EACjD;AACF,CAAC,MAAM,IAAIT,MAAM,EAAE,EAAE;EACnBG,QAAQ,GAAGW,YAAY;AACzB,CAAC,MAAM,IAAIhB,gBAAgB,EAAE,EAAE;EAC7BK,QAAQ,GAAGc,sBAAsB;AACnC,CAAC,MAAM;EACLd,QAAQ,GAAGe,eAAe;AAC5B"}
1
+ {"version":3,"names":["isChromeDebugger","isFabric","isJest","shouldBeUseWeb","dispatchCommand","scrollTo","scrollToFabric","animatedRef","x","y","animated","scrollToPaper","_WORKLET","viewTag","global","_scrollToPaper","scrollToJest","console","warn","scrollToChromeDebugger","scrollToDefault"],"sources":["scrollTo.ts"],"sourcesContent":["'use strict';\nimport {\n isChromeDebugger,\n isFabric,\n isJest,\n shouldBeUseWeb,\n} from '../PlatformChecker';\nimport { dispatchCommand } from './dispatchCommand';\nimport type {\n AnimatedRef,\n AnimatedRefOnJS,\n AnimatedRefOnUI,\n} from '../hook/commonTypes';\nimport type { Component } from 'react';\n\ntype ScrollTo = <T extends Component>(\n animatedRef: AnimatedRef<T>,\n x: number,\n y: number,\n animated: boolean\n) => void;\n\n/**\n * Lets you synchronously scroll to a given position of a `ScrollView`.\n *\n * @param animatedRef - An [animated ref](https://docs.swmansion.com/react-native-reanimated/docs/core/useAnimatedRef) attached to an `Animated.ScrollView` component.\n * @param x - The x position you want to scroll to.\n * @param y - The y position you want to scroll to.\n * @param animated - Whether the scrolling should be smooth or instant.\n * @see https://docs.swmansion.com/react-native-reanimated/docs/scroll/scrollTo\n */\nexport let scrollTo: ScrollTo;\n\nfunction scrollToFabric(\n animatedRef: AnimatedRefOnJS | AnimatedRefOnUI,\n x: number,\n y: number,\n animated: boolean\n) {\n 'worklet';\n dispatchCommand(\n // This assertion is needed to comply to `dispatchCommand` interface\n animatedRef as unknown as AnimatedRef<Component>,\n 'scrollTo',\n [x, y, animated]\n );\n}\n\nfunction scrollToPaper(\n animatedRef: AnimatedRefOnJS | AnimatedRefOnUI,\n x: number,\n y: number,\n animated: boolean\n) {\n 'worklet';\n if (!_WORKLET) {\n return;\n }\n\n const viewTag = animatedRef() as number;\n global._scrollToPaper!(viewTag, x, y, animated);\n}\n\nfunction scrollToJest() {\n console.warn('[Reanimated] scrollTo() is not supported with Jest.');\n}\n\nfunction scrollToChromeDebugger() {\n console.warn(\n '[Reanimated] scrollTo() is not supported with Chrome Debugger.'\n );\n}\n\nfunction scrollToDefault() {\n console.warn(\n '[Reanimated] scrollTo() is not supported on this configuration.'\n );\n}\n\nif (!shouldBeUseWeb()) {\n // Those assertions are actually correct since on Native platforms `AnimatedRef` is\n // mapped as a different function in `shareableMappingCache` and\n // TypeScript is not able to infer that.\n if (isFabric()) {\n scrollTo = scrollToFabric as unknown as ScrollTo;\n } else {\n scrollTo = scrollToPaper as unknown as ScrollTo;\n }\n} else if (isJest()) {\n scrollTo = scrollToJest;\n} else if (isChromeDebugger()) {\n scrollTo = scrollToChromeDebugger;\n} else {\n scrollTo = scrollToDefault;\n}\n"],"mappings":"AAAA,YAAY;;AACZ,SACEA,gBAAgB,EAChBC,QAAQ,EACRC,MAAM,EACNC,cAAc,QACT,oBAAoB;AAC3B,SAASC,eAAe,QAAQ,mBAAmB;AAenD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,IAAIC,QAAkB;AAE7B,SAASC,cAAcA,CACrBC,WAA8C,EAC9CC,CAAS,EACTC,CAAS,EACTC,QAAiB,EACjB;EACA,SAAS;;EACTN,eAAe;EACb;EACAG,WAAW,EACX,UAAU,EACV,CAACC,CAAC,EAAEC,CAAC,EAAEC,QAAQ,CACjB,CAAC;AACH;AAEA,SAASC,aAAaA,CACpBJ,WAA8C,EAC9CC,CAAS,EACTC,CAAS,EACTC,QAAiB,EACjB;EACA,SAAS;;EACT,IAAI,CAACE,QAAQ,EAAE;IACb;EACF;EAEA,MAAMC,OAAO,GAAGN,WAAW,CAAC,CAAW;EACvCO,MAAM,CAACC,cAAc,CAAEF,OAAO,EAAEL,CAAC,EAAEC,CAAC,EAAEC,QAAQ,CAAC;AACjD;AAEA,SAASM,YAAYA,CAAA,EAAG;EACtBC,OAAO,CAACC,IAAI,CAAC,qDAAqD,CAAC;AACrE;AAEA,SAASC,sBAAsBA,CAAA,EAAG;EAChCF,OAAO,CAACC,IAAI,CACV,gEACF,CAAC;AACH;AAEA,SAASE,eAAeA,CAAA,EAAG;EACzBH,OAAO,CAACC,IAAI,CACV,iEACF,CAAC;AACH;AAEA,IAAI,CAACf,cAAc,CAAC,CAAC,EAAE;EACrB;EACA;EACA;EACA,IAAIF,QAAQ,CAAC,CAAC,EAAE;IACdI,QAAQ,GAAGC,cAAqC;EAClD,CAAC,MAAM;IACLD,QAAQ,GAAGM,aAAoC;EACjD;AACF,CAAC,MAAM,IAAIT,MAAM,CAAC,CAAC,EAAE;EACnBG,QAAQ,GAAGW,YAAY;AACzB,CAAC,MAAM,IAAIhB,gBAAgB,CAAC,CAAC,EAAE;EAC7BK,QAAQ,GAAGc,sBAAsB;AACnC,CAAC,MAAM;EACLd,QAAQ,GAAGe,eAAe;AAC5B","ignoreList":[]}
@@ -7,7 +7,7 @@ export function scrollTo(animatedRef, x, y, animated) {
7
7
  if (element !== -1) {
8
8
  // By ScrollView we mean any scrollable component
9
9
  const scrollView = element;
10
- scrollView === null || scrollView === void 0 ? void 0 : scrollView.scrollTo({
10
+ scrollView === null || scrollView === void 0 || scrollView.scrollTo({
11
11
  x,
12
12
  y,
13
13
  animated
@@ -1 +1 @@
1
- {"version":3,"names":["scrollTo","animatedRef","x","y","animated","element","scrollView"],"sources":["scrollTo.web.ts"],"sourcesContent":["'use strict';\nimport type { AnimatedRef } from '../hook/commonTypes';\nimport type { Component } from 'react';\nimport type { ScrollView } from 'react-native';\n\nexport function scrollTo<T extends Component>(\n animatedRef: AnimatedRef<T>,\n x: number,\n y: number,\n animated: boolean\n) {\n const element = animatedRef();\n\n // This prevents crashes if ref has not been set yet\n if (element !== -1) {\n // By ScrollView we mean any scrollable component\n const scrollView = element as HTMLElement as unknown as ScrollView;\n scrollView?.scrollTo({ x, y, animated });\n }\n}\n"],"mappings":"AAAA,YAAY;;AAKZ,OAAO,SAASA,QAAQA,CACtBC,WAA2B,EAC3BC,CAAS,EACTC,CAAS,EACTC,QAAiB,EACjB;EACA,MAAMC,OAAO,GAAGJ,WAAW,EAAE;;EAE7B;EACA,IAAII,OAAO,KAAK,CAAC,CAAC,EAAE;IAClB;IACA,MAAMC,UAAU,GAAGD,OAA+C;IAClEC,UAAU,aAAVA,UAAU,uBAAVA,UAAU,CAAEN,QAAQ,CAAC;MAAEE,CAAC;MAAEC,CAAC;MAAEC;IAAS,CAAC,CAAC;EAC1C;AACF"}
1
+ {"version":3,"names":["scrollTo","animatedRef","x","y","animated","element","scrollView"],"sources":["scrollTo.web.ts"],"sourcesContent":["'use strict';\nimport type { AnimatedRef } from '../hook/commonTypes';\nimport type { Component } from 'react';\nimport type { ScrollView } from 'react-native';\n\nexport function scrollTo<T extends Component>(\n animatedRef: AnimatedRef<T>,\n x: number,\n y: number,\n animated: boolean\n) {\n const element = animatedRef();\n\n // This prevents crashes if ref has not been set yet\n if (element !== -1) {\n // By ScrollView we mean any scrollable component\n const scrollView = element as HTMLElement as unknown as ScrollView;\n scrollView?.scrollTo({ x, y, animated });\n }\n}\n"],"mappings":"AAAA,YAAY;;AAKZ,OAAO,SAASA,QAAQA,CACtBC,WAA2B,EAC3BC,CAAS,EACTC,CAAS,EACTC,QAAiB,EACjB;EACA,MAAMC,OAAO,GAAGJ,WAAW,CAAC,CAAC;;EAE7B;EACA,IAAII,OAAO,KAAK,CAAC,CAAC,EAAE;IAClB;IACA,MAAMC,UAAU,GAAGD,OAA+C;IAClEC,UAAU,aAAVA,UAAU,eAAVA,UAAU,CAAEN,QAAQ,CAAC;MAAEE,CAAC;MAAEC,CAAC;MAAEC;IAAS,CAAC,CAAC;EAC1C;AACF","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["isChromeDebugger","isJest","shouldBeUseWeb","setGestureState","setGestureStateNative","handlerTag","newState","_WORKLET","console","warn","global","_setGestureState","setGestureStateJest","setGestureStateChromeDebugger","setGestureStateDefault"],"sources":["setGestureState.ts"],"sourcesContent":["'use strict';\nimport { isChromeDebugger, isJest, shouldBeUseWeb } from '../PlatformChecker';\n\ntype SetGestureState = (handlerTag: number, newState: number) => void;\n\nexport let setGestureState: SetGestureState;\n\nfunction setGestureStateNative(handlerTag: number, newState: number) {\n 'worklet';\n if (!_WORKLET) {\n console.warn(\n '[Reanimated] You can not use setGestureState in non-worklet function.'\n );\n return;\n }\n global._setGestureState(handlerTag, newState);\n}\n\nfunction setGestureStateJest() {\n console.warn('[Reanimated] setGestureState() cannot be used with Jest.');\n}\n\nfunction setGestureStateChromeDebugger() {\n console.warn(\n '[Reanimated] setGestureState() cannot be used with Chrome Debugger.'\n );\n}\n\nfunction setGestureStateDefault() {\n console.warn(\n '[Reanimated] setGestureState() is not supported on this configuration.'\n );\n}\n\nif (!shouldBeUseWeb()) {\n setGestureState = setGestureStateNative;\n} else if (isJest()) {\n setGestureState = setGestureStateJest;\n} else if (isChromeDebugger()) {\n setGestureState = setGestureStateChromeDebugger;\n} else {\n setGestureState = setGestureStateDefault;\n}\n"],"mappings":"AAAA,YAAY;;AACZ,SAASA,gBAAgB,EAAEC,MAAM,EAAEC,cAAc,QAAQ,oBAAoB;AAI7E,OAAO,IAAIC,eAAgC;AAE3C,SAASC,qBAAqBA,CAACC,UAAkB,EAAEC,QAAgB,EAAE;EACnE,SAAS;;EACT,IAAI,CAACC,QAAQ,EAAE;IACbC,OAAO,CAACC,IAAI,CACV,uEAAuE,CACxE;IACD;EACF;EACAC,MAAM,CAACC,gBAAgB,CAACN,UAAU,EAAEC,QAAQ,CAAC;AAC/C;AAEA,SAASM,mBAAmBA,CAAA,EAAG;EAC7BJ,OAAO,CAACC,IAAI,CAAC,0DAA0D,CAAC;AAC1E;AAEA,SAASI,6BAA6BA,CAAA,EAAG;EACvCL,OAAO,CAACC,IAAI,CACV,qEAAqE,CACtE;AACH;AAEA,SAASK,sBAAsBA,CAAA,EAAG;EAChCN,OAAO,CAACC,IAAI,CACV,wEAAwE,CACzE;AACH;AAEA,IAAI,CAACP,cAAc,EAAE,EAAE;EACrBC,eAAe,GAAGC,qBAAqB;AACzC,CAAC,MAAM,IAAIH,MAAM,EAAE,EAAE;EACnBE,eAAe,GAAGS,mBAAmB;AACvC,CAAC,MAAM,IAAIZ,gBAAgB,EAAE,EAAE;EAC7BG,eAAe,GAAGU,6BAA6B;AACjD,CAAC,MAAM;EACLV,eAAe,GAAGW,sBAAsB;AAC1C"}
1
+ {"version":3,"names":["isChromeDebugger","isJest","shouldBeUseWeb","setGestureState","setGestureStateNative","handlerTag","newState","_WORKLET","console","warn","global","_setGestureState","setGestureStateJest","setGestureStateChromeDebugger","setGestureStateDefault"],"sources":["setGestureState.ts"],"sourcesContent":["'use strict';\nimport { isChromeDebugger, isJest, shouldBeUseWeb } from '../PlatformChecker';\n\ntype SetGestureState = (handlerTag: number, newState: number) => void;\n\nexport let setGestureState: SetGestureState;\n\nfunction setGestureStateNative(handlerTag: number, newState: number) {\n 'worklet';\n if (!_WORKLET) {\n console.warn(\n '[Reanimated] You can not use setGestureState in non-worklet function.'\n );\n return;\n }\n global._setGestureState(handlerTag, newState);\n}\n\nfunction setGestureStateJest() {\n console.warn('[Reanimated] setGestureState() cannot be used with Jest.');\n}\n\nfunction setGestureStateChromeDebugger() {\n console.warn(\n '[Reanimated] setGestureState() cannot be used with Chrome Debugger.'\n );\n}\n\nfunction setGestureStateDefault() {\n console.warn(\n '[Reanimated] setGestureState() is not supported on this configuration.'\n );\n}\n\nif (!shouldBeUseWeb()) {\n setGestureState = setGestureStateNative;\n} else if (isJest()) {\n setGestureState = setGestureStateJest;\n} else if (isChromeDebugger()) {\n setGestureState = setGestureStateChromeDebugger;\n} else {\n setGestureState = setGestureStateDefault;\n}\n"],"mappings":"AAAA,YAAY;;AACZ,SAASA,gBAAgB,EAAEC,MAAM,EAAEC,cAAc,QAAQ,oBAAoB;AAI7E,OAAO,IAAIC,eAAgC;AAE3C,SAASC,qBAAqBA,CAACC,UAAkB,EAAEC,QAAgB,EAAE;EACnE,SAAS;;EACT,IAAI,CAACC,QAAQ,EAAE;IACbC,OAAO,CAACC,IAAI,CACV,uEACF,CAAC;IACD;EACF;EACAC,MAAM,CAACC,gBAAgB,CAACN,UAAU,EAAEC,QAAQ,CAAC;AAC/C;AAEA,SAASM,mBAAmBA,CAAA,EAAG;EAC7BJ,OAAO,CAACC,IAAI,CAAC,0DAA0D,CAAC;AAC1E;AAEA,SAASI,6BAA6BA,CAAA,EAAG;EACvCL,OAAO,CAACC,IAAI,CACV,qEACF,CAAC;AACH;AAEA,SAASK,sBAAsBA,CAAA,EAAG;EAChCN,OAAO,CAACC,IAAI,CACV,wEACF,CAAC;AACH;AAEA,IAAI,CAACP,cAAc,CAAC,CAAC,EAAE;EACrBC,eAAe,GAAGC,qBAAqB;AACzC,CAAC,MAAM,IAAIH,MAAM,CAAC,CAAC,EAAE;EACnBE,eAAe,GAAGS,mBAAmB;AACvC,CAAC,MAAM,IAAIZ,gBAAgB,CAAC,CAAC,EAAE;EAC7BG,eAAe,GAAGU,6BAA6B;AACjD,CAAC,MAAM;EACLV,eAAe,GAAGW,sBAAsB;AAC1C","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["setGestureState","console","warn"],"sources":["setGestureState.web.ts"],"sourcesContent":["'use strict';\n\nexport function setGestureState() {\n console.warn('[Reanimated] setGestureState() is not available on web.');\n}\n"],"mappings":"AAAA,YAAY;;AAEZ,OAAO,SAASA,eAAeA,CAAA,EAAG;EAChCC,OAAO,CAACC,IAAI,CAAC,yDAAyD,CAAC;AACzE"}
1
+ {"version":3,"names":["setGestureState","console","warn"],"sources":["setGestureState.web.ts"],"sourcesContent":["'use strict';\n\nexport function setGestureState() {\n console.warn('[Reanimated] setGestureState() is not available on web.');\n}\n"],"mappings":"AAAA,YAAY;;AAEZ,OAAO,SAASA,eAAeA,CAAA,EAAG;EAChCC,OAAO,CAACC,IAAI,CAAC,yDAAyD,CAAC;AACzE","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["isChromeDebugger","isFabric","isJest","shouldBeUseWeb","processColorsInProps","setNativeProps","setNativePropsFabric","animatedRef","updates","_WORKLET","console","warn","shadowNodeWrapper","global","_updatePropsFabric","setNativePropsPaper","tag","name","viewName","value","_updatePropsPaper","setNativePropsJest","setNativePropsChromeDebugger","setNativePropsDefault"],"sources":["setNativeProps.ts"],"sourcesContent":["'use strict';\nimport type { ShadowNodeWrapper, StyleProps } from '../commonTypes';\nimport {\n isChromeDebugger,\n isFabric,\n isJest,\n shouldBeUseWeb,\n} from '../PlatformChecker';\nimport type {\n AnimatedRef,\n AnimatedRefOnJS,\n AnimatedRefOnUI,\n} from '../hook/commonTypes';\nimport type { Component } from 'react';\nimport { processColorsInProps } from '../Colors';\n\ntype SetNativeProps = <T extends Component>(\n animatedRef: AnimatedRef<T>,\n updates: StyleProps\n) => void;\n/**\n * Lets you imperatively update component properties. You should always reach for [useAnimatedStyle](https://docs.swmansion.com/react-native-reanimated/docs/core/useAnimatedStyle) and [useAnimatedProps](https://docs.swmansion.com/react-native-reanimated/docs/core/useAnimatedProps) first when animating styles or properties.\n *\n * @param animatedRef - An [animated ref](https://docs.swmansion.com/react-native-reanimated/docs/core/useAnimatedRef#returns) connected to the component you'd want to update.\n * @param updates - An object with properties you want to update.\n * @see https://docs.swmansion.com/react-native-reanimated/docs/advanced/setNativeProps\n */\nexport let setNativeProps: SetNativeProps;\n\nfunction setNativePropsFabric(\n animatedRef: AnimatedRefOnJS | AnimatedRefOnUI,\n updates: StyleProps\n) {\n 'worklet';\n if (!_WORKLET) {\n console.warn(\n '[Reanimated] setNativeProps() can only be used on the UI runtime.'\n );\n return;\n }\n const shadowNodeWrapper = animatedRef() as ShadowNodeWrapper;\n processColorsInProps(updates);\n global._updatePropsFabric!([{ shadowNodeWrapper, updates }]);\n}\n\nfunction setNativePropsPaper(\n animatedRef: AnimatedRefOnJS | AnimatedRefOnUI,\n updates: StyleProps\n) {\n 'worklet';\n if (!_WORKLET) {\n console.warn(\n '[Reanimated] setNativeProps() can only be used on the UI runtime.'\n );\n return;\n }\n const tag = animatedRef() as number;\n const name = (animatedRef as AnimatedRefOnUI).viewName.value;\n processColorsInProps(updates);\n global._updatePropsPaper!([{ tag, name, updates }]);\n}\n\nfunction setNativePropsJest() {\n console.warn('[Reanimated] setNativeProps() is not supported with Jest.');\n}\n\nfunction setNativePropsChromeDebugger() {\n console.warn(\n '[Reanimated] setNativeProps() is not supported with Chrome Debugger.'\n );\n}\n\nfunction setNativePropsDefault() {\n console.warn(\n '[Reanimated] setNativeProps() is not supported on this configuration.'\n );\n}\n\nif (!shouldBeUseWeb()) {\n // Those assertions are actually correct since on Native platforms `AnimatedRef` is\n // mapped as a different function in `shareableMappingCache` and\n // TypeScript is not able to infer that.\n if (isFabric()) {\n setNativeProps = setNativePropsFabric as unknown as SetNativeProps;\n } else {\n setNativeProps = setNativePropsPaper as unknown as SetNativeProps;\n }\n} else if (isJest()) {\n setNativeProps = setNativePropsJest;\n} else if (isChromeDebugger()) {\n setNativeProps = setNativePropsChromeDebugger;\n} else {\n setNativeProps = setNativePropsDefault;\n}\n"],"mappings":"AAAA,YAAY;;AAEZ,SACEA,gBAAgB,EAChBC,QAAQ,EACRC,MAAM,EACNC,cAAc,QACT,oBAAoB;AAO3B,SAASC,oBAAoB,QAAQ,WAAW;AAMhD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,IAAI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C,MAAM,IAAIrB,gBAAgB,EAAE,EAAE;EAC7BK,cAAc,GAAGiB,4BAA4B;AAC/C,CAAC,MAAM;EACLjB,cAAc,GAAGkB,qBAAqB;AACxC"}
1
+ {"version":3,"names":["isChromeDebugger","isFabric","isJest","shouldBeUseWeb","processColorsInProps","setNativeProps","setNativePropsFabric","animatedRef","updates","_WORKLET","console","warn","shadowNodeWrapper","global","_updatePropsFabric","setNativePropsPaper","tag","name","viewName","value","_updatePropsPaper","setNativePropsJest","setNativePropsChromeDebugger","setNativePropsDefault"],"sources":["setNativeProps.ts"],"sourcesContent":["'use strict';\nimport type { ShadowNodeWrapper, StyleProps } from '../commonTypes';\nimport {\n isChromeDebugger,\n isFabric,\n isJest,\n shouldBeUseWeb,\n} from '../PlatformChecker';\nimport type {\n AnimatedRef,\n AnimatedRefOnJS,\n AnimatedRefOnUI,\n} from '../hook/commonTypes';\nimport type { Component } from 'react';\nimport { processColorsInProps } from '../Colors';\n\ntype SetNativeProps = <T extends Component>(\n animatedRef: AnimatedRef<T>,\n updates: StyleProps\n) => void;\n/**\n * Lets you imperatively update component properties. You should always reach for [useAnimatedStyle](https://docs.swmansion.com/react-native-reanimated/docs/core/useAnimatedStyle) and [useAnimatedProps](https://docs.swmansion.com/react-native-reanimated/docs/core/useAnimatedProps) first when animating styles or properties.\n *\n * @param animatedRef - An [animated ref](https://docs.swmansion.com/react-native-reanimated/docs/core/useAnimatedRef#returns) connected to the component you'd want to update.\n * @param updates - An object with properties you want to update.\n * @see https://docs.swmansion.com/react-native-reanimated/docs/advanced/setNativeProps\n */\nexport let setNativeProps: SetNativeProps;\n\nfunction setNativePropsFabric(\n animatedRef: AnimatedRefOnJS | AnimatedRefOnUI,\n updates: StyleProps\n) {\n 'worklet';\n if (!_WORKLET) {\n console.warn(\n '[Reanimated] setNativeProps() can only be used on the UI runtime.'\n );\n return;\n }\n const shadowNodeWrapper = animatedRef() as ShadowNodeWrapper;\n processColorsInProps(updates);\n global._updatePropsFabric!([{ shadowNodeWrapper, updates }]);\n}\n\nfunction setNativePropsPaper(\n animatedRef: AnimatedRefOnJS | AnimatedRefOnUI,\n updates: StyleProps\n) {\n 'worklet';\n if (!_WORKLET) {\n console.warn(\n '[Reanimated] setNativeProps() can only be used on the UI runtime.'\n );\n return;\n }\n const tag = animatedRef() as number;\n const name = (animatedRef as AnimatedRefOnUI).viewName.value;\n processColorsInProps(updates);\n global._updatePropsPaper!([{ tag, name, updates }]);\n}\n\nfunction setNativePropsJest() {\n console.warn('[Reanimated] setNativeProps() is not supported with Jest.');\n}\n\nfunction setNativePropsChromeDebugger() {\n console.warn(\n '[Reanimated] setNativeProps() is not supported with Chrome Debugger.'\n );\n}\n\nfunction setNativePropsDefault() {\n console.warn(\n '[Reanimated] setNativeProps() is not supported on this configuration.'\n );\n}\n\nif (!shouldBeUseWeb()) {\n // Those assertions are actually correct since on Native platforms `AnimatedRef` is\n // mapped as a different function in `shareableMappingCache` and\n // TypeScript is not able to infer that.\n if (isFabric()) {\n setNativeProps = setNativePropsFabric as unknown as SetNativeProps;\n } else {\n setNativeProps = setNativePropsPaper as unknown as SetNativeProps;\n }\n} else if (isJest()) {\n setNativeProps = setNativePropsJest;\n} else if (isChromeDebugger()) {\n setNativeProps = setNativePropsChromeDebugger;\n} else {\n setNativeProps = setNativePropsDefault;\n}\n"],"mappings":"AAAA,YAAY;;AAEZ,SACEA,gBAAgB,EAChBC,QAAQ,EACRC,MAAM,EACNC,cAAc,QACT,oBAAoB;AAO3B,SAASC,oBAAoB,QAAQ,WAAW;AAMhD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,IAAIC,cAA8B;AAEzC,SAASC,oBAAoBA,CAC3BC,WAA8C,EAC9CC,OAAmB,EACnB;EACA,SAAS;;EACT,IAAI,CAACC,QAAQ,EAAE;IACbC,OAAO,CAACC,IAAI,CACV,mEACF,CAAC;IACD;EACF;EACA,MAAMC,iBAAiB,GAAGL,WAAW,CAAC,CAAsB;EAC5DH,oBAAoB,CAACI,OAAO,CAAC;EAC7BK,MAAM,CAACC,kBAAkB,CAAE,CAAC;IAAEF,iBAAiB;IAAEJ;EAAQ,CAAC,CAAC,CAAC;AAC9D;AAEA,SAASO,mBAAmBA,CAC1BR,WAA8C,EAC9CC,OAAmB,EACnB;EACA,SAAS;;EACT,IAAI,CAACC,QAAQ,EAAE;IACbC,OAAO,CAACC,IAAI,CACV,mEACF,CAAC;IACD;EACF;EACA,MAAMK,GAAG,GAAGT,WAAW,CAAC,CAAW;EACnC,MAAMU,IAAI,GAAIV,WAAW,CAAqBW,QAAQ,CAACC,KAAK;EAC5Df,oBAAoB,CAACI,OAAO,CAAC;EAC7BK,MAAM,CAACO,iBAAiB,CAAE,CAAC;IAAEJ,GAAG;IAAEC,IAAI;IAAET;EAAQ,CAAC,CAAC,CAAC;AACrD;AAEA,SAASa,kBAAkBA,CAAA,EAAG;EAC5BX,OAAO,CAACC,IAAI,CAAC,2DAA2D,CAAC;AAC3E;AAEA,SAASW,4BAA4BA,CAAA,EAAG;EACtCZ,OAAO,CAACC,IAAI,CACV,sEACF,CAAC;AACH;AAEA,SAASY,qBAAqBA,CAAA,EAAG;EAC/Bb,OAAO,CAACC,IAAI,CACV,uEACF,CAAC;AACH;AAEA,IAAI,CAACR,cAAc,CAAC,CAAC,EAAE;EACrB;EACA;EACA;EACA,IAAIF,QAAQ,CAAC,CAAC,EAAE;IACdI,cAAc,GAAGC,oBAAiD;EACpE,CAAC,MAAM;IACLD,cAAc,GAAGU,mBAAgD;EACnE;AACF,CAAC,MAAM,IAAIb,MAAM,CAAC,CAAC,EAAE;EACnBG,cAAc,GAAGgB,kBAAkB;AACrC,CAAC,MAAM,IAAIrB,gBAAgB,CAAC,CAAC,EAAE;EAC7BK,cAAc,GAAGiB,4BAA4B;AAC/C,CAAC,MAAM;EACLjB,cAAc,GAAGkB,qBAAqB;AACxC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_updatePropsJS","setNativeProps","animatedRef","updates","component","_component"],"sources":["setNativeProps.web.ts"],"sourcesContent":["'use strict';\nimport type { ReanimatedHTMLElement } from '../js-reanimated';\nimport { _updatePropsJS } from '../js-reanimated';\nimport type { StyleProps } from '../commonTypes';\nimport type { AnimatedRef } from '../hook/commonTypes';\nimport type { Component } from 'react';\n\nexport function setNativeProps<T extends Component>(\n animatedRef: AnimatedRef<T>,\n updates: StyleProps\n) {\n const component = animatedRef() as ReanimatedHTMLElement;\n _updatePropsJS(updates, { _component: component });\n}\n"],"mappings":"AAAA,YAAY;;AAEZ,SAASA,cAAc,QAAQ,kBAAkB;AAKjD,OAAO,SAASC,cAAcA,CAC5BC,WAA2B,EAC3BC,OAAmB,EACnB;EACA,MAAMC,SAAS,GAAGF,WAAW,EAA2B;EACxDF,cAAc,CAACG,OAAO,EAAE;IAAEE,UAAU,EAAED;EAAU,CAAC,CAAC;AACpD"}
1
+ {"version":3,"names":["_updatePropsJS","setNativeProps","animatedRef","updates","component","_component"],"sources":["setNativeProps.web.ts"],"sourcesContent":["'use strict';\nimport type { ReanimatedHTMLElement } from '../js-reanimated';\nimport { _updatePropsJS } from '../js-reanimated';\nimport type { StyleProps } from '../commonTypes';\nimport type { AnimatedRef } from '../hook/commonTypes';\nimport type { Component } from 'react';\n\nexport function setNativeProps<T extends Component>(\n animatedRef: AnimatedRef<T>,\n updates: StyleProps\n) {\n const component = animatedRef() as ReanimatedHTMLElement;\n _updatePropsJS(updates, { _component: component });\n}\n"],"mappings":"AAAA,YAAY;;AAEZ,SAASA,cAAc,QAAQ,kBAAkB;AAKjD,OAAO,SAASC,cAAcA,CAC5BC,WAA2B,EAC3BC,OAAmB,EACnB;EACA,MAAMC,SAAS,GAAGF,WAAW,CAAC,CAA0B;EACxDF,cAAc,CAACG,OAAO,EAAE;IAAEE,UAAU,EAAED;EAAU,CAAC,CAAC;AACpD","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["getUseOfValueInStyleWarning"],"sources":["pluginUtils.ts"],"sourcesContent":["'use strict';\nexport function getUseOfValueInStyleWarning() {\n return (\n \"It looks like you might be using shared value's .value inside reanimated inline style. \" +\n 'If you want a component to update when shared value changes you should use the shared value' +\n ' directly instead of its current state represented by `.value`. See documentation here: ' +\n 'https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary/#animations-in-inline-styling'\n );\n}\n"],"mappings":"AAAA,YAAY;;AACZ,OAAO,SAASA,2BAA2BA,CAAA,EAAG;EAC5C,OACE,yFAAyF,GACzF,6FAA6F,GAC7F,0FAA0F,GAC1F,6GAA6G;AAEjH"}
1
+ {"version":3,"names":["getUseOfValueInStyleWarning"],"sources":["pluginUtils.ts"],"sourcesContent":["'use strict';\nexport function getUseOfValueInStyleWarning() {\n return (\n \"It looks like you might be using shared value's .value inside reanimated inline style. \" +\n 'If you want a component to update when shared value changes you should use the shared value' +\n ' directly instead of its current state represented by `.value`. See documentation here: ' +\n 'https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary/#animations-in-inline-styling'\n );\n}\n"],"mappings":"AAAA,YAAY;;AACZ,OAAO,SAASA,2BAA2BA,CAAA,EAAG;EAC5C,OACE,yFAAyF,GACzF,6FAA6F,GAC7F,0FAA0F,GAC1F,6GAA6G;AAEjH","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["publicGlobals.ts"],"sourcesContent":["'use strict';\n/* eslint-disable no-var */\nexport {};\n\ndeclare global {\n /**\n * This global variable is a diagnostic/development tool.\n *\n * It is `true` on the UI thread and `false` on the JS thread.\n *\n * It used to be necessary in the past for some of the\n * functionalities of react-native-reanimated to work\n * properly but it's no longer the case. Your code\n * shouldn't depend on it, we keep it here\n * mainly for backward compatibility for our users.\n */\n var _WORKLET: boolean | undefined;\n\n /**\n * This ArrayBuffer contains the memory address of `jsi::Runtime`\n * which is the Reanimated UI runtime.\n */\n var _WORKLET_RUNTIME: ArrayBuffer;\n}\n"],"mappings":"AAAA,YAAY;;AACZ;AACA"}
1
+ {"version":3,"names":[],"sources":["publicGlobals.ts"],"sourcesContent":["'use strict';\n/* eslint-disable no-var */\nexport {};\n\ndeclare global {\n /**\n * This global variable is a diagnostic/development tool.\n *\n * It is `true` on the UI thread and `false` on the JS thread.\n *\n * It used to be necessary in the past for some of the\n * functionalities of react-native-reanimated to work\n * properly but it's no longer the case. Your code\n * shouldn't depend on it, we keep it here\n * mainly for backward compatibility for our users.\n */\n var _WORKLET: boolean | undefined;\n\n /**\n * This ArrayBuffer contains the memory address of `jsi::Runtime`\n * which is the Reanimated UI runtime.\n */\n var _WORKLET_RUNTIME: ArrayBuffer;\n}\n"],"mappings":"AAAA,YAAY;;AACZ;AACA","ignoreList":[]}
@@ -14,14 +14,16 @@ const SHOULD_BE_USE_WEB = shouldBeUseWeb();
14
14
  * @param initializer - An optional worklet that will be run synchronously on the same thread immediately after the runtime is created.
15
15
  * @returns WorkletRuntime which is a jsi::HostObject\<reanimated::WorkletRuntime\> - {@link WorkletRuntime}
16
16
  * @see https://docs.swmansion.com/react-native-reanimated/docs/threading/createWorkletRuntime
17
- */ // @ts-expect-error Check `runOnUI` overload.
17
+ */
18
+ // @ts-expect-error Check `runOnUI` overload.
19
+
18
20
  export function createWorkletRuntime(name, initializer) {
19
21
  return NativeReanimatedModule.createWorkletRuntime(name, makeShareableCloneRecursive(() => {
20
22
  'worklet';
21
23
 
22
24
  setupCallGuard();
23
25
  setupConsole();
24
- initializer === null || initializer === void 0 ? void 0 : initializer();
26
+ initializer === null || initializer === void 0 || initializer();
25
27
  }));
26
28
  }
27
29
 
@@ -37,26 +39,16 @@ export function runOnRuntime(workletRuntime, worklet) {
37
39
  throw new Error('[Reanimated] The function passed to `runOnRuntime` is not a worklet.' + (_WORKLET ? ' Please make sure that `processNestedWorklets` option in Reanimated Babel plugin is enabled.' : ''));
38
40
  }
39
41
  if (_WORKLET) {
40
- return function () {
41
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
42
- args[_key] = arguments[_key];
43
- }
44
- return global._scheduleOnRuntime(workletRuntime, makeShareableCloneOnUIRecursive(() => {
45
- 'worklet';
46
-
47
- worklet(...args);
48
- }));
49
- };
50
- }
51
- return function () {
52
- for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
53
- args[_key2] = arguments[_key2];
54
- }
55
- return NativeReanimatedModule.scheduleOnRuntime(workletRuntime, makeShareableCloneRecursive(() => {
42
+ return (...args) => global._scheduleOnRuntime(workletRuntime, makeShareableCloneOnUIRecursive(() => {
56
43
  'worklet';
57
44
 
58
45
  worklet(...args);
59
46
  }));
60
- };
47
+ }
48
+ return (...args) => NativeReanimatedModule.scheduleOnRuntime(workletRuntime, makeShareableCloneRecursive(() => {
49
+ 'worklet';
50
+
51
+ worklet(...args);
52
+ }));
61
53
  }
62
54
  //# sourceMappingURL=runtimes.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["isWorkletFunction","setupCallGuard","setupConsole","NativeReanimatedModule","shouldBeUseWeb","makeShareableCloneOnUIRecursive","makeShareableCloneRecursive","SHOULD_BE_USE_WEB","createWorkletRuntime","name","initializer","runOnRuntime","workletRuntime","worklet","__DEV__","Error","_WORKLET","_len","arguments","length","args","Array","_key","global","_scheduleOnRuntime","_len2","_key2","scheduleOnRuntime"],"sources":["runtimes.ts"],"sourcesContent":["'use strict';\nimport { isWorkletFunction } from './commonTypes';\nimport type { WorkletFunction } from './commonTypes';\nimport { setupCallGuard, setupConsole } from './initializers';\nimport NativeReanimatedModule from './NativeReanimated';\nimport { shouldBeUseWeb } from './PlatformChecker';\nimport {\n makeShareableCloneOnUIRecursive,\n makeShareableCloneRecursive,\n} from './shareables';\n\nconst SHOULD_BE_USE_WEB = shouldBeUseWeb();\n\nexport type WorkletRuntime = {\n __hostObjectWorkletRuntime: never;\n readonly name: string;\n};\n\n/**\n * Lets you create a new JS runtime which can be used to run worklets possibly on different threads than JS or UI thread.\n *\n * @param name - A name used to identify the runtime which will appear in devices list in Chrome DevTools.\n * @param initializer - An optional worklet that will be run synchronously on the same thread immediately after the runtime is created.\n * @returns WorkletRuntime which is a jsi::HostObject\\<reanimated::WorkletRuntime\\> - {@link WorkletRuntime}\n * @see https://docs.swmansion.com/react-native-reanimated/docs/threading/createWorkletRuntime\n */\n// @ts-expect-error Check `runOnUI` overload.\nexport function createWorkletRuntime(\n name: string,\n initializer?: () => void\n): WorkletRuntime;\n\nexport function createWorkletRuntime(\n name: string,\n initializer?: WorkletFunction<[], void>\n): WorkletRuntime {\n return NativeReanimatedModule.createWorkletRuntime(\n name,\n makeShareableCloneRecursive(() => {\n 'worklet';\n setupCallGuard();\n setupConsole();\n initializer?.();\n })\n );\n}\n\n// @ts-expect-error Check `runOnUI` overload.\nexport function runOnRuntime<Args extends unknown[], ReturnValue>(\n workletRuntime: WorkletRuntime,\n worklet: (...args: Args) => ReturnValue\n): WorkletFunction<Args, ReturnValue>;\n/**\n * Schedule a worklet to execute on the background queue.\n */\nexport function runOnRuntime<Args extends unknown[], ReturnValue>(\n workletRuntime: WorkletRuntime,\n worklet: WorkletFunction<Args, ReturnValue>\n): (...args: Args) => void {\n 'worklet';\n if (__DEV__ && !SHOULD_BE_USE_WEB && !isWorkletFunction(worklet)) {\n throw new Error(\n '[Reanimated] The function passed to `runOnRuntime` is not a worklet.' +\n (_WORKLET\n ? ' Please make sure that `processNestedWorklets` option in Reanimated Babel plugin is enabled.'\n : '')\n );\n }\n if (_WORKLET) {\n return (...args) =>\n global._scheduleOnRuntime(\n workletRuntime,\n makeShareableCloneOnUIRecursive(() => {\n 'worklet';\n worklet(...args);\n })\n );\n }\n return (...args) =>\n NativeReanimatedModule.scheduleOnRuntime(\n workletRuntime,\n makeShareableCloneRecursive(() => {\n 'worklet';\n worklet(...args);\n })\n );\n}\n"],"mappings":"AAAA,YAAY;;AACZ,SAASA,iBAAiB,QAAQ,eAAe;AAEjD,SAASC,cAAc,EAAEC,YAAY,QAAQ,gBAAgB;AAC7D,OAAOC,sBAAsB,MAAM,oBAAoB;AACvD,SAASC,cAAc,QAA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,KAAA;MAAJN,IAAI,CAAAM,KAAA,IAAAR,SAAA,CAAAQ,KAAA;IAAA;IAAA,OACbvB,sBAAsB,CAACwB,iBAAiB,CACtCf,cAAc,EACdN,2BAA2B,CAAC,MAAM;MAChC,SAAS;;MACTO,OAAO,CAAC,GAAGO,IAAI,CAAC;IAClB,CAAC,CAAC,CACH;EAAA;AACL"}
1
+ {"version":3,"names":["isWorkletFunction","setupCallGuard","setupConsole","NativeReanimatedModule","shouldBeUseWeb","makeShareableCloneOnUIRecursive","makeShareableCloneRecursive","SHOULD_BE_USE_WEB","createWorkletRuntime","name","initializer","runOnRuntime","workletRuntime","worklet","__DEV__","Error","_WORKLET","args","global","_scheduleOnRuntime","scheduleOnRuntime"],"sources":["runtimes.ts"],"sourcesContent":["'use strict';\nimport { isWorkletFunction } from './commonTypes';\nimport type { WorkletFunction } from './commonTypes';\nimport { setupCallGuard, setupConsole } from './initializers';\nimport NativeReanimatedModule from './NativeReanimated';\nimport { shouldBeUseWeb } from './PlatformChecker';\nimport {\n makeShareableCloneOnUIRecursive,\n makeShareableCloneRecursive,\n} from './shareables';\n\nconst SHOULD_BE_USE_WEB = shouldBeUseWeb();\n\nexport type WorkletRuntime = {\n __hostObjectWorkletRuntime: never;\n readonly name: string;\n};\n\n/**\n * Lets you create a new JS runtime which can be used to run worklets possibly on different threads than JS or UI thread.\n *\n * @param name - A name used to identify the runtime which will appear in devices list in Chrome DevTools.\n * @param initializer - An optional worklet that will be run synchronously on the same thread immediately after the runtime is created.\n * @returns WorkletRuntime which is a jsi::HostObject\\<reanimated::WorkletRuntime\\> - {@link WorkletRuntime}\n * @see https://docs.swmansion.com/react-native-reanimated/docs/threading/createWorkletRuntime\n */\n// @ts-expect-error Check `runOnUI` overload.\nexport function createWorkletRuntime(\n name: string,\n initializer?: () => void\n): WorkletRuntime;\n\nexport function createWorkletRuntime(\n name: string,\n initializer?: WorkletFunction<[], void>\n): WorkletRuntime {\n return NativeReanimatedModule.createWorkletRuntime(\n name,\n makeShareableCloneRecursive(() => {\n 'worklet';\n setupCallGuard();\n setupConsole();\n initializer?.();\n })\n );\n}\n\n// @ts-expect-error Check `runOnUI` overload.\nexport function runOnRuntime<Args extends unknown[], ReturnValue>(\n workletRuntime: WorkletRuntime,\n worklet: (...args: Args) => ReturnValue\n): WorkletFunction<Args, ReturnValue>;\n/**\n * Schedule a worklet to execute on the background queue.\n */\nexport function runOnRuntime<Args extends unknown[], ReturnValue>(\n workletRuntime: WorkletRuntime,\n worklet: WorkletFunction<Args, ReturnValue>\n): (...args: Args) => void {\n 'worklet';\n if (__DEV__ && !SHOULD_BE_USE_WEB && !isWorkletFunction(worklet)) {\n throw new Error(\n '[Reanimated] The function passed to `runOnRuntime` is not a worklet.' +\n (_WORKLET\n ? ' Please make sure that `processNestedWorklets` option in Reanimated Babel plugin is enabled.'\n : '')\n );\n }\n if (_WORKLET) {\n return (...args) =>\n global._scheduleOnRuntime(\n workletRuntime,\n makeShareableCloneOnUIRecursive(() => {\n 'worklet';\n worklet(...args);\n })\n );\n }\n return (...args) =>\n NativeReanimatedModule.scheduleOnRuntime(\n workletRuntime,\n makeShareableCloneRecursive(() => {\n 'worklet';\n worklet(...args);\n })\n );\n}\n"],"mappings":"AAAA,YAAY;;AACZ,SAASA,iBAAiB,QAAQ,eAAe;AAEjD,SAASC,cAAc,EAAEC,YAAY,QAAQ,gBAAgB;AAC7D,OAAOC,sBAAsB,MAAM,oBAAoB;AACvD,SAASC,cAAc,QAAQ,mBAAmB;AAClD,SACEC,+BAA+B,EAC/BC,2BAA2B,QACtB,cAAc;AAErB,MAAMC,iBAAiB,GAAGH,cAAc,CAAC,CAAC;;AAO1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAMA,OAAO,SAASI,oBAAoBA,CAClCC,IAAY,EACZC,WAAuC,EACvB;EAChB,OAAOP,sBAAsB,CAACK,oBAAoB,CAChDC,IAAI,EACJH,2BAA2B,CAAC,MAAM;IAChC,SAAS;;IACTL,cAAc,CAAC,CAAC;IAChBC,YAAY,CAAC,CAAC;IACdQ,WAAW,aAAXA,WAAW,eAAXA,WAAW,CAAG,CAAC;EACjB,CAAC,CACH,CAAC;AACH;;AAEA;;AAKA;AACA;AACA;AACA,OAAO,SAASC,YAAYA,CAC1BC,cAA8B,EAC9BC,OAA2C,EAClB;EACzB,SAAS;;EACT,IAAIC,OAAO,IAAI,CAACP,iBAAiB,IAAI,CAACP,iBAAiB,CAACa,OAAO,CAAC,EAAE;IAChE,MAAM,IAAIE,KAAK,CACb,sEAAsE,IACnEC,QAAQ,GACL,8FAA8F,GAC9F,EAAE,CACV,CAAC;EACH;EACA,IAAIA,QAAQ,EAAE;IACZ,OAAO,CAAC,GAAGC,IAAI,KACbC,MAAM,CAACC,kBAAkB,CACvBP,cAAc,EACdP,+BAA+B,CAAC,MAAM;MACpC,SAAS;;MACTQ,OAAO,CAAC,GAAGI,IAAI,CAAC;IAClB,CAAC,CACH,CAAC;EACL;EACA,OAAO,CAAC,GAAGA,IAAI,KACbd,sBAAsB,CAACiB,iBAAiB,CACtCR,cAAc,EACdN,2BAA2B,CAAC,MAAM;IAChC,SAAS;;IACTO,OAAO,CAAC,GAAGI,IAAI,CAAC;EAClB,CAAC,CACH,CAAC;AACL","ignoreList":[]}
@@ -0,0 +1,20 @@
1
+ 'use strict';
2
+
3
+ function noopFactory(defaultReturnValue) {
4
+ return () => {
5
+ 'worklet';
6
+
7
+ console.warn('[Reanimated] RNScreensTurboModule has not been found. Check that you have installed `react-native-screens@3.30.0` or newer in your project and rebuilt your app.');
8
+ return defaultReturnValue;
9
+ };
10
+ }
11
+ export const RNScreensTurboModule = global.RNScreensTurboModule || {
12
+ startTransition: noopFactory({
13
+ topScreenId: -1,
14
+ belowTopScreenId: -1,
15
+ canStartTransition: false
16
+ }),
17
+ updateTransition: noopFactory(),
18
+ finishTransition: noopFactory()
19
+ };
20
+ //# sourceMappingURL=RNScreensTurboModule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["noopFactory","defaultReturnValue","console","warn","RNScreensTurboModule","global","startTransition","topScreenId","belowTopScreenId","canStartTransition","updateTransition","finishTransition"],"sources":["RNScreensTurboModule.ts"],"sourcesContent":["'use strict';\nimport type { RNScreensTurboModuleType } from './commonTypes';\n\nfunction noopFactory<T>(defaultReturnValue?: T): () => T {\n return () => {\n 'worklet';\n console.warn(\n '[Reanimated] RNScreensTurboModule has not been found. Check that you have installed `react-native-screens@3.30.0` or newer in your project and rebuilt your app.'\n );\n return defaultReturnValue as T;\n };\n}\n\ntype TransactionConfig = {\n topScreenId: number;\n belowTopScreenId: number;\n canStartTransition: boolean;\n};\n\nexport const RNScreensTurboModule: RNScreensTurboModuleType =\n global.RNScreensTurboModule || {\n startTransition: noopFactory<TransactionConfig>({\n topScreenId: -1,\n belowTopScreenId: -1,\n canStartTransition: false,\n }),\n updateTransition: noopFactory(),\n finishTransition: noopFactory(),\n };\n"],"mappings":"AAAA,YAAY;;AAGZ,SAASA,WAAWA,CAAIC,kBAAsB,EAAW;EACvD,OAAO,MAAM;IACX,SAAS;;IACTC,OAAO,CAACC,IAAI,CACV,kKACF,CAAC;IACD,OAAOF,kBAAkB;EAC3B,CAAC;AACH;AAQA,OAAO,MAAMG,oBAA8C,GACzDC,MAAM,CAACD,oBAAoB,IAAI;EAC7BE,eAAe,EAAEN,WAAW,CAAoB;IAC9CO,WAAW,EAAE,CAAC,CAAC;IACfC,gBAAgB,EAAE,CAAC,CAAC;IACpBC,kBAAkB,EAAE;EACtB,CAAC,CAAC;EACFC,gBAAgB,EAAEV,WAAW,CAAC,CAAC;EAC/BW,gBAAgB,EAAEX,WAAW,CAAC;AAChC,CAAC","ignoreList":[]}
@@ -0,0 +1,41 @@
1
+ 'use strict';
2
+
3
+ import { configureProps } from '../../ConfigHelper';
4
+ import { applyStyle } from './styleUpdater';
5
+ import { getSwipeSimulator } from './swipeSimulator';
6
+ configureProps();
7
+ export function startScreenTransition(screenTransitionConfig) {
8
+ 'worklet';
9
+
10
+ const {
11
+ stackTag,
12
+ sharedEvent
13
+ } = screenTransitionConfig;
14
+ sharedEvent.addListener(stackTag, () => {
15
+ applyStyle(screenTransitionConfig, sharedEvent.value);
16
+ });
17
+ }
18
+ function getLockAxis(goBackGesture) {
19
+ 'worklet';
20
+
21
+ if (['swipeRight', 'swipeLeft', 'horizontalSwipe'].includes(goBackGesture)) {
22
+ return 'x';
23
+ } else if (['swipeUp', 'swipeDown', 'verticalSwipe'].includes(goBackGesture)) {
24
+ return 'y';
25
+ }
26
+ return undefined;
27
+ }
28
+ export function finishScreenTransition(screenTransitionConfig) {
29
+ 'worklet';
30
+
31
+ const {
32
+ stackTag,
33
+ sharedEvent,
34
+ goBackGesture
35
+ } = screenTransitionConfig;
36
+ sharedEvent.removeListener(stackTag);
37
+ const lockAxis = getLockAxis(goBackGesture);
38
+ const step = getSwipeSimulator(sharedEvent.value, screenTransitionConfig, lockAxis);
39
+ step();
40
+ }
41
+ //# sourceMappingURL=animationManager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["configureProps","applyStyle","getSwipeSimulator","startScreenTransition","screenTransitionConfig","stackTag","sharedEvent","addListener","value","getLockAxis","goBackGesture","includes","undefined","finishScreenTransition","removeListener","lockAxis","step"],"sources":["animationManager.ts"],"sourcesContent":["'use strict';\n\nimport type { LockAxis, ScreenTransitionConfig } from './commonTypes';\nimport { configureProps } from '../../ConfigHelper';\nimport { applyStyle } from './styleUpdater';\nimport { getSwipeSimulator } from './swipeSimulator';\n\nconfigureProps();\n\nexport function startScreenTransition(\n screenTransitionConfig: ScreenTransitionConfig\n) {\n 'worklet';\n const { stackTag, sharedEvent } = screenTransitionConfig;\n sharedEvent.addListener(stackTag, () => {\n applyStyle(screenTransitionConfig, sharedEvent.value);\n });\n}\n\nfunction getLockAxis(goBackGesture: string): LockAxis {\n 'worklet';\n if (['swipeRight', 'swipeLeft', 'horizontalSwipe'].includes(goBackGesture)) {\n return 'x';\n } else if (\n ['swipeUp', 'swipeDown', 'verticalSwipe'].includes(goBackGesture)\n ) {\n return 'y';\n }\n return undefined;\n}\n\nexport function finishScreenTransition(\n screenTransitionConfig: ScreenTransitionConfig\n) {\n 'worklet';\n const { stackTag, sharedEvent, goBackGesture } = screenTransitionConfig;\n sharedEvent.removeListener(stackTag);\n const lockAxis = getLockAxis(goBackGesture);\n const step = getSwipeSimulator(\n sharedEvent.value,\n screenTransitionConfig,\n lockAxis\n );\n step();\n}\n"],"mappings":"AAAA,YAAY;;AAGZ,SAASA,cAAc,QAAQ,oBAAoB;AACnD,SAASC,UAAU,QAAQ,gBAAgB;AAC3C,SAASC,iBAAiB,QAAQ,kBAAkB;AAEpDF,cAAc,CAAC,CAAC;AAEhB,OAAO,SAASG,qBAAqBA,CACnCC,sBAA8C,EAC9C;EACA,SAAS;;EACT,MAAM;IAAEC,QAAQ;IAAEC;EAAY,CAAC,GAAGF,sBAAsB;EACxDE,WAAW,CAACC,WAAW,CAACF,QAAQ,EAAE,MAAM;IACtCJ,UAAU,CAACG,sBAAsB,EAAEE,WAAW,CAACE,KAAK,CAAC;EACvD,CAAC,CAAC;AACJ;AAEA,SAASC,WAAWA,CAACC,aAAqB,EAAY;EACpD,SAAS;;EACT,IAAI,CAAC,YAAY,EAAE,WAAW,EAAE,iBAAiB,CAAC,CAACC,QAAQ,CAACD,aAAa,CAAC,EAAE;IAC1E,OAAO,GAAG;EACZ,CAAC,MAAM,IACL,CAAC,SAAS,EAAE,WAAW,EAAE,eAAe,CAAC,CAACC,QAAQ,CAACD,aAAa,CAAC,EACjE;IACA,OAAO,GAAG;EACZ;EACA,OAAOE,SAAS;AAClB;AAEA,OAAO,SAASC,sBAAsBA,CACpCT,sBAA8C,EAC9C;EACA,SAAS;;EACT,MAAM;IAAEC,QAAQ;IAAEC,WAAW;IAAEI;EAAc,CAAC,GAAGN,sBAAsB;EACvEE,WAAW,CAACQ,cAAc,CAACT,QAAQ,CAAC;EACpC,MAAMU,QAAQ,GAAGN,WAAW,CAACC,aAAa,CAAC;EAC3C,MAAMM,IAAI,GAAGd,iBAAiB,CAC5BI,WAAW,CAACE,KAAK,EACjBJ,sBAAsB,EACtBW,QACF,CAAC;EACDC,IAAI,CAAC,CAAC;AACR","ignoreList":[]}
@@ -0,0 +1,4 @@
1
+ 'use strict';
2
+
3
+ export {};
4
+ //# sourceMappingURL=commonTypes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["commonTypes.ts"],"sourcesContent":["'use strict';\n\nimport type {\n MeasuredDimensions,\n ShadowNodeWrapper,\n SharedValue,\n} from '../commonTypes';\n\nexport type PanGestureHandlerEventPayload = {\n x: number;\n y: number;\n absoluteX: number;\n absoluteY: number;\n translationX: number;\n translationY: number;\n velocityX: number;\n velocityY: number;\n};\n\nexport type AnimatedScreenTransition = {\n topScreenStyle: (\n event: PanGestureHandlerEventPayload,\n screenDimensions: MeasuredDimensions\n ) => Record<string, unknown>;\n belowTopScreenStyle: (\n event: PanGestureHandlerEventPayload,\n screenDimensions: MeasuredDimensions\n ) => Record<string, unknown>;\n};\n\nexport type GoBackGesture =\n | 'swipeRight'\n | 'swipeLeft'\n | 'swipeUp'\n | 'swipeDown'\n | 'verticalSwipe'\n | 'horizontalSwipe'\n | 'twoDimensionalSwipe';\n\nexport type ScreenTransitionConfig = {\n stackTag: number;\n belowTopScreenId: number | ShadowNodeWrapper;\n topScreenId: number | ShadowNodeWrapper;\n screenTransition: AnimatedScreenTransition;\n sharedEvent: SharedValue<PanGestureHandlerEventPayload>;\n startingGesturePosition: SharedValue<PanGestureHandlerEventPayload>;\n onFinishAnimation?: () => void;\n isTransitionCanceled: boolean;\n goBackGesture: GoBackGesture;\n screenDimensions: MeasuredDimensions;\n};\n\nexport type RNScreensTurboModuleType = {\n startTransition: (stackTag: number) => {\n topScreenId: number | ShadowNodeWrapper;\n belowTopScreenId: number | ShadowNodeWrapper;\n canStartTransition: boolean;\n };\n updateTransition: (stackTag: number, progress: number) => void;\n finishTransition: (stackTag: number, isCanceled: boolean) => void;\n};\n\nexport type LockAxis = 'x' | 'y' | undefined;\n"],"mappings":"AAAA,YAAY;;AAAC","ignoreList":[]}
@@ -0,0 +1,5 @@
1
+ 'use strict';
2
+
3
+ export { startScreenTransition, finishScreenTransition } from './animationManager';
4
+ export { ScreenTransition } from './presets';
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["startScreenTransition","finishScreenTransition","ScreenTransition"],"sources":["index.ts"],"sourcesContent":["'use strict';\n\nexport {\n startScreenTransition,\n finishScreenTransition,\n} from './animationManager';\nexport { ScreenTransition } from './presets';\nexport type {\n AnimatedScreenTransition,\n GoBackGesture,\n ScreenTransitionConfig,\n} from './commonTypes';\n"],"mappings":"AAAA,YAAY;;AAEZ,SACEA,qBAAqB,EACrBC,sBAAsB,QACjB,oBAAoB;AAC3B,SAASC,gBAAgB,QAAQ,WAAW","ignoreList":[]}