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,48 +1,37 @@
1
- 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; }
2
-
1
+ 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; }
2
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
3
+ 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); }
3
4
  export default class MutableValue {
4
5
  constructor(value, setter) {
5
6
  _defineProperty(this, "_id", void 0);
6
-
7
7
  _defineProperty(this, "_value", void 0);
8
-
9
8
  _defineProperty(this, "_setter", void 0);
10
-
11
9
  _defineProperty(this, "_animation", null);
12
-
13
10
  _defineProperty(this, "_listeners", []);
14
-
15
11
  this._id = MutableValue.MUTABLE_ID++;
16
12
  this._value = value;
17
13
  this._setter = setter;
18
14
  }
19
-
20
15
  get value() {
21
16
  return this._value;
22
17
  }
23
-
24
18
  set value(nextValue) {
25
19
  this._setter(nextValue);
26
- } // this changes the value finally and is supposed to be called from this._setter
27
-
20
+ }
28
21
 
22
+ // this changes the value finally and is supposed to be called from this._setter
29
23
  _setValue(newValue) {
30
24
  this._value = newValue;
31
-
32
25
  this._triggerListener();
33
26
  }
34
-
35
27
  addListener(listener) {
36
28
  this._listeners.push(listener);
37
29
  }
38
-
39
30
  _triggerListener() {
40
31
  for (let i = 0, len = this._listeners.length; i < len; ++i) {
41
32
  this._listeners[i]();
42
33
  }
43
34
  }
44
-
45
35
  }
46
-
47
36
  _defineProperty(MutableValue, "MUTABLE_ID", 1);
48
37
  //# sourceMappingURL=MutableValue.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["MutableValue","constructor","value","setter","_id","MUTABLE_ID","_value","_setter","nextValue","_setValue","newValue","_triggerListener","addListener","listener","_listeners","push","i","len","length"],"sources":["MutableValue.ts"],"sourcesContent":["export default class MutableValue<T> {\n static MUTABLE_ID = 1;\n _id: number;\n _value: T;\n _setter: (value: T) => void;\n _animation = null;\n _listeners: (() => void)[] = [];\n\n constructor(value: T, setter: (value: T) => void) {\n this._id = MutableValue.MUTABLE_ID++;\n this._value = value;\n this._setter = setter;\n }\n\n get value(): T {\n return this._value;\n }\n\n set value(nextValue: T) {\n this._setter(nextValue);\n }\n\n // this changes the value finally and is supposed to be called from this._setter\n _setValue(newValue: T): void {\n this._value = newValue;\n this._triggerListener();\n }\n\n addListener(listener: () => void): void {\n this._listeners.push(listener);\n }\n\n _triggerListener(): void {\n for (let i = 0, len = this._listeners.length; i < len; ++i) {\n this._listeners[i]();\n }\n }\n}\n"],"mappings":";;AAAA,eAAe,MAAMA,YAAN,CAAsB;EAQnCC,WAAW,CAACC,KAAD,EAAWC,MAAX,EAAuC;IAAA;;IAAA;;IAAA;;IAAA,oCAHrC,IAGqC;;IAAA,oCAFrB,EAEqB;;IAChD,KAAKC,GAAL,GAAWJ,YAAY,CAACK,UAAb,EAAX;IACA,KAAKC,MAAL,GAAcJ,KAAd;IACA,KAAKK,OAAL,GAAeJ,MAAf;EACD;;EAEQ,IAALD,KAAK,GAAM;IACb,OAAO,KAAKI,MAAZ;EACD;;EAEQ,IAALJ,KAAK,CAACM,SAAD,EAAe;IACtB,KAAKD,OAAL,CAAaC,SAAb;EACD,CApBkC,CAsBnC;;;EACAC,SAAS,CAACC,QAAD,EAAoB;IAC3B,KAAKJ,MAAL,GAAcI,QAAd;;IACA,KAAKC,gBAAL;EACD;;EAEDC,WAAW,CAACC,QAAD,EAA6B;IACtC,KAAKC,UAAL,CAAgBC,IAAhB,CAAqBF,QAArB;EACD;;EAEDF,gBAAgB,GAAS;IACvB,KAAK,IAAIK,CAAC,GAAG,CAAR,EAAWC,GAAG,GAAG,KAAKH,UAAL,CAAgBI,MAAtC,EAA8CF,CAAC,GAAGC,GAAlD,EAAuD,EAAED,CAAzD,EAA4D;MAC1D,KAAKF,UAAL,CAAgBE,CAAhB;IACD;EACF;;AApCkC;;gBAAhBhB,Y,gBACC,C"}
1
+ {"version":3,"names":["MutableValue","constructor","value","setter","_defineProperty","_id","MUTABLE_ID","_value","_setter","nextValue","_setValue","newValue","_triggerListener","addListener","listener","_listeners","push","i","len","length"],"sources":["MutableValue.ts"],"sourcesContent":["export default class MutableValue<T> {\n static MUTABLE_ID = 1;\n _id: number;\n _value: T;\n _setter: (value: T) => void;\n _animation = null;\n _listeners: (() => void)[] = [];\n\n constructor(value: T, setter: (value: T) => void) {\n this._id = MutableValue.MUTABLE_ID++;\n this._value = value;\n this._setter = setter;\n }\n\n get value(): T {\n return this._value;\n }\n\n set value(nextValue: T) {\n this._setter(nextValue);\n }\n\n // this changes the value finally and is supposed to be called from this._setter\n _setValue(newValue: T): void {\n this._value = newValue;\n this._triggerListener();\n }\n\n addListener(listener: () => void): void {\n this._listeners.push(listener);\n }\n\n _triggerListener(): void {\n for (let i = 0, len = this._listeners.length; i < len; ++i) {\n this._listeners[i]();\n }\n }\n}\n"],"mappings":";;;AAAA,eAAe,MAAMA,YAAY,CAAI;EAQnCC,WAAWA,CAACC,KAAQ,EAAEC,MAA0B,EAAE;IAAAC,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA,qBAHrC,IAAI;IAAAA,eAAA,qBACY,EAAE;IAG7B,IAAI,CAACC,GAAG,GAAGL,YAAY,CAACM,UAAU,EAAE;IACpC,IAAI,CAACC,MAAM,GAAGL,KAAK;IACnB,IAAI,CAACM,OAAO,GAAGL,MAAM;EACvB;EAEA,IAAID,KAAKA,CAAA,EAAM;IACb,OAAO,IAAI,CAACK,MAAM;EACpB;EAEA,IAAIL,KAAKA,CAACO,SAAY,EAAE;IACtB,IAAI,CAACD,OAAO,CAACC,SAAS,CAAC;EACzB;;EAEA;EACAC,SAASA,CAACC,QAAW,EAAQ;IAC3B,IAAI,CAACJ,MAAM,GAAGI,QAAQ;IACtB,IAAI,CAACC,gBAAgB,EAAE;EACzB;EAEAC,WAAWA,CAACC,QAAoB,EAAQ;IACtC,IAAI,CAACC,UAAU,CAACC,IAAI,CAACF,QAAQ,CAAC;EAChC;EAEAF,gBAAgBA,CAAA,EAAS;IACvB,KAAK,IAAIK,CAAC,GAAG,CAAC,EAAEC,GAAG,GAAG,IAAI,CAACH,UAAU,CAACI,MAAM,EAAEF,CAAC,GAAGC,GAAG,EAAE,EAAED,CAAC,EAAE;MAC1D,IAAI,CAACF,UAAU,CAACE,CAAC,CAAC,EAAE;IACtB;EACF;AACF;AAACb,eAAA,CArCoBJ,YAAY,gBACX,CAAC"}
@@ -1,6 +1,6 @@
1
1
  // In order to keep bundle size down, we treat this file as a polyfill for Web.
2
- import { shouldBeUseWeb } from '../PlatformChecker';
3
2
 
