react-native-reanimated 3.0.2 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (473) hide show
  1. package/Common/cpp/Fabric/FabricUtils.h +1 -1
  2. package/Common/cpp/NativeModules/NativeReanimatedModule.cpp +38 -27
  3. package/Common/cpp/SharedItems/Shareables.h +22 -0
  4. package/Common/cpp/Tools/PlatformDepMethodsHolder.h +2 -0
  5. package/Common/cpp/Tools/RuntimeDecorator.cpp +4 -1
  6. package/Common/cpp/Tools/RuntimeDecorator.h +2 -1
  7. package/Common/cpp/Tools/SingleInstanceChecker.h +14 -2
  8. package/RNReanimated.podspec +5 -2
  9. package/android/CMakeLists.txt +4 -0
  10. package/android/build.gradle +18 -10
  11. package/android/src/main/cpp/NativeProxy.cpp +316 -337
  12. package/android/src/main/cpp/NativeProxy.h +53 -11
  13. package/android/src/main/java/com/swmansion/reanimated/NativeMethodsHelper.java +7 -12
  14. package/android/src/main/java/com/swmansion/reanimated/NodesManager.java +11 -8
  15. package/android/src/main/java/com/swmansion/reanimated/nativeProxy/NativeProxyCommon.java +21 -14
  16. package/android/src/paper/java/com/swmansion/reanimated/NativeProxy.java +0 -3
  17. package/ios/Fabric/REAInitializerRCTFabricSurface.mm +1 -0
  18. package/ios/REANodesManager.h +1 -0
  19. package/ios/REANodesManager.mm +30 -4
  20. package/ios/keyboardObserver/REAKeyboardEventObserver.m +51 -130
  21. package/ios/native/NativeMethods.mm +1 -1
  22. package/ios/native/NativeProxy.mm +4 -1
  23. package/ios/native/REAIOSErrorHandler.mm +1 -1
  24. package/ios/native/REAIOSLogger.mm +1 -1
  25. package/ios/native/REAIOSScheduler.mm +1 -1
  26. package/ios/native/REAInitializer.mm +1 -1
  27. package/ios/native/REAMessageThread.mm +2 -2
  28. package/lib/commonjs/Animated.js +0 -8
  29. package/lib/commonjs/Animated.js.map +1 -1
  30. package/lib/commonjs/ConfigHelper.js +8 -19
  31. package/lib/commonjs/ConfigHelper.js.map +1 -1
  32. package/lib/commonjs/createAnimatedComponent.js +20 -158
  33. package/lib/commonjs/createAnimatedComponent.js.map +1 -1
  34. package/lib/commonjs/index.js +0 -9
  35. package/lib/commonjs/index.js.map +1 -1
  36. package/lib/commonjs/index.web.js +0 -7
  37. package/lib/commonjs/index.web.js.map +1 -1
  38. package/lib/commonjs/reanimated2/Bezier.js +14 -34
  39. package/lib/commonjs/reanimated2/Bezier.js.map +1 -1
  40. package/lib/commonjs/reanimated2/Colors.js +60 -132
  41. package/lib/commonjs/reanimated2/Colors.js.map +1 -1
  42. package/lib/commonjs/reanimated2/Easing.js +81 -34
  43. package/lib/commonjs/reanimated2/Easing.js.map +1 -1
  44. package/lib/commonjs/reanimated2/NativeMethods.js +8 -20
  45. package/lib/commonjs/reanimated2/NativeMethods.js.map +1 -1
  46. package/lib/commonjs/reanimated2/NativeReanimated/NativeReanimated.js +5 -31
  47. package/lib/commonjs/reanimated2/NativeReanimated/NativeReanimated.js.map +1 -1
  48. package/lib/commonjs/reanimated2/NativeReanimated/index.js +0 -7
  49. package/lib/commonjs/reanimated2/NativeReanimated/index.js.map +1 -1
  50. package/lib/commonjs/reanimated2/PlatformChecker.js +0 -6
  51. package/lib/commonjs/reanimated2/PlatformChecker.js.map +1 -1
  52. package/lib/commonjs/reanimated2/PropAdapters.js +10 -12
  53. package/lib/commonjs/reanimated2/PropAdapters.js.map +1 -1
  54. package/lib/commonjs/reanimated2/UpdateProps.js +3 -12
  55. package/lib/commonjs/reanimated2/UpdateProps.js.map +1 -1
  56. package/lib/commonjs/reanimated2/ViewDescriptorsSet.js +0 -10
  57. package/lib/commonjs/reanimated2/ViewDescriptorsSet.js.map +1 -1
  58. package/lib/commonjs/reanimated2/WorkletEventHandler.js +5 -22
  59. package/lib/commonjs/reanimated2/WorkletEventHandler.js.map +1 -1
  60. package/lib/commonjs/reanimated2/animation/decay.js +7 -18
  61. package/lib/commonjs/reanimated2/animation/decay.js.map +1 -1
  62. package/lib/commonjs/reanimated2/animation/delay.js +0 -11
  63. package/lib/commonjs/reanimated2/animation/delay.js.map +1 -1
  64. package/lib/commonjs/reanimated2/animation/index.js +0 -8
  65. package/lib/commonjs/reanimated2/animation/index.js.map +1 -1
  66. package/lib/commonjs/reanimated2/animation/repeat.js +6 -22
  67. package/lib/commonjs/reanimated2/animation/repeat.js.map +1 -1
  68. package/lib/commonjs/reanimated2/animation/sequence.js +3 -20
  69. package/lib/commonjs/reanimated2/animation/sequence.js.map +1 -1
  70. package/lib/commonjs/reanimated2/animation/spring.js +11 -23
  71. package/lib/commonjs/reanimated2/animation/spring.js.map +1 -1
  72. package/lib/commonjs/reanimated2/animation/styleAnimation.js +3 -35
  73. package/lib/commonjs/reanimated2/animation/styleAnimation.js.map +1 -1
  74. package/lib/commonjs/reanimated2/animation/timing.js +0 -11
  75. package/lib/commonjs/reanimated2/animation/timing.js.map +1 -1
  76. package/lib/commonjs/reanimated2/animation/util.js +11 -41
  77. package/lib/commonjs/reanimated2/animation/util.js.map +1 -1
  78. package/lib/commonjs/reanimated2/commonTypes.js +16 -23
  79. package/lib/commonjs/reanimated2/commonTypes.js.map +1 -1
  80. package/lib/commonjs/reanimated2/component/FlatList.js +0 -16
  81. package/lib/commonjs/reanimated2/component/FlatList.js.map +1 -1
  82. package/lib/commonjs/reanimated2/component/Image.js +0 -4
  83. package/lib/commonjs/reanimated2/component/Image.js.map +1 -1
  84. package/lib/commonjs/reanimated2/component/ScrollView.js +0 -4
  85. package/lib/commonjs/reanimated2/component/ScrollView.js.map +1 -1
  86. package/lib/commonjs/reanimated2/component/Text.js +0 -4
  87. package/lib/commonjs/reanimated2/component/Text.js.map +1 -1
  88. package/lib/commonjs/reanimated2/component/View.js +0 -4
  89. package/lib/commonjs/reanimated2/component/View.js.map +1 -1
  90. package/lib/commonjs/reanimated2/core.js +6 -48
  91. package/lib/commonjs/reanimated2/core.js.map +1 -1
  92. package/lib/commonjs/reanimated2/errors.js +3 -14
  93. package/lib/commonjs/reanimated2/errors.js.map +1 -1
  94. package/lib/commonjs/reanimated2/fabricUtils.js +3 -5
  95. package/lib/commonjs/reanimated2/fabricUtils.js.map +1 -1
  96. package/lib/commonjs/reanimated2/fabricUtils.web.js +1 -3
  97. package/lib/commonjs/reanimated2/fabricUtils.web.js.map +1 -1
  98. package/lib/commonjs/reanimated2/frameCallback/FrameCallbackRegistryJS.js +3 -12
  99. package/lib/commonjs/reanimated2/frameCallback/FrameCallbackRegistryJS.js.map +1 -1
  100. package/lib/commonjs/reanimated2/frameCallback/FrameCallbackRegistryUI.js +13 -17
  101. package/lib/commonjs/reanimated2/frameCallback/FrameCallbackRegistryUI.js.map +1 -1
  102. package/lib/commonjs/reanimated2/globals.d.js.map +1 -1
  103. package/lib/commonjs/reanimated2/hook/Hooks.js +0 -5
  104. package/lib/commonjs/reanimated2/hook/Hooks.js.map +1 -1
  105. package/lib/commonjs/reanimated2/hook/commonTypes.js.map +1 -1
  106. package/lib/commonjs/reanimated2/hook/index.js +0 -12
  107. package/lib/commonjs/reanimated2/hook/index.js.map +1 -1
  108. package/lib/commonjs/reanimated2/hook/useAnimatedGestureHandler.js +4 -17
  109. package/lib/commonjs/reanimated2/hook/useAnimatedGestureHandler.js.map +1 -1
  110. package/lib/commonjs/reanimated2/hook/useAnimatedKeyboard.js +2 -9
  111. package/lib/commonjs/reanimated2/hook/useAnimatedKeyboard.js.map +1 -1
  112. package/lib/commonjs/reanimated2/hook/useAnimatedReaction.js +1 -11
  113. package/lib/commonjs/reanimated2/hook/useAnimatedReaction.js.map +1 -1
  114. package/lib/commonjs/reanimated2/hook/useAnimatedRef.js +0 -12
  115. package/lib/commonjs/reanimated2/hook/useAnimatedRef.js.map +1 -1
  116. package/lib/commonjs/reanimated2/hook/useAnimatedScrollHandler.js +2 -9
  117. package/lib/commonjs/reanimated2/hook/useAnimatedScrollHandler.js.map +1 -1
  118. package/lib/commonjs/reanimated2/hook/useAnimatedSensor.js +8 -23
  119. package/lib/commonjs/reanimated2/hook/useAnimatedSensor.js.map +1 -1
  120. package/lib/commonjs/reanimated2/hook/useAnimatedStyle.js +13 -71
  121. package/lib/commonjs/reanimated2/hook/useAnimatedStyle.js.map +1 -1
  122. package/lib/commonjs/reanimated2/hook/useDerivedValue.js +4 -13
  123. package/lib/commonjs/reanimated2/hook/useDerivedValue.js.map +1 -1
  124. package/lib/commonjs/reanimated2/hook/useFrameCallback.js +0 -5
  125. package/lib/commonjs/reanimated2/hook/useFrameCallback.js.map +1 -1
  126. package/lib/commonjs/reanimated2/hook/useScrollViewOffset.js +0 -7
  127. package/lib/commonjs/reanimated2/hook/useScrollViewOffset.js.map +1 -1
  128. package/lib/commonjs/reanimated2/hook/useSharedValue.js +2 -7
  129. package/lib/commonjs/reanimated2/hook/useSharedValue.js.map +1 -1
  130. package/lib/commonjs/reanimated2/hook/utils.js +8 -39
  131. package/lib/commonjs/reanimated2/hook/utils.js.map +1 -1
  132. package/lib/commonjs/reanimated2/index.js +0 -26
  133. package/lib/commonjs/reanimated2/index.js.map +1 -1
  134. package/lib/commonjs/reanimated2/initializers.js +21 -43
  135. package/lib/commonjs/reanimated2/initializers.js.map +1 -1
  136. package/lib/commonjs/reanimated2/interpolateColor.js +6 -43
  137. package/lib/commonjs/reanimated2/interpolateColor.js.map +1 -1
  138. package/lib/commonjs/reanimated2/interpolation.js +14 -29
  139. package/lib/commonjs/reanimated2/interpolation.js.map +1 -1
  140. package/lib/commonjs/reanimated2/jestUtils.js +11 -44
  141. package/lib/commonjs/reanimated2/jestUtils.js.map +1 -1
  142. package/lib/commonjs/reanimated2/js-reanimated/JSReanimated.js +15 -39
  143. package/lib/commonjs/reanimated2/js-reanimated/JSReanimated.js.map +1 -1
  144. package/lib/commonjs/reanimated2/js-reanimated/Mapper.js +9 -28
  145. package/lib/commonjs/reanimated2/js-reanimated/Mapper.js.map +1 -1
  146. package/lib/commonjs/reanimated2/js-reanimated/MapperRegistry.js +7 -37
  147. package/lib/commonjs/reanimated2/js-reanimated/MapperRegistry.js.map +1 -1
  148. package/lib/commonjs/reanimated2/js-reanimated/MutableValue.js +5 -18
  149. package/lib/commonjs/reanimated2/js-reanimated/MutableValue.js.map +1 -1
  150. package/lib/commonjs/reanimated2/js-reanimated/global.js +2 -9
  151. package/lib/commonjs/reanimated2/js-reanimated/global.js.map +1 -1
  152. package/lib/commonjs/reanimated2/js-reanimated/index.js +3 -14
  153. package/lib/commonjs/reanimated2/js-reanimated/index.js.map +1 -1
  154. package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.js +7 -26
  155. package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.js.map +1 -1
  156. package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.js +3 -49
  157. package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.js.map +1 -1
  158. package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/Keyframe.js +7 -43
  159. package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/Keyframe.js.map +1 -1
  160. package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/commonTypes.js +4 -5
  161. package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/commonTypes.js.map +1 -1
  162. package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/index.js +0 -4
  163. package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/index.js.map +1 -1
  164. package/lib/commonjs/reanimated2/layoutReanimation/animationsManager.js +4 -23
  165. package/lib/commonjs/reanimated2/layoutReanimation/animationsManager.js.map +1 -1
  166. package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Bounce.js +3 -74
  167. package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Bounce.js.map +1 -1
  168. package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Fade.js +3 -53
  169. package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Fade.js.map +1 -1
  170. package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Flip.js +3 -63
  171. package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Flip.js.map +1 -1
  172. package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.js +7 -26
  173. package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.js.map +1 -1
  174. package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.js +3 -13
  175. package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.js.map +1 -1
  176. package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Roll.js +3 -23
  177. package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Roll.js.map +1 -1
  178. package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Rotate.js +3 -43
  179. package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Rotate.js.map +1 -1
  180. package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Slide.js +3 -43
  181. package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Slide.js.map +1 -1
  182. package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Stretch.js +3 -23
  183. package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Stretch.js.map +1 -1
  184. package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Zoom.js +3 -83
  185. package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Zoom.js.map +1 -1
  186. package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/index.js +0 -20
  187. package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/index.js.map +1 -1
  188. package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.js +3 -22
  189. package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.js.map +1 -1
  190. package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.js +5 -29
  191. package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.js.map +1 -1
  192. package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.js +3 -9
  193. package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.js.map +1 -1
  194. package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.js +5 -11
  195. package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.js.map +1 -1
  196. package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.js +3 -8
  197. package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.js.map +1 -1
  198. package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.js +3 -12
  199. package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.js.map +1 -1
  200. package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/index.js +0 -12
  201. package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/index.js.map +1 -1
  202. package/lib/commonjs/reanimated2/layoutReanimation/index.js +0 -9
  203. package/lib/commonjs/reanimated2/layoutReanimation/index.js.map +1 -1
  204. package/lib/commonjs/reanimated2/layoutReanimation/sharedTransitions/index.js +3 -17
  205. package/lib/commonjs/reanimated2/layoutReanimation/sharedTransitions/index.js.map +1 -1
  206. package/lib/commonjs/reanimated2/mappers.js +26 -32
  207. package/lib/commonjs/reanimated2/mappers.js.map +1 -1
  208. package/lib/commonjs/reanimated2/mock.js +5 -15
  209. package/lib/commonjs/reanimated2/mock.js.map +1 -1
  210. package/lib/commonjs/reanimated2/mutables.js +2 -28
  211. package/lib/commonjs/reanimated2/mutables.js.map +1 -1
  212. package/lib/commonjs/reanimated2/platform-specific/RNRenderer.js +0 -2
  213. package/lib/commonjs/reanimated2/platform-specific/RNRenderer.js.map +1 -1
  214. package/lib/commonjs/reanimated2/platform-specific/RNRenderer.web.js.map +1 -1
  215. package/lib/commonjs/reanimated2/platform-specific/checkCppVersion.js +31 -0
  216. package/lib/commonjs/reanimated2/platform-specific/checkCppVersion.js.map +1 -0
  217. package/lib/commonjs/reanimated2/platform-specific/checkVersion.web.js +0 -2
  218. package/lib/commonjs/reanimated2/platform-specific/checkVersion.web.js.map +1 -1
  219. package/lib/commonjs/reanimated2/platform-specific/jsVersion.js +14 -0
  220. package/lib/commonjs/reanimated2/platform-specific/jsVersion.js.map +1 -0
  221. package/lib/commonjs/reanimated2/pluginUtils.js +0 -1
  222. package/lib/commonjs/reanimated2/pluginUtils.js.map +1 -1
  223. package/lib/commonjs/reanimated2/shareables.js +92 -49
  224. package/lib/commonjs/reanimated2/shareables.js.map +1 -1
  225. package/lib/commonjs/reanimated2/threads.js +42 -46
  226. package/lib/commonjs/reanimated2/threads.js.map +1 -1
  227. package/lib/commonjs/reanimated2/utils.js +0 -5
  228. package/lib/commonjs/reanimated2/utils.js.map +1 -1
  229. package/lib/commonjs/reanimated2/valueSetter.js +6 -21
  230. package/lib/commonjs/reanimated2/valueSetter.js.map +1 -1
  231. package/lib/commonjs/setAndForwardRef.js +3 -3
  232. package/lib/commonjs/setAndForwardRef.js.map +1 -1
  233. package/lib/module/Animated.js.map +1 -1
  234. package/lib/module/ConfigHelper.js +9 -15
  235. package/lib/module/ConfigHelper.js.map +1 -1
  236. package/lib/module/createAnimatedComponent.js +20 -139
  237. package/lib/module/createAnimatedComponent.js.map +1 -1
  238. package/lib/module/index.js +0 -2
  239. package/lib/module/index.js.map +1 -1
  240. package/lib/module/index.web.js.map +1 -1
  241. package/lib/module/reanimated2/Bezier.js +14 -33
  242. package/lib/module/reanimated2/Bezier.js.map +1 -1
  243. package/lib/module/reanimated2/Colors.js +59 -109
  244. package/lib/module/reanimated2/Colors.js.map +1 -1
  245. package/lib/module/reanimated2/Easing.js +37 -33
  246. package/lib/module/reanimated2/Easing.js.map +1 -1
  247. package/lib/module/reanimated2/NativeMethods.js +8 -15
  248. package/lib/module/reanimated2/NativeMethods.js.map +1 -1
  249. package/lib/module/reanimated2/NativeReanimated/NativeReanimated.js +5 -27
  250. package/lib/module/reanimated2/NativeReanimated/NativeReanimated.js.map +1 -1
  251. package/lib/module/reanimated2/NativeReanimated/index.js +0 -2
  252. package/lib/module/reanimated2/NativeReanimated/index.js.map +1 -1
  253. package/lib/module/reanimated2/PlatformChecker.js.map +1 -1
  254. package/lib/module/reanimated2/PropAdapters.js +12 -10
  255. package/lib/module/reanimated2/PropAdapters.js.map +1 -1
  256. package/lib/module/reanimated2/UpdateProps.js +3 -5
  257. package/lib/module/reanimated2/UpdateProps.js.map +1 -1
  258. package/lib/module/reanimated2/ViewDescriptorsSet.js +0 -6
  259. package/lib/module/reanimated2/ViewDescriptorsSet.js.map +1 -1
  260. package/lib/module/reanimated2/WorkletEventHandler.js +5 -18
  261. package/lib/module/reanimated2/WorkletEventHandler.js.map +1 -1
  262. package/lib/module/reanimated2/animation/decay.js +7 -15
  263. package/lib/module/reanimated2/animation/decay.js.map +1 -1
  264. package/lib/module/reanimated2/animation/delay.js +0 -9
  265. package/lib/module/reanimated2/animation/delay.js.map +1 -1
  266. package/lib/module/reanimated2/animation/index.js.map +1 -1
  267. package/lib/module/reanimated2/animation/repeat.js +6 -20
  268. package/lib/module/reanimated2/animation/repeat.js.map +1 -1
  269. package/lib/module/reanimated2/animation/sequence.js +3 -18
  270. package/lib/module/reanimated2/animation/sequence.js.map +1 -1
  271. package/lib/module/reanimated2/animation/spring.js +11 -21
  272. package/lib/module/reanimated2/animation/spring.js.map +1 -1
  273. package/lib/module/reanimated2/animation/styleAnimation.js +7 -31
  274. package/lib/module/reanimated2/animation/styleAnimation.js.map +1 -1
  275. package/lib/module/reanimated2/animation/timing.js +0 -8
  276. package/lib/module/reanimated2/animation/timing.js.map +1 -1
  277. package/lib/module/reanimated2/animation/util.js +10 -33
  278. package/lib/module/reanimated2/animation/util.js.map +1 -1
  279. package/lib/module/reanimated2/commonTypes.js +12 -19
  280. package/lib/module/reanimated2/commonTypes.js.map +1 -1
  281. package/lib/module/reanimated2/component/FlatList.js +0 -4
  282. package/lib/module/reanimated2/component/FlatList.js.map +1 -1
  283. package/lib/module/reanimated2/component/Image.js.map +1 -1
  284. package/lib/module/reanimated2/component/ScrollView.js.map +1 -1
  285. package/lib/module/reanimated2/component/Text.js.map +1 -1
  286. package/lib/module/reanimated2/component/View.js.map +1 -1
  287. package/lib/module/reanimated2/core.js +6 -22
  288. package/lib/module/reanimated2/core.js.map +1 -1
  289. package/lib/module/reanimated2/errors.js +3 -13
  290. package/lib/module/reanimated2/errors.js.map +1 -1
  291. package/lib/module/reanimated2/fabricUtils.js +3 -3
  292. package/lib/module/reanimated2/fabricUtils.js.map +1 -1
  293. package/lib/module/reanimated2/fabricUtils.web.js +1 -1
  294. package/lib/module/reanimated2/fabricUtils.web.js.map +1 -1
  295. package/lib/module/reanimated2/frameCallback/FrameCallbackRegistryJS.js +3 -8
  296. package/lib/module/reanimated2/frameCallback/FrameCallbackRegistryJS.js.map +1 -1
  297. package/lib/module/reanimated2/frameCallback/FrameCallbackRegistryUI.js +13 -15
  298. package/lib/module/reanimated2/frameCallback/FrameCallbackRegistryUI.js.map +1 -1
  299. package/lib/module/reanimated2/globals.d.js.map +1 -1
  300. package/lib/module/reanimated2/hook/Hooks.js +3 -2
  301. package/lib/module/reanimated2/hook/Hooks.js.map +1 -1
  302. package/lib/module/reanimated2/hook/commonTypes.js.map +1 -1
  303. package/lib/module/reanimated2/hook/index.js.map +1 -1
  304. package/lib/module/reanimated2/hook/useAnimatedGestureHandler.js +3 -14
  305. package/lib/module/reanimated2/hook/useAnimatedGestureHandler.js.map +1 -1
  306. package/lib/module/reanimated2/hook/useAnimatedKeyboard.js +2 -5
  307. package/lib/module/reanimated2/hook/useAnimatedKeyboard.js.map +1 -1
  308. package/lib/module/reanimated2/hook/useAnimatedReaction.js +1 -7
  309. package/lib/module/reanimated2/hook/useAnimatedReaction.js.map +1 -1
  310. package/lib/module/reanimated2/hook/useAnimatedRef.js +0 -6
  311. package/lib/module/reanimated2/hook/useAnimatedRef.js.map +1 -1
  312. package/lib/module/reanimated2/hook/useAnimatedScrollHandler.js +2 -7
  313. package/lib/module/reanimated2/hook/useAnimatedScrollHandler.js.map +1 -1
  314. package/lib/module/reanimated2/hook/useAnimatedSensor.js +9 -20
  315. package/lib/module/reanimated2/hook/useAnimatedSensor.js.map +1 -1
  316. package/lib/module/reanimated2/hook/useAnimatedStyle.js +13 -59
  317. package/lib/module/reanimated2/hook/useAnimatedStyle.js.map +1 -1
  318. package/lib/module/reanimated2/hook/useDerivedValue.js +4 -8
  319. package/lib/module/reanimated2/hook/useDerivedValue.js.map +1 -1
  320. package/lib/module/reanimated2/hook/useFrameCallback.js.map +1 -1
  321. package/lib/module/reanimated2/hook/useScrollViewOffset.js +0 -1
  322. package/lib/module/reanimated2/hook/useScrollViewOffset.js.map +1 -1
  323. package/lib/module/reanimated2/hook/useSharedValue.js +2 -3
  324. package/lib/module/reanimated2/hook/useSharedValue.js.map +1 -1
  325. package/lib/module/reanimated2/hook/utils.js +8 -21
  326. package/lib/module/reanimated2/hook/utils.js.map +1 -1
  327. package/lib/module/reanimated2/index.js.map +1 -1
  328. package/lib/module/reanimated2/initializers.js +23 -37
  329. package/lib/module/reanimated2/initializers.js.map +1 -1
  330. package/lib/module/reanimated2/interpolateColor.js +5 -34
  331. package/lib/module/reanimated2/interpolateColor.js.map +1 -1
  332. package/lib/module/reanimated2/interpolation.js +13 -28
  333. package/lib/module/reanimated2/interpolation.js.map +1 -1
  334. package/lib/module/reanimated2/jestUtils.js +11 -35
  335. package/lib/module/reanimated2/jestUtils.js.map +1 -1
  336. package/lib/module/reanimated2/js-reanimated/JSReanimated.js +15 -35
  337. package/lib/module/reanimated2/js-reanimated/JSReanimated.js.map +1 -1
  338. package/lib/module/reanimated2/js-reanimated/Mapper.js +9 -23
  339. package/lib/module/reanimated2/js-reanimated/Mapper.js.map +1 -1
  340. package/lib/module/reanimated2/js-reanimated/MapperRegistry.js +7 -35
  341. package/lib/module/reanimated2/js-reanimated/MapperRegistry.js.map +1 -1
  342. package/lib/module/reanimated2/js-reanimated/MutableValue.js +5 -16
  343. package/lib/module/reanimated2/js-reanimated/MutableValue.js.map +1 -1
  344. package/lib/module/reanimated2/js-reanimated/global.js +2 -6
  345. package/lib/module/reanimated2/js-reanimated/global.js.map +1 -1
  346. package/lib/module/reanimated2/js-reanimated/index.js +3 -9
  347. package/lib/module/reanimated2/js-reanimated/index.js.map +1 -1
  348. package/lib/module/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.js +7 -23
  349. package/lib/module/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.js.map +1 -1
  350. package/lib/module/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.js +3 -45
  351. package/lib/module/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.js.map +1 -1
  352. package/lib/module/reanimated2/layoutReanimation/animationBuilder/Keyframe.js +7 -39
  353. package/lib/module/reanimated2/layoutReanimation/animationBuilder/Keyframe.js.map +1 -1
  354. package/lib/module/reanimated2/layoutReanimation/animationBuilder/commonTypes.js +3 -3
  355. package/lib/module/reanimated2/layoutReanimation/animationBuilder/commonTypes.js.map +1 -1
  356. package/lib/module/reanimated2/layoutReanimation/animationBuilder/index.js.map +1 -1
  357. package/lib/module/reanimated2/layoutReanimation/animationsManager.js +4 -19
  358. package/lib/module/reanimated2/layoutReanimation/animationsManager.js.map +1 -1
  359. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Bounce.js +3 -52
  360. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Bounce.js.map +1 -1
  361. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Fade.js +3 -32
  362. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Fade.js.map +1 -1
  363. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Flip.js +3 -38
  364. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Flip.js.map +1 -1
  365. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.js +7 -16
  366. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.js.map +1 -1
  367. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.js +3 -8
  368. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.js.map +1 -1
  369. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Roll.js +3 -14
  370. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Roll.js.map +1 -1
  371. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Rotate.js +3 -26
  372. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Rotate.js.map +1 -1
  373. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Slide.js +3 -26
  374. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Slide.js.map +1 -1
  375. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Stretch.js +3 -14
  376. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Stretch.js.map +1 -1
  377. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Zoom.js +3 -50
  378. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Zoom.js.map +1 -1
  379. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/index.js.map +1 -1
  380. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.js +3 -17
  381. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.js.map +1 -1
  382. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.js +5 -23
  383. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.js.map +1 -1
  384. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.js +3 -5
  385. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.js.map +1 -1
  386. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.js +5 -6
  387. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.js.map +1 -1
  388. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.js +3 -5
  389. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.js.map +1 -1
  390. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.js +3 -8
  391. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.js.map +1 -1
  392. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/index.js.map +1 -1
  393. package/lib/module/reanimated2/layoutReanimation/index.js.map +1 -1
  394. package/lib/module/reanimated2/layoutReanimation/sharedTransitions/index.js +3 -13
  395. package/lib/module/reanimated2/layoutReanimation/sharedTransitions/index.js.map +1 -1
  396. package/lib/module/reanimated2/mappers.js +26 -25
  397. package/lib/module/reanimated2/mappers.js.map +1 -1
  398. package/lib/module/reanimated2/mock.js +5 -15
  399. package/lib/module/reanimated2/mock.js.map +1 -1
  400. package/lib/module/reanimated2/mutables.js +2 -19
  401. package/lib/module/reanimated2/mutables.js.map +1 -1
  402. package/lib/module/reanimated2/platform-specific/RNRenderer.js.map +1 -1
  403. package/lib/module/reanimated2/platform-specific/RNRenderer.web.js.map +1 -1
  404. package/lib/module/reanimated2/platform-specific/checkCppVersion.js +24 -0
  405. package/lib/module/reanimated2/platform-specific/checkCppVersion.js.map +1 -0
  406. package/lib/module/reanimated2/platform-specific/checkVersion.web.js +0 -1
  407. package/lib/module/reanimated2/platform-specific/checkVersion.web.js.map +1 -1
  408. package/lib/module/reanimated2/platform-specific/jsVersion.js +7 -0
  409. package/lib/module/reanimated2/platform-specific/jsVersion.js.map +1 -0
  410. package/lib/module/reanimated2/pluginUtils.js.map +1 -1
  411. package/lib/module/reanimated2/shareables.js +96 -44
  412. package/lib/module/reanimated2/shareables.js.map +1 -1
  413. package/lib/module/reanimated2/threads.js +39 -33
  414. package/lib/module/reanimated2/threads.js.map +1 -1
  415. package/lib/module/reanimated2/utils.js +0 -3
  416. package/lib/module/reanimated2/utils.js.map +1 -1
  417. package/lib/module/reanimated2/valueSetter.js +6 -19
  418. package/lib/module/reanimated2/valueSetter.js.map +1 -1
  419. package/lib/module/setAndForwardRef.js +3 -2
  420. package/lib/module/setAndForwardRef.js.map +1 -1
  421. package/package.json +46 -40
  422. package/plugin/.eslintrc.js +7 -0
  423. package/plugin/README.md +241 -0
  424. package/plugin/build/plugin.js +714 -0
  425. package/plugin/build/plugin.js.map +7 -0
  426. package/plugin/index.js +1 -807
  427. package/plugin/package.json +23 -0
  428. package/plugin/src/buildWorkletString.ts +213 -0
  429. package/plugin/src/commonObjects.ts +60 -0
  430. package/plugin/src/injectVersion.ts +37 -0
  431. package/plugin/src/makeWorklet.ts +375 -0
  432. package/plugin/src/plugin.ts +49 -0
  433. package/plugin/src/processForCalleesWorklets.ts +106 -0
  434. package/plugin/src/processIfGestureHandlerEventCallbackFunctionNode.ts +156 -0
  435. package/plugin/src/processIfWorkletFunction.ts +55 -0
  436. package/plugin/src/processIfWorkletNode.ts +44 -0
  437. package/plugin/src/processInlineStylesWarning.ts +129 -0
  438. package/plugin/src/processWorkletObjectMethod.ts +31 -0
  439. package/plugin/src/types.ts +15 -0
  440. package/plugin/src/utils.ts +6 -0
  441. package/plugin/tsconfig.json +15 -0
  442. package/plugin/yarn.lock +2193 -0
  443. package/react-native-reanimated.d.ts +1 -0
  444. package/scripts/reanimated_utils.rb +2 -2
  445. package/src/createAnimatedComponent.tsx +2 -3
  446. package/src/reanimated2/Easing.ts +19 -0
  447. package/src/reanimated2/NativeMethods.ts +9 -4
  448. package/src/reanimated2/NativeReanimated/NativeReanimated.ts +2 -2
  449. package/src/reanimated2/UpdateProps.ts +2 -2
  450. package/src/reanimated2/animation/decay.ts +7 -1
  451. package/src/reanimated2/animation/styleAnimation.ts +5 -1
  452. package/src/reanimated2/core.ts +4 -4
  453. package/src/reanimated2/errors.ts +1 -0
  454. package/src/reanimated2/frameCallback/FrameCallbackRegistryUI.ts +12 -4
  455. package/src/reanimated2/globals.d.ts +71 -112
  456. package/src/reanimated2/hook/commonTypes.ts +1 -1
  457. package/src/reanimated2/hook/useAnimatedReaction.ts +2 -2
  458. package/src/reanimated2/hook/useAnimatedSensor.ts +2 -2
  459. package/src/reanimated2/initializers.ts +11 -8
  460. package/src/reanimated2/jestUtils.ts +0 -1
  461. package/src/reanimated2/js-reanimated/JSReanimated.ts +5 -1
  462. package/src/reanimated2/js-reanimated/index.ts +1 -1
  463. package/src/reanimated2/mappers.ts +26 -4
  464. package/src/reanimated2/mock.ts +1 -0
  465. package/src/reanimated2/platform-specific/checkCppVersion.ts +29 -0
  466. package/src/reanimated2/platform-specific/jsVersion.ts +6 -0
  467. package/src/reanimated2/shareables.ts +107 -8
  468. package/src/reanimated2/threads.ts +36 -17
  469. package/lib/commonjs/reanimated2/platform-specific/checkVersion.js +0 -42
  470. package/lib/commonjs/reanimated2/platform-specific/checkVersion.js.map +0 -1
  471. package/lib/module/reanimated2/platform-specific/checkVersion.js +0 -35
  472. package/lib/module/reanimated2/platform-specific/checkVersion.js.map +0 -1
  473. package/src/reanimated2/platform-specific/checkVersion.ts +0 -39
