@react-native-ohos/react-native-reanimated 3.18.2-rc.2 → 4.0.0-rc.1

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 (282) hide show
  1. package/compatibility.json +161 -0
  2. package/harmony/reanimated/BuildProfile.ets +16 -16
  3. package/harmony/reanimated/build-profile.json5 +18 -11
  4. package/harmony/reanimated/oh-package.json5 +12 -11
  5. package/harmony/reanimated/src/main/cpp/CMakeLists.txt +31 -40
  6. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/AnimatedSensor/AnimatedSensorModule.cpp +81 -86
  7. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/AnimatedSensor/AnimatedSensorModule.h +46 -47
  8. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/InterpolatorRegistry.cpp +390 -0
  9. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/InterpolatorRegistry.h +16 -0
  10. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/definitions.h +30 -0
  11. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/filters/FilterOp.cpp +46 -0
  12. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/filters/FilterOp.h +23 -0
  13. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/transforms/Quaternion.cpp +53 -0
  14. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/transforms/Quaternion.h +21 -0
  15. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/transforms/TransformMatrix.cpp +166 -0
  16. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/transforms/TransformMatrix.h +71 -0
  17. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/transforms/TransformMatrix2D.cpp +368 -0
  18. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/transforms/TransformMatrix2D.h +53 -0
  19. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/transforms/TransformMatrix3D.cpp +594 -0
  20. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/transforms/TransformMatrix3D.h +67 -0
  21. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/transforms/TransformOp.cpp +52 -0
  22. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/transforms/TransformOp.h +26 -0
  23. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/transforms/vectors.cpp +156 -0
  24. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/transforms/vectors.h +76 -0
  25. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSAngle.cpp +93 -0
  26. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSAngle.h +33 -0
  27. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSBoolean.cpp +48 -0
  28. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSBoolean.h +31 -0
  29. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSColor.cpp +135 -0
  30. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSColor.h +61 -0
  31. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSDiscreteArray.cpp +100 -0
  32. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSDiscreteArray.h +44 -0
  33. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSKeyword.cpp +81 -0
  34. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSKeyword.h +53 -0
  35. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSLength.cpp +122 -0
  36. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSLength.h +38 -0
  37. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSNumber.cpp +82 -0
  38. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSNumber.h +63 -0
  39. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSValue.h +118 -0
  40. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSValueVariant.cpp +174 -0
  41. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSValueVariant.h +111 -0
  42. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/complex/CSSBoxShadow.cpp +196 -0
  43. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/complex/CSSBoxShadow.h +66 -0
  44. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/complex/CSSDropShadow.cpp +134 -0
  45. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/complex/CSSDropShadow.h +44 -0
  46. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/configs/CSSAnimationConfig.cpp +174 -0
  47. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/configs/CSSAnimationConfig.h +49 -0
  48. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/configs/CSSKeyframesConfig.cpp +45 -0
  49. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/configs/CSSKeyframesConfig.h +26 -0
  50. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/configs/CSSTransitionConfig.cpp +90 -0
  51. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/configs/CSSTransitionConfig.h +43 -0
  52. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/configs/common.cpp +17 -0
  53. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/configs/common.h +13 -0
  54. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/core/CSSAnimation.cpp +127 -0
  55. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/core/CSSAnimation.h +51 -0
  56. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/core/CSSTransition.cpp +145 -0
  57. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/core/CSSTransition.h +47 -0
  58. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/easing/EasingFunctions.cpp +69 -0
  59. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/easing/EasingFunctions.h +22 -0
  60. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/easing/cubicBezier.cpp +66 -0
  61. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/easing/cubicBezier.h +15 -0
  62. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/easing/linear.cpp +28 -0
  63. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/easing/linear.h +15 -0
  64. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/easing/steps.cpp +13 -0
  65. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/easing/steps.h +12 -0
  66. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/InterpolatorFactory.cpp +157 -0
  67. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/InterpolatorFactory.h +189 -0
  68. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/PropertyInterpolator.cpp +76 -0
  69. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/PropertyInterpolator.h +66 -0
  70. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/configs.h +20 -0
  71. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/FilterOperation.cpp +136 -0
  72. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/FilterOperation.h +40 -0
  73. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/FilterOperationInterpolator.cpp +38 -0
  74. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/FilterOperationInterpolator.h +24 -0
  75. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/FilterStyleInterpolator.cpp +58 -0
  76. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/FilterStyleInterpolator.h +24 -0
  77. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/operations/blur.h +14 -0
  78. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/operations/brightness.h +14 -0
  79. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/operations/contrast.h +14 -0
  80. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/operations/dropShadow.h +17 -0
  81. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/operations/grayscale.h +14 -0
  82. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/operations/hueRotate.h +14 -0
  83. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/operations/invert.h +14 -0
  84. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/operations/opacity.h +14 -0
  85. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/operations/saturate.h +14 -0
  86. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/operations/sepia.h +14 -0
  87. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/groups/ArrayPropertiesInterpolator.cpp +95 -0
  88. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/groups/ArrayPropertiesInterpolator.h +36 -0
  89. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/groups/GroupPropertiesInterpolator.cpp +41 -0
  90. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/groups/GroupPropertiesInterpolator.h +32 -0
  91. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/groups/RecordPropertiesInterpolator.cpp +99 -0
  92. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/groups/RecordPropertiesInterpolator.h +37 -0
  93. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/operations/OperationsStyleInterpolator.cpp +308 -0
  94. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/operations/OperationsStyleInterpolator.h +100 -0
  95. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/operations/StyleOperation.cpp +19 -0
  96. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/operations/StyleOperation.h +94 -0
  97. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/operations/StyleOperationInterpolator.cpp +18 -0
  98. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/operations/StyleOperationInterpolator.h +43 -0
  99. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/styles/AnimationStyleInterpolator.h +26 -0
  100. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/styles/TransitionStyleInterpolator.cpp +103 -0
  101. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/styles/TransitionStyleInterpolator.h +42 -0
  102. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/TransformOperation.cpp +224 -0
  103. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/TransformOperation.h +52 -0
  104. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/TransformOperationInterpolator.cpp +218 -0
  105. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/TransformOperationInterpolator.h +89 -0
  106. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/TransformsStyleInterpolator.cpp +149 -0
  107. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/TransformsStyleInterpolator.h +33 -0
  108. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/operations/matrix.cpp +208 -0
  109. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/operations/matrix.h +56 -0
  110. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/operations/perspective.cpp +42 -0
  111. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/operations/perspective.h +20 -0
  112. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/operations/rotate.cpp +41 -0
  113. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/operations/rotate.h +39 -0
  114. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/operations/scale.cpp +28 -0
  115. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/operations/scale.h +25 -0
  116. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/operations/skew.cpp +14 -0
  117. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/operations/skew.h +20 -0
  118. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/operations/translate.cpp +39 -0
  119. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/operations/translate.h +25 -0
  120. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/values/ResolvableValueInterpolator.cpp +47 -0
  121. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/values/ResolvableValueInterpolator.h +43 -0
  122. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/values/SimpleValueInterpolator.cpp +70 -0
  123. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/values/SimpleValueInterpolator.h +40 -0
  124. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/values/ValueInterpolator.cpp +146 -0
  125. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/values/ValueInterpolator.h +71 -0
  126. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/misc/ViewStylesRepository.cpp +155 -0
  127. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/misc/ViewStylesRepository.h +53 -0
  128. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/progress/AnimationProgressProvider.cpp +170 -0
  129. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/progress/AnimationProgressProvider.h +67 -0
  130. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/progress/KeyframeProgressProvider.h +12 -0
  131. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/progress/RawProgressProvider.cpp +41 -0
  132. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/progress/RawProgressProvider.h +31 -0
  133. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/progress/TransitionProgressProvider.cpp +193 -0
  134. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/progress/TransitionProgressProvider.h +77 -0
  135. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/registries/CSSAnimationsRegistry.cpp +340 -0
  136. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/registries/CSSAnimationsRegistry.h +80 -0
  137. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/registries/CSSKeyframesRegistry.cpp +45 -0
  138. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/registries/CSSKeyframesRegistry.h +29 -0
  139. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/registries/CSSTransitionsRegistry.cpp +167 -0
  140. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/registries/CSSTransitionsRegistry.h +51 -0
  141. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/registries/StaticPropsRegistry.cpp +61 -0
  142. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/registries/StaticPropsRegistry.h +33 -0
  143. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/svg/values/SVGBrush.cpp +80 -0
  144. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/svg/values/SVGBrush.h +39 -0
  145. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/svg/values/SVGLength.cpp +93 -0
  146. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/svg/values/SVGLength.h +36 -0
  147. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/svg/values/SVGStrokeDashArray.cpp +110 -0
  148. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/svg/values/SVGStrokeDashArray.h +33 -0
  149. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/utils/DelayedItemsManager.cpp +75 -0
  150. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/utils/DelayedItemsManager.h +45 -0
  151. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/utils/algorithms.cpp +12 -0
  152. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/utils/algorithms.h +10 -0
  153. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/utils/interpolators.cpp +36 -0
  154. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/utils/interpolators.h +23 -0
  155. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/utils/props.cpp +149 -0
  156. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/utils/props.h +32 -0
  157. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/ReanimatedCommitHook.cpp +113 -101
  158. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/ReanimatedCommitHook.h +49 -51
  159. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/ReanimatedCommitShadowNode.h +46 -49
  160. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/ReanimatedMountHook.cpp +56 -96
  161. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/ReanimatedMountHook.h +37 -33
  162. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/ShadowTreeCloner.cpp +104 -95
  163. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/ShadowTreeCloner.h +22 -29
  164. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/updates/AnimatedPropsRegistry.cpp +72 -0
  165. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/updates/AnimatedPropsRegistry.h +25 -0
  166. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/updates/UpdatesRegistry.cpp +160 -0
  167. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/updates/UpdatesRegistry.h +71 -0
  168. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/updates/UpdatesRegistryManager.cpp +161 -0
  169. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/updates/UpdatesRegistryManager.h +65 -0
  170. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationType.h +11 -9
  171. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsManager.cpp +137 -232
  172. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsManager.h +82 -90
  173. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxyCommon.cpp +79 -0
  174. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxyCommon.h +81 -0
  175. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxy_Experimental.cpp +864 -0
  176. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxy_Experimental.h +214 -0
  177. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/{LayoutAnimationsProxy.cpp → LayoutAnimationsProxy_Legacy.cpp} +897 -870
  178. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxy_Legacy.h +220 -0
  179. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsUtils.cpp +31 -91
  180. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsUtils.h +146 -176
  181. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/PropsDiffer.cpp +456 -0
  182. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/PropsDiffer.h +102 -0
  183. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/SharedTransitions.cpp +544 -0
  184. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/NativeModules/PropValueProcessor.cpp +119 -0
  185. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/NativeModules/PropValueProcessor.h +39 -0
  186. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/NativeModules/ReanimatedModuleProxy.cpp +1376 -971
  187. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/NativeModules/ReanimatedModuleProxy.h +228 -252
  188. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/NativeModules/ReanimatedModuleProxySpec.cpp +183 -231
  189. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/NativeModules/ReanimatedModuleProxySpec.h +93 -109
  190. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/RuntimeDecorators/RNRuntimeDecorator.cpp +54 -56
  191. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/RuntimeDecorators/RNRuntimeDecorator.h +28 -20
  192. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/RuntimeDecorators/UIRuntimeDecorator.cpp +58 -70
  193. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/RuntimeDecorators/UIRuntimeDecorator.h +31 -35
  194. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Tools/FeatureFlags.cpp +18 -0
  195. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Tools/FeatureFlags.h +44 -0
  196. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Tools/PlatformDepMethodsHolder.h +67 -98
  197. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Tools/ReanimatedSystraceSection.h +114 -135
  198. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Tools/ReanimatedVersion.cpp +46 -0
  199. package/harmony/reanimated/src/main/cpp/Common/cpp/{worklets → reanimated}/Tools/ReanimatedVersion.h +18 -19
  200. package/harmony/reanimated/src/main/cpp/ReanimatedModule.cpp +60 -85
  201. package/harmony/reanimated/src/main/cpp/ReanimatedNodesManager.cpp +1 -0
  202. package/harmony/reanimated/src/main/cpp/ReanimatedPackage.cpp +0 -3
  203. package/harmony/reanimated/src/main/cpp/ReanimatedSensor.cpp +266 -0
  204. package/harmony/reanimated/src/main/cpp/ReanimatedSensor.h +36 -0
  205. package/harmony/reanimated/src/main/cpp/ReanimatedSensorContainer.cpp +36 -0
  206. package/harmony/reanimated/src/main/cpp/ReanimatedSensorContainer.h +23 -0
  207. package/harmony/reanimated/src/main/cpp/ReanimatedUIScheduler.h +3 -3
  208. package/harmony/reanimated/src/main/ets/ReanimatedModule.ts +5 -1
  209. package/harmony/reanimated/src/main/ets/ReanimatedPackage.ts +1 -4
  210. package/harmony/reanimated/src/main/module.json5 +12 -12
  211. package/harmony/reanimated/src/main/resources/base/element/color.json +7 -7
  212. package/harmony/reanimated/src/main/resources/base/element/string.json +15 -15
  213. package/harmony/reanimated/src/main/resources/base/profile/main_pages.json +5 -5
  214. package/harmony/reanimated/src/main/resources/en_US/element/string.json +15 -15
  215. package/harmony/reanimated/src/main/resources/zh_CN/element/string.json +15 -15
  216. package/harmony/reanimated/ts.ts +6 -6
  217. package/harmony/reanimated.har +0 -0
  218. package/package.json +68 -50
  219. package/scripts/deploy.js +191 -0
  220. package/scripts/set-reanimated-version.js +37 -0
  221. package/scripts/update-version.js +119 -0
  222. package/scripts/validate-react-native-version.js +46 -0
  223. package/scripts/validate-worklets-build.js +17 -0
  224. package/scripts/validate-worklets-version.js +79 -0
  225. package/scripts/worklets-version.json +4 -0
  226. package/LICENSE +0 -21
  227. package/README.OpenSource +0 -11
  228. package/README.md +0 -10
  229. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/PropsRegistry.cpp +0 -68
  230. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/PropsRegistry.h +0 -68
  231. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxy.h +0 -147
  232. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Tools/CollectionUtils.h +0 -14
  233. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Tools/FeaturesConfig.cpp +0 -5
  234. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Tools/FeaturesConfig.h +0 -19
  235. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/NativeModules/WorkletsModuleProxy.cpp +0 -47
  236. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/NativeModules/WorkletsModuleProxy.h +0 -59
  237. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/NativeModules/WorkletsModuleProxySpec.cpp +0 -27
  238. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/NativeModules/WorkletsModuleProxySpec.h +0 -25
  239. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Registries/EventHandlerRegistry.cpp +0 -94
  240. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Registries/EventHandlerRegistry.h +0 -49
  241. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Registries/WorkletRuntimeRegistry.cpp +0 -8
  242. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Registries/WorkletRuntimeRegistry.h +0 -39
  243. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/SharedItems/Shareables.cpp +0 -326
  244. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/SharedItems/Shareables.h +0 -345
  245. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/AsyncQueue.cpp +0 -52
  246. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/AsyncQueue.h +0 -35
  247. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/Defs.h +0 -10
  248. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/JSISerializer.cpp +0 -342
  249. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/JSISerializer.h +0 -47
  250. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/JSLogger.cpp +0 -16
  251. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/JSLogger.h +0 -20
  252. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/JSScheduler.cpp +0 -20
  253. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/JSScheduler.h +0 -29
  254. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/PlatformLogger.h +0 -16
  255. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/ReanimatedJSIUtils.cpp +0 -26
  256. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/ReanimatedJSIUtils.h +0 -199
  257. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/ReanimatedVersion.cpp +0 -95
  258. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/SingleInstanceChecker.h +0 -72
  259. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/ThreadSafeQueue.h +0 -49
  260. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/UIScheduler.cpp +0 -20
  261. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/UIScheduler.h +0 -22
  262. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/WorkletEventHandler.cpp +0 -29
  263. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/WorkletEventHandler.h +0 -41
  264. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/RNRuntimeWorkletDecorator.cpp +0 -16
  265. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/RNRuntimeWorkletDecorator.h +0 -19
  266. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/ReanimatedHermesRuntime.cpp +0 -112
  267. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/ReanimatedHermesRuntime.h +0 -127
  268. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/ReanimatedRuntime.cpp +0 -53
  269. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/ReanimatedRuntime.h +0 -22
  270. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/RuntimeInitialization.md +0 -191
  271. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/WorkletRuntime.cpp +0 -173
  272. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/WorkletRuntime.h +0 -90
  273. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/WorkletRuntimeCollector.h +0 -36
  274. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/WorkletRuntimeDecorator.cpp +0 -189
  275. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/WorkletRuntimeDecorator.h +0 -22
  276. package/harmony/reanimated/src/main/cpp/ReanimatedLogger.cpp +0 -33
  277. package/harmony/reanimated/src/main/cpp/WorkletsModule.cpp +0 -61
  278. package/harmony/reanimated/src/main/cpp/WorkletsModule.h +0 -22
  279. package/harmony/reanimated/src/main/cpp/patches/AnimatedSensor/AnimatedSensorModule.cpp +0 -89
  280. package/harmony/reanimated/src/main/cpp/patches/Fabric/ShadowTreeCloner.cpp +0 -95
  281. package/harmony/reanimated/src/main/cpp/patches/NativeModules/ReanimatedModuleProxy.cpp +0 -964
  282. package/harmony/reanimated/src/main/ets/WorkletsModule.ts +0 -15
