react-native-reanimated 3.9.0-rc.0 → 3.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (297) hide show
  1. package/Common/cpp/Fabric/ShadowTreeCloner.cpp +2 -1
  2. package/Common/cpp/NativeModules/NativeReanimatedModule.cpp +11 -4
  3. package/android/src/main/java/com/swmansion/reanimated/NodesManager.java +5 -3
  4. package/apple/REAModule.mm +14 -29
  5. package/apple/REANodesManager.mm +7 -6
  6. package/lib/module/Animated.js.map +1 -1
  7. package/lib/module/ConfigHelper.js.map +1 -1
  8. package/lib/module/animationBuilder.js.map +1 -1
  9. package/lib/module/createAnimatedComponent/InlinePropManager.js +2 -2
  10. package/lib/module/createAnimatedComponent/InlinePropManager.js.map +1 -1
  11. package/lib/module/createAnimatedComponent/JSPropsUpdater.js +4 -4
  12. package/lib/module/createAnimatedComponent/JSPropsUpdater.js.map +1 -1
  13. package/lib/module/createAnimatedComponent/JSPropsUpdater.web.js.map +1 -1
  14. package/lib/module/createAnimatedComponent/PropsFilter.js +5 -5
  15. package/lib/module/createAnimatedComponent/PropsFilter.js.map +1 -1
  16. package/lib/module/createAnimatedComponent/commonTypes.js.map +1 -1
  17. package/lib/module/createAnimatedComponent/createAnimatedComponent.js +33 -33
  18. package/lib/module/createAnimatedComponent/createAnimatedComponent.js.map +1 -1
  19. package/lib/module/createAnimatedComponent/getViewInfo.js +2 -2
  20. package/lib/module/createAnimatedComponent/getViewInfo.js.map +1 -1
  21. package/lib/module/createAnimatedComponent/index.js.map +1 -1
  22. package/lib/module/createAnimatedComponent/setAndForwardRef.js +4 -5
  23. package/lib/module/createAnimatedComponent/setAndForwardRef.js.map +1 -1
  24. package/lib/module/createAnimatedComponent/utils.js.map +1 -1
  25. package/lib/module/index.js.map +1 -1
  26. package/lib/module/index.web.js +1 -2
  27. package/lib/module/index.web.js.map +1 -1
  28. package/lib/module/mock.js +3 -8
  29. package/lib/module/mock.js.map +1 -1
  30. package/lib/module/propsAllowlists.js.map +1 -1
  31. package/lib/module/reanimated2/Bezier.js.map +1 -1
  32. package/lib/module/reanimated2/Colors.js +4 -11
  33. package/lib/module/reanimated2/Colors.js.map +1 -1
  34. package/lib/module/reanimated2/Easing.js +3 -7
  35. package/lib/module/reanimated2/Easing.js.map +1 -1
  36. package/lib/module/reanimated2/NativeReanimated/NativeReanimated.js +3 -3
  37. package/lib/module/reanimated2/NativeReanimated/NativeReanimated.js.map +1 -1
  38. package/lib/module/reanimated2/NativeReanimated/index.js.map +1 -1
  39. package/lib/module/reanimated2/NativeReanimated/index.web.js.map +1 -1
  40. package/lib/module/reanimated2/PlatformChecker.js +1 -0
  41. package/lib/module/reanimated2/PlatformChecker.js.map +1 -1
  42. package/lib/module/reanimated2/PropAdapters.js +1 -1
  43. package/lib/module/reanimated2/PropAdapters.js.map +1 -1
  44. package/lib/module/reanimated2/PropsRegistry.js.map +1 -1
  45. package/lib/module/reanimated2/Sensor.js +2 -2
  46. package/lib/module/reanimated2/Sensor.js.map +1 -1
  47. package/lib/module/reanimated2/SensorContainer.js +2 -2
  48. package/lib/module/reanimated2/SensorContainer.js.map +1 -1
  49. package/lib/module/reanimated2/UpdateLayoutAnimations.js.map +1 -1
  50. package/lib/module/reanimated2/UpdateProps.js.map +1 -1
  51. package/lib/module/reanimated2/ViewDescriptorsSet.js.map +1 -1
  52. package/lib/module/reanimated2/WorkletEventHandler.js +74 -31
  53. package/lib/module/reanimated2/WorkletEventHandler.js.map +1 -1
  54. package/lib/module/reanimated2/animation/clamp.js.map +1 -1
  55. package/lib/module/reanimated2/animation/commonTypes.js.map +1 -1
  56. package/lib/module/reanimated2/animation/decay/decay.js.map +1 -1
  57. package/lib/module/reanimated2/animation/decay/index.js.map +1 -1
  58. package/lib/module/reanimated2/animation/decay/rigidDecay.js.map +1 -1
  59. package/lib/module/reanimated2/animation/decay/rubberBandDecay.js.map +1 -1
  60. package/lib/module/reanimated2/animation/decay/utils.js.map +1 -1
  61. package/lib/module/reanimated2/animation/delay.js.map +1 -1
  62. package/lib/module/reanimated2/animation/index.js.map +1 -1
  63. package/lib/module/reanimated2/animation/repeat.js +1 -6
  64. package/lib/module/reanimated2/animation/repeat.js.map +1 -1
  65. package/lib/module/reanimated2/animation/sequence.js +1 -5
  66. package/lib/module/reanimated2/animation/sequence.js.map +1 -1
  67. package/lib/module/reanimated2/animation/spring.js.map +1 -1
  68. package/lib/module/reanimated2/animation/springUtils.js +8 -10
  69. package/lib/module/reanimated2/animation/springUtils.js.map +1 -1
  70. package/lib/module/reanimated2/animation/styleAnimation.js +5 -4
  71. package/lib/module/reanimated2/animation/styleAnimation.js.map +1 -1
  72. package/lib/module/reanimated2/animation/timing.js.map +1 -1
  73. package/lib/module/reanimated2/animation/transformationMatrix/matrixUtils.js +1 -2
  74. package/lib/module/reanimated2/animation/transformationMatrix/matrixUtils.js.map +1 -1
  75. package/lib/module/reanimated2/animation/util.js.map +1 -1
  76. package/lib/module/reanimated2/commonTypes.js +2 -0
  77. package/lib/module/reanimated2/commonTypes.js.map +1 -1
  78. package/lib/module/reanimated2/component/FlatList.js +1 -0
  79. package/lib/module/reanimated2/component/FlatList.js.map +1 -1
  80. package/lib/module/reanimated2/component/Image.js +1 -0
  81. package/lib/module/reanimated2/component/Image.js.map +1 -1
  82. package/lib/module/reanimated2/component/LayoutAnimationConfig.js +1 -0
  83. package/lib/module/reanimated2/component/LayoutAnimationConfig.js.map +1 -1
  84. package/lib/module/reanimated2/component/PerformanceMonitor.js +3 -4
  85. package/lib/module/reanimated2/component/PerformanceMonitor.js.map +1 -1
  86. package/lib/module/reanimated2/component/ScrollView.js +1 -0
  87. package/lib/module/reanimated2/component/ScrollView.js.map +1 -1
  88. package/lib/module/reanimated2/component/Text.js +1 -0
  89. package/lib/module/reanimated2/component/Text.js.map +1 -1
  90. package/lib/module/reanimated2/component/View.js +1 -0
  91. package/lib/module/reanimated2/component/View.js.map +1 -1
  92. package/lib/module/reanimated2/core.js +2 -4
  93. package/lib/module/reanimated2/core.js.map +1 -1
  94. package/lib/module/reanimated2/errors.js +7 -8
  95. package/lib/module/reanimated2/errors.js.map +1 -1
  96. package/lib/module/reanimated2/fabricUtils.js +4 -4
  97. package/lib/module/reanimated2/fabricUtils.js.map +1 -1
  98. package/lib/module/reanimated2/fabricUtils.web.js.map +1 -1
  99. package/lib/module/reanimated2/frameCallback/FrameCallbackRegistryJS.js +2 -2
  100. package/lib/module/reanimated2/frameCallback/FrameCallbackRegistryJS.js.map +1 -1
  101. package/lib/module/reanimated2/frameCallback/FrameCallbackRegistryUI.js.map +1 -1
  102. package/lib/module/reanimated2/frameCallback/index.js.map +1 -1
  103. package/lib/module/reanimated2/globals.d.js.map +1 -1
  104. package/lib/module/reanimated2/helperTypes.js.map +1 -1
  105. package/lib/module/reanimated2/hook/commonTypes.js.map +1 -1
  106. package/lib/module/reanimated2/hook/index.js.map +1 -1
  107. package/lib/module/reanimated2/hook/useAnimatedGestureHandler.js +1 -0
  108. package/lib/module/reanimated2/hook/useAnimatedGestureHandler.js.map +1 -1
  109. package/lib/module/reanimated2/hook/useAnimatedKeyboard.js +3 -4
  110. package/lib/module/reanimated2/hook/useAnimatedKeyboard.js.map +1 -1
  111. package/lib/module/reanimated2/hook/useAnimatedProps.js.map +1 -1
  112. package/lib/module/reanimated2/hook/useAnimatedReaction.js +1 -0
  113. package/lib/module/reanimated2/hook/useAnimatedReaction.js.map +1 -1
  114. package/lib/module/reanimated2/hook/useAnimatedRef.js +1 -1
  115. package/lib/module/reanimated2/hook/useAnimatedRef.js.map +1 -1
  116. package/lib/module/reanimated2/hook/useAnimatedScrollHandler.js +3 -1
  117. package/lib/module/reanimated2/hook/useAnimatedScrollHandler.js.map +1 -1
  118. package/lib/module/reanimated2/hook/useAnimatedSensor.js.map +1 -1
  119. package/lib/module/reanimated2/hook/useAnimatedStyle.js +3 -6
  120. package/lib/module/reanimated2/hook/useAnimatedStyle.js.map +1 -1
  121. package/lib/module/reanimated2/hook/useDerivedValue.js +3 -1
  122. package/lib/module/reanimated2/hook/useDerivedValue.js.map +1 -1
  123. package/lib/module/reanimated2/hook/useEvent.js +4 -5
  124. package/lib/module/reanimated2/hook/useEvent.js.map +1 -1
  125. package/lib/module/reanimated2/hook/useFrameCallback.js +1 -2
  126. package/lib/module/reanimated2/hook/useFrameCallback.js.map +1 -1
  127. package/lib/module/reanimated2/hook/useHandler.js +3 -1
  128. package/lib/module/reanimated2/hook/useHandler.js.map +1 -1
  129. package/lib/module/reanimated2/hook/useReducedMotion.js.map +1 -1
  130. package/lib/module/reanimated2/hook/useScrollViewOffset.js +14 -6
  131. package/lib/module/reanimated2/hook/useScrollViewOffset.js.map +1 -1
  132. package/lib/module/reanimated2/hook/useSharedValue.js.map +1 -1
  133. package/lib/module/reanimated2/hook/useWorkletCallback.js.map +1 -1
  134. package/lib/module/reanimated2/hook/utils.js.map +1 -1
  135. package/lib/module/reanimated2/index.js.map +1 -1
  136. package/lib/module/reanimated2/initializers.js +1 -5
  137. package/lib/module/reanimated2/initializers.js.map +1 -1
  138. package/lib/module/reanimated2/interpolateColor.js +2 -6
  139. package/lib/module/reanimated2/interpolateColor.js.map +1 -1
  140. package/lib/module/reanimated2/interpolation.js +1 -1
  141. package/lib/module/reanimated2/interpolation.js.map +1 -1
  142. package/lib/module/reanimated2/isSharedValue.js.map +1 -1
  143. package/lib/module/reanimated2/jestUtils.js +3 -6
  144. package/lib/module/reanimated2/jestUtils.js.map +1 -1
  145. package/lib/module/reanimated2/jestUtils.web.js.map +1 -1
  146. package/lib/module/reanimated2/js-reanimated/JSReanimated.js +4 -5
  147. package/lib/module/reanimated2/js-reanimated/JSReanimated.js.map +1 -1
  148. package/lib/module/reanimated2/js-reanimated/WebSensor.js.map +1 -1
  149. package/lib/module/reanimated2/js-reanimated/index.js +2 -2
  150. package/lib/module/reanimated2/js-reanimated/index.js.map +1 -1
  151. package/lib/module/reanimated2/js-reanimated/react-native-web.d.js.map +1 -1
  152. package/lib/module/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.js +4 -2
  153. package/lib/module/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.js.map +1 -1
  154. package/lib/module/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.js +8 -11
  155. package/lib/module/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.js.map +1 -1
  156. package/lib/module/reanimated2/layoutReanimation/animationBuilder/Keyframe.js +8 -9
  157. package/lib/module/reanimated2/layoutReanimation/animationBuilder/Keyframe.js.map +1 -1
  158. package/lib/module/reanimated2/layoutReanimation/animationBuilder/commonTypes.js.map +1 -1
  159. package/lib/module/reanimated2/layoutReanimation/animationBuilder/index.js.map +1 -1
  160. package/lib/module/reanimated2/layoutReanimation/animationsManager.js +1 -2
  161. package/lib/module/reanimated2/layoutReanimation/animationsManager.js.map +1 -1
  162. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Bounce.js +22 -22
  163. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Bounce.js.map +1 -1
  164. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Fade.js +22 -22
  165. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Fade.js.map +1 -1
  166. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Flip.js +26 -26
  167. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Flip.js.map +1 -1
  168. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.js +10 -10
  169. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.js.map +1 -1
  170. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.js +6 -6
  171. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.js.map +1 -1
  172. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Roll.js +10 -10
  173. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Roll.js.map +1 -1
  174. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Rotate.js +18 -18
  175. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Rotate.js.map +1 -1
  176. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Slide.js +18 -18
  177. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Slide.js.map +1 -1
  178. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Stretch.js +10 -10
  179. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Stretch.js.map +1 -1
  180. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Zoom.js +34 -34
  181. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Zoom.js.map +1 -1
  182. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/index.js.map +1 -1
  183. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.js +4 -4
  184. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.js.map +1 -1
  185. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.js +4 -4
  186. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.js.map +1 -1
  187. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.js +4 -4
  188. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.js.map +1 -1
  189. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.js +4 -4
  190. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.js.map +1 -1
  191. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.js +4 -4
  192. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.js.map +1 -1
  193. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.js +4 -4
  194. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.js.map +1 -1
  195. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/index.js.map +1 -1
  196. package/lib/module/reanimated2/layoutReanimation/index.js.map +1 -1
  197. package/lib/module/reanimated2/layoutReanimation/sharedTransitions/ProgressTransitionManager.js +4 -6
  198. package/lib/module/reanimated2/layoutReanimation/sharedTransitions/ProgressTransitionManager.js.map +1 -1
  199. package/lib/module/reanimated2/layoutReanimation/sharedTransitions/SharedTransition.js +4 -6
  200. package/lib/module/reanimated2/layoutReanimation/sharedTransitions/SharedTransition.js.map +1 -1
  201. package/lib/module/reanimated2/layoutReanimation/sharedTransitions/SharedTransition.web.js.map +1 -1
  202. package/lib/module/reanimated2/layoutReanimation/sharedTransitions/index.js.map +1 -1
  203. package/lib/module/reanimated2/layoutReanimation/web/animation/Bounce.web.js.map +1 -1
  204. package/lib/module/reanimated2/layoutReanimation/web/animation/Fade.web.js.map +1 -1
  205. package/lib/module/reanimated2/layoutReanimation/web/animation/Flip.web.js.map +1 -1
  206. package/lib/module/reanimated2/layoutReanimation/web/animation/Lightspeed.web.js.map +1 -1
  207. package/lib/module/reanimated2/layoutReanimation/web/animation/Pinwheel.web.js.map +1 -1
  208. package/lib/module/reanimated2/layoutReanimation/web/animation/Roll.web.js.map +1 -1
  209. package/lib/module/reanimated2/layoutReanimation/web/animation/Rotate.web.js.map +1 -1
  210. package/lib/module/reanimated2/layoutReanimation/web/animation/Slide.web.js.map +1 -1
  211. package/lib/module/reanimated2/layoutReanimation/web/animation/Stretch.web.js.map +1 -1
  212. package/lib/module/reanimated2/layoutReanimation/web/animation/Zoom.web.js.map +1 -1
  213. package/lib/module/reanimated2/layoutReanimation/web/animationParser.js +0 -2
  214. package/lib/module/reanimated2/layoutReanimation/web/animationParser.js.map +1 -1
  215. package/lib/module/reanimated2/layoutReanimation/web/animationsManager.js +1 -2
  216. package/lib/module/reanimated2/layoutReanimation/web/animationsManager.js.map +1 -1
  217. package/lib/module/reanimated2/layoutReanimation/web/componentStyle.js +3 -1
  218. package/lib/module/reanimated2/layoutReanimation/web/componentStyle.js.map +1 -1
  219. package/lib/module/reanimated2/layoutReanimation/web/componentUtils.js +6 -7
  220. package/lib/module/reanimated2/layoutReanimation/web/componentUtils.js.map +1 -1
  221. package/lib/module/reanimated2/layoutReanimation/web/config.js.map +1 -1
  222. package/lib/module/reanimated2/layoutReanimation/web/createAnimation.js +2 -2
  223. package/lib/module/reanimated2/layoutReanimation/web/createAnimation.js.map +1 -1
  224. package/lib/module/reanimated2/layoutReanimation/web/domUtils.js +4 -4
  225. package/lib/module/reanimated2/layoutReanimation/web/domUtils.js.map +1 -1
  226. package/lib/module/reanimated2/layoutReanimation/web/index.js.map +1 -1
  227. package/lib/module/reanimated2/layoutReanimation/web/transition/Fading.web.js.map +1 -1
  228. package/lib/module/reanimated2/layoutReanimation/web/transition/Linear.web.js.map +1 -1
  229. package/lib/module/reanimated2/layoutReanimation/web/transition/Sequenced.web.js.map +1 -1
  230. package/lib/module/reanimated2/mappers.js +2 -4
  231. package/lib/module/reanimated2/mappers.js.map +1 -1
  232. package/lib/module/reanimated2/mockedRequestAnimationFrame.js.map +1 -1
  233. package/lib/module/reanimated2/mutables.js +2 -4
  234. package/lib/module/reanimated2/mutables.js.map +1 -1
  235. package/lib/module/reanimated2/platform-specific/RNRenderer.js.map +1 -1
  236. package/lib/module/reanimated2/platform-specific/RNRenderer.web.js.map +1 -1
  237. package/lib/module/reanimated2/platform-specific/checkCppVersion.js.map +1 -1
  238. package/lib/module/reanimated2/platform-specific/jsVersion.js +1 -1
  239. package/lib/module/reanimated2/platform-specific/jsVersion.js.map +1 -1
  240. package/lib/module/reanimated2/platformFunctions/dispatchCommand.js +2 -4
  241. package/lib/module/reanimated2/platformFunctions/dispatchCommand.js.map +1 -1
  242. package/lib/module/reanimated2/platformFunctions/dispatchCommand.web.js.map +1 -1
  243. package/lib/module/reanimated2/platformFunctions/getRelativeCoords.js +2 -2
  244. package/lib/module/reanimated2/platformFunctions/getRelativeCoords.js.map +1 -1
  245. package/lib/module/reanimated2/platformFunctions/index.js.map +1 -1
  246. package/lib/module/reanimated2/platformFunctions/measure.js.map +1 -1
  247. package/lib/module/reanimated2/platformFunctions/measure.web.js.map +1 -1
  248. package/lib/module/reanimated2/platformFunctions/scrollTo.js.map +1 -1
  249. package/lib/module/reanimated2/platformFunctions/scrollTo.web.js +1 -1
  250. package/lib/module/reanimated2/platformFunctions/scrollTo.web.js.map +1 -1
  251. package/lib/module/reanimated2/platformFunctions/setGestureState.js.map +1 -1
  252. package/lib/module/reanimated2/platformFunctions/setGestureState.web.js.map +1 -1
  253. package/lib/module/reanimated2/platformFunctions/setNativeProps.js.map +1 -1
  254. package/lib/module/reanimated2/platformFunctions/setNativeProps.web.js.map +1 -1
  255. package/lib/module/reanimated2/pluginUtils.js.map +1 -1
  256. package/lib/module/reanimated2/publicGlobals.js.map +1 -1
  257. package/lib/module/reanimated2/runtimes.js +11 -19
  258. package/lib/module/reanimated2/runtimes.js.map +1 -1
  259. package/lib/module/reanimated2/screenTransition/RNScreensTurboModule.js.map +1 -1
  260. package/lib/module/reanimated2/screenTransition/animationManager.js.map +1 -1
  261. package/lib/module/reanimated2/screenTransition/commonTypes.js.map +1 -1
  262. package/lib/module/reanimated2/screenTransition/index.js.map +1 -1
  263. package/lib/module/reanimated2/screenTransition/presets.js.map +1 -1
  264. package/lib/module/reanimated2/screenTransition/styleUpdater.js.map +1 -1
  265. package/lib/module/reanimated2/screenTransition/swipeSimulator.js +1 -1
  266. package/lib/module/reanimated2/screenTransition/swipeSimulator.js.map +1 -1
  267. package/lib/module/reanimated2/shareableMappingCache.js.map +1 -1
  268. package/lib/module/reanimated2/shareables.js +2 -4
  269. package/lib/module/reanimated2/shareables.js.map +1 -1
  270. package/lib/module/reanimated2/threads.js +9 -34
  271. package/lib/module/reanimated2/threads.js.map +1 -1
  272. package/lib/module/reanimated2/valueSetter.js +1 -2
  273. package/lib/module/reanimated2/valueSetter.js.map +1 -1
  274. package/lib/module/reanimated2/valueUnpacker.js.map +1 -1
  275. package/lib/module/specs/NativeReanimatedModule.js.map +1 -1
  276. package/lib/typescript/reanimated2/WorkletEventHandler.d.ts +16 -9
  277. package/lib/typescript/reanimated2/component/LayoutAnimationConfig.d.ts +1 -1
  278. package/lib/typescript/reanimated2/component/PerformanceMonitor.d.ts +2 -1
  279. package/lib/typescript/reanimated2/hook/commonTypes.d.ts +5 -0
  280. package/lib/typescript/reanimated2/hook/useEvent.d.ts +2 -3
  281. package/lib/typescript/reanimated2/platform-specific/jsVersion.d.ts +1 -1
  282. package/package.json +18 -14
  283. package/plugin/build/plugin.js +7 -2
  284. package/src/createAnimatedComponent/PropsFilter.tsx +1 -1
  285. package/src/createAnimatedComponent/createAnimatedComponent.tsx +29 -33
  286. package/src/reanimated2/WorkletEventHandler.ts +98 -39
  287. package/src/reanimated2/animation/styleAnimation.ts +8 -6
  288. package/src/reanimated2/hook/commonTypes.ts +9 -0
  289. package/src/reanimated2/hook/useEvent.ts +4 -4
  290. package/src/reanimated2/hook/useScrollViewOffset.ts +21 -5
  291. package/src/reanimated2/js-reanimated/JSReanimated.ts +6 -3
  292. package/src/reanimated2/layoutReanimation/web/animationsManager.ts +1 -1
  293. package/src/reanimated2/layoutReanimation/web/componentStyle.ts +3 -1
  294. package/src/reanimated2/layoutReanimation/web/componentUtils.ts +1 -1
  295. package/src/reanimated2/layoutReanimation/web/createAnimation.ts +2 -2
  296. package/src/reanimated2/platform-specific/jsVersion.ts +1 -1
  297. package/src/reanimated2/platformFunctions/getRelativeCoords.ts +2 -2
