@react-native-ohos/react-native-reanimated 3.18.1-rc.6 → 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 (275) hide show
  1. package/compatibility.json +161 -0
  2. package/harmony/reanimated/BuildProfile.ets +1 -1
  3. package/harmony/reanimated/build-profile.json5 +8 -1
  4. package/harmony/reanimated/oh-package.json5 +3 -2
  5. package/harmony/reanimated/src/main/cpp/CMakeLists.txt +31 -40
  6. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/AnimatedSensor/AnimatedSensorModule.cpp +11 -16
  7. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/AnimatedSensor/AnimatedSensorModule.h +3 -4
  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 +51 -39
  158. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/ReanimatedCommitHook.h +13 -15
  159. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/ReanimatedCommitShadowNode.h +0 -3
  160. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/ReanimatedMountHook.cpp +22 -53
  161. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/ReanimatedMountHook.h +12 -8
  162. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/ShadowTreeCloner.cpp +46 -37
  163. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/ShadowTreeCloner.h +3 -10
  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 +4 -2
  171. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsManager.cpp +62 -157
  172. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsManager.h +38 -46
  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} +303 -276
  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 +5 -65
  180. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsUtils.h +52 -82
  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 +957 -552
  187. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/NativeModules/ReanimatedModuleProxy.h +87 -111
  188. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/NativeModules/ReanimatedModuleProxySpec.cpp +115 -163
  189. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/NativeModules/ReanimatedModuleProxySpec.h +38 -54
  190. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/RuntimeDecorators/RNRuntimeDecorator.cpp +34 -36
  191. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/RuntimeDecorators/RNRuntimeDecorator.h +8 -0
  192. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/RuntimeDecorators/UIRuntimeDecorator.cpp +46 -58
  193. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/RuntimeDecorators/UIRuntimeDecorator.h +5 -9
  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 +26 -57
  197. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Tools/ReanimatedSystraceSection.h +12 -33
  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 +3 -4
  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 +12 -1
  209. package/harmony/reanimated/src/main/ets/ReanimatedPackage.ts +1 -4
  210. package/harmony/reanimated.har +0 -0
  211. package/package.json +36 -18
  212. package/scripts/deploy.js +191 -0
  213. package/scripts/set-reanimated-version.js +37 -0
  214. package/scripts/update-version.js +119 -0
  215. package/scripts/validate-react-native-version.js +46 -0
  216. package/scripts/validate-worklets-build.js +17 -0
  217. package/scripts/validate-worklets-version.js +79 -0
  218. package/scripts/worklets-version.json +4 -0
  219. package/LICENSE +0 -21
  220. package/README.OpenSource +0 -11
  221. package/README.md +0 -10
  222. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/PropsRegistry.cpp +0 -68
  223. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/PropsRegistry.h +0 -68
  224. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxy.h +0 -147
  225. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Tools/CollectionUtils.h +0 -14
  226. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Tools/FeaturesConfig.cpp +0 -5
  227. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Tools/FeaturesConfig.h +0 -19
  228. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/NativeModules/WorkletsModuleProxy.cpp +0 -47
  229. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/NativeModules/WorkletsModuleProxy.h +0 -59
  230. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/NativeModules/WorkletsModuleProxySpec.cpp +0 -27
  231. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/NativeModules/WorkletsModuleProxySpec.h +0 -25
  232. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Registries/EventHandlerRegistry.cpp +0 -94
  233. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Registries/EventHandlerRegistry.h +0 -49
  234. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Registries/WorkletRuntimeRegistry.cpp +0 -8
  235. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Registries/WorkletRuntimeRegistry.h +0 -39
  236. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/SharedItems/Shareables.cpp +0 -326
  237. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/SharedItems/Shareables.h +0 -345
  238. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/AsyncQueue.cpp +0 -52
  239. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/AsyncQueue.h +0 -35
  240. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/Defs.h +0 -10
  241. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/JSISerializer.cpp +0 -342
  242. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/JSISerializer.h +0 -47
  243. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/JSLogger.cpp +0 -16
  244. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/JSLogger.h +0 -20
  245. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/JSScheduler.cpp +0 -20
  246. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/JSScheduler.h +0 -29
  247. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/PlatformLogger.h +0 -16
  248. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/ReanimatedJSIUtils.cpp +0 -26
  249. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/ReanimatedJSIUtils.h +0 -199
  250. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/ReanimatedVersion.cpp +0 -95
  251. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/SingleInstanceChecker.h +0 -72
  252. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/ThreadSafeQueue.h +0 -49
  253. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/UIScheduler.cpp +0 -20
  254. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/UIScheduler.h +0 -22
  255. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/WorkletEventHandler.cpp +0 -29
  256. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/WorkletEventHandler.h +0 -41
  257. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/RNRuntimeWorkletDecorator.cpp +0 -16
  258. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/RNRuntimeWorkletDecorator.h +0 -19
  259. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/ReanimatedHermesRuntime.cpp +0 -112
  260. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/ReanimatedHermesRuntime.h +0 -127
  261. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/ReanimatedRuntime.cpp +0 -53
  262. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/ReanimatedRuntime.h +0 -22
  263. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/RuntimeInitialization.md +0 -191
  264. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/WorkletRuntime.cpp +0 -155
  265. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/WorkletRuntime.h +0 -90
  266. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/WorkletRuntimeCollector.h +0 -36
  267. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/WorkletRuntimeDecorator.cpp +0 -182
  268. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/WorkletRuntimeDecorator.h +0 -22
  269. package/harmony/reanimated/src/main/cpp/ReanimatedLogger.cpp +0 -33
  270. package/harmony/reanimated/src/main/cpp/WorkletsModule.cpp +0 -61
  271. package/harmony/reanimated/src/main/cpp/WorkletsModule.h +0 -22
  272. package/harmony/reanimated/src/main/cpp/patches/AnimatedSensor/AnimatedSensorModule.cpp +0 -89
  273. package/harmony/reanimated/src/main/cpp/patches/Fabric/ShadowTreeCloner.cpp +0 -95
  274. package/harmony/reanimated/src/main/cpp/patches/NativeModules/ReanimatedModuleProxy.cpp +0 -964
  275. package/harmony/reanimated/src/main/ets/WorkletsModule.ts +0 -15