3
+ import { shouldBeUseWeb } from '../PlatformChecker';
4
4
  const initializeGlobalsForWeb = () => {
5
5
  if (shouldBeUseWeb()) {
6
6
  global._measure = () => {
@@ -14,22 +14,19 @@ const initializeGlobalsForWeb = () => {
14
14
  pageY: 0
15
15
  };
16
16
  };
17
-
18
17
  global._scrollTo = () => {
19
18
  console.warn("[Reanimated] You can't use `scrollTo` with Chrome Debugger or with web version");
20
19
  };
21
-
22
20
  global._dispatchCommand = () => {
23
21
  console.warn("[Reanimated] You can't use `scrollTo` or `dispatchCommand` methods with Chrome Debugger or with web version");
24
22
  };
25
-
26
23
  global._setGestureState = () => {
27
24
  console.warn("[Reanimated] You can't use `setGestureState` with Chrome Debugger or with web version");
28
25
  };
29
26
  }
30
-
31
27
  return true;
32
28
  };
29
+
33
30
  /*
34
31
  If a file doesn't export anything, tree shaking doesn't pack
35
32
  it into the JS bundle. In effect, the code inside of this file
@@ -38,6 +35,5 @@ const initializeGlobalsForWeb = () => {
38
35
  the module export object.
39
36
  */
40
37
 
41
-
42
38
  export default initializeGlobalsForWeb();
43
39
  //# sourceMappingURL=global.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["shouldBeUseWeb","initializeGlobalsForWeb","global","_measure","console","warn","x","y","width","height","pageX","pageY","_scrollTo","_dispatchCommand","_setGestureState"],"sources":["global.ts"],"sourcesContent":["// In order to keep bundle size down, we treat this file as a polyfill for Web.\n\nimport { shouldBeUseWeb } from '../PlatformChecker';\nconst initializeGlobalsForWeb = () => {\n if (shouldBeUseWeb()) {\n global._measure = () => {\n console.warn(\n \"[Reanimated] You can't use `measure` with Chrome Debugger or with web version\"\n );\n return {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n pageX: 0,\n pageY: 0,\n };\n };\n global._scrollTo = () => {\n console.warn(\n \"[Reanimated] You can't use `scrollTo` with Chrome Debugger or with web version\"\n );\n };\n global._dispatchCommand = () => {\n console.warn(\n \"[Reanimated] You can't use `scrollTo` or `dispatchCommand` methods with Chrome Debugger or with web version\"\n );\n };\n global._setGestureState = () => {\n console.warn(\n \"[Reanimated] You can't use `setGestureState` with Chrome Debugger or with web version\"\n );\n };\n }\n return true;\n};\n\n/*\n If a file doesn't export anything, tree shaking doesn't pack\n it into the JS bundle. In effect, the code inside of this file\n will never execute. That is why we wrapped initialization code\n into a function, and we call this one during creating\n the module export object.\n*/\n\nexport default initializeGlobalsForWeb();\n"],"mappings":"AAAA;AAEA,SAASA,cAAT,QAA+B,oBAA/B;;AACA,MAAMC,uBAAuB,GAAG,MAAM;EACpC,IAAID,cAAc,EAAlB,EAAsB;IACpBE,MAAM,CAACC,QAAP,GAAkB,MAAM;MACtBC,OAAO,CAACC,IAAR,CACE,+EADF;MAGA,OAAO;QACLC,CAAC,EAAE,CADE;QAELC,CAAC,EAAE,CAFE;QAGLC,KAAK,EAAE,CAHF;QAILC,MAAM,EAAE,CAJH;QAKLC,KAAK,EAAE,CALF;QAMLC,KAAK,EAAE;MANF,CAAP;IAQD,CAZD;;IAaAT,MAAM,CAACU,SAAP,GAAmB,MAAM;MACvBR,OAAO,CAACC,IAAR,CACE,gFADF;IAGD,CAJD;;IAKAH,MAAM,CAACW,gBAAP,GAA0B,MAAM;MAC9BT,OAAO,CAACC,IAAR,CACE,6GADF;IAGD,CAJD;;IAKAH,MAAM,CAACY,gBAAP,GAA0B,MAAM;MAC9BV,OAAO,CAACC,IAAR,CACE,uFADF;IAGD,CAJD;EAKD;;EACD,OAAO,IAAP;AACD,CAhCD;AAkCA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAEA,eAAeJ,uBAAuB,EAAtC"}
1
+ {"version":3,"names":["shouldBeUseWeb","initializeGlobalsForWeb","global","_measure","console","warn","x","y","width","height","pageX","pageY","_scrollTo","_dispatchCommand","_setGestureState"],"sources":["global.ts"],"sourcesContent":["// In order to keep bundle size down, we treat this file as a polyfill for Web.\n\nimport { shouldBeUseWeb } from '../PlatformChecker';\nconst initializeGlobalsForWeb = () => {\n if (shouldBeUseWeb()) {\n global._measure = () => {\n console.warn(\n \"[Reanimated] You can't use `measure` with Chrome Debugger or with web version\"\n );\n return {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n pageX: 0,\n pageY: 0,\n };\n };\n global._scrollTo = () => {\n console.warn(\n \"[Reanimated] You can't use `scrollTo` with Chrome Debugger or with web version\"\n );\n };\n global._dispatchCommand = () => {\n console.warn(\n \"[Reanimated] You can't use `scrollTo` or `dispatchCommand` methods with Chrome Debugger or with web version\"\n );\n };\n global._setGestureState = () => {\n console.warn(\n \"[Reanimated] You can't use `setGestureState` with Chrome Debugger or with web version\"\n );\n };\n }\n return true;\n};\n\n/*\n If a file doesn't export anything, tree shaking doesn't pack\n it into the JS bundle. In effect, the code inside of this file\n will never execute. That is why we wrapped initialization code\n into a function, and we call this one during creating\n the module export object.\n*/\n\nexport default initializeGlobalsForWeb();\n"],"mappings":"AAAA;;AAEA,SAASA,cAAc,QAAQ,oBAAoB;AACnD,MAAMC,uBAAuB,GAAGA,CAAA,KAAM;EACpC,IAAID,cAAc,EAAE,EAAE;IACpBE,MAAM,CAACC,QAAQ,GAAG,MAAM;MACtBC,OAAO,CAACC,IAAI,CACV,+EAA+E,CAChF;MACD,OAAO;QACLC,CAAC,EAAE,CAAC;QACJC,CAAC,EAAE,CAAC;QACJC,KAAK,EAAE,CAAC;QACRC,MAAM,EAAE,CAAC;QACTC,KAAK,EAAE,CAAC;QACRC,KAAK,EAAE;MACT,CAAC;IACH,CAAC;IACDT,MAAM,CAACU,SAAS,GAAG,MAAM;MACvBR,OAAO,CAACC,IAAI,CACV,gFAAgF,CACjF;IACH,CAAC;IACDH,MAAM,CAACW,gBAAgB,GAAG,MAAM;MAC9BT,OAAO,CAACC,IAAI,CACV,6GAA6G,CAC9G;IACH,CAAC;IACDH,MAAM,CAACY,gBAAgB,GAAG,MAAM;MAC9BV,OAAO,CAACC,IAAI,CACV,uFAAuF,CACxF;IACH,CAAC;EACH;EACA,OAAO,IAAI;AACb,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,eAAeJ,uBAAuB,EAAE"}
@@ -1,9 +1,7 @@
1
1
  import JSReanimated from './JSReanimated';
2
2
  const reanimatedJS = new JSReanimated();
3
-
4
3
  global._makeShareableClone = c => c;
