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":["reanimatedJS","JSReanimated","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;;;;AAGA,MAAMA,YAAY,GAAG,IAAIC,qBAAJ,EAArB;;AAEAC,MAAM,CAACC,mBAAP,GAA8BC,CAAD,IAAOA,CAApC;;AACAF,MAAM,CAACG,aAAP,GAAuBC,YAAvB;;AAWO,MAAMC,cAAc,GAAG,CAC5BC,OAD4B,EAE5BC,OAF4B,KAGnB;EACT,IAAIA,OAAO,CAACC,UAAZ,EAAwB;IACtB,MAAMC,SAAS,GAAGF,OAAO,CAACC,UAA1B;IACA,MAAM,CAACE,SAAD,IAAcC,MAAM,CAACC,IAAP,CAAYN,OAAZ,EAAqBO,MAArB,CAClB,CAACC,GAAD,EAAmCC,GAAnC,KAA2C;MACzC,MAAMC,KAAK,GAAGV,OAAO,CAACS,GAAD,CAArB;MACA,MAAME,KAAK,GAAG,OAAOD,KAAP,KAAiB,UAAjB,GAA8B,CAA9B,GAAkC,CAAhD;MACAF,GAAG,CAACG,KAAD,CAAH,CAAWF,GAAX,IAAkBC,KAAlB;MACA,OAAOF,GAAP;IACD,CANiB,EAOlB,CAAC,EAAD,EAAK,EAAL,CAPkB,CAApB;;IAUA,IAAI,OAAOL,SAAS,CAACS,cAAjB,KAAoC,UAAxC,EAAoD;MAClDA,cAAc,CAACT,SAAD,EAAYC,SAAZ,CAAd;IACD,CAFD,MAEO,IAAIC,MAAM,CAACC,IAAP,CAAYH,SAAS,CAACU,KAAtB,EAA6BC,MAA7B,GAAsC,CAA1C,EAA6C;MAClDT,MAAM,CAACC,IAAP,CAAYH,SAAS,CAACU,KAAtB,EAA6BE,OAA7B,CAAsCN,GAAD,IAAS;QAC5C,IAAI,CAACL,SAAS,CAACK,GAAD,CAAd,EAAqB;UACnB;QACD;;QACD,MAAMO,SAAS,GAAGP,GAAG,CAACQ,OAAJ,CAAY,QAAZ,EAAuBC,CAAD,IAAO,MAAMA,CAAC,CAACC,WAAF,EAAnC,CAAlB;;QACAhB,SAAS,CAACiB,cAAV,CAAyBC,YAAzB,CAAsCL,SAAtC,EAAiDZ,SAAS,CAACK,GAAD,CAA1D;MACD,CAND;IAOD,CARM,MAQA;MACLa,OAAO,CAACC,IAAR,CAAa,4CAAb;IACD;EACF;AACF,CA9BM;;;;AAgCP,MAAMX,cAAc,GAAG,CACrBT,SADqB,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;;eAUelC,Y"}
1
+ {"version":3,"names":["_JSReanimated","_interopRequireDefault","require","obj","__esModule","default","reanimatedJS","JSReanimated","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","exports","style","previousStyle","currentStyle","_default"],"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,IAAAA,aAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA0C,SAAAD,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,G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L,SAAS,EAAEZ,SAAS,CAACK,GAAG,CAAC,CAAC;MAClE,CAAC,CAAC;IACJ,CAAC,MAAM;MACLa,OAAO,CAACC,IAAI,CAAC,4CAA4C,CAAC;IAC5D;EACF;AACF,CAAC;AAACC,OAAA,CAAAzB,cAAA,GAAAA,cAAA;AAEF,MAAMa,cAAc,GAAGA,CACrBT,SAAgC,EAChCsB,KAAiB,KACR;EACT,MAAMC,aAAa,GAAGvB,SAAS,CAACuB,aAAa,GAAGvB,SAAS,CAACuB,aAAa,GAAG,CAAC,CAAC;EAC5E,MAAMC,YAAY,GAAG;IAAE,GAAGD,aAAa;IAAE,GAAGD;EAAM,CAAC;EACnDtB,SAAS,CAACuB,aAAa,GAAGC,YAAY;EACtCxB,SAAS,CAACS,cAAc,CAAC;IAAEa,KAAK,EAAEE;EAAa,CAAC,CAAC;AACnD,CAAC;AAAC,IAAAC,QAAA,GAEapC,YAAY;AAAAgC,OAAA,CAAAjC,OAAA,GAAAqC,QAAA"}
@@ -4,80 +4,65 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.BaseAnimationBuilder = 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
  class BaseAnimationBuilder {
13
12
  constructor() {
14
13
  _defineProperty(this, "durationV", void 0);
15
-
16
14
  _defineProperty(this, "delayV", void 0);
17
-
18
15
  _defineProperty(this, "randomizeDelay", false);
19
-
20
16
  _defineProperty(this, "callbackV", void 0);
21
-
22
17
  _defineProperty(this, "build", () => {
23
18
  throw Error('Unimplemented method in child class.');
24
19
  });
25
20
  }
26
-
27
21
  static duration(durationMs) {
28
22
  const instance = this.createInstance();
29
23
  return instance.duration(durationMs);
30
24
  }
31
-
32
25
  duration(durationMs) {
33
26
  this.durationV = durationMs;
34
27
  return this;
35
28
  }
36
-
37
29
  static delay(delayMs) {
38
30
  const instance = this.createInstance();
39
31
  return instance.delay(delayMs);
40
32
  }
41
-
42
33
  delay(delayMs) {
43
34
  this.delayV = delayMs;
44
35
  return this;
45
36
  }
46
-
47
37
  static withCallback(callback) {
48
38
  const instance = this.createInstance();
49
39
  return instance.withCallback(callback);
50
40
  }
51
-
52
41
  withCallback(callback) {
53
42
  this.callbackV = callback;
54
43
  return this;
55
- } // 300ms is the default animation duration. If any animation has different default has to override this method.
56
-
44
+ }
57
45
 