@@ -0,0 +1,266 @@
1
+ // Copyright (c) 2025 Huawei Device Co., Ltd. All rights reserved
2
+ // Use of this source code is governed by a MIT license that can be
3
+ // found in the LICENSE file.
4
+
5
+ #include "ReanimatedSensor.h"
6
+ #include "glog/logging.h"
7
+ #include <sensors/oh_sensor.h>
8
+ #include <window_manager/oh_display_info.h>
9
+ #include <window_manager/oh_display_manager.h>
10
+ namespace rnoh {
11
+ static std::unordered_map<Sensor_Type, ReanimatedSensor *> g_sensorSubscriberMap_;
12
+ static std::mutex g_subscriberMapMutex_; // 保护映射表的互斥锁
13
+
14
+ void SensorDataCallbackImpl(Sensor_Event *event) {
15
+ if (event == nullptr) {
16
+ return;
17
+ }
18
+ int64_t timestamp = -1;
19
+ // 获取传感器数据的时间戳。
20
+ int32_t ret = OH_SensorEvent_GetTimestamp(event, &timestamp);
21
+ if (ret != SENSOR_SUCCESS) {
22
+ return;
23
+ }
24
+ Sensor_Type sensorType;
25
+ // 获取传感器类型。
26
+ ret = OH_SensorEvent_GetType(event, &sensorType);
27
+ if (ret != SENSOR_SUCCESS) {
28
+ return;
29
+ }
30
+ Sensor_Accuracy accuracy = SENSOR_ACCURACY_UNRELIABLE;
31
+ // 获取传感器数据的精度。
32
+ ret = OH_SensorEvent_GetAccuracy(event, &accuracy);
33
+ if (ret != SENSOR_SUCCESS) {
34
+ return;
35
+ }
36
+ float *data = nullptr;
37
+ uint32_t length = 0;
38
+ // 获取传感器数据。
39
+ ret = OH_SensorEvent_GetData(event, &data, &length);
40
+ if (ret != SENSOR_SUCCESS || data == nullptr) {
41
+ return;
42
+ }
43
+
44
+ std::lock_guard<std::mutex> lock(g_subscriberMapMutex_);
45
+ auto it = g_sensorSubscriberMap_.find(sensorType);
46
+ if (it == g_sensorSubscriberMap_.end()) {
47
+ return;
48
+ }
49
+ ReanimatedSensor *sensorInstance = it->second;
50
+ if (sensorInstance == nullptr) {
51
+ return;
52
+ }
53
+
54
+ switch (sensorType) {
55
+ case SENSOR_TYPE_ACCELEROMETER: {
56
+ double sendData[] = {
57
+ data[0],
58
+ data[1],
59
+ data[2],
60
+ };
61
+ sensorInstance->runSensor(sendData);
62
+ return;
63
+ }
64
+ case SENSOR_TYPE_GYROSCOPE: {
65
+ double sendData[] = {
66
+ data[0],
67
+ data[1],
68
+ data[2],
69
+ };
70
+ sensorInstance->runSensor(sendData);
71
+ return;
72
+ }
73
+ case SENSOR_TYPE_GRAVITY: {
74
+ double sendData[] = {
75
+ data[0],
76
+ data[1],
77
+ data[2],
78
+ };
79
+ sensorInstance->runSensor(sendData);
80
+ return;
81
+ }
82
+ case SENSOR_TYPE_MAGNETIC_FIELD: {
83
+ double sendData[] = {
84
+ data[0],
85
+ data[1],
86
+ data[2],
87
+ };
88
+ sensorInstance->runSensor(sendData);
89
+ return;
90
+ }
91
+ case SENSOR_TYPE_ROTATION_VECTOR: {
92
+ double sendData[] = {
93
+ data[0], // x
94
+ data[1], // y
95
+ data[2], // z
96
+ data[3], // w
97
+ // ios
98
+ 0, // yaw
99
+ 0, // pitch
100
+ 0 // roll
101
+ };
102
+ sensorInstance->runSensor(sendData);
103
+ return;
104
+ }
105
+ default:
106
+ return;
107
+ }
108
+ }
109
+
110
+
111
+ rnoh::ReanimatedSensor::ReanimatedSensor(int sensorType, int interval, int iosReferenceFrame,
112
+ std::function<void(double *, int)> setter,
113
+ std::function<void(TaskExecutor::Task &&)> runOnTheMainThread)
114
+ : iosReferenceFrame_(iosReferenceFrame), setter_(std::move(setter)),
115
+ runOnTheMainThread_(std::move(runOnTheMainThread)) {
116
+ if (interval == -1) {
117
+ uint32_t refreshRate = 0;
118
+ OH_NativeDisplayManager_GetDefaultDisplayRefreshRate(&refreshRate);
119
+ if (refreshRate > 0) {
120
+ interval_ = refreshRate * 1000000; // 120hz;
121
+ } else {
122
+ interval_ = 200000000;
123
+ }
124
+ } else {
125
+ // js unit is milliseconds
126
+ interval_ = interval * 1000000;
127
+ }
128
+ castSensorType(sensorType);
129
+ }
130
+
131
+
132
+ void rnoh::ReanimatedSensor::castSensorType(int sensorType) {
133
+ if (sensorType == 1) {
134
+ sensorType_ = SENSOR_TYPE_ACCELEROMETER;
135
+ } else if (sensorType == 2) {
136
+ sensorType_ = SENSOR_TYPE_GYROSCOPE;
137
+ } else if (sensorType == 3) {
138
+ sensorType_ = SENSOR_TYPE_GRAVITY;
139
+ } else if (sensorType == 4) {
140
+ sensorType_ = SENSOR_TYPE_MAGNETIC_FIELD;
141
+ } else if (sensorType == 5) {
142
+ sensorType_ = SENSOR_TYPE_ROTATION_VECTOR;
143
+ } else {
144
+ throw std::invalid_argument("[ReanimatedSensor] Unknown sensorType: " + sensorType);
145
+ }
146
+ }
147
+
148
+ bool rnoh::ReanimatedSensor::initialize() {
149
+ if (!isSupportSensor()) {
150
+ LOG(ERROR) << "[ReanimatedSensor] is not support, sensorType:" << sensorType_;
151
+ return false;
152
+ }
153
+ id_ = OH_Sensor_CreateSubscriptionId();
154
+ if (id_ == nullptr) {
155
+ LOG(ERROR) << "[ReanimatedSensor] create sensor id failed";
156
+ return false;
157
+ }
158
+ int32_t res = OH_SensorSubscriptionId_SetType(id_, sensorType_);
159
+ if (res != SENSOR_SUCCESS) {
160
+ LOG(ERROR) << "[ReanimatedSensor] set sensor type failed ,sensorType:" << sensorType_;
161
+ return false;
162
+ }
163
+ auto attr = OH_Sensor_CreateSubscriptionAttribute();
164
+ if (attr == nullptr) {
165
+ LOG(ERROR) << "[ReanimatedSensor] create sensor attribute failed";
166
+ return false;
167
+ }
168
+
169
+ res = OH_SensorSubscriptionAttribute_SetSamplingInterval(attr, interval_);
170
+ if (res != SENSOR_SUCCESS) {
171
+ LOG(ERROR) << "[ReanimatedSensor] set sensor Interval failed, interval_:" << interval_;
172
+ return false;
173
+ }
174
+
175
+ subSensor_ = OH_Sensor_CreateSubscriber();
176
+
177
+ {
178
+ std::lock_guard<std::mutex> lock(g_subscriberMapMutex_);
179
+ g_sensorSubscriberMap_[sensorType_] = this;
180
+ }
181
+
182
+ int32_t ret = OH_SensorSubscriber_SetCallback(subSensor_, SensorDataCallbackImpl);
183
+ if (ret != SENSOR_SUCCESS) {
184
+ LOG(ERROR) << "[ReanimatedSensor] set sensor callback failed";
185
+ return false;
186
+ }
187
+ Sensor_Result sensorRes = OH_Sensor_Subscribe(id_, attr, subSensor_);
188
+ if (sensorRes != SENSOR_SUCCESS) {
189
+ LOG(ERROR) << "[ReanimatedSensor] on sensor subscribe failed";
190
+ return false;
191
+ }
192
+ return true;
193
+ }
194
+
195
+
196
+ bool rnoh::ReanimatedSensor::isSupportSensor() {
197
+ uint32_t count = 0;
198
+ int32_t ret = OH_Sensor_GetInfos(nullptr, &count);
199
+ bool isSupport = false;
200
+ if (count > 0) {
201
+ Sensor_Info **sensors = OH_Sensor_CreateInfos(count);
202
+ ret = OH_Sensor_GetInfos(sensors, &count);
203
+ for (uint32_t i = 0; i < count; ++i) {
204
+ Sensor_Info *sensorInfoTemp = sensors[i];
205
+ Sensor_Type sensorType;
206
+ ret = OH_SensorInfo_GetType(sensorInfoTemp, &sensorType);
207
+ if (sensorType == sensorType_) {
208
+ isSupport = true;
209
+ break;
210
+ }
211
+ }
212
+ ret = OH_Sensor_DestroyInfos(sensors, count);
213
+ }
214
+ return isSupport;
215
+ }
216
+
217
+ void rnoh::ReanimatedSensor::runSensor(double *value) {
218
+ if (value && setter_ && runOnTheMainThread_) {
219
+ runOnTheMainThread_([weakSelf = weak_from_this(), value]() {
220
+ auto self = weakSelf.lock();
221
+ if (!self) {
222
+ return;
223
+ }
224
+ self->setter_(value, self->getInterfaceOrientation());
225
+ });
226
+ }
227
+ }
228
+
229
+ int rnoh::ReanimatedSensor::getInterfaceOrientation() {
230
+ NativeDisplayManager_Rotation rotation;
231
+ auto ret = OH_NativeDisplayManager_GetDefaultDisplayRotation(&rotation);
232
+ if (ret == DISPLAY_MANAGER_OK) {
233
+ switch (rotation) {
234
+ case DISPLAY_MANAGER_ROTATION_270:
235
+ return 270;
236
+ case DISPLAY_MANAGER_ROTATION_90:
237
+ return 90;
238
+ case DISPLAY_MANAGER_ROTATION_180:
239
+ return 180;
240
+ default:
241
+ return 0;
242
+ }
243
+ }
244
+ return 0;
245
+ }
246
+
247
+
248
+ void rnoh::ReanimatedSensor::cancel() { destroySensor(); }
249
+
250
+ void rnoh::ReanimatedSensor::destroySensor() {
251
+ std::lock_guard<std::mutex> lock(g_subscriberMapMutex_);
252
+ for (auto it = g_sensorSubscriberMap_.begin(); it != g_sensorSubscriberMap_.end();) {
253
+ if (it->second == this) {
254
+ OH_Sensor_Unsubscribe(it->second->id_, it->second->subSensor_);
255
+ OH_Sensor_DestroySubscriptionId(it->second->id_);
256
+ OH_Sensor_DestroySubscriber(it->second->subSensor_);
257
+ it->second->subSensor_ = nullptr;
258
+ it = g_sensorSubscriberMap_.erase(it);
259
+ } else {
260
+ ++it;
261
+ }
262
+ }
263
+ }
264
+
265
+ rnoh::ReanimatedSensor::~ReanimatedSensor() { destroySensor(); }
266
+ }
@@ -0,0 +1,36 @@
1
+ // Copyright (c) 2025 Huawei Device Co., Ltd. All rights reserved
2
+ // Use of this source code is governed by a MIT license that can be
3
+ // found in the LICENSE file.
4
+
5
+ #ifndef HARMONY_REANIMATEDSENSOR_H
6
+ #define HARMONY_REANIMATEDSENSOR_H
7
+ #include <functional>
8
+ #include <mutex>
9
+ #include <sensors/oh_sensor_type.h>
10
+ #include "RNOH/TaskExecutor/TaskExecutor.h"
11
+
12
+ namespace rnoh {
13
+ class ReanimatedSensor : public std::enable_shared_from_this<ReanimatedSensor> {
14
+ public:
15
+ ReanimatedSensor(int sensorType, int interval, int iosReferenceFrame, std::function<void(double[], int)> setter,
16
+ std::function<void(TaskExecutor::Task &&)> runOnTheMainThread);
17
+ ~ReanimatedSensor();
18
+ bool initialize();
19
+ void cancel();
20
+ void castSensorType(int sensorType);
21
+ void runSensor(double *value);
22
+ std::function<void(double[], int)> setter_;
23
+ Sensor_Type sensorType_{SENSOR_TYPE_ACCELEROMETER};
24
+
25
+ private:
26
+ void destroySensor();
27
+ bool isSupportSensor();
28
+ int getInterfaceOrientation();
29
+ int interval_{-1};
30
+ int iosReferenceFrame_{-1};
31
+ Sensor_Subscriber *subSensor_{nullptr};
32
+ Sensor_SubscriptionId *id_{nullptr};
33
+ std::function<void(TaskExecutor::Task &&)> runOnTheMainThread_;
34
+ };
35
+ } // namespace rnoh
36
+ #endif // HARMONY_REANIMATEDSENSOR_H
@@ -0,0 +1,36 @@
1
+ // Copyright (c) 2025 Huawei Device Co., Ltd. All rights reserved
2
+ // Use of this source code is governed by a MIT license that can be
3
+ // found in the LICENSE file.
4
+
5
+ #include "ReanimatedSensorContainer.h"
6
+ #include "glog/logging.h"
7
+ namespace rnoh {
8
+
9
+ rnoh::ReanimatedSensorContainer::ReanimatedSensorContainer() {}
10
+
11
+ int rnoh::ReanimatedSensorContainer::registerSensor(int sensorType, int interval, int iosReferenceFrame,
12
+ std::function<void(double *, int)> setter,
13
+ std::function<void(TaskExecutor::Task &&)> runOnTheMainThread) {
14
+ auto sensor =
15
+ std::make_shared<ReanimatedSensor>(sensorType, interval, iosReferenceFrame, setter, runOnTheMainThread);
16
+ int sensorId = -1;
17
+ if (sensor->initialize()) {
18
+ sensorId = nextSensorId;
19
+ nextSensorId++;
20
+ sensorMap_[sensorId] = sensor;
21
+ }
22
+ return sensorId;
23
+ }
24
+
25
+ void rnoh::ReanimatedSensorContainer::unregisterSensor(int sensorId) {
26
+ auto it = sensorMap_.find(sensorId);
27
+ if (it == sensorMap_.end()) {
28
+ return;
29
+ }
30
+ auto sensor = it->second;
31
+ if (sensor != nullptr) {
32
+ sensor->cancel();
33
+ sensorMap_.erase(it);
34
+ }
35
+ }
36
+ }
@@ -0,0 +1,23 @@
1
+ // Copyright (c) 2025 Huawei Device Co., Ltd. All rights reserved
2
+ // Use of this source code is governed by a MIT license that can be
3
+ // found in the LICENSE file.
4
+
5
+ #ifndef HARMONY_REANIMATEDSENSORCONTAINER_H
6
+ #define HARMONY_REANIMATEDSENSORCONTAINER_H
7
+ #include "ReanimatedSensor.h"
8
+ #include <functional>
9
+ namespace rnoh {
10
+ class ReanimatedSensorContainer {
11
+ public:
12
+ ReanimatedSensorContainer();
13
+ ~ReanimatedSensorContainer() noexcept = default;
14
+ int registerSensor(int sensorType, int interval, int iosReferenceFrame, std::function<void(double[], int)> setter,
15
+ std::function<void(TaskExecutor::Task &&)> runOnTheMainThread);
16
+ void unregisterSensor(int sensorId);
17
+
18
+ private:
19
+ std::unordered_map<int, std::shared_ptr<ReanimatedSensor>> sensorMap_;
20
+ int nextSensorId{0};
21
+ };
22
+ } // namespace rnoh
23
+ #endif // HARMONY_REANIMATEDSENSORCONTAINER_H
@@ -4,17 +4,17 @@
4
4
 