@@ -1 +1 @@
1
- {"version":3,"names":["SequencedTransition","BaseAnimationBuilder","delayFunction","getDelayFunction","callback","callbackV","delay","getDelay","sequenceDuration","durationV","config","duration","reverse","reversed","values","initialValues","originX","currentOriginX","originY","currentOriginY","width","currentWidth","height","currentHeight","animations","withSequence","withTiming","targetOriginX","targetOriginY","targetWidth","targetHeight","createInstance","instance"],"sources":["SequencedTransition.ts"],"sourcesContent":["import { withSequence, withTiming } from '../../animation';\nimport {\n ILayoutAnimationBuilder,\n LayoutAnimationFunction,\n} from '../animationBuilder/commonTypes';\nimport { BaseAnimationBuilder } from '../animationBuilder';\n\nexport class SequencedTransition\n extends BaseAnimationBuilder\n implements ILayoutAnimationBuilder\n{\n reversed = false;\n\n static createInstance(): SequencedTransition {\n return new SequencedTransition();\n }\n\n static reverse(): SequencedTransition {\n const instance = SequencedTransition.createInstance();\n return instance.reverse();\n }\n\n reverse(): SequencedTransition {\n this.reversed = !this.reversed;\n return this;\n }\n\n build = (): LayoutAnimationFunction => {\n const delayFunction = this.getDelayFunction();\n const callback = this.callbackV;\n const delay = this.getDelay();\n const sequenceDuration = (this.durationV ?? 500) / 2;\n const config = { duration: sequenceDuration };\n const reverse = this.reversed;\n\n return (values) => {\n 'worklet';\n return {\n initialValues: {\n originX: values.currentOriginX,\n originY: values.currentOriginY,\n width: values.currentWidth,\n height: values.currentHeight,\n },\n animations: {\n originX: delayFunction(\n delay,\n withSequence(\n withTiming(\n reverse ? values.currentOriginX : values.targetOriginX,\n config\n ),\n withTiming(values.targetOriginX, config)\n )\n ),\n originY: delayFunction(\n delay,\n withSequence(\n withTiming(\n reverse ? values.targetOriginY : values.currentOriginY,\n config\n ),\n withTiming(values.targetOriginY, config)\n )\n ),\n width: delayFunction(\n delay,\n withSequence(\n withTiming(\n reverse ? values.currentWidth : values.targetWidth,\n config\n ),\n withTiming(values.targetWidth, config)\n )\n ),\n height: delayFunction(\n delay,\n withSequence(\n withTiming(\n reverse ? values.targetHeight : values.currentHeight,\n config\n ),\n withTiming(values.targetHeight, config)\n )\n ),\n },\n callback: callback,\n };\n };\n };\n}\n"],"mappings":";;;;;;;AAAA;;AAKA;;;;AAEO,MAAMA,mBAAN,SACGC,sCADH,CAGP;EAAA;IAAA;;IAAA,kCACa,KADb;;IAAA,+BAiBU,MAA+B;MACrC,MAAMC,aAAa,GAAG,KAAKC,gBAAL,EAAtB;MACA,MAAMC,QAAQ,GAAG,KAAKC,SAAtB;MACA,MAAMC,KAAK,GAAG,KAAKC,QAAL,EAAd;MACA,MAAMC,gBAAgB,GAAG,CAAC,KAAKC,SAAL,IAAkB,GAAnB,IAA0B,CAAnD;MACA,MAAMC,MAAM,GAAG;QAAEC,QAAQ,EAAEH;MAAZ,CAAf;MACA,MAAMI,OAAO,GAAG,KAAKC,QAArB;MAEA,OAAQC,MAAD,IAAY;QACjB;;QACA,OAAO;UACLC,aAAa,EAAE;YACbC,OA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D,CA/EH;EAAA;;EAGuB,OAAd2B,cAAc,GAAwB;IAC3C,OAAO,IAAI/B,mBAAJ,EAAP;EACD;;EAEa,OAAPY,OAAO,GAAwB;IACpC,MAAMoB,QAAQ,GAAGhC,mBAAmB,CAAC+B,cAApB,EAAjB;IACA,OAAOC,QAAQ,CAACpB,OAAT,EAAP;EACD;;EAEDA,OAAO,GAAwB;IAC7B,KAAKC,QAAL,GAAgB,CAAC,KAAKA,QAAtB;IACA,OAAO,IAAP;EACD;;AAfH"}
1
+ {"version":3,"names":["_animation","require","_animationBuilder","_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","Number","SequencedTransition","BaseAnimationBuilder","constructor","arguments","delayFunction","getDelayFunction","callback","callbackV","delay","getDelay","sequenceDuration","durationV","config","duration","reverse","reversed","values","initialValues","originX","currentOriginX","originY","currentOriginY","width","currentWidth","height","currentHeight","animations","withSequence","withTiming","targetOriginX","targetOriginY","targetWidth","targetHeight","createInstance","instance","exports"],"sources":["SequencedTransition.ts"],"sourcesContent":["import { withSequence, withTiming } from '../../animation';\nimport {\n ILayoutAnimationBuilder,\n LayoutAnimationFunction,\n} from '../animationBuilder/commonTypes';\nimport { BaseAnimationBuilder } from '../animationBuilder';\n\nexport class SequencedTransition\n extends BaseAnimationBuilder\n implements ILayoutAnimationBuilder\n{\n reversed = false;\n\n static createInstance(): SequencedTransition {\n return new SequencedTransition();\n }\n\n static reverse(): SequencedTransition {\n const instance = SequencedTransition.createInstance();\n return instance.reverse();\n }\n\n reverse(): SequencedTransition {\n this.reversed = !this.reversed;\n return this;\n }\n\n build = (): LayoutAnimationFunction => {\n const delayFunction = this.getDelayFunction();\n const callback = this.callbackV;\n const delay = this.getDelay();\n const sequenceDuration = (this.durationV ?? 500) / 2;\n const config = { duration: sequenceDuration };\n const reverse = this.reversed;\n\n return (values) => {\n 'worklet';\n return {\n initialValues: {\n originX: values.currentOriginX,\n originY: values.currentOriginY,\n width: values.currentWidth,\n height: values.currentHeight,\n },\n animations: {\n originX: delayFunction(\n delay,\n withSequence(\n withTiming(\n reverse ? values.currentOriginX : values.targetOriginX,\n config\n ),\n withTiming(values.targetOriginX, config)\n )\n ),\n originY: delayFunction(\n delay,\n withSequence(\n withTiming(\n reverse ? values.targetOriginY : values.currentOriginY,\n config\n ),\n withTiming(values.targetOriginY, config)\n )\n ),\n width: delayFunction(\n delay,\n withSequence(\n withTiming(\n reverse ? values.currentWidth : values.targetWidth,\n config\n ),\n withTiming(values.targetWidth, config)\n )\n ),\n height: delayFunction(\n delay,\n withSequence(\n withTiming(\n reverse ? values.targetHeight : values.currentHeight,\n config\n ),\n withTiming(values.targetHeight, config)\n )\n ),\n },\n callback: callback,\n };\n };\n };\n}\n"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAKA,IAAAC,iBAAA,GAAAD,OAAA;AAA2D,SAAAE,gBAAAC,GAAA,EAAAC,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAD,GAAA,IAAAI,MAAA,CAAAC,cAAA,CAAAL,GAAA,EAAAC,GAAA,IAAAC,KAAA,EAAAA,KAAA,EAAAI,UAAA,QAAAC,YAAA,QAAAC,QAAA,oBAAAR,GAAA,CAAAC,GAAA,IAAAC,KAAA,WAAAF,GAAA;AAAA,SAAAG,eAAAM,GAAA,QAAAR,GAAA,GAAAS,YAAA,CAAAD,GAAA,2BAAAR,GAAA,gBAAAA,GAAA,GAAAU,MAAA,CAAAV,GAAA;AAAA,SAAAS,aAAAE,KAAA,EAAAC,IAAA,eAAAD,KAAA,iBAAAA,KAAA,kBAAAA,KAAA,MAAAE,IAAA,GAAAF,KAAA,CAAAG,MAAA,CAAAC,WAAA,OAAAF,IAAA,KAAAG,SAAA,QAAAC,GAAA,GAAAJ,IAAA,CAAAK,IAAA,CAAAP,KAAA,EAAAC,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BAAU,EAACZ,MAAM,CAACc,aAAa,EAAElB,MAAM,CAAC,CACzC,CACF;YACDU,KAAK,EAAElB,aAAa,CAClBI,KAAK,EACL,IAAAmB,uBAAY,EACV,IAAAC,qBAAU,EACRd,OAAO,GAAGE,MAAM,CAACO,YAAY,GAAGP,MAAM,CAACe,WAAW,EAClDnB,MAAM,CACP,EACD,IAAAgB,qBAAU,EAACZ,MAAM,CAACe,WAAW,EAAEnB,MAAM,CAAC,CACvC,CACF;YACDY,MAAM,EAAEpB,aAAa,CACnBI,KAAK,EACL,IAAAmB,uBAAY,EACV,IAAAC,qBAAU,EACRd,OAAO,GAAGE,MAAM,CAACgB,YAAY,GAAGhB,MAAM,CAACS,aAAa,EACpDb,MAAM,CACP,EACD,IAAAgB,qBAAU,EAACZ,MAAM,CAACgB,YAAY,EAAEpB,MAAM,CAAC,CACxC;UAEL,CAAC;UACDN,QAAQ,EAAEA;QACZ,CAAC;MACH,CAAC;IACH,CAAC;EAAA;EA5ED,OAAO2B,cAAcA,CAAA,EAAwB;IAC3C,OAAO,IAAIjC,mBAAmB,EAAE;EAClC;EAEA,OAAOc,OAAOA,CAAA,EAAwB;IACpC,MAAMoB,QAAQ,GAAGlC,mBAAmB,CAACiC,cAAc,EAAE;IACrD,OAAOC,QAAQ,CAACpB,OAAO,EAAE;EAC3B;EAEAA,OAAOA,CAAA,EAAwB;IAC7B,IAAI,CAACC,QAAQ,GAAG,CAAC,IAAI,CAACA,QAAQ;IAC9B,OAAO,IAAI;EACb;AAiEF;AAACoB,OAAA,CAAAnC,mBAAA,GAAAA,mBAAA"}
@@ -3,9 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
-
7
6
  var _LinearTransition = require("./LinearTransition");
8
-
9
7
  Object.keys(_LinearTransition).forEach(function (key) {
10
8
  if (key === "default" || key === "__esModule") return;
11
9
  if (key in exports && exports[key] === _LinearTransition[key]) return;
@@ -16,9 +14,7 @@ Object.keys(_LinearTransition).forEach(function (key) {
16
14
  }
17
15
  });
18
16
  });
19
-
20
17
  var _FadingTransition = require("./FadingTransition");
21
-
22
18
  Object.keys(_FadingTransition).forEach(function (key) {
23
19
  if (key === "default" || key === "__esModule") return;
24
20
  if (key in exports && exports[key] === _FadingTransition[key]) return;
@@ -29,9 +25,7 @@ Object.keys(_FadingTransition).forEach(function (key) {
29
25
  }
30
26
  });
31
27
  });