5
-
6
- global._scheduleOnJS = setImmediate;
4
+ global._scheduleOnJS = queueMicrotask;
7
5
  export const _updatePropsJS = (updates, viewRef) => {
8
6
  if (viewRef._component) {
9
7
  const component = viewRef._component;
@@ -13,7 +11,6 @@ export const _updatePropsJS = (updates, viewRef) => {
13
11
  acc[index][key] = value;
14
12
  return acc;
15
13
  }, [{}, {}]);
16
-
17
14
  if (typeof component.setNativeProps === 'function') {
18
15
  setNativeProps(component, rawStyles);
19
16
  } else if (Object.keys(component.props).length > 0) {
@@ -21,9 +18,7 @@ export const _updatePropsJS = (updates, viewRef) => {
21
18
  if (!rawStyles[key]) {
22
19
  return;
23
20
  }
24
-
25
21
  const dashedKey = key.replace(/[A-Z]/g, m => '-' + m.toLowerCase());
26
-
27
22
  component._touchableNode.setAttribute(dashedKey, rawStyles[key]);
28
23
  });
29
24
  } else {
@@ -31,10 +26,10 @@ export const _updatePropsJS = (updates, viewRef) => {
31
26
  }
32
27
  }
33
28
  };
34
-
35
29
  const setNativeProps = (component, style) => {
36
30
  const previousStyle = component.previousStyle ? component.previousStyle : {};
37
- const currentStyle = { ...previousStyle,
31
+ const currentStyle = {
32
+ ...previousStyle,
38
33
  ...style
39
34
  };
40
35
  component.previousStyle = currentStyle;
@@ -42,6 +37,5 @@ const setNativeProps = (component, style) => {
42
37
  style: currentStyle
43
38
  });
44
39
  };
45
-
46
40
  export default reanimatedJS;
47
41
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["JSReanimated","reanimatedJS","global","_makeShareableClone","c","_scheduleOnJS","setImmediate","_updatePropsJS","updates","viewRef","_component","component","rawStyles","Object","keys","reduce","acc","key","value","index","setNativeProps","props","length","forEach","dashedKey","replace","m","toLowerCase","_touchableNode","setAttribute","console","warn","style","previousStyle","currentStyle"],"sources":["index.ts"],"sourcesContent":["import JSReanimated from './JSReanimated';\nimport { AnimatedStyle, StyleProps } from '../commonTypes';\n\nconst reanimatedJS = new JSReanimated();\n\nglobal._makeShareableClone = (c) => c;\nglobal._scheduleOnJS = setImmediate;\n\ninterface JSReanimatedComponent {\n previousStyle: StyleProps;\n setNativeProps: (style: StyleProps) => void;\n props: Record<string, string | number>;\n _touchableNode: {\n setAttribute: (key: string, props: unknown) => void;\n };\n}\n\nexport const _updatePropsJS = (\n updates: StyleProps | AnimatedStyle,\n viewRef: { _component?: JSReanimatedComponent }\n): void => {\n if (viewRef._component) {\n const component = viewRef._component;\n const [rawStyles] = Object.keys(updates).reduce(\n (acc: [StyleProps, AnimatedStyle], key) => {\n const value = updates[key];\n const index = typeof value === 'function' ? 1 : 0;\n acc[index][key] = value;\n return acc;\n },\n [{}, {}]\n );\n\n if (typeof component.setNativeProps === 'function') {\n setNativeProps(component, rawStyles);\n } else if (Object.keys(component.props).length > 0) {\n Object.keys(component.props).forEach((key) => {\n if (!rawStyles[key]) {\n return;\n }\n const dashedKey = key.replace(/[A-Z]/g, (m) => '-' + m.toLowerCase());\n component._touchableNode.setAttribute(dashedKey, rawStyles[key]);\n });\n } else {\n console.warn('It is not possible to manipulate component');\n }\n }\n};\n\nconst setNativeProps = (\n component: JSReanimatedComponent,\n style: StyleProps\n): void => {\n const previousStyle = component.previousStyle ? component.previousStyle : {};\n const currentStyle = { ...previousStyle, ...style };\n component.previousStyle = currentStyle;\n component.setNativeProps({ style: currentStyle });\n};\n\nexport default reanimatedJS;\n"],"mappings":"AAAA,OAAOA,YAAP,MAAyB,gBAAzB;AAGA,MAAMC,YAAY,GAAG,IAAID,YAAJ,EAArB;;AAEAE,MAAM,CAACC,mBAAP,GAA8BC,CAAD,IAAOA,CAApC;;AACAF,MAAM,CAACG,aAAP,GAAuBC,YAAvB;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ADqB,EAErBqB,KAFqB,KAGZ;EACT,MAAMC,aAAa,GAAGtB,SAAS,CAACsB,aAAV,GAA0BtB,SAAS,CAACsB,aAApC,GAAoD,EAA1E;EACA,MAAMC,YAAY,GAAG,EAAE,GAAGD,aAAL;IAAoB,GAAGD;EAAvB,CAArB;EACArB,SAAS,CAACsB,aAAV,GAA0BC,YAA1B;EACAvB,SAAS,CAACS,cAAV,CAAyB;IAAEY,KAAK,EAAEE;EAAT,CAAzB;AACD,CARD;;AAUA,eAAejC,YAAf"}
1
+ {"version":3,"names":["JSReanimated","reanimatedJS","global","_makeShareableClone","c","_scheduleOnJS","queueMicrotask","_updatePropsJS","updates","viewRef","_component","component","rawStyles","Object","keys","reduce","acc","key","value","index","setNativeProps","props","length","forEach","dashedKey","replace","m","toLowerCase","_touchableNode","setAttribute","console","warn","style","previousStyle","currentStyle"],"sources":["index.ts"],"sourcesContent":["import JSReanimated from './JSReanimated';\nimport { AnimatedStyle, StyleProps } from '../commonTypes';\n\nconst reanimatedJS = new JSReanimated();\n\nglobal._makeShareableClone = (c) => c;\nglobal._scheduleOnJS = queueMicrotask;\n\ninterface JSReanimatedComponent {\n previousStyle: StyleProps;\n setNativeProps: (style: StyleProps) => void;\n props: Record<string, string | number>;\n _touchableNode: {\n setAttribute: (key: string, props: unknown) => void;\n };\n}\n\nexport const _updatePropsJS = (\n updates: StyleProps | AnimatedStyle,\n viewRef: { _component?: JSReanimatedComponent }\n): void => {\n if (viewRef._component) {\n const component = viewRef._component;\n const [rawStyles] = Object.keys(updates).reduce(\n (acc: [StyleProps, AnimatedStyle], key) => {\n const value = updates[key];\n const index = typeof value === 'function' ? 1 : 0;\n acc[index][key] = value;\n return acc;\n },\n [{}, {}]\n );\n\n if (typeof component.setNativeProps === 'function') {\n setNativeProps(component, rawStyles);\n } else if (Object.keys(component.props).length > 0) {\n Object.keys(component.props).forEach((key) => {\n if (!rawStyles[key]) {\n return;\n }\n const dashedKey = key.replace(/[A-Z]/g, (m) => '-' + m.toLowerCase());\n component._touchableNode.setAttribute(dashedKey, rawStyles[key]);\n });\n } else {\n console.warn('It is not possible to manipulate component');\n }\n }\n};\n\nconst setNativeProps = (\n component: JSReanimatedComponent,\n style: StyleProps\n): void => {\n const previousStyle = component.previousStyle ? component.previousStyle : {};\n const currentStyle = { ...previousStyle, ...style };\n component.previousStyle = currentStyle;\n component.setNativeProps({ style: currentStyle });\n};\n\nexport default reanimatedJS;\n"],"mappings":"AAAA,OAAOA,YAAY,MAAM,gBAAgB;AAGzC,MAAMC,YAAY,GAAG,IAAID,YAAY,EAAE;AAEvCE,MAAM,CAACC,mBAAmB,GAAIC,CAAC,IAAKA,CAAC;AACrCF,MAAM,CAACG,aAAa,GAAGC,cAAc;AAWrC,OAAO,MAAMC,cAAc,GAAGA,CAC5BC,OAAmC,EACnCC,OAA+C,KACtC;EACT,IAAIA,OAAO,CAACC,UAAU,EAAE;IACtB,MAAMC,SAAS,GAAGF,OAAO,CAACC,UAAU;IACpC,MAAM,CAACE,SAAS,CAAC,GAAGC,MAAM,CAACC,IAAI,CAACN,OAAO,CAAC,CAACO,MAAM,CAC7C,CAACC,GAAgC,EAAEC,GAAG,KAAK;MACzC,MAAMC,KAAK,GAAGV,OAAO,CAACS,GAAG,CAAC;MAC1B,MAAME,KAAK,GAAG,OAAOD,KAAK,KAAK,UAAU,GAAG,CAAC,GAAG,CAAC;MACjDF,GAAG,CAACG,KAAK,CAAC,CAACF,GAAG,CAAC,GAAGC,KAAK;MACvB,OAAOF,GAAG;IACZ,CAAC,EACD,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CACT;IAED,IAAI,OAAOL,SAAS,CAACS,cAAc,KAAK,UAAU,EAAE;MAClDA,cAAc,CAACT,SAAS,EAAEC,SAAS,CAAC;IACtC,CAAC,MAAM,IAAIC,MAAM,CAACC,IAAI,CAACH,SAAS,CAACU,KAAK,CAAC,CAACC,MAAM,GAAG,CAAC,EAAE;MAClDT,MAAM,CAACC,IAAI,CAACH,SAAS,CAACU,KAAK,CAAC,CAACE,OAAO,CAAEN,GAAG,IAAK;QAC5C,IAAI,CAACL,SAAS,CAACK,GAAG,CAAC,EAAE;UACnB;QACF;QACA,MAAMO,SAAS,GAAGP,GAAG,CAACQ,OAAO,CAAC,QAAQ,EAAGC,CAAC,IAAK,GAAG,GAAGA,CAAC,CAACC,WAAW,EAAE,CAAC;QACrEhB,SAAS,CAACiB,cAAc,CAACC,YAAY,CAACL,SAAS,EAAEZ,SAAS,CAACK,GAAG,CAAC,CAAC;MAClE,CAAC,CAAC;IACJ,CAAC,MAAM;MACLa,OAAO,CAACC,IAAI,CAAC,4CAA4C,CAAC;IAC5D;EACF;AACF,CAAC;AAED,MAAMX,cAAc,GAAGA,CACrBT,SAAgC,EAChCqB,KAAiB,KACR;EACT,MAAMC,aAAa,GAAGtB,SAAS,CAACsB,aAAa,GAAGtB,SAAS,CAACsB,aAAa,GAAG,CAAC,CAAC;EAC5E,MAAMC,YAAY,GAAG;IAAE,GAAGD,aAAa;IAAE,GAAGD;EAAM,CAAC;EACnDrB,SAAS,CAACsB,aAAa,GAAGC,YAAY;EACtCvB,SAAS,CAACS,cAAc,CAAC;IAAEY,KAAK,EAAEE;EAAa,CAAC,CAAC;AACnD,CAAC;AAED,eAAejC,YAAY"}
@@ -1,75 +1,62 @@
1
- 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; }
2
-
1
+ 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; }
2
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
3
+ 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); }
3
4
  import { withDelay } from '../../animation';