5
5
  #pragma once
6
6
  #include <functional>
7
- #include <UIScheduler.h>
7
+ //#include <UIScheduler.h>
8
8
  #include <memory>
9
9
  #include "RNOH/TaskExecutor/TaskExecutor.h"
10
10
 
11
11
  namespace rnoh {
12
- class ReanimatedUIScheduler : public std::enable_shared_from_this<ReanimatedUIScheduler>, public worklets::UIScheduler {
12
+ class ReanimatedUIScheduler : public std::enable_shared_from_this<ReanimatedUIScheduler> { //, public worklets::UIScheduler
13
13
  private:
14
14
  std::shared_ptr<TaskExecutor> m_taskExecutor;
15
15
 
16
16
  public:
17
17
  ReanimatedUIScheduler(std::shared_ptr<TaskExecutor> taskExecutor);
18
- void scheduleOnUI(std::function<void()> job) override;
18
+ void scheduleOnUI(std::function<void()> job) ; //override
19
19
  };
20
20
  } // namespace rnoh
@@ -5,18 +5,22 @@
5
5
  import { RNOHLogger, Tag, UITurboModule, UITurboModuleContext } from "@rnoh/react-native-openharmony/ts";
6
6
  import { window } from '@kit.ArkUI';
7
7
  import { AnimationManager } from './AnimationManager'
8
+ import settings from '@ohos.settings';
9
+ import { } from "@ohos.display"
8
10
 
9
11
  export class ReanimatedModule extends UITurboModule {
10
12
  static NAME = "ReanimatedModule"
11
13
  private logger: RNOHLogger
12
14
  private keyBordHeight = 0;
13
15
 
14
- constructor(ctx: UITurboModuleContext) {
16
+ constructor(ctx: UITurboModuleContext) {
15
17
  super(ctx);
16
18
  this.logger = ctx.logger.clone("Reanimated");
17
19
  }
20
+
18
21
  public setViewProps(tag: Tag, props: Object) {
19
22
  this.ctx.descriptorRegistry.setAnimatedRawProps(tag, props);
23
+
20
24
  }
21
25
 
22
26
  public async subscribeKeyBordListeners() {
@@ -38,4 +42,11 @@ export class ReanimatedModule extends UITurboModule {
38
42
  windowInstance.off('keyboardHeightChange', (v) => {
39
43
  })
40
44
  }
45
+
46
+ public setGestureHandlerState(handlerTag: Tag, newState: number) {
47
+ const module = this.ctx.rnInstance.getTurboModule("RNGestureHandlerModule") as any;
48
+ if (module && module.setGestureHandlerState) {
49
+ module.setGestureHandlerState(handlerTag, newState);
50
+ }
51
+ }
41
52
  }
@@ -5,20 +5,17 @@
5
5
  import { RNPackage, UITurboModuleContext, TurboModulesFactory } from "@rnoh/react-native-openharmony/ts";
6
6
  import type { UITurboModule } from "@rnoh/react-native-openharmony/ts";
7
7
  import { ReanimatedModule } from './ReanimatedModule';
8
- import { WorkletsModule } from './WorkletsModule';
9
8
 
10
9
  class ReanimatedTurboModulesFactory extends TurboModulesFactory {
11
10
  createTurboModule(name: string): UITurboModule | null {
12
11
  if (name === ReanimatedModule.NAME) {
13
12
  return new ReanimatedModule(this.ctx);
14
- } else if (name === WorkletsModule.NAME) {
15
- return new WorkletsModule(this.ctx);
16
13
  }
17
14
  return null;
18
15
  }
19
16
 
20
17
  hasTurboModule(name: string): boolean {
21
- return name === 'ReanimatedModule' || name === 'WorkletsModule';
18
+ return name === 'ReanimatedModule';
22
19
  }
23
20
  }
24
21
 
Binary file
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "alias": "react-native-reanimated",
5
5
  "redirectInternalImports": true
6
6
  },
7
- "version": "3.18.1-rc.6",
7
+ "version": "4.0.0-rc.1",
8
8
  "description": "",
9
9
  "main": "lib/index.js",
10
10
  "scripts": {
@@ -18,33 +18,51 @@
18
18
  "peerDependencies": {
19
19
  "react": "*",
20
20
  "react-native": "*",
21
- "react-native-harmony": "*",
22
- "react-native-reanimated": "3.18.0"
21
+ "react-native-reanimated": "4.2.1"
23
22
  },
24
23
  "author": "",
25
24
  "license": "ISC",
26
25
  "dependencies": {
27
- "@types/node": "^20.11.4",
28
- "react-native-reanimated": "3.18.0"
26
+ "@types/node": "^24.0.14",
27
+ "react-native-reanimated": "4.2.1"
29
28
  },
30
29
  "devDependencies": {
31
- "@babel/cli": "^7.23.4",
32
- "@babel/core": "^7.23.7",
33
- "@babel/preset-env": "^7.23.8",
34
- "@babel/preset-typescript": "^7.23.3",
35
- "@babel/runtime": "^7.23.8",
36
- "@types/invariant": "^2.2.35",
37
- "@types/react": "^18.2.15",
38
- "metro-react-native-babel-preset": "^0.77.0",
39
- "react": "18.3.1",
40
- "react-native": "0.77.1",
41
- "react-native-builder-bob": "^0.21.3",
42
- "typescript": "^5.1.6"
30
+ "@babel/core": "7.28.4",
31
+ "@babel/preset-env": "7.28.3",
32
+ "@react-native/babel-preset": "0.82.0",
33
+ "@react-native/eslint-config": "0.82.0",
34
+ "@react-native/metro-config": "0.82.0",
35
+ "@react-native/typescript-config": "0.82.0",
36
+ "@testing-library/jest-native": "5.4.3",
37
+ "@testing-library/react-hooks": "8.0.1",
38
+ "@testing-library/react-native": "13.3.3",
39
+ "@types/convert-source-map": "2.0.3",
40
+ "@types/jest": "30.0.0",
41
+ "@types/node": "24.0.14",
42
+ "@types/react": "19.2.2",
43
+ "@types/react-test-renderer": "19.1.0",
44
+ "@types/semver": "7.7.1",
45
+ "clang-format-node": "1.3.5",
46
+ "eslint": "9.37.0",
47
+ "jest": "30.2.0",
48
+ "knip": "5.61.3",
49
+ "madge": "8.0.0",
50
+ "prettier": "3.6.2",
51
+ "react": "19.1.1",
52
+ "react-dom": "19.1.1",
53
+ "react-native": "0.82.0",
54
+ "react-native-builder-bob": "0.40.13",
55
+ "react-native-web": "0.21.1",
56
+ "react-native-worklets": "0.7.1",
57
+ "react-test-renderer": "19.1.1",
58
+ "typescript": "5.8.3"
43
59
  },
44
60
  "files": [
45
61
  "lib",
46
62
  "harmony",
63
+ "scripts",
47
64
  "src",
48
- "./harmony.tar.gz"
65
+ "./harmony.tar.gz",
66
+ "compatibility.json"
49
67
  ]
50
68
  }