32
-
33
28
  var _SequencedTransition = require("./SequencedTransition");
34
-
35
29
  Object.keys(_SequencedTransition).forEach(function (key) {
36
30
  if (key === "default" || key === "__esModule") return;
37
31
  if (key in exports && exports[key] === _SequencedTransition[key]) return;
@@ -42,9 +36,7 @@ Object.keys(_SequencedTransition).forEach(function (key) {
42
36
  }
43
37
  });
44
38
  });
45
-
46
39
  var _JumpingTransition = require("./JumpingTransition");
47
-
48
40
  Object.keys(_JumpingTransition).forEach(function (key) {
49
41
  if (key === "default" || key === "__esModule") return;
50
42
  if (key in exports && exports[key] === _JumpingTransition[key]) return;
@@ -55,9 +47,7 @@ Object.keys(_JumpingTransition).forEach(function (key) {
55
47
  }
56
48
  });
57
49
  });
58
-
59
50
  var _CurvedTransition = require("./CurvedTransition");
60
-
61
51
  Object.keys(_CurvedTransition).forEach(function (key) {
62
52
  if (key === "default" || key === "__esModule") return;
63
53
  if (key in exports && exports[key] === _CurvedTransition[key]) return;
@@ -68,9 +58,7 @@ Object.keys(_CurvedTransition).forEach(function (key) {
68
58
  }
69
59
  });
70
60
  });