4
5
  export class BaseAnimationBuilder {
5
6
  constructor() {
6
7
  _defineProperty(this, "durationV", void 0);
7
-
8
8
  _defineProperty(this, "delayV", void 0);
9
-
10
9
  _defineProperty(this, "randomizeDelay", false);
11
-
12
10
  _defineProperty(this, "callbackV", void 0);
13
-
14
11
  _defineProperty(this, "build", () => {
15
12
  throw Error('Unimplemented method in child class.');
16
13
  });
17
14
  }
18
-
19
15
  static duration(durationMs) {
20
16
  const instance = this.createInstance();
21
17
  return instance.duration(durationMs);
22
18
  }
23
-
24
19
  duration(durationMs) {
25
20
  this.durationV = durationMs;
26
21
  return this;
27
22
  }
28
-
29
23
  static delay(delayMs) {
30
24
  const instance = this.createInstance();
31
25
  return instance.delay(delayMs);
32
26
  }
33
-
34
27
  delay(delayMs) {
35
28
  this.delayV = delayMs;
36
29
  return this;
37
30
  }
38
-
39
31
  static withCallback(callback) {
40
32
  const instance = this.createInstance();
41
33
  return instance.withCallback(callback);
42
34
  }
43
-
44
35
  withCallback(callback) {
45
36
  this.callbackV = callback;
46
37
  return this;
47
- } // 300ms is the default animation duration. If any animation has different default has to override this method.
48
-
38
+ }
49
39
 
40
+ // 300ms is the default animation duration. If any animation has different default has to override this method.
50
41
  static getDuration() {
51
42
  return 300;
52
43
  }
53
-
54
44
  getDuration() {
55
45
  return this.durationV ?? 300;
56
46
  }
57
-
58
47
  static randomDelay() {
59
48
  const instance = this.createInstance();
60
49
  return instance.randomDelay();
61
50
  }
62
-
63
51
  randomDelay() {
64
52
  this.randomizeDelay = true;
65
53
  return this;
66
- } // when randomizeDelay is set to true, randomize delay between 0 and provided value (or 1000ms if delay is not provided)
67
-
54
+ }
68
55
 
56
+ // when randomizeDelay is set to true, randomize delay between 0 and provided value (or 1000ms if delay is not provided)
69
57
  getDelay() {
70
58
  return this.randomizeDelay ? Math.random() * (this.delayV ?? 1000) : this.delayV ?? 0;
71
59
  }
72
-
73
60
  getDelayFunction() {
74
61
  const isDelayProvided = this.randomizeDelay || this.delayV;
75
62
  return isDelayProvided ? withDelay : (_, animation) => {
@@ -78,13 +65,10 @@ export class BaseAnimationBuilder {
78
65
  return animation;
79
66
  };
80
67
  }
81
-
82
68
  static build() {
83
69
  const instance = this.createInstance();
84
70
  return instance.build();
85
71
  }
86
-
87
72
  }
88
-
89
73
  _defineProperty(BaseAnimationBuilder, "createInstance", void 0);
