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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (423) hide show
  1. package/Common/cpp/Fabric/ShadowTreeCloner.cpp +5 -2
  2. package/Common/cpp/LayoutAnimations/LayoutAnimationsManager.cpp +42 -32
  3. package/Common/cpp/LayoutAnimations/LayoutAnimationsManager.h +5 -7
  4. package/Common/cpp/LayoutAnimations/LayoutAnimationsProxy.cpp +565 -0
  5. package/Common/cpp/LayoutAnimations/LayoutAnimationsProxy.h +74 -0
  6. package/Common/cpp/LayoutAnimations/LayoutAnimationsUtils.h +140 -0
  7. package/Common/cpp/NativeModules/NativeReanimatedModule.cpp +216 -58
  8. package/Common/cpp/NativeModules/NativeReanimatedModule.h +32 -11
  9. package/Common/cpp/NativeModules/NativeReanimatedModuleSpec.cpp +2 -17
  10. package/Common/cpp/NativeModules/NativeReanimatedModuleSpec.h +6 -8
  11. package/Common/cpp/ReanimatedRuntime/RNRuntimeDecorator.cpp +3 -0
  12. package/Common/cpp/ReanimatedRuntime/WorkletRuntime.cpp +3 -4
  13. package/Common/cpp/ReanimatedRuntime/WorkletRuntimeDecorator.cpp +8 -3
  14. package/Common/cpp/SharedItems/Shareables.cpp +31 -5
  15. package/Common/cpp/SharedItems/Shareables.h +18 -2
  16. package/Common/cpp/Tools/JSScheduler.cpp +29 -5
  17. package/Common/cpp/Tools/JSScheduler.h +21 -4
  18. package/Common/cpp/Tools/PlatformDepMethodsHolder.h +6 -2
  19. package/Common/cpp/Tools/UIRuntimeDecorator.cpp +6 -0
  20. package/Common/cpp/Tools/UIRuntimeDecorator.h +1 -0
  21. package/android/CMakeLists.txt +3 -0
  22. package/android/build.gradle +17 -5
  23. package/android/src/main/cpp/NativeProxy.cpp +77 -12
  24. package/android/src/main/cpp/NativeProxy.h +35 -1
  25. package/android/src/main/java/com/swmansion/reanimated/NodesManager.java +58 -19
  26. package/android/src/main/java/com/swmansion/reanimated/ReanimatedPackage.java +7 -2
  27. package/android/src/{reactNativeVersionPatch/ReanimatedUIManager/latest → main/java}/com/swmansion/reanimated/ReanimatedUIManagerFactory.java +5 -5
  28. package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/AnimationsManager.java +10 -6
  29. package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/ReanimatedNativeHierarchyManager.java +18 -1
  30. package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/SharedTransitionManager.java +105 -17
  31. package/android/src/main/java/com/swmansion/reanimated/sensor/ReanimatedSensor.java +2 -1
  32. package/android/src/paper/java/com/swmansion/reanimated/NativeReanimatedModuleSpec.java +37 -0
  33. package/android/src/{main/java/com/swmansion/reanimated → reactNativeVersionPatch/ReanimatedUIManager/73/com/swmansion}/ReanimatedModule.java +4 -3
  34. package/android/src/reactNativeVersionPatch/ReanimatedUIManager/{70 → 73}/com/swmansion/reanimated/layoutReanimation/ReanimatedUIManager.java +1 -22
  35. package/android/src/reactNativeVersionPatch/ReanimatedUIManager/latest/com/swmansion/reanimated/ReanimatedModule.java +176 -0
  36. package/android/src/reactNativeVersionPatch/ReanimatedUIManager/latest/com/swmansion/reanimated/layoutReanimation/ReanimatedUIManager.java +0 -26
  37. package/android/src/{fabric/java → reactNativeVersionPatch/RuntimeExecutor/73}/com/swmansion/reanimated/NativeProxy.java +16 -4
  38. package/android/src/reactNativeVersionPatch/RuntimeExecutor/latest/com/swmansion/reanimated/NativeProxy.java +143 -0
  39. package/apple/LayoutReanimation/REAAnimationsManager.h +3 -0
  40. package/apple/LayoutReanimation/REAAnimationsManager.m +11 -0
  41. package/apple/LayoutReanimation/REASharedTransitionManager.m +99 -23
  42. package/apple/LayoutReanimation/REASnapshot.h +1 -0
  43. package/apple/LayoutReanimation/REASnapshot.m +78 -37
  44. package/apple/REAModule.h +22 -2
  45. package/apple/REAModule.mm +97 -46
  46. package/apple/REANodesManager.h +3 -3
  47. package/apple/REANodesManager.mm +46 -22
  48. package/apple/native/NativeProxy.h +28 -2
  49. package/apple/native/NativeProxy.mm +65 -195
  50. package/apple/native/PlatformDepMethodsHolderImpl.h +59 -0
  51. package/apple/native/PlatformDepMethodsHolderImpl.mm +429 -0
  52. package/apple/sensor/ReanimatedSensor.m +5 -5
  53. package/lib/module/Animated.js.map +1 -1
  54. package/lib/module/ConfigHelper.js +1 -1
  55. package/lib/module/ConfigHelper.js.map +1 -1
  56. package/lib/module/animationBuilder.js +1 -0
  57. package/lib/module/animationBuilder.js.map +1 -1
  58. package/lib/module/createAnimatedComponent/InlinePropManager.js +4 -4
  59. package/lib/module/createAnimatedComponent/InlinePropManager.js.map +1 -1
  60. package/lib/module/createAnimatedComponent/JSPropsUpdater.js +9 -6
  61. package/lib/module/createAnimatedComponent/JSPropsUpdater.js.map +1 -1
  62. package/lib/module/createAnimatedComponent/JSPropsUpdater.web.js +11 -0
  63. package/lib/module/createAnimatedComponent/JSPropsUpdater.web.js.map +1 -0
  64. package/lib/module/createAnimatedComponent/PropsFilter.js +25 -9
  65. package/lib/module/createAnimatedComponent/PropsFilter.js.map +1 -1
  66. package/lib/module/createAnimatedComponent/commonTypes.js.map +1 -1
  67. package/lib/module/createAnimatedComponent/createAnimatedComponent.js +83 -52
  68. package/lib/module/createAnimatedComponent/createAnimatedComponent.js.map +1 -1
  69. package/lib/module/createAnimatedComponent/getViewInfo.js +37 -0
  70. package/lib/module/createAnimatedComponent/getViewInfo.js.map +1 -0
  71. package/lib/module/createAnimatedComponent/index.js.map +1 -1
  72. package/lib/module/createAnimatedComponent/setAndForwardRef.js +4 -5
  73. package/lib/module/createAnimatedComponent/setAndForwardRef.js.map +1 -1
  74. package/lib/module/createAnimatedComponent/utils.js.map +1 -1
  75. package/lib/module/index.js.map +1 -1
  76. package/lib/module/index.web.js +1 -2
  77. package/lib/module/index.web.js.map +1 -1
  78. package/lib/module/mock.js +12 -12
  79. package/lib/module/mock.js.map +1 -1
  80. package/lib/module/propsAllowlists.js.map +1 -1
  81. package/lib/module/reanimated2/Bezier.js.map +1 -1
  82. package/lib/module/reanimated2/Colors.js +4 -11
  83. package/lib/module/reanimated2/Colors.js.map +1 -1
  84. package/lib/module/reanimated2/Easing.js +3 -7
  85. package/lib/module/reanimated2/Easing.js.map +1 -1
  86. package/lib/module/reanimated2/NativeReanimated/NativeReanimated.js +16 -13
  87. package/lib/module/reanimated2/NativeReanimated/NativeReanimated.js.map +1 -1
  88. package/lib/module/reanimated2/NativeReanimated/index.js.map +1 -1
  89. package/lib/module/reanimated2/NativeReanimated/index.web.js.map +1 -1
  90. package/lib/module/reanimated2/PlatformChecker.js +2 -1
  91. package/lib/module/reanimated2/PlatformChecker.js.map +1 -1
  92. package/lib/module/reanimated2/PropAdapters.js +1 -1
  93. package/lib/module/reanimated2/PropAdapters.js.map +1 -1
  94. package/lib/module/reanimated2/PropsRegistry.js +1 -2
  95. package/lib/module/reanimated2/PropsRegistry.js.map +1 -1
  96. package/lib/module/reanimated2/Sensor.js +2 -2
  97. package/lib/module/reanimated2/Sensor.js.map +1 -1
  98. package/lib/module/reanimated2/SensorContainer.js +2 -2
  99. package/lib/module/reanimated2/SensorContainer.js.map +1 -1
  100. package/lib/module/reanimated2/UpdateLayoutAnimations.js +30 -8
  101. package/lib/module/reanimated2/UpdateLayoutAnimations.js.map +1 -1
  102. package/lib/module/reanimated2/UpdateProps.js.map +1 -1
  103. package/lib/module/reanimated2/ViewDescriptorsSet.js.map +1 -1
  104. package/lib/module/reanimated2/WorkletEventHandler.js +74 -31
  105. package/lib/module/reanimated2/WorkletEventHandler.js.map +1 -1
  106. package/lib/module/reanimated2/animation/clamp.js.map +1 -1
  107. package/lib/module/reanimated2/animation/commonTypes.js.map +1 -1
  108. package/lib/module/reanimated2/animation/decay/decay.js.map +1 -1
  109. package/lib/module/reanimated2/animation/decay/index.js.map +1 -1
  110. package/lib/module/reanimated2/animation/decay/rigidDecay.js.map +1 -1
  111. package/lib/module/reanimated2/animation/decay/rubberBandDecay.js.map +1 -1
  112. package/lib/module/reanimated2/animation/decay/utils.js.map +1 -1
  113. package/lib/module/reanimated2/animation/delay.js.map +1 -1
  114. package/lib/module/reanimated2/animation/index.js.map +1 -1
  115. package/lib/module/reanimated2/animation/repeat.js +1 -6
  116. package/lib/module/reanimated2/animation/repeat.js.map +1 -1
  117. package/lib/module/reanimated2/animation/sequence.js +1 -5
  118. package/lib/module/reanimated2/animation/sequence.js.map +1 -1
  119. package/lib/module/reanimated2/animation/spring.js.map +1 -1
  120. package/lib/module/reanimated2/animation/springUtils.js +8 -10
  121. package/lib/module/reanimated2/animation/springUtils.js.map +1 -1
  122. package/lib/module/reanimated2/animation/styleAnimation.js +5 -4
  123. package/lib/module/reanimated2/animation/styleAnimation.js.map +1 -1
  124. package/lib/module/reanimated2/animation/timing.js +4 -1
  125. package/lib/module/reanimated2/animation/timing.js.map +1 -1
  126. package/lib/module/reanimated2/animation/transformationMatrix/matrixUtils.js +1 -2
  127. package/lib/module/reanimated2/animation/transformationMatrix/matrixUtils.js.map +1 -1
  128. package/lib/module/reanimated2/animation/util.js +22 -2
  129. package/lib/module/reanimated2/animation/util.js.map +1 -1
  130. package/lib/module/reanimated2/commonTypes.js +3 -1
  131. package/lib/module/reanimated2/commonTypes.js.map +1 -1
  132. package/lib/module/reanimated2/component/FlatList.js +1 -0
  133. package/lib/module/reanimated2/component/FlatList.js.map +1 -1
  134. package/lib/module/reanimated2/component/Image.js +1 -0
  135. package/lib/module/reanimated2/component/Image.js.map +1 -1
  136. package/lib/module/reanimated2/component/LayoutAnimationConfig.js +1 -0
  137. package/lib/module/reanimated2/component/LayoutAnimationConfig.js.map +1 -1
  138. package/lib/module/reanimated2/component/PerformanceMonitor.js +169 -0
  139. package/lib/module/reanimated2/component/PerformanceMonitor.js.map +1 -0
  140. package/lib/module/reanimated2/component/ScrollView.js +1 -0
  141. package/lib/module/reanimated2/component/ScrollView.js.map +1 -1
  142. package/lib/module/reanimated2/component/Text.js +1 -0
  143. package/lib/module/reanimated2/component/Text.js.map +1 -1
  144. package/lib/module/reanimated2/component/View.js +1 -0
  145. package/lib/module/reanimated2/component/View.js.map +1 -1
  146. package/lib/module/reanimated2/core.js +6 -15
  147. package/lib/module/reanimated2/core.js.map +1 -1
  148. package/lib/module/reanimated2/errors.js +8 -8
  149. package/lib/module/reanimated2/errors.js.map +1 -1
  150. package/lib/module/reanimated2/fabricUtils.js +33 -8
  151. package/lib/module/reanimated2/fabricUtils.js.map +1 -1
  152. package/lib/module/reanimated2/fabricUtils.web.js.map +1 -1
  153. package/lib/module/reanimated2/frameCallback/FrameCallbackRegistryJS.js +2 -2
  154. package/lib/module/reanimated2/frameCallback/FrameCallbackRegistryJS.js.map +1 -1
  155. package/lib/module/reanimated2/frameCallback/FrameCallbackRegistryUI.js.map +1 -1
  156. package/lib/module/reanimated2/frameCallback/index.js.map +1 -1
  157. package/lib/module/reanimated2/globals.d.js.map +1 -1
  158. package/lib/module/reanimated2/helperTypes.js.map +1 -1
  159. package/lib/module/reanimated2/hook/commonTypes.js.map +1 -1
  160. package/lib/module/reanimated2/hook/index.js.map +1 -1
  161. package/lib/module/reanimated2/hook/useAnimatedGestureHandler.js +1 -0
  162. package/lib/module/reanimated2/hook/useAnimatedGestureHandler.js.map +1 -1
  163. package/lib/module/reanimated2/hook/useAnimatedKeyboard.js +3 -4
  164. package/lib/module/reanimated2/hook/useAnimatedKeyboard.js.map +1 -1
  165. package/lib/module/reanimated2/hook/useAnimatedProps.js.map +1 -1
  166. package/lib/module/reanimated2/hook/useAnimatedReaction.js +1 -0
  167. package/lib/module/reanimated2/hook/useAnimatedReaction.js.map +1 -1
  168. package/lib/module/reanimated2/hook/useAnimatedRef.js +12 -7
  169. package/lib/module/reanimated2/hook/useAnimatedRef.js.map +1 -1
  170. package/lib/module/reanimated2/hook/useAnimatedScrollHandler.js +3 -1
  171. package/lib/module/reanimated2/hook/useAnimatedScrollHandler.js.map +1 -1
  172. package/lib/module/reanimated2/hook/useAnimatedSensor.js.map +1 -1
  173. package/lib/module/reanimated2/hook/useAnimatedStyle.js +3 -6
  174. package/lib/module/reanimated2/hook/useAnimatedStyle.js.map +1 -1
  175. package/lib/module/reanimated2/hook/useDerivedValue.js +3 -1
  176. package/lib/module/reanimated2/hook/useDerivedValue.js.map +1 -1
  177. package/lib/module/reanimated2/hook/useEvent.js +4 -5
  178. package/lib/module/reanimated2/hook/useEvent.js.map +1 -1
  179. package/lib/module/reanimated2/hook/useFrameCallback.js +1 -2
  180. package/lib/module/reanimated2/hook/useFrameCallback.js.map +1 -1
  181. package/lib/module/reanimated2/hook/useHandler.js +3 -1
  182. package/lib/module/reanimated2/hook/useHandler.js.map +1 -1
  183. package/lib/module/reanimated2/hook/useReducedMotion.js.map +1 -1
  184. package/lib/module/reanimated2/hook/useScrollViewOffset.js +60 -16
  185. package/lib/module/reanimated2/hook/useScrollViewOffset.js.map +1 -1
  186. package/lib/module/reanimated2/hook/useSharedValue.js.map +1 -1
  187. package/lib/module/reanimated2/hook/useWorkletCallback.js.map +1 -1
  188. package/lib/module/reanimated2/hook/utils.js.map +1 -1
  189. package/lib/module/reanimated2/index.js +2 -0
  190. package/lib/module/reanimated2/index.js.map +1 -1
  191. package/lib/module/reanimated2/initializers.js +1 -5
  192. package/lib/module/reanimated2/initializers.js.map +1 -1
  193. package/lib/module/reanimated2/interpolateColor.js +2 -6
  194. package/lib/module/reanimated2/interpolateColor.js.map +1 -1
  195. package/lib/module/reanimated2/interpolation.js +1 -1
  196. package/lib/module/reanimated2/interpolation.js.map +1 -1
  197. package/lib/module/reanimated2/isSharedValue.js.map +1 -1
  198. package/lib/module/reanimated2/jestUtils.js +3 -6
  199. package/lib/module/reanimated2/jestUtils.js.map +1 -1
  200. package/lib/module/reanimated2/jestUtils.web.js.map +1 -1
  201. package/lib/module/reanimated2/js-reanimated/JSReanimated.js +5 -9
  202. package/lib/module/reanimated2/js-reanimated/JSReanimated.js.map +1 -1
  203. package/lib/module/reanimated2/js-reanimated/WebSensor.js.map +1 -1
  204. package/lib/module/reanimated2/js-reanimated/index.js +2 -2
  205. package/lib/module/reanimated2/js-reanimated/index.js.map +1 -1
  206. package/lib/module/reanimated2/js-reanimated/react-native-web.d.js.map +1 -1
  207. package/lib/module/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.js +4 -2
  208. package/lib/module/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.js.map +1 -1
  209. package/lib/module/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.js +12 -11
  210. package/lib/module/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.js.map +1 -1
  211. package/lib/module/reanimated2/layoutReanimation/animationBuilder/Keyframe.js +12 -10
  212. package/lib/module/reanimated2/layoutReanimation/animationBuilder/Keyframe.js.map +1 -1
  213. package/lib/module/reanimated2/layoutReanimation/animationBuilder/commonTypes.js.map +1 -1
  214. package/lib/module/reanimated2/layoutReanimation/animationBuilder/index.js.map +1 -1
  215. package/lib/module/reanimated2/layoutReanimation/animationsManager.js +11 -4
  216. package/lib/module/reanimated2/layoutReanimation/animationsManager.js.map +1 -1
  217. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Bounce.js +22 -22
  218. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Bounce.js.map +1 -1
  219. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Fade.js +22 -22
  220. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Fade.js.map +1 -1
  221. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Flip.js +26 -26
  222. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Flip.js.map +1 -1
  223. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.js +10 -10
  224. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.js.map +1 -1
  225. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.js +6 -6
  226. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.js.map +1 -1
  227. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Roll.js +10 -10
  228. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Roll.js.map +1 -1
  229. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Rotate.js +18 -18
  230. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Rotate.js.map +1 -1
  231. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Slide.js +18 -18
  232. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Slide.js.map +1 -1
  233. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Stretch.js +10 -10
  234. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Stretch.js.map +1 -1
  235. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Zoom.js +34 -34
  236. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Zoom.js.map +1 -1
  237. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/index.js.map +1 -1
  238. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.js +17 -4
  239. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.js.map +1 -1
  240. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.js +4 -4
  241. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.js.map +1 -1
  242. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.js +4 -4
  243. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.js.map +1 -1
  244. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.js +4 -4
  245. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.js.map +1 -1
  246. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.js +4 -4
  247. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.js.map +1 -1
  248. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.js +4 -4
  249. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.js.map +1 -1
  250. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/index.js.map +1 -1
  251. package/lib/module/reanimated2/layoutReanimation/index.js.map +1 -1
  252. package/lib/module/reanimated2/layoutReanimation/sharedTransitions/ProgressTransitionManager.js +16 -12
  253. package/lib/module/reanimated2/layoutReanimation/sharedTransitions/ProgressTransitionManager.js.map +1 -1
  254. package/lib/module/reanimated2/layoutReanimation/sharedTransitions/SharedTransition.js +13 -7
  255. package/lib/module/reanimated2/layoutReanimation/sharedTransitions/SharedTransition.js.map +1 -1
  256. package/lib/module/reanimated2/layoutReanimation/sharedTransitions/SharedTransition.web.js.map +1 -1
  257. package/lib/module/reanimated2/layoutReanimation/sharedTransitions/index.js.map +1 -1
  258. package/lib/module/reanimated2/layoutReanimation/web/animation/Bounce.web.js.map +1 -1
  259. package/lib/module/reanimated2/layoutReanimation/web/animation/Fade.web.js.map +1 -1
  260. package/lib/module/reanimated2/layoutReanimation/web/animation/Flip.web.js.map +1 -1
  261. package/lib/module/reanimated2/layoutReanimation/web/animation/Lightspeed.web.js.map +1 -1
  262. package/lib/module/reanimated2/layoutReanimation/web/animation/Pinwheel.web.js.map +1 -1
  263. package/lib/module/reanimated2/layoutReanimation/web/animation/Roll.web.js.map +1 -1
  264. package/lib/module/reanimated2/layoutReanimation/web/animation/Rotate.web.js.map +1 -1
  265. package/lib/module/reanimated2/layoutReanimation/web/animation/Slide.web.js.map +1 -1
  266. package/lib/module/reanimated2/layoutReanimation/web/animation/Stretch.web.js.map +1 -1
  267. package/lib/module/reanimated2/layoutReanimation/web/animation/Zoom.web.js.map +1 -1
  268. package/lib/module/reanimated2/layoutReanimation/web/animationParser.js +0 -2
  269. package/lib/module/reanimated2/layoutReanimation/web/animationParser.js.map +1 -1
  270. package/lib/module/reanimated2/layoutReanimation/web/animationsManager.js +1 -2
  271. package/lib/module/reanimated2/layoutReanimation/web/animationsManager.js.map +1 -1
  272. package/lib/module/reanimated2/layoutReanimation/web/componentStyle.js +3 -1
  273. package/lib/module/reanimated2/layoutReanimation/web/componentStyle.js.map +1 -1
  274. package/lib/module/reanimated2/layoutReanimation/web/componentUtils.js +6 -7
  275. package/lib/module/reanimated2/layoutReanimation/web/componentUtils.js.map +1 -1
  276. package/lib/module/reanimated2/layoutReanimation/web/config.js.map +1 -1
  277. package/lib/module/reanimated2/layoutReanimation/web/createAnimation.js +2 -2
  278. package/lib/module/reanimated2/layoutReanimation/web/createAnimation.js.map +1 -1
  279. package/lib/module/reanimated2/layoutReanimation/web/domUtils.js +4 -4
  280. package/lib/module/reanimated2/layoutReanimation/web/domUtils.js.map +1 -1
  281. package/lib/module/reanimated2/layoutReanimation/web/index.js.map +1 -1
  282. package/lib/module/reanimated2/layoutReanimation/web/transition/Fading.web.js.map +1 -1
  283. package/lib/module/reanimated2/layoutReanimation/web/transition/Linear.web.js.map +1 -1
  284. package/lib/module/reanimated2/layoutReanimation/web/transition/Sequenced.web.js.map +1 -1
  285. package/lib/module/reanimated2/mappers.js +2 -4
  286. package/lib/module/reanimated2/mappers.js.map +1 -1
  287. package/lib/module/reanimated2/mockedRequestAnimationFrame.js.map +1 -1
  288. package/lib/module/reanimated2/mutables.js +2 -4
  289. package/lib/module/reanimated2/mutables.js.map +1 -1
  290. package/lib/module/reanimated2/platform-specific/RNRenderer.js.map +1 -1
  291. package/lib/module/reanimated2/platform-specific/RNRenderer.web.js.map +1 -1
  292. package/lib/module/reanimated2/platform-specific/checkCppVersion.js.map +1 -1
  293. package/lib/module/reanimated2/platform-specific/jsVersion.js +1 -1
  294. package/lib/module/reanimated2/platform-specific/jsVersion.js.map +1 -1
  295. package/lib/module/reanimated2/platformFunctions/dispatchCommand.js +2 -4
  296. package/lib/module/reanimated2/platformFunctions/dispatchCommand.js.map +1 -1
  297. package/lib/module/reanimated2/platformFunctions/dispatchCommand.web.js.map +1 -1
  298. package/lib/module/reanimated2/platformFunctions/getRelativeCoords.js +2 -2
  299. package/lib/module/reanimated2/platformFunctions/getRelativeCoords.js.map +1 -1
  300. package/lib/module/reanimated2/platformFunctions/index.js.map +1 -1
  301. package/lib/module/reanimated2/platformFunctions/measure.js.map +1 -1
  302. package/lib/module/reanimated2/platformFunctions/measure.web.js.map +1 -1
  303. package/lib/module/reanimated2/platformFunctions/scrollTo.js.map +1 -1
  304. package/lib/module/reanimated2/platformFunctions/scrollTo.web.js +1 -1
  305. package/lib/module/reanimated2/platformFunctions/scrollTo.web.js.map +1 -1
  306. package/lib/module/reanimated2/platformFunctions/setGestureState.js.map +1 -1
  307. package/lib/module/reanimated2/platformFunctions/setGestureState.web.js.map +1 -1
  308. package/lib/module/reanimated2/platformFunctions/setNativeProps.js.map +1 -1
  309. package/lib/module/reanimated2/platformFunctions/setNativeProps.web.js.map +1 -1
  310. package/lib/module/reanimated2/pluginUtils.js.map +1 -1
  311. package/lib/module/reanimated2/publicGlobals.js.map +1 -1
  312. package/lib/module/reanimated2/runtimes.js +11 -19
  313. package/lib/module/reanimated2/runtimes.js.map +1 -1
  314. package/lib/module/reanimated2/screenTransition/RNScreensTurboModule.js +20 -0
  315. package/lib/module/reanimated2/screenTransition/RNScreensTurboModule.js.map +1 -0
  316. package/lib/module/reanimated2/screenTransition/animationManager.js +41 -0
  317. package/lib/module/reanimated2/screenTransition/animationManager.js.map +1 -0
  318. package/lib/module/reanimated2/screenTransition/commonTypes.js +4 -0
  319. package/lib/module/reanimated2/screenTransition/commonTypes.js.map +1 -0
  320. package/lib/module/reanimated2/screenTransition/index.js +5 -0
  321. package/lib/module/reanimated2/screenTransition/index.js.map +1 -0
  322. package/lib/module/reanimated2/screenTransition/presets.js +157 -0
  323. package/lib/module/reanimated2/screenTransition/presets.js.map +1 -0
  324. package/lib/module/reanimated2/screenTransition/styleUpdater.js +62 -0
  325. package/lib/module/reanimated2/screenTransition/styleUpdater.js.map +1 -0
  326. package/lib/module/reanimated2/screenTransition/swipeSimulator.js +190 -0
  327. package/lib/module/reanimated2/screenTransition/swipeSimulator.js.map +1 -0
  328. package/lib/module/reanimated2/shareableMappingCache.js.map +1 -1
  329. package/lib/module/reanimated2/shareables.js +27 -10
  330. package/lib/module/reanimated2/shareables.js.map +1 -1
  331. package/lib/module/reanimated2/threads.js +9 -34
  332. package/lib/module/reanimated2/threads.js.map +1 -1
  333. package/lib/module/reanimated2/valueSetter.js +1 -2
  334. package/lib/module/reanimated2/valueSetter.js.map +1 -1
  335. package/lib/module/reanimated2/valueUnpacker.js +4 -3
  336. package/lib/module/reanimated2/valueUnpacker.js.map +1 -1
  337. package/lib/module/specs/NativeReanimatedModule.js +5 -0
  338. package/lib/module/specs/NativeReanimatedModule.js.map +1 -0
  339. package/lib/typescript/ConfigHelper.d.ts +1 -0
  340. package/lib/typescript/createAnimatedComponent/InlinePropManager.d.ts +1 -1
  341. package/lib/typescript/createAnimatedComponent/JSPropsUpdater.web.d.ts +6 -0
  342. package/lib/typescript/createAnimatedComponent/PropsFilter.d.ts +3 -0
  343. package/lib/typescript/createAnimatedComponent/getViewInfo.d.ts +9 -0
  344. package/lib/typescript/reanimated2/NativeReanimated/NativeReanimated.d.ts +8 -13
  345. package/lib/typescript/reanimated2/UpdateLayoutAnimations.d.ts +12 -1
  346. package/lib/typescript/reanimated2/WorkletEventHandler.d.ts +16 -9
  347. package/lib/typescript/reanimated2/animation/util.d.ts +2 -0
  348. package/lib/typescript/reanimated2/component/LayoutAnimationConfig.d.ts +1 -1
  349. package/lib/typescript/reanimated2/component/PerformanceMonitor.d.ts +2 -0
  350. package/lib/typescript/reanimated2/core.d.ts +3 -4
  351. package/lib/typescript/reanimated2/hook/commonTypes.d.ts +6 -0
  352. package/lib/typescript/reanimated2/hook/useEvent.d.ts +2 -3
  353. package/lib/typescript/reanimated2/hook/useScrollViewOffset.d.ts +3 -1
  354. package/lib/typescript/reanimated2/index.d.ts +3 -0
  355. package/lib/typescript/reanimated2/js-reanimated/JSReanimated.d.ts +2 -2
  356. package/lib/typescript/reanimated2/layoutReanimation/animationBuilder/commonTypes.d.ts +2 -1
  357. package/lib/typescript/reanimated2/layoutReanimation/sharedTransitions/ProgressTransitionManager.d.ts +2 -2
  358. package/lib/typescript/reanimated2/layoutReanimation/sharedTransitions/SharedTransition.d.ts +2 -2
  359. package/lib/typescript/reanimated2/platform-specific/jsVersion.d.ts +1 -1
  360. package/lib/typescript/reanimated2/screenTransition/RNScreensTurboModule.d.ts +2 -0
  361. package/lib/typescript/reanimated2/screenTransition/animationManager.d.ts +3 -0
  362. package/lib/typescript/reanimated2/screenTransition/commonTypes.d.ts +38 -0
  363. package/lib/typescript/reanimated2/screenTransition/index.d.ts +3 -0
  364. package/lib/typescript/reanimated2/screenTransition/presets.d.ts +11 -0
  365. package/lib/typescript/reanimated2/screenTransition/styleUpdater.d.ts +3 -0
  366. package/lib/typescript/reanimated2/screenTransition/swipeSimulator.d.ts +2 -0
  367. package/lib/typescript/specs/NativeReanimatedModule.d.ts +6 -0
  368. package/package.json +29 -17
  369. package/plugin/build/plugin.js +7 -2
  370. package/src/ConfigHelper.ts +1 -1
  371. package/src/animationBuilder.tsx +2 -0
  372. package/src/createAnimatedComponent/InlinePropManager.ts +2 -2
  373. package/src/createAnimatedComponent/JSPropsUpdater.ts +7 -6
  374. package/src/createAnimatedComponent/JSPropsUpdater.web.ts +26 -0
  375. package/src/createAnimatedComponent/PropsFilter.tsx +31 -6
  376. package/src/createAnimatedComponent/createAnimatedComponent.tsx +108 -60
  377. package/src/createAnimatedComponent/getViewInfo.ts +39 -0
  378. package/src/mock.ts +13 -1
  379. package/src/reanimated2/NativeReanimated/NativeReanimated.ts +33 -35
  380. package/src/reanimated2/PlatformChecker.ts +3 -2
  381. package/src/reanimated2/PropsRegistry.ts +1 -3
  382. package/src/reanimated2/UpdateLayoutAnimations.ts +53 -13
  383. package/src/reanimated2/WorkletEventHandler.ts +98 -39
  384. package/src/reanimated2/animation/styleAnimation.ts +8 -6
  385. package/src/reanimated2/animation/timing.ts +9 -1
  386. package/src/reanimated2/animation/util.ts +28 -3
  387. package/src/reanimated2/commonTypes.ts +4 -1
  388. package/src/reanimated2/component/PerformanceMonitor.tsx +216 -0
  389. package/src/reanimated2/core.ts +9 -31
  390. package/src/reanimated2/errors.ts +1 -0
  391. package/src/reanimated2/fabricUtils.ts +43 -18
  392. package/src/reanimated2/globals.d.ts +11 -1
  393. package/src/reanimated2/hook/commonTypes.ts +10 -0
  394. package/src/reanimated2/hook/useAnimatedRef.ts +20 -11
  395. package/src/reanimated2/hook/useEvent.ts +4 -4
  396. package/src/reanimated2/hook/useScrollViewOffset.ts +94 -23
  397. package/src/reanimated2/index.ts +11 -0
  398. package/src/reanimated2/js-reanimated/JSReanimated.ts +7 -7
  399. package/src/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.ts +4 -0
  400. package/src/reanimated2/layoutReanimation/animationBuilder/Keyframe.ts +9 -1
  401. package/src/reanimated2/layoutReanimation/animationBuilder/commonTypes.ts +9 -1
  402. package/src/reanimated2/layoutReanimation/animationsManager.ts +10 -2
  403. package/src/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.ts +13 -0
  404. package/src/reanimated2/layoutReanimation/sharedTransitions/ProgressTransitionManager.ts +17 -8
  405. package/src/reanimated2/layoutReanimation/sharedTransitions/SharedTransition.ts +26 -7
  406. package/src/reanimated2/layoutReanimation/web/animationsManager.ts +1 -1
  407. package/src/reanimated2/layoutReanimation/web/componentStyle.ts +3 -1
  408. package/src/reanimated2/layoutReanimation/web/componentUtils.ts +1 -1
  409. package/src/reanimated2/layoutReanimation/web/createAnimation.ts +2 -2
  410. package/src/reanimated2/platform-specific/jsVersion.ts +1 -1
  411. package/src/reanimated2/platformFunctions/getRelativeCoords.ts +2 -2
  412. package/src/reanimated2/screenTransition/RNScreensTurboModule.ts +29 -0
  413. package/src/reanimated2/screenTransition/animationManager.ts +45 -0
  414. package/src/reanimated2/screenTransition/commonTypes.ts +63 -0
  415. package/src/reanimated2/screenTransition/index.ts +12 -0
  416. package/src/reanimated2/screenTransition/presets.ts +137 -0
  417. package/src/reanimated2/screenTransition/styleUpdater.ts +73 -0
  418. package/src/reanimated2/screenTransition/swipeSimulator.ts +238 -0
  419. package/src/reanimated2/shareables.ts +29 -6
  420. package/src/reanimated2/valueUnpacker.ts +10 -3
  421. package/src/specs/NativeReanimatedModule.ts +9 -0
  422. package/android/src/reactNativeVersionPatch/ReanimatedUIManager/70/com/swmansion/reanimated/ReanimatedUIManagerFactory.java +0 -16
  423. package/android/src/reactNativeVersionPatch/messageQueueThread/67/com/swmansion/reanimated/ReanimatedMessageQueueThread.java +0 -12