@@ -1,135 +1,114 @@
1
- #pragma once
2
- #include <string>
3
- #include <vector>
4
-
5
- #ifdef REANIMATED_PROFILING
6
-
7
- #if defined(__APPLE__)
8
- #include <os/trace_base.h>
9
-
10
- #if OS_LOG_TARGET_HAS_10_15_FEATURES
11
- #include <os/log.h>
12
- #include <os/signpost.h>
13
- #include <sstream>
14
- #endif // OS_LOG_TARGET_HAS_10_15_FEATURES
15
-
16
- #elif defined(ANDROID)
17
-
18
- #include <android/trace.h>
19
-
20
- #endif // defined(ANDROID)
21
-
22
- #endif // REANIMATED_PROFILING
23
-
24
- namespace reanimated {
25
-
26
- #if defined(ANDROID) && defined(REANIMATED_PROFILING)
27
-
28
- struct ReanimatedSystraceSection {
29
- public:
30
- template <typename... ConvertsToStringPiece>
31
- explicit ReanimatedSystraceSection(
32
- const char *name,
33
- ConvertsToStringPiece &&...args) {
34
- ATrace_beginSection(name);
35
- }
36
-
37
- ~ReanimatedSystraceSection() {
38
- ATrace_endSection();
39
- }
40
- };
41
-
42
- // The apple part is copied from React Native
43
- // from
44
- // https://github.com/facebook/react-native/blob/5697d923a05119314b4cfcd556cb243986637764/packages/react-native/ReactCommon/cxxreact/SystraceSection.h
45
- #elif defined(__APPLE__) && OS_LOG_TARGET_HAS_10_15_FEATURES && \
46
- defined(REANIMATED_PROFILING)
47
-
48
- template <typename T, typename = void>
49
- struct renderer {
50
- static std::string render(const T &t) {
51
- std::ostringstream oss;
52
- oss << t;
53
- return oss.str();
54
- }
55
- };
56
-
57
- template <typename T>
58
- static auto render(const T &t)
59
- -> decltype(renderer<T>::render(std::declval<const T &>())) {
60
- return renderer<T>::render(t);
61
- }
62
-
63
- inline os_log_t instrumentsLogHandle = nullptr;
64
-
65
- static inline os_log_t getOrCreateInstrumentsLogHandle() {
66
- if (!instrumentsLogHandle) {
67
- instrumentsLogHandle = os_log_create(
68
- "dev.reanimated.instruments", OS_LOG_CATEGORY_POINTS_OF_INTEREST);
69
- }
70
- return instrumentsLogHandle;
71
- }
72
-
73
- struct ReanimatedSystraceSection {
74
- public:
75
- template <typename... ConvertsToStringPiece>
76
- explicit ReanimatedSystraceSection(
77
- const char *name,
78
- ConvertsToStringPiece &&...args) {
79
- os_log_t instrumentsLogHandle =
80
- reanimated::getOrCreateInstrumentsLogHandle();
81
-
82
- // If the log isn't enabled, we don't want the performance overhead of the
83
- // rest of the code below.
84
- if (!os_signpost_enabled(instrumentsLogHandle)) {
85
- return;
86
- }
87
-
88
- name_ = name;
89
-
90
- const auto argsVector =
91
- std::vector<std::string>{reanimated::render(args)...};
92
- std::string argsString = "";
93
- for (size_t i = 0; i < argsVector.size(); i += 2) {
94
- argsString += argsVector[i] + "=" + argsVector[i + 1] + ";";
95
- }
96
-
97
- signpostID_ = os_signpost_id_make_with_pointer(instrumentsLogHandle, this);
98
-
99
- os_signpost_interval_begin(
100
- instrumentsLogHandle,
101
- signpostID_,
102
- "Reanimated",
103
- "%s begin: %s",
104
- name,
105
- argsString.c_str());
106
- }
107
-
108
- ~ReanimatedSystraceSection() {
109
- os_signpost_interval_end(
110
- reanimated::instrumentsLogHandle,
111
- signpostID_,
112
- "Reanimated",
113
- "%s end",
114
- name_.data());
115
- }
116
-
117
- private:
118
- os_signpost_id_t signpostID_ = OS_SIGNPOST_ID_INVALID;
119
- std::string_view name_;
120
- };
121
-
122
- #else
123
-
124
- struct ReanimatedSystraceSection {
125
- public:
126
- template <typename... ConvertsToStringPiece>
127
- explicit ReanimatedSystraceSection(
128
- const char *name,
129
- ConvertsToStringPiece &&...args) {}
130
- };
131
-
132
- #endif // defined(__APPLE__) && OS_LOG_TARGET_HAS_10_15_FEATURES &&
133
- // defined(REANIMATED_PROFILING)
134
-
135
- } // namespace reanimated
1
+ #pragma once
2
+ #include <string>
3
+ #include <vector>
4
+
5
+ #ifdef REANIMATED_PROFILING
6
+
7
+ #if defined(__APPLE__)
8
+ #include <os/trace_base.h>
9
+
10
+ #if OS_LOG_TARGET_HAS_10_15_FEATURES
11
+ #include <os/log.h>
12
+ #include <os/signpost.h>
13
+ #include <sstream>
14
+ #endif // OS_LOG_TARGET_HAS_10_15_FEATURES
15
+
16
+ #elif defined(ANDROID)
17
+
18
+ #include <android/trace.h>
19
+
20
+ #endif // defined(ANDROID)
21
+
22
+ #endif // REANIMATED_PROFILING
23
+
24
+ namespace reanimated {
25
+
26
+ #if defined(ANDROID) && defined(REANIMATED_PROFILING)
27
+
28
+ struct ReanimatedSystraceSection {
29
+ public:
30
+ template <typename... ConvertsToStringPiece>
31
+ explicit ReanimatedSystraceSection(const char *name, ConvertsToStringPiece &&...args) {
32
+ ATrace_beginSection(name);
33
+ }
34
+
35
+ ~ReanimatedSystraceSection() {
36
+ ATrace_endSection();
37
+ }
38
+ };
39
+
40
+ // The apple part is copied from React Native
41
+ // from
42
+ // https://github.com/facebook/react-native/blob/5697d923a05119314b4cfcd556cb243986637764/packages/react-native/ReactCommon/cxxreact/SystraceSection.h
43
+ #elif defined(__APPLE__) && OS_LOG_TARGET_HAS_10_15_FEATURES && defined(REANIMATED_PROFILING)
44
+
45
+ template <typename T, typename = void>
46
+ struct renderer {
47
+ static std::string render(const T &t) {
48
+ std::ostringstream oss;
49
+ oss << t;
50
+ return oss.str();
51
+ }
52
+ };
53
+
54
+ template <typename T>
55
+ static auto render(const T &t) -> decltype(renderer<T>::render(std::declval<const T &>())) {
56
+ return renderer<T>::render(t);
57
+ }
58
+
59
+ inline os_log_t instrumentsLogHandle = nullptr;
60
+
61
+ static inline os_log_t getOrCreateInstrumentsLogHandle() {
62
+ if (!instrumentsLogHandle) {
63
+ instrumentsLogHandle = os_log_create("dev.reanimated.instruments", OS_LOG_CATEGORY_POINTS_OF_INTEREST);
64
+ }
65
+ return instrumentsLogHandle;
66
+ }
67
+
68
+ struct ReanimatedSystraceSection {
69
+ public:
70
+ template <typename... ConvertsToStringPiece>
71
+ explicit ReanimatedSystraceSection(const char *name, ConvertsToStringPiece &&...args) {
72
+ os_log_t instrumentsLogHandle = reanimated::getOrCreateInstrumentsLogHandle();
73
+
74
+ // If the log isn't enabled, we don't want the performance overhead of the
75
+ // rest of the code below.
76
+ if (!os_signpost_enabled(instrumentsLogHandle)) {
77
+ return;
78
+ }
79
+
80
+ name_ = name;
81
+
82
+ const auto argsVector = std::vector<std::string>{reanimated::render(args)...};
83
+ std::string argsString = "";
84
+ for (size_t i = 0; i < argsVector.size(); i += 2) {
85
+ argsString += argsVector[i] + "=" + argsVector[i + 1] + ";";
86
+ }
87
+
88
+ signpostID_ = os_signpost_id_make_with_pointer(instrumentsLogHandle, this);
89
+
90
+ os_signpost_interval_begin(
91
+ instrumentsLogHandle, signpostID_, "Reanimated", "%s begin: %s", name, argsString.c_str());
92
+ }
93
+
94
+ ~ReanimatedSystraceSection() {
95
+ os_signpost_interval_end(reanimated::instrumentsLogHandle, signpostID_, "Reanimated", "%s end", name_.data());
96
+ }
97
+
98
+ private:
99
+ os_signpost_id_t signpostID_ = OS_SIGNPOST_ID_INVALID;
100
+ std::string_view name_;
101
+ };
102
+
103
+ #else
104
+
105
+ struct ReanimatedSystraceSection {
106
+ public:
107
+ template <typename... ConvertsToStringPiece>
108
+ explicit ReanimatedSystraceSection(const char *name, ConvertsToStringPiece &&...args) {}
109
+ };
110
+
111
+ #endif // defined(__APPLE__) && OS_LOG_TARGET_HAS_10_15_FEATURES && \
112
+ // defined(REANIMATED_PROFILING)
113
+
114
+ } // namespace reanimated
@@ -0,0 +1,46 @@
1
+ #include <reanimated/Tools/ReanimatedVersion.h>
2
+ #include <worklets/Tools/JSLogger.h>
3
+ #include <worklets/Tools/VersionUtils.h>
4
+
5
+ #include <memory>
6
+ #include <string>
7
+
8
+ #ifdef REANIMATED_VERSION
9
+ #define STRINGIZE(x) #x
10
+ #define STRINGIZE2(x) STRINGIZE(x)
11
+ #define REANIMATED_VERSION_STRING STRINGIZE2(REANIMATED_VERSION)
12
+ #endif // REANIMATED_VERSION
13
+
14
+ using namespace facebook;
15
+
16
+ namespace reanimated {
17
+
18
+ std::string getReanimatedCppVersion() {
19
+ return std::string(REANIMATED_VERSION_STRING);
20
+ }
21
+
22
+ void injectReanimatedCppVersion(jsi::Runtime &rnRuntime) {
23
+ auto version = getReanimatedCppVersion();
24
+ rnRuntime.global().setProperty(rnRuntime, "_REANIMATED_VERSION_CPP", jsi::String::createFromUtf8(rnRuntime, version));
25
+ }
26
+
27
+ #ifndef NDEBUG
28
+ void checkJSVersion(jsi::Runtime &rnRuntime, const std::shared_ptr<worklets::JSLogger> &jsLogger) {
29
+ auto cppVersion = getReanimatedCppVersion();
30
+ auto jsVersionValue = rnRuntime.global().getProperty(rnRuntime, "_REANIMATED_VERSION_JS");
31
+ worklets::checkJSVersion(
32
+ rnRuntime,
33
+ jsVersionValue,
34
+ jsLogger,
35
+ cppVersion,
36
+ "Reanimated",
37
+ "https://docs.swmansion.com/react-native-reanimated/");
38
+ }
39
+ #else
40
+ void checkJSVersion(jsi::Runtime &rnRuntime, const std::shared_ptr<worklets::JSLogger> &jsLogger) {
41
+ // In release builds we don't check the version, hence
42
+ // this function is a NOOP.
43
+ }
44
+ #endif // NDEBUG
45
+
46
+ }; // namespace reanimated
@@ -1,19 +1,18 @@
1
- #pragma once
2
-
3
- #include <worklets/Tools/JSLogger.h>
4
-
5
- #include <jsi/jsi.h>
6
-
7
- #include <memory>
8
- #include <string>
9
-
10
- using namespace facebook;
11
-
12
- namespace worklets {
13
-
14
- std::string getReanimatedCppVersion();
15
- void injectReanimatedCppVersion(jsi::Runtime &);
16
- bool matchVersion(const std::string &, const std::string &);
17
- void checkJSVersion(jsi::Runtime &, const std::shared_ptr<JSLogger> &);
18
-
19
- }; // namespace worklets
1
+ #pragma once
2
+
3
+ #include <worklets/Tools/JSLogger.h>
4
+
5
+ #include <jsi/jsi.h>
6
+
7
+ #include <memory>
8
+ #include <string>
9
+
10
+ using namespace facebook;
11
+
12
+ namespace reanimated {
13
+
14
+ std::string getReanimatedCppVersion();
15
+ void injectReanimatedCppVersion(jsi::Runtime &);
16
+ void checkJSVersion(jsi::Runtime &, const std::shared_ptr<worklets::JSLogger> &);
17
+
18
+ }; // namespace reanimated
@@ -5,6 +5,7 @@
5
5
  #include "RNOH/ArkTSTurboModule.h"