71
-
72
61
  var _EntryExitTransition = require("./EntryExitTransition");
73
-
74
62
  Object.keys(_EntryExitTransition).forEach(function (key) {
75
63
  if (key === "default" || key === "__esModule") return;
76
64
  if (key in exports && exports[key] === _EntryExitTransition[key]) return;
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from './LinearTransition';\nexport * from './FadingTransition';\nexport * from './SequencedTransition';\nexport * from './JumpingTransition';\nexport * from './CurvedTransition';\nexport * from './EntryExitTransition';\n"],"mappings":";;;;;;AAAA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
1
+ {"version":3,"names":["_LinearTransition","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_FadingTransition","_SequencedTransition","_JumpingTransition","_CurvedTransition","_EntryExitTransition"],"sources":["index.ts"],"sourcesContent":["export * from './LinearTransition';\nexport * from './FadingTransition';\nexport * from './SequencedTransition';\nexport * from './JumpingTransition';\nexport * from './CurvedTransition';\nexport * from './EntryExitTransition';\n"],"mappings":";;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,iBAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,iBAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,iBAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,iBAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,iBAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAA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,OAAAI,iBAAA,CAAAR,GAAA;IAAA;EAAA;AAAA;AACA,IAAAS,oBAAA,GAAAb,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAW,oBAAA,EAAAV,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAS,oBAAA,CAAAT,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAK,oBAAA,CAAAT,GAAA;IAAA;EAAA;AAAA"}
@@ -3,11 +3,8 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
-
7
6
  require("./animationsManager");
8
-
9
7
  var _animationBuilder = require("./animationBuilder");
10
-
11
8
  Object.keys(_animationBuilder).forEach(function (key) {
12
9
  if (key === "default" || key === "__esModule") return;
13
10
  if (key in exports && exports[key] === _animationBuilder[key]) return;
@@ -18,9 +15,7 @@ Object.keys(_animationBuilder).forEach(function (key) {
18
15
  }
19
16
  });
20
17
  });
21
-
22
18
  var _defaultAnimations = require("./defaultAnimations");
23
-
24
19
  Object.keys(_defaultAnimations).forEach(function (key) {
25
20
  if (key === "default" || key === "__esModule") return;
26
21
  if (key in exports && exports[key] === _defaultAnimations[key]) return;
@@ -31,9 +26,7 @@ Object.keys(_defaultAnimations).forEach(function (key) {
31
26
  }
32
27
  });
33
28
  });