@@ -1 +1 @@
1
- {"version":3,"names":["isColor","convertToRGBA","rgbaArrayToRGBAColor","toGammaSpace","toLinearSpace","ReduceMotion","flatten","multiplyMatrices","scaleMatrix","addMatrices","decomposeMatrixIntoMatricesAndAngles","isAffineMatrixFlat","subtractMatrices","getRotationMatrix","isReducedMotion","shouldBeUseWeb","IN_STYLE_UPDATER","IS_REDUCED_MOTION","__DEV__","console","warn","initialUpdaterRun","updater","result","recognizePrefixSuffix","value","match","Error","prefix","suffix","number","strippedValue","parseFloat","getReduceMotionFromConfig","config","System","Always","getReduceMotionForAnimation","undefined","applyProgressToMatrix","progress","a","b","applyProgressToNumber","decorateAnimation","animation","baseOnStart","onStart","baseOnFrame","onFrame","isHigherOrder","timestamp","previousAnimation","reduceMotion","animationCopy","Object","assign","callback","prefNumberSuffOnStart","__prefix","__suffix","strippedCurrent","strippedToValue","toValue","current","startValue","paPrefix","paSuffix","paStrippedValue","prefNumberSuffOnFrame","res","tab","colorOnStart","RGBAValue","RGBACurrent","RGBAToValue","forEach","i","index","push","colorOnFrame","finished","transformationMatrixOnStart","startMatrices","stopMatrices","transformationMatrixOnFrame","transforms","mappedTransforms","key","_","currentTranslation","currentScale","skewMatrix","rotations","mappedRotations","angle","rotationMatrixX","rotationMatrixY","rotationMatrixZ","rotationMatrix","updated","arrayOnStart","v","arrayOnFrame","objectOnStart","objectOnFrame","newObject","startTime","Array","isArray","SHOULD_BE_USE_WEB","defineAnimation","starting","factory","create","_WORKLET","cancelAnimation","sharedValue"],"sources":["util.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-shadow */\n'use strict';\nimport type { HigherOrderAnimation, StyleLayoutAnimation } from './commonTypes';\nimport type { ParsedColorArray } from '../Colors';\nimport {\n isColor,\n convertToRGBA,\n rgbaArrayToRGBAColor,\n toGammaSpace,\n toLinearSpace,\n} from '../Colors';\nimport { ReduceMotion } from '../commonTypes';\nimport type {\n SharedValue,\n AnimatableValue,\n Animation,\n AnimationObject,\n Timestamp,\n AnimatableValueObject,\n} from '../commonTypes';\nimport type {\n AffineMatrixFlat,\n AffineMatrix,\n} from './transformationMatrix/matrixUtils';\nimport {\n flatten,\n multiplyMatrices,\n scaleMatrix,\n addMatrices,\n decomposeMatrixIntoMatricesAndAngles,\n isAffineMatrixFlat,\n subtractMatrices,\n getRotationMatrix,\n} from './transformationMatrix/matrixUtils';\nimport { isReducedMotion, shouldBeUseWeb } from '../PlatformChecker';\n\nlet IN_STYLE_UPDATER = false;\nconst IS_REDUCED_MOTION = isReducedMotion();\n\nif (__DEV__ && IS_REDUCED_MOTION) {\n console.warn(\n `[Reanimated] Reduced motion setting is enabled on this device. This warning is visible only in the development mode. Some animations will be disabled by default. You can override the behavior for individual animations, see https://docs.swmansion.com/react-native-reanimated/docs/guides/troubleshooting#reduced-motion-setting-is-enabled-on-this-device.`\n );\n}\n\nexport function initialUpdaterRun<T>(updater: () => T) {\n IN_STYLE_UPDATER = true;\n const result = updater();\n IN_STYLE_UPDATER = false;\n return result;\n}\n\ninterface RecognizedPrefixSuffix {\n prefix?: string;\n suffix?: string;\n strippedValue: number;\n}\n\nexport function recognizePrefixSuffix(\n value: string | number\n): RecognizedPrefixSuffix {\n 'worklet';\n if (typeof value === 'string') {\n const match = value.match(\n /([A-Za-z]*)(-?\\d*\\.?\\d*)([eE][-+]?[0-9]+)?([A-Za-z%]*)/\n );\n if (!match) {\n throw new Error(\"[Reanimated] Couldn't parse animation value.\");\n }\n const prefix = match[1];\n const suffix = match[4];\n // number with scientific notation\n const number = match[2] + (match[3] ?? '');\n return { prefix, suffix, strippedValue: parseFloat(number) };\n } else {\n return { strippedValue: value };\n }\n}\n\n/**\n * Returns whether the motion should be reduced for a specified config.\n * By default returns the system setting.\n */\nexport function getReduceMotionFromConfig(config?: ReduceMotion) {\n 'worklet';\n return !config || config === ReduceMotion.System\n ? IS_REDUCED_MOTION\n : config === ReduceMotion.Always;\n}\n\n/**\n * Returns the value that should be assigned to `animation.reduceMotion`\n * for a given config. If the config is not defined, `undefined` is returned.\n */\nexport function getReduceMotionForAnimation(config?: ReduceMotion) {\n 'worklet';\n // if the config is not defined, we want `reduceMotion` to be undefined,\n // so the parent animation knows if it should overwrite it\n if (!config) {\n return undefined;\n }\n\n return getReduceMotionFromConfig(config);\n}\n\nfunction applyProgressToMatrix(\n progress: number,\n a: AffineMatrix,\n b: AffineMatrix\n) {\n 'worklet';\n return addMatrices(a, scaleMatrix(subtractMatrices(b, a), progress));\n}\n\nfunction applyProgressToNumber(progress: number, a: number, b: number) {\n 'worklet';\n return a + progress * (b - a);\n}\n\nfunction decorateAnimation<T extends AnimationObject | StyleLayoutAnimation>(\n animation: T\n): void {\n 'worklet';\n const baseOnStart = (animation as Animation<AnimationObject>).onStart;\n const baseOnFrame = (animation as Animation<AnimationObject>).onFrame;\n\n if ((animation as HigherOrderAnimation).isHigherOrder) {\n animation.onStart = (\n animation: Animation<AnimationObject>,\n value: number,\n timestamp: Timestamp,\n previousAnimation: Animation<AnimationObject>\n ) => {\n if (animation.reduceMotion === undefined) {\n animation.reduceMotion = getReduceMotionFromConfig();\n }\n return baseOnStart(animation, value, timestamp, previousAnimation);\n };\n return;\n }\n\n const animationCopy = Object.assign({}, animation);\n delete animationCopy.callback;\n\n const prefNumberSuffOnStart = (\n animation: Animation<AnimationObject>,\n value: string | number,\n timestamp: number,\n previousAnimation: Animation<AnimationObject>\n ) => {\n // recognize prefix, suffix, and updates stripped value on animation start\n const { prefix, suffix, strippedValue } = recognizePrefixSuffix(value);\n animation.__prefix = prefix;\n animation.__suffix = suffix;\n animation.strippedCurrent = strippedValue;\n const { strippedValue: strippedToValue } = recognizePrefixSuffix(\n animation.toValue as string | number\n );\n animation.current = strippedValue;\n animation.startValue = strippedValue;\n animation.toValue = strippedToValue;\n if (previousAnimation && previousAnimation !== animation) {\n const {\n prefix: paPrefix,\n suffix: paSuffix,\n strippedValue: paStrippedValue,\n } = recognizePrefixSuffix(previousAnimation.current as string | number);\n previousAnimation.current = paStrippedValue;\n previousAnimation.__prefix = paPrefix;\n previousAnimation.__suffix = paSuffix;\n }\n\n baseOnStart(animation, strippedValue, timestamp, previousAnimation);\n\n animation.current =\n (animation.__prefix ?? '') +\n animation.current +\n (animation.__suffix ?? '');\n\n if (previousAnimation && previousAnimation !== animation) {\n previousAnimation.current =\n (previousAnimation.__prefix ?? '') +\n // FIXME\n // eslint-disable-next-line @typescript-eslint/restrict-plus-operands\n previousAnimation.current +\n (previousAnimation.__suffix ?? '');\n }\n };\n const prefNumberSuffOnFrame = (\n animation: Animation<AnimationObject>,\n timestamp: number\n ) => {\n animation.current = animation.strippedCurrent;\n const res = baseOnFrame(animation, timestamp);\n animation.strippedCurrent = animation.current;\n animation.current =\n (animation.__prefix ?? '') +\n animation.current +\n (animation.__suffix ?? '');\n return res;\n };\n\n const tab = ['R', 'G', 'B', 'A'];\n const colorOnStart = (\n animation: Animation<AnimationObject>,\n value: string | number,\n timestamp: Timestamp,\n previousAnimation: Animation<AnimationObject>\n ): void => {\n let RGBAValue: ParsedColorArray;\n let RGBACurrent: ParsedColorArray;\n let RGBAToValue: ParsedColorArray;\n const res: Array<number> = [];\n if (isColor(value)) {\n RGBACurrent = toLinearSpace(convertToRGBA(animation.current));\n RGBAValue = toLinearSpace(convertToRGBA(value));\n if (animation.toValue) {\n RGBAToValue = toLinearSpace(convertToRGBA(animation.toValue));\n }\n }\n tab.forEach((i, index) => {\n animation[i] = Object.assign({}, animationCopy);\n animation[i].current = RGBACurrent[index];\n animation[i].toValue = RGBAToValue ? RGBAToValue[index] : undefined;\n animation[i].onStart(\n animation[i],\n RGBAValue[index],\n timestamp,\n previousAnimation ? previousAnimation[i] : undefined\n );\n res.push(animation[i].current);\n });\n\n animation.current = rgbaArrayToRGBAColor(\n toGammaSpace(res as ParsedColorArray)\n );\n };\n\n const colorOnFrame = (\n animation: Animation<AnimationObject>,\n timestamp: Timestamp\n ): boolean => {\n const RGBACurrent = toLinearSpace(convertToRGBA(animation.current));\n const res: Array<number> = [];\n let finished = true;\n tab.forEach((i, index) => {\n animation[i].current = RGBACurrent[index];\n const result = animation[i].onFrame(animation[i], timestamp);\n // We really need to assign this value to result, instead of passing it directly - otherwise once \"finished\" is false, onFrame won't be called\n finished = finished && result;\n res.push(animation[i].current);\n });\n\n animation.current = rgbaArrayToRGBAColor(\n toGammaSpace(res as ParsedColorArray)\n );\n return finished;\n };\n\n const transformationMatrixOnStart = (\n animation: Animation<AnimationObject>,\n value: AffineMatrixFlat,\n timestamp: Timestamp,\n previousAnimation: Animation<AnimationObject>\n ): void => {\n const toValue = animation.toValue as AffineMatrixFlat;\n\n animation.startMatrices = decomposeMatrixIntoMatricesAndAngles(value);\n animation.stopMatrices = decomposeMatrixIntoMatricesAndAngles(toValue);\n\n // We create an animation copy to animate single value between 0 and 100\n // We set limits from 0 to 100 (instead of 0-1) to make spring look good\n // with default thresholds.\n\n animation[0] = Object.assign({}, animationCopy);\n animation[0].current = 0;\n animation[0].toValue = 100;\n animation[0].onStart(\n animation[0],\n 0,\n timestamp,\n previousAnimation ? previousAnimation[0] : undefined\n );\n\n animation.current = value;\n };\n\n const transformationMatrixOnFrame = (\n animation: Animation<AnimationObject>,\n timestamp: Timestamp\n ): boolean => {\n let finished = true;\n const result = animation[0].onFrame(animation[0], timestamp);\n // We really need to assign this value to result, instead of passing it directly - otherwise once \"finished\" is false, onFrame won't be called\n finished = finished && result;\n\n const progress = animation[0].current / 100;\n\n const transforms = ['translationMatrix', 'scaleMatrix', 'skewMatrix'];\n const mappedTransforms: Array<AffineMatrix> = [];\n\n transforms.forEach((key, _) =>\n mappedTransforms.push(\n applyProgressToMatrix(\n progress,\n animation.startMatrices[key],\n animation.stopMatrices[key]\n )\n )\n );\n\n const [currentTranslation, currentScale, skewMatrix] = mappedTransforms;\n\n const rotations: Array<'x' | 'y' | 'z'> = ['x', 'y', 'z'];\n const mappedRotations: Array<AffineMatrix> = [];\n\n rotations.forEach((key, _) => {\n const angle = applyProgressToNumber(\n progress,\n animation.startMatrices['r' + key],\n animation.stopMatrices['r' + key]\n );\n mappedRotations.push(getRotationMatrix(angle, key));\n });\n\n const [rotationMatrixX, rotationMatrixY, rotationMatrixZ] = mappedRotations;\n\n const rotationMatrix = multiplyMatrices(\n rotationMatrixX,\n multiplyMatrices(rotationMatrixY, rotationMatrixZ)\n );\n\n const updated = flatten(\n multiplyMatrices(\n multiplyMatrices(\n currentScale,\n multiplyMatrices(skewMatrix, rotationMatrix)\n ),\n currentTranslation\n )\n );\n\n animation.current = updated;\n\n return finished;\n };\n\n const arrayOnStart = (\n animation: Animation<AnimationObject>,\n value: Array<number>,\n timestamp: Timestamp,\n previousAnimation: Animation<AnimationObject>\n ): void => {\n value.forEach((v, i) => {\n animation[i] = Object.assign({}, animationCopy);\n animation[i].current = v;\n animation[i].toValue = (animation.toValue as Array<number>)[i];\n animation[i].onStart(\n animation[i],\n v,\n timestamp,\n previousAnimation ? previousAnimation[i] : undefined\n );\n });\n\n animation.current = value;\n };\n\n const arrayOnFrame = (\n animation: Animation<AnimationObject>,\n timestamp: Timestamp\n ): boolean => {\n let finished = true;\n (animation.current as Array<number>).forEach((_, i) => {\n const result = animation[i].onFrame(animation[i], timestamp);\n // We really need to assign this value to result, instead of passing it directly - otherwise once \"finished\" is false, onFrame won't be called\n finished = finished && result;\n (animation.current as Array<number>)[i] = animation[i].current;\n });\n\n return finished;\n };\n\n const objectOnStart = (\n animation: Animation<AnimationObject>,\n value: AnimatableValueObject,\n timestamp: Timestamp,\n previousAnimation: Animation<AnimationObject>\n ): void => {\n for (const key in value) {\n animation[key] = Object.assign({}, animationCopy);\n animation[key].onStart = animation.onStart;\n\n animation[key].current = value[key];\n animation[key].toValue = (animation.toValue as AnimatableValueObject)[\n key\n ];\n animation[key].onStart(\n animation[key],\n value[key],\n timestamp,\n previousAnimation ? previousAnimation[key] : undefined\n );\n }\n animation.current = value;\n };\n\n const objectOnFrame = (\n animation: Animation<AnimationObject>,\n timestamp: Timestamp\n ): boolean => {\n let finished = true;\n const newObject: AnimatableValueObject = {};\n for (const key in animation.current as AnimatableValueObject) {\n const result = animation[key].onFrame(animation[key], timestamp);\n // We really need to assign this value to result, instead of passing it directly - otherwise once \"finished\" is false, onFrame won't be called\n finished = finished && result;\n newObject[key] = animation[key].current;\n }\n animation.current = newObject;\n return finished;\n };\n\n animation.onStart = (\n animation: Animation<AnimationObject>,\n value: number,\n timestamp: Timestamp,\n previousAnimation: Animation<AnimationObject>\n ) => {\n if (animation.reduceMotion === undefined) {\n animation.reduceMotion = getReduceMotionFromConfig();\n }\n if (animation.reduceMotion) {\n if (animation.toValue !== undefined) {\n animation.current = animation.toValue;\n } else {\n // if there is no `toValue`, then the base function is responsible for setting the current value\n baseOnStart(animation, value, timestamp, previousAnimation);\n }\n animation.startTime = 0;\n animation.onFrame = () => true;\n return;\n }\n if (isColor(value)) {\n colorOnStart(animation, value, timestamp, previousAnimation);\n animation.onFrame = colorOnFrame;\n return;\n } else if (isAffineMatrixFlat(value)) {\n transformationMatrixOnStart(\n animation,\n value,\n timestamp,\n previousAnimation\n );\n animation.onFrame = transformationMatrixOnFrame;\n return;\n } else if (Array.isArray(value)) {\n arrayOnStart(animation, value, timestamp, previousAnimation);\n animation.onFrame = arrayOnFrame;\n return;\n } else if (typeof value === 'string') {\n prefNumberSuffOnStart(animation, value, timestamp, previousAnimation);\n animation.onFrame = prefNumberSuffOnFrame;\n return;\n } else if (typeof value === 'object' && value !== null) {\n objectOnStart(animation, value, timestamp, previousAnimation);\n animation.onFrame = objectOnFrame;\n return;\n }\n baseOnStart(animation, value, timestamp, previousAnimation);\n };\n}\n\ntype AnimationToDecoration<\n T extends AnimationObject | StyleLayoutAnimation,\n U extends AnimationObject | StyleLayoutAnimation\n> = T extends StyleLayoutAnimation\n ? Record<string, unknown>\n : U | (() => U) | AnimatableValue;\n\nconst SHOULD_BE_USE_WEB = shouldBeUseWeb();\n\nexport function defineAnimation<\n T extends AnimationObject | StyleLayoutAnimation, // type that's supposed to be returned\n U extends AnimationObject | StyleLayoutAnimation = T // type that's received\n>(starting: AnimationToDecoration<T, U>, factory: () => T): T {\n 'worklet';\n if (IN_STYLE_UPDATER) {\n return starting as unknown as T;\n }\n const create = () => {\n 'worklet';\n const animation = factory();\n decorateAnimation<U>(animation as unknown as U);\n return animation;\n };\n\n if (_WORKLET || SHOULD_BE_USE_WEB) {\n return create();\n }\n // @ts-ignore: eslint-disable-line\n return create;\n}\n\n/**\n * Lets you cancel a running animation paired to a shared value.\n *\n * @param sharedValue - The shared value of a running animation that you want to cancel.\n * @see https://docs.swmansion.com/react-native-reanimated/docs/core/cancelAnimation\n */\nexport function cancelAnimation<T>(sharedValue: SharedValue<T>): void {\n 'worklet';\n // setting the current value cancels the animation if one is currently running\n sharedValue.value = sharedValue.value; // eslint-disable-line no-self-assign\n}\n"],"mappings":"AAAA;AACA,YAAY;;AAGZ,SACEA,OAAO,EACPC,aAAa,EACbC,oBAAoB,EACpBC,YAAY,EACZC,aAAa,QACR,WAAW;AAClB,SAASC,YAAY,QAAQ,gBAAgB;AAa7C,SACEC,OAAO,EACPC,gBAAgB,EAChBC,WAAW,EACXC,WAAW,EACXC,oCAAoC,EACpCC,kBAAkB,EAClBC,gBAAgB,EAChBC,iBAAiB,QACZ,oCAAoC;AAC3C,SAASC,eAAe,EAAEC,cAAc,QAAQ,oBAAoB;AAEpE,IAAIC,gBAAgB,GAAG,KAAK;AAC5B,MAAMC,iBAAiB,GAAGH,eAAe,EAAE;AA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W,CAACD,SAAS,EAAEpB,KAAK,EAAE0B,SAAS,EAAEC,iBAAiB,CAAC;EAC7D,CAAC;AACH;AASA,MAAM0D,iBAAiB,GAAG/F,cAAc,EAAE;AAE1C,OAAO,SAASgG,eAAeA,CAG7BC,QAAqC,EAAEC,OAAgB,EAAK;EAC5D,SAAS;;EACT,IAAIjG,gBAAgB,EAAE;IACpB,OAAOgG,QAAQ;EACjB;EACA,MAAME,MAAM,GAAGA,CAAA,KAAM;IACnB,SAAS;;IACT,MAAMrE,SAAS,GAAGoE,OAAO,EAAE;IAC3BrE,iBAAiB,CAAIC,SAAS,CAAiB;IAC/C,OAAOA,SAAS;EAClB,CAAC;EAED,IAAIsE,QAAQ,IAAIL,iBAAiB,EAAE;IACjC,OAAOI,MAAM,EAAE;EACjB;EACA;EACA,OAAOA,MAAM;AACf;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASE,eAAeA,CAAIC,WAA2B,EAAQ;EACpE,SAAS;;EACT;EACAA,WAAW,CAAC5F,KAAK,GAAG4F,WAAW,CAAC5F,KAAK,CAAC,CAAC;AACzC"}
1
+ {"version":3,"names":["isColor","convertToRGBA","rgbaArrayToRGBAColor","toGammaSpace","toLinearSpace","ReduceMotion","isWorkletFunction","flatten","multiplyMatrices","scaleMatrix","addMatrices","decomposeMatrixIntoMatricesAndAngles","isAffineMatrixFlat","subtractMatrices","getRotationMatrix","isReducedMotion","shouldBeUseWeb","IN_STYLE_UPDATER","IS_REDUCED_MOTION","SHOULD_BE_USE_WEB","__DEV__","console","warn","assertEasingIsWorklet","easing","_WORKLET","factory","Error","initialUpdaterRun","updater","result","recognizePrefixSuffix","value","match","prefix","suffix","number","strippedValue","parseFloat","getReduceMotionFromConfig","config","System","Always","getReduceMotionForAnimation","undefined","applyProgressToMatrix","progress","a","b","applyProgressToNumber","decorateAnimation","animation","baseOnStart","onStart","baseOnFrame","onFrame","isHigherOrder","timestamp","previousAnimation","reduceMotion","animationCopy","Object","assign","callback","prefNumberSuffOnStart","__prefix","__suffix","strippedCurrent","strippedToValue","toValue","current","startValue","paPrefix","paSuffix","paStrippedValue","prefNumberSuffOnFrame","res","tab","colorOnStart","RGBAValue","RGBACurrent","RGBAToValue","forEach","i","index","push","colorOnFrame","finished","transformationMatrixOnStart","startMatrices","stopMatrices","transformationMatrixOnFrame","transforms","mappedTransforms","key","_","currentTranslation","currentScale","skewMatrix","rotations","mappedRotations","angle","rotationMatrixX","rotationMatrixY","rotationMatrixZ","rotationMatrix","updated","arrayOnStart","v","arrayOnFrame","objectOnStart","objectOnFrame","newObject","startTime","Array","isArray","defineAnimation","starting","create","cancelAnimation","sharedValue"],"sources":["util.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-shadow */\n'use strict';\nimport type { HigherOrderAnimation, StyleLayoutAnimation } from './commonTypes';\nimport type { ParsedColorArray } from '../Colors';\nimport {\n isColor,\n convertToRGBA,\n rgbaArrayToRGBAColor,\n toGammaSpace,\n toLinearSpace,\n} from '../Colors';\nimport { ReduceMotion, isWorkletFunction } from '../commonTypes';\nimport type {\n SharedValue,\n AnimatableValue,\n Animation,\n AnimationObject,\n Timestamp,\n AnimatableValueObject,\n} from '../commonTypes';\nimport type {\n AffineMatrixFlat,\n AffineMatrix,\n} from './transformationMatrix/matrixUtils';\nimport {\n flatten,\n multiplyMatrices,\n scaleMatrix,\n addMatrices,\n decomposeMatrixIntoMatricesAndAngles,\n isAffineMatrixFlat,\n subtractMatrices,\n getRotationMatrix,\n} from './transformationMatrix/matrixUtils';\nimport { isReducedMotion, shouldBeUseWeb } from '../PlatformChecker';\nimport type { EasingFunction, EasingFunctionFactory } from '../Easing';\n\nlet IN_STYLE_UPDATER = false;\nconst IS_REDUCED_MOTION = isReducedMotion();\nconst SHOULD_BE_USE_WEB = shouldBeUseWeb();\n\nif (__DEV__ && IS_REDUCED_MOTION) {\n console.warn(\n `[Reanimated] Reduced motion setting is enabled on this device. This warning is visible only in the development mode. Some animations will be disabled by default. You can override the behavior for individual animations, see https://docs.swmansion.com/react-native-reanimated/docs/guides/troubleshooting#reduced-motion-setting-is-enabled-on-this-device.`\n );\n}\n\nexport function assertEasingIsWorklet(\n easing: EasingFunction | EasingFunctionFactory\n): void {\n 'worklet';\n if (_WORKLET) {\n // If this is called on UI (for example from gesture handler with worklets), we don't get easing,\n // but its bound copy, which is not a worklet. We don't want to throw any error then.\n return;\n }\n if (SHOULD_BE_USE_WEB) {\n // It is possible to run reanimated on web without plugin, so let's skip this check on web\n return;\n }\n // @ts-ignore typescript wants us to use `in` instead, which doesn't work with host objects\n if (easing?.factory) {\n return;\n }\n\n if (!isWorkletFunction(easing)) {\n throw new Error(\n '[Reanimated] The easing function is not a worklet. Please make sure you import `Easing` from react-native-reanimated.'\n );\n }\n}\n\nexport function initialUpdaterRun<T>(updater: () => T) {\n IN_STYLE_UPDATER = true;\n const result = updater();\n IN_STYLE_UPDATER = false;\n return result;\n}\n\ninterface RecognizedPrefixSuffix {\n prefix?: string;\n suffix?: string;\n strippedValue: number;\n}\n\nexport function recognizePrefixSuffix(\n value: string | number\n): RecognizedPrefixSuffix {\n 'worklet';\n if (typeof value === 'string') {\n const match = value.match(\n /([A-Za-z]*)(-?\\d*\\.?\\d*)([eE][-+]?[0-9]+)?([A-Za-z%]*)/\n );\n if (!match) {\n throw new Error(\"[Reanimated] Couldn't parse animation value.\");\n }\n const prefix = match[1];\n const suffix = match[4];\n // number with scientific notation\n const number = match[2] + (match[3] ?? '');\n return { prefix, suffix, strippedValue: parseFloat(number) };\n } else {\n return { strippedValue: value };\n }\n}\n\n/**\n * Returns whether the motion should be reduced for a specified config.\n * By default returns the system setting.\n */\nexport function getReduceMotionFromConfig(config?: ReduceMotion) {\n 'worklet';\n return !config || config === ReduceMotion.System\n ? IS_REDUCED_MOTION\n : config === ReduceMotion.Always;\n}\n\n/**\n * Returns the value that should be assigned to `animation.reduceMotion`\n * for a given config. If the config is not defined, `undefined` is returned.\n */\nexport function getReduceMotionForAnimation(config?: ReduceMotion) {\n 'worklet';\n // if the config is not defined, we want `reduceMotion` to be undefined,\n // so the parent animation knows if it should overwrite it\n if (!config) {\n return undefined;\n }\n\n return getReduceMotionFromConfig(config);\n}\n\nfunction applyProgressToMatrix(\n progress: number,\n a: AffineMatrix,\n b: AffineMatrix\n) {\n 'worklet';\n return addMatrices(a, scaleMatrix(subtractMatrices(b, a), progress));\n}\n\nfunction applyProgressToNumber(progress: number, a: number, b: number) {\n 'worklet';\n return a + progress * (b - a);\n}\n\nfunction decorateAnimation<T extends AnimationObject | StyleLayoutAnimation>(\n animation: T\n): void {\n 'worklet';\n const baseOnStart = (animation as Animation<AnimationObject>).onStart;\n const baseOnFrame = (animation as Animation<AnimationObject>).onFrame;\n\n if ((animation as HigherOrderAnimation).isHigherOrder) {\n animation.onStart = (\n animation: Animation<AnimationObject>,\n value: number,\n timestamp: Timestamp,\n previousAnimation: Animation<AnimationObject>\n ) => {\n if (animation.reduceMotion === undefined) {\n animation.reduceMotion = getReduceMotionFromConfig();\n }\n return baseOnStart(animation, value, timestamp, previousAnimation);\n };\n return;\n }\n\n const animationCopy = Object.assign({}, animation);\n delete animationCopy.callback;\n\n const prefNumberSuffOnStart = (\n animation: Animation<AnimationObject>,\n value: string | number,\n timestamp: number,\n previousAnimation: Animation<AnimationObject>\n ) => {\n // recognize prefix, suffix, and updates stripped value on animation start\n const { prefix, suffix, strippedValue } = recognizePrefixSuffix(value);\n animation.__prefix = prefix;\n animation.__suffix = suffix;\n animation.strippedCurrent = strippedValue;\n const { strippedValue: strippedToValue } = recognizePrefixSuffix(\n animation.toValue as string | number\n );\n animation.current = strippedValue;\n animation.startValue = strippedValue;\n animation.toValue = strippedToValue;\n if (previousAnimation && previousAnimation !== animation) {\n const {\n prefix: paPrefix,\n suffix: paSuffix,\n strippedValue: paStrippedValue,\n } = recognizePrefixSuffix(previousAnimation.current as string | number);\n previousAnimation.current = paStrippedValue;\n previousAnimation.__prefix = paPrefix;\n previousAnimation.__suffix = paSuffix;\n }\n\n baseOnStart(animation, strippedValue, timestamp, previousAnimation);\n\n animation.current =\n (animation.__prefix ?? '') +\n animation.current +\n (animation.__suffix ?? '');\n\n if (previousAnimation && previousAnimation !== animation) {\n previousAnimation.current =\n (previousAnimation.__prefix ?? '') +\n // FIXME\n // eslint-disable-next-line @typescript-eslint/restrict-plus-operands\n previousAnimation.current +\n (previousAnimation.__suffix ?? '');\n }\n };\n const prefNumberSuffOnFrame = (\n animation: Animation<AnimationObject>,\n timestamp: number\n ) => {\n animation.current = animation.strippedCurrent;\n const res = baseOnFrame(animation, timestamp);\n animation.strippedCurrent = animation.current;\n animation.current =\n (animation.__prefix ?? '') +\n animation.current +\n (animation.__suffix ?? '');\n return res;\n };\n\n const tab = ['R', 'G', 'B', 'A'];\n const colorOnStart = (\n animation: Animation<AnimationObject>,\n value: string | number,\n timestamp: Timestamp,\n previousAnimation: Animation<AnimationObject>\n ): void => {\n let RGBAValue: ParsedColorArray;\n let RGBACurrent: ParsedColorArray;\n let RGBAToValue: ParsedColorArray;\n const res: Array<number> = [];\n if (isColor(value)) {\n RGBACurrent = toLinearSpace(convertToRGBA(animation.current));\n RGBAValue = toLinearSpace(convertToRGBA(value));\n if (animation.toValue) {\n RGBAToValue = toLinearSpace(convertToRGBA(animation.toValue));\n }\n }\n tab.forEach((i, index) => {\n animation[i] = Object.assign({}, animationCopy);\n animation[i].current = RGBACurrent[index];\n animation[i].toValue = RGBAToValue ? RGBAToValue[index] : undefined;\n animation[i].onStart(\n animation[i],\n RGBAValue[index],\n timestamp,\n previousAnimation ? previousAnimation[i] : undefined\n );\n res.push(animation[i].current);\n });\n\n animation.current = rgbaArrayToRGBAColor(\n toGammaSpace(res as ParsedColorArray)\n );\n };\n\n const colorOnFrame = (\n animation: Animation<AnimationObject>,\n timestamp: Timestamp\n ): boolean => {\n const RGBACurrent = toLinearSpace(convertToRGBA(animation.current));\n const res: Array<number> = [];\n let finished = true;\n tab.forEach((i, index) => {\n animation[i].current = RGBACurrent[index];\n const result = animation[i].onFrame(animation[i], timestamp);\n // We really need to assign this value to result, instead of passing it directly - otherwise once \"finished\" is false, onFrame won't be called\n finished = finished && result;\n res.push(animation[i].current);\n });\n\n animation.current = rgbaArrayToRGBAColor(\n toGammaSpace(res as ParsedColorArray)\n );\n return finished;\n };\n\n const transformationMatrixOnStart = (\n animation: Animation<AnimationObject>,\n value: AffineMatrixFlat,\n timestamp: Timestamp,\n previousAnimation: Animation<AnimationObject>\n ): void => {\n const toValue = animation.toValue as AffineMatrixFlat;\n\n animation.startMatrices = decomposeMatrixIntoMatricesAndAngles(value);\n animation.stopMatrices = decomposeMatrixIntoMatricesAndAngles(toValue);\n\n // We create an animation copy to animate single value between 0 and 100\n // We set limits from 0 to 100 (instead of 0-1) to make spring look good\n // with default thresholds.\n\n animation[0] = Object.assign({}, animationCopy);\n animation[0].current = 0;\n animation[0].toValue = 100;\n animation[0].onStart(\n animation[0],\n 0,\n timestamp,\n previousAnimation ? previousAnimation[0] : undefined\n );\n\n animation.current = value;\n };\n\n const transformationMatrixOnFrame = (\n animation: Animation<AnimationObject>,\n timestamp: Timestamp\n ): boolean => {\n let finished = true;\n const result = animation[0].onFrame(animation[0], timestamp);\n // We really need to assign this value to result, instead of passing it directly - otherwise once \"finished\" is false, onFrame won't be called\n finished = finished && result;\n\n const progress = animation[0].current / 100;\n\n const transforms = ['translationMatrix', 'scaleMatrix', 'skewMatrix'];\n const mappedTransforms: Array<AffineMatrix> = [];\n\n transforms.forEach((key, _) =>\n mappedTransforms.push(\n applyProgressToMatrix(\n progress,\n animation.startMatrices[key],\n animation.stopMatrices[key]\n )\n )\n );\n\n const [currentTranslation, currentScale, skewMatrix] = mappedTransforms;\n\n const rotations: Array<'x' | 'y' | 'z'> = ['x', 'y', 'z'];\n const mappedRotations: Array<AffineMatrix> = [];\n\n rotations.forEach((key, _) => {\n const angle = applyProgressToNumber(\n progress,\n animation.startMatrices['r' + key],\n animation.stopMatrices['r' + key]\n );\n mappedRotations.push(getRotationMatrix(angle, key));\n });\n\n const [rotationMatrixX, rotationMatrixY, rotationMatrixZ] = mappedRotations;\n\n const rotationMatrix = multiplyMatrices(\n rotationMatrixX,\n multiplyMatrices(rotationMatrixY, rotationMatrixZ)\n );\n\n const updated = flatten(\n multiplyMatrices(\n multiplyMatrices(\n currentScale,\n multiplyMatrices(skewMatrix, rotationMatrix)\n ),\n currentTranslation\n )\n );\n\n animation.current = updated;\n\n return finished;\n };\n\n const arrayOnStart = (\n animation: Animation<AnimationObject>,\n value: Array<number>,\n timestamp: Timestamp,\n previousAnimation: Animation<AnimationObject>\n ): void => {\n value.forEach((v, i) => {\n animation[i] = Object.assign({}, animationCopy);\n animation[i].current = v;\n animation[i].toValue = (animation.toValue as Array<number>)[i];\n animation[i].onStart(\n animation[i],\n v,\n timestamp,\n previousAnimation ? previousAnimation[i] : undefined\n );\n });\n\n animation.current = value;\n };\n\n const arrayOnFrame = (\n animation: Animation<AnimationObject>,\n timestamp: Timestamp\n ): boolean => {\n let finished = true;\n (animation.current as Array<number>).forEach((_, i) => {\n const result = animation[i].onFrame(animation[i], timestamp);\n // We really need to assign this value to result, instead of passing it directly - otherwise once \"finished\" is false, onFrame won't be called\n finished = finished && result;\n (animation.current as Array<number>)[i] = animation[i].current;\n });\n\n return finished;\n };\n\n const objectOnStart = (\n animation: Animation<AnimationObject>,\n value: AnimatableValueObject,\n timestamp: Timestamp,\n previousAnimation: Animation<AnimationObject>\n ): void => {\n for (const key in value) {\n animation[key] = Object.assign({}, animationCopy);\n animation[key].onStart = animation.onStart;\n\n animation[key].current = value[key];\n animation[key].toValue = (animation.toValue as AnimatableValueObject)[\n key\n ];\n animation[key].onStart(\n animation[key],\n value[key],\n timestamp,\n previousAnimation ? previousAnimation[key] : undefined\n );\n }\n animation.current = value;\n };\n\n const objectOnFrame = (\n animation: Animation<AnimationObject>,\n timestamp: Timestamp\n ): boolean => {\n let finished = true;\n const newObject: AnimatableValueObject = {};\n for (const key in animation.current as AnimatableValueObject) {\n const result = animation[key].onFrame(animation[key], timestamp);\n // We really need to assign this value to result, instead of passing it directly - otherwise once \"finished\" is false, onFrame won't be called\n finished = finished && result;\n newObject[key] = animation[key].current;\n }\n animation.current = newObject;\n return finished;\n };\n\n animation.onStart = (\n animation: Animation<AnimationObject>,\n value: number,\n timestamp: Timestamp,\n previousAnimation: Animation<AnimationObject>\n ) => {\n if (animation.reduceMotion === undefined) {\n animation.reduceMotion = getReduceMotionFromConfig();\n }\n if (animation.reduceMotion) {\n if (animation.toValue !== undefined) {\n animation.current = animation.toValue;\n } else {\n // if there is no `toValue`, then the base function is responsible for setting the current value\n baseOnStart(animation, value, timestamp, previousAnimation);\n }\n animation.startTime = 0;\n animation.onFrame = () => true;\n return;\n }\n if (isColor(value)) {\n colorOnStart(animation, value, timestamp, previousAnimation);\n animation.onFrame = colorOnFrame;\n return;\n } else if (isAffineMatrixFlat(value)) {\n transformationMatrixOnStart(\n animation,\n value,\n timestamp,\n previousAnimation\n );\n animation.onFrame = transformationMatrixOnFrame;\n return;\n } else if (Array.isArray(value)) {\n arrayOnStart(animation, value, timestamp, previousAnimation);\n animation.onFrame = arrayOnFrame;\n return;\n } else if (typeof value === 'string') {\n prefNumberSuffOnStart(animation, value, timestamp, previousAnimation);\n animation.onFrame = prefNumberSuffOnFrame;\n return;\n } else if (typeof value === 'object' && value !== null) {\n objectOnStart(animation, value, timestamp, previousAnimation);\n animation.onFrame = objectOnFrame;\n return;\n }\n baseOnStart(animation, value, timestamp, previousAnimation);\n };\n}\n\ntype AnimationToDecoration<\n T extends AnimationObject | StyleLayoutAnimation,\n U extends AnimationObject | StyleLayoutAnimation\n> = T extends StyleLayoutAnimation\n ? Record<string, unknown>\n : U | (() => U) | AnimatableValue;\n\nexport function defineAnimation<\n T extends AnimationObject | StyleLayoutAnimation, // type that's supposed to be returned\n U extends AnimationObject | StyleLayoutAnimation = T // type that's received\n>(starting: AnimationToDecoration<T, U>, factory: () => T): T {\n 'worklet';\n if (IN_STYLE_UPDATER) {\n return starting as unknown as T;\n }\n const create = () => {\n 'worklet';\n const animation = factory();\n decorateAnimation<U>(animation as unknown as U);\n return animation;\n };\n\n if (_WORKLET || SHOULD_BE_USE_WEB) {\n return create();\n }\n // @ts-ignore: eslint-disable-line\n return create;\n}\n\n/**\n * Lets you cancel a running animation paired to a shared value.\n *\n * @param sharedValue - The shared value of a running animation that you want to cancel.\n * @see https://docs.swmansion.com/react-native-reanimated/docs/core/cancelAnimation\n */\nexport function cancelAnimation<T>(sharedValue: SharedValue<T>): void {\n 'worklet';\n // setting the current value cancels the animation if one is currently running\n sharedValue.value = sharedValue.value; // eslint-disable-line no-self-assign\n}\n"],"mappings":"AAAA;AACA,YAAY;;AAGZ,SACEA,OAAO,EACPC,aAAa,EACbC,oBAAoB,EACpBC,YAAY,EACZC,aAAa,QACR,WAAW;AAClB,SAASC,YAAY,EAAEC,iBAAiB,QAAQ,gBAAgB;AAahE,SACEC,OAAO,EACPC,gBAAgB,EAChBC,WAAW,EACXC,WAAW,EACXC,oCAAoC,EACpCC,kBAAkB,EAClBC,gBAAgB,EAChBC,iBAAiB,QACZ,oCAAoC;AAC3C,SAASC,eAAe,EAAEC,cAAc,QAAQ,oBAAoB;AAGpE,IAAIC,gBAAgB,GAAG,KAAK;AAC5B,MAAMC,iBAAiB,GAAGH,eAAe,CAAC,CAAC;AAC3C,MAAMI,iBAAiB,GAAGH,cAAc,CAAC,CAAC;AAE1C,IAAII,OAAO,IAAIF,iBAAiB,EAAE;EAChCG,OAAO,CAACC,IAAI,CACT,iWACH,CAAC;AACH;AAEA,OAAO,SAASC,qBAAqBA,CACnCC,MAA8C,EACxC;EACN,SAAS;;EACT,IAAIC,QAAQ,EAAE;IACZ;IACA;IACA;EACF;EACA,IAAIN,iBAAiB,EAAE;IACrB;IACA;EACF;EACA;EACA,IAAIK,MAAM,aAANA,MAAM,eAANA,MAAM,CAAEE,OAAO,EAAE;IACnB;EACF;EAEA,IAAI,CAACpB,iBAAiB,CAACkB,MAAM,CAAC,EAAE;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AK,EAAEyB,SAAS,EAAEC,iBAAiB,CAAC;EAC7D,CAAC;AACH;AASA,OAAO,SAAS0D,eAAeA,CAG7BC,QAAqC,EAAE3F,OAAgB,EAAK;EAC5D,SAAS;;EACT,IAAIT,gBAAgB,EAAE;IACpB,OAAOoG,QAAQ;EACjB;EACA,MAAMC,MAAM,GAAGA,CAAA,KAAM;IACnB,SAAS;;IACT,MAAMnE,SAAS,GAAGzB,OAAO,CAAC,CAAC;IAC3BwB,iBAAiB,CAAIC,SAAyB,CAAC;IAC/C,OAAOA,SAAS;EAClB,CAAC;EAED,IAAI1B,QAAQ,IAAIN,iBAAiB,EAAE;IACjC,OAAOmG,MAAM,CAAC,CAAC;EACjB;EACA;EACA,OAAOA,MAAM;AACf;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,eAAeA,CAAIC,WAA2B,EAAQ;EACpE,SAAS;;EACT;EACAA,WAAW,CAACxF,KAAK,GAAGwF,WAAW,CAACxF,KAAK,CAAC,CAAC;AACzC","ignoreList":[]}
@@ -13,8 +13,10 @@
13
13
  // check other methods that may use them. However, this field is not actually defined
