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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (423) hide show
  1. package/Common/cpp/Fabric/ShadowTreeCloner.cpp +5 -2
  2. package/Common/cpp/LayoutAnimations/LayoutAnimationsManager.cpp +42 -32
  3. package/Common/cpp/LayoutAnimations/LayoutAnimationsManager.h +5 -7
  4. package/Common/cpp/LayoutAnimations/LayoutAnimationsProxy.cpp +565 -0
  5. package/Common/cpp/LayoutAnimations/LayoutAnimationsProxy.h +74 -0
  6. package/Common/cpp/LayoutAnimations/LayoutAnimationsUtils.h +140 -0
  7. package/Common/cpp/NativeModules/NativeReanimatedModule.cpp +216 -58
  8. package/Common/cpp/NativeModules/NativeReanimatedModule.h +32 -11
  9. package/Common/cpp/NativeModules/NativeReanimatedModuleSpec.cpp +2 -17
  10. package/Common/cpp/NativeModules/NativeReanimatedModuleSpec.h +6 -8
  11. package/Common/cpp/ReanimatedRuntime/RNRuntimeDecorator.cpp +3 -0
  12. package/Common/cpp/ReanimatedRuntime/WorkletRuntime.cpp +3 -4
  13. package/Common/cpp/ReanimatedRuntime/WorkletRuntimeDecorator.cpp +8 -3
  14. package/Common/cpp/SharedItems/Shareables.cpp +31 -5
  15. package/Common/cpp/SharedItems/Shareables.h +18 -2
  16. package/Common/cpp/Tools/JSScheduler.cpp +29 -5
  17. package/Common/cpp/Tools/JSScheduler.h +21 -4
  18. package/Common/cpp/Tools/PlatformDepMethodsHolder.h +6 -2
  19. package/Common/cpp/Tools/UIRuntimeDecorator.cpp +6 -0
  20. package/Common/cpp/Tools/UIRuntimeDecorator.h +1 -0
  21. package/android/CMakeLists.txt +3 -0
  22. package/android/build.gradle +17 -5
  23. package/android/src/main/cpp/NativeProxy.cpp +77 -12
  24. package/android/src/main/cpp/NativeProxy.h +35 -1
  25. package/android/src/main/java/com/swmansion/reanimated/NodesManager.java +58 -19
  26. package/android/src/main/java/com/swmansion/reanimated/ReanimatedPackage.java +7 -2
  27. package/android/src/{reactNativeVersionPatch/ReanimatedUIManager/latest → main/java}/com/swmansion/reanimated/ReanimatedUIManagerFactory.java +5 -5
  28. package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/AnimationsManager.java +10 -6
  29. package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/ReanimatedNativeHierarchyManager.java +18 -1
  30. package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/SharedTransitionManager.java +105 -17
  31. package/android/src/main/java/com/swmansion/reanimated/sensor/ReanimatedSensor.java +2 -1
  32. package/android/src/paper/java/com/swmansion/reanimated/NativeReanimatedModuleSpec.java +37 -0
  33. package/android/src/{main/java/com/swmansion/reanimated → reactNativeVersionPatch/ReanimatedUIManager/73/com/swmansion}/ReanimatedModule.java +4 -3
  34. package/android/src/reactNativeVersionPatch/ReanimatedUIManager/{70 → 73}/com/swmansion/reanimated/layoutReanimation/ReanimatedUIManager.java +1 -22
  35. package/android/src/reactNativeVersionPatch/ReanimatedUIManager/latest/com/swmansion/reanimated/ReanimatedModule.java +176 -0
  36. package/android/src/reactNativeVersionPatch/ReanimatedUIManager/latest/com/swmansion/reanimated/layoutReanimation/ReanimatedUIManager.java +0 -26
  37. package/android/src/{fabric/java → reactNativeVersionPatch/RuntimeExecutor/73}/com/swmansion/reanimated/NativeProxy.java +16 -4
  38. package/android/src/reactNativeVersionPatch/RuntimeExecutor/latest/com/swmansion/reanimated/NativeProxy.java +143 -0
  39. package/apple/LayoutReanimation/REAAnimationsManager.h +3 -0
  40. package/apple/LayoutReanimation/REAAnimationsManager.m +11 -0
  41. package/apple/LayoutReanimation/REASharedTransitionManager.m +99 -23
  42. package/apple/LayoutReanimation/REASnapshot.h +1 -0
  43. package/apple/LayoutReanimation/REASnapshot.m +78 -37
  44. package/apple/REAModule.h +22 -2
  45. package/apple/REAModule.mm +97 -46
  46. package/apple/REANodesManager.h +3 -3
  47. package/apple/REANodesManager.mm +46 -22
  48. package/apple/native/NativeProxy.h +28 -2
  49. package/apple/native/NativeProxy.mm +65 -195
  50. package/apple/native/PlatformDepMethodsHolderImpl.h +59 -0
  51. package/apple/native/PlatformDepMethodsHolderImpl.mm +429 -0
  52. package/apple/sensor/ReanimatedSensor.m +5 -5
  53. package/lib/module/Animated.js.map +1 -1
  54. package/lib/module/ConfigHelper.js +1 -1
  55. package/lib/module/ConfigHelper.js.map +1 -1
  56. package/lib/module/animationBuilder.js +1 -0
  57. package/lib/module/animationBuilder.js.map +1 -1
  58. package/lib/module/createAnimatedComponent/InlinePropManager.js +4 -4
  59. package/lib/module/createAnimatedComponent/InlinePropManager.js.map +1 -1
  60. package/lib/module/createAnimatedComponent/JSPropsUpdater.js +9 -6
  61. package/lib/module/createAnimatedComponent/JSPropsUpdater.js.map +1 -1
  62. package/lib/module/createAnimatedComponent/JSPropsUpdater.web.js +11 -0
  63. package/lib/module/createAnimatedComponent/JSPropsUpdater.web.js.map +1 -0
  64. package/lib/module/createAnimatedComponent/PropsFilter.js +25 -9
  65. package/lib/module/createAnimatedComponent/PropsFilter.js.map +1 -1
  66. package/lib/module/createAnimatedComponent/commonTypes.js.map +1 -1
  67. package/lib/module/createAnimatedComponent/createAnimatedComponent.js +83 -52
  68. package/lib/module/createAnimatedComponent/createAnimatedComponent.js.map +1 -1
  69. package/lib/module/createAnimatedComponent/getViewInfo.js +37 -0
  70. package/lib/module/createAnimatedComponent/getViewInfo.js.map +1 -0
  71. package/lib/module/createAnimatedComponent/index.js.map +1 -1
  72. package/lib/module/createAnimatedComponent/setAndForwardRef.js +4 -5
  73. package/lib/module/createAnimatedComponent/setAndForwardRef.js.map +1 -1
  74. package/lib/module/createAnimatedComponent/utils.js.map +1 -1
  75. package/lib/module/index.js.map +1 -1
  76. package/lib/module/index.web.js +1 -2
  77. package/lib/module/index.web.js.map +1 -1
  78. package/lib/module/mock.js +12 -12
  79. package/lib/module/mock.js.map +1 -1
  80. package/lib/module/propsAllowlists.js.map +1 -1
  81. package/lib/module/reanimated2/Bezier.js.map +1 -1
  82. package/lib/module/reanimated2/Colors.js +4 -11
  83. package/lib/module/reanimated2/Colors.js.map +1 -1
  84. package/lib/module/reanimated2/Easing.js +3 -7
  85. package/lib/module/reanimated2/Easing.js.map +1 -1
  86. package/lib/module/reanimated2/NativeReanimated/NativeReanimated.js +16 -13
  87. package/lib/module/reanimated2/NativeReanimated/NativeReanimated.js.map +1 -1
  88. package/lib/module/reanimated2/NativeReanimated/index.js.map +1 -1
  89. package/lib/module/reanimated2/NativeReanimated/index.web.js.map +1 -1
  90. package/lib/module/reanimated2/PlatformChecker.js +2 -1
  91. package/lib/module/reanimated2/PlatformChecker.js.map +1 -1
  92. package/lib/module/reanimated2/PropAdapters.js +1 -1
  93. package/lib/module/reanimated2/PropAdapters.js.map +1 -1
  94. package/lib/module/reanimated2/PropsRegistry.js +1 -2
  95. package/lib/module/reanimated2/PropsRegistry.js.map +1 -1
  96. package/lib/module/reanimated2/Sensor.js +2 -2
  97. package/lib/module/reanimated2/Sensor.js.map +1 -1
  98. package/lib/module/reanimated2/SensorContainer.js +2 -2
  99. package/lib/module/reanimated2/SensorContainer.js.map +1 -1
  100. package/lib/module/reanimated2/UpdateLayoutAnimations.js +30 -8
  101. package/lib/module/reanimated2/UpdateLayoutAnimations.js.map +1 -1
  102. package/lib/module/reanimated2/UpdateProps.js.map +1 -1
  103. package/lib/module/reanimated2/ViewDescriptorsSet.js.map +1 -1
  104. package/lib/module/reanimated2/WorkletEventHandler.js +74 -31
  105. package/lib/module/reanimated2/WorkletEventHandler.js.map +1 -1
  106. package/lib/module/reanimated2/animation/clamp.js.map +1 -1
  107. package/lib/module/reanimated2/animation/commonTypes.js.map +1 -1
  108. package/lib/module/reanimated2/animation/decay/decay.js.map +1 -1
  109. package/lib/module/reanimated2/animation/decay/index.js.map +1 -1
  110. package/lib/module/reanimated2/animation/decay/rigidDecay.js.map +1 -1
  111. package/lib/module/reanimated2/animation/decay/rubberBandDecay.js.map +1 -1
  112. package/lib/module/reanimated2/animation/decay/utils.js.map +1 -1
  113. package/lib/module/reanimated2/animation/delay.js.map +1 -1
  114. package/lib/module/reanimated2/animation/index.js.map +1 -1
  115. package/lib/module/reanimated2/animation/repeat.js +1 -6
  116. package/lib/module/reanimated2/animation/repeat.js.map +1 -1
  117. package/lib/module/reanimated2/animation/sequence.js +1 -5
  118. package/lib/module/reanimated2/animation/sequence.js.map +1 -1
  119. package/lib/module/reanimated2/animation/spring.js.map +1 -1
  120. package/lib/module/reanimated2/animation/springUtils.js +8 -10
  121. package/lib/module/reanimated2/animation/springUtils.js.map +1 -1
  122. package/lib/module/reanimated2/animation/styleAnimation.js +5 -4
  123. package/lib/module/reanimated2/animation/styleAnimation.js.map +1 -1
  124. package/lib/module/reanimated2/animation/timing.js +4 -1
  125. package/lib/module/reanimated2/animation/timing.js.map +1 -1
  126. package/lib/module/reanimated2/animation/transformationMatrix/matrixUtils.js +1 -2
  127. package/lib/module/reanimated2/animation/transformationMatrix/matrixUtils.js.map +1 -1
  128. package/lib/module/reanimated2/animation/util.js +22 -2
  129. package/lib/module/reanimated2/animation/util.js.map +1 -1
  130. package/lib/module/reanimated2/commonTypes.js +3 -1
  131. package/lib/module/reanimated2/commonTypes.js.map +1 -1
  132. package/lib/module/reanimated2/component/FlatList.js +1 -0
  133. package/lib/module/reanimated2/component/FlatList.js.map +1 -1
  134. package/lib/module/reanimated2/component/Image.js +1 -0
  135. package/lib/module/reanimated2/component/Image.js.map +1 -1
  136. package/lib/module/reanimated2/component/LayoutAnimationConfig.js +1 -0
  137. package/lib/module/reanimated2/component/LayoutAnimationConfig.js.map +1 -1
  138. package/lib/module/reanimated2/component/PerformanceMonitor.js +169 -0
  139. package/lib/module/reanimated2/component/PerformanceMonitor.js.map +1 -0
  140. package/lib/module/reanimated2/component/ScrollView.js +1 -0
  141. package/lib/module/reanimated2/component/ScrollView.js.map +1 -1
  142. package/lib/module/reanimated2/component/Text.js +1 -0
  143. package/lib/module/reanimated2/component/Text.js.map +1 -1
  144. package/lib/module/reanimated2/component/View.js +1 -0
  145. package/lib/module/reanimated2/component/View.js.map +1 -1
  146. package/lib/module/reanimated2/core.js +6 -15
  147. package/lib/module/reanimated2/core.js.map +1 -1
  148. package/lib/module/reanimated2/errors.js +8 -8
  149. package/lib/module/reanimated2/errors.js.map +1 -1
  150. package/lib/module/reanimated2/fabricUtils.js +33 -8
  151. package/lib/module/reanimated2/fabricUtils.js.map +1 -1
  152. package/lib/module/reanimated2/fabricUtils.web.js.map +1 -1
  153. package/lib/module/reanimated2/frameCallback/FrameCallbackRegistryJS.js +2 -2
  154. package/lib/module/reanimated2/frameCallback/FrameCallbackRegistryJS.js.map +1 -1
  155. package/lib/module/reanimated2/frameCallback/FrameCallbackRegistryUI.js.map +1 -1
  156. package/lib/module/reanimated2/frameCallback/index.js.map +1 -1
  157. package/lib/module/reanimated2/globals.d.js.map +1 -1
  158. package/lib/module/reanimated2/helperTypes.js.map +1 -1
  159. package/lib/module/reanimated2/hook/commonTypes.js.map +1 -1
  160. package/lib/module/reanimated2/hook/index.js.map +1 -1
  161. package/lib/module/reanimated2/hook/useAnimatedGestureHandler.js +1 -0
  162. package/lib/module/reanimated2/hook/useAnimatedGestureHandler.js.map +1 -1
  163. package/lib/module/reanimated2/hook/useAnimatedKeyboard.js +3 -4
  164. package/lib/module/reanimated2/hook/useAnimatedKeyboard.js.map +1 -1
  165. package/lib/module/reanimated2/hook/useAnimatedProps.js.map +1 -1
  166. package/lib/module/reanimated2/hook/useAnimatedReaction.js +1 -0
  167. package/lib/module/reanimated2/hook/useAnimatedReaction.js.map +1 -1
  168. package/lib/module/reanimated2/hook/useAnimatedRef.js +12 -7
  169. package/lib/module/reanimated2/hook/useAnimatedRef.js.map +1 -1
  170. package/lib/module/reanimated2/hook/useAnimatedScrollHandler.js +3 -1
  171. package/lib/module/reanimated2/hook/useAnimatedScrollHandler.js.map +1 -1
  172. package/lib/module/reanimated2/hook/useAnimatedSensor.js.map +1 -1
  173. package/lib/module/reanimated2/hook/useAnimatedStyle.js +3 -6
  174. package/lib/module/reanimated2/hook/useAnimatedStyle.js.map +1 -1
  175. package/lib/module/reanimated2/hook/useDerivedValue.js +3 -1
  176. package/lib/module/reanimated2/hook/useDerivedValue.js.map +1 -1
  177. package/lib/module/reanimated2/hook/useEvent.js +4 -5
  178. package/lib/module/reanimated2/hook/useEvent.js.map +1 -1
  179. package/lib/module/reanimated2/hook/useFrameCallback.js +1 -2
  180. package/lib/module/reanimated2/hook/useFrameCallback.js.map +1 -1
  181. package/lib/module/reanimated2/hook/useHandler.js +3 -1
  182. package/lib/module/reanimated2/hook/useHandler.js.map +1 -1
  183. package/lib/module/reanimated2/hook/useReducedMotion.js.map +1 -1
  184. package/lib/module/reanimated2/hook/useScrollViewOffset.js +60 -16
  185. package/lib/module/reanimated2/hook/useScrollViewOffset.js.map +1 -1
  186. package/lib/module/reanimated2/hook/useSharedValue.js.map +1 -1
  187. package/lib/module/reanimated2/hook/useWorkletCallback.js.map +1 -1
  188. package/lib/module/reanimated2/hook/utils.js.map +1 -1
  189. package/lib/module/reanimated2/index.js +2 -0
  190. package/lib/module/reanimated2/index.js.map +1 -1
  191. package/lib/module/reanimated2/initializers.js +1 -5
  192. package/lib/module/reanimated2/initializers.js.map +1 -1
  193. package/lib/module/reanimated2/interpolateColor.js +2 -6
  194. package/lib/module/reanimated2/interpolateColor.js.map +1 -1
  195. package/lib/module/reanimated2/interpolation.js +1 -1
  196. package/lib/module/reanimated2/interpolation.js.map +1 -1
  197. package/lib/module/reanimated2/isSharedValue.js.map +1 -1
  198. package/lib/module/reanimated2/jestUtils.js +3 -6
  199. package/lib/module/reanimated2/jestUtils.js.map +1 -1
  200. package/lib/module/reanimated2/jestUtils.web.js.map +1 -1
  201. package/lib/module/reanimated2/js-reanimated/JSReanimated.js +5 -9
  202. package/lib/module/reanimated2/js-reanimated/JSReanimated.js.map +1 -1
  203. package/lib/module/reanimated2/js-reanimated/WebSensor.js.map +1 -1
  204. package/lib/module/reanimated2/js-reanimated/index.js +2 -2
  205. package/lib/module/reanimated2/js-reanimated/index.js.map +1 -1
  206. package/lib/module/reanimated2/js-reanimated/react-native-web.d.js.map +1 -1
  207. package/lib/module/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.js +4 -2
  208. package/lib/module/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.js.map +1 -1
  209. package/lib/module/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.js +12 -11
  210. package/lib/module/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.js.map +1 -1
  211. package/lib/module/reanimated2/layoutReanimation/animationBuilder/Keyframe.js +12 -10
  212. package/lib/module/reanimated2/layoutReanimation/animationBuilder/Keyframe.js.map +1 -1
  213. package/lib/module/reanimated2/layoutReanimation/animationBuilder/commonTypes.js.map +1 -1
  214. package/lib/module/reanimated2/layoutReanimation/animationBuilder/index.js.map +1 -1
  215. package/lib/module/reanimated2/layoutReanimation/animationsManager.js +11 -4
  216. package/lib/module/reanimated2/layoutReanimation/animationsManager.js.map +1 -1
  217. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Bounce.js +22 -22
  218. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Bounce.js.map +1 -1
  219. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Fade.js +22 -22
  220. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Fade.js.map +1 -1
  221. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Flip.js +26 -26
  222. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Flip.js.map +1 -1
  223. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.js +10 -10
  224. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.js.map +1 -1
  225. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.js +6 -6
  226. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.js.map +1 -1
  227. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Roll.js +10 -10
  228. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Roll.js.map +1 -1
  229. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Rotate.js +18 -18
  230. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Rotate.js.map +1 -1
  231. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Slide.js +18 -18
  232. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Slide.js.map +1 -1
  233. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Stretch.js +10 -10
  234. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Stretch.js.map +1 -1
  235. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Zoom.js +34 -34
  236. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Zoom.js.map +1 -1
  237. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/index.js.map +1 -1
  238. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.js +17 -4
  239. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.js.map +1 -1
  240. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.js +4 -4
  241. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.js.map +1 -1
  242. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.js +4 -4
  243. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.js.map +1 -1
  244. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.js +4 -4
  245. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.js.map +1 -1
  246. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.js +4 -4
  247. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.js.map +1 -1
  248. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.js +4 -4
  249. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.js.map +1 -1
  250. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/index.js.map +1 -1
  251. package/lib/module/reanimated2/layoutReanimation/index.js.map +1 -1
  252. package/lib/module/reanimated2/layoutReanimation/sharedTransitions/ProgressTransitionManager.js +16 -12
  253. package/lib/module/reanimated2/layoutReanimation/sharedTransitions/ProgressTransitionManager.js.map +1 -1
  254. package/lib/module/reanimated2/layoutReanimation/sharedTransitions/SharedTransition.js +13 -7
  255. package/lib/module/reanimated2/layoutReanimation/sharedTransitions/SharedTransition.js.map +1 -1
  256. package/lib/module/reanimated2/layoutReanimation/sharedTransitions/SharedTransition.web.js.map +1 -1
  257. package/lib/module/reanimated2/layoutReanimation/sharedTransitions/index.js.map +1 -1
  258. package/lib/module/reanimated2/layoutReanimation/web/animation/Bounce.web.js.map +1 -1
  259. package/lib/module/reanimated2/layoutReanimation/web/animation/Fade.web.js.map +1 -1
  260. package/lib/module/reanimated2/layoutReanimation/web/animation/Flip.web.js.map +1 -1
  261. package/lib/module/reanimated2/layoutReanimation/web/animation/Lightspeed.web.js.map +1 -1
  262. package/lib/module/reanimated2/layoutReanimation/web/animation/Pinwheel.web.js.map +1 -1
  263. package/lib/module/reanimated2/layoutReanimation/web/animation/Roll.web.js.map +1 -1
  264. package/lib/module/reanimated2/layoutReanimation/web/animation/Rotate.web.js.map +1 -1
  265. package/lib/module/reanimated2/layoutReanimation/web/animation/Slide.web.js.map +1 -1
  266. package/lib/module/reanimated2/layoutReanimation/web/animation/Stretch.web.js.map +1 -1
  267. package/lib/module/reanimated2/layoutReanimation/web/animation/Zoom.web.js.map +1 -1
  268. package/lib/module/reanimated2/layoutReanimation/web/animationParser.js +0 -2
  269. package/lib/module/reanimated2/layoutReanimation/web/animationParser.js.map +1 -1
  270. package/lib/module/reanimated2/layoutReanimation/web/animationsManager.js +1 -2
  271. package/lib/module/reanimated2/layoutReanimation/web/animationsManager.js.map +1 -1
  272. package/lib/module/reanimated2/layoutReanimation/web/componentStyle.js +3 -1
  273. package/lib/module/reanimated2/layoutReanimation/web/componentStyle.js.map +1 -1
  274. package/lib/module/reanimated2/layoutReanimation/web/componentUtils.js +6 -7
  275. package/lib/module/reanimated2/layoutReanimation/web/componentUtils.js.map +1 -1
  276. package/lib/module/reanimated2/layoutReanimation/web/config.js.map +1 -1
  277. package/lib/module/reanimated2/layoutReanimation/web/createAnimation.js +2 -2
  278. package/lib/module/reanimated2/layoutReanimation/web/createAnimation.js.map +1 -1
  279. package/lib/module/reanimated2/layoutReanimation/web/domUtils.js +4 -4
  280. package/lib/module/reanimated2/layoutReanimation/web/domUtils.js.map +1 -1
  281. package/lib/module/reanimated2/layoutReanimation/web/index.js.map +1 -1
  282. package/lib/module/reanimated2/layoutReanimation/web/transition/Fading.web.js.map +1 -1
  283. package/lib/module/reanimated2/layoutReanimation/web/transition/Linear.web.js.map +1 -1
  284. package/lib/module/reanimated2/layoutReanimation/web/transition/Sequenced.web.js.map +1 -1
  285. package/lib/module/reanimated2/mappers.js +2 -4
  286. package/lib/module/reanimated2/mappers.js.map +1 -1
  287. package/lib/module/reanimated2/mockedRequestAnimationFrame.js.map +1 -1
  288. package/lib/module/reanimated2/mutables.js +2 -4
  289. package/lib/module/reanimated2/mutables.js.map +1 -1
  290. package/lib/module/reanimated2/platform-specific/RNRenderer.js.map +1 -1
  291. package/lib/module/reanimated2/platform-specific/RNRenderer.web.js.map +1 -1
  292. package/lib/module/reanimated2/platform-specific/checkCppVersion.js.map +1 -1
  293. package/lib/module/reanimated2/platform-specific/jsVersion.js +1 -1
  294. package/lib/module/reanimated2/platform-specific/jsVersion.js.map +1 -1
  295. package/lib/module/reanimated2/platformFunctions/dispatchCommand.js +2 -4
  296. package/lib/module/reanimated2/platformFunctions/dispatchCommand.js.map +1 -1
  297. package/lib/module/reanimated2/platformFunctions/dispatchCommand.web.js.map +1 -1
  298. package/lib/module/reanimated2/platformFunctions/getRelativeCoords.js +2 -2
  299. package/lib/module/reanimated2/platformFunctions/getRelativeCoords.js.map +1 -1
  300. package/lib/module/reanimated2/platformFunctions/index.js.map +1 -1
  301. package/lib/module/reanimated2/platformFunctions/measure.js.map +1 -1
  302. package/lib/module/reanimated2/platformFunctions/measure.web.js.map +1 -1
  303. package/lib/module/reanimated2/platformFunctions/scrollTo.js.map +1 -1
  304. package/lib/module/reanimated2/platformFunctions/scrollTo.web.js +1 -1
  305. package/lib/module/reanimated2/platformFunctions/scrollTo.web.js.map +1 -1
  306. package/lib/module/reanimated2/platformFunctions/setGestureState.js.map +1 -1
  307. package/lib/module/reanimated2/platformFunctions/setGestureState.web.js.map +1 -1
  308. package/lib/module/reanimated2/platformFunctions/setNativeProps.js.map +1 -1
  309. package/lib/module/reanimated2/platformFunctions/setNativeProps.web.js.map +1 -1
  310. package/lib/module/reanimated2/pluginUtils.js.map +1 -1
  311. package/lib/module/reanimated2/publicGlobals.js.map +1 -1
  312. package/lib/module/reanimated2/runtimes.js +11 -19
  313. package/lib/module/reanimated2/runtimes.js.map +1 -1
  314. package/lib/module/reanimated2/screenTransition/RNScreensTurboModule.js +20 -0
  315. package/lib/module/reanimated2/screenTransition/RNScreensTurboModule.js.map +1 -0
  316. package/lib/module/reanimated2/screenTransition/animationManager.js +41 -0
  317. package/lib/module/reanimated2/screenTransition/animationManager.js.map +1 -0
  318. package/lib/module/reanimated2/screenTransition/commonTypes.js +4 -0
  319. package/lib/module/reanimated2/screenTransition/commonTypes.js.map +1 -0
  320. package/lib/module/reanimated2/screenTransition/index.js +5 -0
  321. package/lib/module/reanimated2/screenTransition/index.js.map +1 -0
  322. package/lib/module/reanimated2/screenTransition/presets.js +157 -0
  323. package/lib/module/reanimated2/screenTransition/presets.js.map +1 -0
  324. package/lib/module/reanimated2/screenTransition/styleUpdater.js +62 -0
  325. package/lib/module/reanimated2/screenTransition/styleUpdater.js.map +1 -0
  326. package/lib/module/reanimated2/screenTransition/swipeSimulator.js +190 -0
  327. package/lib/module/reanimated2/screenTransition/swipeSimulator.js.map +1 -0
  328. package/lib/module/reanimated2/shareableMappingCache.js.map +1 -1
  329. package/lib/module/reanimated2/shareables.js +27 -10
  330. package/lib/module/reanimated2/shareables.js.map +1 -1
  331. package/lib/module/reanimated2/threads.js +9 -34
  332. package/lib/module/reanimated2/threads.js.map +1 -1
  333. package/lib/module/reanimated2/valueSetter.js +1 -2
  334. package/lib/module/reanimated2/valueSetter.js.map +1 -1
  335. package/lib/module/reanimated2/valueUnpacker.js +4 -3
  336. package/lib/module/reanimated2/valueUnpacker.js.map +1 -1
  337. package/lib/module/specs/NativeReanimatedModule.js +5 -0
  338. package/lib/module/specs/NativeReanimatedModule.js.map +1 -0
  339. package/lib/typescript/ConfigHelper.d.ts +1 -0
  340. package/lib/typescript/createAnimatedComponent/InlinePropManager.d.ts +1 -1
  341. package/lib/typescript/createAnimatedComponent/JSPropsUpdater.web.d.ts +6 -0
  342. package/lib/typescript/createAnimatedComponent/PropsFilter.d.ts +3 -0
  343. package/lib/typescript/createAnimatedComponent/getViewInfo.d.ts +9 -0
  344. package/lib/typescript/reanimated2/NativeReanimated/NativeReanimated.d.ts +8 -13
  345. package/lib/typescript/reanimated2/UpdateLayoutAnimations.d.ts +12 -1
  346. package/lib/typescript/reanimated2/WorkletEventHandler.d.ts +16 -9
  347. package/lib/typescript/reanimated2/animation/util.d.ts +2 -0
  348. package/lib/typescript/reanimated2/component/LayoutAnimationConfig.d.ts +1 -1
  349. package/lib/typescript/reanimated2/component/PerformanceMonitor.d.ts +2 -0
  350. package/lib/typescript/reanimated2/core.d.ts +3 -4
  351. package/lib/typescript/reanimated2/hook/commonTypes.d.ts +6 -0
  352. package/lib/typescript/reanimated2/hook/useEvent.d.ts +2 -3
  353. package/lib/typescript/reanimated2/hook/useScrollViewOffset.d.ts +3 -1
  354. package/lib/typescript/reanimated2/index.d.ts +3 -0
  355. package/lib/typescript/reanimated2/js-reanimated/JSReanimated.d.ts +2 -2
  356. package/lib/typescript/reanimated2/layoutReanimation/animationBuilder/commonTypes.d.ts +2 -1
  357. package/lib/typescript/reanimated2/layoutReanimation/sharedTransitions/ProgressTransitionManager.d.ts +2 -2
  358. package/lib/typescript/reanimated2/layoutReanimation/sharedTransitions/SharedTransition.d.ts +2 -2
  359. package/lib/typescript/reanimated2/platform-specific/jsVersion.d.ts +1 -1
  360. package/lib/typescript/reanimated2/screenTransition/RNScreensTurboModule.d.ts +2 -0
  361. package/lib/typescript/reanimated2/screenTransition/animationManager.d.ts +3 -0
  362. package/lib/typescript/reanimated2/screenTransition/commonTypes.d.ts +38 -0
  363. package/lib/typescript/reanimated2/screenTransition/index.d.ts +3 -0
  364. package/lib/typescript/reanimated2/screenTransition/presets.d.ts +11 -0
  365. package/lib/typescript/reanimated2/screenTransition/styleUpdater.d.ts +3 -0
  366. package/lib/typescript/reanimated2/screenTransition/swipeSimulator.d.ts +2 -0
  367. package/lib/typescript/specs/NativeReanimatedModule.d.ts +6 -0
  368. package/package.json +29 -17
  369. package/plugin/build/plugin.js +7 -2
  370. package/src/ConfigHelper.ts +1 -1
  371. package/src/animationBuilder.tsx +2 -0
  372. package/src/createAnimatedComponent/InlinePropManager.ts +2 -2
  373. package/src/createAnimatedComponent/JSPropsUpdater.ts +7 -6
  374. package/src/createAnimatedComponent/JSPropsUpdater.web.ts +26 -0
  375. package/src/createAnimatedComponent/PropsFilter.tsx +31 -6
  376. package/src/createAnimatedComponent/createAnimatedComponent.tsx +108 -60
  377. package/src/createAnimatedComponent/getViewInfo.ts +39 -0
  378. package/src/mock.ts +13 -1
  379. package/src/reanimated2/NativeReanimated/NativeReanimated.ts +33 -35
  380. package/src/reanimated2/PlatformChecker.ts +3 -2
  381. package/src/reanimated2/PropsRegistry.ts +1 -3
  382. package/src/reanimated2/UpdateLayoutAnimations.ts +53 -13
  383. package/src/reanimated2/WorkletEventHandler.ts +98 -39
  384. package/src/reanimated2/animation/styleAnimation.ts +8 -6
  385. package/src/reanimated2/animation/timing.ts +9 -1
  386. package/src/reanimated2/animation/util.ts +28 -3
  387. package/src/reanimated2/commonTypes.ts +4 -1
  388. package/src/reanimated2/component/PerformanceMonitor.tsx +216 -0
  389. package/src/reanimated2/core.ts +9 -31
  390. package/src/reanimated2/errors.ts +1 -0
  391. package/src/reanimated2/fabricUtils.ts +43 -18
  392. package/src/reanimated2/globals.d.ts +11 -1
  393. package/src/reanimated2/hook/commonTypes.ts +10 -0
  394. package/src/reanimated2/hook/useAnimatedRef.ts +20 -11
  395. package/src/reanimated2/hook/useEvent.ts +4 -4
  396. package/src/reanimated2/hook/useScrollViewOffset.ts +94 -23
  397. package/src/reanimated2/index.ts +11 -0
  398. package/src/reanimated2/js-reanimated/JSReanimated.ts +7 -7
  399. package/src/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.ts +4 -0
  400. package/src/reanimated2/layoutReanimation/animationBuilder/Keyframe.ts +9 -1
  401. package/src/reanimated2/layoutReanimation/animationBuilder/commonTypes.ts +9 -1
  402. package/src/reanimated2/layoutReanimation/animationsManager.ts +10 -2
  403. package/src/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.ts +13 -0
  404. package/src/reanimated2/layoutReanimation/sharedTransitions/ProgressTransitionManager.ts +17 -8
  405. package/src/reanimated2/layoutReanimation/sharedTransitions/SharedTransition.ts +26 -7
  406. package/src/reanimated2/layoutReanimation/web/animationsManager.ts +1 -1
  407. package/src/reanimated2/layoutReanimation/web/componentStyle.ts +3 -1
  408. package/src/reanimated2/layoutReanimation/web/componentUtils.ts +1 -1
  409. package/src/reanimated2/layoutReanimation/web/createAnimation.ts +2 -2
  410. package/src/reanimated2/platform-specific/jsVersion.ts +1 -1
  411. package/src/reanimated2/platformFunctions/getRelativeCoords.ts +2 -2
  412. package/src/reanimated2/screenTransition/RNScreensTurboModule.ts +29 -0
  413. package/src/reanimated2/screenTransition/animationManager.ts +45 -0
  414. package/src/reanimated2/screenTransition/commonTypes.ts +63 -0
  415. package/src/reanimated2/screenTransition/index.ts +12 -0
  416. package/src/reanimated2/screenTransition/presets.ts +137 -0
  417. package/src/reanimated2/screenTransition/styleUpdater.ts +73 -0
  418. package/src/reanimated2/screenTransition/swipeSimulator.ts +238 -0
  419. package/src/reanimated2/shareables.ts +29 -6
  420. package/src/reanimated2/valueUnpacker.ts +10 -3
  421. package/src/specs/NativeReanimatedModule.ts +9 -0
  422. package/android/src/reactNativeVersionPatch/ReanimatedUIManager/70/com/swmansion/reanimated/ReanimatedUIManagerFactory.java +0 -16
  423. package/android/src/reactNativeVersionPatch/messageQueueThread/67/com/swmansion/reanimated/ReanimatedMessageQueueThread.java +0 -12