46
+ // 300ms is the default animation duration. If any animation has different default has to override this method.
58
47
  static getDuration() {
59
48
  return 300;
60
49
  }
61
-
62
50
  getDuration() {
63
51
  return this.durationV ?? 300;
64
52
  }
65
-
66
53
  static randomDelay() {
67
54
  const instance = this.createInstance();
68
55
  return instance.randomDelay();
69
56
  }
70
-
71
57
  randomDelay() {
72
58
  this.randomizeDelay = true;
73
59
  return this;
74
- } // when randomizeDelay is set to true, randomize delay between 0 and provided value (or 1000ms if delay is not provided)
75
-
60
+ }
76
61
 
62
+ // when randomizeDelay is set to true, randomize delay between 0 and provided value (or 1000ms if delay is not provided)
77
63
  getDelay() {
78
64
  return this.randomizeDelay ? Math.random() * (this.delayV ?? 1000) : this.delayV ?? 0;
79
65
  }
80
-
81
66
  getDelayFunction() {
82
67
  const isDelayProvided = this.randomizeDelay || this.delayV;
83
68
  return isDelayProvided ? _animation.withDelay : (_, animation) => {
@@ -86,15 +71,11 @@ class BaseAnimationBuilder {
86
71
  return animation;
87
72
  };
88
73
  }
89
-
90
74
  static build() {
91
75
  const instance = this.createInstance();
92
76
  return instance.build();
93
77
  }
94
-
95
78
  }
96
-
97
79
  exports.BaseAnimationBuilder = BaseAnimationBuilder;
98
-
99
80
  _defineProperty(BaseAnimationBuilder, "createInstance", void 0);