@@ -1 +1 @@
1
- {"version":3,"names":["React","useEffect","useRef","TextInput","StyleSheet","View","useSharedValue","useAnimatedProps","useFrameCallback","createAnimatedComponent","addWhitelistedNativeProps","createCircularDoublesBuffer","size","next","buffer","Float32Array","count","push","value","oldValue","oldCount","Math","min","front","notEmpty","current","index","back","DEFAULT_BUFFER_SIZE","text","AnimatedTextInput","loopAnimationFrame","fn","lastTime","loop","requestAnimationFrame","time","getFps","renderTimeInMs","getTimeDelta","timestamp","previousTimestamp","completeBufferRoutine","totalRenderTime","round","droppedTimestamp","nextToDrop","delta","droppedDelta","JsPerformance","jsFps","circularBuffer","_","currentFps","toFixed","animatedProps","defaultValue","createElement","style","styles","container","editable","UiPerformance","uiFps","_ref","PerformanceMonitor","monitor","create","flexDirection","position","backgroundColor","zIndex","header","fontSize","color","paddingHorizontal","fontFamily","alignItems","justifyContent","flexWrap"],"sources":["PerformanceMonitor.tsx"],"sourcesContent":["'use strict';\n\nimport React, { useEffect, useRef } from 'react';\nimport { TextInput, StyleSheet, View } from 'react-native';\n\nimport type { FrameInfo } from '../frameCallback';\nimport type { SharedValue } from '../commonTypes';\nimport { useSharedValue, useAnimatedProps, useFrameCallback } from '../hook';\nimport { createAnimatedComponent } from '../../createAnimatedComponent';\nimport { addWhitelistedNativeProps } from '../../ConfigHelper';\n\ntype CircularBuffer = ReturnType<typeof createCircularDoublesBuffer>;\nfunction createCircularDoublesBuffer(size: number) {\n 'worklet';\n\n return {\n next: 0 as number,\n buffer: new Float32Array(size),\n size,\n count: 0 as number,\n\n push(value: number): number | null {\n const oldValue = this.buffer[this.next];\n const oldCount = this.count;\n this.buffer[this.next] = value;\n\n this.next = (this.next + 1) % this.size;\n this.count = Math.min(this.size, this.count + 1);\n return oldCount === this.size ? oldValue : null;\n },\n\n front(): number | null {\n const notEmpty = this.count > 0;\n if (notEmpty) {\n const current = this.next - 1;\n const index = current < 0 ? this.size - 1 : current;\n return this.buffer[index];\n }\n return null;\n },\n\n back(): number | null {\n const notEmpty = this.count > 0;\n return notEmpty ? this.buffer[this.next] : null;\n },\n };\n}\n\nconst DEFAULT_BUFFER_SIZE = 60;\naddWhitelistedNativeProps({ text: true });\nconst AnimatedTextInput = createAnimatedComponent(TextInput);\n\nfunction loopAnimationFrame(fn: (lastTime: number, time: number) => void) {\n let lastTime = 0;\n\n function loop() {\n requestAnimationFrame((time) => {\n if (lastTime > 0) {\n fn(lastTime, time);\n }\n lastTime = time;\n requestAnimationFrame(loop);\n });\n }\n\n loop();\n}\n\nfunction getFps(renderTimeInMs: number): number {\n 'worklet';\n return 1000 / renderTimeInMs;\n}\n\nfunction getTimeDelta(\n timestamp: number,\n previousTimestamp: number | null\n): number {\n 'worklet';\n return previousTimestamp !== null ? timestamp - previousTimestamp : 0;\n}\n\nfunction completeBufferRoutine(\n buffer: CircularBuffer,\n timestamp: number,\n previousTimestamp: number,\n totalRenderTime: SharedValue<number>\n): number {\n 'worklet';\n timestamp = Math.round(timestamp);\n previousTimestamp = Math.round(previousTimestamp) ?? timestamp;\n\n const droppedTimestamp = buffer.push(timestamp);\n const nextToDrop = buffer.back()!;\n\n const delta = getTimeDelta(timestamp, previousTimestamp);\n const droppedDelta = getTimeDelta(nextToDrop, droppedTimestamp);\n\n totalRenderTime.value += delta - droppedDelta;\n\n return getFps(totalRenderTime.value / buffer.count);\n}\n\nfunction JsPerformance() {\n const jsFps = useSharedValue<string | null>(null);\n const totalRenderTime = useSharedValue(0);\n const circularBuffer = useRef<CircularBuffer>(\n createCircularDoublesBuffer(DEFAULT_BUFFER_SIZE)\n );\n\n useEffect(() => {\n loopAnimationFrame((_, timestamp) => {\n timestamp = Math.round(timestamp);\n const previousTimestamp = circularBuffer.current.front() ?? timestamp;\n\n const currentFps = completeBufferRoutine(\n circularBuffer.current,\n timestamp,\n previousTimestamp,\n totalRenderTime\n );\n\n // JS fps have to be measured every 2nd frame,\n // thus 2x multiplication has to occur here\n jsFps.value = (currentFps * 2).toFixed(0);\n });\n }, []);\n\n const animatedProps = useAnimatedProps(() => {\n const text = 'JS: ' + jsFps.value ?? 'N/A';\n return { text, defaultValue: text };\n });\n\n return (\n <View style={styles.container}>\n <AnimatedTextInput\n style={styles.text}\n animatedProps={animatedProps}\n editable={false}\n />\n </View>\n );\n}\n\nfunction UiPerformance() {\n const uiFps = useSharedValue<string | null>(null);\n const totalRenderTime = useSharedValue(0);\n const circularBuffer = useSharedValue<CircularBuffer | null>(null);\n\n useFrameCallback(({ timestamp }: FrameInfo) => {\n if (circularBuffer.value === null) {\n circularBuffer.value = createCircularDoublesBuffer(DEFAULT_BUFFER_SIZE);\n }\n\n timestamp = Math.round(timestamp);\n const previousTimestamp = circularBuffer.value.front() ?? timestamp;\n\n const currentFps = completeBufferRoutine(\n circularBuffer.value,\n timestamp,\n previousTimestamp,\n totalRenderTime\n );\n\n uiFps.value = currentFps.toFixed(0);\n });\n\n const animatedProps = useAnimatedProps(() => {\n const text = 'UI: ' + uiFps.value ?? 'N/A';\n return { text, defaultValue: text };\n });\n\n return (\n <View style={styles.container}>\n <AnimatedTextInput\n style={styles.text}\n animatedProps={animatedProps}\n editable={false}\n />\n </View>\n );\n}\n\nexport function PerformanceMonitor() {\n return (\n <View style={styles.monitor}>\n <JsPerformance />\n <UiPerformance />\n </View>\n );\n}\n\nconst styles = StyleSheet.create({\n monitor: {\n flexDirection: 'row',\n position: 'absolute',\n backgroundColor: '#0006',\n zIndex: 1000,\n },\n header: {\n fontSize: 14,\n color: '#ffff',\n paddingHorizontal: 5,\n },\n text: {\n fontSize: 13,\n color: '#ffff',\n fontFamily: 'monospace',\n paddingHorizontal: 3,\n },\n container: {\n alignItems: 'center',\n justifyContent: 'center',\n flexDirection: 'row',\n flexWrap: 'wrap',\n },\n});\n"],"mappings":"AAAA,YAAY;;AAEZ,OAAOA,KAAK,IAAIC,SAAS,EAAEC,MAAM,QAAQ,OAAO;AAChD,SAASC,SAAS,EAAEC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAI1D,SAASC,cAAc,EAAEC,gBAAgB,EAAEC,gBAAgB,QAAQ,SAAS;AAC5E,SAASC,uBAAuB,QAAQ,+BAA+B;AACvE,SAASC,yBAAyB,QAAQ,oBAAoB;AAG9D,SAASC,2BAA2BA,CAACC,IAAY,EAAE;EACjD,SAAS;;EAET,OAAO;IACLC,IAAI,EAAE,CAAW;IACjBC,MAAM,EAAE,IAAIC,YAAY,CAACH,IAAI,CAAC;IAC9BA,IAAI;IACJI,KAAK,EAAE,CAAW;IAElBC,IAAIA,CAACC,KAAa,EAAiB;MACjC,MAAMC,QAAQ,GAAG,IAAI,CAACL,MAAM,CAAC,IAAI,CAACD,IAAI,CAAC;MAC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AAM,CAAC;EAC/BD,OAAO,EAAE;IACPE,aAAa,EAAE,KAAK;IACpBC,QAAQ,EAAE,UAAU;IACpBC,eAAe,EAAE,OAAO;IACxBC,MAAM,EAAE;EACV,CAAC;EACDC,MAAM,EAAE;IACNC,QAAQ,EAAE,EAAE;IACZC,KAAK,EAAE,OAAO;IACdC,iBAAiB,EAAE;EACrB,CAAC;EACD9C,IAAI,EAAE;IACJ4C,QAAQ,EAAE,EAAE;IACZC,KAAK,EAAE,OAAO;IACdE,UAAU,EAAE,WAAW;IACvBD,iBAAiB,EAAE;EACrB,CAAC;EACDf,SAAS,EAAE;IACTiB,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE,QAAQ;IACxBV,aAAa,EAAE,KAAK;IACpBW,QAAQ,EAAE;EACZ;AACF,CAAC,CAAC"}
1
+ {"version":3,"names":["React","useEffect","useRef","TextInput","StyleSheet","View","useSharedValue","useAnimatedProps","useFrameCallback","createAnimatedComponent","addWhitelistedNativeProps","createCircularDoublesBuffer","size","next","buffer","Float32Array","count","push","value","oldValue","oldCount","Math","min","front","notEmpty","current","index","back","DEFAULT_BUFFER_SIZE","text","AnimatedTextInput","loopAnimationFrame","fn","lastTime","loop","requestAnimationFrame","time","getFps","renderTimeInMs","getTimeDelta","timestamp","previousTimestamp","completeBufferRoutine","totalRenderTime","round","droppedTimestamp","nextToDrop","delta","droppedDelta","JsPerformance","jsFps","circularBuffer","_","currentFps","toFixed","animatedProps","defaultValue","createElement","style","styles","container","editable","UiPerformance","uiFps","PerformanceMonitor","monitor","create","flexDirection","position","backgroundColor","zIndex","header","fontSize","color","paddingHorizontal","fontFamily","alignItems","justifyContent","flexWrap"],"sources":["PerformanceMonitor.tsx"],"sourcesContent":["'use strict';\n\nimport React, { useEffect, useRef } from 'react';\nimport { TextInput, StyleSheet, View } from 'react-native';\n\nimport type { FrameInfo } from '../frameCallback';\nimport type { SharedValue } from '../commonTypes';\nimport { useSharedValue, useAnimatedProps, useFrameCallback } from '../hook';\nimport { createAnimatedComponent } from '../../createAnimatedComponent';\nimport { addWhitelistedNativeProps } from '../../ConfigHelper';\n\ntype CircularBuffer = ReturnType<typeof createCircularDoublesBuffer>;\nfunction createCircularDoublesBuffer(size: number) {\n 'worklet';\n\n return {\n next: 0 as number,\n buffer: new Float32Array(size),\n size,\n count: 0 as number,\n\n push(value: number): number | null {\n const oldValue = this.buffer[this.next];\n const oldCount = this.count;\n this.buffer[this.next] = value;\n\n this.next = (this.next + 1) % this.size;\n this.count = Math.min(this.size, this.count + 1);\n return oldCount === this.size ? oldValue : null;\n },\n\n front(): number | null {\n const notEmpty = this.count > 0;\n if (notEmpty) {\n const current = this.next - 1;\n const index = current < 0 ? this.size - 1 : current;\n return this.buffer[index];\n }\n return null;\n },\n\n back(): number | null {\n const notEmpty = this.count > 0;\n return notEmpty ? this.buffer[this.next] : null;\n },\n };\n}\n\nconst DEFAULT_BUFFER_SIZE = 60;\naddWhitelistedNativeProps({ text: true });\nconst AnimatedTextInput = createAnimatedComponent(TextInput);\n\nfunction loopAnimationFrame(fn: (lastTime: number, time: number) => void) {\n let lastTime = 0;\n\n function loop() {\n requestAnimationFrame((time) => {\n if (lastTime > 0) {\n fn(lastTime, time);\n }\n lastTime = time;\n requestAnimationFrame(loop);\n });\n }\n\n loop();\n}\n\nfunction getFps(renderTimeInMs: number): number {\n 'worklet';\n return 1000 / renderTimeInMs;\n}\n\nfunction getTimeDelta(\n timestamp: number,\n previousTimestamp: number | null\n): number {\n 'worklet';\n return previousTimestamp !== null ? timestamp - previousTimestamp : 0;\n}\n\nfunction completeBufferRoutine(\n buffer: CircularBuffer,\n timestamp: number,\n previousTimestamp: number,\n totalRenderTime: SharedValue<number>\n): number {\n 'worklet';\n timestamp = Math.round(timestamp);\n previousTimestamp = Math.round(previousTimestamp) ?? timestamp;\n\n const droppedTimestamp = buffer.push(timestamp);\n const nextToDrop = buffer.back()!;\n\n const delta = getTimeDelta(timestamp, previousTimestamp);\n const droppedDelta = getTimeDelta(nextToDrop, droppedTimestamp);\n\n totalRenderTime.value += delta - droppedDelta;\n\n return getFps(totalRenderTime.value / buffer.count);\n}\n\nfunction JsPerformance() {\n const jsFps = useSharedValue<string | null>(null);\n const totalRenderTime = useSharedValue(0);\n const circularBuffer = useRef<CircularBuffer>(\n createCircularDoublesBuffer(DEFAULT_BUFFER_SIZE)\n );\n\n useEffect(() => {\n loopAnimationFrame((_, timestamp) => {\n timestamp = Math.round(timestamp);\n const previousTimestamp = circularBuffer.current.front() ?? timestamp;\n\n const currentFps = completeBufferRoutine(\n circularBuffer.current,\n timestamp,\n previousTimestamp,\n totalRenderTime\n );\n\n // JS fps have to be measured every 2nd frame,\n // thus 2x multiplication has to occur here\n jsFps.value = (currentFps * 2).toFixed(0);\n });\n }, []);\n\n const animatedProps = useAnimatedProps(() => {\n const text = 'JS: ' + jsFps.value ?? 'N/A';\n return { text, defaultValue: text };\n });\n\n return (\n <View style={styles.container}>\n <AnimatedTextInput\n style={styles.text}\n animatedProps={animatedProps}\n editable={false}\n />\n </View>\n );\n}\n\nfunction UiPerformance() {\n const uiFps = useSharedValue<string | null>(null);\n const totalRenderTime = useSharedValue(0);\n const circularBuffer = useSharedValue<CircularBuffer | null>(null);\n\n useFrameCallback(({ timestamp }: FrameInfo) => {\n if (circularBuffer.value === null) {\n circularBuffer.value = createCircularDoublesBuffer(DEFAULT_BUFFER_SIZE);\n }\n\n timestamp = Math.round(timestamp);\n const previousTimestamp = circularBuffer.value.front() ?? timestamp;\n\n const currentFps = completeBufferRoutine(\n circularBuffer.value,\n timestamp,\n previousTimestamp,\n totalRenderTime\n );\n\n uiFps.value = currentFps.toFixed(0);\n });\n\n const animatedProps = useAnimatedProps(() => {\n const text = 'UI: ' + uiFps.value ?? 'N/A';\n return { text, defaultValue: text };\n });\n\n return (\n <View style={styles.container}>\n <AnimatedTextInput\n style={styles.text}\n animatedProps={animatedProps}\n editable={false}\n />\n </View>\n );\n}\n\nexport function PerformanceMonitor() {\n return (\n <View style={styles.monitor}>\n <JsPerformance />\n <UiPerformance />\n </View>\n );\n}\n\nconst styles = StyleSheet.create({\n monitor: {\n flexDirection: 'row',\n position: 'absolute',\n backgroundColor: '#0006',\n zIndex: 1000,\n },\n header: {\n fontSize: 14,\n color: '#ffff',\n paddingHorizontal: 5,\n },\n text: {\n fontSize: 13,\n color: '#ffff',\n fontFamily: 'monospace',\n paddingHorizontal: 3,\n },\n container: {\n alignItems: 'center',\n justifyContent: 'center',\n flexDirection: 'row',\n flexWrap: 'wrap',\n },\n});\n"],"mappings":"AAAA,YAAY;;AAEZ,OAAOA,KAAK,IAAIC,SAAS,EAAEC,MAAM,QAAQ,OAAO;AAChD,SAASC,SAAS,EAAEC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAI1D,SAASC,cAAc,EAAEC,gBAAgB,EAAEC,gBAAgB,QAAQ,SAAS;AAC5E,SAASC,uBAAuB,QAAQ,+BAA+B;AACvE,SAASC,yBAAyB,QAAQ,oBAAoB;AAG9D,SAASC,2BAA2BA,CAACC,IAAY,EAAE;EACjD,SAAS;;EAET,OAAO;IACLC,IAAI,EAAE,CAAW;IACjBC,MAAM,EAAE,IAAIC,YAAY,CAACH,IAAI,CAAC;IAC9BA,IAAI;IACJI,KAAK,EAAE,CAAW;IAElBC,IAAIA,CAACC,KAAa,EAAiB;MACjC,MAAMC,QAAQ,GAAG,IAAI,CAACL,MAAM,CAAC,IAAI,CAACD,IAAI,CAAC;MACvC,MAAMO,QAAQ,GAAG,IAAI,CAACJ,KAAK;MAC3B,IAAI,CAACF,MAAM,CAAC,IAAI,CAACD,IAAI,CAAC,GAAGK,KAAK;MAE9B,IAAI,CAACL,IAAI,GAAG,CAAC,IAAI,CAACA,IAAI,GAAG,CAAC,IAAI,IAAI,CAACD,IAAI;MACvC,IAAI,CAACI,KAAK,GAAGK,IAAI,CAACC,GAAG,CAAC,IAAI,CAACV,IAAI,EAAE,IAAI,CAACI,KAAK,GAAG,CAAC,CAAC;MAChD,OAAOI,QAAQ,KA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E,WAAW;IACvBD,iBAAiB,EAAE;EACrB,CAAC;EACDd,SAAS,EAAE;IACTgB,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE,QAAQ;IACxBV,aAAa,EAAE,KAAK;IACpBW,QAAQ,EAAE;EACZ;AACF,CAAC,CAAC","ignoreList":[]}
@@ -8,6 +8,7 @@ import { useAnimatedRef, useScrollViewOffset } from '../hook';
8
8
 
9
9
  // Since createAnimatedComponent return type is ComponentClass that has the props of the argument,
10
10
  // but not things like NativeMethods, etc. we need to add them manually by extending the type.
11
+
11
12
  const AnimatedScrollViewComponent = createAnimatedComponent(ScrollView);