6
6
  #include "RNOH/RNInstance.h"
7
7
  #include "ReanimatedModule.h"
8
+ #include "ReanimatedSensorContainer.h"
8
9
  #include "ReanimatedUIScheduler.h"
9
10
  #include "PlatformDepMethodsHolder.h"
10
11
  #include "WorkletRuntimeCollector.h"
@@ -17,32 +18,25 @@ using namespace facebook;
17
18
  using namespace reanimated;
18
19
  using namespace worklets;
19
20
  namespace rnoh {
20
- static double getMillisSinceEpoch()
21
- {
21
+ static double getMillisSinceEpoch() {
22
22
  auto now = std::chrono::high_resolution_clock::now();
23
23
  auto frameTime = std::chrono::duration_cast<std::chrono::milliseconds>(now.time_since_epoch());
24
24
  return frameTime.count();
25
25
  }
26
26
 
27
27
  jsi::Value installTurboModule(facebook::jsi::Runtime &rt, react::TurboModule &turboModule,
28
- const facebook::jsi::Value *args, size_t count)
29
- {
28
+ const facebook::jsi::Value *args, size_t count) {
30
29
  auto self = static_cast<ReanimatedModule *>(&turboModule);
31
- if (self == nullptr) {
32
- return facebook::jsi::Value::undefined();
33
- }
34
30
  self->installTurboModule(rt);
35
31
  return facebook::jsi::Value(true);
36
32
  }
37
33
 
38
34
  ReanimatedModule::ReanimatedModule(const ArkTSTurboModule::Context ctx, const std::string name)
39
- : ArkTSTurboModule(ctx, name)
40
- {
41
- methodMap_ = { { "installTurboModule", { 0, rnoh::installTurboModule } } };
35
+ : ArkTSTurboModule(ctx, name) {
36
+ methodMap_ = {{"installTurboModule", {0, rnoh::installTurboModule}}};
42
37
  }
43
38
 
44
- ReanimatedModule::~ReanimatedModule()
45
- {
39
+ ReanimatedModule::~ReanimatedModule() {
46
40
  LOG(INFO) << "ReanimatedModule::~ReanimatedModule";
47
41
  if (eventListener) {
48
42
  m_ctx.scheduler->removeEventListener(eventListener);
@@ -52,14 +46,18 @@ ReanimatedModule::~ReanimatedModule()
52
46
  }
53
47
  }
54
48
 
55
- void ReanimatedModule::installTurboModule(facebook::jsi::Runtime &rt)
56
- {
57
- auto nodesManager = std::make_shared<ReanimatedNodesManager>(
58
- [weakExecutor = std::weak_ptr(m_ctx.taskExecutor)](TaskExecutor::Task &&task) {
59
- if (auto taskExecutor = weakExecutor.lock()) {
60
- taskExecutor->runTask(TaskThread::MAIN, std::move(task));
61
- }
62
- });
49
+ void ReanimatedModule::installTurboModule(facebook::jsi::Runtime &rt) {
50
+ if (!m_ctx.taskExecutor->isOnTaskThread(rnoh::TaskThread::JS)) {
51
+ DLOG(ERROR) << "react_worklets reanimated installTurboModule failed,because of current thread is not js;";
52
+ return;
53
+ }
54
+
55
+ auto runMainThreadFuc = [weakExecutor = std::weak_ptr(m_ctx.taskExecutor)](TaskExecutor::Task &&task) {
56
+ if (auto taskExecutor = weakExecutor.lock()) {
57
+ taskExecutor->runTask(TaskThread::MAIN, std::move(task));
58
+ }
59
+ };
60
+ auto nodesManager = std::make_shared<ReanimatedNodesManager>(runMainThreadFuc);
63
61
 
64
62
  auto maybeFlushUIUpdatesQueueFunction = [nodesManager]() { nodesManager->maybeFlushUIUpdatesQueue(); };
65
63
  auto requestRender = [weakSelf = weak_from_this(), nodesManager](std::function<void(double)> onRender) {
@@ -76,28 +74,37 @@ void ReanimatedModule::installTurboModule(facebook::jsi::Runtime &rt)
76
74
  });
77
75
  };
78
76
 
79
- auto progressLayoutAnimation = [=](jsi::Runtime &rt, int tag, const jsi::Object &newStyle,
80
- bool isSharedTransition) {
81
- // noop
82
- };
77
+ auto getAnimationTimestamp = getMillisSinceEpoch;
78
+
79
+ auto synchronouslyUpdateUIPropsFunction = [weakInstance = m_ctx.instance](Tag tag, const folly::dynamic &dynamic) {
80
+ auto instance = weakInstance.lock();
81
+ auto instanceCapi = std::dynamic_pointer_cast<RNInstanceCAPI>(instance);
82
+ if (!instanceCapi) {
83
+ return;
84
+ }
85
+ auto componentInstance = instanceCapi->findComponentInstanceByTag(tag);
86
+ if (!componentInstance) {
87
+ return;
88
+ }
83
89
 
84
- auto endLayoutAnimation = [=](int tag, bool removeView) {
85
- // noop
90
+ // We want to restore the ignored props after the update,
91
+ // because reanimated handles setting correct props on React renders on its own
92
+ auto ignoredProps = componentInstance->getIgnoredPropKeys();
93
+ instanceCapi->synchronouslyUpdateViewOnUIThread(tag, dynamic);
94
+ componentInstance->setIgnoredPropKeys(std::move(ignoredProps));
86
95
  };
96
+ auto sensorContainer = std::make_shared<ReanimatedSensorContainer>();
87
97
 
88
- auto getAnimationTimestamp = getMillisSinceEpoch;
89
98
 
90
- auto registerSensorFunction = [](int sensorType, int interval, int iosReferenceFrame,
91
- std::function<void(double[], int)> setter) -> int {
92
- // TODO
93
- return -1;
94
- };
95
- auto unregisterSensorFunction = [](int sensorId) {
96
- // TODO
99
+ auto registerSensorFunction = [sensorContainer,
100
+ runMainThreadFuc](int sensorType, int interval, int iosReferenceFrame,
101
+ std::function<void(double[], int)> setter) -> int {
102
+ return sensorContainer->registerSensor(sensorType, interval, iosReferenceFrame, setter, runMainThreadFuc);
97
103
  };
104
+ auto unregisterSensorFunction = [sensorContainer](int sensorId) { sensorContainer->unregisterSensor(sensorId); };
98
105
  auto subscribeForKeyboardEventsFunction =
99
106
  [weakSelf = weak_from_this()](std::function<void(int keyboardState, int height)> keyboardEventDataUpdater,
100
- bool isStatusBarTranslucent, bool isNavigationBarTranslucent) {
107
+ bool isStatusBarTranslucent, bool isNavigationBarTranslucent) {
101
108
  auto self = weakSelf.lock();
102
109
  if (!self) {
103
110
  return 0;
@@ -138,13 +145,13 @@ void ReanimatedModule::installTurboModule(facebook::jsi::Runtime &rt)
138
145
  auto napiTag = arkJs.createInt(handlerTag);
139
146
  auto napiState = arkJs.createInt(newState);
140
147
  auto napiTurboModuleObject = arkJs.getObject(self->m_ctx.arkTSTurboModuleInstanceRef);
141
- napiTurboModuleObject.call("setGestureHandlerState", { napiTag, napiState });
148
+ napiTurboModuleObject.call("setGestureHandlerState", {napiTag, napiState});
142
149
  };
150
+
143
151
  PlatformDepMethodsHolder platformDepMethodsHolder = {
144
152
  requestRender,
153
+ synchronouslyUpdateUIPropsFunction,
145
154
  getAnimationTimestamp,
146
- progressLayoutAnimation,
147
- endLayoutAnimation,
148
155
  registerSensorFunction,
149
156
  unregisterSensorFunction,
150
157
  setGestureStateFunction,
@@ -152,8 +159,7 @@ void ReanimatedModule::installTurboModule(facebook::jsi::Runtime &rt)
152
159
  unsubscribeFromKeyboardEventsFunction,
153
160
  maybeFlushUIUpdatesQueueFunction,
154
161
  };
155
- auto isReducedMotion = false;
156
- auto isBridgeless = true;
162
+ auto isReducedMotion = false; // ANIMATOR_DURATION_SCALE
157
163
  auto workletsModule = [weakSelf = weak_from_this()]() -> std::shared_ptr<WorkletsModule> {
158
164
  auto self = weakSelf.lock();
159
165
  if (!self) {
@@ -165,44 +171,28 @@ void ReanimatedModule::installTurboModule(facebook::jsi::Runtime &rt)
165
171
  }
166
172
  return instance->getTurboModule<WorkletsModule>("WorkletsModule");
167
173
  };
168
- auto workletsModulePtr = workletsModule();
169
- if (!workletsModulePtr) {
170
- LOG(ERROR) << "ReanimatedModule: Failed to get WorkletsModule";
171
- return;
172
- }
173
- auto workletsModuleProxy = workletsModulePtr->getWorkletsModuleProxy();
174
- if (!workletsModuleProxy) {
175
- LOG(ERROR) << "ReanimatedModule: WorkletsModuleProxy is null, WorkletsModule may not be initialized yet";
176
- return;
177
- }
178
- if (!jsInvoker_) {
179
- LOG(ERROR) << "ReanimatedModule: jsInvoker_ is null";
180
- return;
181
- }
182
- if (!m_ctx.scheduler) {
183
- LOG(ERROR) << "ReanimatedModule: m_ctx.scheduler is null";
184
- return;
185
- }
186
- auto nativeReanimatedModule = std::make_shared<ReanimatedModuleProxy>(workletsModuleProxy,
187
- rt, jsInvoker_, platformDepMethodsHolder, isBridgeless, isReducedMotion);
188
- weakNativeReanimatedModule_ = nativeReanimatedModule;
189
- nativeReanimatedModule->init(platformDepMethodsHolder);
174
+ auto reanimatedModuleProxy = std::make_shared<ReanimatedModuleProxy>(
175
+ workletsModule()->getWorkletsModuleProxy(), rt, jsInvoker_, platformDepMethodsHolder, isReducedMotion);
176
+ reanimatedModuleProxy->init(platformDepMethodsHolder);
177
+ weakNativeReanimatedModule_ = reanimatedModuleProxy;
178
+
190
179
  ReanimatedPerformOperations reanimatedPerformOperations = [weakNativeReanimatedModule =
191
180
  weakNativeReanimatedModule_]() {
192
181
  if (auto nativeReanimatedModule = weakNativeReanimatedModule.lock()) {
193
- nativeReanimatedModule->performOperations();
182
+ nativeReanimatedModule->performOperations(false);
194
183
  }
195
184
  };
196
185
  nodesManager->registerPerformOperations(reanimatedPerformOperations);
197
186
 
198
187
  WorkletRuntimeCollector::install(rt);
188
+ auto &uiRuntime = workletsModule()->getWorkletsModuleProxy()->getUIWorkletRuntime()->getJSIRuntime();
199
189
 
200
- RNRuntimeDecorator::decorate(rt, nativeReanimatedModule);
190
+ RNRuntimeDecorator::decorate(rt, uiRuntime, reanimatedModuleProxy);
201
191
  injectDependencies(rt);
202
192
 
203
- eventListener =
204
- std::make_shared<facebook::react::EventListener>([weakNativeReanimatedModule = weakNativeReanimatedModule_,
205
- weakTaskExecutor = std::weak_ptr{ m_ctx.taskExecutor }](facebook::react::RawEvent const & rawEvent) {
193
+ eventListener = std::make_shared<facebook::react::EventListener>(
194
+ [weakNativeReanimatedModule = weakNativeReanimatedModule_,
195
+ weakTaskExecutor = std::weak_ptr{m_ctx.taskExecutor}](facebook::react::RawEvent const &rawEvent) {
206
196
  auto taskExecutor = weakTaskExecutor.lock();
207
197
  auto nativeReanimatedModule = weakNativeReanimatedModule.lock();
208
198
  if (!nativeReanimatedModule || !taskExecutor || !taskExecutor->isOnTaskThread(TaskThread::MAIN)) {
@@ -224,31 +214,16 @@ void ReanimatedModule::installTurboModule(facebook::jsi::Runtime &rt)
224
214
  }
225
215
  return nativeReanimatedModule->handleRawEvent(rawEvent, frameTime);
226
216
  });
227
- if (m_ctx.scheduler) {
228
- m_ctx.scheduler->addEventListener(eventListener);
229
- } else {
230
- LOG(ERROR) << "ReanimatedModule: Cannot add event listener, scheduler is null";
231
- }
217
+ m_ctx.scheduler->addEventListener(eventListener);
232
218
  }
233
-
234
- void ReanimatedModule::injectDependencies(facebook::jsi::Runtime & /* rt */)
235
- {
236
- if (!m_ctx.scheduler) {
237
- LOG(ERROR) << "ReanimatedModule::injectDependencies: scheduler is null";
238
- return;
239
- }
219
+ void ReanimatedModule::injectDependencies(facebook::jsi::Runtime & /* rt */) {
240
220
  const auto uiManager = m_ctx.scheduler->getUIManager();
241
- if (!uiManager) {
242
- LOG(WARNING) << "ReanimatedModule::injectDependencies: uiManager is null";
243
- return;
244
- }
245
221
  if (auto nativeReanimatedModule = weakNativeReanimatedModule_.lock()) {
246
222
  nativeReanimatedModule->initializeFabric(uiManager);
247
223
  }
248
224
  }
249
225
 
250
- void ReanimatedModule::callKeyBord(double height, int status)
251
- {
226
+ void ReanimatedModule::callKeyBord(double height, int status) {
252
227
  if (keyboardEventDataUpdater_) {
253
228
  keyboardEventDataUpdater_(status, height);
254
229
  }
@@ -28,6 +28,7 @@ void ReanimatedNodesManager::registerPerformOperations(ReanimatedPerformOperatio
28
28
 
29
29
  void ReanimatedNodesManager::postOnAnimation(ReanimatedOnAnimationCallback callback)
30
30
  {
31
+ LOG(INFO)<<"react_work reanimated------>postOnAnimation";
31
32
  onAnimationCallbacks.push_back(std::move(callback));
32
33
  m_vsyncHandle.requestFrame(vsyncHandleCallback, this);
33
34
  }
@@ -4,7 +4,6 @@
4
4
 
5
5
  #include "ReanimatedPackage.h"
6
6
  #include "ReanimatedModule.h"
7
- #include "WorkletsModule.h"
8
7
 
9
8
  using namespace rnoh;
10
9
  using namespace facebook;
@@ -15,8 +14,6 @@ public:
15
14
  {
16
15
  if (name == "ReanimatedModule") {
17
16
  return std::make_shared<ReanimatedModule>(ctx, name);
18
- } else if (name == "WorkletsModule") {
19
- return std::make_shared<worklets::WorkletsModule>(ctx, name);
20
17
  }
21
18
  return nullptr;
22
19
  };