100
81
  //# sourceMappingURL=BaseAnimationBuilder.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["BaseAnimationBuilder","Error","duration","durationMs","instance","createInstance","durationV","delay","delayMs","delayV","withCallback","callback","callbackV","getDuration","randomDelay","randomizeDelay","getDelay","Math","random","getDelayFunction","isDelayProvided","withDelay","_","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;;;;AAOO,MAAMA,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,GAClBC,oBADkB,GAElB,CAACC,CAAD,EAAIC,SAAJ,KAAkB;MAChB;;MACA,OAAOA,SAAP;IACD,CALL;EAMD;;EAEW,OAALC,KAAK,GAAyD;IACnE,MAAMpB,QAAQ,GAAG,KAAKC,cAAL,EAAjB;IACA,OAAOD,QAAQ,CAACoB,KAAT,EAAP;EACD;;AAlF+B;;;;gBAArBxB,oB"}
1
+ {"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","BaseAnimationBuilder","constructor","Error","duration","durationMs","instance","createInstance","durationV","delay","delayMs","delayV","withCallback","callback","callbackV","getDuration","randomDelay","randomizeDelay","getDelay","Math","random","getDelayFunction","isDelayProvided","withDelay","_","animation","build","exports"],"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":";;;;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AAOC,KAAKA,CAAA,EAAyD;IACnE,MAAMpB,QAAQ,GAAG,IAAI,CAACC,cAAc,EAAE;IACtC,OAAOD,QAAQ,CAACoB,KAAK,EAAE;EACzB;AACF;AAACC,OAAA,CAAA1B,oBAAA,GAAAA,oBAAA;AAAAvB,eAAA,CAnFYuB,oBAAoB"}
@@ -4,138 +4,105 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.ComplexAnimationBuilder = void 0;
7
-
8
7
  var _animation = require("../../animation");
9
-
10
8
  var _BaseAnimationBuilder = require("./BaseAnimationBuilder");