90
74
  //# sourceMappingURL=BaseAnimationBuilder.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["withDelay","BaseAnimationBuilder","Error","duration","durationMs","instance","createInstance","durationV","delay","delayMs","delayV","withCallback","callback","callbackV","getDuration","randomDelay","randomizeDelay","getDelay","Math","random","getDelayFunction","isDelayProvided","_","animation","build"],"sources":["BaseAnimationBuilder.ts"],"sourcesContent":["import { withDelay } from '../../animation';\nimport {\n EntryExitAnimationFunction,\n AnimationFunction,\n LayoutAnimationFunction,\n} from './commonTypes';\n\nexport class BaseAnimationBuilder {\n durationV?: number;\n delayV?: number;\n randomizeDelay = false;\n callbackV?: (finished: boolean) => void;\n\n static createInstance: () => BaseAnimationBuilder;\n build = (): EntryExitAnimationFunction | LayoutAnimationFunction => {\n throw Error('Unimplemented method in child class.');\n };\n\n static duration(durationMs: number): BaseAnimationBuilder {\n const instance = this.createInstance();\n return instance.duration(durationMs);\n }\n\n duration(durationMs: number): BaseAnimationBuilder {\n this.durationV = durationMs;\n return this;\n }\n\n static delay(delayMs: number): BaseAnimationBuilder {\n const instance = this.createInstance();\n return instance.delay(delayMs);\n }\n\n delay(delayMs: number): BaseAnimationBuilder {\n this.delayV = delayMs;\n return this;\n }\n\n static withCallback(\n callback: (finished: boolean) => void\n ): BaseAnimationBuilder {\n const instance = this.createInstance();\n return instance.withCallback(callback);\n }\n\n withCallback(callback: (finsihed: boolean) => void): BaseAnimationBuilder {\n this.callbackV = callback;\n return this;\n }\n\n // 300ms is the default animation duration. If any animation has different default has to override this method.\n static getDuration(): number {\n return 300;\n }\n\n getDuration(): number {\n return this.durationV ?? 300;\n }\n\n static randomDelay(): BaseAnimationBuilder {\n const instance = this.createInstance();\n return instance.randomDelay();\n }\n\n randomDelay(): BaseAnimationBuilder {\n this.randomizeDelay = true;\n return this;\n }\n\n // when randomizeDelay is set to true, randomize delay between 0 and provided value (or 1000ms if delay is not provided)\n getDelay(): number {\n return this.randomizeDelay\n ? Math.random() * (this.delayV ?? 1000)\n : this.delayV ?? 0;\n }\n\n getDelayFunction(): AnimationFunction {\n const isDelayProvided = this.randomizeDelay || this.delayV;\n return isDelayProvided\n ? withDelay\n : (_, animation) => {\n 'worklet';\n return animation;\n };\n }\n\n static build(): EntryExitAnimationFunction | LayoutAnimationFunction {\n const instance = this.createInstance();\n return instance.build();\n }\n}\n"],"mappings":";;AAAA,SAASA,SAAT,QAA0B,iBAA1B;AAOA,OAAO,MAAMC,oBAAN,CAA2B;EAAA;IAAA;;IAAA;;IAAA,wCAGf,KAHe;;IAAA;;IAAA,+BAOxB,MAA4D;MAClE,MAAMC,KAAK,CAAC,sCAAD,CAAX;IACD,CAT+B;EAAA;;EAWjB,OAARC,QAAQ,CAACC,UAAD,EAA2C;IACxD,MAAMC,QAAQ,GAAG,KAAKC,cAAL,EAAjB;IACA,OAAOD,QAAQ,CAACF,QAAT,CAAkBC,UAAlB,CAAP;EACD;;EAEDD,QAAQ,CAACC,UAAD,EAA2C;IACjD,KAAKG,SAAL,GAAiBH,UAAjB;IACA,OAAO,IAAP;EACD;;EAEW,OAALI,KAAK,CAACC,OAAD,EAAwC;IAClD,MAAMJ,QAAQ,GAAG,KAAKC,cAAL,EAAjB;IACA,OAAOD,QAAQ,CAACG,KAAT,CAAeC,OAAf,CAAP;EACD;;EAEDD,KAAK,CAACC,OAAD,EAAwC;IAC3C,KAAKC,MAAL,GAAcD,OAAd;IACA,OAAO,IAAP;EACD;;EAEkB,OAAZE,YAAY,CACjBC,QADiB,EAEK;IACtB,MAAMP,QAAQ,GAAG,KAAKC,cAAL,EAAjB;IACA,OAAOD,QAAQ,CAACM,YAAT,CAAsBC,QAAtB,CAAP;EACD;;EAEDD,YAAY,CAACC,QAAD,EAA8D;IACxE,KAAKC,SAAL,GAAiBD,QAAjB;IACA,OAAO,IAAP;EACD,CAzC+B,CA2ChC;;;EACkB,OAAXE,WAAW,GAAW;IAC3B,OAAO,GAAP;EACD;;EAEDA,WAAW,GAAW;IACpB,OAAO,KAAKP,SAAL,IAAkB,GAAzB;EACD;;EAEiB,OAAXQ,WAAW,GAAyB;IACzC,MAAMV,QAAQ,GAAG,KAAKC,cAAL,EAAjB;IACA,OAAOD,QAAQ,CAACU,WAAT,EAAP;EACD;;EAEDA,WAAW,GAAyB;IAClC,KAAKC,cAAL,GAAsB,IAAtB;IACA,OAAO,IAAP;EACD,CA5D+B,CA8DhC;;;EACAC,QAAQ,GAAW;IACjB,OAAO,KAAKD,cAAL,GACHE,IAAI,CAACC,MAAL,MAAiB,KAAKT,MAAL,IAAe,IAAhC,CADG,GAEH,KAAKA,MAAL,IAAe,CAFnB;EAGD;;EAEDU,gBAAgB,GAAsB;IACpC,MAAMC,eAAe,GAAG,KAAKL,cAAL,IAAuB,KAAKN,MAApD;IACA,OAAOW,eAAe,GAClBrB,SADkB,GAElB,CAACsB,CAAD,EAAIC,SAAJ,KAAkB;MAChB;;MACA,OAAOA,SAAP;IACD,CALL;EAMD;;EAEW,OAALC,KAAK,GAAyD;IACnE,MAAMnB,QAAQ,GAAG,KAAKC,cAAL,EAAjB;IACA,OAAOD,QAAQ,CAACmB,KAAT,EAAP;EACD;;AAlF+B;;gBAArBvB,oB"}
1
+ {"version":3,"names":["withDelay","BaseAnimationBuilder","constructor","_defineProperty","Error","duration","durationMs","instance","createInstance","durationV","delay","delayMs","delayV","withCallback","callback","callbackV","getDuration","randomDelay","randomizeDelay","getDelay","Math","random","getDelayFunction","isDelayProvided","_","animation","build"],"sources":["BaseAnimationBuilder.ts"],"sourcesContent":["import { withDelay } from '../../animation';\nimport {\n EntryExitAnimationFunction,\n AnimationFunction,\n LayoutAnimationFunction,\n} from './commonTypes';\n\nexport class BaseAnimationBuilder {\n durationV?: number;\n delayV?: number;\n randomizeDelay = false;\n callbackV?: (finished: boolean) => void;\n\n static createInstance: () => BaseAnimationBuilder;\n build = (): EntryExitAnimationFunction | LayoutAnimationFunction => {\n throw Error('Unimplemented method in child class.');\n };\n\n static duration(durationMs: number): BaseAnimationBuilder {\n const instance = this.createInstance();\n return instance.duration(durationMs);\n }\n\n duration(durationMs: number): BaseAnimationBuilder {\n this.durationV = durationMs;\n return this;\n }\n\n static delay(delayMs: number): BaseAnimationBuilder {\n const instance = this.createInstance();\n return instance.delay(delayMs);\n }\n\n delay(delayMs: number): BaseAnimationBuilder {\n this.delayV = delayMs;\n return this;\n }\n\n static withCallback(\n callback: (finished: boolean) => void\n ): BaseAnimationBuilder {\n const instance = this.createInstance();\n return instance.withCallback(callback);\n }\n\n withCallback(callback: (finsihed: boolean) => void): BaseAnimationBuilder {\n this.callbackV = callback;\n return this;\n }\n\n // 300ms is the default animation duration. If any animation has different default has to override this method.\n static getDuration(): number {\n return 300;\n }\n\n getDuration(): number {\n return this.durationV ?? 300;\n }\n\n static randomDelay(): BaseAnimationBuilder {\n const instance = this.createInstance();\n return instance.randomDelay();\n }\n\n randomDelay(): BaseAnimationBuilder {\n this.randomizeDelay = true;\n return this;\n }\n\n // when randomizeDelay is set to true, randomize delay between 0 and provided value (or 1000ms if delay is not provided)\n getDelay(): number {\n return this.randomizeDelay\n ? Math.random() * (this.delayV ?? 1000)\n : this.delayV ?? 0;\n }\n\n getDelayFunction(): AnimationFunction {\n const isDelayProvided = this.randomizeDelay || this.delayV;\n return isDelayProvided\n ? withDelay\n : (_, animation) => {\n 'worklet';\n return animation;\n };\n }\n\n static build(): EntryExitAnimationFunction | LayoutAnimationFunction {\n const instance = this.createInstance();\n return instance.build();\n }\n}\n"],"mappings":";;;AAAA,SAASA,SAAS,QAAQ,iBAAiB;AAO3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AI,CAACC,cAAc,GAAG,IAAI;IAC1B,OAAO,IAAI;EACb;;EAEA;EACAC,QAAQA,CAAA,EAAW;IACjB,OAAO,IAAI,CAACD,cAAc,GACtBE,IAAI,CAACC,MAAM,EAAE,IAAI,IAAI,CAACT,MAAM,IAAI,IAAI,CAAC,GACrC,IAAI,CAACA,MAAM,IAAI,CAAC;EACtB;EAEAU,gBAAgBA,CAAA,EAAsB;IACpC,MAAMC,eAAe,GAAG,IAAI,CAACL,cAAc,IAAI,IAAI,CAACN,MAAM;IAC1D,OAAOW,eAAe,GAClBvB,SAAS,GACT,CAACwB,CAAC,EAAEC,SAAS,KAAK;MAChB,SAAS;;MACT,OAAOA,SAAS;IAClB,CAAC;EACP;EAEA,OAAOC,KAAKA,CAAA,EAAyD;IACnE,MAAMnB,QAAQ,GAAG,IAAI,CAACC,cAAc,EAAE;IACtC,OAAOD,QAAQ,CAACmB,KAAK,EAAE;EACzB;AACF;AAACvB,eAAA,CAnFYF,oBAAoB"}
@@ -1,132 +1,102 @@
1
- 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; }
2
-
1
+ 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; }
2
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
3
+ 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); }
3
4
  import { withTiming, withSpring } from '../../animation';