14
14
  // nor should be used for anything else as assigning any data to those objects will
15
15
  // throw an error.
16
+
16
17
  // In case of objects with depth or arrays of objects or arrays of arrays etc.
17
18
  // we add this utility type that makes it a SharaebleRef of the outermost type.
19
+
18
20
  /**
19
21
  * This function allows you to determine if a given function is a worklet. It only works
20
22
  * with Reanimated Babel plugin enabled. Unless you are doing something with internals of
@@ -41,7 +43,7 @@ export function isWorkletFunction(value) {
41
43
 
42
44
  // Since host objects always return true for `in` operator, we have to use dot notation to check if the property exists.
43
45
  // See https://github.com/facebook/hermes/blob/340726ef8cf666a7cce75bc60b02fa56b3e54560/lib/VM/JSObject.cpp#L1276.
44
- return !!value.__workletHash;
46
+ return typeof value === 'function' && !!value.__workletHash;
45
47
  }
46
48
  export let SensorType = /*#__PURE__*/function (SensorType) {
47
49
  SensorType[SensorType["ACCELEROMETER"] = 1] = "ACCELEROMETER";
@@ -1 +1 @@
1
- {"version":3,"names":["isWorkletFunction","value","__workletHash","SensorType","IOSReferenceFrame","InterfaceOrientation","KeyboardState","ReduceMotion"],"sources":["commonTypes.ts"],"sourcesContent":["'use strict';\nimport type { ViewStyle, TextStyle } from 'react-native';\n\nexport type RequiredKeys<T, K extends keyof T> = T & Required<Pick<T, K>>;\nexport interface StyleProps extends ViewStyle, TextStyle {\n originX?: number;\n originY?: number;\n [key: string]: any;\n}\n\n/**\n * A value that can be used both on the [JavaScript thread](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#javascript-thread) and the [UI thread](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#ui-thread).\n *\n * Shared values are defined using [useSharedValue](https://docs.swmansion.com/react-native-reanimated/docs/core/useSharedValue) hook. You access and modify shared values by their `.value` property.\n */\nexport interface SharedValue<Value = unknown> {\n value: Value;\n addListener: (listenerID: number, listener: (value: Value) => void) => void;\n removeListener: (listenerID: number) => void;\n modify: (\n modifier?: <T extends Value>(value: T) => T,\n forceUpdate?: boolean\n ) => void;\n}\n\nexport interface Mutable<Value = unknown> extends SharedValue<Value> {\n _isReanimatedSharedValue: true;\n _animation?: AnimationObject<Value> | null; // only in Native\n _value: Value;\n}\n\n// The below type is used for HostObjects returned by the JSI API that don't have\n// any accessible fields or methods but can carry data that is accessed from the\n// c++ side. We add a field to the type to make it possible for typescript to recognize\n// which JSI methods accept those types as arguments and to be able to correctly type\n// check other methods that may use them. However, this field is not actually defined\n// nor should be used for anything else as assigning any data to those objects will\n// throw an error.\nexport type ShareableRef<T = unknown> = {\n __hostObjectShareableJSRef: T;\n};\n\n// In case of objects with depth or arrays of objects or arrays of arrays etc.\n// we add this utility type that makes it a SharaebleRef of the outermost type.\nexport type FlatShareableRef<T> = T extends ShareableRef<infer U>\n ? ShareableRef<U>\n : ShareableRef<T>;\n\nexport type MapperRawInputs = unknown[];\n\nexport type MapperOutputs = SharedValue[];\n\nexport type MapperRegistry = {\n start: (\n mapperID: number,\n worklet: () => void,\n inputs: MapperRawInputs,\n outputs?: MapperOutputs\n ) => void;\n stop: (mapperID: number) => void;\n};\n\nexport type WorkletStackDetails = [\n error: Error,\n lineOffset: number,\n columnOffset: number\n];\n\ntype WorkletClosure = Record<string, unknown>;\n\ninterface WorkletInitDataCommon {\n code: string;\n}\n\ntype WorkletInitDataRelease = WorkletInitDataCommon;\n\ninterface WorkletInitDataDev extends WorkletInitDataCommon {\n location: string;\n sourceMap: string;\n version: string;\n}\n\ninterface WorkletBaseCommon {\n __closure: WorkletClosure;\n __workletHash: number;\n}\n\ninterface WorkletBaseRelease extends WorkletBaseCommon {\n __initData: WorkletInitDataRelease;\n}\n\ninterface WorkletBaseDev extends WorkletBaseCommon {\n __initData: WorkletInitDataDev;\n /**\n * `__stackDetails` is removed after parsing.\n */\n __stackDetails?: WorkletStackDetails;\n}\n\nexport type WorkletFunction<\n Args extends unknown[] = unknown[],\n ReturnValue = unknown\n> = ((...args: Args) => ReturnValue) & (WorkletBaseRelease | WorkletBaseDev);\n\n/**\n * This function allows you to determine if a given function is a worklet. It only works\n * with Reanimated Babel plugin enabled. Unless you are doing something with internals of\n * Reanimated you shouldn't need to use this function.\n *\n * ### Note\n * Do not call it before the worklet is declared, as it will always return false then. E.g.:\n *\n * ```ts\n * isWorkletFunction(myWorklet); // Will always return false.\n *\n * function myWorklet() {\n * 'worklet';\n * };\n * ```\n *\n * ### Maintainer note\n * This function works well on the JS thread performance-wise, since the JIT can inline it.\n * However, on other threads it will not get optimized and we will get a function call overhead.\n * We want to change it in the future, but it's not feasible at the moment.\n */\nexport function isWorkletFunction<\n Args extends unknown[] = unknown[],\n ReturnValue = unknown,\n BuildType extends WorkletBaseDev | WorkletBaseRelease = WorkletBaseDev\n>(value: unknown): value is WorkletFunction<Args, ReturnValue> & BuildType {\n 'worklet';\n // Since host objects always return true for `in` operator, we have to use dot notation to check if the property exists.\n // See https://github.com/facebook/hermes/blob/340726ef8cf666a7cce75bc60b02fa56b3e54560/lib/VM/JSObject.cpp#L1276.\n return !!(value as Record<string, unknown>).__workletHash;\n}\n\nexport type AnimatedPropsAdapterFunction = (\n props: Record<string, unknown>\n) => void;\n\nexport type AnimatedPropsAdapterWorklet = WorkletFunction<\n [props: Record<string, unknown>],\n void\n>;\n\nexport interface NestedObject<T> {\n [key: string]: NestedObjectValues<T>;\n}\n\nexport type NestedObjectValues<T> =\n | T\n | Array<NestedObjectValues<T>>\n | NestedObject<T>;\n\ntype Animatable = number | string | Array<number>;\n\nexport type AnimatableValueObject = { [key: string]: Animatable };\n\nexport type AnimatableValue = Animatable | AnimatableValueObject;\n\nexport interface AnimationObject<T = AnimatableValue> {\n [key: string]: any;\n callback?: AnimationCallback;\n current?: T;\n toValue?: AnimationObject<T>['current'];\n startValue?: AnimationObject<T>['current'];\n finished?: boolean;\n strippedCurrent?: number;\n cancelled?: boolean;\n reduceMotion?: boolean;\n\n __prefix?: string;\n __suffix?: string;\n onFrame: (animation: any, timestamp: Timestamp) => boolean;\n onStart: (\n nextAnimation: any,\n current: any,\n timestamp: Timestamp,\n previousAnimation: any\n ) => void;\n}\n\nexport interface Animation<T extends AnimationObject> extends AnimationObject {\n onFrame: (animation: T, timestamp: Timestamp) => boolean;\n onStart: (\n nextAnimation: T,\n current: AnimatableValue,\n timestamp: Timestamp,\n previousAnimation: Animation<any> | null | T\n ) => void;\n}\n\nexport enum SensorType {\n ACCELEROMETER = 1,\n GYROSCOPE = 2,\n GRAVITY = 3,\n MAGNETIC_FIELD = 4,\n ROTATION = 5,\n}\nexport enum IOSReferenceFrame {\n XArbitraryZVertical,\n XArbitraryCorrectedZVertical,\n XMagneticNorthZVertical,\n XTrueNorthZVertical,\n Auto,\n}\n\nexport type SensorConfig = {\n interval: number | 'auto';\n adjustToInterfaceOrientation: boolean;\n iosReferenceFrame: IOSReferenceFrame;\n};\n\nexport type AnimatedSensor<T extends Value3D | ValueRotation> = {\n sensor: SharedValue<T>;\n unregister: () => void;\n isAvailable: boolean;\n config: SensorConfig;\n};\n\n/**\n * A function called upon animation completion. If the animation is cancelled, the callback will receive `false` as the argument; otherwise, it will receive `true`.\n */\nexport type AnimationCallback = (\n finished?: boolean,\n current?: AnimatableValue\n) => void;\n\nexport type Timestamp = number;\n\nexport type Value3D = {\n x: number;\n y: number;\n z: number;\n interfaceOrientation: InterfaceOrientation;\n};\n\nexport type ValueRotation = {\n qw: number;\n qx: number;\n qy: number;\n qz: number;\n yaw: number;\n pitch: number;\n roll: number;\n interfaceOrientation: InterfaceOrientation;\n};\n\nexport enum InterfaceOrientation {\n ROTATION_0 = 0,\n ROTATION_90 = 90,\n ROTATION_180 = 180,\n ROTATION_270 = 270,\n}\n\nexport type ShadowNodeWrapper = {\n __hostObjectShadowNodeWrapper: never;\n};\n\nexport enum KeyboardState {\n UNKNOWN = 0,\n OPENING = 1,\n OPEN = 2,\n CLOSING = 3,\n CLOSED = 4,\n}\n\nexport type AnimatedKeyboardInfo = {\n height: SharedValue<number>;\n state: SharedValue<KeyboardState>;\n};\n\n/**\n * @param x - A number representing X coordinate relative to the parent component.\n * @param y - A number representing Y coordinate relative to the parent component.\n * @param width - A number representing the width of the component.\n * @param height - A number representing the height of the component.\n * @param pageX - A number representing X coordinate relative to the screen.\n * @param pageY - A number representing Y coordinate relative to the screen.\n * @see https://docs.swmansion.com/react-native-reanimated/docs/advanced/measure#returns\n */\nexport interface MeasuredDimensions {\n x: number;\n y: number;\n width: number;\n height: number;\n pageX: number;\n pageY: number;\n}\n\nexport interface AnimatedKeyboardOptions {\n isStatusBarTranslucentAndroid?: boolean;\n}\n\n/**\n * @param System - If the `Reduce motion` accessibility setting is enabled on the device, disable the animation. Otherwise, enable the animation.\n * @param Always - Disable the animation.\n * @param Never - Enable the animation.\n * @see https://docs.swmansion.com/react-native-reanimated/docs/guides/accessibility\n */\nexport enum ReduceMotion {\n System = 'system',\n Always = 'always',\n Never = 'never',\n}\n"],"mappings":"AAAA,YAAY;;AAUZ;AACA;AACA;AACA;AACA;;AAi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ZA,YAAY;EAAZA,YAAY;EAAA,OAAZA,YAAY;AAAA"}
1
+ {"version":3,"names":["isWorkletFunction","value","__workletHash","SensorType","IOSReferenceFrame","InterfaceOrientation","KeyboardState","ReduceMotion"],"sources":["commonTypes.ts"],"sourcesContent":["'use strict';\nimport type { ViewStyle, TextStyle } from 'react-native';\n\nexport type RequiredKeys<T, K extends keyof T> = T & Required<Pick<T, K>>;\nexport interface StyleProps extends ViewStyle, TextStyle {\n originX?: number;\n originY?: number;\n [key: string]: any;\n}\n\n/**\n * A value that can be used both on the [JavaScript thread](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#javascript-thread) and the [UI thread](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#ui-thread).\n *\n * Shared values are defined using [useSharedValue](https://docs.swmansion.com/react-native-reanimated/docs/core/useSharedValue) hook. You access and modify shared values by their `.value` property.\n */\nexport interface SharedValue<Value = unknown> {\n value: Value;\n addListener: (listenerID: number, listener: (value: Value) => void) => void;\n removeListener: (listenerID: number) => void;\n modify: (\n modifier?: <T extends Value>(value: T) => T,\n forceUpdate?: boolean\n ) => void;\n}\n\nexport interface Mutable<Value = unknown> extends SharedValue<Value> {\n _isReanimatedSharedValue: true;\n _animation?: AnimationObject<Value> | null; // only in Native\n _value: Value;\n}\n\n// The below type is used for HostObjects returned by the JSI API that don't have\n// any accessible fields or methods but can carry data that is accessed from the\n// c++ side. We add a field to the type to make it possible for typescript to recognize\n// which JSI methods accept those types as arguments and to be able to correctly type\n// check other methods that may use them. However, this field is not actually defined\n// nor should be used for anything else as assigning any data to those objects will\n// throw an error.\nexport type ShareableRef<T = unknown> = {\n __hostObjectShareableJSRef: T;\n};\n\n// In case of objects with depth or arrays of objects or arrays of arrays etc.\n// we add this utility type that makes it a SharaebleRef of the outermost type.\nexport type FlatShareableRef<T> = T extends ShareableRef<infer U>\n ? ShareableRef<U>\n : ShareableRef<T>;\n\nexport type MapperRawInputs = unknown[];\n\nexport type MapperOutputs = SharedValue[];\n\nexport type MapperRegistry = {\n start: (\n mapperID: number,\n worklet: () => void,\n inputs: MapperRawInputs,\n outputs?: MapperOutputs\n ) => void;\n stop: (mapperID: number) => void;\n};\n\nexport type WorkletStackDetails = [\n error: Error,\n lineOffset: number,\n columnOffset: number\n];\n\ntype WorkletClosure = Record<string, unknown>;\n\ninterface WorkletInitDataCommon {\n code: string;\n}\n\ntype WorkletInitDataRelease = WorkletInitDataCommon;\n\ninterface WorkletInitDataDev extends WorkletInitDataCommon {\n location: string;\n sourceMap: string;\n version: string;\n}\n\ninterface WorkletBaseCommon {\n __closure: WorkletClosure;\n __workletHash: number;\n}\n\ninterface WorkletBaseRelease extends WorkletBaseCommon {\n __initData: WorkletInitDataRelease;\n}\n\ninterface WorkletBaseDev extends WorkletBaseCommon {\n __initData: WorkletInitDataDev;\n /**\n * `__stackDetails` is removed after parsing.\n */\n __stackDetails?: WorkletStackDetails;\n}\n\nexport type WorkletFunction<\n Args extends unknown[] = unknown[],\n ReturnValue = unknown\n> = ((...args: Args) => ReturnValue) & (WorkletBaseRelease | WorkletBaseDev);\n\n/**\n * This function allows you to determine if a given function is a worklet. It only works\n * with Reanimated Babel plugin enabled. Unless you are doing something with internals of\n * Reanimated you shouldn't need to use this function.\n *\n * ### Note\n * Do not call it before the worklet is declared, as it will always return false then. E.g.:\n *\n * ```ts\n * isWorkletFunction(myWorklet); // Will always return false.\n *\n * function myWorklet() {\n * 'worklet';\n * };\n * ```\n *\n * ### Maintainer note\n * This function works well on the JS thread performance-wise, since the JIT can inline it.\n * However, on other threads it will not get optimized and we will get a function call overhead.\n * We want to change it in the future, but it's not feasible at the moment.\n */\nexport function isWorkletFunction<\n Args extends unknown[] = unknown[],\n ReturnValue = unknown,\n BuildType extends WorkletBaseDev | WorkletBaseRelease = WorkletBaseDev\n>(value: unknown): value is WorkletFunction<Args, ReturnValue> & BuildType {\n 'worklet';\n // Since host objects always return true for `in` operator, we have to use dot notation to check if the property exists.\n // See https://github.com/facebook/hermes/blob/340726ef8cf666a7cce75bc60b02fa56b3e54560/lib/VM/JSObject.cpp#L1276.\n return (\n typeof value === 'function' &&\n !!(value as unknown as Record<string, unknown>).__workletHash\n );\n}\n\nexport type AnimatedPropsAdapterFunction = (\n props: Record<string, unknown>\n) => void;\n\nexport type AnimatedPropsAdapterWorklet = WorkletFunction<\n [props: Record<string, unknown>],\n void\n>;\n\nexport interface NestedObject<T> {\n [key: string]: NestedObjectValues<T>;\n}\n\nexport type NestedObjectValues<T> =\n | T\n | Array<NestedObjectValues<T>>\n | NestedObject<T>;\n\ntype Animatable = number | string | Array<number>;\n\nexport type AnimatableValueObject = { [key: string]: Animatable };\n\nexport type AnimatableValue = Animatable | AnimatableValueObject;\n\nexport interface AnimationObject<T = AnimatableValue> {\n [key: string]: any;\n callback?: AnimationCallback;\n current?: T;\n toValue?: AnimationObject<T>['current'];\n startValue?: AnimationObject<T>['current'];\n finished?: boolean;\n strippedCurrent?: number;\n cancelled?: boolean;\n reduceMotion?: boolean;\n\n __prefix?: string;\n __suffix?: string;\n onFrame: (animation: any, timestamp: Timestamp) => boolean;\n onStart: (\n nextAnimation: any,\n current: any,\n timestamp: Timestamp,\n previousAnimation: any\n ) => void;\n}\n\nexport interface Animation<T extends AnimationObject> extends AnimationObject {\n onFrame: (animation: T, timestamp: Timestamp) => boolean;\n onStart: (\n nextAnimation: T,\n current: AnimatableValue,\n timestamp: Timestamp,\n previousAnimation: Animation<any> | null | T\n ) => void;\n}\n\nexport enum SensorType {\n ACCELEROMETER = 1,\n GYROSCOPE = 2,\n GRAVITY = 3,\n MAGNETIC_FIELD = 4,\n ROTATION = 5,\n}\nexport enum IOSReferenceFrame {\n XArbitraryZVertical,\n XArbitraryCorrectedZVertical,\n XMagneticNorthZVertical,\n XTrueNorthZVertical,\n Auto,\n}\n\nexport type SensorConfig = {\n interval: number | 'auto';\n adjustToInterfaceOrientation: boolean;\n iosReferenceFrame: IOSReferenceFrame;\n};\n\nexport type AnimatedSensor<T extends Value3D | ValueRotation> = {\n sensor: SharedValue<T>;\n unregister: () => void;\n isAvailable: boolean;\n config: SensorConfig;\n};\n\n/**\n * A function called upon animation completion. If the animation is cancelled, the callback will receive `false` as the argument; otherwise, it will receive `true`.\n */\nexport type AnimationCallback = (\n finished?: boolean,\n current?: AnimatableValue\n) => void;\n\nexport type Timestamp = number;\n\nexport type Value3D = {\n x: number;\n y: number;\n z: number;\n interfaceOrientation: InterfaceOrientation;\n};\n\nexport type ValueRotation = {\n qw: number;\n qx: number;\n qy: number;\n qz: number;\n yaw: number;\n pitch: number;\n roll: number;\n interfaceOrientation: InterfaceOrientation;\n};\n\nexport enum InterfaceOrientation {\n ROTATION_0 = 0,\n ROTATION_90 = 90,\n ROTATION_180 = 180,\n ROTATION_270 = 270,\n}\n\nexport type ShadowNodeWrapper = {\n __hostObjectShadowNodeWrapper: never;\n};\n\nexport enum KeyboardState {\n UNKNOWN = 0,\n OPENING = 1,\n OPEN = 2,\n CLOSING = 3,\n CLOSED = 4,\n}\n\nexport type AnimatedKeyboardInfo = {\n height: SharedValue<number>;\n state: SharedValue<KeyboardState>;\n};\n\n/**\n * @param x - A number representing X coordinate relative to the parent component.\n * @param y - A number representing Y coordinate relative to the parent component.\n * @param width - A number representing the width of the component.\n * @param height - A number representing the height of the component.\n * @param pageX - A number representing X coordinate relative to the screen.\n * @param pageY - A number representing Y coordinate relative to the screen.\n * @see https://docs.swmansion.com/react-native-reanimated/docs/advanced/measure#returns\n */\nexport interface MeasuredDimensions {\n x: number;\n y: number;\n width: number;\n height: number;\n pageX: number;\n pageY: number;\n}\n\nexport interface AnimatedKeyboardOptions {\n isStatusBarTranslucentAndroid?: boolean;\n}\n\n/**\n * @param System - If the `Reduce motion` accessibility setting is enabled on the device, disable the animation. Otherwise, enable the animation.\n * @param Always - Disable the animation.\n * @param Never - Enable the animation.\n * @see https://docs.swmansion.com/react-native-reanimated/docs/guides/accessibility\n */\nexport enum ReduceMotion {\n System = 'system',\n Always = 'always',\n Never = 'never',\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A;AACA;AACA;;AAcA;AACA;AACA;AACA;AACA;AACA;AACA,WAAYC,YAAY,0BAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAA,OAAZA,YAAY;AAAA","ignoreList":[]}
@@ -22,6 +22,7 @@ const createCellRendererComponent = itemLayoutAnimationRef => {
22
22
 
23
23
  // Since createAnimatedComponent return type is ComponentClass that has the props of the argument,
24
24
  // but not things like NativeMethods, etc. we need to add them manually by extending the type.
25
+
25
26
  // We need explicit any here, because this is the exact same type that is used in React Native types.
26
27
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
27
28
  const FlatListForwardRefRender = function (props, ref) {
@@ -1 +1 @@
1
- {"version":3,"names":["_extends","Object","assign","bind","target","i","arguments","length","source","key","prototype","hasOwnProperty","call","apply","React","forwardRef","useRef","FlatList","AnimatedView","createAnimatedComponent","LayoutAnimationConfig","AnimatedFlatList","createCellRendererComponent","itemLayoutAnimationRef","CellRendererComponent","props","createElement","layout","current","onLayout","style","children","FlatListForwardRefRender","ref","itemLayoutAnimation","skipEnteringExitingAnimations","restProps","scrollEventThrottle","useMemo","animatedFlatList","undefined","skipEntering","skipExiting","ReanimatedFlatList"],"sources":["FlatList.tsx"],"sourcesContent":["'use strict';\nimport React, { forwardRef, useRef } from 'react';\nimport type {\n FlatListProps,\n LayoutChangeEvent,\n StyleProp,\n ViewStyle,\n} from 'react-native';\nimport { FlatList } from 'react-native';\nimport { AnimatedView } from './View';\nimport { createAnimatedComponent } from '../../createAnimatedComponent';\nimport type { ILayoutAnimationBuilder } from '../layoutReanimation/animationBuilder/commonTypes';\nimport { LayoutAnimationConfig } from './LayoutAnimationConfig';\nimport type { AnimatedProps, AnimatedStyle } from '../helperTypes';\n\nconst AnimatedFlatList = createAnimatedComponent(FlatList);\n\ninterface CellRendererComponentProps {\n onLayout?: ((event: LayoutChangeEvent) => void) | undefined;\n children: React.ReactNode;\n style?: StyleProp<AnimatedStyle<ViewStyle>>;\n}\n\nconst createCellRendererComponent = (\n itemLayoutAnimationRef?: React.MutableRefObject<\n ILayoutAnimationBuilder | undefined\n >\n) => {\n const CellRendererComponent = (props: CellRendererComponentProps) => {\n return (\n <AnimatedView\n // TODO TYPESCRIPT This is temporary cast is to get rid of .d.ts file.\n layout={itemLayoutAnimationRef?.current as any}\n onLayout={props.onLayout}\n style={props.style}>\n {props.children}\n </AnimatedView>\n );\n };\n\n return CellRendererComponent;\n};\n\ninterface ReanimatedFlatListPropsWithLayout<T>\n extends AnimatedProps<FlatListProps<T>> {\n /**\n * Lets you pass layout animation directly to the FlatList item.\n */\n itemLayoutAnimation?: ILayoutAnimationBuilder;\n /**\n * Lets you skip entering and exiting animations of FlatList items when on FlatList mount or unmount.\n */\n skipEnteringExitingAnimations?: boolean;\n}\n\nexport type FlatListPropsWithLayout<T> = ReanimatedFlatListPropsWithLayout<T>;\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 AnimatedFlatListComplement<T> extends FlatList<T> {\n getNode(): FlatList<T>;\n}\n\n// We need explicit any here, because this is the exact same type that is used in React Native types.\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst FlatListForwardRefRender = function <Item = any>(\n props: ReanimatedFlatListPropsWithLayout<Item>,\n ref: React.ForwardedRef<FlatList>\n) {\n const { itemLayoutAnimation, skipEnteringExitingAnimations, ...restProps } =\n props;\n\n // Set default scrollEventThrottle, because user expects\n // to have continuous scroll events and\n // react-native defaults it to 50 for FlatLists.\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 const itemLayoutAnimationRef = useRef(itemLayoutAnimation);\n itemLayoutAnimationRef.current = itemLayoutAnimation;\n\n const CellRendererComponent = React.useMemo(\n () => createCellRendererComponent(itemLayoutAnimationRef),\n [itemLayoutAnimationRef]\n );\n\n const animatedFlatList = (\n // @ts-expect-error In its current type state, createAnimatedComponent cannot create generic components.\n <AnimatedFlatList\n ref={ref}\n {...restProps}\n CellRendererComponent={CellRendererComponent}\n />\n );\n\n if (skipEnteringExitingAnimations === undefined) {\n return animatedFlatList;\n }\n\n return (\n <LayoutAnimationConfig skipEntering skipExiting>\n {animatedFlatList}\n </LayoutAnimationConfig>\n );\n};\n\nexport const ReanimatedFlatList = forwardRef(FlatListForwardRefRender) as <\n // We need explicit any here, because this is the exact same type that is used in React Native types.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ItemT = any\n>(\n props: ReanimatedFlatListPropsWithLayout<ItemT> & {\n ref?: React.ForwardedRef<FlatList>;\n }\n) => React.ReactElement;\n\nexport type ReanimatedFlatList<T> = typeof AnimatedFlatList &\n AnimatedFlatListComplement<T>;\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;AACb,OAAOQ,KAAK,IAAIC,UAAU,EAAEC,MAAM,QAAQ,OAAO;AAOjD,SAASC,QAAQ,QAAQ,cAAc;AACvC,SAASC,YAAY,QAAQ,QAAQ;AACrC,SAASC,uBAAuB,QAAQ,+BAA+B;AAEvE,SAASC,qBAAqB,QAAQ,yBAAyB;AAG/D,MAAMC,gBAAgB,GAAGF,uBAAuB,CAACF,QAAQ,CAAC;AAQ1D,MAAMK,2BAA2B,GAC/BC,sBAEC,IACE;E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B,UAAU,CAACiB,wBAAwB,CAQ9C"}
1
+ {"version":3,"names":["_extends","Object","assign","bind","target","i","arguments","length","source","key","prototype","hasOwnProperty","call","apply","React","forwardRef","useRef","FlatList","AnimatedView","createAnimatedComponent","LayoutAnimationConfig","AnimatedFlatList","createCellRendererComponent","itemLayoutAnimationRef","CellRendererComponent","props","createElement","layout","current","onLayout","style","children","FlatListForwardRefRender","ref","itemLayoutAnimation","skipEnteringExitingAnimations","restProps","scrollEventThrottle","useMemo","animatedFlatList","undefined","skipEntering","skipExiting","ReanimatedFlatList"],"sources":["FlatList.tsx"],"sourcesContent":["'use strict';\nimport React, { forwardRef, useRef } from 'react';\nimport type {\n FlatListProps,\n LayoutChangeEvent,\n StyleProp,\n ViewStyle,\n} from 'react-native';\nimport { FlatList } from 'react-native';\nimport { AnimatedView } from './View';\nimport { createAnimatedComponent } from '../../createAnimatedComponent';\nimport type { ILayoutAnimationBuilder } from '../layoutReanimation/animationBuilder/commonTypes';\nimport { LayoutAnimationConfig } from './LayoutAnimationConfig';\nimport type { AnimatedProps, AnimatedStyle } from '../helperTypes';\n\nconst AnimatedFlatList = createAnimatedComponent(FlatList);\n\ninterface CellRendererComponentProps {\n onLayout?: ((event: LayoutChangeEvent) => void) | undefined;\n children: React.ReactNode;\n style?: StyleProp<AnimatedStyle<ViewStyle>>;\n}\n\nconst createCellRendererComponent = (\n itemLayoutAnimationRef?: React.MutableRefObject<\n ILayoutAnimationBuilder | undefined\n >\n) => {\n const CellRendererComponent = (props: CellRendererComponentProps) => {\n return (\n <AnimatedView\n // TODO TYPESCRIPT This is temporary cast is to get rid of .d.ts file.\n layout={itemLayoutAnimationRef?.current as any}\n onLayout={props.onLayout}\n style={props.style}>\n {props.children}\n </AnimatedView>\n );\n };\n\n return CellRendererComponent;\n};\n\ninterface ReanimatedFlatListPropsWithLayout<T>\n extends AnimatedProps<FlatListProps<T>> {\n /**\n * Lets you pass layout animation directly to the FlatList item.\n */\n itemLayoutAnimation?: ILayoutAnimationBuilder;\n /**\n * Lets you skip entering and exiting animations of FlatList items when on FlatList mount or unmount.\n */\n skipEnteringExitingAnimations?: boolean;\n}\n\nexport type FlatListPropsWithLayout<T> = ReanimatedFlatListPropsWithLayout<T>;\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 AnimatedFlatListComplement<T> extends FlatList<T> {\n getNode(): FlatList<T>;\n}\n\n// We need explicit any here, because this is the exact same type that is used in React Native types.\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst FlatListForwardRefRender = function <Item = any>(\n props: ReanimatedFlatListPropsWithLayout<Item>,\n ref: React.ForwardedRef<FlatList>\n) {\n const { itemLayoutAnimation, skipEnteringExitingAnimations, ...restProps } =\n props;\n\n // Set default scrollEventThrottle, because user expects\n // to have continuous scroll events and\n // react-native defaults it to 50 for FlatLists.\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 const itemLayoutAnimationRef = useRef(itemLayoutAnimation);\n itemLayoutAnimationRef.current = itemLayoutAnimation;\n\n const CellRendererComponent = React.useMemo(\n () => createCellRendererComponent(itemLayoutAnimationRef),\n [itemLayoutAnimationRef]\n );\n\n const animatedFlatList = (\n // @ts-expect-error In its current type state, createAnimatedComponent cannot create generic components.\n <AnimatedFlatList\n ref={ref}\n {...restProps}\n CellRendererComponent={CellRendererComponent}\n />\n );\n\n if (skipEnteringExitingAnimations === undefined) {\n return animatedFlatList;\n }\n\n return (\n <LayoutAnimationConfig skipEntering skipExiting>\n {animatedFlatList}\n </LayoutAnimationConfig>\n );\n};\n\nexport const ReanimatedFlatList = forwardRef(FlatListForwardRefRender) as <\n // We need explicit any here, because this is the exact same type that is used in React Native types.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ItemT = any\n>(\n props: ReanimatedFlatListPropsWithLayout<ItemT> & {\n ref?: React.ForwardedRef<FlatList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BP,KAA8C,EAC9CQ,GAAiC,EACjC;EACA,MAAM;IAAEC,mBAAmB;IAAEC,6BAA6B;IAAE,GAAGC;EAAU,CAAC,GACxEX,KAAK;;EAEP;EACA;EACA;EACA;EACA;EACA,IAAI,EAAE,qBAAqB,IAAIW,SAAS,CAAC,EAAE;IACzCA,SAAS,CAACC,mBAAmB,GAAG,CAAC;EACnC;EAEA,MAAMd,sBAAsB,GAAGP,MAAM,CAACkB,mBAAmB,CAAC;EAC1DX,sBAAsB,CAACK,OAAO,GAAGM,mBAAmB;EAEpD,MAAMV,qBAAqB,GAAGV,KAAK,CAACwB,OAAO,CACzC,MAAMhB,2BAA2B,CAACC,sBAAsB,CAAC,EACzD,CAACA,sBAAsB,CACzB,CAAC;EAED,MAAMgB,gBAAgB;EAAA;EACpB;EACAzB,KAAA,CAAAY,aAAA,CAACL,gBAAgB,EAAArB,QAAA;IACfiC,GAAG,EAAEA;EAAI,GACLG,SAAS;IACbZ,qBAAqB,EAAEA;EAAsB,EAC9C,CACF;EAED,IAAIW,6BAA6B,KAAKK,SAAS,EAAE;IAC/C,OAAOD,gBAAgB;EACzB;EAEA,oBACEzB,KAAA,CAAAY,aAAA,CAACN,qBAAqB;IAACqB,YAAY;IAACC,WAAW;EAAA,GAC5CH,gBACoB,CAAC;AAE5B,CAAC;AAED,OAAO,MAAMI,kBAAkB,gBAAG5B,UAAU,CAACiB,wBAAwB,CAQ9C","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 AnimatedImage = createAnimatedComponent(Image);
9
10
  //# sourceMappingURL=Image.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["Image","createAnimatedComponent","AnimatedImage"],"sources":["Image.ts"],"sourcesContent":["'use strict';\nimport { Image } 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 AnimatedImageComplement extends Image {\n getNode(): Image;\n}\n\nexport const AnimatedImage = createAnimatedComponent(Image);\n\nexport type AnimatedImage = typeof AnimatedImage & AnimatedImageComplement;\n"],"mappings":"AAAA,YAAY;;AACZ,SAASA,KAAK,QAAQ,cAAc;AACpC,SAASC,uBAAuB,QAAQ,+BAA+B;;AAEvE;AACA;AAKA,OAAO,MAAMC,aAAa,GAAGD,uBAAuB,CAACD,KAAK,CAAC"}
1
+ {"version":3,"names":["Image","createAnimatedComponent","AnimatedImage"],"sources":["Image.ts"],"sourcesContent":["'use strict';\nimport { Image } 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 AnimatedImageComplement extends Image {\n getNode(): Image;\n}\n\nexport const AnimatedImage = createAnimatedComponent(Image);\n\nexport type AnimatedImage = typeof AnimatedImage & AnimatedImageComplement;\n"],"mappings":"AAAA,YAAY;;AACZ,SAASA,KAAK,QAAQ,cAAc;AACpC,SAASC,uBAAuB,QAAQ,+BAA+B;;AAEvE;AACA;;AAKA,OAAO,MAAMC,aAAa,GAAGD,uBAAuB,CAACD,KAAK,CAAC","ignoreList":[]}
@@ -7,6 +7,7 @@ export const SkipEnteringContext = /*#__PURE__*/createContext(null);
7
7
 
8
8
  // skipEntering - don't animate entering of children on wrapper mount
9
9
  // skipExiting - don't animate exiting of children on wrapper unmount
10
+
10
11
  function SkipEntering(props) {
11
12
  const skipValueRef = useRef(props.shouldSkip);
12
13
  useEffect(() => {
@@ -1 +1 @@
1
- {"version":3,"names":["React","Children","Component","createContext","useEffect","useRef","setShouldAnimateExitingForTag","findNodeHandle","SkipEnteringContext","SkipEntering","props","skipValueRef","shouldSkip","current","createElement","Provider","value","children","LayoutAnimationConfig","getMaybeWrappedChildren","count","skipExiting","map","child","setShouldAnimateExiting","tag","componentWillUnmount","undefined","render","skipEntering"],"sources":["LayoutAnimationConfig.tsx"],"sourcesContent":["'use strict';\nimport React, {\n Children,\n Component,\n createContext,\n useEffect,\n useRef,\n} from 'react';\nimport type { ReactNode } from 'react';\nimport { setShouldAnimateExitingForTag } from '../core';\nimport { findNodeHandle } from 'react-native';\n\nexport const SkipEnteringContext =\n createContext<React.MutableRefObject<boolean> | null>(null);\n\n// skipEntering - don't animate entering of children on wrapper mount\n// skipExiting - don't animate exiting of children on wrapper unmount\ninterface LayoutAnimationConfigProps {\n skipEntering?: boolean;\n skipExiting?: boolean;\n children: ReactNode;\n}\n\nfunction SkipEntering(props: { shouldSkip: boolean; children: ReactNode }) {\n const skipValueRef = useRef(props.shouldSkip);\n\n useEffect(() => {\n skipValueRef.current = false;\n }, [skipValueRef]);\n\n return (\n <SkipEnteringContext.Provider value={skipValueRef}>\n {props.children}\n </SkipEnteringContext.Provider>\n );\n}\n\n// skipExiting (unlike skipEntering) cannot be done by conditionally\n// configuring the animation in `createAnimatedComponent`, since at this stage\n// we don't know if the wrapper is going to be unmounted or not.\n// That's why we need to pass the skipExiting flag to the native side\n// when the wrapper is unmounted to prevent the animation.\n// Since `ReactNode` can be a list of nodes, we wrap every child with our wrapper\n// so we are able to access its tag with `findNodeHandle`.\n/**\n * A component that lets you skip entering and exiting animations.\n *\n * @param skipEntering - A boolean indicating whether children's entering animations should be skipped when `LayoutAnimationConfig` is mounted.\n * @param skipExiting - A boolean indicating whether children's exiting animations should be skipped when LayoutAnimationConfig is unmounted.\n * @see https://docs.swmansion.com/react-native-reanimated/docs/layout-animations/layout-animation-config/\n */\nexport class LayoutAnimationConfig extends Component<LayoutAnimationConfigProps> {\n getMaybeWrappedChildren() {\n return Children.count(this.props.children) > 1 && this.props.skipExiting\n ? Children.map(this.props.children, (child) => (\n <LayoutAnimationConfig skipExiting>{child}</LayoutAnimationConfig>\n ))\n : this.props.children;\n }\n\n setShouldAnimateExiting() {\n if (Children.count(this.props.children) === 1) {\n const tag = findNodeHandle(this);\n if (tag) {\n setShouldAnimateExitingForTag(tag, !this.props.skipExiting);\n }\n }\n }\n\n componentWillUnmount(): void {\n if (this.props.skipExiting !== undefined) {\n this.setShouldAnimateExiting();\n }\n }\n\n render(): ReactNode {\n const children = this.getMaybeWrappedChildren();\n\n if (this.props.skipEntering === undefined) {\n return children;\n }\n\n return (\n <SkipEntering shouldSkip={this.props.skipEntering}>\n {children}\n </SkipEntering>\n );\n }\n}\n"],"mappings":"AAAA,YAAY;;AACZ,OAAOA,KAAK,IACVC,QAAQ,EACRC,SAAS,EACTC,aAAa,EACbC,SAAS,EACTC,MAAM,QACD,OAAO;AAEd,SAASC,6BAA6B,QAAQ,SAAS;AACvD,SAASC,cAAc,QAAQ,cAAc;AAE7C,OAAO,MAAMC,mBAAmB,gBAC9BL,aAAa,CAAyC,IAAI,CAAC;;AAE7D;AACA;AAOA,SAASM,YAAYA,CAACC,KAAmD,EAAE;EACzE,MAAMC,YAAY,GAAGN,MAAM,CAACK,KAAK,CAACE,UAAU,CAAC;EAE7CR,SAAS,CAAC,MAAM;IACdO,YAAY,CAACE,OAAO,GAAG,KAAK;EAC9B,CAAC,EAAE,CAACF,YAAY,CAAC,CAAC;EAElB,oBACEX,KAAA,CAAAc,aAAA,CAACN,mBAAmB,CAACO,QAAQ;IAACC,KAAK,EAAEL;EAAa,GAC/CD,KAAK,CAACO,QAAQ,CACc;AAEnC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,qBAAqB,SAAShB,SAAS,CAA6B;EAC/EiB,uBAAuBA,CAAA,EAAG;IACxB,OAAOlB,QAAQ,CAACmB,KAAK,CAAC,IAAI,CAACV,KAAK,CAACO,QAAQ,CAAC,GAAG,CAAC,IAAI,IAAI,CAACP,KAAK,CAACW,WAAW,GACpEpB,QAAQ,CAACqB,GAAG,CAAC,IAAI,CAACZ,KAAK,CAACO,QAAQ,EAAGM,KAAK,iBACtCvB,KAAA,CAAAc,aAAA,CAACI,qBAAqB;MAACG,WAAW;IAAA,GAAEE,KAAK,CAC1C,CAAC,GACF,IAAI,CAACb,KAAK,CAACO,QAAQ;EACzB;EAEAO,uBAAuBA,CAAA,EAAG;IACxB,IAAIvB,QAAQ,CAACmB,KAAK,CAAC,IAAI,CAACV,KAAK,CAACO,QAAQ,CAAC,KAAK,CAAC,EAAE;MAC7C,MAAMQ,GAAG,GAAGlB,cAAc,CAAC,IAAI,CAAC;MAChC,IAAIkB,GAAG,EAAE;QACPnB,6BAA6B,CAACmB,GAAG,EAAE,CAAC,IAAI,CAACf,KAAK,CAACW,WAAW,CAAC;MAC7D;IACF;EACF;EAEAK,oBAAoBA,CAAA,EAAS;IAC3B,IAAI,IAAI,CAAChB,KAAK,CAACW,WAAW,KAAKM,SAAS,EAAE;MACxC,IAAI,CAACH,uBAAuB,EAAE;IAChC;EACF;EAEAI,MAAMA,CAAA,EAAc;IAClB,MAAMX,QAAQ,GAAG,IAAI,CAACE,uBAAuB,EAAE;IAE/C,IAAI,IAAI,CAACT,KAAK,CAACmB,YAAY,KAAKF,SAAS,EAAE;MACzC,OAAOV,QAAQ;IACjB;IAEA,oBACEjB,KAAA,CAAAc,aAAA,CAACL,YAAY;MAACG,UAAU,EAAE,IAAI,CAACF,KAAK,CAACmB;IAAa,GAC/CZ,QAAQ,CACI;EAEnB;AACF"}
1
+ {"version":3,"names":["React","Children","Component","createContext","useEffect","useRef","setShouldAnimateExitingForTag","findNodeHandle","SkipEnteringContext","SkipEntering","props","skipValueRef","shouldSkip","current","createElement","Provider","value","children","LayoutAnimationConfig","getMaybeWrappedChildren","count","skipExiting","map","child","setShouldAnimateExiting","tag","componentWillUnmount","undefined","render","skipEntering"],"sources":["LayoutAnimationConfig.tsx"],"sourcesContent":["'use strict';\nimport React, {\n Children,\n Component,\n createContext,\n useEffect,\n useRef,\n} from 'react';\nimport type { ReactNode } from 'react';\nimport { setShouldAnimateExitingForTag } from '../core';\nimport { findNodeHandle } from 'react-native';\n\nexport const SkipEnteringContext =\n createContext<React.MutableRefObject<boolean> | null>(null);\n\n// skipEntering - don't animate entering of children on wrapper mount\n// skipExiting - don't animate exiting of children on wrapper unmount\ninterface LayoutAnimationConfigProps {\n skipEntering?: boolean;\n skipExiting?: boolean;\n children: ReactNode;\n}\n\nfunction SkipEntering(props: { shouldSkip: boolean; children: ReactNode }) {\n const skipValueRef = useRef(props.shouldSkip);\n\n useEffect(() => {\n skipValueRef.current = false;\n }, [skipValueRef]);\n\n return (\n <SkipEnteringContext.Provider value={skipValueRef}>\n {props.children}\n </SkipEnteringContext.Provider>\n );\n}\n\n// skipExiting (unlike skipEntering) cannot be done by conditionally\n// configuring the animation in `createAnimatedComponent`, since at this stage\n// we don't know if the wrapper is going to be unmounted or not.\n// That's why we need to pass the skipExiting flag to the native side\n// when the wrapper is unmounted to prevent the animation.\n// Since `ReactNode` can be a list of nodes, we wrap every child with our wrapper\n// so we are able to access its tag with `findNodeHandle`.\n/**\n * A component that lets you skip entering and exiting animations.\n *\n * @param skipEntering - A boolean indicating whether children's entering animations should be skipped when `LayoutAnimationConfig` is mounted.\n * @param skipExiting - A boolean indicating whether children's exiting animations should be skipped when LayoutAnimationConfig is unmounted.\n * @see https://docs.swmansion.com/react-native-reanimated/docs/layout-animations/layout-animation-config/\n */\nexport class LayoutAnimationConfig extends Component<LayoutAnimationConfigProps> {\n getMaybeWrappedChildren() {\n return Children.count(this.props.children) > 1 && this.props.skipExiting\n ? Children.map(this.props.children, (child) => (\n <LayoutAnimationConfig skipExiting>{child}</LayoutAnimationConfig>\n ))\n : this.props.children;\n }\n\n setShouldAnimateExiting() {\n if (Children.count(this.props.children) === 1) {\n const tag = findNodeHandle(this);\n if (tag) {\n setShouldAnimateExitingForTag(tag, !this.props.skipExiting);\n }\n }\n }\n\n componentWillUnmount(): void {\n if (this.props.skipExiting !== undefined) {\n this.setShouldAnimateExiting();\n }\n }\n\n render(): ReactNode {\n const children = this.getMaybeWrappedChildren();\n\n if (this.props.skipEntering === undefined) {\n return children;\n }\n\n return (\n <SkipEntering shouldSkip={this.props.skipEntering}>\n {children}\n </SkipEntering>\n );\n }\n}\n"],"mappings":"AAAA,YAAY;;AACZ,OAAOA,KAAK,IACVC,QAAQ,EACRC,SAAS,EACTC,aAAa,EACbC,SAAS,EACTC,MAAM,QACD,OAAO;AAEd,SAASC,6BAA6B,QAAQ,SAAS;AACvD,SAASC,cAAc,QAAQ,cAAc;AAE7C,OAAO,MAAMC,mBAAmB,gBAC9BL,aAAa,CAAyC,IAAI,CAAC;;AAE7D;AACA;;AAOA,SAASM,YAAYA,CAACC,KAAmD,EAAE;EACzE,MAAMC,YAAY,GAAGN,MAAM,CAACK,KAAK,CAACE,UAAU,CAAC;EAE7CR,SAAS,CAAC,MAAM;IACdO,YAAY,CAACE,OAAO,GAAG,KAAK;EAC9B,CAAC,EAAE,CAACF,YAAY,CAAC,CAAC;EAElB,oBACEX,KAAA,CAAAc,aAAA,CAACN,mBAAmB,CAACO,QAAQ;IAACC,KAAK,EAAEL;EAAa,GAC/CD,KAAK,CAACO,QACqB,CAAC;AAEnC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,qBAAqB,SAAShB,SAAS,CAA6B;EAC/EiB,uBAAuBA,CAAA,EAAG;IACxB,OAAOlB,QAAQ,CAACmB,KAAK,CAAC,IAAI,CAACV,KAAK,CAACO,QAAQ,CAAC,GAAG,CAAC,IAAI,IAAI,CAACP,KAAK,CAACW,WAAW,GACpEpB,QAAQ,CAACqB,GAAG,CAAC,IAAI,CAACZ,KAAK,CAACO,QAAQ,EAAGM,KAAK,iBACtCvB,KAAA,CAAAc,aAAA,CAACI,qBAAqB;MAACG,WAAW;IAAA,GAAEE,KAA6B,CAClE,CAAC,GACF,IAAI,CAACb,KAAK,CAACO,QAAQ;EACzB;EAEAO,uBAAuBA,CAAA,EAAG;IACxB,IAAIvB,QAAQ,CAACmB,KAAK,CAAC,IAAI,CAACV,KAAK,CAACO,QAAQ,CAAC,KAAK,CAAC,EAAE;MAC7C,MAAMQ,GAAG,GAAGlB,cAAc,CAAC,IAAI,CAAC;MAChC,IAAIkB,GAAG,EAAE;QACPnB,6BAA6B,CAACmB,GAAG,EAAE,CAAC,IAAI,CAACf,KAAK,CAACW,WAAW,CAAC;MAC7D;IACF;EACF;EAEAK,oBAAoBA,CAAA,EAAS;IAC3B,IAAI,IAAI,CAAChB,KAAK,CAACW,WAAW,KAAKM,SAAS,EAAE;MACxC,IAAI,CAACH,uBAAuB,CAAC,CAAC;IAChC;EACF;EAEAI,MAAMA,CAAA,EAAc;IAClB,MAAMX,QAAQ,GAAG,IAAI,CAACE,uBAAuB,CAAC,CAAC;IAE/C,IAAI,IAAI,CAACT,KAAK,CAACmB,YAAY,KAAKF,SAAS,EAAE;MACzC,OAAOV,QAAQ;IACjB;IAEA,oBACEjB,KAAA,CAAAc,aAAA,CAACL,YAAY;MAACG,UAAU,EAAE,IAAI,CAACF,KAAK,CAACmB;IAAa,GAC/CZ,QACW,CAAC;EAEnB;AACF","ignoreList":[]}
@@ -0,0 +1,169 @@
1
+ 'use strict';
2
+
3
+ import React, { useEffect, useRef } from 'react';
4
+ import { TextInput, StyleSheet, View } from 'react-native';
5
+ import { useSharedValue, useAnimatedProps, useFrameCallback } from '../hook';
6
+ import { createAnimatedComponent } from '../../createAnimatedComponent';
7
+ import { addWhitelistedNativeProps } from '../../ConfigHelper';
8
+ function createCircularDoublesBuffer(size) {
9
+ 'worklet';
10
+
11
+ return {
12
+ next: 0,
13
+ buffer: new Float32Array(size),
14
+ size,
15
+ count: 0,
16
+ push(value) {
17
+ const oldValue = this.buffer[this.next];
18
+ const oldCount = this.count;
19
+ this.buffer[this.next] = value;
20
+ this.next = (this.next + 1) % this.size;
21
+ this.count = Math.min(this.size, this.count + 1);
22
+ return oldCount === this.size ? oldValue : null;
23
+ },
24
+ front() {
25
+ const notEmpty = this.count > 0;
26
+ if (notEmpty) {
27
+ const current = this.next - 1;
28
+ const index = current < 0 ? this.size - 1 : current;
29
+ return this.buffer[index];
30
+ }
31
+ return null;
32
+ },
33
+ back() {
34
+ const notEmpty = this.count > 0;
35
+ return notEmpty ? this.buffer[this.next] : null;
36
+ }
37
+ };
38
+ }
39
+ const DEFAULT_BUFFER_SIZE = 60;
40
+ addWhitelistedNativeProps({
41
+ text: true
42
+ });
43
+ const AnimatedTextInput = createAnimatedComponent(TextInput);
44
+ function loopAnimationFrame(fn) {
45
+ let lastTime = 0;
46
+ function loop() {
47
+ requestAnimationFrame(time => {
48
+ if (lastTime > 0) {
49
+ fn(lastTime, time);
50
+ }
51
+ lastTime = time;
52
+ requestAnimationFrame(loop);
53
+ });
54
+ }
55
+ loop();
56
+ }
57
+ function getFps(renderTimeInMs) {
58
+ 'worklet';
59
+
60
+ return 1000 / renderTimeInMs;
61
+ }
62
+ function getTimeDelta(timestamp, previousTimestamp) {
63
+ 'worklet';
64
+
65
+ return previousTimestamp !== null ? timestamp - previousTimestamp : 0;
66
+ }
67
+ function completeBufferRoutine(buffer, timestamp, previousTimestamp, totalRenderTime) {
68
+ 'worklet';
69
+
70
+ timestamp = Math.round(timestamp);
71
+ previousTimestamp = Math.round(previousTimestamp) ?? timestamp;
72
+ const droppedTimestamp = buffer.push(timestamp);
73
+ const nextToDrop = buffer.back();
74
+ const delta = getTimeDelta(timestamp, previousTimestamp);
75
+ const droppedDelta = getTimeDelta(nextToDrop, droppedTimestamp);
76
+ totalRenderTime.value += delta - droppedDelta;
77
+ return getFps(totalRenderTime.value / buffer.count);
78
+ }
79
+ function JsPerformance() {
80
+ const jsFps = useSharedValue(null);
81
+ const totalRenderTime = useSharedValue(0);
82
+ const circularBuffer = useRef(createCircularDoublesBuffer(DEFAULT_BUFFER_SIZE));
83
+ useEffect(() => {
84
+ loopAnimationFrame((_, timestamp) => {
85
+ timestamp = Math.round(timestamp);
86
+ const previousTimestamp = circularBuffer.current.front() ?? timestamp;
87
+ const currentFps = completeBufferRoutine(circularBuffer.current, timestamp, previousTimestamp, totalRenderTime);
88
+
89
+ // JS fps have to be measured every 2nd frame,
90
+ // thus 2x multiplication has to occur here
91
+ jsFps.value = (currentFps * 2).toFixed(0);
92
+ });
93
+ }, []);
94
+ const animatedProps = useAnimatedProps(() => {
95
+ const text = 'JS: ' + jsFps.value ?? 'N/A';
96
+ return {
97
+ text,
98
+ defaultValue: text
99
+ };
100
+ });
101
+ return /*#__PURE__*/React.createElement(View, {
102
+ style: styles.container
103
+ }, /*#__PURE__*/React.createElement(AnimatedTextInput, {
104
+ style: styles.text,
105
+ animatedProps: animatedProps,
106
+ editable: false
107
+ }));
108
+ }
109
+ function UiPerformance() {
110
+ const uiFps = useSharedValue(null);
111
+ const totalRenderTime = useSharedValue(0);
112
+ const circularBuffer = useSharedValue(null);
113
+ useFrameCallback(({
114
+ timestamp
115
+ }) => {
116
+ if (circularBuffer.value === null) {
117
+ circularBuffer.value = createCircularDoublesBuffer(DEFAULT_BUFFER_SIZE);
118
+ }
119
+ timestamp = Math.round(timestamp);
120
+ const previousTimestamp = circularBuffer.value.front() ?? timestamp;
121
+ const currentFps = completeBufferRoutine(circularBuffer.value, timestamp, previousTimestamp, totalRenderTime);
122
+ uiFps.value = currentFps.toFixed(0);
123
+ });
124
+ const animatedProps = useAnimatedProps(() => {
125
+ const text = 'UI: ' + uiFps.value ?? 'N/A';
126
+ return {
127
+ text,
128
+ defaultValue: text
129
+ };
130
+ });
131
+ return /*#__PURE__*/React.createElement(View, {
132
+ style: styles.container
133
+ }, /*#__PURE__*/React.createElement(AnimatedTextInput, {
134
+ style: styles.text,
135
+ animatedProps: animatedProps,
136
+ editable: false
137
+ }));
138
+ }
139
+ export function PerformanceMonitor() {
140
+ return /*#__PURE__*/React.createElement(View, {
141
+ style: styles.monitor
142
+ }, /*#__PURE__*/React.createElement(JsPerformance, null), /*#__PURE__*/React.createElement(UiPerformance, null));
143
+ }
144
+ const styles = StyleSheet.create({
145
+ monitor: {
146
+ flexDirection: 'row',
147
+ position: 'absolute',
148
+ backgroundColor: '#0006',
149
+ zIndex: 1000
150
+ },
151
+ header: {
152
+ fontSize: 14,
153
+ color: '#ffff',
154
+ paddingHorizontal: 5
155
+ },
156
+ text: {
157
+ fontSize: 13,
158
+ color: '#ffff',
159
+ fontFamily: 'monospace',
160
+ paddingHorizontal: 3
161
+ },
162
+ container: {
163
+ alignItems: 'center',
164
+ justifyContent: 'center',
165
+ flexDirection: 'row',
166
+ flexWrap: 'wrap'
167
+ }
168
+ });
169
+ //# sourceMappingURL=PerformanceMonitor.js.map
@@ -0,0 +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","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,KAAK,IAAI,CAACR,IAAI,GAAGO,QAAQ,GAAG,IAAI;IACjD,CAAC;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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":[]}