11
-
12
- 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; }
13
-
9
+ 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; }
10
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
11
+ 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); }
14
12
  class ComplexAnimationBuilder extends _BaseAnimationBuilder.BaseAnimationBuilder {
15
13
  constructor() {
16
14
  super(...arguments);
17
-
18
15
  _defineProperty(this, "easingV", void 0);
19
-
20
16
  _defineProperty(this, "rotateV", void 0);
21
-
22
17
  _defineProperty(this, "type", void 0);
23
-
24
18
  _defineProperty(this, "dampingV", void 0);
25
-
26
19
  _defineProperty(this, "massV", void 0);
27
-
28
20
  _defineProperty(this, "stiffnessV", void 0);
29
-
30
21
  _defineProperty(this, "overshootClampingV", void 0);
31
-
32
22
  _defineProperty(this, "restDisplacementThresholdV", void 0);
33
-
34
23
  _defineProperty(this, "restSpeedThresholdV", void 0);
35
-
36
24
  _defineProperty(this, "initialValues", void 0);
37
25
  }
38
-
39
26
  static easing(easingFunction) {
40
27
  const instance = this.createInstance();
41
28
  return instance.easing(easingFunction);
42
29
  }
43
-
44
30
  easing(easingFunction) {
45
31
  this.easingV = easingFunction;
46
32
  return this;
47
33
  }
48
-
49
34
  static rotate(degree) {
50
35
  const instance = this.createInstance();
51
36
  return instance.rotate(degree);
52
37
  }
53
-
54
38
  rotate(degree) {
55
39
  this.rotateV = degree;
56
40
  return this;
57
41
  }
58
-
59
42
  static springify() {
60
43
  const instance = this.createInstance();
61
44
  return instance.springify();
62
45
  }
63
-
64
46
  springify() {
65
47
  this.type = _animation.withSpring;
66
48
  return this;
67
49
  }
68
-
69
50
  static damping(damping) {
70
51
  const instance = this.createInstance();
71
52
  return instance.damping(damping);
72
53
  }
73
-
74
54
  damping(damping) {
75
55
  this.dampingV = damping;
76
56
  return this;
77
57
  }
78
-
79
58
  static mass(mass) {
80
59
  const instance = this.createInstance();
81
60
  return instance.mass(mass);
82
61
  }
83
-
84
62
  mass(mass) {
85
63
  this.massV = mass;
86
64
  return this;
87
65
  }
88
-
89
66
  static stiffness(stiffness) {
90
67
  const instance = this.createInstance();
91
68
  return instance.stiffness(stiffness);
92
69
  }
93
-
94
70
  stiffness(stiffness) {
95
71
  this.stiffnessV = stiffness;
96
72
  return this;
97
73
  }
98
-
99
74
  static overshootClamping(overshootClamping) {
100
75
  const instance = this.createInstance();
101
76
  return instance.overshootClamping(overshootClamping);
102
77
  }
103
-
104
78
  overshootClamping(overshootClamping) {
105
79
  this.overshootClampingV = overshootClamping;
106
80
  return this;
107
81
  }
108
-
109
82
  static restDisplacementThreshold(restDisplacementThreshold) {
110
83
  const instance = this.createInstance();
111
84
  return instance.restDisplacementThreshold(restDisplacementThreshold);
112
85
  }
113
-
114
86
  restDisplacementThreshold(restDisplacementThreshold) {
115
87
  this.restDisplacementThresholdV = restDisplacementThreshold;
116
88
  return this;
117
89
  }
118
-
119
90
  static restSpeedThreshold(restSpeedThreshold) {
120
91
  const instance = this.createInstance();
121
92
  return instance.restSpeedThreshold(restSpeedThreshold);
122
93
  }
123
-
124
94
  restSpeedThreshold(restSpeedThreshold) {
125
95
  this.restSpeedThresholdV = restSpeedThreshold;
126
96
  return this;
127
97
  }
128
-
129
98
  static withInitialValues(values) {
130
99
  const instance = this.createInstance();
131
100
  return instance.withInitialValues(values);
132
101
  }
133
-
134
102
  withInitialValues(values) {
135
103
  this.initialValues = values;
136
104
  return this;
137
105
  }
138
-
139
106
  getAnimationAndConfig() {
140
107
  const duration = this.durationV;
141
108
  const easing = this.easingV;
@@ -149,16 +116,13 @@ class ComplexAnimationBuilder extends _BaseAnimationBuilder.BaseAnimationBuilder
149
116
  const restSpeedThreshold = this.restSpeedThresholdV;
150
117
  const animation = type;
151
118
  const config = {};
152
-
153
119
  if (type === _animation.withTiming) {
154
120
  if (easing) {
155
121
  config.easing = easing;
156
122
  }
157
-
158
123
  if (duration) {
159
124
  config.duration = duration;
160
125
  }
161
-
162
126
  if (rotate) {
163
127
  config.rotate = rotate;
164
128
  }
@@ -166,38 +130,28 @@ class ComplexAnimationBuilder extends _BaseAnimationBuilder.BaseAnimationBuilder
166
130
  if (damping) {
167
131
  config.damping = damping;
168
132
  }
169
-
170
133
  if (mass) {
171
134
  config.mass = mass;
172
135
  }
173
-
174
136
  if (stiffness) {
175
137
  config.stiffness = stiffness;
176
138
  }
177
-
178
139
  if (overshootClamping) {
179
140
  config.overshootClamping = overshootClamping;
180
141
  }
181
-
182
142
  if (restDisplacementThreshold) {
183
143
  config.restDisplacementThreshold = restDisplacementThreshold;
184
144
  }
185
-
186
145
  if (restSpeedThreshold) {
187
146
  config.restSpeedThreshold = restSpeedThreshold;
188
147
  }
189
-
190
148
  if (rotate) {
191
149
  config.rotate = rotate;
192
150
  }
193
151
  }
194
-
195
152
  return [animation, config];
196
153
  }
197
-
198
154
  }
199
-
200
155
  exports.ComplexAnimationBuilder = ComplexAnimationBuilder;
201
-
202
156
  _defineProperty(ComplexAnimationBuilder, "createInstance", void 0);