4
5
  import { BaseAnimationBuilder } from './BaseAnimationBuilder';
5
6
  export class ComplexAnimationBuilder extends BaseAnimationBuilder {
6
7
  constructor() {
7
8
  super(...arguments);
8
-
9
9
  _defineProperty(this, "easingV", void 0);
10
-
11
10
  _defineProperty(this, "rotateV", void 0);
12
-
13
11
  _defineProperty(this, "type", void 0);
14
-
15
12
  _defineProperty(this, "dampingV", void 0);
16
-
17
13
  _defineProperty(this, "massV", void 0);
18
-
19
14
  _defineProperty(this, "stiffnessV", void 0);
20
-
21
15
  _defineProperty(this, "overshootClampingV", void 0);
22
-
23
16
  _defineProperty(this, "restDisplacementThresholdV", void 0);
24
-
25
17
  _defineProperty(this, "restSpeedThresholdV", void 0);
26
-
27
18
  _defineProperty(this, "initialValues", void 0);
28
19
  }
29
-
30
20
  static easing(easingFunction) {
31
21
  const instance = this.createInstance();
32
22
  return instance.easing(easingFunction);
33
23
  }
34
-
35
24
  easing(easingFunction) {
36
25
  this.easingV = easingFunction;
37
26
  return this;
38
27
  }
39
-
40
28
  static rotate(degree) {
41
29
  const instance = this.createInstance();
42
30
  return instance.rotate(degree);
43
31
  }
44
-
45
32
  rotate(degree) {
46
33
  this.rotateV = degree;
47
34
  return this;
48
35
  }
49
-
50
36
  static springify() {
51
37
  const instance = this.createInstance();
52
38
  return instance.springify();
53
39
  }
54
-
55
40
  springify() {
56
41
  this.type = withSpring;
57
42
  return this;
58
43
  }
59
-
60
44
  static damping(damping) {
61
45
  const instance = this.createInstance();
62
46
  return instance.damping(damping);
63
47
  }
64
-
65
48
  damping(damping) {
66
49
  this.dampingV = damping;
67
50
  return this;
68
51
  }
69
-
70
52
  static mass(mass) {
71
53
  const instance = this.createInstance();
72
54
  return instance.mass(mass);
73
55
  }
74
-
75
56
  mass(mass) {
76
57
  this.massV = mass;
77
58
  return this;
78
59
  }
79
-
80
60
  static stiffness(stiffness) {
81
61
  const instance = this.createInstance();
82
62
  return instance.stiffness(stiffness);
83
63
  }
84
-
85
64
  stiffness(stiffness) {
86
65
  this.stiffnessV = stiffness;
87
66
  return this;
88
67
  }
89
-
90
68
  static overshootClamping(overshootClamping) {
91
69
  const instance = this.createInstance();
92
70
  return instance.overshootClamping(overshootClamping);
93
71
  }
94
-
95
72
  overshootClamping(overshootClamping) {
96
73
  this.overshootClampingV = overshootClamping;
97
74
  return this;
98
75
  }
99
-
100
76
  static restDisplacementThreshold(restDisplacementThreshold) {
101
77
  const instance = this.createInstance();
102
78
  return instance.restDisplacementThreshold(restDisplacementThreshold);
103
79
  }
104
-
105
80
  restDisplacementThreshold(restDisplacementThreshold) {
106
81
  this.restDisplacementThresholdV = restDisplacementThreshold;
107
82
  return this;
108
83
  }
109
-
110
84
  static restSpeedThreshold(restSpeedThreshold) {
111
85
  const instance = this.createInstance();
112
86
  return instance.restSpeedThreshold(restSpeedThreshold);
113
87
  }
114
-
115
88
  restSpeedThreshold(restSpeedThreshold) {
116
89
  this.restSpeedThresholdV = restSpeedThreshold;
117
90
  return this;
118
91
  }
119
-
120
92
  static withInitialValues(values) {
121
93
  const instance = this.createInstance();
122
94
  return instance.withInitialValues(values);
123
95
  }
124
-
125
96
  withInitialValues(values) {
126
97
  this.initialValues = values;
127
98
  return this;
128
99
  }
129
-
130
100
  getAnimationAndConfig() {
131
101
  const duration = this.durationV;
132
102
  const easing = this.easingV;
@@ -140,16 +110,13 @@ export class ComplexAnimationBuilder extends BaseAnimationBuilder {
140
110
  const restSpeedThreshold = this.restSpeedThresholdV;
141
111
  const animation = type;
142
112
  const config = {};
143
-
144
113
  if (type === withTiming) {
145
114
  if (easing) {
146
115
  config.easing = easing;
147
116
  }
148
-
149
117
  if (duration) {
150
118
  config.duration = duration;
151
119
  }
152
-
153
120
  if (rotate) {
154
121
  config.rotate = rotate;
155
122
  }
@@ -157,36 +124,27 @@ export class ComplexAnimationBuilder extends BaseAnimationBuilder {
157
124
  if (damping) {
158
125
  config.damping = damping;
159
126
  }
160
-
161
127
  if (mass) {
162
128
  config.mass = mass;
163
129
  }
164
-
165
130
  if (stiffness) {
166
131
  config.stiffness = stiffness;
167
132
  }
168
-
169
133
  if (overshootClamping) {
170
134
  config.overshootClamping = overshootClamping;
171
135
  }
172
-
173
136
  if (restDisplacementThreshold) {
174
137
  config.restDisplacementThreshold = restDisplacementThreshold;
175
138
  }
176
-
177
139
  if (restSpeedThreshold) {
178
140
  config.restSpeedThreshold = restSpeedThreshold;
179
141
  }
180
-
181
142
  if (rotate) {
182
143
  config.rotate = rotate;
183
144
  }
184
145
  }
185
-
186
146
  return [animation, config];
187
147
  }
188
-
189
148
  }
190
-
191
149
  _defineProperty(ComplexAnimationBuilder, "createInstance", void 0);
192
150
  //# sourceMappingURL=ComplexAnimationBuilder.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["withTiming","withSpring","BaseAnimationBuilder","ComplexAnimationBuilder","easing","easingFunction","instance","createInstance","easingV","rotate","degree","rotateV","springify","type","damping","dampingV","mass","massV","stiffness","stiffnessV","overshootClamping","overshootClampingV","restDisplacementThreshold","restDisplacementThresholdV","restSpeedThreshold","restSpeedThresholdV","withInitialValues","values","initialValues","getAnimationAndConfig","duration","durationV","animation","config"],"sources":["ComplexAnimationBuilder.ts"],"sourcesContent":["import { withTiming, withSpring } from '../../animation';\nimport {\n AnimationFunction,\n BaseBuilderAnimationConfig,\n LayoutAnimationAndConfig,\n} from './commonTypes';\nimport { EasingFn } from '../../Easing';\nimport { BaseAnimationBuilder } from './BaseAnimationBuilder';\nimport { StyleProps } from '../../commonTypes';\n\nexport class ComplexAnimationBuilder extends BaseAnimationBuilder {\n easingV?: EasingFn;\n rotateV?: string;\n type?: AnimationFunction;\n dampingV?: number;\n massV?: number;\n stiffnessV?: number;\n overshootClampingV?: number;\n restDisplacementThresholdV?: number;\n restSpeedThresholdV?: number;\n initialValues?: StyleProps;\n\n static createInstance: () => ComplexAnimationBuilder;\n\n static easing(easingFunction: EasingFn): ComplexAnimationBuilder {\n const instance = this.createInstance();\n return instance.easing(easingFunction);\n }\n\n easing(easingFunction: EasingFn): ComplexAnimationBuilder {\n this.easingV = easingFunction;\n return this;\n }\n\n static rotate(degree: string): ComplexAnimationBuilder {\n const instance = this.createInstance();\n return instance.rotate(degree);\n }\n\n rotate(degree: string): ComplexAnimationBuilder {\n this.rotateV = degree;\n return this;\n }\n\n static springify(): ComplexAnimationBuilder {\n const instance = this.createInstance();\n return instance.springify();\n }\n\n springify(): ComplexAnimationBuilder {\n this.type = withSpring as AnimationFunction;\n return this;\n }\n\n static damping(damping: number): ComplexAnimationBuilder {\n const instance = this.createInstance();\n return instance.damping(damping);\n }\n\n damping(damping: number): ComplexAnimationBuilder {\n this.dampingV = damping;\n return this;\n }\n\n static mass(mass: number): ComplexAnimationBuilder {\n const instance = this.createInstance();\n return instance.mass(mass);\n }\n\n mass(mass: number): ComplexAnimationBuilder {\n this.massV = mass;\n return this;\n }\n\n static stiffness(stiffness: number): ComplexAnimationBuilder {\n const instance = this.createInstance();\n return instance.stiffness(stiffness);\n }\n\n stiffness(stiffness: number): ComplexAnimationBuilder {\n this.stiffnessV = stiffness;\n return this;\n }\n\n static overshootClamping(overshootClamping: number): ComplexAnimationBuilder {\n const instance = this.createInstance();\n return instance.overshootClamping(overshootClamping);\n }\n\n overshootClamping(overshootClamping: number): ComplexAnimationBuilder {\n this.overshootClampingV = overshootClamping;\n return this;\n }\n\n static restDisplacementThreshold(\n restDisplacementThreshold: number\n ): ComplexAnimationBuilder {\n const instance = this.createInstance();\n return instance.restDisplacementThreshold(restDisplacementThreshold);\n }\n\n restDisplacementThreshold(\n restDisplacementThreshold: number\n ): ComplexAnimationBuilder {\n this.restDisplacementThresholdV = restDisplacementThreshold;\n return this;\n }\n\n static restSpeedThreshold(\n restSpeedThreshold: number\n ): ComplexAnimationBuilder {\n const instance = this.createInstance();\n return instance.restSpeedThreshold(restSpeedThreshold);\n }\n\n restSpeedThreshold(restSpeedThreshold: number): ComplexAnimationBuilder {\n this.restSpeedThresholdV = restSpeedThreshold;\n return this;\n }\n\n static withInitialValues(values: StyleProps): BaseAnimationBuilder {\n const instance = this.createInstance();\n return instance.withInitialValues(values);\n }\n\n withInitialValues(values: StyleProps): BaseAnimationBuilder {\n this.initialValues = values;\n return this;\n }\n\n getAnimationAndConfig(): LayoutAnimationAndConfig {\n const duration = this.durationV;\n const easing = this.easingV;\n const rotate = this.rotateV;\n const type = this.type ? this.type : (withTiming as AnimationFunction);\n const damping = this.dampingV;\n const mass = this.massV;\n const stiffness = this.stiffnessV;\n const overshootClamping = this.overshootClampingV;\n const restDisplacementThreshold = this.restDisplacementThresholdV;\n const restSpeedThreshold = this.restSpeedThresholdV;\n\n const animation = type;\n\n const config: BaseBuilderAnimationConfig = {};\n\n if (type === withTiming) {\n if (easing) {\n config.easing = easing;\n }\n if (duration) {\n config.duration = duration;\n }\n if (rotate) {\n config.rotate = rotate;\n }\n } else {\n if (damping) {\n config.damping = damping;\n }\n if (mass) {\n config.mass = mass;\n }\n if (stiffness) {\n config.stiffness = stiffness;\n }\n if (overshootClamping) {\n config.overshootClamping = overshootClamping;\n }\n if (restDisplacementThreshold) {\n config.restDisplacementThreshold = restDisplacementThreshold;\n }\n if (restSpeedThreshold) {\n config.restSpeedThreshold = restSpeedThreshold;\n }\n if (rotate) {\n config.rotate = rotate;\n }\n }\n return [animation, config];\n }\n}\n"],"mappings":";;AAAA,SAASA,UAAT,EAAqBC,UAArB,QAAuC,iBAAvC;AAOA,SAASC,oBAAT,QAAqC,wBAArC;AAGA,OAAO,MAAMC,uBAAN,SAAsCD,oBAAtC,CAA2D;EAAA;IAAA;;IAAA;;IAAA;;IAAA;;IAAA;;IAAA;;IAAA;;IAAA;;IAAA;;IAAA;;IAAA;EAAA;;EAcnD,OAANE,MAAM,CAACC,cAAD,EAAoD;IAC/D,MAAMC,QAAQ,GAAG,KAAKC,cAAL,EAAjB;IACA,OAAOD,QAAQ,CAACF,MAAT,CAAgBC,cAAhB,CAAP;EACD;;EAEDD,MAAM,CAACC,cAAD,EAAoD;IACxD,KAAKG,OAAL,GAAeH,cAAf;IACA,OAAO,IAAP;EACD;;EAEY,OAANI,MAAM,CAACC,MAAD,EAA0C;IACrD,MAAMJ,QAAQ,GAAG,KAAKC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BAAvC;IACA,MAAMC,kBAAkB,GAAG,KAAKC,mBAAhC;IAEA,MAAMO,SAAS,GAAGnB,IAAlB;IAEA,MAAMoB,MAAkC,GAAG,EAA3C;;IAEA,IAAIpB,IAAI,KAAKb,UAAb,EAAyB;MACvB,IAAII,MAAJ,EAAY;QACV6B,MAAM,CAAC7B,MAAP,GAAgBA,MAAhB;MACD;;MACD,IAAI0B,QAAJ,EAAc;QACZG,MAAM,CAACH,QAAP,GAAkBA,QAAlB;MACD;;MACD,IAAIrB,MAAJ,EAAY;QACVwB,MAAM,CAACxB,MAAP,GAAgBA,MAAhB;MACD;IACF,CAVD,MAUO;MACL,IAAIK,OAAJ,EAAa;QACXmB,MAAM,CAACnB,OAAP,GAAiBA,OAAjB;MACD;;MACD,IAAIE,IAAJ,EAAU;QACRiB,MAAM,CAACjB,IAAP,GAAcA,IAAd;MACD;;MACD,IAAIE,SAAJ,EAAe;QACbe,MAAM,CAACf,SAAP,GAAmBA,SAAnB;MACD;;MACD,IAAIE,iBAAJ,EAAuB;QACrBa,MAAM,CAACb,iBAAP,GAA2BA,iBAA3B;MACD;;MACD,IAAIE,yBAAJ,EAA+B;QAC7BW,MAAM,CAACX,yBAAP,GAAmCA,yBAAnC;MACD;;MACD,IAAIE,kBAAJ,EAAwB;QACtBS,MAAM,CAACT,kBAAP,GAA4BA,kBAA5B;MACD;;MACD,IAAIf,MAAJ,EAAY;QACVwB,MAAM,CAACxB,MAAP,GAAgBA,MAAhB;MACD;IACF;;IACD,OAAO,CAACuB,SAAD,EAAYC,MAAZ,CAAP;EACD;;AA1K+D;;gBAArD9B,uB"}
1
+ {"version":3,"names":["withTiming","withSpring","BaseAnimationBuilder","ComplexAnimationBuilder","constructor","arguments","_defineProperty","easing","easingFunction","instance","createInstance","easingV","rotate","degree","rotateV","springify","type","damping","dampingV","mass","massV","stiffness","stiffnessV","overshootClamping","overshootClampingV","restDisplacementThreshold","restDisplacementThresholdV","restSpeedThreshold","restSpeedThresholdV","withInitialValues","values","initialValues","getAnimationAndConfig","duration","durationV","animation","config"],"sources":["ComplexAnimationBuilder.ts"],"sourcesContent":["import { withTiming, withSpring } from '../../animation';\nimport {\n AnimationFunction,\n BaseBuilderAnimationConfig,\n LayoutAnimationAndConfig,\n} from './commonTypes';\nimport { EasingFn } from '../../Easing';\nimport { BaseAnimationBuilder } from './BaseAnimationBuilder';\nimport { StyleProps } from '../../commonTypes';\n\nexport class ComplexAnimationBuilder extends BaseAnimationBuilder {\n easingV?: EasingFn;\n rotateV?: string;\n type?: AnimationFunction;\n dampingV?: number;\n massV?: number;\n stiffnessV?: number;\n overshootClampingV?: number;\n restDisplacementThresholdV?: number;\n restSpeedThresholdV?: number;\n initialValues?: StyleProps;\n\n static createInstance: () => ComplexAnimationBuilder;\n\n static easing(easingFunction: EasingFn): ComplexAnimationBuilder {\n const instance = this.createInstance();\n return instance.easing(easingFunction);\n }\n\n easing(easingFunction: EasingFn): ComplexAnimationBuilder {\n this.easingV = easingFunction;\n return this;\n }\n\n static rotate(degree: string): ComplexAnimationBuilder {\n const instance = this.createInstance();\n return instance.rotate(degree);\n }\n\n rotate(degree: string): ComplexAnimationBuilder {\n this.rotateV = degree;\n return this;\n }\n\n static springify(): ComplexAnimationBuilder {\n const instance = this.createInstance();\n return instance.springify();\n }\n\n springify(): ComplexAnimationBuilder {\n this.type = withSpring as AnimationFunction;\n return this;\n }\n\n static damping(damping: number): ComplexAnimationBuilder {\n const instance = this.createInstance();\n return instance.damping(damping);\n }\n\n damping(damping: number): ComplexAnimationBuilder {\n this.dampingV = damping;\n return this;\n }\n\n static mass(mass: number): ComplexAnimationBuilder {\n const instance = this.createInstance();\n return instance.mass(mass);\n }\n\n mass(mass: number): ComplexAnimationBuilder {\n this.massV = mass;\n return this;\n }\n\n static stiffness(stiffness: number): ComplexAnimationBuilder {\n const instance = this.createInstance();\n return instance.stiffness(stiffness);\n }\n\n stiffness(stiffness: number): ComplexAnimationBuilder {\n this.stiffnessV = stiffness;\n return this;\n }\n\n static overshootClamping(overshootClamping: number): ComplexAnimationBuilder {\n const instance = this.createInstance();\n return instance.overshootClamping(overshootClamping);\n }\n\n overshootClamping(overshootClamping: number): ComplexAnimationBuilder {\n this.overshootClampingV = overshootClamping;\n return this;\n }\n\n static restDisplacementThreshold(\n restDisplacementThreshold: number\n ): ComplexAnimationBuilder {\n const instance = this.createInstance();\n return instance.restDisplacementThreshold(restDisplacementThreshold);\n }\n\n restDisplacementThreshold(\n restDisplacementThreshold: number\n ): ComplexAnimationBuilder {\n this.restDisplacementThresholdV = restDisplacementThreshold;\n return this;\n }\n\n static restSpeedThreshold(\n restSpeedThreshold: number\n ): ComplexAnimationBuilder {\n const instance = this.createInstance();\n return instance.restSpeedThreshold(restSpeedThreshold);\n }\n\n restSpeedThreshold(restSpeedThreshold: number): ComplexAnimationBuilder {\n this.restSpeedThresholdV = restSpeedThreshold;\n return this;\n }\n\n static withInitialValues(values: StyleProps): BaseAnimationBuilder {\n const instance = this.createInstance();\n return instance.withInitialValues(values);\n }\n\n withInitialValues(values: StyleProps): BaseAnimationBuilder {\n this.initialValues = values;\n return this;\n }\n\n getAnimationAndConfig(): LayoutAnimationAndConfig {\n const duration = this.durationV;\n const easing = this.easingV;\n const rotate = this.rotateV;\n const type = this.type ? this.type : (withTiming as AnimationFunction);\n const damping = this.dampingV;\n const mass = this.massV;\n const stiffness = this.stiffnessV;\n const overshootClamping = this.overshootClampingV;\n const restDisplacementThreshold = this.restDisplacementThresholdV;\n const restSpeedThreshold = this.restSpeedThresholdV;\n\n const animation = type;\n\n const config: BaseBuilderAnimationConfig = {};\n\n if (type === withTiming) {\n if (easing) {\n config.easing = easing;\n }\n if (duration) {\n config.duration = duration;\n }\n if (rotate) {\n config.rotate = rotate;\n }\n } else {\n if (damping) {\n config.damping = damping;\n }\n if (mass) {\n config.mass = mass;\n }\n if (stiffness) {\n config.stiffness = stiffness;\n }\n if (overshootClamping) {\n config.overshootClamping = overshootClamping;\n }\n if (restDisplacementThreshold) {\n config.restDisplacementThreshold = restDisplacementThreshold;\n }\n if (restSpeedThreshold) {\n config.restSpeedThreshold = restSpeedThreshold;\n }\n if (rotate) {\n config.rotate = rotate;\n }\n }\n return [animation, config];\n }\n}\n"],"mappings":";;;AAAA,SAASA,UAAU,EAAEC,UAAU,QAAQ,iBAAiB;AAOxD,SAASC,oBAAoB,QAAQ,wBAAwB;AAG7D,OAAO,MAAMC,uBAAuB,SAASD,oBAAoB,CAAC;EAAAE,YAAA;IAAA,SAAAC,SAAA;IAAAC,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;EAAA;EAchE,OAAOC,MAAMA,CAACC,cAAwB,EAA2B;IAC/D,MAAMC,QAAQ,GAAG,IAAI,CAACC,cAAc,EAAE;IACtC,OAAOD,QAAQ,CAACF,MAAM,CAACC,cAAc,CAAC;EACxC;EAEAD,MAAMA,CAACC,cAAwB,EAA2B;IACxD,IAAI,CAACG,OAAO,GAAGH,cAAc;IAC7B,OAAO,IAAI;EACb;EAEA,OAAOI,MAAMA,CAACC,MAAc,EAA2B;IACrD,MAAMJ,QAAQ,GAAG,IAAI,CAACC,cAAc,EAAE;IACtC,OAAOD,QAAQ,CAACG,MAAM,CAACC,MAAM,CAAC;EAChC;EAEAD,MAAMA,CAACC,MAAc,EAA2B;IAC9C,IAAI,CAACC,OAAO,GAAGD,MAAM;IACrB,OAAO,IAAI;EACb;EAEA,OAAOE,SAASA,CAAA,EAA4B;IAC1C,MAAMN,QAAQ,GAAG,IAAI,CAACC,cAAc,EAAE;IACtC,OAAOD,QAAQ,CAACM,SAAS,EAAE;EAC7B;EAEAA,SAASA,CAAA,EAA4B;IACnC,IAAI,CAACC,IAAI,GAAGf,UAA+B;IAC3C,OAAO,IAAI;EACb;EAEA,OAAOgB,OAAOA,CAACA,OAAe,EAA2B;IACvD,MAAMR,QAAQ,GAAG,IAAI,C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