34
-
35
29
  var _defaultTransitions = require("./defaultTransitions");
36
-
37
30
  Object.keys(_defaultTransitions).forEach(function (key) {
38
31
  if (key === "default" || key === "__esModule") return;
39
32
  if (key in exports && exports[key] === _defaultTransitions[key]) return;
@@ -44,9 +37,7 @@ Object.keys(_defaultTransitions).forEach(function (key) {
44
37
  }
45
38
  });
46
39
  });
47
-
48
40
  var _sharedTransitions = require("./sharedTransitions");
49
-
50
41
  Object.keys(_sharedTransitions).forEach(function (key) {
51
42
  if (key === "default" || key === "__esModule") return;
52
43
  if (key in exports && exports[key] === _sharedTransitions[key]) return;
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["import './animationsManager';\nexport * from './animationBuilder';\nexport * from './defaultAnimations';\nexport * from './defaultTransitions';\nexport * from './sharedTransitions';\n"],"mappings":";;;;;;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
1
+ {"version":3,"names":["require","_animationBuilder","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_defaultAnimations","_defaultTransitions","_sharedTransitions"],"sources":["index.ts"],"sourcesContent":["import './animationsManager';\nexport * from './animationBuilder';\nexport * from './defaultAnimations';\nexport * from './defaultTransitions';\nexport * from './sharedTransitions';\n"],"mappings":";;;;;AAAAA,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA;AAAAE,MAAA,CAAAC,IAAA,CAAAF,iBAAA,EAAAG,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAJ,iBAAA,CAAAI,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAR,iBAAA,CAAAI,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,kBAAA,GAAAV,OAAA;AAAAE,MAAA,CAAAC,IAAA,CAAAO,kBAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,kBAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,kBAAA,CAAAL,GAAA;IAAA;EAAA;AAAA;AACA,IAAAM,mBAAA,GAAAX,OAAA;AAAAE,MAAA,CAAAC,IAAA,CAAAQ,mBAAA,EAAAP,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAM,mBAAA,CAAAN,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAE,mBAAA,CAAAN,GAAA;IAAA;EAAA;AAAA;AACA,IAAAO,kBAAA,GAAAZ,OAAA;AAAAE,MAAA,CAAAC,IAAA,CAAAS,kBAAA,EAAAR,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAO,kBAAA,CAAAP,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAG,kBAAA,CAAAP,GAAA;IAAA;EAAA;AAAA"}
@@ -4,37 +4,29 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.SharedTransition = exports.DefaultSharedTransition = void 0;
7
-
8
7
  var _animation = require("../../animation");
9
-
10
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
11
-
8
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
9
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
10
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
12
11
  const supportedProps = ['width', 'height', 'originX', 'originY', 'transform'];
13
-
14
12
  class SharedTransition {
15
13
  constructor() {
16
14
  _defineProperty(this, "animationFactory", null);
17
-
18
15
  _defineProperty(this, "defaultDuration", 500);
19
16
  }
20
-
21
17
  static createInstance() {
22
18
  return new SharedTransition();
23
19
  }
24
-
25
20
  static custom(animationFactory) {
26
21
  return this.createInstance().custom(animationFactory);
27
22
  }
28
-
29
23
  custom(animationFactory) {
30
24
  this.animationFactory = animationFactory;
31
25
  return this;
32
26
  }
33
-
34
27
  static build() {
35
28
  return this.createInstance().build();
36
29
  }
37
-
38
30
  build() {
39
31
  const animationFactory = this.animationFactory;
40
32
  const animationDuration = this.defaultDuration;
@@ -43,10 +35,8 @@ class SharedTransition {
43
35
 
44
36
  let animations = {};
45
37
  const initialValues = {};
46
-
47
38
  if (animationFactory) {
48
39
  animations = animationFactory(values);
49
-
50
40
  for (const key in animations) {
51
41
  if (!supportedProps.includes(key)) {
52
42
  throw Error(`The prop '${key}' is not supported yet.`);
@@ -69,7 +59,6 @@ class SharedTransition {
69
59
  }
70
60
  }
71
61
  }
72
-
73
62
  for (const propName in animations) {
74
63
  if (propName === 'transform') {
75
64
  initialValues.transformMatrix = values.currentTransformMatrix;
@@ -78,16 +67,13 @@ class SharedTransition {
78
67
  initialValues[propName] = values[keyToCurrentValue];
79
68
  }
80
69
  }
81
-
82
70
  return {
83
71
  initialValues,
84
72
  animations
85
73
  };
86
74
  };
87
75
  }
88
-
89
76
  }
90
-
91
77
  exports.SharedTransition = SharedTransition;
92
78
  const DefaultSharedTransition = SharedTransition;
93
79
  exports.DefaultSharedTransition = DefaultSharedTransition;
@@ -1 +1 @@
1
- {"version":3,"names":["supportedProps","SharedTransition","createInstance","custom","animationFactory","build","animationDuration","defaultDuration","values","animations","initialValues","key","includes","Error","propName","matrix","targetTransformMatrix","transformMatrix","withTiming","duration","keyToTargetValue","charAt","toUpperCase","slice","currentTransformMatrix","keyToCurrentValue","DefaultSharedTransition"],"sources":["index.ts"],"sourcesContent":["import { withTiming } from '../../animation';\nimport {\n ILayoutAnimationBuilder,\n LayoutAnimationFunction,\n LayoutAnimationsValues,\n} from '../animationBuilder/commonTypes';\nimport { StyleProps } from '../../commonTypes';\n\nconst supportedProps = ['width', 'height', 'originX', 'originY', 'transform'];\n\ntype AnimationFactoryType = (values: LayoutAnimationsValues) => StyleProps;\n\nexport class SharedTransition implements ILayoutAnimationBuilder {\n animationFactory: AnimationFactoryType | null = null;\n defaultDuration = 500;\n\n static createInstance(): SharedTransition {\n return new SharedTransition();\n }\n\n static custom(animationFactory: AnimationFactoryType): SharedTransition {\n return this.createInstance().custom(animationFactory);\n }\n\n custom(animationFactory: AnimationFactoryType): SharedTransition {\n this.animationFactory = animationFactory;\n return this;\n }\n\n static build(): LayoutAnimationFunction {\n return this.createInstance().build();\n }\n\n build(): LayoutAnimationFunction {\n const animationFactory = this.animationFactory;\n const animationDuration = this.defaultDuration;\n return (values: LayoutAnimationsValues) => {\n 'worklet';\n let animations: {\n [key: string]: any;\n } = {};\n const initialValues: {\n [key: string]: any;\n } = {};\n\n if (animationFactory) {\n animations = animationFactory(values);\n for (const key in animations) {\n if (!supportedProps.includes(key)) {\n throw Error(`The prop '${key}' is not supported yet.`);\n }\n }\n } else {\n for (const propName of supportedProps) {\n if (propName === 'transform') {\n const matrix = values.targetTransformMatrix;\n animations.transformMatrix = withTiming(matrix, {\n // native screen transition takes around 500ms\n duration: animationDuration,\n });\n } else {\n const keyToTargetValue =\n 'target' + propName.charAt(0).toUpperCase() + propName.slice(1);\n animations[propName] = withTiming(values[keyToTargetValue], {\n // native screen transition takes around 500ms\n duration: animationDuration,\n });\n }\n }\n }\n\n for (const propName in animations) {\n if (propName === 'transform') {\n initialValues.transformMatrix = values.currentTransformMatrix;\n } else {\n const keyToCurrentValue =\n 'current' + propName.charAt(0).toUpperCase() + propName.slice(1);\n initialValues[propName] = values[keyToCurrentValue];\n }\n }\n\n return { initialValues, animations };\n };\n }\n}\n\nexport const DefaultSharedTransition = SharedTransition;\n"],"mappings":";;;;;;;AAAA;;;;AAQA,MAAMA,cAAc,GAAG,CAAC,OAAD,EAAU,QAAV,EAAoB,SAApB,EAA+B,SAA/B,EAA0C,WAA1C,CAAvB;;AAIO,MAAMC,gBAAN,CAA0D;EAAA;IAAA,0CACf,IADe;;IAAA,yCAE7C,GAF6C;EAAA;;EAI1C,OAAdC,cAAc,GAAqB;IACxC,OAAO,IAAID,gBAAJ,EAAP;EACD;;EAEY,OAANE,MAAM,CAACC,gBAAD,EAA2D;IACtE,OAAO,KAAKF,cAAL,GAAsBC,MAAtB,CAA6BC,gBAA7B,CAAP;EACD;;EAEDD,MAAM,CAACC,gBAAD,EAA2D;IAC/D,KAAKA,gBAAL,GAAwBA,gBAAxB;IACA,OAAO,IAAP;EACD;;EAEW,OAALC,KAAK,GAA4B;IACtC,OAAO,KAAKH,cAAL,GAAsBG,KAAtB,EAAP;EACD;;EAEDA,KAAK,GAA4B;IAC/B,MAAMD,gBAAgB,GAAG,KAAKA,gBAA9B;IACA,MAAME,iBAAiB,GAAG,KAAKC,eAA/B;IACA,OAAQC,MAAD,IAAoC;MACzC;;MACA,IAAIC,UAEH,GAAG,EAFJ;MAGA,MAAMC,aAEL,GAAG,EAFJ;;MAIA,IAAIN,gBAAJ,EAAsB;QACpBK,UAAU,GAAGL,gBAAgB,CAACI,MAAD,CAA7B;;QACA,KAAK,MAAMG,GAAX,I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{"version":3,"names":["_animation","require","_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","Number","supportedProps","SharedTransition","constructor","createInstance","custom","animationFactory","build","animationDuration","defaultDuration","values","animations","initialValues","includes","Error","propName","matrix","targetTransformMatrix","transformMatrix","withTiming","duration","keyToTargetValue","charAt","toUpperCase","slice","currentTransformMatrix","keyToCurrentValue","exports","DefaultSharedTransition"],"sources":["index.ts"],"sourcesContent":["import { withTiming } from '../../animation';\nimport {\n ILayoutAnimationBuilder,\n LayoutAnimationFunction,\n LayoutAnimationsValues,\n} from '../animationBuilder/commonTypes';\nimport { StyleProps } from '../../commonTypes';\n\nconst supportedProps = ['width', 'height', 'originX', 'originY', 'transform'];\n\ntype AnimationFactoryType = (values: LayoutAnimationsValues) => StyleProps;\n\nexport class SharedTransition implements ILayoutAnimationBuilder {\n animationFactory: AnimationFactoryType | null = null;\n defaultDuration = 500;\n\n static createInstance(): SharedTransition {\n return new SharedTransition();\n }\n\n static custom(animationFactory: AnimationFactoryType): SharedTransition {\n return this.createInstance().custom(animationFactory);\n }\n\n custom(animationFactory: AnimationFactoryType): SharedTransition {\n this.animationFactory = animationFactory;\n return this;\n }\n\n static build(): LayoutAnimationFunction {\n return this.createInstance().build();\n }\n\n build(): LayoutAnimationFunction {\n const animationFactory = this.animationFactory;\n const animationDuration = this.defaultDuration;\n return (values: LayoutAnimationsValues) => {\n 'worklet';\n let animations: {\n [key: string]: any;\n } = {};\n const initialValues: {\n [key: string]: any;\n } = {};\n\n if (animationFactory) {\n animations = animationFactory(values);\n for (const key in animations) {\n if (!supportedProps.includes(key)) {\n throw Error(`The prop '${key}' is not supported yet.`);\n }\n }\n } else {\n for (const propName of supportedProps) {\n if (propName === 'transform') {\n const matrix = values.targetTransformMatrix;\n animations.transformMatrix = withTiming(matrix, {\n // native screen transition takes around 500ms\n duration: animationDuration,\n });\n } else {\n const keyToTargetValue =\n 'target' + propName.charAt(0).toUpperCase() + propName.slice(1);\n animations[propName] = withTiming(values[keyToTargetValue], {\n // native screen transition takes around 500ms\n duration: animationDuration,\n });\n }\n }\n }\n\n for (const propName in animations) {\n if (propName === 'transform') {\n initialValues.transformMatrix = values.currentTransformMatrix;\n } else {\n const keyToCurrentValue =\n 'current' + propName.charAt(0).toUpperCase() + propName.slice(1);\n initialValues[propName] = values[keyToCurrentValue];\n }\n }\n\n return { initialValues, animations };\n };\n }\n}\n\nexport const DefaultSharedTransition = SharedTransition;\n"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAA6C,SAAAC,gBAAAC,GAAA,EAAAC,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAD,GAAA,IAAAI,MAAA,CAAAC,cAAA,CAAAL,GAAA,EAAAC,GAAA,IAAAC,KAAA,EAAAA,KAAA,EAAAI,UAAA,QAAAC,YAAA,QAAAC,QAAA,oBAAAR,GAAA,CAAAC,GAAA,IAAAC,KAAA,WAAAF,GAAA;AAAA,SAAAG,eAAAM,GAAA,QAAAR,GAAA,GAAAS,YAAA,CAAAD,GAAA,2BAAAR,GAAA,gBAAAA,GAAA,GAAAU,MAAA,CAAAV,GAAA;AAAA,SAAAS,aAAAE,KAAA,EAAAC,IAAA,eAAAD,KAAA,iBAAAA,KAAA,kBAAAA,KAAA,MAAAE,IAAA,GAAAF,KAAA,CAAAG,MAAA,CAAAC,WAAA,OAAAF,IAAA,KAAAG,SAAA,QAAAC,GAAA,GAAAJ,IAAA,CAAAK,IAAA,CAAAP,KAAA,EAAAC,IAAA,2BAAAK,GAAA,sBAAAA,GAAA,YAAAE,SAAA,4DAAAP,IAAA,gBAAAF,MAAA,GAAAU,MAAA,EAAAT,KAAA;AAQ7C,MAAMU,cAAc,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,CAAC;AAIt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;UACJ,CAAC,MAAM;YACL,MAAMa,gBAAgB,GACpB,QAAQ,GAAGN,QAAQ,CAACO,MAAM,CAAC,CAAC,CAAC,CAACC,WAAW,EAAE,GAAGR,QAAQ,CAACS,KAAK,CAAC,CAAC,CAAC;YACjEb,UAAU,CAACI,QAAQ,CAAC,GAAG,IAAAI,qBAAU,EAACT,MAAM,CAACW,gBAAgB,CAAC,EAAE;cAC1D;cACAD,QAAQ,EAAEZ;YACZ,CAAC,CAAC;UACJ;QACF;MACF;MAEA,KAAK,MAAMO,QAAQ,IAAIJ,UAAU,EAAE;QACjC,IAAII,QAAQ,KAAK,WAAW,EAAE;UAC5BH,aAAa,CAACM,eAAe,GAAGR,MAAM,CAACe,sBAAsB;QAC/D,CAAC,MAAM;UACL,MAAMC,iBAAiB,GACrB,SAAS,GAAGX,QAAQ,CAACO,MAAM,CAAC,CAAC,CAAC,CAACC,WAAW,EAAE,GAAGR,QAAQ,CAACS,KAAK,CAAC,CAAC,CAAC;UAClEZ,aAAa,CAACG,QAAQ,CAAC,GAAGL,MAAM,CAACgB,iBAAiB,CAAC;QACrD;MACF;MAEA,OAAO;QAAEd,aAAa;QAAED;MAAW,CAAC;IACtC,CAAC;EACH;AACF;AAACgB,OAAA,CAAAzB,gBAAA,GAAAA,gBAAA;AAEM,MAAM0B,uBAAuB,GAAG1B,gBAAgB;AAACyB,OAAA,CAAAC,uBAAA,GAAAA,uBAAA"}
@@ -6,20 +6,17 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.createMapperRegistry = createMapperRegistry;
7
7
  exports.startMapper = startMapper;
8
8
  exports.stopMapper = stopMapper;
9
-
10
9
  var _PlatformChecker = require("./PlatformChecker");
11
-
12
10
  var _threads = require("./threads");
13
-
11
+ var _utils = require("./utils");
14
12
  const IS_JEST = (0, _PlatformChecker.isJest)();
15
-
16
13
  function createMapperRegistry() {
17
14
  'worklet';
18
15
 
19
16
  const mappers = new Map();
20
17
  let sortedMappers = [];
21
18
  let runRequested = false;
22
-
19
+ let processingMappers = false;
23
20
  function updateMappersOrder() {
24
21
  // sort mappers topologically
25
22
  // the algorithm here takes adventage of a fact that the topological order
@@ -42,12 +39,10 @@ function createMapperRegistry() {
42
39
  // instead of reversing that order we can use a normal array and push processed
43
40
  // mappers to the end. There is no need to reverse that array after we are done.
44
41
  const pre = new Map(); // map from sv -> mapper that outputs that sv
45
-
46
42
  mappers.forEach(mapper => {
47
43
  if (mapper.outputs) {
48
44
  for (const output of mapper.outputs) {
49
45
  const preMappers = pre.get(output);
50
-
51
46
  if (preMappers === undefined) {
52
47
  pre.set(output, [mapper]);
53
48
  } else {
@@ -58,13 +53,10 @@ function createMapperRegistry() {
58
53
  });
59
54
  const visited = new Set();
60
55
  const newOrder = [];
61
-
62
56
  function dfs(mapper) {
63
57
  visited.add(mapper);
64
-
65
58
  for (const input of mapper.inputs) {
66
59
  const preMappers = pre.get(input);
67
-
68
60
  if (preMappers) {
69
61
  for (const preMapper of preMappers) {
70
62
  if (!visited.has(preMapper)) {
@@ -73,10 +65,8 @@ function createMapperRegistry() {
73
65
  }
74
66
  }
75
67
  }
76
-
77
68
  newOrder.push(mapper);
78
69
  }
79
-
80
70
  mappers.forEach(mapper => {
81
71
  if (!visited.has(mapper)) {
82
72
  dfs(mapper);
@@ -84,25 +74,23 @@ function createMapperRegistry() {
84
74
  });
85
75
  sortedMappers = newOrder;
86
76
  }
87
-
88
77
  function mapperRun() {
78
+ processingMappers = true;
89
79
  runRequested = false;
90
-
91
80
  if (mappers.size !== sortedMappers.length) {
92
81
  updateMappersOrder();
93
82
  }
94
-
95
83
  for (const mapper of sortedMappers) {
96
84
  if (mapper.dirty) {
97
85
  mapper.dirty = false;
98
86
  mapper.worklet();
99
87
  }
100
88
  }
89
+ processingMappers = false;
101
90
  }
102
-
103
91
  function maybeRequestUpdates() {
104
92
  if (IS_JEST) {
105
- // On Jest environment we avoid using setImmediate as that'd require test
93
+ // On Jest environment we avoid using queueMicrotask as that'd require test
106
94
  // to advance the clock manually. This on other hand would require tests
107
95
  // to know how many times mappers need to run. As we don't want tests to
108
96
  // make any assumptions on that number it is easier to execute mappers
@@ -110,27 +98,42 @@ function createMapperRegistry() {
110
98
  // if they want to make any assertions on the effects of animations being run.
111
99
  mapperRun();
112
100
  } else if (!runRequested) {
113
- setImmediate(mapperRun);
101
+ if (processingMappers) {
102
+ // In general, we should avoid having mappers trigger updates as this may
103
+ // result in unpredictable behavior. Specifically, the updated value can
104
+ // be read by mappers that run later in the same frame but previous mappers
105
+ // would access the old value. Updating mappers during the mapper-run phase
106
+ // breaks the order in which we should execute the mappers. However, doing
107
+ // that is still a possibility and there are some instances where people use
108
+ // the API in that way, hence we need to prevent mapper-run phase falling into
109
+ // an infinite loop. We do that by detecting when mapper-run is requested while
110
+ // we are already in mapper-run phase, and in that case we use `requestAnimationFrame`
111
+ // instead of `queueMicrotask` which will schedule mapper run for the next
112
+ // frame instead of queuing another set of updates in the same frame.
113
+ requestAnimationFrame(mapperRun);
114
+ } else {
115
+ queueMicrotask(mapperRun);
116
+ }
114
117
  runRequested = true;
115
118
  }
116
119
  }
117
-
118
120
  function extractInputs(inputs, resultArray) {
119
121
  if (Array.isArray(inputs)) {
120
122
  for (const input of inputs) {
121
123
  input && extractInputs(input, resultArray);
122
124
  }
123
- } else if (inputs.addListener) {
125
+ } else if ((0, _utils.isSharedValue)(inputs)) {
124
126
  resultArray.push(inputs);
125
- } else if (typeof inputs === 'object') {
127
+ } else if (Object.getPrototypeOf(inputs) === Object.prototype) {
128
+ // we only extract inputs recursively from "plain" objects here, if object
129
+ // is of a derivative class (e.g. HostObject on web, or Map) we don't scan
130
+ // it recursively
126
131
  for (const element of Object.values(inputs)) {
127
132
  element && extractInputs(element, resultArray);
128
133
  }
129
134
  }
130
-
131
135
  return resultArray;
132
136
  }
133
-
134
137
  return {
135
138
  start: (mapperID, worklet, inputs, outputs) => {
136
139
  const mapper = {
@@ -142,23 +145,19 @@ function createMapperRegistry() {
142
145
  };
143
146
  mappers.set(mapper.id, mapper);
144
147
  sortedMappers = [];
145
-
146
148
  for (const sv of mapper.inputs) {
147
149
  sv.addListener(mapper.id, () => {
148
150
  mapper.dirty = true;
149
151
  maybeRequestUpdates();
150
152
  });
151
153
  }
152
-
153
154
  maybeRequestUpdates();
154
155
  },
155
156
  stop: mapperID => {
156
157
  const mapper = mappers.get(mapperID);
157
-
158
158
  if (mapper) {
159
159
  mappers.delete(mapper.id);
160
160
  sortedMappers = [];
161
-
162
161
  for (const sv of mapper.inputs) {
163
162
  sv.removeListener(mapper.id);
164
163
  }
@@ -166,9 +165,7 @@ function createMapperRegistry() {
166
165
  }
167
166
  };
168
167
  }
169
-
170
168
  let MAPPER_ID = 9999;
171
-
172
169
  function startMapper(worklet) {
173
170
  let inputs = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
174
171
  let outputs = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
@@ -177,16 +174,13 @@ function startMapper(worklet) {
177
174
  'worklet';
178
175
 
179
176
  let mapperRegistry = global.__mapperRegistry;
180
-
181
177
  if (mapperRegistry === undefined) {
182
178
  mapperRegistry = global.__mapperRegistry = createMapperRegistry();
183
179
  }
184
-
185
180
  mapperRegistry.start(mapperID, worklet, inputs, outputs);
186
181
  })();
187
182
  return mapperID;
188
183
  }
189
-
190
184
  function stopMapper(mapperID) {
191
185
  (0, _threads.runOnUI)(() => {
192
186
  'worklet';
@@ -1 +1 @@
1
- {"version":3,"names":["IS_JEST","isJest","createMapperRegistry","mappers","Map","sortedMappers","runRequested","updateMappersOrder","pre","forEach","mapper","outputs","output","preMappers","get","undefined","set","push","visited","Set","newOrder","dfs","add","input","inputs","preMapper","has","mapperRun","size","length","dirty","worklet","maybeRequestUpdates","setImmediate","extractInputs","resultArray","Array","isArray","addListener","element","Object","values","start","mapperID","id","sv","stop","delete","removeListener","MAPPER_ID","startMapper","runOnUI","mapperRegistry","global","__mapperRegistry","stopMapper"],"sources":["mappers.ts"],"sourcesContent":["import { SharedValue } from './commonTypes';\nimport { isJest } from './PlatformChecker';\nimport { runOnUI } from './threads';\n\nconst IS_JEST = isJest();\n\nexport type Mapper = {\n id: number;\n dirty: boolean;\n worklet: () => void;\n inputs: SharedValue<any>[];\n outputs?: SharedValue<any>[];\n};\n\nexport function createMapperRegistry() {\n 'worklet';\n const mappers = new Map();\n let sortedMappers: Mapper[] = [];\n\n let runRequested = false;\n\n function updateMappersOrder() {\n // sort mappers topologically\n // the algorithm here takes adventage of a fact that the topological order\n // of a transposed graph is a reverse topological order of the original graph\n // The graph in our case consists of mappers and an edge between two mappers\n // A and B exists if there is a shared value that's on A's output lists and on\n // B's input list.\n //\n // We don't need however to calculate that graph as it is easier to work with\n // the transposed version of it that can be calculated ad-hoc. For the transposed\n // version to be traversed we use \"pre\" map that maps share value to mappers that\n // output that shared value. Then we can infer all the outgoing edges for a given\n // mapper simply by scanning it's input list and checking if any of the shared values\n // from that list exists in the \"pre\" map. If they do, then we have an edge between\n // that mapper and the mappers from the \"pre\" list for the given shared value.\n //\n // For topological sorting we use a dfs-based approach that requires the graph to\n // be traversed in dfs order and each node after being processed lands at the\n // beginning of the topological order list. Since we traverse a transposed graph,\n // instead of reversing that order we can use a normal array and push processed\n // mappers to the end. There is no need to reverse that array after we are done.\n const pre = new Map(); // map from sv -> mapper that outputs that sv\n mappers.forEach((mapper) => {\n if (mapper.outputs) {\n for (const output of mapper.outputs) {\n const preMappers = pre.get(output);\n if (preMappers === undefined) {\n pre.set(output, [mapper]);\n } else {\n preMappers.push(mapper);\n }\n }\n }\n });\n const visited = new Set();\n const newOrder: Mapper[] = [];\n function dfs(mapper: Mapper) {\n visited.add(mapper);\n for (const input of mapper.inputs) {\n const preMappers = pre.get(input);\n if (preMappers) {\n for (const preMapper of preMappers) {\n if (!visited.has(preMapper)) {\n dfs(preMapper);\n }\n }\n }\n }\n newOrder.push(mapper);\n }\n mappers.forEach((mapper) => {\n if (!visited.has(mapper)) {\n dfs(mapper);\n }\n });\n sortedMappers = newOrder;\n }\n\n function mapperRun() {\n runRequested = false;\n if (mappers.size !== sortedMappers.length) {\n updateMappersOrder();\n }\n for (const mapper of sortedMappers) {\n if (mapper.dirty) {\n mapper.dirty = false;\n mapper.worklet();\n }\n }\n }\n\n function maybeRequestUpdates() {\n if (IS_JEST) {\n // On Jest environment we avoid using setImmediate as that'd require test\n // to advance the clock manually. This on other hand would require tests\n // to know how many times mappers need to run. As we don't want tests to\n // make any assumptions on that number it is easier to execute mappers\n // immediately for testing purposes and only expect test to advance timers\n // if they want to make any assertions on the effects of animations being run.\n mapperRun();\n } else if (!runRequested) {\n setImmediate(mapperRun);\n runRequested = true;\n }\n }\n\n function extractInputs(\n inputs: any,\n resultArray: SharedValue<any>[]\n ): SharedValue<any>[] {\n if (Array.isArray(inputs)) {\n for (const input of inputs) {\n input && extractInputs(input, resultArray);\n }\n } else if (inputs.addListener) {\n resultArray.push(inputs);\n } else if (typeof inputs === 'object') {\n for (const element of Object.values(inputs)) {\n element && extractInputs(element, resultArray);\n }\n }\n return resultArray;\n }\n\n return {\n start: (\n mapperID: number,\n worklet: () => void,\n inputs: SharedValue<any>[],\n outputs?: SharedValue<any>[]\n ) => {\n const mapper = {\n id: mapperID,\n dirty: true,\n worklet,\n inputs: extractInputs(inputs, []),\n outputs,\n };\n mappers.set(mapper.id, mapper);\n sortedMappers = [];\n for (const sv of mapper.inputs) {\n sv.addListener(mapper.id, () => {\n mapper.dirty = true;\n maybeRequestUpdates();\n });\n }\n maybeRequestUpdates();\n },\n stop: (mapperID: number) => {\n const mapper = mappers.get(mapperID);\n if (mapper) {\n mappers.delete(mapper.id);\n sortedMappers = [];\n for (const sv of mapper.inputs) {\n sv.removeListener(mapper.id);\n }\n }\n },\n };\n}\n\nlet MAPPER_ID = 9999;\n\nexport function startMapper(\n worklet: () => void,\n inputs: any[] = [],\n outputs: any[] = []\n): number {\n const mapperID = (MAPPER_ID += 1);\n\n runOnUI(() => {\n 'worklet';\n let mapperRegistry = global.__mapperRegistry;\n if (mapperRegistry === undefined) {\n mapperRegistry = global.__mapperRegistry = createMapperRegistry();\n }\n mapperRegistry.start(mapperID, worklet, inputs, outputs);\n })();\n\n return mapperID;\n}\n\nexport function stopMapper(mapperID: number): void {\n runOnUI(() => {\n 'worklet';\n const mapperRegistry = global.__mapperRegistry;\n mapperRegistry?.stop(mapperID);\n })();\n}\n"],"mappings":";;;;;;;;;AACA;;AACA;;AAEA,MAAMA,OAAO,GAAG,IAAAC,uBAAA,GAAhB;;AAUO,SAASC,oBAAT,GAAgC;EACrC;;EACA,MAAMC,OAAO,GAAG,IAAIC,GAAJ,EAAhB;EACA,IAAIC,aAAuB,GAAG,EAA9B;EAEA,IAAIC,YAAY,GAAG,KAAnB;;EAEA,SAASC,kBAAT,GAA8B;IAC5B;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA,MAAMC,GAAG,GAAG,IAAIJ,GAAJ,EAAZ,CArB4B,CAqBL;;IACvBD,OAAO,CAACM,OAAR,CAAiBC,MAAD,IAAY;MAC1B,IAAIA,MAAM,CAACC,OAAX,EAAoB;QAClB,KAAK,MAAMC,MAAX,IAAqBF,MAAM,CAACC,OAA5B,EAAqC;UACnC,MAAME,UAAU,GAAGL,GAAG,CAACM,GAAJ,CAAQF,MAAR,CAAnB;;UACA,IAAIC,UAAU,KAAKE,SAAnB,EAA8B;YAC5BP,GAAG,CAACQ,GAAJ,CAAQJ,MAAR,EAAgB,CAACF,MAAD,CAAhB;UACD,CAFD,MAEO;YACLG,UAAU,CAACI,IAAX,CAAgBP,MAAhB;UACD;QACF;MACF;IACF,CAXD;IAYA,MAAMQ,OAAO,GAAG,IAAIC,GAAJ,EAAhB;IACA,MAAMC,QAAkB,GAAG,EAA3B;;IACA,SAASC,GAAT,CAAaX,MAAb,EAA6B;MAC3BQ,OAAO,CAACI,GAAR,CAAYZ,MAAZ;;MACA,KAAK,MAAMa,KAAX,IAAoBb,MAA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H,CAAkBtC,MAAM,CAACkC,EAAzB;QACD;MACF;IACF;EAjCI,CAAP;AAmCD;;AAED,IAAIK,SAAS,GAAG,IAAhB;;AAEO,SAASC,WAAT,CACLnB,OADK,EAIG;EAAA,IAFRP,MAEQ,uEAFQ,EAER;EAAA,IADRb,OACQ,uEADS,EACT;EACR,MAAMgC,QAAQ,GAAIM,SAAS,IAAI,CAA/B;EAEA,IAAAE,gBAAA,EAAQ,MAAM;IACZ;;IACA,IAAIC,cAAc,GAAGC,MAAM,CAACC,gBAA5B;;IACA,IAAIF,cAAc,KAAKrC,SAAvB,EAAkC;MAChCqC,cAAc,GAAGC,MAAM,CAACC,gBAAP,GAA0BpD,oBAAoB,EAA/D;IACD;;IACDkD,cAAc,CAACV,KAAf,CAAqBC,QAArB,EAA+BZ,OAA/B,EAAwCP,MAAxC,EAAgDb,OAAhD;EACD,CAPD;EASA,OAAOgC,QAAP;AACD;;AAEM,SAASY,UAAT,CAAoBZ,QAApB,EAA4C;EACjD,IAAAQ,gBAAA,EAAQ,MAAM;IACZ;;IACA,MAAMC,cAAc,GAAGC,MAAM,CAACC,gBAA9B;IACAF,cAAc,SAAd,IAAAA,cAAc,WAAd,YAAAA,cAAc,CAAEN,IAAhB,CAAqBH,QAArB;EACD,CAJD;AAKD"}
1
+ {"version":3,"names":["_PlatformChecker","require","_threads","_utils","IS_JEST","isJest","createMapperRegistry","mappers","Map","sortedMappers","runRequested","processingMappers","updateMappersOrder","pre","forEach","mapper","outputs","output","preMappers","get","undefined","set","push","visited","Set","newOrder","dfs","add","input","inputs","preMapper","has","mapperRun","size","length","dirty","worklet","maybeRequestUpdates","requestAnimationFrame","queueMicrotask","extractInputs","resultArray","Array","isArray","isSharedValue","Object","getPrototypeOf","prototype","element","values","start","mapperID","id","sv","addListener","stop","delete","removeListener","MAPPER_ID","startMapper","arguments","runOnUI","mapperRegistry","global","__mapperRegistry","stopMapper"],"sources":["mappers.ts"],"sourcesContent":["import { SharedValue } from './commonTypes';\nimport { isJest } from './PlatformChecker';\nimport { runOnUI } from './threads';\nimport { isSharedValue } from './utils';\n\nconst IS_JEST = isJest();\n\nexport type Mapper = {\n id: number;\n dirty: boolean;\n worklet: () => void;\n inputs: SharedValue<any>[];\n outputs?: SharedValue<any>[];\n};\n\nexport function createMapperRegistry() {\n 'worklet';\n const mappers = new Map();\n let sortedMappers: Mapper[] = [];\n\n let runRequested = false;\n let processingMappers = false;\n\n function updateMappersOrder() {\n // sort mappers topologically\n // the algorithm here takes adventage of a fact that the topological order\n // of a transposed graph is a reverse topological order of the original graph\n // The graph in our case consists of mappers and an edge between two mappers\n // A and B exists if there is a shared value that's on A's output lists and on\n // B's input list.\n //\n // We don't need however to calculate that graph as it is easier to work with\n // the transposed version of it that can be calculated ad-hoc. For the transposed\n // version to be traversed we use \"pre\" map that maps share value to mappers that\n // output that shared value. Then we can infer all the outgoing edges for a given\n // mapper simply by scanning it's input list and checking if any of the shared values\n // from that list exists in the \"pre\" map. If they do, then we have an edge between\n // that mapper and the mappers from the \"pre\" list for the given shared value.\n //\n // For topological sorting we use a dfs-based approach that requires the graph to\n // be traversed in dfs order and each node after being processed lands at the\n // beginning of the topological order list. Since we traverse a transposed graph,\n // instead of reversing that order we can use a normal array and push processed\n // mappers to the end. There is no need to reverse that array after we are done.\n const pre = new Map(); // map from sv -> mapper that outputs that sv\n mappers.forEach((mapper) => {\n if (mapper.outputs) {\n for (const output of mapper.outputs) {\n const preMappers = pre.get(output);\n if (preMappers === undefined) {\n pre.set(output, [mapper]);\n } else {\n preMappers.push(mapper);\n }\n }\n }\n });\n const visited = new Set();\n const newOrder: Mapper[] = [];\n function dfs(mapper: Mapper) {\n visited.add(mapper);\n for (const input of mapper.inputs) {\n const preMappers = pre.get(input);\n if (preMappers) {\n for (const preMapper of preMappers) {\n if (!visited.has(preMapper)) {\n dfs(preMapper);\n }\n }\n }\n }\n newOrder.push(mapper);\n }\n mappers.forEach((mapper) => {\n if (!visited.has(mapper)) {\n dfs(mapper);\n }\n });\n sortedMappers = newOrder;\n }\n\n function mapperRun() {\n processingMappers = true;\n runRequested = false;\n if (mappers.size !== sortedMappers.length) {\n updateMappersOrder();\n }\n for (const mapper of sortedMappers) {\n if (mapper.dirty) {\n mapper.dirty = false;\n mapper.worklet();\n }\n }\n processingMappers = false;\n }\n\n function maybeRequestUpdates() {\n if (IS_JEST) {\n // On Jest environment we avoid using queueMicrotask as that'd require test\n // to advance the clock manually. This on other hand would require tests\n // to know how many times mappers need to run. As we don't want tests to\n // make any assumptions on that number it is easier to execute mappers\n // immediately for testing purposes and only expect test to advance timers\n // if they want to make any assertions on the effects of animations being run.\n mapperRun();\n } else if (!runRequested) {\n if (processingMappers) {\n // In general, we should avoid having mappers trigger updates as this may\n // result in unpredictable behavior. Specifically, the updated value can\n // be read by mappers that run later in the same frame but previous mappers\n // would access the old value. Updating mappers during the mapper-run phase\n // breaks the order in which we should execute the mappers. However, doing\n // that is still a possibility and there are some instances where people use\n // the API in that way, hence we need to prevent mapper-run phase falling into\n // an infinite loop. We do that by detecting when mapper-run is requested while\n // we are already in mapper-run phase, and in that case we use `requestAnimationFrame`\n // instead of `queueMicrotask` which will schedule mapper run for the next\n // frame instead of queuing another set of updates in the same frame.\n requestAnimationFrame(mapperRun);\n } else {\n queueMicrotask(mapperRun);\n }\n runRequested = true;\n }\n }\n\n function extractInputs(\n inputs: any,\n resultArray: SharedValue<any>[]\n ): SharedValue<any>[] {\n if (Array.isArray(inputs)) {\n for (const input of inputs) {\n input && extractInputs(input, resultArray);\n }\n } else if (isSharedValue(inputs)) {\n resultArray.push(inputs);\n } else if (Object.getPrototypeOf(inputs) === Object.prototype) {\n // we only extract inputs recursively from \"plain\" objects here, if object\n // is of a derivative class (e.g. HostObject on web, or Map) we don't scan\n // it recursively\n for (const element of Object.values(inputs)) {\n element && extractInputs(element, resultArray);\n }\n }\n return resultArray;\n }\n\n return {\n start: (\n mapperID: number,\n worklet: () => void,\n inputs: SharedValue<any>[],\n outputs?: SharedValue<any>[]\n ) => {\n const mapper = {\n id: mapperID,\n dirty: true,\n worklet,\n inputs: extractInputs(inputs, []),\n outputs,\n };\n mappers.set(mapper.id, mapper);\n sortedMappers = [];\n for (const sv of mapper.inputs) {\n sv.addListener(mapper.id, () => {\n mapper.dirty = true;\n maybeRequestUpdates();\n });\n }\n maybeRequestUpdates();\n },\n stop: (mapperID: number) => {\n const mapper = mappers.get(mapperID);\n if (mapper) {\n mappers.delete(mapper.id);\n sortedMappers = [];\n for (const sv of mapper.inputs) {\n sv.removeListener(mapper.id);\n }\n }\n },\n };\n}\n\nlet MAPPER_ID = 9999;\n\nexport function startMapper(\n worklet: () => void,\n inputs: any[] = [],\n outputs: any[] = []\n): number {\n const mapperID = (MAPPER_ID += 1);\n\n runOnUI(() => {\n 'worklet';\n let mapperRegistry = global.__mapperRegistry;\n if (mapperRegistry === undefined) {\n mapperRegistry = global.__mapperRegistry = createMapperRegistry();\n }\n mapperRegistry.start(mapperID, worklet, inputs, outputs);\n })();\n\n return mapperID;\n}\n\nexport function stopMapper(mapperID: number): void {\n runOnUI(() => {\n 'worklet';\n const mapperRegistry = global.__mapperRegistry;\n mapperRegistry?.stop(mapperID);\n })();\n}\n"],"mappings":";;;;;;;;AACA,IAAAA,gBAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AAEA,MAAMG,OAAO,GAAG,IAAAC,uBAAM,GAAE;AAUjB,SAASC,oBAAoBA,CAAA,EAAG;EACrC,SAAS;;EACT,MAAMC,OAAO,GAAG,IAAIC,GAAG,EAAE;EACzB,IAAIC,aAAuB,GAAG,EAAE;EAEhC,IAAIC,YAAY,GAAG,KAAK;EACxB,IAAIC,iBAAiB,GAAG,KAAK;EAE7B,SAASC,kBAAkBA,CAAA,EAAG;IAC5B;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA,MAAMC,GA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QAAA0B,SAAA,QAAAxC,SAAA,GAAAwC,SAAA,MAAG,EAAE;EAEnB,MAAMT,QAAQ,GAAIO,SAAS,IAAI,CAAE;EAEjC,IAAAG,gBAAO,EAAC,MAAM;IACZ,SAAS;;IACT,IAAIC,cAAc,GAAGC,MAAM,CAACC,gBAAgB;IAC5C,IAAIF,cAAc,KAAK1C,SAAS,EAAE;MAChC0C,cAAc,GAAGC,MAAM,CAACC,gBAAgB,GAAG1D,oBAAoB,EAAE;IACnE;IACAwD,cAAc,CAACZ,KAAK,CAACC,QAAQ,EAAEf,OAAO,EAAEP,MAAM,EAAEb,OAAO,CAAC;EAC1D,CAAC,CAAC,EAAE;EAEJ,OAAOmC,QAAQ;AACjB;AAEO,SAASc,UAAUA,CAACd,QAAgB,EAAQ;EACjD,IAAAU,gBAAO,EAAC,MAAM;IACZ,SAAS;;IACT,MAAMC,cAAc,GAAGC,MAAM,CAACC,gBAAgB;IAC9CF,cAAc,aAAdA,cAAc,uBAAdA,cAAc,CAAEP,IAAI,CAACJ,QAAQ,CAAC;EAChC,CAAC,CAAC,EAAE;AACN"}
@@ -3,55 +3,43 @@
3
3
  /* eslint-disable node/no-callback-literal */
4
4
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
5
5
  // @ts-nocheck
6
- const NOOP = () => {// noop
6
+ const NOOP = () => {
7
+ // noop
7
8
  };
8
-
9
9
  const ID = t => t;
10
-
11
10
  const IMMEDIATE_CB_INVOCATION = cb => cb();
12
-
13
11
  class BaseAnimationMock {
14
12
  duration(_) {
15
13
  return this;
16
14
  }
17
-
18
15
  delay(_) {
19
16
  return this;
20
17
  }
21
-
22
18
  springify(_) {
23
19
  return this;
24
20
  }
25
-
26
21
  damping(_) {
27
22
  return this;
28
23
  }
29
-
30
24
  stiffness(_) {
31
25
  return this;
32
26
  }
33
-
34
27
  withCallback(_) {
35
28
  return this;
36
29
  }
37
-
38
30
  randomDelay() {
39
31
  return this;
40
32
  }
41
-
42
33
  withInitialValues() {
43
34
  return this;
44
35
  }
45
-
46
36
  build() {
47
37
  return () => ({
48
38
  initialValues: {},
49
39
  animations: {}
50
40
  });
51
41
  }
52
-
53
42
  }
54
-
55
43
  const ReanimatedV2 = {
56
44
  useSharedValue: v => ({
57
45
  value: v
@@ -113,6 +101,7 @@ const ReanimatedV2 = {
113
101
  factory: ID
114
102
  }),
115
103
  bezierFn: ID,
104
+ steps: ID,
116
105
  in: ID,
117
106
  out: ID,
118
107
  inOut: ID
@@ -128,6 +117,7 @@ const ReanimatedV2 = {
128
117
  ['FadeIn', 'FadeInRight', 'FadeInLeft', 'FadeInUp', 'FadeInDown', 'FadeOut', 'FadeOutRight', 'FadeOutLeft', 'FadeOutUp', 'FadeOutDown', 'FlipInYLeft', 'FlipInXDown', 'FlipInYRight', 'FlipInEasyX', 'FlipInEasyY', 'FlipOutXUp', 'FlipOutYLeft', 'FlipOutXDown', 'FlipOutYRight', 'FlipOutEasyX', 'FlipOutEasyY', 'StretchInY', 'StretchOutX', 'StretchOutY', 'SlideInLeft', 'SlideOutRight', 'SlideOutLeft', 'SlideInUp', 'SlideInDown', 'SlideOutUp', 'ZoomInRotate', 'ZoomInLeft', 'ZoomInRight', 'ZoomInUp', 'ZoomInDown', 'ZoomInEasyUp', 'ZoomInEasyDown', 'ZoomOut', 'ZoomOutRotate', 'ZoomOutLeft', 'ZoomOutRight', 'ZoomOutUp', 'ZoomOutDown', 'ZoomOutEasyUp', 'ZoomOutEasyDown', 'BounceInDown', 'BounceInUp', 'BounceInLeft', 'BounceInRight', 'BounceOut', 'BounceOutDown', 'BounceOutUp', 'BounceOutLeft', 'BounceOutRight', 'LightSpeedInLeft', 'LightSpeedOutRight', 'LightSpeedOutLeft', 'PinwheelOut', 'RotateInDownRight', 'RotateInUpLeft', 'RotateInUpRight', 'RotateOutDownLeft', 'RotateOutDownRight', 'RotateOutUpLeft', 'RotateOutUpRight', 'RollInRight', 'RollOutLeft', 'RollOutRight', 'Layout', 'CurvedTransition', 'JumpingTransition', 'SequencedTransition', 'FadingTransition', 'EntryExitTransition'].forEach(k => Object.assign(ReanimatedV2, {
129
118
  [k]: new BaseAnimationMock()
130
119
  }));
131
- module.exports = { ...ReanimatedV2
120
+ module.exports = {
121
+ ...ReanimatedV2
132
122
  };
133
123
  //# sourceMappingURL=mock.js.map