203
157
  //# sourceMappingURL=ComplexAnimationBuilder.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["ComplexAnimationBuilder","BaseAnimationBuilder","easing","easingFunction","instance","createInstance","easingV","rotate","degree","rotateV","springify","type","withSpring","damping","dampingV","mass","massV","stiffness","stiffnessV","overshootClamping","overshootClampingV","restDisplacementThreshold","restDisplacementThresholdV","restSpeedThreshold","restSpeedThresholdV","withInitialValues","values","initialValues","getAnimationAndConfig","duration","durationV","withTiming","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;;AAOA;;;;AAGO,MAAMA,uBAAN,SAAsCC,0CAAtC,CAA2D;EAAA;IAAA;;IAAA;;IAAA;;IAAA;;IAAA;;IAAA;;IAAA;;IAAA;;IAAA;;IAAA;;IAAA;EAAA;;EAcnD,OAANC,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,cAAL,EAAjB;IACA,OAAOD,QAAQ,CAACG,MAAT,CAAgBC,MAAhB,CAAP;EACD;;EAEDD,MAAM,CAACC,MAAD,EAA0C;IAC9C,KAAKC,OAAL,GAAeD,MAAf;IACA,OAAO,IAAP;EACD;;EAEe,OAATE,SAAS,GAA4B;IAC1C,MAAMN,QAAQ,GAAG,KAAKC,cAAL,EAAjB;IACA,OAAOD,QAAQ,CAACM,SAAT,EAAP;EACD;;EAEDA,SAAS,GAA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AkBA,QAAlB;MACD;;MACD,IAAItB,MAAJ,EAAY;QACV0B,MAAM,CAAC1B,MAAP,GAAgBA,MAAhB;MACD;IACF,CAVD,MAUO;MACL,IAAIM,OAAJ,EAAa;QACXoB,MAAM,CAACpB,OAAP,GAAiBA,OAAjB;MACD;;MACD,IAAIE,IAAJ,EAAU;QACRkB,MAAM,CAAClB,IAAP,GAAcA,IAAd;MACD;;MACD,IAAIE,SAAJ,EAAe;QACbgB,MAAM,CAAChB,SAAP,GAAmBA,SAAnB;MACD;;MACD,IAAIE,iBAAJ,EAAuB;QACrBc,MAAM,CAACd,iBAAP,GAA2BA,iBAA3B;MACD;;MACD,IAAIE,yBAAJ,EAA+B;QAC7BY,MAAM,CAACZ,yBAAP,GAAmCA,yBAAnC;MACD;;MACD,IAAIE,kBAAJ,EAAwB;QACtBU,MAAM,CAACV,kBAAP,GAA4BA,kBAA5B;MACD;;MACD,IAAIhB,MAAJ,EAAY;QACV0B,MAAM,CAAC1B,MAAP,GAAgBA,MAAhB;MACD;IACF;;IACD,OAAO,CAACyB,SAAD,EAAYC,MAAZ,CAAP;EACD;;AA1K+D;;;;gBAArDjC,uB"}
1
+ {"version":3,"names":["_animation","require","_BaseAnimationBuilder","_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","Number","ComplexAnimationBuilder","BaseAnimationBuilder","constructor","arguments","easing","easingFunction","instance","createInstance","easingV","rotate","degree","rotateV","springify","type","withSpring","damping","dampingV","mass","massV","stiffness","stiffnessV","overshootClamping","overshootClampingV","restDisplacementThreshold","restDisplacementThresholdV","restSpeedThreshold","restSpeedThresholdV","withInitialValues","values","initialValues","getAnimationAndConfig","duration","durationV","withTiming","animation","config","exports"],"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":";;;;;;A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S,EAAEC,MAAM,CAAC;EAC5B;AACF;AAACC,OAAA,CAAApC,uBAAA,GAAAA,uBAAA;AAAAvB,eAAA,CA3KYuB,uBAAuB"}
@@ -4,13 +4,11 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.Keyframe = void 0;
7
-
8
7
  var _Easing = require("../../Easing");
9
-
10
8
  var _animation = require("../../animation");