12
13
  export const AnimatedScrollView = /*#__PURE__*/forwardRef((props, ref) => {
13
14
  const {
@@ -1 +1 @@
1
- {"version":3,"names":["_extends","Object","assign","bind","target","i","arguments","length","source","key","prototype","hasOwnProperty","call","apply","React","forwardRef","ScrollView","createAnimatedComponent","useAnimatedRef","useScrollViewOffset","AnimatedScrollViewComponent","AnimatedScrollView","props","ref","scrollViewOffset","restProps","animatedRef","scrollEventThrottle","createElement"],"sources":["ScrollView.tsx"],"sourcesContent":["'use strict';\nimport type { ForwardedRef } from 'react';\nimport React, { forwardRef } from 'react';\nimport type { ScrollViewProps } from 'react-native';\nimport { ScrollView } from 'react-native';\nimport { createAnimatedComponent } from '../../createAnimatedComponent';\nimport type { SharedValue } from '../commonTypes';\nimport type { AnimatedRef } from '../hook';\nimport { useAnimatedRef, useScrollViewOffset } from '../hook';\nimport type { AnimatedProps } from '../helperTypes';\n\nexport interface AnimatedScrollViewProps\n extends AnimatedProps<ScrollViewProps> {\n scrollViewOffset?: SharedValue<number>;\n}\n\n// Since createAnimatedComponent return type is ComponentClass that has the props of the argument,\n// but not things like NativeMethods, etc. we need to add them manually by extending the type.\ninterface AnimatedScrollViewComplement extends ScrollView {\n getNode(): ScrollView;\n}\n\nconst AnimatedScrollViewComponent = createAnimatedComponent(ScrollView);\n\nexport const AnimatedScrollView = forwardRef(\n (props: AnimatedScrollViewProps, ref: ForwardedRef<AnimatedScrollView>) => {\n const { scrollViewOffset, ...restProps } = props;\n const animatedRef = (\n ref === null\n ? // eslint-disable-next-line react-hooks/rules-of-hooks\n useAnimatedRef<ScrollView>()\n : ref\n ) as AnimatedRef<AnimatedScrollView>;\n\n if (scrollViewOffset) {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useScrollViewOffset(animatedRef, scrollViewOffset);\n }\n\n // Set default scrollEventThrottle, because user expects\n // to have continuous scroll events.\n // We set it to 1 so we have peace until\n // there are 960 fps screens.\n if (!('scrollEventThrottle' in restProps)) {\n restProps.scrollEventThrottle = 1;\n }\n\n return <AnimatedScrollViewComponent ref={animatedRef} {...restProps} />;\n }\n);\n\nexport type AnimatedScrollView = AnimatedScrollViewComplement &\n typeof AnimatedScrollViewComponent;\n"],"mappings":"AAAA,YAAY;;AAAC,SAAAA,SAAA,IAAAA,QAAA,GAAAC,MAAA,CAAAC,MAAA,GAAAD,MAAA,CAAAC,MAAA,CAAAC,IAAA,eAAAC,MAAA,aAAAC,CAAA,MAAAA,CAAA,GAAAC,SAAA,CAAAC,MAAA,EAAAF,CAAA,UAAAG,MAAA,GAAAF,SAAA,CAAAD,CAAA,YAAAI,GAAA,IAAAD,MAAA,QAAAP,MAAA,CAAAS,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAJ,MAAA,EAAAC,GAAA,KAAAL,MAAA,CAAAK,GAAA,IAAAD,MAAA,CAAAC,GAAA,gBAAAL,MAAA,YAAAJ,QAAA,CAAAa,KAAA,OAAAP,SAAA;AAEb,OAAOQ,KAAK,IAAIC,UAAU,QAAQ,OAAO;AAEzC,SAASC,UAAU,QAAQ,cAAc;AACzC,SAASC,uBAAuB,QAAQ,+BAA+B;AAGvE,SAASC,cAAc,EAAEC,mBAAmB,QAAQ,SAAS;;AAQ7D;AACA;AAKA,MAAMC,2BAA2B,GAAGH,uBAAuB,CAACD,UAAU,CAAC;AAEvE,OAAO,MAAMK,kBAAkB,gBAAGN,UAAU,CAC1C,CAACO,KAA8B,EAAEC,GAAqC,KAAK;EACzE,MAAM;IAAEC,gBAAgB;IAAE,GAAGC;EAAU,CAAC,GAAGH,KAAK;EAChD,MAAMI,WAAW,GACfH,GAAG,KAAK,IAAI;EACR;EACAL,cAAc,EAAc,GAC5BK,GAC8B;EAEpC,IAAIC,gBAAgB,EAAE;IACpB;IACAL,mBAAmB,CAACO,WAAW,EAAEF,gBAAgB,CAAC;EACpD;;EAEA;EACA;EACA;EACA;EACA,IAAI,EAAE,qBAAqB,IAAIC,SAAS,CAAC,EAAE;IACzCA,SAAS,CAACE,mBAAmB,GAAG,CAAC;EACnC;EAEA,oBAAOb,KAAA,CAAAc,aAAA,CAACR,2BAA2B,EAAApB,QAAA;IAACuB,GAAG,EAAEG;EAAY,GAAKD,SAAS,EAAI;AACzE,CAAC,CACF"}
1
+ {"version":3,"names":["_extends","Object","assign","bind","target","i","arguments","length","source","key","prototype","hasOwnProperty","call","apply","React","forwardRef","ScrollView","createAnimatedComponent","useAnimatedRef","useScrollViewOffset","AnimatedScrollViewComponent","AnimatedScrollView","props","ref","scrollViewOffset","restProps","animatedRef","scrollEventThrottle","createElement"],"sources":["ScrollView.tsx"],"sourcesContent":["'use strict';\nimport type { ForwardedRef } from 'react';\nimport React, { forwardRef } from 'react';\nimport type { ScrollViewProps } from 'react-native';\nimport { ScrollView } from 'react-native';\nimport { createAnimatedComponent } from '../../createAnimatedComponent';\nimport type { SharedValue } from '../commonTypes';\nimport type { AnimatedRef } from '../hook';\nimport { useAnimatedRef, useScrollViewOffset } from '../hook';\nimport type { AnimatedProps } from '../helperTypes';\n\nexport interface AnimatedScrollViewProps\n extends AnimatedProps<ScrollViewProps> {\n scrollViewOffset?: SharedValue<number>;\n}\n\n// Since createAnimatedComponent return type is ComponentClass that has the props of the argument,\n// but not things like NativeMethods, etc. we need to add them manually by extending the type.\ninterface AnimatedScrollViewComplement extends ScrollView {\n getNode(): ScrollView;\n}\n\nconst AnimatedScrollViewComponent = createAnimatedComponent(ScrollView);\n\nexport const AnimatedScrollView = forwardRef(\n (props: AnimatedScrollViewProps, ref: ForwardedRef<AnimatedScrollView>) => {\n const { scrollViewOffset, ...restProps } = props;\n const animatedRef = (\n ref === null\n ? // eslint-disable-next-line react-hooks/rules-of-hooks\n useAnimatedRef<ScrollView>()\n : ref\n ) as AnimatedRef<AnimatedScrollView>;\n\n if (scrollViewOffset) {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useScrollViewOffset(animatedRef, scrollViewOffset);\n }\n\n // Set default scrollEventThrottle, because user expects\n // to have continuous scroll events.\n // We set it to 1 so we have peace until\n // there are 960 fps screens.\n if (!('scrollEventThrottle' in restProps)) {\n restProps.scrollEventThrottle = 1;\n }\n\n return <AnimatedScrollViewComponent ref={animatedRef} {...restProps} />;\n }\n);\n\nexport type AnimatedScrollView = AnimatedScrollViewComplement &\n typeof AnimatedScrollViewComponent;\n"],"mappings":"AAAA,YAAY;;AAAC,SAAAA,SAAA,IAAAA,QAAA,GAAAC,MAAA,CAAAC,MAAA,GAAAD,MAAA,CAAAC,MAAA,CAAAC,IAAA,eAAAC,MAAA,aAAAC,CAAA,MAAAA,CAAA,GAAAC,SAAA,CAAAC,MAAA,EAAAF,CAAA,UAAAG,MAAA,GAAAF,SAAA,CAAAD,CAAA,YAAAI,GAAA,IAAAD,MAAA,QAAAP,MAAA,CAAAS,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAJ,MAAA,EAAAC,GAAA,KAAAL,MAAA,CAAAK,GAAA,IAAAD,MAAA,CAAAC,GAAA,gBAAAL,MAAA,YAAAJ,QAAA,CAAAa,KAAA,OAAAP,SAAA;AAEb,OAAOQ,KAAK,IAAIC,UAAU,QAAQ,OAAO;AAEzC,SAASC,UAAU,QAAQ,cAAc;AACzC,SAASC,uBAAuB,QAAQ,+BAA+B;AAGvE,SAASC,cAAc,EAAEC,mBAAmB,QAAQ,SAAS;;AAQ7D;AACA;;AAKA,MAAMC,2BAA2B,GAAGH,uBAAuB,CAACD,UAAU,CAAC;AAEvE,OAAO,MAAMK,kBAAkB,gBAAGN,UAAU,CAC1C,CAACO,KAA8B,EAAEC,GAAqC,KAAK;EACzE,MAAM;IAAEC,gBAAgB;IAAE,GAAGC;EAAU,CAAC,GAAGH,KAAK;EAChD,MAAMI,WAAW,GACfH,GAAG,KAAK,IAAI;EACR;EACAL,cAAc,CAAa,CAAC,GAC5BK,GAC8B;EAEpC,IAAIC,gBAAgB,EAAE;IACpB;IACAL,mBAAmB,CAACO,WAAW,EAAEF,gBAAgB,CAAC;EACpD;;EAEA;EACA;EACA;EACA;EACA,IAAI,EAAE,qBAAqB,IAAIC,SAAS,CAAC,EAAE;IACzCA,SAAS,CAACE,mBAAmB,GAAG,CAAC;EACnC;EAEA,oBAAOb,KAAA,CAAAc,aAAA,CAACR,2BAA2B,EAAApB,QAAA;IAACuB,GAAG,EAAEG;EAAY,GAAKD,SAAS,CAAG,CAAC;AACzE,CACF,CAAC","ignoreList":[]}
@@ -5,5 +5,6 @@ import { createAnimatedComponent } from '../../createAnimatedComponent';
5
5
 
6
6
  // Since createAnimatedComponent return type is ComponentClass that has the props of the argument,
7
7
  // but not things like NativeMethods, etc. we need to add them manually by extending the type.
8
+
8
9
  export const AnimatedText = createAnimatedComponent(Text);
9
10
  //# sourceMappingURL=Text.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["Text","createAnimatedComponent","AnimatedText"],"sources":["Text.ts"],"sourcesContent":["'use strict';\nimport { Text } from 'react-native';\nimport { createAnimatedComponent } from '../../createAnimatedComponent';\n\n// Since createAnimatedComponent return type is ComponentClass that has the props of the argument,\n// but not things like NativeMethods, etc. we need to add them manually by extending the type.\ninterface AnimatedTextComplement extends Text {\n getNode(): Text;\n}\n\nexport const AnimatedText = createAnimatedComponent(Text);\n\nexport type AnimatedText = typeof AnimatedText & AnimatedTextComplement;\n"],"mappings":"AAAA,YAAY;;AACZ,SAASA,IAAI,QAAQ,cAAc;AACnC,SAASC,uBAAuB,QAAQ,+BAA+B;;AAEvE;AACA;AAKA,OAAO,MAAMC,YAAY,GAAGD,uBAAuB,CAACD,IAAI,CAAC"}
1
+ {"version":3,"names":["Text","createAnimatedComponent","AnimatedText"],"sources":["Text.ts"],"sourcesContent":["'use strict';\nimport { Text } from 'react-native';\nimport { createAnimatedComponent } from '../../createAnimatedComponent';\n\n// Since createAnimatedComponent return type is ComponentClass that has the props of the argument,\n// but not things like NativeMethods, etc. we need to add them manually by extending the type.\ninterface AnimatedTextComplement extends Text {\n getNode(): Text;\n}\n\nexport const AnimatedText = createAnimatedComponent(Text);\n\nexport type AnimatedText = typeof AnimatedText & AnimatedTextComplement;\n"],"mappings":"AAAA,YAAY;;AACZ,SAASA,IAAI,QAAQ,cAAc;AACnC,SAASC,uBAAuB,QAAQ,+BAA+B;;AAEvE;AACA;;AAKA,OAAO,MAAMC,YAAY,GAAGD,uBAAuB,CAACD,IAAI,CAAC","ignoreList":[]}
@@ -5,5 +5,6 @@ import { createAnimatedComponent } from '../../createAnimatedComponent';
5
5
 
6
6
  // Since createAnimatedComponent return type is ComponentClass that has the props of the argument,
7
7
  // but not things like NativeMethods, etc. we need to add them manually by extending the type.
8
+
8
9
  export const AnimatedView = createAnimatedComponent(View);
9
10
  //# sourceMappingURL=View.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["View","createAnimatedComponent","AnimatedView"],"sources":["View.ts"],"sourcesContent":["'use strict';\nimport { View } from 'react-native';\nimport { createAnimatedComponent } from '../../createAnimatedComponent';\n\n// Since createAnimatedComponent return type is ComponentClass that has the props of the argument,\n// but not things like NativeMethods, etc. we need to add them manually by extending the type.\ninterface AnimatedViewComplement extends View {\n getNode(): View;\n}\n\nexport const AnimatedView = createAnimatedComponent(View);\n\nexport type AnimatedView = typeof AnimatedView & AnimatedViewComplement;\n"],"mappings":"AAAA,YAAY;;AACZ,SAASA,IAAI,QAAQ,cAAc;AACnC,SAASC,uBAAuB,QAAQ,+BAA+B;;AAEvE;AACA;AAKA,OAAO,MAAMC,YAAY,GAAGD,uBAAuB,CAACD,IAAI,CAAC"}
1
+ {"version":3,"names":["View","createAnimatedComponent","AnimatedView"],"sources":["View.ts"],"sourcesContent":["'use strict';\nimport { View } from 'react-native';\nimport { createAnimatedComponent } from '../../createAnimatedComponent';\n\n// Since createAnimatedComponent return type is ComponentClass that has the props of the argument,\n// but not things like NativeMethods, etc. we need to add them manually by extending the type.\ninterface AnimatedViewComplement extends View {\n getNode(): View;\n}\n\nexport const AnimatedView = createAnimatedComponent(View);\n\nexport type AnimatedView = typeof AnimatedView & AnimatedViewComplement;\n"],"mappings":"AAAA,YAAY;;AACZ,SAASA,IAAI,QAAQ,cAAc;AACnC,SAASC,uBAAuB,QAAQ,+BAA+B;;AAEvE;AACA;;AAKA,OAAO,MAAMC,YAAY,GAAGD,uBAAuB,CAACD,IAAI,CAAC","ignoreList":[]}
@@ -56,8 +56,7 @@ function getSensorContainer() {
56
56
  }
57
57
  return global.__sensorContainer;
58
58
  }
59
- export function registerEventHandler(eventHandler, eventName) {
60
- let emitterReactTag = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : -1;
59
+ export function registerEventHandler(eventHandler, eventName, emitterReactTag = -1) {
61
60
  function handleAndFlushAnimationFrame(eventTimestamp, event) {
62
61
  'worklet';
63
62
 
@@ -107,8 +106,7 @@ let featuresConfig = {
107
106
  enableLayoutAnimations: false,
108
107
  setByUser: false
109
108
  };
110
- export function enableLayoutAnimations(flag) {
111
- let isCallByUser = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
109
+ export function enableLayoutAnimations(flag, isCallByUser = true) {
112
110
  if (isCallByUser) {
113
111
  featuresConfig = {
114
112
  enableLayoutAnimations: flag,
@@ -1 +1 @@
1
- {"version":3,"names":["NativeReanimatedModule","isWeb","shouldBeUseWeb","isFabric","makeShareableCloneRecursive","initializeUIRuntime","SensorContainer","startMapper","stopMapper","runOnJS","runOnUI","executeOnUIRuntimeSync","createWorkletRuntime","runOnRuntime","makeShareable","makeMutable","SHOULD_BE_USE_WEB","isReanimated3","isConfigured","global","_WORKLET","_log","console","log","_getAnimationTimestamp","performance","now","getViewProp","viewTag","propName","component","Error","Promise","resolve","reject","result","substr","getSensorContainer","__sensorContainer","registerEventHandler","eventHandler","eventName","emitterReactTag","arguments","length","undefined","handleAndFlushAnimationFrame","eventTimestamp","event","__frameTimestamp","__flushAnimationFrame","unregisterEventHandler","id","subscribeForKeyboardEvents","options","state","height","isStatusBarTranslucentAndroid","unsubscribeFromKeyboardEvents","listenerId","registerSensor","sensorType","config","sensorContainer","initializeSensor","unregisterSensor","sensorId","featuresConfig","enableLayoutAnimations","setByUser","flag","isCallByUser","configureLayoutAnimationBatch","layoutAnimationsBatch","setShouldAnimateExitingForTag","shouldAnimate","jsiConfigureProps","uiProps","nativeProps","configureProps"],"sources":["core.ts"],"sourcesContent":["'use strict';\nimport NativeReanimatedModule from './NativeReanimated';\nimport { isWeb, shouldBeUseWeb, isFabric } from './PlatformChecker';\nimport type {\n AnimatedKeyboardOptions,\n SensorConfig,\n SensorType,\n SharedValue,\n Value3D,\n ValueRotation,\n} from './commonTypes';\nimport { makeShareableCloneRecursive } from './shareables';\nimport { initializeUIRuntime } from './initializers';\nimport type { LayoutAnimationBatchItem } from './layoutReanimation/animationBuilder/commonTypes';\nimport { SensorContainer } from './SensorContainer';\n\nexport { startMapper, stopMapper } from './mappers';\nexport { runOnJS, runOnUI, executeOnUIRuntimeSync } from './threads';\nexport { createWorkletRuntime, runOnRuntime } from './runtimes';\nexport type { WorkletRuntime } from './runtimes';\nexport { makeShareable, makeShareableCloneRecursive } from './shareables';\nexport { makeMutable } from './mutables';\n\nconst SHOULD_BE_USE_WEB = shouldBeUseWeb();\n\n/**\n * @returns `true` in Reanimated 3, doesn't exist in Reanimated 2 or 1\n */\nexport const isReanimated3 = () => true;\n\n// Superseded by check in `/src/threads.ts`.\n// Used by `react-navigation` to detect if using Reanimated 2 or 3.\n/**\n * @deprecated This function was superseded by other checks.\n * We keep it here for backward compatibility reasons.\n * If you need to check if you are using Reanimated 3 or Reanimated 2\n * please use `isReanimated3` function instead.\n * @returns `true` in Reanimated 3, doesn't exist in Reanimated 2\n */\nexport const isConfigured = isReanimated3;\n\n// this is for web implementation\nif (SHOULD_BE_USE_WEB) {\n global._WORKLET = false;\n global._log = console.log;\n global._getAnimationTimestamp = () => performance.now();\n}\n\nexport function getViewProp<T>(\n viewTag: number,\n propName: string,\n component?: React.Component // required on Fabric\n): Promise<T> {\n if (isFabric() && !component) {\n throw new Error(\n '[Reanimated] Function `getViewProp` requires a component to be passed as an argument on Fabric.'\n );\n }\n\n // eslint-disable-next-line @typescript-eslint/no-misused-promises\n return new Promise((resolve, reject) => {\n return NativeReanimatedModule.getViewProp(\n viewTag,\n propName,\n component,\n (result: T) => {\n if (typeof result === 'string' && result.substr(0, 6) === 'error:') {\n reject(result);\n } else {\n resolve(result);\n }\n }\n );\n });\n}\n\nfunction getSensorContainer(): SensorContainer {\n if (!global.__sensorContainer) {\n global.__sensorContainer = new SensorContainer();\n }\n return global.__sensorContainer;\n}\n\nexport function registerEventHandler<T>(\n eventHandler: (event: T) => void,\n eventName: string,\n emitterReactTag = -1\n): number {\n function handleAndFlushAnimationFrame(eventTimestamp: number, event: T) {\n 'worklet';\n global.__frameTimestamp = eventTimestamp;\n eventHandler(event);\n global.__flushAnimationFrame(eventTimestamp);\n global.__frameTimestamp = undefined;\n }\n return NativeReanimatedModule.registerEventHandler(\n makeShareableCloneRecursive(handleAndFlushAnimationFrame),\n eventName,\n emitterReactTag\n );\n}\n\nexport function unregisterEventHandler(id: number): void {\n return NativeReanimatedModule.unregisterEventHandler(id);\n}\n\nexport function subscribeForKeyboardEvents(\n eventHandler: (state: number, height: number) => void,\n options: AnimatedKeyboardOptions\n): number {\n // TODO: this should really go with the same code path as other events, that is\n // via registerEventHandler. For now we are copying the code from there.\n function handleAndFlushAnimationFrame(state: number, height: number) {\n 'worklet';\n const now = global._getAnimationTimestamp();\n global.__frameTimestamp = now;\n eventHandler(state, height);\n global.__flushAnimationFrame(now);\n global.__frameTimestamp = undefined;\n }\n return NativeReanimatedModule.subscribeForKeyboardEvents(\n makeShareableCloneRecursive(handleAndFlushAnimationFrame),\n options.isStatusBarTranslucentAndroid ?? false\n );\n}\n\nexport function unsubscribeFromKeyboardEvents(listenerId: number): void {\n return NativeReanimatedModule.unsubscribeFromKeyboardEvents(listenerId);\n}\n\nexport function registerSensor(\n sensorType: SensorType,\n config: SensorConfig,\n eventHandler: (\n data: Value3D | ValueRotation,\n orientationDegrees: number\n ) => void\n): number {\n const sensorContainer = getSensorContainer();\n return sensorContainer.registerSensor(\n sensorType,\n config,\n makeShareableCloneRecursive(eventHandler)\n );\n}\n\nexport function initializeSensor(\n sensorType: SensorType,\n config: SensorConfig\n): SharedValue<Value3D | ValueRotation> {\n const sensorContainer = getSensorContainer();\n return sensorContainer.initializeSensor(sensorType, config);\n}\n\nexport function unregisterSensor(sensorId: number): void {\n const sensorContainer = getSensorContainer();\n return sensorContainer.unregisterSensor(sensorId);\n}\n\nif (!isWeb()) {\n initializeUIRuntime();\n}\n\ntype FeaturesConfig = {\n enableLayoutAnimations: boolean;\n setByUser: boolean;\n};\n\nlet featuresConfig: FeaturesConfig = {\n enableLayoutAnimations: false,\n setByUser: false,\n};\n\nexport function enableLayoutAnimations(\n flag: boolean,\n isCallByUser = true\n): void {\n if (isCallByUser) {\n featuresConfig = {\n enableLayoutAnimations: flag,\n setByUser: true,\n };\n NativeReanimatedModule.enableLayoutAnimations(flag);\n } else if (\n !featuresConfig.setByUser &&\n featuresConfig.enableLayoutAnimations !== flag\n ) {\n featuresConfig.enableLayoutAnimations = flag;\n NativeReanimatedModule.enableLayoutAnimations(flag);\n }\n}\n\nexport function configureLayoutAnimationBatch(\n layoutAnimationsBatch: LayoutAnimationBatchItem[]\n): void {\n NativeReanimatedModule.configureLayoutAnimationBatch(layoutAnimationsBatch);\n}\n\nexport function setShouldAnimateExitingForTag(\n viewTag: number | HTMLElement,\n shouldAnimate: boolean\n) {\n NativeReanimatedModule.setShouldAnimateExitingForTag(\n viewTag as number,\n shouldAnimate\n );\n}\n\nexport function jsiConfigureProps(\n uiProps: string[],\n nativeProps: string[]\n): void {\n if (!SHOULD_BE_USE_WEB) {\n NativeReanimatedModule.configureProps(uiProps, nativeProps);\n }\n}\n"],"mappings":"AAAA,YAAY;;AACZ,OAAOA,sBAAsB,MAAM,oBAAoB;AACvD,SAASC,KAAK,EAAEC,cAAc,EAAEC,QAAQ,QAAQ,mBAAmB;AASnE,SAASC,2BAA2B,QAAQ,cAAc;AAC1D,SAASC,mBAAmB,QAAQ,gBAAgB;AAEpD,SAASC,eAAe,QAAQ,mBAAmB;AAEnD,SAASC,WAAW,EAAEC,UAAU,QAAQ,WAAW;AACnD,SAASC,OAAO,EAAEC,OAAO,EAAEC,sBAAsB,QAAQ,WAAW;AACpE,SAASC,oBAAoB,EAAEC,YAAY,QAAQ,YAAY;AAE/D,SAASC,aAAa,EAAEV,2BAA2B,QAAQ,cAAc;AACzE,SAASW,WAAW,QAAQ,YAAY;AAExC,MAAMC,iBAAiB,GAAGd,cAAc,EAAE;;AAE1C;AACA;AACA;AACA,OAAO,MAAMe,aAAa,GAAGA,CAAA,KAAM,IAAI;;AAEvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,YAAY,GAAGD,aAAa;;AAEzC;AACA,IAAID,iBAAiB,EAAE;EACrBG,MAAM,CAACC,QAAQ,GAAG,KAAK;EACvBD,MAAM,CAACE,IAAI,GAAGC,OAAO,CAACC,GAAG;EACzBJ,MAAM,CAACK,sBAAsB,GAAG,MAAMC,WAAW,CAACC,GAAG,EAAE;AACzD;AAEA,OAAO,SAASC,WAAWA,CACzBC,OAAe,EACfC,QAAgB,EAChBC,SAA2B,EACf;EACZ,IAAI3B,QAAQ,EAAE,IAAI,CAAC2B,SAAS,EAAE;IAC5B,MAAM,IAAIC,KAAK,CACb,iGAAiG,CAClG;EACH;;EAEA;EACA,OA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D,cAA8B,GAAG;EACnCC,sBAAsB,EAAE,KAAK;EAC7BC,SAAS,EAAE;AACb,CAAC;AAED,OAAO,SAASD,sBAAsBA,CACpCE,IAAa,EAEP;EAAA,IADNC,YAAY,GAAA5B,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,IAAI;EAEnB,IAAI4B,YAAY,EAAE;IAChBJ,cAAc,GAAG;MACfC,sBAAsB,EAAEE,IAAI;MAC5BD,SAAS,EAAE;IACb,CAAC;IACDrE,sBAAsB,CAACoE,sBAAsB,CAACE,IAAI,CAAC;EACrD,CAAC,MAAM,IACL,CAACH,cAAc,CAACE,SAAS,IACzBF,cAAc,CAACC,sBAAsB,KAAKE,IAAI,EAC9C;IACAH,cAAc,CAACC,sBAAsB,GAAGE,IAAI;IAC5CtE,sBAAsB,CAACoE,sBAAsB,CAACE,IAAI,CAAC;EACrD;AACF;AAEA,OAAO,SAASE,6BAA6BA,CAC3CC,qBAAiD,EAC3C;EACNzE,sBAAsB,CAACwE,6BAA6B,CAACC,qBAAqB,CAAC;AAC7E;AAEA,OAAO,SAASC,6BAA6BA,CAC3C9C,OAA6B,EAC7B+C,aAAsB,EACtB;EACA3E,sBAAsB,CAAC0E,6BAA6B,CAClD9C,OAAO,EACP+C,aAAa,CACd;AACH;AAEA,OAAO,SAASC,iBAAiBA,CAC/BC,OAAiB,EACjBC,WAAqB,EACf;EACN,IAAI,CAAC9D,iBAAiB,EAAE;IACtBhB,sBAAsB,CAAC+E,cAAc,CAACF,OAAO,EAAEC,WAAW,CAAC;EAC7D;AACF"}
1
+ {"version":3,"names":["NativeReanimatedModule","isWeb","shouldBeUseWeb","isFabric","makeShareableCloneRecursive","initializeUIRuntime","SensorContainer","startMapper","stopMapper","runOnJS","runOnUI","executeOnUIRuntimeSync","createWorkletRuntime","runOnRuntime","makeShareable","makeMutable","SHOULD_BE_USE_WEB","isReanimated3","isConfigured","global","_WORKLET","_log","console","log","_getAnimationTimestamp","performance","now","getViewProp","viewTag","propName","component","Error","Promise","resolve","reject","result","substr","getSensorContainer","__sensorContainer","registerEventHandler","eventHandler","eventName","emitterReactTag","handleAndFlushAnimationFrame","eventTimestamp","event","__frameTimestamp","__flushAnimationFrame","undefined","unregisterEventHandler","id","subscribeForKeyboardEvents","options","state","height","isStatusBarTranslucentAndroid","unsubscribeFromKeyboardEvents","listenerId","registerSensor","sensorType","config","sensorContainer","initializeSensor","unregisterSensor","sensorId","featuresConfig","enableLayoutAnimations","setByUser","flag","isCallByUser","configureLayoutAnimationBatch","layoutAnimationsBatch","setShouldAnimateExitingForTag","shouldAnimate","jsiConfigureProps","uiProps","nativeProps","configureProps"],"sources":["core.ts"],"sourcesContent":["'use strict';\nimport NativeReanimatedModule from './NativeReanimated';\nimport { isWeb, shouldBeUseWeb, isFabric } from './PlatformChecker';\nimport type {\n AnimatedKeyboardOptions,\n SensorConfig,\n SensorType,\n SharedValue,\n Value3D,\n ValueRotation,\n} from './commonTypes';\nimport { makeShareableCloneRecursive } from './shareables';\nimport { initializeUIRuntime } from './initializers';\nimport type { LayoutAnimationBatchItem } from './layoutReanimation/animationBuilder/commonTypes';\nimport { SensorContainer } from './SensorContainer';\n\nexport { startMapper, stopMapper } from './mappers';\nexport { runOnJS, runOnUI, executeOnUIRuntimeSync } from './threads';\nexport { createWorkletRuntime, runOnRuntime } from './runtimes';\nexport type { WorkletRuntime } from './runtimes';\nexport { makeShareable, makeShareableCloneRecursive } from './shareables';\nexport { makeMutable } from './mutables';\n\nconst SHOULD_BE_USE_WEB = shouldBeUseWeb();\n\n/**\n * @returns `true` in Reanimated 3, doesn't exist in Reanimated 2 or 1\n */\nexport const isReanimated3 = () => true;\n\n// Superseded by check in `/src/threads.ts`.\n// Used by `react-navigation` to detect if using Reanimated 2 or 3.\n/**\n * @deprecated This function was superseded by other checks.\n * We keep it here for backward compatibility reasons.\n * If you need to check if you are using Reanimated 3 or Reanimated 2\n * please use `isReanimated3` function instead.\n * @returns `true` in Reanimated 3, doesn't exist in Reanimated 2\n */\nexport const isConfigured = isReanimated3;\n\n// this is for web implementation\nif (SHOULD_BE_USE_WEB) {\n global._WORKLET = false;\n global._log = console.log;\n global._getAnimationTimestamp = () => performance.now();\n}\n\nexport function getViewProp<T>(\n viewTag: number,\n propName: string,\n component?: React.Component // required on Fabric\n): Promise<T> {\n if (isFabric() && !component) {\n throw new Error(\n '[Reanimated] Function `getViewProp` requires a component to be passed as an argument on Fabric.'\n );\n }\n\n // eslint-disable-next-line @typescript-eslint/no-misused-promises\n return new Promise((resolve, reject) => {\n return NativeReanimatedModule.getViewProp(\n viewTag,\n propName,\n component,\n (result: T) => {\n if (typeof result === 'string' && result.substr(0, 6) === 'error:') {\n reject(result);\n } else {\n resolve(result);\n }\n }\n );\n });\n}\n\nfunction getSensorContainer(): SensorContainer {\n if (!global.__sensorContainer) {\n global.__sensorContainer = new SensorContainer();\n }\n return global.__sensorContainer;\n}\n\nexport function registerEventHandler<T>(\n eventHandler: (event: T) => void,\n eventName: string,\n emitterReactTag = -1\n): number {\n function handleAndFlushAnimationFrame(eventTimestamp: number, event: T) {\n 'worklet';\n global.__frameTimestamp = eventTimestamp;\n eventHandler(event);\n global.__flushAnimationFrame(eventTimestamp);\n global.__frameTimestamp = undefined;\n }\n return NativeReanimatedModule.registerEventHandler(\n makeShareableCloneRecursive(handleAndFlushAnimationFrame),\n eventName,\n emitterReactTag\n );\n}\n\nexport function unregisterEventHandler(id: number): void {\n return NativeReanimatedModule.unregisterEventHandler(id);\n}\n\nexport function subscribeForKeyboardEvents(\n eventHandler: (state: number, height: number) => void,\n options: AnimatedKeyboardOptions\n): number {\n // TODO: this should really go with the same code path as other events, that is\n // via registerEventHandler. For now we are copying the code from there.\n function handleAndFlushAnimationFrame(state: number, height: number) {\n 'worklet';\n const now = global._getAnimationTimestamp();\n global.__frameTimestamp = now;\n eventHandler(state, height);\n global.__flushAnimationFrame(now);\n global.__frameTimestamp = undefined;\n }\n return NativeReanimatedModule.subscribeForKeyboardEvents(\n makeShareableCloneRecursive(handleAndFlushAnimationFrame),\n options.isStatusBarTranslucentAndroid ?? false\n );\n}\n\nexport function unsubscribeFromKeyboardEvents(listenerId: number): void {\n return NativeReanimatedModule.unsubscribeFromKeyboardEvents(listenerId);\n}\n\nexport function registerSensor(\n sensorType: SensorType,\n config: SensorConfig,\n eventHandler: (\n data: Value3D | ValueRotation,\n orientationDegrees: number\n ) => void\n): number {\n const sensorContainer = getSensorContainer();\n return sensorContainer.registerSensor(\n sensorType,\n config,\n makeShareableCloneRecursive(eventHandler)\n );\n}\n\nexport function initializeSensor(\n sensorType: SensorType,\n config: SensorConfig\n): SharedValue<Value3D | ValueRotation> {\n const sensorContainer = getSensorContainer();\n return sensorContainer.initializeSensor(sensorType, config);\n}\n\nexport function unregisterSensor(sensorId: number): void {\n const sensorContainer = getSensorContainer();\n return sensorContainer.unregisterSensor(sensorId);\n}\n\nif (!isWeb()) {\n initializeUIRuntime();\n}\n\ntype FeaturesConfig = {\n enableLayoutAnimations: boolean;\n setByUser: boolean;\n};\n\nlet featuresConfig: FeaturesConfig = {\n enableLayoutAnimations: false,\n setByUser: false,\n};\n\nexport function enableLayoutAnimations(\n flag: boolean,\n isCallByUser = true\n): void {\n if (isCallByUser) {\n featuresConfig = {\n enableLayoutAnimations: flag,\n setByUser: true,\n };\n NativeReanimatedModule.enableLayoutAnimations(flag);\n } else if (\n !featuresConfig.setByUser &&\n featuresConfig.enableLayoutAnimations !== flag\n ) {\n featuresConfig.enableLayoutAnimations = flag;\n NativeReanimatedModule.enableLayoutAnimations(flag);\n }\n}\n\nexport function configureLayoutAnimationBatch(\n layoutAnimationsBatch: LayoutAnimationBatchItem[]\n): void {\n NativeReanimatedModule.configureLayoutAnimationBatch(layoutAnimationsBatch);\n}\n\nexport function setShouldAnimateExitingForTag(\n viewTag: number | HTMLElement,\n shouldAnimate: boolean\n) {\n NativeReanimatedModule.setShouldAnimateExitingForTag(\n viewTag as number,\n shouldAnimate\n );\n}\n\nexport function jsiConfigureProps(\n uiProps: string[],\n nativeProps: string[]\n): void {\n if (!SHOULD_BE_USE_WEB) {\n NativeReanimatedModule.configureProps(uiProps, nativeProps);\n }\n}\n"],"mappings":"AAAA,YAAY;;AACZ,OAAOA,sBAAsB,MAAM,oBAAoB;AACvD,SAASC,KAAK,EAAEC,cAAc,EAAEC,QAAQ,QAAQ,mBAAmB;AASnE,SAASC,2BAA2B,QAAQ,cAAc;AAC1D,SAASC,mBAAmB,QAAQ,gBAAgB;AAEpD,SAASC,eAAe,QAAQ,mBAAmB;AAEnD,SAASC,WAAW,EAAEC,UAAU,QAAQ,WAAW;AACnD,SAASC,OAAO,EAAEC,OAAO,EAAEC,sBAAsB,QAAQ,WAAW;AACpE,SAASC,oBAAoB,EAAEC,YAAY,QAAQ,YAAY;AAE/D,SAASC,aAAa,EAAEV,2BAA2B,QAAQ,cAAc;AACzE,SAASW,WAAW,QAAQ,YAAY;AAExC,MAAMC,iBAAiB,GAAGd,cAAc,CAAC,CAAC;;AAE1C;AACA;AACA;AACA,OAAO,MAAMe,aAAa,GAAGA,CAAA,KAAM,IAAI;;AAEvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,YAAY,GAAGD,aAAa;;AAEzC;AACA,IAAID,iBAAiB,EAAE;EACrBG,MAAM,CAACC,QAAQ,GAAG,KAAK;EACvBD,MAAM,CAACE,IAAI,GAAGC,OAAO,CAACC,GAAG;EACzBJ,MAAM,CAACK,sBAAsB,GAAG,MAAMC,WAAW,CAACC,GAAG,CAAC,CAAC;AACzD;AAEA,OAAO,SAASC,WAAWA,CACzBC,OAAe,EACfC,QAAgB,EAChBC,SAA2B,EACf;EACZ,IAAI3B,QAAQ,CAAC,CAAC,IAAI,CAAC2B,SAAS,EAAE;IAC5B,MAAM,IAAIC,KAAK,CACb,iGACF,CAAC;EACH;;EAEA;EACA,OAAO,IAAIC,OAAO,CAAC,CAACC,OAAO,EAAEC,MAAM,KAAK;IACtC,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BA,CACpCE,IAAa,EACbC,YAAY,GAAG,IAAI,EACb;EACN,IAAIA,YAAY,EAAE;IAChBJ,cAAc,GAAG;MACfC,sBAAsB,EAAEE,IAAI;MAC5BD,SAAS,EAAE;IACb,CAAC;IACDnE,sBAAsB,CAACkE,sBAAsB,CAACE,IAAI,CAAC;EACrD,CAAC,MAAM,IACL,CAACH,cAAc,CAACE,SAAS,IACzBF,cAAc,CAACC,sBAAsB,KAAKE,IAAI,EAC9C;IACAH,cAAc,CAACC,sBAAsB,GAAGE,IAAI;IAC5CpE,sBAAsB,CAACkE,sBAAsB,CAACE,IAAI,CAAC;EACrD;AACF;AAEA,OAAO,SAASE,6BAA6BA,CAC3CC,qBAAiD,EAC3C;EACNvE,sBAAsB,CAACsE,6BAA6B,CAACC,qBAAqB,CAAC;AAC7E;AAEA,OAAO,SAASC,6BAA6BA,CAC3C5C,OAA6B,EAC7B6C,aAAsB,EACtB;EACAzE,sBAAsB,CAACwE,6BAA6B,CAClD5C,OAAO,EACP6C,aACF,CAAC;AACH;AAEA,OAAO,SAASC,iBAAiBA,CAC/BC,OAAiB,EACjBC,WAAqB,EACf;EACN,IAAI,CAAC5D,iBAAiB,EAAE;IACtBhB,sBAAsB,CAAC6E,cAAc,CAACF,OAAO,EAAEC,WAAW,CAAC;EAC7D;AACF","ignoreList":[]}
@@ -5,8 +5,8 @@ export function registerWorkletStackDetails(hash, stackDetails) {
5
5
  _workletStackDetails.set(hash, stackDetails);
6
6
  }
7
7
  function getBundleOffset(error) {
8
- var _error$stack, _error$stack$split;
9
- const frame = (_error$stack = error.stack) === null || _error$stack === void 0 ? void 0 : (_error$stack$split = _error$stack.split('\n')) === null || _error$stack$split === void 0 ? void 0 : _error$stack$split[0];
8
+ var _error$stack;
9
+ const frame = (_error$stack = error.stack) === null || _error$stack === void 0 || (_error$stack = _error$stack.split('\n')) === null || _error$stack === void 0 ? void 0 : _error$stack[0];
10
10
  if (frame) {
11
11
  const parsedFrame = /@([^@]+):(\d+):(\d+)/.exec(frame);
12
12
  if (parsedFrame) {
@@ -19,7 +19,7 @@ function getBundleOffset(error) {
19
19
  function processStack(stack) {
20
20
  const workletStackEntries = stack.match(/worklet_(\d+):(\d+):(\d+)/g);
21
21
  let result = stack;
22
- workletStackEntries === null || workletStackEntries === void 0 ? void 0 : workletStackEntries.forEach(match => {
22
+ workletStackEntries === null || workletStackEntries === void 0 || workletStackEntries.forEach(match => {
23
23
  const [, hash, origLine, origCol] = match.split(/:|_/).map(Number);
24
24
  const errorDetails = _workletStackDetails.get(hash);
25
25
  if (!errorDetails) {
@@ -33,11 +33,10 @@ function processStack(stack) {
33
33
  });
34
34
  return result;
35
35
  }
36
- export function reportFatalErrorOnJS(_ref) {
37
- let {
38
- message,
39
- stack
40
- } = _ref;
36
+ export function reportFatalErrorOnJS({
37
+ message,
38
+ stack
39
+ }) {
41
40
  const error = new Error();
42
41
  error.message = message;
43
42
  error.stack = stack ? processStack(stack) : undefined;
@@ -1 +1 @@
1
- {"version":3,"names":["_workletStackDetails","Map","registerWorkletStackDetails","hash","stackDetails","set","getBundleOffset","error","_error$stack","_error$stack$split","frame","stack","split","parsedFrame","exec","file","line","col","Number","processStack","workletStackEntries","match","result","forEach","origLine","origCol","map","errorDetails","get","lineOffset","colOffset","bundleFile","bundleLine","bundleCol","replace","reportFatalErrorOnJS","_ref","message","Error","undefined","name","jsEngine","global","ErrorUtils","reportFatalError"],"sources":["errors.ts"],"sourcesContent":["'use strict';\nimport type { WorkletStackDetails } from './commonTypes';\n\nconst _workletStackDetails = new Map<number, WorkletStackDetails>();\n\nexport function registerWorkletStackDetails(\n hash: number,\n stackDetails: WorkletStackDetails\n) {\n _workletStackDetails.set(hash, stackDetails);\n}\n\nfunction getBundleOffset(error: Error): [string, number, number] {\n const frame = error.stack?.split('\\n')?.[0];\n if (frame) {\n const parsedFrame = /@([^@]+):(\\d+):(\\d+)/.exec(frame);\n if (parsedFrame) {\n const [, file, line, col] = parsedFrame;\n return [file, Number(line), Number(col)];\n }\n }\n return ['unknown', 0, 0];\n}\n\nfunction processStack(stack: string): string {\n const workletStackEntries = stack.match(/worklet_(\\d+):(\\d+):(\\d+)/g);\n let result = stack;\n workletStackEntries?.forEach((match) => {\n const [, hash, origLine, origCol] = match.split(/:|_/).map(Number);\n const errorDetails = _workletStackDetails.get(hash);\n if (!errorDetails) {\n return;\n }\n const [error, lineOffset, colOffset] = errorDetails;\n const [bundleFile, bundleLine, bundleCol] = getBundleOffset(error);\n const line = origLine + bundleLine + lineOffset;\n const col = origCol + bundleCol + colOffset;\n\n result = result.replace(match, `${bundleFile}:${line}:${col}`);\n });\n return result;\n}\n\nexport function reportFatalErrorOnJS({\n message,\n stack,\n}: {\n message: string;\n stack?: string;\n}) {\n const error = new Error();\n error.message = message;\n error.stack = stack ? processStack(stack) : undefined;\n error.name = 'ReanimatedError';\n // @ts-ignore React Native's ErrorUtils implementation extends the Error type with jsEngine field\n error.jsEngine = 'reanimated';\n // @ts-ignore the reportFatalError method is an internal method of ErrorUtils not exposed in the type definitions\n global.ErrorUtils.reportFatalError(error);\n}\n"],"mappings":"AAAA,YAAY;;AAGZ,MAAMA,oBAAoB,GAAG,IAAIC,GAAG,EAA+B;AAEnE,OAAO,SAASC,2BAA2BA,CACzCC,IAAY,EACZC,YAAiC,EACjC;EACAJ,oBAAoB,CAACK,GAAG,CAACF,IAAI,EAAEC,YAAY,CAAC;AAC9C;AAEA,SAASE,eAAeA,CAACC,KAAY,EAA4B;EAAA,IAAAC,YAAA,EAAAC,kBAAA;EAC/D,MAAMC,KAAK,IAAAF,YAAA,GAAGD,KAAK,CAACI,KAAK,cAAAH,YAAA,wBAAAC,kBAAA,GAAXD,YAAA,CAAaI,KAAK,CAAC,IAAI,CAAC,cAAAH,kBAAA,uBAAxBA,kBAAA,CAA2B,CAAC,CAAC;EAC3C,IAAIC,KAAK,EAAE;IACT,MAAMG,WAAW,GAAG,sBAAsB,CAACC,IAAI,CAACJ,KAAK,CAAC;IACtD,IAAIG,WAAW,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F,CAAC,GAAAyB,IAAA;EACC,MAAM7B,KAAK,GAAG,IAAI+B,KAAK,EAAE;EACzB/B,KAAK,CAAC8B,OAAO,GAAGA,OAAO;EACvB9B,KAAK,CAACI,KAAK,GAAGA,KAAK,GAAGQ,YAAY,CAACR,KAAK,CAAC,GAAG4B,SAAS;EACrDhC,KAAK,CAACiC,IAAI,GAAG,iBAAiB;EAC9B;EACAjC,KAAK,CAACkC,QAAQ,GAAG,YAAY;EAC7B;EACAC,MAAM,CAACC,UAAU,CAACC,gBAAgB,CAACrC,KAAK,CAAC;AAC3C"}
1
+ {"version":3,"names":["_workletStackDetails","Map","registerWorkletStackDetails","hash","stackDetails","set","getBundleOffset","error","_error$stack","frame","stack","split","parsedFrame","exec","file","line","col","Number","processStack","workletStackEntries","match","result","forEach","origLine","origCol","map","errorDetails","get","lineOffset","colOffset","bundleFile","bundleLine","bundleCol","replace","reportFatalErrorOnJS","message","Error","undefined","name","jsEngine","global","ErrorUtils","reportFatalError"],"sources":["errors.ts"],"sourcesContent":["'use strict';\nimport type { WorkletStackDetails } from './commonTypes';\n\nconst _workletStackDetails = new Map<number, WorkletStackDetails>();\n\nexport function registerWorkletStackDetails(\n hash: number,\n stackDetails: WorkletStackDetails\n) {\n _workletStackDetails.set(hash, stackDetails);\n}\n\nfunction getBundleOffset(error: Error): [string, number, number] {\n const frame = error.stack?.split('\\n')?.[0];\n if (frame) {\n const parsedFrame = /@([^@]+):(\\d+):(\\d+)/.exec(frame);\n if (parsedFrame) {\n const [, file, line, col] = parsedFrame;\n return [file, Number(line), Number(col)];\n }\n }\n return ['unknown', 0, 0];\n}\n\nfunction processStack(stack: string): string {\n const workletStackEntries = stack.match(/worklet_(\\d+):(\\d+):(\\d+)/g);\n let result = stack;\n workletStackEntries?.forEach((match) => {\n const [, hash, origLine, origCol] = match.split(/:|_/).map(Number);\n const errorDetails = _workletStackDetails.get(hash);\n if (!errorDetails) {\n return;\n }\n const [error, lineOffset, colOffset] = errorDetails;\n const [bundleFile, bundleLine, bundleCol] = getBundleOffset(error);\n const line = origLine + bundleLine + lineOffset;\n const col = origCol + bundleCol + colOffset;\n\n result = result.replace(match, `${bundleFile}:${line}:${col}`);\n });\n return result;\n}\n\nexport function reportFatalErrorOnJS({\n message,\n stack,\n}: {\n message: string;\n stack?: string;\n}) {\n const error = new Error();\n error.message = message;\n error.stack = stack ? processStack(stack) : undefined;\n error.name = 'ReanimatedError';\n // @ts-ignore React Native's ErrorUtils implementation extends the Error type with jsEngine field\n error.jsEngine = 'reanimated';\n // @ts-ignore the reportFatalError method is an internal method of ErrorUtils not exposed in the type definitions\n global.ErrorUtils.reportFatalError(error);\n}\n"],"mappings":"AAAA,YAAY;;AAGZ,MAAMA,oBAAoB,GAAG,IAAIC,GAAG,CAA8B,CAAC;AAEnE,OAAO,SAASC,2BAA2BA,CACzCC,IAAY,EACZC,YAAiC,EACjC;EACAJ,oBAAoB,CAACK,GAAG,CAACF,IAAI,EAAEC,YAAY,CAAC;AAC9C;AAEA,SAASE,eAAeA,CAACC,KAAY,EAA4B;EAAA,IAAAC,YAAA;EAC/D,MAAMC,KAAK,IAAAD,YAAA,GAAGD,KAAK,CAACG,KAAK,cAAAF,YAAA,gBAAAA,YAAA,GAAXA,YAAA,CAAaG,KAAK,CAAC,IAAI,CAAC,cAAAH,YAAA,uBAAxBA,YAAA,CAA2B,CAAC,CAAC;EAC3C,IAAIC,KAAK,EAAE;IACT,MAAMG,WAAW,GAAG,sBAAsB,CAACC,IAAI,CAACJ,KAAK,CAAC;IACtD,IAAIG,WAAW,EAAE;MACf,MAAM,GAAGE,IAAI,EAAEC,IAAI,EAAEC,GAAG,CAAC,GAAGJ,WAAW;MACvC,OAAO,CAACE,IAAI,EAAEG,MAAM,CAACF,IAAI,CAAC,EAAEE,MAAM,CAACD,GAAG,CAAC,CAAC;IAC1C;EACF;EACA,OAAO,CAAC,SAAS,EAAE,CAAC,EAAE,CAAC,CAAC;AAC1B;AAEA,SAASE,YAAYA,CAACR,KAA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MAAM,CAACC,UAAU,CAACC,gBAAgB,CAACnC,KAAK,CAAC;AAC3C","ignoreList":[]}
@@ -4,7 +4,7 @@
4
4
  let findHostInstance_DEPRECATED;
5
5
  let getInternalInstanceHandleFromPublicInstance;
6
6
  export function getShadowNodeWrapperFromRef(ref) {
7
- var _ref$getScrollRespond, _ref$getScrollRespond2, _ref$getScrollRespond3, _ref$getNativeScrollR, _ref$__internalInstan, _ref$__internalInstan2;
7
+ var _ref$getScrollRespond, _ref$getScrollRespond2, _ref$getNativeScrollR, _ref$__internalInstan;
8
8
  // load findHostInstance_DEPRECATED lazily because it may not be available before render
9
9
  if (findHostInstance_DEPRECATED === undefined) {
10
10
  try {
@@ -23,11 +23,11 @@ export function getShadowNodeWrapperFromRef(ref) {
23
23
 
24
24
  // taken from https://github.com/facebook/react-native/commit/803bb16531697233686efd475f004c1643e03617#diff-d8172256c6d63b5d32db10e54d7b10f37a26b337d5280d89f5bfd7bcea778292R196
25
25
  // @ts-ignore some weird stuff on RN 0.74 - see examples with scrollView
26
- const scrollViewRef = ref === null || ref === void 0 ? void 0 : (_ref$getScrollRespond = ref.getScrollResponder) === null || _ref$getScrollRespond === void 0 ? void 0 : (_ref$getScrollRespond2 = _ref$getScrollRespond.call(ref)) === null || _ref$getScrollRespond2 === void 0 ? void 0 : (_ref$getScrollRespond3 = _ref$getScrollRespond2.getNativeScrollRef) === null || _ref$getScrollRespond3 === void 0 ? void 0 : _ref$getScrollRespond3.call(_ref$getScrollRespond2);
26
+ const scrollViewRef = ref === null || ref === void 0 || (_ref$getScrollRespond = ref.getScrollResponder) === null || _ref$getScrollRespond === void 0 || (_ref$getScrollRespond = _ref$getScrollRespond.call(ref)) === null || _ref$getScrollRespond === void 0 || (_ref$getScrollRespond2 = _ref$getScrollRespond.getNativeScrollRef) === null || _ref$getScrollRespond2 === void 0 ? void 0 : _ref$getScrollRespond2.call(_ref$getScrollRespond);
27
27
  // @ts-ignore some weird stuff on RN 0.74 - see examples with scrollView
28
- const otherScrollViewRef = ref === null || ref === void 0 ? void 0 : (_ref$getNativeScrollR = ref.getNativeScrollRef) === null || _ref$getNativeScrollR === void 0 ? void 0 : _ref$getNativeScrollR.call(ref);
28
+ const otherScrollViewRef = ref === null || ref === void 0 || (_ref$getNativeScrollR = ref.getNativeScrollRef) === null || _ref$getNativeScrollR === void 0 ? void 0 : _ref$getNativeScrollR.call(ref);
29
29
  // @ts-ignore some weird stuff on RN 0.74 - see setNativeProps example
30
- const textInputRef = ref === null || ref === void 0 ? void 0 : (_ref$__internalInstan = ref.__internalInstanceHandle) === null || _ref$__internalInstan === void 0 ? void 0 : (_ref$__internalInstan2 = _ref$__internalInstan.stateNode) === null || _ref$__internalInstan2 === void 0 ? void 0 : _ref$__internalInstan2.node;
30
+ const textInputRef = ref === null || ref === void 0 || (_ref$__internalInstan = ref.__internalInstanceHandle) === null || _ref$__internalInstan === void 0 || (_ref$__internalInstan = _ref$__internalInstan.stateNode) === null || _ref$__internalInstan === void 0 ? void 0 : _ref$__internalInstan.node;
31
31
  let resolvedRef;
32
32
  if (scrollViewRef) {
33
33
  resolvedRef = scrollViewRef.__internalInstanceHandle.stateNode.node;
@@ -1 +1 @@
1
- {"version":3,"names":["findHostInstance_DEPRECATED","getInternalInstanceHandleFromPublicInstance","getShadowNodeWrapperFromRef","ref","_ref$getScrollRespond","_ref$getScrollRespond2","_ref$getScrollRespond3","_ref$getNativeScrollR","_ref$__internalInstan","_ref$__internalInstan2","undefined","require","e","_ref","_internalInstanceHandle","scrollViewRef","getScrollResponder","call","getNativeScrollRef","otherScrollViewRef","textInputRef","__internalInstanceHandle","stateNode","node","resolvedRef"],"sources":["fabricUtils.ts"],"sourcesContent":["'use strict';\n/* eslint-disable */\n\nimport type { ShadowNodeWrapper } from './commonTypes';\n\nlet findHostInstance_DEPRECATED: (ref: unknown) => void;\nlet getInternalInstanceHandleFromPublicInstance: (ref: unknown) => {\n stateNode: { node: unknown };\n};\n\nexport function getShadowNodeWrapperFromRef(\n ref: React.Component\n): ShadowNodeWrapper {\n // load findHostInstance_DEPRECATED lazily because it may not be available before render\n if (findHostInstance_DEPRECATED === undefined) {\n try {\n findHostInstance_DEPRECATED =\n require('react-native/Libraries/Renderer/shims/ReactFabric').findHostInstance_DEPRECATED;\n } catch (e) {\n findHostInstance_DEPRECATED = (_ref: unknown) => null;\n }\n }\n\n if (getInternalInstanceHandleFromPublicInstance === undefined) {\n try {\n getInternalInstanceHandleFromPublicInstance =\n require('react-native/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance')\n .getInternalInstanceHandleFromPublicInstance ??\n ((_ref: any) => _ref._internalInstanceHandle);\n } catch (e) {\n getInternalInstanceHandleFromPublicInstance = (_ref: any) =>\n _ref._internalInstanceHandle;\n }\n }\n\n // taken from https://github.com/facebook/react-native/commit/803bb16531697233686efd475f004c1643e03617#diff-d8172256c6d63b5d32db10e54d7b10f37a26b337d5280d89f5bfd7bcea778292R196\n // @ts-ignore some weird stuff on RN 0.74 - see examples with scrollView\n const scrollViewRef = ref?.getScrollResponder?.()?.getNativeScrollRef?.();\n // @ts-ignore some weird stuff on RN 0.74 - see examples with scrollView\n const otherScrollViewRef = ref?.getNativeScrollRef?.();\n // @ts-ignore some weird stuff on RN 0.74 - see setNativeProps example\n const textInputRef = ref?.__internalInstanceHandle?.stateNode?.node;\n\n let resolvedRef;\n if (scrollViewRef) {\n resolvedRef = scrollViewRef.__internalInstanceHandle.stateNode.node;\n } else if (otherScrollViewRef) {\n resolvedRef = otherScrollViewRef.__internalInstanceHandle.stateNode.node;\n } else if (textInputRef) {\n resolvedRef = textInputRef;\n } else {\n resolvedRef = getInternalInstanceHandleFromPublicInstance(\n findHostInstance_DEPRECATED(ref)\n ).stateNode.node;\n }\n\n return resolvedRef;\n}\n"],"mappings":"AAAA,YAAY;;AACZ;AAIA,IAAIA,2BAAmD;AACvD,IAAIC,2CAEH;AAED,OAAO,SAASC,2BAA2BA,CACzCC,GAAoB,EACD;EAAA,IAAAC,qBAAA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0Cc,IAAI;EAEnE,IAAIC,WAAW;EACf,IAAIT,aAAa,EAAE;IACjBS,WAAW,GAAGT,aAAa,CAACM,wBAAwB,CAACC,SAAS,CAACC,IAAI;EACrE,CAAC,MAAM,IAAIJ,kBAAkB,EAAE;IAC7BK,WAAW,GAAGL,kBAAkB,CAACE,wBAAwB,CAACC,SAAS,CAACC,IAAI;EAC1E,CAAC,MAAM,IAAIH,YAAY,EAAE;IACvBI,WAAW,GAAGJ,YAAY;EAC5B,CAAC,MAAM;IACLI,WAAW,GAAGvB,2CAA2C,CACvDD,2BAA2B,CAACG,GAAG,CAAC,CACjC,CAACmB,SAAS,CAACC,IAAI;EAClB;EAEA,OAAOC,WAAW;AACpB"}
1
+ {"version":3,"names":["findHostInstance_DEPRECATED","getInternalInstanceHandleFromPublicInstance","getShadowNodeWrapperFromRef","ref","_ref$getScrollRespond","_ref$getScrollRespond2","_ref$getNativeScrollR","_ref$__internalInstan","undefined","require","e","_ref","_internalInstanceHandle","scrollViewRef","getScrollResponder","call","getNativeScrollRef","otherScrollViewRef","textInputRef","__internalInstanceHandle","stateNode","node","resolvedRef"],"sources":["fabricUtils.ts"],"sourcesContent":["'use strict';\n/* eslint-disable */\n\nimport type { ShadowNodeWrapper } from './commonTypes';\n\nlet findHostInstance_DEPRECATED: (ref: unknown) => void;\nlet getInternalInstanceHandleFromPublicInstance: (ref: unknown) => {\n stateNode: { node: unknown };\n};\n\nexport function getShadowNodeWrapperFromRef(\n ref: React.Component\n): ShadowNodeWrapper {\n // load findHostInstance_DEPRECATED lazily because it may not be available before render\n if (findHostInstance_DEPRECATED === undefined) {\n try {\n findHostInstance_DEPRECATED =\n require('react-native/Libraries/Renderer/shims/ReactFabric').findHostInstance_DEPRECATED;\n } catch (e) {\n findHostInstance_DEPRECATED = (_ref: unknown) => null;\n }\n }\n\n if (getInternalInstanceHandleFromPublicInstance === undefined) {\n try {\n getInternalInstanceHandleFromPublicInstance =\n require('react-native/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance')\n .getInternalInstanceHandleFromPublicInstance ??\n ((_ref: any) => _ref._internalInstanceHandle);\n } catch (e) {\n getInternalInstanceHandleFromPublicInstance = (_ref: any) =>\n _ref._internalInstanceHandle;\n }\n }\n\n // taken from https://github.com/facebook/react-native/commit/803bb16531697233686efd475f004c1643e03617#diff-d8172256c6d63b5d32db10e54d7b10f37a26b337d5280d89f5bfd7bcea778292R196\n // @ts-ignore some weird stuff on RN 0.74 - see examples with scrollView\n const scrollViewRef = ref?.getScrollResponder?.()?.getNativeScrollRef?.();\n // @ts-ignore some weird stuff on RN 0.74 - see examples with scrollView\n const otherScrollViewRef = ref?.getNativeScrollRef?.();\n // @ts-ignore some weird stuff on RN 0.74 - see setNativeProps example\n const textInputRef = ref?.__internalInstanceHandle?.stateNode?.node;\n\n let resolvedRef;\n if (scrollViewRef) {\n resolvedRef = scrollViewRef.__internalInstanceHandle.stateNode.node;\n } else if (otherScrollViewRef) {\n resolvedRef = otherScrollViewRef.__internalInstanceHandle.stateNode.node;\n } else if (textInputRef) {\n resolvedRef = textInputRef;\n } else {\n resolvedRef = getInternalInstanceHandleFromPublicInstance(\n findHostInstance_DEPRECATED(ref)\n ).stateNode.node;\n }\n\n return resolvedRef;\n}\n"],"mappings":"AAAA,YAAY;;AACZ;AAIA,IAAIA,2BAAmD;AACvD,IAAIC,2CAEH;AAED,OAAO,SAASC,2BAA2BA,CACzCC,GAAoB,EACD;EAAA,IAAAC,qBAAA,EAAAC,sBAAA,EAAAC,qBAAA,EAAAC,qBAAA;EACnB;EACA,IAAIP,2BAA2B,KAAKQ,SAAS,EAAE;IAC7C,IAAI;MACFR,2BAA2B,GACzBS,OAAO,CAAC,mDAAmD,CAAC,CAACT,2BAA2B;IAC5F,CAAC,CAAC,OAAOU,CAAC,EAAE;MACVV,2BAA2B,GAAIW,IAAa,IAAK,IAAI;IACvD;EACF;EAEA,IAAIV,2CAA2C,KAAKO,SAAS,EAAE;IAC7D,IAAI;MACFP,2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2BAA2B,CAACG,GAAG,CACjC,CAAC,CAACiB,SAAS,CAACC,IAAI;EAClB;EAEA,OAAOC,WAAW;AACpB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["getShadowNodeWrapperFromRef","Error"],"sources":["fabricUtils.web.ts"],"sourcesContent":["'use strict';\nexport function getShadowNodeWrapperFromRef() {\n throw new Error(\n '[Reanimated] Trying to call `getShadowNodeWrapperFromRef` on web.'\n );\n}\n"],"mappings":"AAAA,YAAY;;AACZ,OAAO,SAASA,2BAA2BA,CAAA,EAAG;EAC5C,MAAM,IAAIC,KAAK,CACb,mEAAmE,CACpE;AACH"}
1
+ {"version":3,"names":["getShadowNodeWrapperFromRef","Error"],"sources":["fabricUtils.web.ts"],"sourcesContent":["'use strict';\nexport function getShadowNodeWrapperFromRef() {\n throw new Error(\n '[Reanimated] Trying to call `getShadowNodeWrapperFromRef` on web.'\n );\n}\n"],"mappings":"AAAA,YAAY;;AACZ,OAAO,SAASA,2BAA2BA,CAAA,EAAG;EAC5C,MAAM,IAAIC,KAAK,CACb,mEACF,CAAC;AACH","ignoreList":[]}
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
3
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
4
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
5
- function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
4
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
5
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
6
6
  import { runOnUI } from '../core';
7
7
  import { prepareUIRegistry } from './FrameCallbackRegistryUI';
8
8
  export default class FrameCallbackRegistryJS {
@@ -1 +1 @@
1
- {"version":3,"names":["_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","Number","runOnUI","prepareUIRegistry","FrameCallbackRegistryJS","constructor","registerFrameCallback","callback","callbackId","nextCallbackId","global","_frameCallbackRegistry","unregisterFrameCallback","manageStateFrameCallback","state"],"sources":["FrameCallbackRegistryJS.ts"],"sourcesContent":["'use strict';\nimport { runOnUI } from '../core';\nimport type { FrameInfo } from './FrameCallbackRegistryUI';\nimport { prepareUIRegistry } from './FrameCallbackRegistryUI';\n\nexport default class FrameCallbackRegistryJS {\n private nextCallbackId = 0;\n\n constructor() {\n prepareUIRegistry();\n }\n\n registerFrameCallback(callback: (frameInfo: FrameInfo) => void): number {\n if (!callback) {\n return -1;\n }\n\n const callbackId = this.nextCallbackId;\n this.nextCallbackId++;\n\n runOnUI(() => {\n global._frameCallbackRegistry.registerFrameCallback(callback, callbackId);\n })();\n\n return callbackId;\n }\n\n unregisterFrameCallback(callbackId: number): void {\n runOnUI(() => {\n global._frameCallbackRegistry.unregisterFrameCallback(callbackId);\n })();\n }\n\n manageStateFrameCallback(callbackId: number, state: boolean): void {\n runOnUI(() => {\n global._frameCallbackRegistry.manageStateFrameCallback(callbackId, state);\n })();\n }\n}\n"],"mappings":"AAAA,YAAY;;AAAC,SAAAA,gBAAAC,GAAA,EAAAC,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAD,GAAA,IAAAI,MAAA,CAAAC,cAAA,CAAAL,GAAA,EAAAC,GAAA,IAAAC,KAAA,EAAA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L,UAAkB,EAAEM,KAAc,EAAQ;IACjEZ,OAAO,CAAC,MAAM;MACZQ,MAAM,CAACC,sBAAsB,CAACE,wBAAwB,CAACL,UAAU,EAAEM,KAAK,CAAC;IAC3E,CAAC,CAAC,EAAE;EACN;AACF"}
1
+ {"version":3,"names":["_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","r","e","Symbol","toPrimitive","call","TypeError","String","Number","runOnUI","prepareUIRegistry","FrameCallbackRegistryJS","constructor","registerFrameCallback","callback","callbackId","nextCallbackId","global","_frameCallbackRegistry","unregisterFrameCallback","manageStateFrameCallback","state"],"sources":["FrameCallbackRegistryJS.ts"],"sourcesContent":["'use strict';\nimport { runOnUI } from '../core';\nimport type { FrameInfo } from './FrameCallbackRegistryUI';\nimport { prepareUIRegistry } from './FrameCallbackRegistryUI';\n\nexport default class FrameCallbackRegistryJS {\n private nextCallbackId = 0;\n\n constructor() {\n prepareUIRegistry();\n }\n\n registerFrameCallback(callback: (frameInfo: FrameInfo) => void): number {\n if (!callback) {\n return -1;\n }\n\n const callbackId = this.nextCallbackId;\n this.nextCallbackId++;\n\n runOnUI(() => {\n global._frameCallbackRegistry.registerFrameCallback(callback, callbackId);\n })();\n\n return callbackId;\n }\n\n unregisterFrameCallback(callbackId: number): void {\n runOnUI(() => {\n global._frameCallbackRegistry.unregisterFrameCallback(callbackId);\n })();\n }\n\n manageStateFrameCallback(callbackId: number, state: boolean): void {\n runOnUI(() => {\n global._frameCallbackRegistry.manageStateFrameCallback(callbackId, state);\n })();\n }\n}\n"],"mappings":"AAAA,YAAY;;AAAC,SAAAA,gBAAAC,GAAA,EAAAC,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAD,GAAA,IAAAI,MAAA,CAAAC,cAAA,CAAAL,GAAA,EAAAC,GAAA,IAAAC,KAAA,EAAAA,KAAA,EAAAI,UAAA,QAAAC,YAAA,QA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,MAAM;MACZQ,MAAM,CAACC,sBAAsB,CAACE,wBAAwB,CAACL,UAAU,EAAEM,KAAK,CAAC;IAC3E,CAAC,CAAC,CAAC,CAAC;EACN;AACF","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["runOnUIImmediately","prepareUIRegistry","frameCallbackRegistry","Map","activeFrameCallbacks","Set","previousFrameTimestamp","nextCallId","runCallbacks","callId","loop","timestamp","delta","forEach","callbackId","callbackDetails","get","startTime","callback","timeSincePreviousFrame","timeSinceFirstFrame","size","requestAnimationFrame","registerFrameCallback","set","unregisterFrameCallback","manageStateFrameCallback","delete","state","add","global","_frameCallbackRegistry"],"sources":["FrameCallbackRegistryUI.ts"],"sourcesContent":["'use strict';\nimport { runOnUIImmediately } from '../threads';\n\ntype CallbackDetails = {\n callback: (frameInfo: FrameInfo) => void;\n startTime: number | null;\n};\n\nexport type FrameInfo = {\n timestamp: number;\n timeSincePreviousFrame: number | null;\n timeSinceFirstFrame: number;\n};\n\nexport interface FrameCallbackRegistryUI {\n frameCallbackRegistry: Map<number, CallbackDetails>;\n activeFrameCallbacks: Set<number>;\n previousFrameTimestamp: number | null;\n runCallbacks: (callId: number) => void;\n nextCallId: number;\n registerFrameCallback: (\n callback: (frameInfo: FrameInfo) => void,\n callbackId: number\n ) => void;\n unregisterFrameCallback: (callbackId: number) => void;\n manageStateFrameCallback: (callbackId: number, state: boolean) => void;\n}\n\nexport const prepareUIRegistry = runOnUIImmediately(() => {\n 'worklet';\n\n const frameCallbackRegistry: FrameCallbackRegistryUI = {\n frameCallbackRegistry: new Map<number, CallbackDetails>(),\n activeFrameCallbacks: new Set<number>(),\n previousFrameTimestamp: null,\n nextCallId: 0,\n\n runCallbacks(callId) {\n const loop = (timestamp: number) => {\n if (callId !== this.nextCallId) {\n return;\n }\n if (this.previousFrameTimestamp === null) {\n this.previousFrameTimestamp = timestamp;\n }\n\n const delta = timestamp - this.previousFrameTimestamp;\n\n this.activeFrameCallbacks.forEach((callbackId: number) => {\n const callbackDetails = this.frameCallbackRegistry.get(callbackId)!;\n\n const { startTime } = callbackDetails;\n\n if (startTime === null) {\n // First frame\n callbackDetails.startTime = timestamp;\n\n callbackDetails.callback({\n timestamp,\n timeSincePreviousFrame: null,\n timeSinceFirstFrame: 0,\n });\n } else {\n // Next frame\n callbackDetails.callback({\n timestamp,\n timeSincePreviousFrame: delta,\n timeSinceFirstFrame: timestamp - startTime,\n });\n }\n });\n\n if (this.activeFrameCallbacks.size > 0) {\n this.previousFrameTimestamp = timestamp;\n requestAnimationFrame(loop);\n } else {\n this.previousFrameTimestamp = null;\n }\n };\n\n // runCallback() should only be called after registering a callback,\n // so if there is only one active callback, then it means that there were\n // zero previously and the loop isn't running yet.\n if (this.activeFrameCallbacks.size === 1 && callId === this.nextCallId) {\n requestAnimationFrame(loop);\n }\n },\n\n registerFrameCallback(\n callback: (frameInfo: FrameInfo) => void,\n callbackId: number\n ) {\n this.frameCallbackRegistry.set(callbackId, {\n callback,\n startTime: null,\n });\n },\n\n unregisterFrameCallback(callbackId: number) {\n this.manageStateFrameCallback(callbackId, false);\n this.frameCallbackRegistry.delete(callbackId);\n },\n\n manageStateFrameCallback(callbackId: number, state: boolean) {\n if (callbackId === -1) {\n return;\n }\n if (state) {\n this.activeFrameCallbacks.add(callbackId);\n this.runCallbacks(this.nextCallId);\n } else {\n const callback = this.frameCallbackRegistry.get(callbackId)!;\n callback.startTime = null;\n\n this.activeFrameCallbacks.delete(callbackId);\n if (this.activeFrameCallbacks.size === 0) {\n this.nextCallId += 1;\n }\n }\n },\n };\n\n global._frameCallbackRegistry = frameCallbackRegistry;\n});\n"],"mappings":"AAAA,YAAY;;AACZ,SAASA,kBAAkB,QAAQ,YAAY;AA2B/C,OAAO,MAAMC,iBAAiB,GAAGD,kBAAkB,CAAC,MAAM;EACxD,SAAS;;EAET,MAAME,qBAA8C,GAAG;IACrDA,qBAAqB,EAAE,IAAIC,GAAG,EAA2B;IACzDC,oBAAoB,EAAE,IAAIC,GAA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tEe,qBAAqB,CAACZ,IAAI,CAAC;MAC7B;IACF,CAAC;IAEDa,qBAAqBA,CACnBL,QAAwC,EACxCJ,UAAkB,EAClB;MACA,IAAI,CAACZ,qBAAqB,CAACsB,GAAG,CAACV,UAAU,EAAE;QACzCI,QAAQ;QACRD,SAAS,EAAE;MACb,CAAC,CAAC;IACJ,CAAC;IAEDQ,uBAAuBA,CAACX,UAAkB,EAAE;MAC1C,IAAI,CAACY,wBAAwB,CAACZ,UAAU,EAAE,KAAK,CAAC;MAChD,IAAI,CAACZ,qBAAqB,CAACyB,MAAM,CAACb,UAAU,CAAC;IAC/C,CAAC;IAEDY,wBAAwBA,CAACZ,UAAkB,EAAEc,KAAc,EAAE;MAC3D,IAAId,UAAU,KAAK,CAAC,CAAC,EAAE;QACrB;MACF;MACA,IAAIc,KAAK,EAAE;QACT,IAAI,CAACxB,oBAAoB,CAACyB,GAAG,CAACf,UAAU,CAAC;QACzC,IAAI,CAACN,YAAY,CAAC,IAAI,CAACD,UAAU,CAAC;MACpC,CAAC,MAAM;QACL,MAAMW,QAAQ,GAAG,IAAI,CAAChB,qBAAqB,CAACc,GAAG,CAACF,UAAU,CAAE;QAC5DI,QAAQ,CAACD,SAAS,GAAG,IAAI;QAEzB,IAAI,CAACb,oBAAoB,CAACuB,MAAM,CAACb,UAAU,CAAC;QAC5C,IAAI,IAAI,CAACV,oBAAoB,CAACiB,IAAI,KAAK,CAAC,EAAE;UACxC,IAAI,CAACd,UAAU,IAAI,CAAC;QACtB;MACF;IACF;EACF,CAAC;EAEDuB,MAAM,CAACC,sBAAsB,GAAG7B,qBAAqB;AACvD,CAAC,CAAC"}
1
+ {"version":3,"names":["runOnUIImmediately","prepareUIRegistry","frameCallbackRegistry","Map","activeFrameCallbacks","Set","previousFrameTimestamp","nextCallId","runCallbacks","callId","loop","timestamp","delta","forEach","callbackId","callbackDetails","get","startTime","callback","timeSincePreviousFrame","timeSinceFirstFrame","size","requestAnimationFrame","registerFrameCallback","set","unregisterFrameCallback","manageStateFrameCallback","delete","state","add","global","_frameCallbackRegistry"],"sources":["FrameCallbackRegistryUI.ts"],"sourcesContent":["'use strict';\nimport { runOnUIImmediately } from '../threads';\n\ntype CallbackDetails = {\n callback: (frameInfo: FrameInfo) => void;\n startTime: number | null;\n};\n\nexport type FrameInfo = {\n timestamp: number;\n timeSincePreviousFrame: number | null;\n timeSinceFirstFrame: number;\n};\n\nexport interface FrameCallbackRegistryUI {\n frameCallbackRegistry: Map<number, CallbackDetails>;\n activeFrameCallbacks: Set<number>;\n previousFrameTimestamp: number | null;\n runCallbacks: (callId: number) => void;\n nextCallId: number;\n registerFrameCallback: (\n callback: (frameInfo: FrameInfo) => void,\n callbackId: number\n ) => void;\n unregisterFrameCallback: (callbackId: number) => void;\n manageStateFrameCallback: (callbackId: number, state: boolean) => void;\n}\n\nexport const prepareUIRegistry = runOnUIImmediately(() => {\n 'worklet';\n\n const frameCallbackRegistry: FrameCallbackRegistryUI = {\n frameCallbackRegistry: new Map<number, CallbackDetails>(),\n activeFrameCallbacks: new Set<number>(),\n previousFrameTimestamp: null,\n nextCallId: 0,\n\n runCallbacks(callId) {\n const loop = (timestamp: number) => {\n if (callId !== this.nextCallId) {\n return;\n }\n if (this.previousFrameTimestamp === null) {\n this.previousFrameTimestamp = timestamp;\n }\n\n const delta = timestamp - this.previousFrameTimestamp;\n\n this.activeFrameCallbacks.forEach((callbackId: number) => {\n const callbackDetails = this.frameCallbackRegistry.get(callbackId)!;\n\n const { startTime } = callbackDetails;\n\n if (startTime === null) {\n // First frame\n callbackDetails.startTime = timestamp;\n\n callbackDetails.callback({\n timestamp,\n timeSincePreviousFrame: null,\n timeSinceFirstFrame: 0,\n });\n } else {\n // Next frame\n callbackDetails.callback({\n timestamp,\n timeSincePreviousFrame: delta,\n timeSinceFirstFrame: timestamp - startTime,\n });\n }\n });\n\n if (this.activeFrameCallbacks.size > 0) {\n this.previousFrameTimestamp = timestamp;\n requestAnimationFrame(loop);\n } else {\n this.previousFrameTimestamp = null;\n }\n };\n\n // runCallback() should only be called after registering a callback,\n // so if there is only one active callback, then it means that there were\n // zero previously and the loop isn't running yet.\n if (this.activeFrameCallbacks.size === 1 && callId === this.nextCallId) {\n requestAnimationFrame(loop);\n }\n },\n\n registerFrameCallback(\n callback: (frameInfo: FrameInfo) => void,\n callbackId: number\n ) {\n this.frameCallbackRegistry.set(callbackId, {\n callback,\n startTime: null,\n });\n },\n\n unregisterFrameCallback(callbackId: number) {\n this.manageStateFrameCallback(callbackId, false);\n this.frameCallbackRegistry.delete(callbackId);\n },\n\n manageStateFrameCallback(callbackId: number, state: boolean) {\n if (callbackId === -1) {\n return;\n }\n if (state) {\n this.activeFrameCallbacks.add(callbackId);\n this.runCallbacks(this.nextCallId);\n } else {\n const callback = this.frameCallbackRegistry.get(callbackId)!;\n callback.startTime = null;\n\n this.activeFrameCallbacks.delete(callbackId);\n if (this.activeFrameCallbacks.size === 0) {\n this.nextCallId += 1;\n }\n }\n },\n };\n\n global._frameCallbackRegistry = frameCallbackRegistry;\n});\n"],"mappings":"AAAA,YAAY;;AACZ,SAASA,kBAAkB,QAAQ,YAAY;AA2B/C,OAAO,MAAMC,iBAAiB,GAAGD,kBAAkB,CAAC,MAAM;EACxD,SAAS;;EAET,MAAME,qBAA8C,GAAG;IACrDA,qBAAqB,EAAE,IAAIC,GAAG,CAA0B,CAAC;IACzDC,oBAAoB,EAAE,IAAIC,GAAG,CAAS,CAAC;IACvCC,sBAAsB,EAAE,IAAI;IAC5BC,UAAU,EAAE,CAAC;IAEbC,YAAYA,CAACC,MAAM,EAAE;MACnB,MAAMC,IAAI,GAAIC,SAAiB,IAAK;QAClC,IAAIF,MAAM,KAAK,IAAI,CAACF,UAAU,EAAE;UAC9B;QACF;QACA,IAAI,IAAI,CAACD,sBAAsB,KAAK,IAAI,EAAE;UACxC,IAAI,CAACA,sBAAsB,GAAGK,SAAS;QACzC;QAEA,MAAMC,KAAK,GAAGD,SAAS,GAAG,IAAI,CAACL,sBAAs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AACyB,MAAM,CAACb,UAAU,CAAC;IAC/C,CAAC;IAEDY,wBAAwBA,CAACZ,UAAkB,EAAEc,KAAc,EAAE;MAC3D,IAAId,UAAU,KAAK,CAAC,CAAC,EAAE;QACrB;MACF;MACA,IAAIc,KAAK,EAAE;QACT,IAAI,CAACxB,oBAAoB,CAACyB,GAAG,CAACf,UAAU,CAAC;QACzC,IAAI,CAACN,YAAY,CAAC,IAAI,CAACD,UAAU,CAAC;MACpC,CAAC,MAAM;QACL,MAAMW,QAAQ,GAAG,IAAI,CAAChB,qBAAqB,CAACc,GAAG,CAACF,UAAU,CAAE;QAC5DI,QAAQ,CAACD,SAAS,GAAG,IAAI;QAEzB,IAAI,CAACb,oBAAoB,CAACuB,MAAM,CAACb,UAAU,CAAC;QAC5C,IAAI,IAAI,CAACV,oBAAoB,CAACiB,IAAI,KAAK,CAAC,EAAE;UACxC,IAAI,CAACd,UAAU,IAAI,CAAC;QACtB;MACF;IACF;EACF,CAAC;EAEDuB,MAAM,CAACC,sBAAsB,GAAG7B,qBAAqB;AACvD,CAAC,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["'use strict';\nexport type { FrameInfo } from './FrameCallbackRegistryUI';\n"],"mappings":"AAAA,YAAY"}
1
+ {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["'use strict';\nexport type { FrameInfo } from './FrameCallbackRegistryUI';\n"],"mappings":"AAAA,YAAY","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["globals.d.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable no-var */\n'use strict';\nimport type {\n StyleProps,\n MeasuredDimensions,\n MapperRegistry,\n ShareableRef,\n ShadowNodeWrapper,\n FlatShareableRef,\n} from './commonTypes';\nimport type { AnimatedStyle } from './helperTypes';\nimport type { FrameCallbackRegistryUI } from './frameCallback/FrameCallbackRegistryUI';\nimport type { NativeReanimatedModule } from './NativeReanimated/NativeReanimated';\nimport type { SensorContainer } from './SensorContainer';\nimport type { LayoutAnimationsManager } from './layoutReanimation/animationsManager';\nimport type { ProgressTransitionRegister } from './layoutReanimation/sharedTransitions';\nimport type { UpdatePropsManager } from './UpdateProps';\nimport type { callGuardDEV } from './initializers';\nimport type { WorkletRuntime } from './runtimes';\nimport type { RNScreensTurboModuleType } from './screenTransition/commonTypes';\n\ndeclare global {\n var _REANIMATED_IS_REDUCED_MOTION: boolean | undefined;\n var _IS_FABRIC: boolean | undefined;\n var _REANIMATED_VERSION_CPP: string | undefined;\n var _REANIMATED_VERSION_JS: string | undefined;\n var __reanimatedModuleProxy: NativeReanimatedModule | undefined;\n var __callGuardDEV: typeof callGuardDEV | undefined;\n var evalWithSourceMap:\n | ((js: string, sourceURL: string, sourceMap: string) => any)\n | undefined;\n var evalWithSourceUrl: ((js: string, sourceURL: string) => any) | undefined;\n var _log: (value: unknown) => void;\n var _toString: (value: unknown) => string;\n var _notifyAboutProgress: (\n tag: number,\n value: Record<string, unknown>,\n isSharedTransition: boolean\n ) => void;\n var _notifyAboutEnd: (tag: number, removeView: boolean) => void;\n var _setGestureState: (handlerTag: number, newState: number) => void;\n var _makeShareableClone: <T>(\n value: T,\n nativeStateSource?: object\n ) => FlatShareableRef<T>;\n var _scheduleOnJS: (fun: (...args: A) => R, args?: A) => void;\n var _scheduleOnRuntime: (\n runtime: WorkletRuntime,\n worklet: ShareableRef<() => void>\n ) => void;\n var _updatePropsPaper:\n | ((\n operations: {\n tag: number;\n name: string | null;\n // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents\n updates: StyleProps | AnimatedStyle<any>;\n }[]\n ) => void)\n | undefined;\n var _updatePropsFabric:\n | ((\n operations: {\n shadowNodeWrapper: ShadowNodeWrapper;\n // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents\n updates: StyleProps | AnimatedStyle<any>;\n }[]\n ) => void)\n | undefined;\n var _removeFromPropsRegistry: (viewTags: number[]) => void | undefined;\n var _measurePaper:\n | ((viewTag: number | null) => MeasuredDimensions)\n | undefined;\n var _measureFabric:\n | ((shadowNodeWrapper: ShadowNodeWrapper | null) => MeasuredDimensions)\n | undefined;\n var _scrollToPaper:\n | ((viewTag: number, x: number, y: number, animated: boolean) => void)\n | undefined;\n var _dispatchCommandPaper:\n | ((viewTag: number, commandName: string, args: Array<unknown>) => void)\n | undefined;\n var _dispatchCommandFabric:\n | ((\n shadowNodeWrapper: ShadowNodeWrapper,\n commandName: string,\n args: Array<unknown>\n ) => void)\n | undefined;\n var _getAnimationTimestamp: () => number;\n var __ErrorUtils: {\n reportFatalError: (error: Error) => void;\n };\n var _frameCallbackRegistry: FrameCallbackRegistryUI;\n var console: Console;\n var __frameTimestamp: number | undefined;\n var __flushAnimationFrame: (timestamp: number) => void;\n var __workletsCache: Map<string, any>;\n var __handleCache: WeakMap<object, any>;\n var __callMicrotasks: () => void;\n var __mapperRegistry: MapperRegistry;\n var __sensorContainer: SensorContainer;\n var _maybeFlushUIUpdatesQueue: () => void;\n var LayoutAnimationsManager: LayoutAnimationsManager;\n var UpdatePropsManager: UpdatePropsManager;\n var ProgressTransitionRegister: ProgressTransitionRegister;\n var updateJSProps: (viewTag: number, props: Record<string, unknown>) => void;\n var RNScreensTurboModule: RNScreensTurboModuleType | undefined;\n var _obtainPropPaper: (viewTag: number, propName: string) => string;\n var _obtainPropFabric: (\n shadowNodeWrapper: ShadowNodeWrapper,\n propName: string\n ) => string;\n}\n"],"mappings":"AAAA;AACA;AACA,YAAY;;AAAC"}
1
+ {"version":3,"names":[],"sources":["globals.d.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable no-var */\n'use strict';\nimport type {\n StyleProps,\n MeasuredDimensions,\n MapperRegistry,\n ShareableRef,\n ShadowNodeWrapper,\n FlatShareableRef,\n} from './commonTypes';\nimport type { AnimatedStyle } from './helperTypes';\nimport type { FrameCallbackRegistryUI } from './frameCallback/FrameCallbackRegistryUI';\nimport type { NativeReanimatedModule } from './NativeReanimated/NativeReanimated';\nimport type { SensorContainer } from './SensorContainer';\nimport type { LayoutAnimationsManager } from './layoutReanimation/animationsManager';\nimport type { ProgressTransitionRegister } from './layoutReanimation/sharedTransitions';\nimport type { UpdatePropsManager } from './UpdateProps';\nimport type { callGuardDEV } from './initializers';\nimport type { WorkletRuntime } from './runtimes';\nimport type { RNScreensTurboModuleType } from './screenTransition/commonTypes';\n\ndeclare global {\n var _REANIMATED_IS_REDUCED_MOTION: boolean | undefined;\n var _IS_FABRIC: boolean | undefined;\n var _REANIMATED_VERSION_CPP: string | undefined;\n var _REANIMATED_VERSION_JS: string | undefined;\n var __reanimatedModuleProxy: NativeReanimatedModule | undefined;\n var __callGuardDEV: typeof callGuardDEV | undefined;\n var evalWithSourceMap:\n | ((js: string, sourceURL: string, sourceMap: string) => any)\n | undefined;\n var evalWithSourceUrl: ((js: string, sourceURL: string) => any) | undefined;\n var _log: (value: unknown) => void;\n var _toString: (value: unknown) => string;\n var _notifyAboutProgress: (\n tag: number,\n value: Record<string, unknown>,\n isSharedTransition: boolean\n ) => void;\n var _notifyAboutEnd: (tag: number, removeView: boolean) => void;\n var _setGestureState: (handlerTag: number, newState: number) => void;\n var _makeShareableClone: <T>(\n value: T,\n nativeStateSource?: object\n ) => FlatShareableRef<T>;\n var _scheduleOnJS: (fun: (...args: A) => R, args?: A) => void;\n var _scheduleOnRuntime: (\n runtime: WorkletRuntime,\n worklet: ShareableRef<() => void>\n ) => void;\n var _updatePropsPaper:\n | ((\n operations: {\n tag: number;\n name: string | null;\n // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents\n updates: StyleProps | AnimatedStyle<any>;\n }[]\n ) => void)\n | undefined;\n var _updatePropsFabric:\n | ((\n operations: {\n shadowNodeWrapper: ShadowNodeWrapper;\n // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents\n updates: StyleProps | AnimatedStyle<any>;\n }[]\n ) => void)\n | undefined;\n var _removeFromPropsRegistry: (viewTags: number[]) => void | undefined;\n var _measurePaper:\n | ((viewTag: number | null) => MeasuredDimensions)\n | undefined;\n var _measureFabric:\n | ((shadowNodeWrapper: ShadowNodeWrapper | null) => MeasuredDimensions)\n | undefined;\n var _scrollToPaper:\n | ((viewTag: number, x: number, y: number, animated: boolean) => void)\n | undefined;\n var _dispatchCommandPaper:\n | ((viewTag: number, commandName: string, args: Array<unknown>) => void)\n | undefined;\n var _dispatchCommandFabric:\n | ((\n shadowNodeWrapper: ShadowNodeWrapper,\n commandName: string,\n args: Array<unknown>\n ) => void)\n | undefined;\n var _getAnimationTimestamp: () => number;\n var __ErrorUtils: {\n reportFatalError: (error: Error) => void;\n };\n var _frameCallbackRegistry: FrameCallbackRegistryUI;\n var console: Console;\n var __frameTimestamp: number | undefined;\n var __flushAnimationFrame: (timestamp: number) => void;\n var __workletsCache: Map<string, any>;\n var __handleCache: WeakMap<object, any>;\n var __callMicrotasks: () => void;\n var __mapperRegistry: MapperRegistry;\n var __sensorContainer: SensorContainer;\n var _maybeFlushUIUpdatesQueue: () => void;\n var LayoutAnimationsManager: LayoutAnimationsManager;\n var UpdatePropsManager: UpdatePropsManager;\n var ProgressTransitionRegister: ProgressTransitionRegister;\n var updateJSProps: (viewTag: number, props: Record<string, unknown>) => void;\n var RNScreensTurboModule: RNScreensTurboModuleType | undefined;\n var _obtainPropPaper: (viewTag: number, propName: string) => string;\n var _obtainPropFabric: (\n shadowNodeWrapper: ShadowNodeWrapper,\n propName: string\n ) => string;\n}\n"],"mappings":"AAAA;AACA;AACA,YAAY;;AAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["helperTypes.ts"],"sourcesContent":["'use strict';\n/*\nThis file is a legacy remainder of manual types from react-native-reanimated.d.ts file. \nI wasn't able to get rid of all of them from the code. \nThey should be treated as a temporary solution\nuntil time comes to refactor the code and get necessary types right. \nThis will not be easy though! \n*/\n\nimport type {\n ImageStyle,\n RegisteredStyle,\n StyleProp,\n TextStyle,\n TransformsStyle,\n ViewStyle,\n} from 'react-native';\nimport type { AnimatableValue, SharedValue } from './commonTypes';\nimport type { BaseAnimationBuilder } from './layoutReanimation/animationBuilder/BaseAnimationBuilder';\nimport type {\n EntryExitAnimationFunction,\n LayoutAnimationFunction,\n} from './layoutReanimation/animationBuilder/commonTypes';\nimport type { ReanimatedKeyframe } from './layoutReanimation/animationBuilder/Keyframe';\nimport type { SharedTransition } from './layoutReanimation/sharedTransitions';\n\nexport type TransformArrayItem = Extract<\n TransformsStyle['transform'],\n Array<unknown>\n>[number];\n\nexport type AnimatedTransform = MaybeSharedValueRecursive<\n TransformsStyle['transform']\n>;\n\ntype MaybeSharedValue<Value> =\n | Value\n | (Value extends AnimatableValue ? SharedValue<Value> : never);\n\ntype MaybeSharedValueRecursive<Value> = Value extends (infer Item)[]\n ? SharedValue<Item[]> | (MaybeSharedValueRecursive<Item> | Item)[]\n : Value extends object\n ?\n | SharedValue<Value>\n | {\n [Key in keyof Value]:\n | MaybeSharedValueRecursive<Value[Key]>\n | Value[Key];\n }\n : MaybeSharedValue<Value>;\n\ntype DefaultStyle = ViewStyle & ImageStyle & TextStyle;\n\n// Ideally we want AnimatedStyle to not be generic, but there are\n// so many depenedencies on it being generic that it's not feasible at the moment.\nexport type AnimatedStyle<Style = DefaultStyle> =\n | Style\n | MaybeSharedValueRecursive<Style>;\n\ntype EntryOrExitLayoutType =\n | BaseAnimationBuilder\n | typeof BaseAnimationBuilder\n | EntryExitAnimationFunction\n | ReanimatedKeyframe;\n\n/*\n Style type properties (properties that extends StyleProp<ViewStyle>)\n can be defined with other property names than \"style\". For example `contentContainerStyle` in FlatList.\n Type definition for all style type properties should act similarly, hence we\n pick keys with 'Style' substring with the use of this utility type.\n*/\ntype PickStyleProps<Props> = Pick<\n Props,\n {\n [Key in keyof Props]-?: Key extends `${string}Style` | 'style'\n ? Key\n : never;\n }[keyof Props]\n>;\n\ntype AnimatedStyleProps<Props extends object> = {\n [Key in keyof PickStyleProps<Props>]: StyleProp<AnimatedStyle<Props[Key]>>;\n};\n\n/**\n * Component props that are not specially handled by us.\n */\ntype RestProps<Props extends object> = {\n [K in keyof Omit<Props, keyof PickStyleProps<Props> | 'style'>]:\n | Props[K]\n | SharedValue<Props[K]>;\n};\n\ntype LayoutProps = {\n /**\n * Lets you animate the layout changes when components are added to or removed from the view hierarchy.\n *\n * You can use the predefined layout transitions (eg. `LinearTransition`, `FadingTransition`) or create your own ones.\n *\n * @see https://docs.swmansion.com/react-native-reanimated/docs/layout-animations/layout-transitions\n */\n layout?:\n | BaseAnimationBuilder\n | LayoutAnimationFunction\n | typeof BaseAnimationBuilder;\n /**\n * Lets you animate an element when it's added to or removed from the view hierarchy.\n *\n * You can use the predefined entering animations (eg. `FadeIn`, `SlideInLeft`) or create your own ones.\n *\n * @see https://docs.swmansion.com/react-native-reanimated/docs/layout-animations/entering-exiting-animations\n */\n entering?: EntryOrExitLayoutType;\n /**\n * Lets you animate an element when it's added to or removed from the view hierarchy.\n *\n * You can use the predefined entering animations (eg. `FadeOut`, `SlideOutRight`) or create your own ones.\n *\n * @see https://docs.swmansion.com/react-native-reanimated/docs/layout-animations/entering-exiting-animations\n */\n exiting?: EntryOrExitLayoutType;\n};\n\ntype SharedTransitionProps = {\n /**\n * Lets you animate components between two navigation screens.\n *\n * Assign the same `sharedTransitionTag` to [animated components](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#animated-component) on two different navigation screens to create a shared transition.\n *\n * @see https://docs.swmansion.com/react-native-reanimated/docs/shared-element-transitions/overview\n * @experimental\n */\n sharedTransitionTag?: string;\n /**\n * Lets you create a custom shared transition animation.\n *\n * Used alongside `SharedTransition.custom()` method.\n *\n * @see https://docs.swmansion.com/react-native-reanimated/docs/shared-element-transitions/overview\n * @experimental\n */\n sharedTransitionStyle?: SharedTransition;\n};\n\ntype AnimatedPropsProp<Props extends object> = RestProps<Props> &\n AnimatedStyleProps<Props> &\n LayoutProps &\n SharedTransitionProps;\n\nexport type AnimatedProps<Props extends object> = RestProps<Props> &\n AnimatedStyleProps<Props> &\n LayoutProps &\n SharedTransitionProps & {\n /**\n * Lets you animate component props.\n *\n * @see https://docs.swmansion.com/react-native-reanimated/docs/core/useAnimatedProps\n */\n animatedProps?: Partial<AnimatedPropsProp<Props>>;\n };\n\n// THE LAND OF THE DEPRECATED\n\n/**\n * @deprecated This type is no longer relevant.\n */\nexport type Adaptable<T> =\n | T\n | ReadonlyArray<T | ReadonlyArray<T>>\n | SharedValue<T>;\n\n/**\n * @deprecated This type is no longer relevant.\n */\nexport type AdaptTransforms<T> = {\n [P in keyof T]: Adaptable<T[P]>;\n};\n\n/**\n * @deprecated Please use {@link TransformArrayItem} type instead.\n */\nexport type TransformStyleTypes = TransformArrayItem;\n\n/**\n * @deprecated Please use {@link AnimatedStyle} type instead.\n */\nexport type AnimateStyle<Style = DefaultStyle> = AnimatedStyle<Style>;\n\n/**\n * @deprecated This type is no longer relevant.\n */\nexport type StylesOrDefault<T> = 'style' extends keyof T\n ? MaybeSharedValueRecursive<T['style']>\n : Record<string, unknown>;\n\n/**\n * @deprecated This type is no longer relevant.\n */\nexport type AnimatedStyleProp<T> =\n | AnimatedStyle<T>\n | RegisteredStyle<AnimatedStyle<T>>;\n\n/**\n * @deprecated Please use {@link AnimatedProps} type instead.\n */\nexport type AnimateProps<Props extends object> = AnimatedProps<Props>;\n"],"mappings":"AAAA,YAAY;;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AANA"}
1
+ {"version":3,"names":[],"sources":["helperTypes.ts"],"sourcesContent":["'use strict';\n/*\nThis file is a legacy remainder of manual types from react-native-reanimated.d.ts file. \nI wasn't able to get rid of all of them from the code. \nThey should be treated as a temporary solution\nuntil time comes to refactor the code and get necessary types right. \nThis will not be easy though! \n*/\n\nimport type {\n ImageStyle,\n RegisteredStyle,\n StyleProp,\n TextStyle,\n TransformsStyle,\n ViewStyle,\n} from 'react-native';\nimport type { AnimatableValue, SharedValue } from './commonTypes';\nimport type { BaseAnimationBuilder } from './layoutReanimation/animationBuilder/BaseAnimationBuilder';\nimport type {\n EntryExitAnimationFunction,\n LayoutAnimationFunction,\n} from './layoutReanimation/animationBuilder/commonTypes';\nimport type { ReanimatedKeyframe } from './layoutReanimation/animationBuilder/Keyframe';\nimport type { SharedTransition } from './layoutReanimation/sharedTransitions';\n\nexport type TransformArrayItem = Extract<\n TransformsStyle['transform'],\n Array<unknown>\n>[number];\n\nexport type AnimatedTransform = MaybeSharedValueRecursive<\n TransformsStyle['transform']\n>;\n\ntype MaybeSharedValue<Value> =\n | Value\n | (Value extends AnimatableValue ? SharedValue<Value> : never);\n\ntype MaybeSharedValueRecursive<Value> = Value extends (infer Item)[]\n ? SharedValue<Item[]> | (MaybeSharedValueRecursive<Item> | Item)[]\n : Value extends object\n ?\n | SharedValue<Value>\n | {\n [Key in keyof Value]:\n | MaybeSharedValueRecursive<Value[Key]>\n | Value[Key];\n }\n : MaybeSharedValue<Value>;\n\ntype DefaultStyle = ViewStyle & ImageStyle & TextStyle;\n\n// Ideally we want AnimatedStyle to not be generic, but there are\n// so many depenedencies on it being generic that it's not feasible at the moment.\nexport type AnimatedStyle<Style = DefaultStyle> =\n | Style\n | MaybeSharedValueRecursive<Style>;\n\ntype EntryOrExitLayoutType =\n | BaseAnimationBuilder\n | typeof BaseAnimationBuilder\n | EntryExitAnimationFunction\n | ReanimatedKeyframe;\n\n/*\n Style type properties (properties that extends StyleProp<ViewStyle>)\n can be defined with other property names than \"style\". For example `contentContainerStyle` in FlatList.\n Type definition for all style type properties should act similarly, hence we\n pick keys with 'Style' substring with the use of this utility type.\n*/\ntype PickStyleProps<Props> = Pick<\n Props,\n {\n [Key in keyof Props]-?: Key extends `${string}Style` | 'style'\n ? Key\n : never;\n }[keyof Props]\n>;\n\ntype AnimatedStyleProps<Props extends object> = {\n [Key in keyof PickStyleProps<Props>]: StyleProp<AnimatedStyle<Props[Key]>>;\n};\n\n/**\n * Component props that are not specially handled by us.\n */\ntype RestProps<Props extends object> = {\n [K in keyof Omit<Props, keyof PickStyleProps<Props> | 'style'>]:\n | Props[K]\n | SharedValue<Props[K]>;\n};\n\ntype LayoutProps = {\n /**\n * Lets you animate the layout changes when components are added to or removed from the view hierarchy.\n *\n * You can use the predefined layout transitions (eg. `LinearTransition`, `FadingTransition`) or create your own ones.\n *\n * @see https://docs.swmansion.com/react-native-reanimated/docs/layout-animations/layout-transitions\n */\n layout?:\n | BaseAnimationBuilder\n | LayoutAnimationFunction\n | typeof BaseAnimationBuilder;\n /**\n * Lets you animate an element when it's added to or removed from the view hierarchy.\n *\n * You can use the predefined entering animations (eg. `FadeIn`, `SlideInLeft`) or create your own ones.\n *\n * @see https://docs.swmansion.com/react-native-reanimated/docs/layout-animations/entering-exiting-animations\n */\n entering?: EntryOrExitLayoutType;\n /**\n * Lets you animate an element when it's added to or removed from the view hierarchy.\n *\n * You can use the predefined entering animations (eg. `FadeOut`, `SlideOutRight`) or create your own ones.\n *\n * @see https://docs.swmansion.com/react-native-reanimated/docs/layout-animations/entering-exiting-animations\n */\n exiting?: EntryOrExitLayoutType;\n};\n\ntype SharedTransitionProps = {\n /**\n * Lets you animate components between two navigation screens.\n *\n * Assign the same `sharedTransitionTag` to [animated components](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#animated-component) on two different navigation screens to create a shared transition.\n *\n * @see https://docs.swmansion.com/react-native-reanimated/docs/shared-element-transitions/overview\n * @experimental\n */\n sharedTransitionTag?: string;\n /**\n * Lets you create a custom shared transition animation.\n *\n * Used alongside `SharedTransition.custom()` method.\n *\n * @see https://docs.swmansion.com/react-native-reanimated/docs/shared-element-transitions/overview\n * @experimental\n */\n sharedTransitionStyle?: SharedTransition;\n};\n\ntype AnimatedPropsProp<Props extends object> = RestProps<Props> &\n AnimatedStyleProps<Props> &\n LayoutProps &\n SharedTransitionProps;\n\nexport type AnimatedProps<Props extends object> = RestProps<Props> &\n AnimatedStyleProps<Props> &\n LayoutProps &\n SharedTransitionProps & {\n /**\n * Lets you animate component props.\n *\n * @see https://docs.swmansion.com/react-native-reanimated/docs/core/useAnimatedProps\n */\n animatedProps?: Partial<AnimatedPropsProp<Props>>;\n };\n\n// THE LAND OF THE DEPRECATED\n\n/**\n * @deprecated This type is no longer relevant.\n */\nexport type Adaptable<T> =\n | T\n | ReadonlyArray<T | ReadonlyArray<T>>\n | SharedValue<T>;\n\n/**\n * @deprecated This type is no longer relevant.\n */\nexport type AdaptTransforms<T> = {\n [P in keyof T]: Adaptable<T[P]>;\n};\n\n/**\n * @deprecated Please use {@link TransformArrayItem} type instead.\n */\nexport type TransformStyleTypes = TransformArrayItem;\n\n/**\n * @deprecated Please use {@link AnimatedStyle} type instead.\n */\nexport type AnimateStyle<Style = DefaultStyle> = AnimatedStyle<Style>;\n\n/**\n * @deprecated This type is no longer relevant.\n */\nexport type StylesOrDefault<T> = 'style' extends keyof T\n ? MaybeSharedValueRecursive<T['style']>\n : Record<string, unknown>;\n\n/**\n * @deprecated This type is no longer relevant.\n */\nexport type AnimatedStyleProp<T> =\n | AnimatedStyle<T>\n | RegisteredStyle<AnimatedStyle<T>>;\n\n/**\n * @deprecated Please use {@link AnimatedProps} type instead.\n */\nexport type AnimateProps<Props extends object> = AnimatedProps<Props>;\n"],"mappings":"AAAA,YAAY;;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AANA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["commonTypes.ts"],"sourcesContent":["'use strict';\nimport type { Component, MutableRefObject } from 'react';\nimport type {\n AnimatedPropsAdapterFunction,\n ShadowNodeWrapper,\n SharedValue,\n WorkletFunction,\n} from '../commonTypes';\nimport type {\n ImageStyle,\n NativeSyntheticEvent,\n TextStyle,\n ViewStyle,\n NativeScrollEvent,\n} from 'react-native';\nimport type { ViewDescriptorsSet, ViewRefSet } from '../ViewDescriptorsSet';\nimport type { AnimatedStyle } from '../helperTypes';\n\nexport type DependencyList = Array<unknown> | undefined;\n\nexport interface Descriptor {\n tag: number;\n name: string;\n shadowNodeWrapper: ShadowNodeWrapper;\n}\n\nexport interface AnimatedRef<T extends Component> {\n (component?: T):\n | number // Paper\n | ShadowNodeWrapper // Fabric\n | HTMLElement; // web\n current: T | null;\n getTag: () => number;\n}\n\n// Might make that type generic if it's ever needed.\nexport type AnimatedRefOnJS = AnimatedRef<Component>;\n\n/**\n * `AnimatedRef` is mapped to this type on the UI thread via a shareable handle.\n */\nexport type AnimatedRefOnUI = {\n (): number | ShadowNodeWrapper | null;\n /**\n * @remarks `viewName` is required only on iOS with Paper and it's value is null on other platforms.\n */\n viewName: SharedValue<string | null>;\n};\n\ntype ReanimatedPayload = {\n eventName: string;\n};\n\n/**\n * This utility type is to convert type of events that would normally be\n * sent by React Native (they have `nativeEvent` field) to the type\n * that is sent by Reanimated.\n */\nexport type ReanimatedEvent<Event extends object> = ReanimatedPayload &\n (Event extends {\n nativeEvent: infer NativeEvent extends object;\n }\n ? NativeEvent\n : Event);\n\nexport type EventPayload<Event extends object> = Event extends {\n nativeEvent: infer NativeEvent extends object;\n}\n ? NativeEvent\n : Omit<Event, 'eventName'>;\n\nexport type NativeEventWrapper<Event extends object> = {\n nativeEvent: Event;\n};\n\nexport type DefaultStyle = ViewStyle | ImageStyle | TextStyle;\n\nexport type RNNativeScrollEvent = NativeSyntheticEvent<NativeScrollEvent>;\n\nexport type ReanimatedScrollEvent = ReanimatedEvent<RNNativeScrollEvent>;\n\nexport interface AnimatedStyleHandle<\n Style extends DefaultStyle = DefaultStyle\n> {\n viewDescriptors: ViewDescriptorsSet;\n initial: {\n value: AnimatedStyle<Style>;\n updater: () => AnimatedStyle<Style>;\n };\n /**\n * @remarks `viewsRef` is only defined in Web implementation.\n */\n viewsRef: ViewRefSet<unknown> | undefined;\n}\n\nexport interface JestAnimatedStyleHandle<\n Style extends DefaultStyle = DefaultStyle\n> extends AnimatedStyleHandle<Style> {\n jestAnimatedStyle: MutableRefObject<AnimatedStyle<Style>>;\n}\n\nexport type UseAnimatedStyleInternal<Style extends DefaultStyle> = (\n updater: WorkletFunction<[], Style> | (() => Style),\n dependencies?: DependencyList | null,\n adapters?:\n | AnimatedPropsAdapterFunction\n | AnimatedPropsAdapterFunction[]\n | null,\n isAnimatedProps?: boolean\n) => AnimatedStyleHandle<Style> | JestAnimatedStyleHandle<Style>;\n"],"mappings":"AAAA,YAAY;;AAAC"}
1
+ {"version":3,"names":[],"sources":["commonTypes.ts"],"sourcesContent":["'use strict';\nimport type { Component, MutableRefObject } from 'react';\nimport type {\n AnimatedPropsAdapterFunction,\n ShadowNodeWrapper,\n SharedValue,\n WorkletFunction,\n} from '../commonTypes';\nimport type {\n ImageStyle,\n NativeSyntheticEvent,\n TextStyle,\n ViewStyle,\n NativeScrollEvent,\n} from 'react-native';\nimport type { ViewDescriptorsSet, ViewRefSet } from '../ViewDescriptorsSet';\nimport type { AnimatedStyle } from '../helperTypes';\n\nexport type DependencyList = Array<unknown> | undefined;\n\nexport interface Descriptor {\n tag: number;\n name: string;\n shadowNodeWrapper: ShadowNodeWrapper;\n}\n\nexport interface AnimatedRef<T extends Component> {\n (component?: T):\n | number // Paper\n | ShadowNodeWrapper // Fabric\n | HTMLElement; // web\n current: T | null;\n getTag: () => number;\n}\n\n// Might make that type generic if it's ever needed.\nexport type AnimatedRefOnJS = AnimatedRef<Component>;\n\n/**\n * `AnimatedRef` is mapped to this type on the UI thread via a shareable handle.\n */\nexport type AnimatedRefOnUI = {\n (): number | ShadowNodeWrapper | null;\n /**\n * @remarks `viewName` is required only on iOS with Paper and it's value is null on other platforms.\n */\n viewName: SharedValue<string | null>;\n};\n\ntype ReanimatedPayload = {\n eventName: string;\n};\n\n/**\n * This utility type is to convert type of events that would normally be\n * sent by React Native (they have `nativeEvent` field) to the type\n * that is sent by Reanimated.\n */\nexport type ReanimatedEvent<Event extends object> = ReanimatedPayload &\n (Event extends {\n nativeEvent: infer NativeEvent extends object;\n }\n ? NativeEvent\n : Event);\n\nexport type EventPayload<Event extends object> = Event extends {\n nativeEvent: infer NativeEvent extends object;\n}\n ? NativeEvent\n : Omit<Event, 'eventName'>;\n\nexport type NativeEventWrapper<Event extends object> = {\n nativeEvent: Event;\n};\n\nexport type DefaultStyle = ViewStyle | ImageStyle | TextStyle;\n\nexport type RNNativeScrollEvent = NativeSyntheticEvent<NativeScrollEvent>;\n\nexport type ReanimatedScrollEvent = ReanimatedEvent<RNNativeScrollEvent>;\n\nexport interface IWorkletEventHandler<Event extends object> {\n updateEventHandler: (\n newWorklet: (event: ReanimatedEvent<Event>) => void,\n newEvents: string[]\n ) => void;\n registerForEvents: (viewTag: number, fallbackEventName?: string) => void;\n unregisterFromEvents: (viewTag: number) => void;\n}\n\nexport interface AnimatedStyleHandle<\n Style extends DefaultStyle = DefaultStyle\n> {\n viewDescriptors: ViewDescriptorsSet;\n initial: {\n value: AnimatedStyle<Style>;\n updater: () => AnimatedStyle<Style>;\n };\n /**\n * @remarks `viewsRef` is only defined in Web implementation.\n */\n viewsRef: ViewRefSet<unknown> | undefined;\n}\n\nexport interface JestAnimatedStyleHandle<\n Style extends DefaultStyle = DefaultStyle\n> extends AnimatedStyleHandle<Style> {\n jestAnimatedStyle: MutableRefObject<AnimatedStyle<Style>>;\n}\n\nexport type UseAnimatedStyleInternal<Style extends DefaultStyle> = (\n updater: WorkletFunction<[], Style> | (() => Style),\n dependencies?: DependencyList | null,\n adapters?:\n | AnimatedPropsAdapterFunction\n | AnimatedPropsAdapterFunction[]\n | null,\n isAnimatedProps?: boolean\n) => AnimatedStyleHandle<Style> | JestAnimatedStyleHandle<Style>;\n"],"mappings":"AAAA,YAAY;;AAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["useAnimatedProps","useWorkletCallback","useSharedValue","useReducedMotion","useAnimatedStyle","useAnimatedGestureHandler","useAnimatedReaction","useAnimatedRef","useAnimatedScrollHandler","useDerivedValue","useAnimatedSensor","useFrameCallback","useAnimatedKeyboard","useScrollViewOffset","useEvent","useHandler"],"sources":["index.ts"],"sourcesContent":["'use strict';\nexport type {\n DependencyList,\n AnimatedRef,\n ReanimatedScrollEvent as ScrollEvent,\n ReanimatedEvent,\n} from './commonTypes';\nexport { useAnimatedProps } from './useAnimatedProps';\nexport { useWorkletCallback } from './useWorkletCallback';\nexport { useSharedValue } from './useSharedValue';\nexport { useReducedMotion } from './useReducedMotion';\nexport { useAnimatedStyle } from './useAnimatedStyle';\nexport { useAnimatedGestureHandler } from './useAnimatedGestureHandler';\nexport type {\n GestureHandlerEvent,\n GestureHandlers,\n} from './useAnimatedGestureHandler';\nexport { useAnimatedReaction } from './useAnimatedReaction';\nexport { useAnimatedRef } from './useAnimatedRef';\nexport { useAnimatedScrollHandler } from './useAnimatedScrollHandler';\nexport type {\n ScrollHandler,\n ScrollHandlers,\n ScrollHandlerProcessed,\n ScrollHandlerInternal,\n} from './useAnimatedScrollHandler';\nexport { useDerivedValue } from './useDerivedValue';\nexport type { DerivedValue } from './useDerivedValue';\nexport { useAnimatedSensor } from './useAnimatedSensor';\nexport { useFrameCallback } from './useFrameCallback';\nexport type { FrameCallback } from './useFrameCallback';\nexport { useAnimatedKeyboard } from './useAnimatedKeyboard';\nexport { useScrollViewOffset } from './useScrollViewOffset';\nexport type {\n EventHandler,\n EventHandlerProcessed,\n EventHandlerInternal,\n} from './useEvent';\nexport { useEvent } from './useEvent';\nexport type { UseHandlerContext } from './useHandler';\nexport { useHandler } from './useHandler';\n"],"mappings":"AAAA,YAAY;;AAOZ,SAASA,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,kBAAkB,QAAQ,sBAAsB;AACzD,SAASC,cAAc,QAAQ,kBAAkB;AACjD,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,yBAAyB,QAAQ,6BAA6B;AAKvE,SAASC,mBAAmB,QAAQ,uBAAuB;AAC3D,SAASC,cAAc,QAAQ,kBAAkB;AACjD,SAASC,wBAAwB,QAAQ,4BAA4B;AAOrE,SAASC,eAAe,QAAQ,mBAAmB;AAEnD,SAASC,iBAAiB,QAAQ,qBAAqB;AACvD,SAASC,gBAAgB,QAAQ,oBAAoB;AAErD,SAASC,mBAAmB,QAAQ,uBAAuB;AAC3D,SAASC,mBAAmB,QAAQ,uBAAuB;AAM3D,SAASC,QAAQ,QAAQ,YAAY;AAErC,SAASC,UAAU,QAAQ,cAAc"}
1
+ {"version":3,"names":["useAnimatedProps","useWorkletCallback","useSharedValue","useReducedMotion","useAnimatedStyle","useAnimatedGestureHandler","useAnimatedReaction","useAnimatedRef","useAnimatedScrollHandler","useDerivedValue","useAnimatedSensor","useFrameCallback","useAnimatedKeyboard","useScrollViewOffset","useEvent","useHandler"],"sources":["index.ts"],"sourcesContent":["'use strict';\nexport type {\n DependencyList,\n AnimatedRef,\n ReanimatedScrollEvent as ScrollEvent,\n ReanimatedEvent,\n} from './commonTypes';\nexport { useAnimatedProps } from './useAnimatedProps';\nexport { useWorkletCallback } from './useWorkletCallback';\nexport { useSharedValue } from './useSharedValue';\nexport { useReducedMotion } from './useReducedMotion';\nexport { useAnimatedStyle } from './useAnimatedStyle';\nexport { useAnimatedGestureHandler } from './useAnimatedGestureHandler';\nexport type {\n GestureHandlerEvent,\n GestureHandlers,\n} from './useAnimatedGestureHandler';\nexport { useAnimatedReaction } from './useAnimatedReaction';\nexport { useAnimatedRef } from './useAnimatedRef';\nexport { useAnimatedScrollHandler } from './useAnimatedScrollHandler';\nexport type {\n ScrollHandler,\n ScrollHandlers,\n ScrollHandlerProcessed,\n ScrollHandlerInternal,\n} from './useAnimatedScrollHandler';\nexport { useDerivedValue } from './useDerivedValue';\nexport type { DerivedValue } from './useDerivedValue';\nexport { useAnimatedSensor } from './useAnimatedSensor';\nexport { useFrameCallback } from './useFrameCallback';\nexport type { FrameCallback } from './useFrameCallback';\nexport { useAnimatedKeyboard } from './useAnimatedKeyboard';\nexport { useScrollViewOffset } from './useScrollViewOffset';\nexport type {\n EventHandler,\n EventHandlerProcessed,\n EventHandlerInternal,\n} from './useEvent';\nexport { useEvent } from './useEvent';\nexport type { UseHandlerContext } from './useHandler';\nexport { useHandler } from './useHandler';\n"],"mappings":"AAAA,YAAY;;AAOZ,SAASA,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,kBAAkB,QAAQ,sBAAsB;AACzD,SAASC,cAAc,QAAQ,kBAAkB;AACjD,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,yBAAyB,QAAQ,6BAA6B;AAKvE,SAASC,mBAAmB,QAAQ,uBAAuB;AAC3D,SAASC,cAAc,QAAQ,kBAAkB;AACjD,SAASC,wBAAwB,QAAQ,4BAA4B;AAOrE,SAASC,eAAe,QAAQ,mBAAmB;AAEnD,SAASC,iBAAiB,QAAQ,qBAAqB;AACvD,SAASC,gBAAgB,QAAQ,oBAAoB;AAErD,SAASC,mBAAmB,QAAQ,uBAAuB;AAC3D,SAASC,mBAAmB,QAAQ,uBAAuB;AAM3D,SAASC,QAAQ,QAAQ,YAAY;AAErC,SAASC,UAAU,QAAQ,cAAc","ignoreList":[]}
@@ -13,6 +13,7 @@ const EVENT_TYPE = {
13
13
 
14
14
  // This type comes from React Native Gesture Handler
15
15
  // import type { PanGestureHandlerGestureEvent as DefaultEvent } from 'react-native-gesture-handler';
16
+
16
17
  /**
17
18
  * @deprecated useAnimatedGestureHandler is an old API which is no longer supported.
18
19
  *
@@ -1 +1 @@
1
- {"version":3,"names":["useHandler","useEvent","EVENT_TYPE","UNDETERMINED","FAILED","BEGAN","CANCELLED","ACTIVE","END","useAnimatedGestureHandler","handlers","dependencies","context","doDependenciesDiffer","useWeb","handler","e","event","nativeEvent","state","onStart","onActive","oldState","onEnd","onFail","onCancel","onFinish"],"sources":["useAnimatedGestureHandler.ts"],"sourcesContent":["'use strict';\nimport type {\n DependencyList,\n NativeEventWrapper,\n ReanimatedEvent,\n} from './commonTypes';\nimport { useHandler } from './useHandler';\nimport { useEvent } from './useEvent';\n\nconst EVENT_TYPE = {\n UNDETERMINED: 0,\n FAILED: 1,\n BEGAN: 2,\n CANCELLED: 3,\n ACTIVE: 4,\n END: 5,\n} as const;\n\ntype StateType = (typeof EVENT_TYPE)[keyof typeof EVENT_TYPE];\n\n// This type comes from React Native Gesture Handler\n// import type { PanGestureHandlerGestureEvent as DefaultEvent } from 'react-native-gesture-handler';\ntype DefaultEvent = {\n nativeEvent: {\n readonly handlerTag: number;\n readonly numberOfPointers: number;\n readonly state: (typeof EVENT_TYPE)[keyof typeof EVENT_TYPE];\n readonly x: number;\n readonly y: number;\n readonly absoluteX: number;\n readonly absoluteY: number;\n readonly translationX: number;\n readonly translationY: number;\n readonly velocityX: number;\n readonly velocityY: number;\n };\n};\n\ninterface PropsUsedInUseAnimatedGestureHandler {\n handlerTag?: number;\n numberOfPointers?: number;\n state?: StateType;\n oldState?: StateType;\n}\n\nexport type GestureHandlerEvent<Event extends object> =\n | ReanimatedEvent<Event>\n | Event;\n\ntype GestureHandler<\n Event extends NativeEventWrapper<PropsUsedInUseAnimatedGestureHandler>,\n Context extends Record<string, unknown>\n> = (\n eventPayload: ReanimatedEvent<Event>,\n context: Context,\n isCanceledOrFailed?: boolean\n) => void;\n\nexport interface GestureHandlers<\n Event extends NativeEventWrapper<PropsUsedInUseAnimatedGestureHandler>,\n Context extends Record<string, unknown>\n> {\n [key: string]: GestureHandler<Event, Context> | undefined;\n onStart?: GestureHandler<Event, Context>;\n onActive?: GestureHandler<Event, Context>;\n onEnd?: GestureHandler<Event, Context>;\n onFail?: GestureHandler<Event, Context>;\n onCancel?: GestureHandler<Event, Context>;\n onFinish?: GestureHandler<Event, Context>;\n}\n\n/**\n * @deprecated useAnimatedGestureHandler is an old API which is no longer supported.\n *\n * Please check https://docs.swmansion.com/react-native-gesture-handler/docs/guides/upgrading-to-2/\n * for information about how to migrate to `react-native-gesture-handler` v2\n */\nexport function useAnimatedGestureHandler<\n Event extends NativeEventWrapper<PropsUsedInUseAnimatedGestureHandler> = DefaultEvent,\n Context extends Record<string, unknown> = Record<string, unknown>\n>(handlers: GestureHandlers<Event, Context>, dependencies?: DependencyList) {\n type WebOrNativeEvent = Event | ReanimatedEvent<Event>;\n\n const { context, doDependenciesDiffer, useWeb } = useHandler<Event, Context>(\n handlers,\n dependencies\n );\n const handler = (e: WebOrNativeEvent) => {\n 'worklet';\n const event = useWeb\n ? // On Web we get events straight from React Native and they don't have\n // the `eventName` field there. To simplify the types here we just\n // cast it as the field was available.\n ((e as Event).nativeEvent as ReanimatedEvent<Event>)\n : (e as ReanimatedEvent<Event>);\n\n if (event.state === EVENT_TYPE.BEGAN && handlers.onStart) {\n handlers.onStart(event, context);\n }\n if (event.state === EVENT_TYPE.ACTIVE && handlers.onActive) {\n handlers.onActive(event, context);\n }\n if (\n event.oldState === EVENT_TYPE.ACTIVE &&\n event.state === EVENT_TYPE.END &&\n handlers.onEnd\n ) {\n handlers.onEnd(event, context);\n }\n if (\n event.oldState === EVENT_TYPE.BEGAN &&\n event.state === EVENT_TYPE.FAILED &&\n handlers.onFail\n ) {\n handlers.onFail(event, context);\n }\n if (\n event.oldState === EVENT_TYPE.ACTIVE &&\n event.state === EVENT_TYPE.CANCELLED &&\n handlers.onCancel\n ) {\n handlers.onCancel(event, context);\n }\n if (\n (event.oldState === EVENT_TYPE.BEGAN ||\n event.oldState === EVENT_TYPE.ACTIVE) &&\n event.state !== EVENT_TYPE.BEGAN &&\n event.state !== EVENT_TYPE.ACTIVE &&\n handlers.onFinish\n ) {\n handlers.onFinish(\n event,\n context,\n event.state === EVENT_TYPE.CANCELLED ||\n event.state === EVENT_TYPE.FAILED\n );\n }\n };\n\n if (useWeb) {\n return handler;\n }\n\n // eslint-disable-next-line react-hooks/rules-of-hooks\n return useEvent<Event>(\n handler,\n ['onGestureHandlerStateChange', 'onGestureHandlerEvent'],\n doDependenciesDiffer\n // This is not correct but we want to make GH think it receives a function.\n ) as unknown as (e: Event) => void;\n}\n"],"mappings":"AAAA,YAAY;;AAMZ,SAASA,UAAU,QAA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AAQ,CAACc,MAAM,CAACP,KAAK,EAAEL,OAAO,CAAC;IACjC;IACA,IACEK,KAAK,CAACK,QAAQ,KAAKpB,UAAU,CAACK,MAAM,IACpCU,KAAK,CAACE,KAAK,KAAKjB,UAAU,CAACI,SAAS,IACpCI,QAAQ,CAACe,QAAQ,EACjB;MACAf,QAAQ,CAACe,QAAQ,CAACR,KAAK,EAAEL,OAAO,CAAC;IACnC;IACA,IACE,CAACK,KAAK,CAACK,QAAQ,KAAKpB,UAAU,CAACG,KAAK,IAClCY,KAAK,CAACK,QAAQ,KAAKpB,UAAU,CAACK,MAAM,KACtCU,KAAK,CAACE,KAAK,KAAKjB,UAAU,CAACG,KAAK,IAChCY,KAAK,CAACE,KAAK,KAAKjB,UAAU,CAACK,MAAM,IACjCG,QAAQ,CAACgB,QAAQ,EACjB;MACAhB,QAAQ,CAACgB,QAAQ,CACfT,KAAK,EACLL,OAAO,EACPK,KAAK,CAACE,KAAK,KAAKjB,UAAU,CAACI,SAAS,IAClCW,KAAK,CAACE,KAAK,KAAKjB,UAAU,CAACE,MAAM,CACpC;IACH;EACF,CAAC;EAED,IAAIU,MAAM,EAAE;IACV,OAAOC,OAAO;EAChB;;EAEA;EACA,OAAOd,QAAQ,CACbc,OAAO,EACP,CAAC,6BAA6B,EAAE,uBAAuB,CAAC,EACxDF;EACA;EAAA,CACD;AACH"}
1
+ {"version":3,"names":["useHandler","useEvent","EVENT_TYPE","UNDETERMINED","FAILED","BEGAN","CANCELLED","ACTIVE","END","useAnimatedGestureHandler","handlers","dependencies","context","doDependenciesDiffer","useWeb","handler","e","event","nativeEvent","state","onStart","onActive","oldState","onEnd","onFail","onCancel","onFinish"],"sources":["useAnimatedGestureHandler.ts"],"sourcesContent":["'use strict';\nimport type {\n DependencyList,\n NativeEventWrapper,\n ReanimatedEvent,\n} from './commonTypes';\nimport { useHandler } from './useHandler';\nimport { useEvent } from './useEvent';\n\nconst EVENT_TYPE = {\n UNDETERMINED: 0,\n FAILED: 1,\n BEGAN: 2,\n CANCELLED: 3,\n ACTIVE: 4,\n END: 5,\n} as const;\n\ntype StateType = (typeof EVENT_TYPE)[keyof typeof EVENT_TYPE];\n\n// This type comes from React Native Gesture Handler\n// import type { PanGestureHandlerGestureEvent as DefaultEvent } from 'react-native-gesture-handler';\ntype DefaultEvent = {\n nativeEvent: {\n readonly handlerTag: number;\n readonly numberOfPointers: number;\n readonly state: (typeof EVENT_TYPE)[keyof typeof EVENT_TYPE];\n readonly x: number;\n readonly y: number;\n readonly absoluteX: number;\n readonly absoluteY: number;\n readonly translationX: number;\n readonly translationY: number;\n readonly velocityX: number;\n readonly velocityY: number;\n };\n};\n\ninterface PropsUsedInUseAnimatedGestureHandler {\n handlerTag?: number;\n numberOfPointers?: number;\n state?: StateType;\n oldState?: StateType;\n}\n\nexport type GestureHandlerEvent<Event extends object> =\n | ReanimatedEvent<Event>\n | Event;\n\ntype GestureHandler<\n Event extends NativeEventWrapper<PropsUsedInUseAnimatedGestureHandler>,\n Context extends Record<string, unknown>\n> = (\n eventPayload: ReanimatedEvent<Event>,\n context: Context,\n isCanceledOrFailed?: boolean\n) => void;\n\nexport interface GestureHandlers<\n Event extends NativeEventWrapper<PropsUsedInUseAnimatedGestureHandler>,\n Context extends Record<string, unknown>\n> {\n [key: string]: GestureHandler<Event, Context> | undefined;\n onStart?: GestureHandler<Event, Context>;\n onActive?: GestureHandler<Event, Context>;\n onEnd?: GestureHandler<Event, Context>;\n onFail?: GestureHandler<Event, Context>;\n onCancel?: GestureHandler<Event, Context>;\n onFinish?: GestureHandler<Event, Context>;\n}\n\n/**\n * @deprecated useAnimatedGestureHandler is an old API which is no longer supported.\n *\n * Please check https://docs.swmansion.com/react-native-gesture-handler/docs/guides/upgrading-to-2/\n * for information about how to migrate to `react-native-gesture-handler` v2\n */\nexport function useAnimatedGestureHandler<\n Event extends NativeEventWrapper<PropsUsedInUseAnimatedGestureHandler> = DefaultEvent,\n Context extends Record<string, unknown> = Record<string, unknown>\n>(handlers: GestureHandlers<Event, Context>, dependencies?: DependencyList) {\n type WebOrNativeEvent = Event | ReanimatedEvent<Event>;\n\n const { context, doDependenciesDiffer, useWeb } = useHandler<Event, Context>(\n handlers,\n dependencies\n );\n const handler = (e: WebOrNativeEvent) => {\n 'worklet';\n const event = useWeb\n ? // On Web we get events straight from React Native and they don't have\n // the `eventName` field there. To simplify the types here we just\n // cast it as the field was available.\n ((e as Event).nativeEvent as ReanimatedEvent<Event>)\n : (e as ReanimatedEvent<Event>);\n\n if (event.state === EVENT_TYPE.BEGAN && handlers.onStart) {\n handlers.onStart(event, context);\n }\n if (event.state === EVENT_TYPE.ACTIVE && handlers.onActive) {\n handlers.onActive(event, context);\n }\n if (\n event.oldState === EVENT_TYPE.ACTIVE &&\n event.state === EVENT_TYPE.END &&\n handlers.onEnd\n ) {\n handlers.onEnd(event, context);\n }\n if (\n event.oldState === EVENT_TYPE.BEGAN &&\n event.state === EVENT_TYPE.FAILED &&\n handlers.onFail\n ) {\n handlers.onFail(event, context);\n }\n if (\n event.oldState === EVENT_TYPE.ACTIVE &&\n event.state === EVENT_TYPE.CANCELLED &&\n handlers.onCancel\n ) {\n handlers.onCancel(event, context);\n }\n if (\n (event.oldState === EVENT_TYPE.BEGAN ||\n event.oldState === EVENT_TYPE.ACTIVE) &&\n event.state !== EVENT_TYPE.BEGAN &&\n event.state !== EVENT_TYPE.ACTIVE &&\n handlers.onFinish\n ) {\n handlers.onFinish(\n event,\n context,\n event.state === EVENT_TYPE.CANCELLED ||\n event.state === EVENT_TYPE.FAILED\n );\n }\n };\n\n if (useWeb) {\n return handler;\n }\n\n // eslint-disable-next-line react-hooks/rules-of-hooks\n return useEvent<Event>(\n handler,\n ['onGestureHandlerStateChange', 'onGestureHandlerEvent'],\n doDependenciesDiffer\n // This is not correct but we want to make GH think it receives a function.\n ) as unknown as (e: Event) => void;\n}\n"],"mappings":"AAAA,YAAY;;AAMZ,SAASA,UAAU,QAAQ,cAAc;AACzC,SAASC,QAAQ,QAAQ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EL,OAAO,CAAC;IACjC;IACA,IACEK,KAAK,CAACK,QAAQ,KAAKpB,UAAU,CAACK,MAAM,IACpCU,KAAK,CAACE,KAAK,KAAKjB,UAAU,CAACI,SAAS,IACpCI,QAAQ,CAACe,QAAQ,EACjB;MACAf,QAAQ,CAACe,QAAQ,CAACR,KAAK,EAAEL,OAAO,CAAC;IACnC;IACA,IACE,CAACK,KAAK,CAACK,QAAQ,KAAKpB,UAAU,CAACG,KAAK,IAClCY,KAAK,CAACK,QAAQ,KAAKpB,UAAU,CAACK,MAAM,KACtCU,KAAK,CAACE,KAAK,KAAKjB,UAAU,CAACG,KAAK,IAChCY,KAAK,CAACE,KAAK,KAAKjB,UAAU,CAACK,MAAM,IACjCG,QAAQ,CAACgB,QAAQ,EACjB;MACAhB,QAAQ,CAACgB,QAAQ,CACfT,KAAK,EACLL,OAAO,EACPK,KAAK,CAACE,KAAK,KAAKjB,UAAU,CAACI,SAAS,IAClCW,KAAK,CAACE,KAAK,KAAKjB,UAAU,CAACE,MAC/B,CAAC;IACH;EACF,CAAC;EAED,IAAIU,MAAM,EAAE;IACV,OAAOC,OAAO;EAChB;;EAEA;EACA,OAAOd,QAAQ,CACbc,OAAO,EACP,CAAC,6BAA6B,EAAE,uBAAuB,CAAC,EACxDF;EACA;EACF,CAAC;AACH","ignoreList":[]}
@@ -11,10 +11,9 @@ import { KeyboardState } from '../commonTypes';
11
11
  * @returns An object with the current keyboard `height` and `state` as [shared values](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#shared-value).
12
12
  * @see https://docs.swmansion.com/react-native-reanimated/docs/device/useAnimatedKeyboard
13
13
  */
14
- export function useAnimatedKeyboard() {
15
- let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
16
- isStatusBarTranslucentAndroid: false
17
- };
14
+ export function useAnimatedKeyboard(options = {
15
+ isStatusBarTranslucentAndroid: false
16
+ }) {
18
17
  const ref = useRef(null);
19
18
  const listenerId = useRef(-1);
20
19
  const isSubscribed = useRef(false);