@@ -1 +1 @@
1
- {"version":3,"names":["_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","Number","flattenArray","makeViewDescriptorsSet","adaptViewConfig","updateProps","stopMapper","startMapper","isSharedValue","shouldBeUseWeb","SHOULD_BE_USE_WEB","isInlineStyleTransform","transform","Array","isArray","some","t","hasInlineStyles","inlinePropsHasChanged","styles1","styles2","keys","length","getInlinePropsUpdate","inlineProps","update","styleValue","entries","map","item","extractSharedValuesMapFromProps","props","styles","style","forEach","styleKey","getInlineStyle","isFirstRender","newStyle","InlinePropManager","constructor","attachInlineProps","animatedComponent","viewInfo","newInlineProps","hasChanged","_inlineProps","_inlinePropsViewDescriptors","viewTag","viewName","shadowNodeWrapper","viewConfig","add","tag","name","shareableViewDescriptors","maybeViewRef","items","Set","updaterFunction","_inlinePropsMapperId","values","detachInlineProps"],"sources":["InlinePropManager.ts"],"sourcesContent":["'use strict';\nimport type { StyleProps } from '../reanimated2';\nimport type {\n IAnimatedComponentInternal,\n AnimatedComponentProps,\n IInlinePropManager,\n ViewInfo,\n} from './commonTypes';\nimport { flattenArray } from './utils';\nimport { makeViewDescriptorsSet } from '../reanimated2/ViewDescriptorsSet';\nimport type {\n ViewDescriptorsSet,\n ViewRefSet,\n} from '../reanimated2/ViewDescriptorsSet';\nimport { adaptViewConfig } from '../ConfigHelper';\nimport updateProps from '../reanimated2/UpdateProps';\nimport { stopMapper, startMapper } from '../reanimated2/mappers';\nimport { isSharedValue } from '../reanimated2/isSharedValue';\nimport { shouldBeUseWeb } from '../reanimated2/PlatformChecker';\n\nconst SHOULD_BE_USE_WEB = shouldBeUseWeb();\n\nfunction isInlineStyleTransform(transform: unknown): boolean {\n if (!Array.isArray(transform)) {\n return false;\n }\n\n return transform.some((t: Record<string, unknown>) => hasInlineStyles(t));\n}\n\nfunction inlinePropsHasChanged(\n styles1: StyleProps,\n styles2: StyleProps\n): boolean {\n if (Object.keys(styles1).length !== Object.keys(styles2).length) {\n return true;\n }\n\n for (const key of Object.keys(styles1)) {\n if (styles1[key] !== styles2[key]) return true;\n }\n\n return false;\n}\n\nfunction getInlinePropsUpdate(inlineProps: Record<string, unknown>) {\n 'worklet';\n const update: Record<string, unknown> = {};\n for (const [key, styleValue] of Object.entries(inlineProps)) {\n if (isSharedValue(styleValue)) {\n update[key] = styleValue.value;\n } else if (Array.isArray(styleValue)) {\n update[key] = styleValue.map((item) => {\n return getInlinePropsUpdate(item);\n });\n } else if (typeof styleValue === 'object') {\n update[key] = getInlinePropsUpdate(styleValue as Record<string, unknown>);\n } else {\n update[key] = styleValue;\n }\n }\n return update;\n}\n\nfunction extractSharedValuesMapFromProps(\n props: AnimatedComponentProps<\n Record<string, unknown> /* Initial component props */\n >\n): Record<string, unknown> {\n const inlineProps: Record<string, unknown> = {};\n\n for (const key in props) {\n const value = props[key];\n if (key === 'style') {\n const styles = flattenArray<StyleProps>(props.style ?? []);\n styles.forEach((style) => {\n if (!style) {\n return;\n }\n for (const [styleKey, styleValue] of Object.entries(style)) {\n if (isSharedValue(styleValue)) {\n inlineProps[styleKey] = styleValue;\n } else if (\n styleKey === 'transform' &&\n isInlineStyleTransform(styleValue)\n ) {\n inlineProps[styleKey] = styleValue;\n }\n }\n });\n } else if (isSharedValue(value)) {\n inlineProps[key] = value;\n }\n }\n\n return inlineProps;\n}\n\nexport function hasInlineStyles(style: StyleProps): boolean {\n if (!style) {\n return false;\n }\n return Object.keys(style).some((key) => {\n const styleValue = style[key];\n return (\n isSharedValue(styleValue) ||\n (key === 'transform' && isInlineStyleTransform(styleValue))\n );\n });\n}\n\nexport function getInlineStyle(\n style: Record<string, unknown>,\n isFirstRender: boolean\n) {\n if (isFirstRender) {\n return getInlinePropsUpdate(style);\n }\n const newStyle: StyleProps = {};\n for (const [key, styleValue] of Object.entries(style)) {\n if (\n !isSharedValue(styleValue) &&\n !(key === 'transform' && isInlineStyleTransform(styleValue))\n ) {\n newStyle[key] = styleValue;\n }\n }\n return newStyle;\n}\n\nexport class InlinePropManager implements IInlinePropManager {\n _inlinePropsViewDescriptors: ViewDescriptorsSet | null = null;\n _inlinePropsMapperId: number | null = null;\n _inlineProps: StyleProps = {};\n\n public attachInlineProps(\n animatedComponent: React.Component<unknown, unknown> &\n IAnimatedComponentInternal,\n viewInfo: ViewInfo\n ) {\n const newInlineProps: Record<string, unknown> =\n extractSharedValuesMapFromProps(animatedComponent.props);\n const hasChanged = inlinePropsHasChanged(newInlineProps, this._inlineProps);\n\n if (hasChanged) {\n if (!this._inlinePropsViewDescriptors) {\n this._inlinePropsViewDescriptors = makeViewDescriptorsSet();\n\n const { viewTag, viewName, shadowNodeWrapper, viewConfig } = viewInfo;\n\n if (Object.keys(newInlineProps).length && viewConfig) {\n adaptViewConfig(viewConfig);\n }\n\n this._inlinePropsViewDescriptors.add({\n tag: viewTag as number,\n name: viewName!,\n shadowNodeWrapper: shadowNodeWrapper!,\n });\n }\n const shareableViewDescriptors =\n this._inlinePropsViewDescriptors.shareableViewDescriptors;\n\n const maybeViewRef = SHOULD_BE_USE_WEB\n ? ({ items: new Set([animatedComponent]) } as ViewRefSet<unknown>) // see makeViewsRefSet\n : undefined;\n const updaterFunction = () => {\n 'worklet';\n const update = getInlinePropsUpdate(newInlineProps);\n updateProps(shareableViewDescriptors, update, maybeViewRef);\n };\n this._inlineProps = newInlineProps;\n if (this._inlinePropsMapperId) {\n stopMapper(this._inlinePropsMapperId);\n }\n this._inlinePropsMapperId = null;\n if (Object.keys(newInlineProps).length) {\n this._inlinePropsMapperId = startMapper(\n updaterFunction,\n Object.values(newInlineProps)\n );\n }\n }\n }\n\n public detachInlineProps() {\n if (this._inlinePropsMapperId) {\n stopMapper(this._inlinePropsMapperId);\n }\n }\n}\n"],"mappings":"AAAA,YAAY;;AAAC,SAAAA,gBAAAC,GAAA,EAAAC,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAD,GAAA,IAAAI,MAAA,CAAAC,cAAA,CAAAL,GAAA,EAAAC,GAAA,IAAAC,KAAA,EAAAA,KAAA,EAAAI,UAAA,QAAAC,YAAA,QAAAC,QAAA,oBAAAR,GAAA,CAAAC,GAAA,IAAAC,KAAA,WAAAF,GAAA;AAAA,SAAAG,eAAAM,GAAA,QAAAR,GAAA,GAAAS,YAAA,CAAAD,GAAA,2BAAAR,GAAA,gBAAAA,GAAA,GAAAU,MAAA,CAAAV,GAAA;AAAA,SAAAS,aAAAE,KAAA,EAAAC,IAAA,eAAAD,KAAA,iBAAAA,KAAA,kBAAAA,KAAA,MAAAE,IAAA,GAAAF,KAAA,CAAAG,MAAA,CAAAC,WAAA,OAAAF,IAAA,KAAAG,SAAA,QAAAC,GAAA,GAAAJ,IAAA,CAAAK,IAAA,CAAAP,KAAA,EAAAC,IAAA,2BAAAK,GAAA,sBAAAA,GAAA,YAAAE,SAAA,4DAAAP,IAAA,gBAAAF,MAAA,GAAAU,MAAA,EAAAT,KAAA;AAQb,SAASU,YAAY,QAAQ,SAAS;AACtC,SAASC,sBAAsB,QAAQ,mCAAmC;AAK1E,SAASC,eAAe,QAAQ,iBAAiB;AACjD,OAAOC,WAAW,MAAM,4BAA4B;AACpD,SAASC,UAAU,EAAEC,WAAW,QAAQ,wBAAwB;AAChE,SAASC,aAAa,QAAQ,8BAA8B;AAC5D,SAASC,cAAc,QAAQ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;QAErE,IAAI3D,MAAM,CAACqC,IAAI,CAACuB,cAAc,CAAC,CAACtB,MAAM,IAAI6B,UAAU,EAAE;UACpD/C,eAAe,CAAC+C,UAAU,CAAC;QAC7B;QAEA,IAAI,CAACJ,2BAA2B,CAACK,GAAG,CAAC;UACnCC,GAAG,EAAEL,OAAiB;UACtBM,IAAI,EAAEL,QAAS;UACfC,iBAAiB,EAAEA;QACrB,CAAC,CAAC;MACJ;MACA,MAAMK,wBAAwB,GAC5B,IAAI,CAACR,2BAA2B,CAACQ,wBAAwB;MAE3D,MAAMC,YAAY,GAAG9C,iBAAiB,GACjC;QAAE+C,KAAK,EAAE,IAAIC,GAAG,CAAC,CAAChB,iBAAiB,CAAC;MAAE,CAAC,CAAyB;MAAA,EACjE7C,SAAS;MACb,MAAM8D,eAAe,GAAGA,CAAA,KAAM;QAC5B,SAAS;;QACT,MAAMlC,MAAM,GAAGF,oBAAoB,CAACqB,cAAc,CAAC;QACnDvC,WAAW,CAACkD,wBAAwB,EAAE9B,MAAM,EAAE+B,YAAY,CAAC;MAC7D,CAAC;MACD,IAAI,CAACV,YAAY,GAAGF,cAAc;MAClC,IAAI,IAAI,CAACgB,oBAAoB,EAAE;QAC7BtD,UAAU,CAAC,IAAI,CAACsD,oBAAoB,CAAC;MACvC;MACA,IAAI,CAACA,oBAAoB,GAAG,IAAI;MAChC,IAAI5E,MAAM,CAACqC,IAAI,CAACuB,cAAc,CAAC,CAACtB,MAAM,EAAE;QACtC,IAAI,CAACsC,oBAAoB,GAAGrD,WAAW,CACrCoD,eAAe,EACf3E,MAAM,CAAC6E,MAAM,CAACjB,cAAc,CAAC,CAC9B;MACH;IACF;EACF;EAEOkB,iBAAiBA,CAAA,EAAG;IACzB,IAAI,IAAI,CAACF,oBAAoB,EAAE;MAC7BtD,UAAU,CAAC,IAAI,CAACsD,oBAAoB,CAAC;IACvC;EACF;AACF"}
1
+ {"version":3,"names":["_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","r","e","Symbol","toPrimitive","call","TypeError","String","Number","flattenArray","makeViewDescriptorsSet","adaptViewConfig","updateProps","stopMapper","startMapper","isSharedValue","shouldBeUseWeb","SHOULD_BE_USE_WEB","isInlineStyleTransform","transform","Array","isArray","some","hasInlineStyles","inlinePropsHasChanged","styles1","styles2","keys","length","getInlinePropsUpdate","inlineProps","update","styleValue","entries","map","item","extractSharedValuesMapFromProps","props","styles","style","forEach","styleKey","getInlineStyle","shouldGetInitialStyle","newStyle","InlinePropManager","constructor","attachInlineProps","animatedComponent","viewInfo","newInlineProps","hasChanged","_inlineProps","_inlinePropsViewDescriptors","viewTag","viewName","shadowNodeWrapper","viewConfig","add","tag","name","shareableViewDescriptors","maybeViewRef","items","Set","undefined","updaterFunction","_inlinePropsMapperId","values","detachInlineProps"],"sources":["InlinePropManager.ts"],"sourcesContent":["'use strict';\nimport type { StyleProps } from '../reanimated2';\nimport type {\n IAnimatedComponentInternal,\n AnimatedComponentProps,\n IInlinePropManager,\n ViewInfo,\n} from './commonTypes';\nimport { flattenArray } from './utils';\nimport { makeViewDescriptorsSet } from '../reanimated2/ViewDescriptorsSet';\nimport type {\n ViewDescriptorsSet,\n ViewRefSet,\n} from '../reanimated2/ViewDescriptorsSet';\nimport { adaptViewConfig } from '../ConfigHelper';\nimport updateProps from '../reanimated2/UpdateProps';\nimport { stopMapper, startMapper } from '../reanimated2/mappers';\nimport { isSharedValue } from '../reanimated2/isSharedValue';\nimport { shouldBeUseWeb } from '../reanimated2/PlatformChecker';\n\nconst SHOULD_BE_USE_WEB = shouldBeUseWeb();\n\nfunction isInlineStyleTransform(transform: unknown): boolean {\n if (!Array.isArray(transform)) {\n return false;\n }\n\n return transform.some((t: Record<string, unknown>) => hasInlineStyles(t));\n}\n\nfunction inlinePropsHasChanged(\n styles1: StyleProps,\n styles2: StyleProps\n): boolean {\n if (Object.keys(styles1).length !== Object.keys(styles2).length) {\n return true;\n }\n\n for (const key of Object.keys(styles1)) {\n if (styles1[key] !== styles2[key]) return true;\n }\n\n return false;\n}\n\nfunction getInlinePropsUpdate(inlineProps: Record<string, unknown>) {\n 'worklet';\n const update: Record<string, unknown> = {};\n for (const [key, styleValue] of Object.entries(inlineProps)) {\n if (isSharedValue(styleValue)) {\n update[key] = styleValue.value;\n } else if (Array.isArray(styleValue)) {\n update[key] = styleValue.map((item) => {\n return getInlinePropsUpdate(item);\n });\n } else if (typeof styleValue === 'object') {\n update[key] = getInlinePropsUpdate(styleValue as Record<string, unknown>);\n } else {\n update[key] = styleValue;\n }\n }\n return update;\n}\n\nfunction extractSharedValuesMapFromProps(\n props: AnimatedComponentProps<\n Record<string, unknown> /* Initial component props */\n >\n): Record<string, unknown> {\n const inlineProps: Record<string, unknown> = {};\n\n for (const key in props) {\n const value = props[key];\n if (key === 'style') {\n const styles = flattenArray<StyleProps>(props.style ?? []);\n styles.forEach((style) => {\n if (!style) {\n return;\n }\n for (const [styleKey, styleValue] of Object.entries(style)) {\n if (isSharedValue(styleValue)) {\n inlineProps[styleKey] = styleValue;\n } else if (\n styleKey === 'transform' &&\n isInlineStyleTransform(styleValue)\n ) {\n inlineProps[styleKey] = styleValue;\n }\n }\n });\n } else if (isSharedValue(value)) {\n inlineProps[key] = value;\n }\n }\n\n return inlineProps;\n}\n\nexport function hasInlineStyles(style: StyleProps): boolean {\n if (!style) {\n return false;\n }\n return Object.keys(style).some((key) => {\n const styleValue = style[key];\n return (\n isSharedValue(styleValue) ||\n (key === 'transform' && isInlineStyleTransform(styleValue))\n );\n });\n}\n\nexport function getInlineStyle(\n style: Record<string, unknown>,\n shouldGetInitialStyle: boolean\n) {\n if (shouldGetInitialStyle) {\n return getInlinePropsUpdate(style);\n }\n const newStyle: StyleProps = {};\n for (const [key, styleValue] of Object.entries(style)) {\n if (\n !isSharedValue(styleValue) &&\n !(key === 'transform' && isInlineStyleTransform(styleValue))\n ) {\n newStyle[key] = styleValue;\n }\n }\n return newStyle;\n}\n\nexport class InlinePropManager implements IInlinePropManager {\n _inlinePropsViewDescriptors: ViewDescriptorsSet | null = null;\n _inlinePropsMapperId: number | null = null;\n _inlineProps: StyleProps = {};\n\n public attachInlineProps(\n animatedComponent: React.Component<unknown, unknown> &\n IAnimatedComponentInternal,\n viewInfo: ViewInfo\n ) {\n const newInlineProps: Record<string, unknown> =\n extractSharedValuesMapFromProps(animatedComponent.props);\n const hasChanged = inlinePropsHasChanged(newInlineProps, this._inlineProps);\n\n if (hasChanged) {\n if (!this._inlinePropsViewDescriptors) {\n this._inlinePropsViewDescriptors = makeViewDescriptorsSet();\n\n const { viewTag, viewName, shadowNodeWrapper, viewConfig } = viewInfo;\n\n if (Object.keys(newInlineProps).length && viewConfig) {\n adaptViewConfig(viewConfig);\n }\n\n this._inlinePropsViewDescriptors.add({\n tag: viewTag as number,\n name: viewName!,\n shadowNodeWrapper: shadowNodeWrapper!,\n });\n }\n const shareableViewDescriptors =\n this._inlinePropsViewDescriptors.shareableViewDescriptors;\n\n const maybeViewRef = SHOULD_BE_USE_WEB\n ? ({ items: new Set([animatedComponent]) } as ViewRefSet<unknown>) // see makeViewsRefSet\n : undefined;\n const updaterFunction = () => {\n 'worklet';\n const update = getInlinePropsUpdate(newInlineProps);\n updateProps(shareableViewDescriptors, update, maybeViewRef);\n };\n this._inlineProps = newInlineProps;\n if (this._inlinePropsMapperId) {\n stopMapper(this._inlinePropsMapperId);\n }\n this._inlinePropsMapperId = null;\n if (Object.keys(newInlineProps).length) {\n this._inlinePropsMapperId = startMapper(\n updaterFunction,\n Object.values(newInlineProps)\n );\n }\n }\n }\n\n public detachInlineProps() {\n if (this._inlinePropsMapperId) {\n stopMapper(this._inlinePropsMapperId);\n }\n }\n}\n"],"mappings":"AAAA,YAAY;;AAAC,SAAAA,gBAAAC,GAAA,EAAAC,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAD,GAAA,IAAAI,MAAA,CAAAC,cAAA,CAAAL,GAA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B,iBAAiB,CAAC;MAAE,CAAC,CAAyB;MAAA,EACjEiB,SAAS;MACb,MAAMC,eAAe,GAAGA,CAAA,KAAM;QAC5B,SAAS;;QACT,MAAMnC,MAAM,GAAGF,oBAAoB,CAACqB,cAAc,CAAC;QACnDtC,WAAW,CAACiD,wBAAwB,EAAE9B,MAAM,EAAE+B,YAAY,CAAC;MAC7D,CAAC;MACD,IAAI,CAACV,YAAY,GAAGF,cAAc;MAClC,IAAI,IAAI,CAACiB,oBAAoB,EAAE;QAC7BtD,UAAU,CAAC,IAAI,CAACsD,oBAAoB,CAAC;MACvC;MACA,IAAI,CAACA,oBAAoB,GAAG,IAAI;MAChC,IAAI1E,MAAM,CAACkC,IAAI,CAACuB,cAAc,CAAC,CAACtB,MAAM,EAAE;QACtC,IAAI,CAACuC,oBAAoB,GAAGrD,WAAW,CACrCoD,eAAe,EACfzE,MAAM,CAAC2E,MAAM,CAAClB,cAAc,CAC9B,CAAC;MACH;IACF;EACF;EAEOmB,iBAAiBA,CAAA,EAAG;IACzB,IAAI,IAAI,CAACF,oBAAoB,EAAE;MAC7BtD,UAAU,CAAC,IAAI,CAACsD,oBAAoB,CAAC;IACvC;EACF;AACF","ignoreList":[]}
@@ -1,16 +1,19 @@
1
1
  'use strict';