11
-
12
- 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; }
13
-
9
+ 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; }
10
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
11
+ 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); }
14
12
  class Keyframe {
15
13
  /*
16
14
  Keyframe definition should be passed in the constructor as the map
@@ -18,13 +16,9 @@ class Keyframe {
18
16
  */
19
17
  constructor(definitions) {
20
18
  _defineProperty(this, "durationV", void 0);
21
-
22
19
  _defineProperty(this, "delayV", void 0);
23
-
24
20
  _defineProperty(this, "callbackV", void 0);
25
-
26
21
  _defineProperty(this, "definitions", void 0);
27
-
28
22
  _defineProperty(this, "build", () => {
29
23
  const delay = this.delayV;
30
24
  const delayFunction = this.getDelayFunction();
@@ -37,14 +31,14 @@ class Keyframe {
37
31
  'worklet';
38
32
 
39
33
  const animations = {};
34
+
40
35
  /*
41
36
  For each style property, an animations sequence is created that corresponds with its key points.
42
37
  Transform style properties require special handling because of their nested structure.
43
38
  */
44
-
45
39
  const addAnimation = key => {
46
- const keyframePoints = keyframes[key]; // in case if property was only passed as initial value
47
-
40
+ const keyframePoints = keyframes[key];
41
+ // in case if property was only passed as initial value
48
42
  if (keyframePoints.length === 0) return;
49
43
  const animation = delayFunction(delay, keyframePoints.length === 1 ? (0, _animation.withTiming)(keyframePoints[0].value, {
50
44
  duration: keyframePoints[0].duration,
@@ -53,14 +47,11 @@ class Keyframe {
53
47
  duration: keyframePoint.duration,
54
48
  easing: keyframePoint.easing ? keyframePoint.easing : _Easing.Easing.linear
55
49
  }))));
56
-
57
50
  if (key.includes('transform')) {
58
51
  var _animations$transform;
59
-
60
52
  if (!('transform' in animations)) {
61
53
  animations.transform = [];
62
54
  }
63
-
64
55
  (_animations$transform = animations.transform) === null || _animations$transform === void 0 ? void 0 : _animations$transform.push({
65
56
  [key.split(':')[1]]: animation
66
57
  });
@@ -68,7 +59,6 @@ class Keyframe {
68
59
  animations[key] = animation;
69
60
  }
70
61
  };
71
-
72
62
  Object.keys(initialValues).forEach(key => {
73
63
  if (key.includes('transform')) {
74
64
  initialValues[key].forEach((transformProp, index) => {
@@ -87,10 +77,8 @@ class Keyframe {
87
77
  };
88
78
  };
89
79
  });
90
-
91
80
  this.definitions = definitions;
92
81
  }
93
-
94
82
  parseDefinitions() {
95
83
  /*
96
84
  Each style property contain an array with all their key points:
@@ -100,21 +88,17 @@ class Keyframe {
100
88
  /*
101
89
  Parsing keyframes 'from' and 'to'.
102
90
  */
103
-
104
91
  if (this.definitions.from) {
105
92
  if (this.definitions['0']) {
106
93
  throw Error("You cannot provide both keyframe 0 and 'from' as they both specified initial values");
107
94
  }
108
-
109
95
  this.definitions['0'] = this.definitions.from;
110
96
  delete this.definitions.from;
111
97
  }
112
-
113
98
  if (this.definitions.to) {
114
99
  if (this.definitions['100']) {
115
100
  throw Error("You cannot provide both keyframe 100 and 'to' as they both specified values at the end of the animation.");
116
101
  }
117
-
118
102
  this.definitions['100'] = this.definitions.to;
119
103
  delete this.definitions.to;
120
104
  }
@@ -122,21 +106,16 @@ class Keyframe {
122
106
  One of the assumptions is that keyframe 0 is required to properly set initial values.
123
107
  Every other keyframe should contain properties from the set provided as initial values.
124
108
  */
125
-
126
-
127
109
  if (!this.definitions['0']) {
128
110
  throw Error("Please provide 0, or 'from' keyframe with initial state of your object.");
129
111
  }
130
-
131
112
  const initialValues = this.definitions['0'];
132
113
  /*
133
114
  Initialize parsedKeyframes for properties provided in initial keyframe
134
115
  */
135
-
136
116
  Object.keys(initialValues).forEach(styleProp => {
137
117
  if (styleProp === 'transform') {
138
118
  var _initialValues$styleP;
139
-
140
119
  (_initialValues$styleP = initialValues[styleProp]) === null || _initialValues$styleP === void 0 ? void 0 : _initialValues$styleP.forEach((transformStyle, index) => {
141
120
  Object.keys(transformStyle).forEach(transformProp => {
142
121
  parsedKeyframes[index.toString() + '_transform:' + transformProp] = [];
@@ -148,17 +127,15 @@ class Keyframe {
148
127
  });
149
128
  const duration = this.durationV ? this.durationV : 500;
150
129
  const animationKeyPoints = Array.from(Object.keys(this.definitions));
151
-
152
130
  const getAnimationDuration = (key, currentKeyPoint) => {
153
131
  const maxDuration = currentKeyPoint / 100 * duration;
154
132
  const currentDuration = parsedKeyframes[key].reduce((acc, value) => acc + value.duration, 0);
155
133
  return maxDuration - currentDuration;
156
134
  };
135
+
157
136
  /*
158
137
  Other keyframes can't contain properties that were not specified in initial keyframe.
159
138
  */
160
-
161
-
162
139
  const addKeyPoint = _ref => {
163
140
  let {
164
141
  key,
@@ -166,38 +143,31 @@ class Keyframe {
166
143
  currentKeyPoint,
167
144
  easing
168
145
  } = _ref;
169
-
170
146
  if (!(key in parsedKeyframes)) {
171
147
  throw Error("Keyframe can contain only that set of properties that were provide with initial values (keyframe 0 or 'from')");
172
148
  }
173
-
174
149
  parsedKeyframes[key].push({
175
150
  duration: getAnimationDuration(key, currentKeyPoint),
176
151
  value: value,
177
152
  easing: easing
178
153
  });
179
154
  };
180
-
181
155
  animationKeyPoints.filter(value => parseInt(value) !== 0).sort((a, b) => parseInt(a) - parseInt(b)).forEach(keyPoint => {
182
156
  if (parseInt(keyPoint) < 0 || parseInt(keyPoint) > 100) {
183
157
  throw Error('Keyframe should be in between range 0 - 100.');
184
158
  }
185
-
186
159
  const keyframe = this.definitions[keyPoint];
187
160
  const easing = keyframe.easing;
188
161
  delete keyframe.easing;
189
-
190
162
  const addKeyPointWith = (key, value) => addKeyPoint({
191
163
  key,
192
164
  value,
193
165
  currentKeyPoint: parseInt(keyPoint),
194
166
  easing
195
167
  });
196
-
197
168
  Object.keys(keyframe).forEach(key => {
198
169
  if (key === 'transform') {
199
170
  var _keyframe$key;
200
-
201
171
  (_keyframe$key = keyframe[key]) === null || _keyframe$key === void 0 ? void 0 : _keyframe$key.forEach((transformStyle, index) => {
202
172
  Object.keys(transformStyle).forEach(transformProp => {
203
173
  addKeyPointWith(index.toString() + '_transform:' + transformProp, transformStyle[transformProp]);
@@ -213,22 +183,18 @@ class Keyframe {
213
183
  keyframes: parsedKeyframes
214
184
  };
215
185
  }
216
-
217
186
  duration(durationMs) {
218
187
  this.durationV = durationMs;
219
188
  return this;
220
189
  }
221
-
222
190
  delay(delayMs) {
223
191
  this.delayV = delayMs;
224
192
  return this;
225
193
  }
226
-
227
194
  withCallback(callback) {
228
195
  this.callbackV = callback;
229
196
  return this;
230
197
  }
231
-
232
198
  getDelayFunction() {
233
199
  const delay = this.delayV;
234
200
  return delay ? _animation.withDelay : (_, animation) => {
@@ -237,8 +203,6 @@ class Keyframe {
237
203
  return animation;
238
204
  };
239
205
  }
240
-
241
206
  }
242
-
243
207
  exports.Keyframe = Keyframe;
244
208
  //# sourceMappingURL=Keyframe.js.map