2
2
 
3
3
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
4
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
5
- function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
6
- import { NativeEventEmitter, NativeModules, findNodeHandle } from 'react-native';
4
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
5
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
6
+ import { NativeEventEmitter, Platform, findNodeHandle } from 'react-native';
7
7
  import { shouldBeUseWeb } from '../reanimated2/PlatformChecker';
8
8
  import { runOnJS, runOnUIImmediately } from '../reanimated2/threads';
9
+ import NativeReanimatedModule from '../specs/NativeReanimatedModule';
9
10
  const SHOULD_BE_USE_WEB = shouldBeUseWeb();
10
11
  class JSPropsUpdaterPaper {
11
12
  constructor() {
12
13
  _defineProperty(this, "_reanimatedEventEmitter", void 0);
13
- this._reanimatedEventEmitter = new NativeEventEmitter(NativeModules.ReanimatedModule);
14
+ this._reanimatedEventEmitter = new NativeEventEmitter(
15
+ // NativeEventEmitter only uses this parameter on iOS.
16
+ Platform.OS === 'ios' ? NativeReanimatedModule : undefined);
14
17
  }
15
18
  addOnJSPropsChangeListener(animatedComponent) {
16
19
  const viewTag = findNodeHandle(animatedComponent);
@@ -18,7 +21,7 @@ class JSPropsUpdaterPaper {
18
21
  if (JSPropsUpdaterPaper._tagToComponentMapping.size === 1) {
19
22
  const listener = data => {
20
23
  const component = JSPropsUpdaterPaper._tagToComponentMapping.get(data.viewTag);
21
- component === null || component === void 0 ? void 0 : component._updateFromNative(data.props);
24
+ component === null || component === void 0 || component._updateFromNative(data.props);
22
25
  };
23
26
  this._reanimatedEventEmitter.addListener('onReanimatedPropsChange', listener);
24
27
  }
@@ -37,7 +40,7 @@ class JSPropsUpdaterFabric {
37
40
  if (!JSPropsUpdaterFabric.isInitialized) {
38
41
  const updater = (viewTag, props) => {
39
42
  const component = JSPropsUpdaterFabric._tagToComponentMapping.get(viewTag);
40
- component === null || component === void 0 ? void 0 : component._updateFromNative(props);
43
+ component === null || component === void 0 || component._updateFromNative(props);
41
44
  };
42
45
  runOnUIImmediately(() => {
43
46
  'worklet';
@@ -1 +1 @@
1
- {"version":3,"names":["_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","Number","NativeEventEmitter","NativeModules","findNodeHandle","shouldBeUseWeb","runOnJS","runOnUIImmediately","SHOULD_BE_USE_WEB","JSPropsUpdaterPaper","constructor","_reanimatedEventEmitter","ReanimatedModule","addOnJSPropsChangeListener","animatedComponent","viewTag","_tagToComponentMapping","set","size","listener","data","component","get","_updateFromNative","props","addListener","removeOnJSPropsChangeListener","delete","removeAllListeners","Map","JSPropsUpdaterFabric","isInitialized","updater","global","updateJSProps","JSPropsUpdaterWeb","_animatedComponent","JSPropsUpdater","_IS_FABRIC"],"sources":["JSPropsUpdater.ts"],"sourcesContent":["'use strict';\nimport {\n NativeEventEmitter,\n NativeModules,\n findNodeHandle,\n} from 'react-native';\nimport { shouldBeUseWeb } from '../reanimated2/PlatformChecker';\nimport type { StyleProps } from '../reanimated2';\nimport { runOnJS, runOnUIImmediately } from '../reanimated2/threads';\nimport type {\n AnimatedComponentProps,\n IAnimatedComponentInternal,\n IJSPropsUpdater,\n InitialComponentProps,\n} from './commonTypes';\n\ninterface ListenerData {\n viewTag: number;\n props: StyleProps;\n}\n\nconst SHOULD_BE_USE_WEB = shouldBeUseWeb();\n\nclass JSPropsUpdaterPaper implements IJSPropsUpdater {\n private static _tagToComponentMapping = new Map();\n private _reanimatedEventEmitter: NativeEventEmitter;\n\n constructor() {\n this._reanimatedEventEmitter = new NativeEventEmitter(\n NativeModules.ReanimatedModule\n );\n }\n\n public addOnJSPropsChangeListener(\n animatedComponent: React.Component<\n AnimatedComponentProps<InitialComponentProps>\n > &\n IAnimatedComponentInternal\n ) {\n const viewTag = findNodeHandle(animatedComponent);\n JSPropsUpdaterPaper._tagToComponentMapping.set(viewTag, animatedComponent);\n if (JSPropsUpdaterPaper._tagToComponentMapping.size === 1) {\n const listener = (data: ListenerData) => {\n const component = JSPropsUpdaterPaper._tagToComponentMapping.get(\n data.viewTag\n );\n component?._updateFromNative(data.props);\n };\n this._reanimatedEventEmitter.addListener(\n 'onReanimatedPropsChange',\n listener\n );\n }\n }\n\n public removeOnJSPropsChangeListener(\n animatedComponent: React.Component<\n AnimatedComponentProps<InitialComponentProps>\n > &\n IAnimatedComponentInternal\n ) {\n const viewTag = findNodeHandle(animatedComponent);\n JSPropsUpdaterPaper._tagToComponentMapping.delete(viewTag);\n if (JSPropsUpdaterPaper._tagToComponentMapping.size === 0) {\n this._reanimatedEventEmitter.removeAllListeners(\n 'onReanimatedPropsChange'\n );\n }\n }\n}\n\nclass JSPropsUpdaterFabric implements IJSPropsUpdater {\n private static _tagToComponentMapping = new Map();\n private static isInitialized = false;\n\n constructor() {\n if (!JSPropsUpdaterFabric.isInitialized) {\n const updater = (viewTag: number, props: unknown) => {\n const component =\n JSPropsUpdaterFabric._tagToComponentMapping.get(viewTag);\n component?._updateFromNative(props);\n };\n runOnUIImmediately(() => {\n 'worklet';\n global.updateJSProps = (viewTag: number, props: unknown) => {\n runOnJS(updater)(viewTag, props);\n };\n })();\n JSPropsUpdaterFabric.isInitialized = true;\n }\n }\n\n public addOnJSPropsChangeListener(\n animatedComponent: React.Component<\n AnimatedComponentProps<InitialComponentProps>\n > &\n IAnimatedComponentInternal\n ) {\n if (!JSPropsUpdaterFabric.isInitialized) {\n return;\n }\n const viewTag = findNodeHandle(animatedComponent);\n JSPropsUpdaterFabric._tagToComponentMapping.set(viewTag, animatedComponent);\n }\n\n public removeOnJSPropsChangeListener(\n animatedComponent: React.Component<\n AnimatedComponentProps<InitialComponentProps>\n > &\n IAnimatedComponentInternal\n ) {\n if (!JSPropsUpdaterFabric.isInitialized) {\n return;\n }\n const viewTag = findNodeHandle(animatedComponent);\n JSPropsUpdaterFabric._tagToComponentMapping.delete(viewTag);\n }\n}\n\nclass JSPropsUpdaterWeb implements IJSPropsUpdater {\n public addOnJSPropsChangeListener(\n _animatedComponent: React.Component<\n AnimatedComponentProps<InitialComponentProps>\n > &\n IAnimatedComponentInternal\n ) {\n // noop\n }\n\n public removeOnJSPropsChangeListener(\n _animatedComponent: React.Component<\n AnimatedComponentProps<InitialComponentProps>\n > &\n IAnimatedComponentInternal\n ) {\n // noop\n }\n}\n\ntype JSPropsUpdaterOptions =\n | typeof JSPropsUpdaterWeb\n | typeof JSPropsUpdaterFabric\n | typeof JSPropsUpdaterPaper;\n\nlet JSPropsUpdater: JSPropsUpdaterOptions;\nif (SHOULD_BE_USE_WEB) {\n JSPropsUpdater = JSPropsUpdaterWeb;\n} else if (global._IS_FABRIC) {\n JSPropsUpdater = JSPropsUpdaterFabric;\n} else {\n JSPropsUpdater = JSPropsUpdaterPaper;\n}\n\nexport default JSPropsUpdater;\n"],"mappings":"AAAA,YAAY;;AAAC,SAAAA,gBAAAC,GAAA,EAAAC,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAD,GAAA,IAAAI,MAAA,CAAAC,cAAA,CAAAL,GAAA,EAAAC,GAAA,IAAAC,KAAA,EAAAA,KAAA,EAAAI,UAAA,QAAAC,YAAA,QAAAC,QAAA,oBAAAR,GAAA,CAAAC,GAAA,IAAAC,KAAA,WAAAF,GAAA;AAAA,SAAAG,eAAAM,GAAA,QAAAR,GAAA,GAAAS,YAAA,CAAAD,GAAA,2BAAAR,GAAA,gBAAAA,GAAA,GAAAU,MAAA,CAAAV,GAAA;AAAA,SAAAS,aAAAE,KAAA,EAAAC,IAAA,eAAAD,KAAA,iBAAAA,KAAA,kBAAAA,KAAA,MAAAE,IAAA,GAAAF,KAAA,CAAAG,MAAA,CAAAC,WAAA,OAAAF,IAAA,KAAAG,SAAA,QAAAC,GAAA,GAAAJ,IAAA,CAAAK,IAAA,CAAAP,KAAA,EAAAC,IAAA,2BAAAK,GAAA,sBAAAA,GAAA,YAAAE,SAAA,4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iB,CAA4B;EAC1CtB,0BAA0BA,CAC/BuB,kBAG4B,EAC5B;IACA;EAAA;EAGKV,6BAA6BA,CAClCU,kBAG4B,EAC5B;IACA;EAAA;AAEJ;AAOA,IAAIC,cAAqC;AACzC,IAAI7B,iBAAiB,EAAE;EACrB6B,cAAc,GAAGF,iBAAiB;AACpC,CAAC,MAAM,IAAIF,MAAM,CAACK,UAAU,EAAE;EAC5BD,cAAc,GAAGP,oBAAoB;AACvC,CAAC,MAAM;EACLO,cAAc,GAAG5B,mBAAmB;AACtC;AAEA,eAAe4B,cAAc"}
1
+ {"version":3,"names":["_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","r","e","Symbol","toPrimitive","call","TypeError","String","Number","NativeEventEmitter","Platform","findNodeHandle","shouldBeUseWeb","runOnJS","runOnUIImmediately","NativeReanimatedModule","SHOULD_BE_USE_WEB","JSPropsUpdaterPaper","constructor","_reanimatedEventEmitter","OS","undefined","addOnJSPropsChangeListener","animatedComponent","viewTag","_tagToComponentMapping","set","size","listener","data","component","get","_updateFromNative","props","addListener","removeOnJSPropsChangeListener","delete","removeAllListeners","Map","JSPropsUpdaterFabric","isInitialized","updater","global","updateJSProps","JSPropsUpdaterWeb","_animatedComponent","JSPropsUpdater","_IS_FABRIC"],"sources":["JSPropsUpdater.ts"],"sourcesContent":["'use strict';\nimport { NativeEventEmitter, Platform, findNodeHandle } from 'react-native';\nimport type { NativeModule } from 'react-native';\nimport { shouldBeUseWeb } from '../reanimated2/PlatformChecker';\nimport type { StyleProps } from '../reanimated2';\nimport { runOnJS, runOnUIImmediately } from '../reanimated2/threads';\nimport type {\n AnimatedComponentProps,\n IAnimatedComponentInternal,\n IJSPropsUpdater,\n InitialComponentProps,\n} from './commonTypes';\nimport NativeReanimatedModule from '../specs/NativeReanimatedModule';\n\ninterface ListenerData {\n viewTag: number;\n props: StyleProps;\n}\n\nconst SHOULD_BE_USE_WEB = shouldBeUseWeb();\n\nclass JSPropsUpdaterPaper implements IJSPropsUpdater {\n private static _tagToComponentMapping = new Map();\n private _reanimatedEventEmitter: NativeEventEmitter;\n\n constructor() {\n this._reanimatedEventEmitter = new NativeEventEmitter(\n // NativeEventEmitter only uses this parameter on iOS.\n Platform.OS === 'ios'\n ? (NativeReanimatedModule as unknown as NativeModule)\n : undefined\n );\n }\n\n public addOnJSPropsChangeListener(\n animatedComponent: React.Component<\n AnimatedComponentProps<InitialComponentProps>\n > &\n IAnimatedComponentInternal\n ) {\n const viewTag = findNodeHandle(animatedComponent);\n JSPropsUpdaterPaper._tagToComponentMapping.set(viewTag, animatedComponent);\n if (JSPropsUpdaterPaper._tagToComponentMapping.size === 1) {\n const listener = (data: ListenerData) => {\n const component = JSPropsUpdaterPaper._tagToComponentMapping.get(\n data.viewTag\n );\n component?._updateFromNative(data.props);\n };\n this._reanimatedEventEmitter.addListener(\n 'onReanimatedPropsChange',\n listener\n );\n }\n }\n\n public removeOnJSPropsChangeListener(\n animatedComponent: React.Component<\n AnimatedComponentProps<InitialComponentProps>\n > &\n IAnimatedComponentInternal\n ) {\n const viewTag = findNodeHandle(animatedComponent);\n JSPropsUpdaterPaper._tagToComponentMapping.delete(viewTag);\n if (JSPropsUpdaterPaper._tagToComponentMapping.size === 0) {\n this._reanimatedEventEmitter.removeAllListeners(\n 'onReanimatedPropsChange'\n );\n }\n }\n}\n\nclass JSPropsUpdaterFabric implements IJSPropsUpdater {\n private static _tagToComponentMapping = new Map();\n private static isInitialized = false;\n\n constructor() {\n if (!JSPropsUpdaterFabric.isInitialized) {\n const updater = (viewTag: number, props: unknown) => {\n const component =\n JSPropsUpdaterFabric._tagToComponentMapping.get(viewTag);\n component?._updateFromNative(props);\n };\n runOnUIImmediately(() => {\n 'worklet';\n global.updateJSProps = (viewTag: number, props: unknown) => {\n runOnJS(updater)(viewTag, props);\n };\n })();\n JSPropsUpdaterFabric.isInitialized = true;\n }\n }\n\n public addOnJSPropsChangeListener(\n animatedComponent: React.Component<\n AnimatedComponentProps<InitialComponentProps>\n > &\n IAnimatedComponentInternal\n ) {\n if (!JSPropsUpdaterFabric.isInitialized) {\n return;\n }\n const viewTag = findNodeHandle(animatedComponent);\n JSPropsUpdaterFabric._tagToComponentMapping.set(viewTag, animatedComponent);\n }\n\n public removeOnJSPropsChangeListener(\n animatedComponent: React.Component<\n AnimatedComponentProps<InitialComponentProps>\n > &\n IAnimatedComponentInternal\n ) {\n if (!JSPropsUpdaterFabric.isInitialized) {\n return;\n }\n const viewTag = findNodeHandle(animatedComponent);\n JSPropsUpdaterFabric._tagToComponentMapping.delete(viewTag);\n }\n}\n\nclass JSPropsUpdaterWeb implements IJSPropsUpdater {\n public addOnJSPropsChangeListener(\n _animatedComponent: React.Component<\n AnimatedComponentProps<InitialComponentProps>\n > &\n IAnimatedComponentInternal\n ) {\n // noop\n }\n\n public removeOnJSPropsChangeListener(\n _animatedComponent: React.Component<\n AnimatedComponentProps<InitialComponentProps>\n > &\n IAnimatedComponentInternal\n ) {\n // noop\n }\n}\n\ntype JSPropsUpdaterOptions =\n | typeof JSPropsUpdaterWeb\n | typeof JSPropsUpdaterFabric\n | typeof JSPropsUpdaterPaper;\n\nlet JSPropsUpdater: JSPropsUpdaterOptions;\nif (SHOULD_BE_USE_WEB) {\n JSPropsUpdater = JSPropsUpdaterWeb;\n} else if (global._IS_FABRIC) {\n JSPropsUpdater = JSPropsUpdaterFabric;\n} else {\n JSPropsUpdater = JSPropsUpdaterPaper;\n}\n\nexport default JSPropsUpdater;\n"],"mappings":"AAAA,YAAY;;AAAC,SAAAA,gBAAAC,GAAA,EAAAC,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAD,GAAA,IAAAI,MAAA,CAAAC,cAAA,CAAAL,GAAA,EAAAC,GAAA,IAAAC,KAAA,EAAAA,KAAA,EAAAI,UAAA,QAAAC,YAAA,QAAAC,QAAA,oBAAAR,GAAA,CAAAC,GAAA,IAAAC,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IACF;IACA,MAAMhB,OAAO,GAAGb,cAAc,CAACY,iBAAiB,CAAC;IACjDgB,oBAAoB,CAACd,sBAAsB,CAACC,GAAG,CAACF,OAAO,EAAED,iBAAiB,CAAC;EAC7E;EAEOY,6BAA6BA,CAClCZ,iBAG4B,EAC5B;IACA,IAAI,CAACgB,oBAAoB,CAACC,aAAa,EAAE;MACvC;IACF;IACA,MAAMhB,OAAO,GAAGb,cAAc,CAACY,iBAAiB,CAAC;IACjDgB,oBAAoB,CAACd,sBAAsB,CAACW,MAAM,CAACZ,OAAO,CAAC;EAC7D;AACF;AAACpC,eAAA,CA9CKmD,oBAAoB,4BACgB,IAAID,GAAG,CAAC,CAAC;AAAAlD,eAAA,CAD7CmD,oBAAoB,mBAEO,KAAK;AA8CtC,MAAMK,iBAAiB,CAA4B;EAC1CtB,0BAA0BA,CAC/BuB,kBAG4B,EAC5B;IACA;EAAA;EAGKV,6BAA6BA,CAClCU,kBAG4B,EAC5B;IACA;EAAA;AAEJ;AAOA,IAAIC,cAAqC;AACzC,IAAI9B,iBAAiB,EAAE;EACrB8B,cAAc,GAAGF,iBAAiB;AACpC,CAAC,MAAM,IAAIF,MAAM,CAACK,UAAU,EAAE;EAC5BD,cAAc,GAAGP,oBAAoB;AACvC,CAAC,MAAM;EACLO,cAAc,GAAG7B,mBAAmB;AACtC;AAEA,eAAe6B,cAAc","ignoreList":[]}
@@ -0,0 +1,11 @@
1
+ 'use strict';
2
+
3
+ export default class JSPropsUpdaterWeb {
4
+ addOnJSPropsChangeListener(_animatedComponent) {
5
+ // noop
6
+ }
7
+ removeOnJSPropsChangeListener(_animatedComponent) {
8
+ // noop
9
+ }
10
+ }
11
+ //# sourceMappingURL=JSPropsUpdater.web.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["JSPropsUpdaterWeb","addOnJSPropsChangeListener","_animatedComponent","removeOnJSPropsChangeListener"],"sources":["JSPropsUpdater.web.ts"],"sourcesContent":["'use strict';\nimport type {\n AnimatedComponentProps,\n IAnimatedComponentInternal,\n InitialComponentProps,\n} from './commonTypes';\n\nexport default class JSPropsUpdaterWeb {\n public addOnJSPropsChangeListener(\n _animatedComponent: React.Component<\n AnimatedComponentProps<InitialComponentProps>\n > &\n IAnimatedComponentInternal\n ) {\n // noop\n }\n\n public removeOnJSPropsChangeListener(\n _animatedComponent: React.Component<\n AnimatedComponentProps<InitialComponentProps>\n > &\n IAnimatedComponentInternal\n ) {\n // noop\n }\n}\n"],"mappings":"AAAA,YAAY;;AAOZ,eAAe,MAAMA,iBAAiB,CAAC;EAC9BC,0BAA0BA,CAC/BC,kBAG4B,EAC5B;IACA;EAAA;EAGKC,6BAA6BA,CAClCD,kBAG4B,EAC5B;IACA;EAAA;AAEJ","ignoreList":[]}
@@ -1,11 +1,12 @@
1
1
  'use strict';
2
2
 
3
3
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
4
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
5
- function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
6
- import { isSharedValue } from '../reanimated2';
4
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
5
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
6
+ import { shallowEqual } from '../reanimated2/hook/utils';
7
+ import { isSharedValue } from '../reanimated2/isSharedValue';
7
8
  import { isChromeDebugger } from '../reanimated2/PlatformChecker';
8
- import WorkletEventHandler from '../reanimated2/WorkletEventHandler';
9
+ import { WorkletEventHandler } from '../reanimated2/WorkletEventHandler';
9
10
  import { initialUpdaterRun } from '../reanimated2/animation';
10
11
  import { hasInlineStyles, getInlineStyle } from './InlinePropManager';
11
12
  import { flattenArray, has } from './utils';
@@ -17,21 +18,28 @@ function dummyListener() {
17
18
  export class PropsFilter {
18
19
  constructor() {
19
20
  _defineProperty(this, "_initialStyle", {});
21
+ _defineProperty(this, "_previousProps", null);
22
+ _defineProperty(this, "_requiresNewInitials", true);
20
23
  }
21
24
  filterNonAnimatedProps(component) {
22
25
  const inputProps = component.props;
26
+ this._maybePrepareForNewInitials(inputProps);
23
27
  const props = {};
24
28
  for (const key in inputProps) {
25
29
  const value = inputProps[key];
26
30
  if (key === 'style') {
27
31
  const styleProp = inputProps.style;
28
32
  const styles = flattenArray(styleProp ?? []);
33
+ if (this._requiresNewInitials) {
34
+ this._initialStyle = {};
35
+ }
29
36
  const processedStyle = styles.map(style => {
30
37
  if (style && style.viewDescriptors) {
31
38
  var _style$viewsRef;
32
39
  // this is how we recognize styles returned by useAnimatedStyle
33
- (_style$viewsRef = style.viewsRef) === null || _style$viewsRef === void 0 ? void 0 : _style$viewsRef.add(component);
34
- if (component._isFirstRender) {
40
+ // TODO - refactor, since `viewsRef` is only present on Web
41
+ (_style$viewsRef = style.viewsRef) === null || _style$viewsRef === void 0 || _style$viewsRef.add(component);
42
+ if (this._requiresNewInitials) {
35
43
  this._initialStyle = {
36
44
  ...style.initial.value,
37
45
  ...this._initialStyle,
@@ -40,7 +48,7 @@ export class PropsFilter {
40
48
  }
41
49
  return this._initialStyle;
42
50
  } else if (hasInlineStyles(style)) {
43
- return getInlineStyle(style, component._isFirstRender);
51
+ return getInlineStyle(style, this._requiresNewInitials);
44
52
  } else {
45
53
  return style;
46
54
  }
@@ -52,7 +60,8 @@ export class PropsFilter {
52
60
  Object.keys(animatedProp.initial.value).forEach(initialValueKey => {
53
61
  var _animatedProp$initial, _animatedProp$viewsRe;
54
62
  props[initialValueKey] = (_animatedProp$initial = animatedProp.initial) === null || _animatedProp$initial === void 0 ? void 0 : _animatedProp$initial.value[initialValueKey];
55
- (_animatedProp$viewsRe = animatedProp.viewsRef) === null || _animatedProp$viewsRe === void 0 ? void 0 : _animatedProp$viewsRe.add(component);
63
+ // TODO - refacotr, since `viewsRef` is only present on Web
64
+ (_animatedProp$viewsRe = animatedProp.viewsRef) === null || _animatedProp$viewsRe === void 0 || _animatedProp$viewsRe.add(component);
56
65
  });
57
66
  }
58
67
  } else if (has('workletEventHandler', value) && value.workletEventHandler instanceof WorkletEventHandler) {
@@ -64,14 +73,21 @@ export class PropsFilter {
64
73
  props[key] = dummyListener;
65
74
  }
66
75
  } else if (isSharedValue(value)) {
67
- if (component._isFirstRender) {
76
+ if (this._requiresNewInitials) {
68
77
  props[key] = value.value;
69
78
  }
70
79
  } else if (key !== 'onGestureHandlerStateChange' || !isChromeDebugger()) {
71
80
  props[key] = value;
72
81
  }
73
82
  }
83
+ this._requiresNewInitials = false;
74
84
  return props;
75
85
  }
86
+ _maybePrepareForNewInitials(inputProps) {
87
+ if (this._previousProps && inputProps.style) {
88
+ this._requiresNewInitials = !shallowEqual(this._previousProps, inputProps);
89
+ }
90
+ this._previousProps = inputProps;
91
+ }
76
92
  }
77
93
  //# sourceMappingURL=PropsFilter.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","Number","isSharedValue","isChromeDebugger","WorkletEventHandler","initialUpdaterRun","hasInlineStyles","getInlineStyle","flattenArray","has","StyleSheet","dummyListener","PropsFilter","constructor","filterNonAnimatedProps","component","inputProps","props","styleProp","style","styles","processedStyle","map","viewDescriptors","_style$viewsRef","viewsRef","add","_isFirstRender","_initialStyle","initial","updater","flatten","animatedProp","animatedProps","keys","forEach","initialValueKey","_animatedProp$initial","_animatedProp$viewsRe","workletEventHandler","eventNames","length","eventName","listeners"],"sources":["PropsFilter.tsx"],"sourcesContent":["'use strict';\nimport type { StyleProps } from '../reanimated2';\nimport { isSharedValue } from '../reanimated2';\nimport { isChromeDebugger } from '../reanimated2/PlatformChecker';\nimport WorkletEventHandler from '../reanimated2/WorkletEventHandler';\nimport { initialUpdaterRun } from '../reanimated2/animation';\nimport { hasInlineStyles, getInlineStyle } from './InlinePropManager';\nimport type {\n AnimatedComponentProps,\n AnimatedProps,\n InitialComponentProps,\n IAnimatedComponentInternal,\n IPropsFilter,\n} from './commonTypes';\nimport { flattenArray, has } from './utils';\nimport { StyleSheet } from 'react-native';\n\nfunction dummyListener() {\n // empty listener we use to assign to listener properties for which animated\n // event is used.\n}\n\nexport class PropsFilter implements IPropsFilter {\n private _initialStyle = {};\n\n public filterNonAnimatedProps(\n component: React.Component<unknown, unknown> & IAnimatedComponentInternal\n ): Record<string, unknown> {\n const inputProps =\n component.props as AnimatedComponentProps<InitialComponentProps>;\n const props: Record<string, unknown> = {};\n for (const key in inputProps) {\n const value = inputProps[key];\n if (key === 'style') {\n const styleProp = inputProps.style;\n const styles = flattenArray<StyleProps>(styleProp ?? []);\n const processedStyle: StyleProps = styles.map((style) => {\n if (style && style.viewDescriptors) {\n // this is how we recognize styles returned by useAnimatedStyle\n style.viewsRef?.add(component);\n if (component._isFirstRender) {\n this._initialStyle = {\n ...style.initial.value,\n ...this._initialStyle,\n ...initialUpdaterRun<StyleProps>(style.initial.updater),\n };\n }\n return this._initialStyle;\n } else if (hasInlineStyles(style)) {\n return getInlineStyle(style, component._isFirstRender);\n } else {\n return style;\n }\n });\n props[key] = StyleSheet.flatten(processedStyle);\n } else if (key === 'animatedProps') {\n const animatedProp = inputProps.animatedProps as Partial<\n AnimatedComponentProps<AnimatedProps>\n >;\n if (animatedProp.initial !== undefined) {\n Object.keys(animatedProp.initial.value).forEach((initialValueKey) => {\n props[initialValueKey] =\n animatedProp.initial?.value[initialValueKey];\n animatedProp.viewsRef?.add(component);\n });\n }\n } else if (\n has('workletEventHandler', value) &&\n value.workletEventHandler instanceof WorkletEventHandler\n ) {\n if (value.workletEventHandler.eventNames.length > 0) {\n value.workletEventHandler.eventNames.forEach((eventName) => {\n props[eventName] = has('listeners', value.workletEventHandler)\n ? (\n value.workletEventHandler.listeners as Record<string, unknown>\n )[eventName]\n : dummyListener;\n });\n } else {\n props[key] = dummyListener;\n }\n } else if (isSharedValue(value)) {\n if (component._isFirstRender) {\n props[key] = value.value;\n }\n } else if (key !== 'onGestureHandlerStateChange' || !isChromeDebugger()) {\n props[key] = value;\n }\n }\n return props;\n }\n}\n"],"mappings":"AAAA,YAAY;;AAAC,SAAAA,gBAAAC,GAAA,EAAAC,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAD,GAAA,IAAAI,MAAA,CAAAC,cAAA,CAAAL,GAAA,EAAAC,GAAA,IAAAC,KAAA,EAAAA,KAAA,EAAAI,UAAA,QAAAC,YAAA,QAAAC,QAAA,oBAAAR,GAAA,CAAAC,GAAA,IAAAC,KAAA,WAAAF,GAAA;AAAA,SAAAG,eAAAM,GAAA,QAAAR,GAAA,GAAAS,YAAA,CAAAD,GAAA,2BAAAR,GAAA,gBAAAA,GAAA,GAAAU,MAAA,CAAAV,GAAA;AAAA,SAAAS,aAAAE,KAAA,EAAAC,IAAA,eAAAD,KAAA,iBAAAA,KAAA,kBAAAA,KAAA,MAAAE,IAAA,GAAAF,KAAA,CAAAG,MAAA,CAAAC,WAAA,OAAAF,IAAA,KAAAG,SAAA,QAAAC,GAAA,GAAAJ,IAAA,CAAAK,IAAA,CAAAP,KAAA,EAAAC,IAAA,2BAAAK,GAAA,sBAAAA,GAAA,YAAAE,SAAA,4DAAAP,IAAA,gBAAAF,MAAA,GAAAU,MAAA,EAAAT,KAAA;AAEb,SAASU,aAAa,QAAQ,gBAAgB;AAC9C,SAASC,gBAAgB,QA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GACZ/B,aAAa;UACnB,CAAC,CAAC;QACJ,CAAC,MAAM;UACLM,KAAK,CAACpC,GAAG,CAAC,GAAG8B,aAAa;QAC5B;MACF,CAAC,MAAM,IAAIT,aAAa,CAACpB,KAAK,CAAC,EAAE;QAC/B,IAAIiC,SAAS,CAACY,cAAc,EAAE;UAC5BV,KAAK,CAACpC,GAAG,CAAC,GAAGC,KAAK,CAACA,KAAK;QAC1B;MACF,CAAC,MAAM,IAAID,GAAG,KAAK,6BAA6B,IAAI,CAACsB,gBAAgB,EAAE,EAAE;QACvEc,KAAK,CAACpC,GAAG,CAAC,GAAGC,KAAK;MACpB;IACF;IACA,OAAOmC,KAAK;EACd;AACF"}
1
+ {"version":3,"names":["_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","r","e","Symbol","toPrimitive","call","TypeError","String","Number","shallowEqual","isSharedValue","isChromeDebugger","WorkletEventHandler","initialUpdaterRun","hasInlineStyles","getInlineStyle","flattenArray","has","StyleSheet","dummyListener","PropsFilter","constructor","filterNonAnimatedProps","component","inputProps","props","_maybePrepareForNewInitials","styleProp","style","styles","_requiresNewInitials","_initialStyle","processedStyle","map","viewDescriptors","_style$viewsRef","viewsRef","add","initial","updater","flatten","animatedProp","animatedProps","undefined","keys","forEach","initialValueKey","_animatedProp$initial","_animatedProp$viewsRe","workletEventHandler","eventNames","length","eventName","listeners","_previousProps"],"sources":["PropsFilter.tsx"],"sourcesContent":["'use strict';\n\nimport { shallowEqual } from '../reanimated2/hook/utils';\nimport type { StyleProps } from '../reanimated2/commonTypes';\nimport { isSharedValue } from '../reanimated2/isSharedValue';\nimport { isChromeDebugger } from '../reanimated2/PlatformChecker';\nimport { WorkletEventHandler } from '../reanimated2/WorkletEventHandler';\nimport { initialUpdaterRun } from '../reanimated2/animation';\nimport { hasInlineStyles, getInlineStyle } from './InlinePropManager';\nimport type {\n AnimatedComponentProps,\n AnimatedProps,\n InitialComponentProps,\n IAnimatedComponentInternal,\n IPropsFilter,\n} from './commonTypes';\nimport { flattenArray, has } from './utils';\nimport { StyleSheet } from 'react-native';\n\nfunction dummyListener() {\n // empty listener we use to assign to listener properties for which animated\n // event is used.\n}\n\nexport class PropsFilter implements IPropsFilter {\n private _initialStyle = {};\n private _previousProps: React.Component['props'] | null = null;\n private _requiresNewInitials = true;\n\n public filterNonAnimatedProps(\n component: React.Component<unknown, unknown> & IAnimatedComponentInternal\n ): Record<string, unknown> {\n const inputProps =\n component.props as AnimatedComponentProps<InitialComponentProps>;\n\n this._maybePrepareForNewInitials(inputProps);\n\n const props: Record<string, unknown> = {};\n for (const key in inputProps) {\n const value = inputProps[key];\n if (key === 'style') {\n const styleProp = inputProps.style;\n const styles = flattenArray<StyleProps>(styleProp ?? []);\n if (this._requiresNewInitials) {\n this._initialStyle = {};\n }\n const processedStyle: StyleProps = styles.map((style) => {\n if (style && style.viewDescriptors) {\n // this is how we recognize styles returned by useAnimatedStyle\n // TODO - refactor, since `viewsRef` is only present on Web\n style.viewsRef?.add(component);\n if (this._requiresNewInitials) {\n this._initialStyle = {\n ...style.initial.value,\n ...this._initialStyle,\n ...initialUpdaterRun<StyleProps>(style.initial.updater),\n };\n }\n return this._initialStyle;\n } else if (hasInlineStyles(style)) {\n return getInlineStyle(style, this._requiresNewInitials);\n } else {\n return style;\n }\n });\n props[key] = StyleSheet.flatten(processedStyle);\n } else if (key === 'animatedProps') {\n const animatedProp = inputProps.animatedProps as Partial<\n AnimatedComponentProps<AnimatedProps>\n >;\n if (animatedProp.initial !== undefined) {\n Object.keys(animatedProp.initial.value).forEach((initialValueKey) => {\n props[initialValueKey] =\n animatedProp.initial?.value[initialValueKey];\n // TODO - refacotr, since `viewsRef` is only present on Web\n animatedProp.viewsRef?.add(component);\n });\n }\n } else if (\n has('workletEventHandler', value) &&\n value.workletEventHandler instanceof WorkletEventHandler\n ) {\n if (value.workletEventHandler.eventNames.length > 0) {\n value.workletEventHandler.eventNames.forEach((eventName) => {\n props[eventName] = has('listeners', value.workletEventHandler)\n ? (\n value.workletEventHandler.listeners as Record<string, unknown>\n )[eventName]\n : dummyListener;\n });\n } else {\n props[key] = dummyListener;\n }\n } else if (isSharedValue(value)) {\n if (this._requiresNewInitials) {\n props[key] = value.value;\n }\n } else if (key !== 'onGestureHandlerStateChange' || !isChromeDebugger()) {\n props[key] = value;\n }\n }\n this._requiresNewInitials = false;\n return props;\n }\n\n private _maybePrepareForNewInitials(\n inputProps: AnimatedComponentProps<InitialComponentProps>\n ) {\n if (this._previousProps && inputProps.style) {\n this._requiresNewInitials = !shallowEqual(\n this._previousProps,\n inputProps\n );\n }\n this._previousProps = inputProps;\n }\n}\n"],"mappings":"AAAA,YAAY;;AAAC,SAAAA,gBAAAC,GAAA,EAAAC,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAD,GAAA,IAAAI,MAAA,CAAAC,cAAA,CAAAL,GAAA,EAAAC,GAAA,IAAAC,KAAA,EAAAA,KAAA,EAAAI,UAAA,QAAAC,YAAA,QAAAC,QAAA,oBAAAR,GAAA,CAAAC,GAAA,IAAAC,KAAA,WAAAF,GAAA;AAAA,SAAAG,eAAAM,CAAA,QAAAC,CAAA,GAAAC,YAAA,CAAAF,CAAA,uCAAAC,CAAA,GAAAA,CAAA,GAAAA,CAAA;AAAA,SAAAC,aAAAF,CAAA,EAAAG,CAAA,2BAAAH,CAAA,KAAAA,CAAA,SAAAA,CAAA,MAAAI,CAAA,GAAAJ,CAAA,CAAAK,MAAA,CAAAC,WAAA,kBAAAF,CAAA,QAAAH,CAAA,GAAAG,CAAA,CAAAG,IAAA,CAAAP,CAAA,EAAAG,CAAA,uCAAAF,CAAA,SAAAA,CAAA,YAAAO,SAAA,yEAAAL,CAAA,GAAAM,MAAA,GAAAC,MAAA,EAAAV,CAAA;AAEb,SAASW,YAAY,QAAQ,2BAA2B;AAExD,SAASC,aAAa,QAAQ,8BAA8B;AAC5D,SAASC,gB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mB,CAACC,UAAU,CAACL,OAAO,CAAEO,SAAS,IAAK;YAC1D3B,KAAK,CAAC2B,SAAS,CAAC,GAAGnC,GAAG,CAAC,WAAW,EAAE1B,KAAK,CAAC0D,mBAAmB,CAAC,GAExD1D,KAAK,CAAC0D,mBAAmB,CAACI,SAAS,CACnCD,SAAS,CAAC,GACZjC,aAAa;UACnB,CAAC,CAAC;QACJ,CAAC,MAAM;UACLM,KAAK,CAACnC,GAAG,CAAC,GAAG6B,aAAa;QAC5B;MACF,CAAC,MAAM,IAAIT,aAAa,CAACnB,KAAK,CAAC,EAAE;QAC/B,IAAI,IAAI,CAACuC,oBAAoB,EAAE;UAC7BL,KAAK,CAACnC,GAAG,CAAC,GAAGC,KAAK,CAACA,KAAK;QAC1B;MACF,CAAC,MAAM,IAAID,GAAG,KAAK,6BAA6B,IAAI,CAACqB,gBAAgB,CAAC,CAAC,EAAE;QACvEc,KAAK,CAACnC,GAAG,CAAC,GAAGC,KAAK;MACpB;IACF;IACA,IAAI,CAACuC,oBAAoB,GAAG,KAAK;IACjC,OAAOL,KAAK;EACd;EAEQC,2BAA2BA,CACjCF,UAAyD,EACzD;IACA,IAAI,IAAI,CAAC8B,cAAc,IAAI9B,UAAU,CAACI,KAAK,EAAE;MAC3C,IAAI,CAACE,oBAAoB,GAAG,CAACrB,YAAY,CACvC,IAAI,CAAC6C,cAAc,EACnB9B,UACF,CAAC;IACH;IACA,IAAI,CAAC8B,cAAc,GAAG9B,UAAU;EAClC;AACF","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["commonTypes.ts"],"sourcesContent":["'use strict';\nimport type { Ref, Component } from 'react';\nimport type {\n StyleProps,\n BaseAnimationBuilder,\n ILayoutAnimationBuilder,\n EntryExitAnimationFunction,\n SharedTransition,\n SharedValue,\n} from '../reanimated2';\nimport type {\n ViewDescriptorsSet,\n ViewRefSet,\n} from '../reanimated2/ViewDescriptorsSet';\nimport type { SkipEnteringContext } from '../reanimated2/component/LayoutAnimationConfig';\nimport type { ShadowNodeWrapper } from '../reanimated2/commonTypes';\nimport type { ViewConfig } from '../ConfigHelper';\n\nexport interface AnimatedProps extends Record<string, unknown> {\n viewDescriptors?: ViewDescriptorsSet;\n viewsRef?: ViewRefSet<unknown>;\n initial?: SharedValue<StyleProps>;\n}\n\nexport interface ViewInfo {\n viewTag: number | HTMLElement | null;\n viewName: string | null;\n shadowNodeWrapper: ShadowNodeWrapper | null;\n viewConfig: ViewConfig;\n}\n\nexport interface IInlinePropManager {\n attachInlineProps(\n animatedComponent: React.Component<unknown, unknown>,\n viewInfo: ViewInfo\n ): void;\n detachInlineProps(): void;\n}\n\nexport interface IPropsFilter {\n filterNonAnimatedProps: (\n component: React.Component<unknown, unknown> & IAnimatedComponentInternal\n ) => Record<string, unknown>;\n}\n\nexport interface IJSPropsUpdater {\n addOnJSPropsChangeListener(\n animatedComponent: React.Component<unknown, unknown> &\n IAnimatedComponentInternal\n ): void;\n removeOnJSPropsChangeListener(\n animatedComponent: React.Component<unknown, unknown> &\n IAnimatedComponentInternal\n ): void;\n}\n\nexport type LayoutAnimationStaticContext = {\n presetName: string;\n};\n\nexport type AnimatedComponentProps<P extends Record<string, unknown>> = P & {\n forwardedRef?: Ref<Component>;\n style?: NestedArray<StyleProps>;\n animatedProps?: Partial<AnimatedComponentProps<AnimatedProps>>;\n animatedStyle?: StyleProps;\n layout?: (\n | BaseAnimationBuilder\n | ILayoutAnimationBuilder\n | typeof BaseAnimationBuilder\n ) &\n LayoutAnimationStaticContext;\n entering?: (\n | BaseAnimationBuilder\n | typeof BaseAnimationBuilder\n | EntryExitAnimationFunction\n | Keyframe\n ) &\n LayoutAnimationStaticContext;\n exiting?: (\n | BaseAnimationBuilder\n | typeof BaseAnimationBuilder\n | EntryExitAnimationFunction\n | Keyframe\n ) &\n LayoutAnimationStaticContext;\n sharedTransitionTag?: string;\n sharedTransitionStyle?: SharedTransition;\n};\n\nexport interface AnimatedComponentRef extends Component {\n setNativeProps?: (props: Record<string, unknown>) => void;\n getScrollableNode?: () => AnimatedComponentRef;\n getAnimatableRef?: () => AnimatedComponentRef;\n}\n\nexport interface IAnimatedComponentInternal {\n _styles: StyleProps[] | null;\n _animatedProps?: Partial<AnimatedComponentProps<AnimatedProps>>;\n _viewTag: number;\n _isFirstRender: boolean;\n jestAnimatedStyle: { value: StyleProps };\n _component: AnimatedComponentRef | HTMLElement | null;\n _sharedElementTransition: SharedTransition | null;\n _jsPropsUpdater: IJSPropsUpdater;\n _InlinePropManager: IInlinePropManager;\n _PropsFilter: IPropsFilter;\n _viewInfo?: ViewInfo;\n context: React.ContextType<typeof SkipEnteringContext>;\n}\n\nexport type NestedArray<T> = T | NestedArray<T>[];\n\nexport interface InitialComponentProps extends Record<string, unknown> {\n ref?: Ref<Component>;\n collapsable?: boolean;\n}\n"],"mappings":"AAAA,YAAY;;AAAC"}
1
+ {"version":3,"names":[],"sources":["commonTypes.ts"],"sourcesContent":["'use strict';\nimport type { Ref, Component } from 'react';\nimport type {\n StyleProps,\n BaseAnimationBuilder,\n ILayoutAnimationBuilder,\n EntryExitAnimationFunction,\n SharedTransition,\n SharedValue,\n} from '../reanimated2';\nimport type {\n ViewDescriptorsSet,\n ViewRefSet,\n} from '../reanimated2/ViewDescriptorsSet';\nimport type { SkipEnteringContext } from '../reanimated2/component/LayoutAnimationConfig';\nimport type { ShadowNodeWrapper } from '../reanimated2/commonTypes';\nimport type { ViewConfig } from '../ConfigHelper';\n\nexport interface AnimatedProps extends Record<string, unknown> {\n viewDescriptors?: ViewDescriptorsSet;\n viewsRef?: ViewRefSet<unknown>;\n initial?: SharedValue<StyleProps>;\n}\n\nexport interface ViewInfo {\n viewTag: number | HTMLElement | null;\n viewName: string | null;\n shadowNodeWrapper: ShadowNodeWrapper | null;\n viewConfig: ViewConfig;\n}\n\nexport interface IInlinePropManager {\n attachInlineProps(\n animatedComponent: React.Component<unknown, unknown>,\n viewInfo: ViewInfo\n ): void;\n detachInlineProps(): void;\n}\n\nexport interface IPropsFilter {\n filterNonAnimatedProps: (\n component: React.Component<unknown, unknown> & IAnimatedComponentInternal\n ) => Record<string, unknown>;\n}\n\nexport interface IJSPropsUpdater {\n addOnJSPropsChangeListener(\n animatedComponent: React.Component<unknown, unknown> &\n IAnimatedComponentInternal\n ): void;\n removeOnJSPropsChangeListener(\n animatedComponent: React.Component<unknown, unknown> &\n IAnimatedComponentInternal\n ): void;\n}\n\nexport type LayoutAnimationStaticContext = {\n presetName: string;\n};\n\nexport type AnimatedComponentProps<P extends Record<string, unknown>> = P & {\n forwardedRef?: Ref<Component>;\n style?: NestedArray<StyleProps>;\n animatedProps?: Partial<AnimatedComponentProps<AnimatedProps>>;\n animatedStyle?: StyleProps;\n layout?: (\n | BaseAnimationBuilder\n | ILayoutAnimationBuilder\n | typeof BaseAnimationBuilder\n ) &\n LayoutAnimationStaticContext;\n entering?: (\n | BaseAnimationBuilder\n | typeof BaseAnimationBuilder\n | EntryExitAnimationFunction\n | Keyframe\n ) &\n LayoutAnimationStaticContext;\n exiting?: (\n | BaseAnimationBuilder\n | typeof BaseAnimationBuilder\n | EntryExitAnimationFunction\n | Keyframe\n ) &\n LayoutAnimationStaticContext;\n sharedTransitionTag?: string;\n sharedTransitionStyle?: SharedTransition;\n};\n\nexport interface AnimatedComponentRef extends Component {\n setNativeProps?: (props: Record<string, unknown>) => void;\n getScrollableNode?: () => AnimatedComponentRef;\n getAnimatableRef?: () => AnimatedComponentRef;\n}\n\nexport interface IAnimatedComponentInternal {\n _styles: StyleProps[] | null;\n _animatedProps?: Partial<AnimatedComponentProps<AnimatedProps>>;\n _viewTag: number;\n _isFirstRender: boolean;\n jestAnimatedStyle: { value: StyleProps };\n _component: AnimatedComponentRef | HTMLElement | null;\n _sharedElementTransition: SharedTransition | null;\n _jsPropsUpdater: IJSPropsUpdater;\n _InlinePropManager: IInlinePropManager;\n _PropsFilter: IPropsFilter;\n _viewInfo?: ViewInfo;\n context: React.ContextType<typeof SkipEnteringContext>;\n}\n\nexport type NestedArray<T> = T | NestedArray<T>[];\n\nexport interface InitialComponentProps extends Record<string, unknown> {\n ref?: Ref<Component>;\n collapsable?: boolean;\n}\n"],"mappings":"AAAA,YAAY;;AAAC","ignoreList":[]}