@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,252 +1,228 @@
1
- #pragma once
2
-
3
- #include <reanimated/AnimatedSensor/AnimatedSensorModule.h>
4
- #include <reanimated/LayoutAnimations/LayoutAnimationsManager.h>
5
- #include <reanimated/NativeModules/ReanimatedModuleProxySpec.h>
6
- #include <reanimated/Tools/PlatformDepMethodsHolder.h>
7
-
8
- #ifdef RCT_NEW_ARCH_ENABLED
9
- #include <reanimated/Fabric/PropsRegistry.h>
10
- #include <reanimated/Fabric/ReanimatedCommitHook.h>
11
- #include <reanimated/Fabric/ReanimatedMountHook.h>
12
- #include <reanimated/LayoutAnimations/LayoutAnimationsProxy.h>
13
- #endif // RCT_NEW_ARCH_ENABLED
14
-
15
- #include <worklets/NativeModules/WorkletsModuleProxy.h>
16
- #include <worklets/Registries/EventHandlerRegistry.h>
17
- #include <worklets/Tools/JSScheduler.h>
18
- #include <worklets/Tools/SingleInstanceChecker.h>
19
- #include <worklets/Tools/UIScheduler.h>
20
-
21
- #ifdef RCT_NEW_ARCH_ENABLED
22
- #include <react/renderer/uimanager/UIManager.h>
23
- #endif // RCT_NEW_ARCH_ENABLED
24
-
25
- #include <memory>
26
- #include <string>
27
- #include <unordered_set>
28
- #include <utility>
29
- #include <vector>
30
-
31
- namespace reanimated {
32
-
33
- using namespace facebook;
34
-
35
- class ReanimatedModuleProxy
36
- : public ReanimatedModuleProxySpec,
37
- public std::enable_shared_from_this<ReanimatedModuleProxy> {
38
- public:
39
- ReanimatedModuleProxy(
40
- const std::shared_ptr<WorkletsModuleProxy> &workletsModuleProxy,
41
- jsi::Runtime &rnRuntime,
42
- const std::shared_ptr<CallInvoker> &jsCallInvoker,
43
- const PlatformDepMethodsHolder &platformDepMethodsHolder,
44
- const bool isBridgeless,
45
- const bool isReducedMotion);
46
-
47
- // We need this init method to initialize callbacks with
48
- // weak_from_this() which is available only after the object
49
- // is fully constructed.
50
- void init(const PlatformDepMethodsHolder &platformDepMethodsHolder);
51
-
52
- void scheduleOnUI(jsi::Runtime &rt, const jsi::Value &worklet) override;
53
- jsi::Value executeOnUIRuntimeSync(jsi::Runtime &rt, const jsi::Value &worklet)
54
- override;
55
-
56
- jsi::Value createWorkletRuntime(
57
- jsi::Runtime &rt,
58
- const jsi::Value &name,
59
- const jsi::Value &initializer) override;
60
- jsi::Value scheduleOnRuntime(
61
- jsi::Runtime &rt,
62
- const jsi::Value &workletRuntimeValue,
63
- const jsi::Value &shareableWorkletValue) override;
64
-
65
- ~ReanimatedModuleProxy();
66
-
67
- jsi::Value registerEventHandler(
68
- jsi::Runtime &rt,
69
- const jsi::Value &worklet,
70
- const jsi::Value &eventName,
71
- const jsi::Value &emitterReactTag) override;
72
- void unregisterEventHandler(
73
- jsi::Runtime &rt,
74
- const jsi::Value &registrationId) override;
75
-
76
- jsi::Value getViewProp(
77
- jsi::Runtime &rt,
78
- #ifdef RCT_NEW_ARCH_ENABLED
79
- const jsi::Value &shadowNodeWrapper,
80
- #else
81
- const jsi::Value &viewTag,
82
- #endif
83
- const jsi::Value &propName,
84
- const jsi::Value &callback) override;
85
-
86
- jsi::Value enableLayoutAnimations(jsi::Runtime &rt, const jsi::Value &config)
87
- override;
88
- jsi::Value configureProps(
89
- jsi::Runtime &rt,
90
- const jsi::Value &uiProps,
91
- const jsi::Value &nativeProps) override;
92
- jsi::Value configureLayoutAnimationBatch(
93
- jsi::Runtime &rt,
94
- const jsi::Value &layoutAnimationsBatch) override;
95
- void setShouldAnimateExiting(
96
- jsi::Runtime &rt,
97
- const jsi::Value &viewTag,
98
- const jsi::Value &shouldAnimate) override;
99
-
100
- void onRender(double timestampMs);
101
-
102
- bool isAnyHandlerWaitingForEvent(
103
- const std::string &eventName,
104
- const int emitterReactTag);
105
-
106
- void maybeRequestRender();
107
-
108
- bool handleEvent(
109
- const std::string &eventName,
110
- const int emitterReactTag,
111
- const jsi::Value &payload,
112
- double currentTime);
113
-
114
- inline std::shared_ptr<JSLogger> getJSLogger() const {
115
- return jsLogger_;
116
- }
117
-
118
- #ifdef RCT_NEW_ARCH_ENABLED
119
- bool handleRawEvent(const RawEvent &rawEvent, double currentTime);
120
-
121
- void updateProps(jsi::Runtime &rt, const jsi::Value &operations);
122
-
123
- void removeFromPropsRegistry(jsi::Runtime &rt, const jsi::Value &viewTags);
124
-
125
- void performOperations();
126
-
127
- void markNodeAsRemovable(
128
- jsi::Runtime &rt,
129
- const jsi::Value &shadowNodeWrapper) override;
130
- void unmarkNodeAsRemovable(jsi::Runtime &rt, const jsi::Value &viewTag)
131
- override;
132
-
133
- void dispatchCommand(
134
- jsi::Runtime &rt,
135
- const jsi::Value &shadowNodeValue,
136
- const jsi::Value &commandNameValue,
137
- const jsi::Value &argsValue);
138
-
139
- jsi::String obtainProp(
140
- jsi::Runtime &rt,
141
- const jsi::Value &shadowNodeWrapper,
142
- const jsi::Value &propName);
143
-
144
- jsi::Value measure(jsi::Runtime &rt, const jsi::Value &shadowNodeValue);
145
-
146
- void initializeFabric(const std::shared_ptr<UIManager> &uiManager);
147
-
148
- void initializeLayoutAnimationsProxy();
149
-
150
- std::string obtainPropFromShadowNode(
151
- jsi::Runtime &rt,
152
- const std::string &propName,
153
- const ShadowNode::Shared &shadowNode);
154
-
155
- #ifdef IS_REANIMATED_EXAMPLE_APP
156
- std::function<std::string()> createRegistriesLeakCheck();
157
- #endif // IS_REANIMATED_EXAMPLE_APP
158
- #endif
159
-
160
- jsi::Value registerSensor(
161
- jsi::Runtime &rt,
162
- const jsi::Value &sensorType,
163
- const jsi::Value &interval,
164
- const jsi::Value &iosReferenceFrame,
165
- const jsi::Value &sensorDataContainer) override;
166
- void unregisterSensor(jsi::Runtime &rt, const jsi::Value &sensorId) override;
167
-
168
- void cleanupSensors();
169
-
170
- jsi::Value subscribeForKeyboardEvents(
171
- jsi::Runtime &rt,
172
- const jsi::Value &keyboardEventContainer,
173
- const jsi::Value &isStatusBarTranslucent,
174
- const jsi::Value &isNavigationBarTranslucent) override;
175
- void unsubscribeFromKeyboardEvents(
176
- jsi::Runtime &rt,
177
- const jsi::Value &listenerId) override;
178
-
179
- inline LayoutAnimationsManager &layoutAnimationsManager() {
180
- return *layoutAnimationsManager_;
181
- }
182
-
183
- [[nodiscard]] inline jsi::Runtime &getUIRuntime() const {
184
- return uiWorkletRuntime_->getJSIRuntime();
185
- }
186
-
187
- [[nodiscard]] inline bool isBridgeless() const {
188
- return isBridgeless_;
189
- }
190
-
191
- [[nodiscard]] inline bool isReducedMotion() const {
192
- return isReducedMotion_;
193
- }
194
-
195
- [[nodiscard]] inline std::shared_ptr<WorkletsModuleProxy>
196
- getWorkletsModuleProxy() const {
197
- return workletsModuleProxy_;
198
- }
199
-
200
- private:
201
- void requestAnimationFrame(jsi::Runtime &rt, const jsi::Value &callback);
202
-
203
- #ifdef RCT_NEW_ARCH_ENABLED
204
- jsi::Value filterNonAnimatableProps(
205
- jsi::Runtime &rt,
206
- const jsi::Value &props);
207
- #endif // RCT_NEW_ARCH_ENABLED
208
-
209
- const bool isBridgeless_;
210
- const bool isReducedMotion_;
211
- std::shared_ptr<WorkletsModuleProxy> workletsModuleProxy_;
212
- const std::string valueUnpackerCode_;
213
- std::shared_ptr<WorkletRuntime> uiWorkletRuntime_;
214
-
215
- std::unique_ptr<EventHandlerRegistry> eventHandlerRegistry_;
216
- const RequestRenderFunction requestRender_;
217
- std::vector<std::shared_ptr<jsi::Value>> frameCallbacks_;
218
- volatile bool renderRequested_{false};
219
- std::function<void(const double)> onRenderCallback_;
220
- AnimatedSensorModule animatedSensorModule_;
221
- const std::shared_ptr<JSLogger> jsLogger_;
222
- std::shared_ptr<LayoutAnimationsManager> layoutAnimationsManager_;
223
-
224
- #ifdef RCT_NEW_ARCH_ENABLED
225
- std::unordered_set<std::string>
226
- animatablePropNames_; // filled by configureProps
227
- std::shared_ptr<UIManager> uiManager_;
228
- std::shared_ptr<LayoutAnimationsProxy> layoutAnimationsProxy_;
229
-
230
- std::vector<std::pair<ShadowNode::Shared, std::unique_ptr<jsi::Value>>>
231
- operationsInBatch_; // TODO: refactor std::pair to custom struct
232
-
233
- std::shared_ptr<PropsRegistry> propsRegistry_;
234
- std::shared_ptr<ReanimatedCommitHook> commitHook_;
235
- std::shared_ptr<ReanimatedMountHook> mountHook_;
236
-
237
- std::vector<Tag> tagsToRemove_; // from `propsRegistry_`
238
- #else
239
- const ObtainPropFunction obtainPropFunction_;
240
- const ConfigurePropsFunction configurePropsPlatformFunction_;
241
- const UpdatePropsFunction updatePropsFunction_;
242
- #endif
243
-
244
- const KeyboardEventSubscribeFunction subscribeForKeyboardEventsFunction_;
245
- const KeyboardEventUnsubscribeFunction unsubscribeFromKeyboardEventsFunction_;
246
-
247
- #ifndef NDEBUG
248
- worklets::SingleInstanceChecker<ReanimatedModuleProxy> singleInstanceChecker_;
249
- #endif // NDEBUG
250
- };
251
-
252
- } // namespace reanimated
1
+ #pragma once
2
+
3
+ #include <reanimated/AnimatedSensor/AnimatedSensorModule.h>
4
+ #include <reanimated/CSS/core/CSSAnimation.h>
5
+ #include <reanimated/CSS/core/CSSTransition.h>
6
+ #include <reanimated/CSS/misc/ViewStylesRepository.h>
7
+ #include <reanimated/CSS/registries/CSSAnimationsRegistry.h>
8
+ #include <reanimated/CSS/registries/CSSKeyframesRegistry.h>
9
+ #include <reanimated/CSS/registries/CSSTransitionsRegistry.h>
10
+ #include <reanimated/CSS/registries/StaticPropsRegistry.h>
11
+ #include <reanimated/Fabric/ReanimatedCommitHook.h>
12
+ #include <reanimated/Fabric/ReanimatedCommitShadowNode.h>
13
+ #include <reanimated/Fabric/ReanimatedMountHook.h>
14
+ #include <reanimated/Fabric/ShadowTreeCloner.h>
15
+ #include <reanimated/Fabric/updates/AnimatedPropsRegistry.h>
16
+ #include <reanimated/Fabric/updates/UpdatesRegistryManager.h>
17
+ #include <reanimated/LayoutAnimations/LayoutAnimationsManager.h>
18
+ #include <reanimated/LayoutAnimations/LayoutAnimationsProxyCommon.h>
19
+ #include <reanimated/NativeModules/PropValueProcessor.h>
20
+ #include <reanimated/NativeModules/ReanimatedModuleProxySpec.h>
21
+ #include <reanimated/Tools/PlatformDepMethodsHolder.h>
22
+
23
+ #include <worklets/NativeModules/WorkletsModuleProxy.h>
24
+ #include <worklets/Registries/EventHandlerRegistry.h>
25
+ #include <worklets/Tools/JSScheduler.h>
26
+ #include <worklets/Tools/SingleInstanceChecker.h>
27
+ #include <worklets/Tools/UIScheduler.h>
28
+
29
+ #include <react/renderer/componentregistry/componentNameByReactViewName.h>
30
+ #include <react/renderer/core/ShadowNode.h>
31
+ #include <react/renderer/uimanager/UIManager.h>
32
+
33
+ #include <memory>
34
+ #include <set>
35
+ #include <string>
36
+ #include <unordered_map>
37
+ #include <unordered_set>
38
+ #include <utility>
39
+ #include <vector>
40
+
41
+ namespace reanimated {
42
+
43
+ using namespace facebook;
44
+ using namespace css;
45
+
46
+ using UpdatesBatch = std::vector<std::pair<std::shared_ptr<const ShadowNode>, folly::dynamic>>;
47
+
48
+ class ReanimatedModuleProxy : public ReanimatedModuleProxySpec,
49
+ public std::enable_shared_from_this<ReanimatedModuleProxy> {
50
+ public:
51
+ ReanimatedModuleProxy(
52
+ const std::shared_ptr<WorkletsModuleProxy> &workletsModuleProxy,
53
+ jsi::Runtime &rnRuntime,
54
+ const std::shared_ptr<CallInvoker> &jsCallInvoker,
55
+ const PlatformDepMethodsHolder &platformDepMethodsHolder,
56
+ const bool isReducedMotion);
57
+
58
+ // We need this init method to initialize callbacks with
59
+ // weak_from_this() which is available only after the object
60
+ // is fully constructed.
61
+ void init(const PlatformDepMethodsHolder &platformDepMethodsHolder);
62
+
63
+ ~ReanimatedModuleProxy() override;
64
+
65
+ jsi::Value registerEventHandler(
66
+ jsi::Runtime &rt,
67
+ const jsi::Value &worklet,
68
+ const jsi::Value &eventName,
69
+ const jsi::Value &emitterReactTag) override;
70
+ void unregisterEventHandler(jsi::Runtime &rt, const jsi::Value &registrationId) override;
71
+
72
+ jsi::Value getViewProp(
73
+ jsi::Runtime &rt,
74
+ const jsi::Value &shadowNodeWrapper,
75
+ const jsi::Value &propName,
76
+ const jsi::Value &callback) override;
77
+
78
+ jsi::Value getStaticFeatureFlag(jsi::Runtime &rt, const jsi::Value &name) override;
79
+ jsi::Value setDynamicFeatureFlag(jsi::Runtime &rt, const jsi::Value &name, const jsi::Value &value) override;
80
+
81
+ jsi::Value configureLayoutAnimationBatch(jsi::Runtime &rt, const jsi::Value &layoutAnimationsBatch) override;
82
+ void setShouldAnimateExiting(jsi::Runtime &rt, const jsi::Value &viewTag, const jsi::Value &shouldAnimate) override;
83
+
84
+ void onRender(double timestampMs);
85
+
86
+ bool isAnyHandlerWaitingForEvent(const std::string &eventName, const int emitterReactTag);
87
+
88
+ void maybeRequestRender();
89
+
90
+ bool
91
+ handleEvent(const std::string &eventName, const int emitterReactTag, const jsi::Value &payload, double currentTime);
92
+
93
+ inline std::shared_ptr<JSLogger> getJSLogger() const {
94
+ return jsLogger_;
95
+ }
96
+
97
+ bool handleRawEvent(const RawEvent &rawEvent, double currentTime);
98
+
99
+ void maybeRunCSSLoop();
100
+ double getCssTimestamp();
101
+
102
+ void performOperations(const bool isTriggeredByEvent);
103
+
104
+ void setViewStyle(jsi::Runtime &rt, const jsi::Value &viewTag, const jsi::Value &viewStyle) override;
105
+
106
+ void markNodeAsRemovable(jsi::Runtime &rt, const jsi::Value &shadowNodeWrapper) override;
107
+ void unmarkNodeAsRemovable(jsi::Runtime &rt, const jsi::Value &viewTag) override;
108
+
109
+ void registerCSSKeyframes(
110
+ jsi::Runtime &rt,
111
+ const jsi::Value &animationName,
112
+ const jsi::Value &viewName,
113
+ const jsi::Value &keyframesConfig) override;
114
+ void unregisterCSSKeyframes(jsi::Runtime &rt, const jsi::Value &animationName, const jsi::Value &viewName) override;
115
+
116
+ void applyCSSAnimations(jsi::Runtime &rt, const jsi::Value &shadowNodeWrapper, const jsi::Value &animationUpdates)
117
+ override;
118
+ void unregisterCSSAnimations(const jsi::Value &viewTag) override;
119
+
120
+ void registerCSSTransition(jsi::Runtime &rt, const jsi::Value &shadowNodeWrapper, const jsi::Value &transitionConfig)
121
+ override;
122
+ void updateCSSTransition(jsi::Runtime &rt, const jsi::Value &viewTag, const jsi::Value &configUpdates) override;
123
+ void unregisterCSSTransition(jsi::Runtime &rt, const jsi::Value &viewTag) override;
124
+
125
+ jsi::Value getSettledUpdates(jsi::Runtime &rt) override;
126
+
127
+ void cssLoopCallback(const double /*timestampMs*/);
128
+
129
+ void dispatchCommand(
130
+ jsi::Runtime &rt,
131
+ const jsi::Value &shadowNodeValue,
132
+ const jsi::Value &commandNameValue,
133
+ const jsi::Value &argsValue);
134
+
135
+ jsi::String obtainProp(jsi::Runtime &rt, const jsi::Value &shadowNodeWrapper, const jsi::Value &propName);
136
+
137
+ jsi::Value measure(jsi::Runtime &rt, const jsi::Value &shadowNodeValue);
138
+
139
+ void initializeFabric(const std::shared_ptr<UIManager> &uiManager);
140
+
141
+ void initializeLayoutAnimationsProxy();
142
+
143
+ std::string obtainPropFromShadowNode(
144
+ jsi::Runtime &rt,
145
+ const std::string &propName,
146
+ const std::shared_ptr<const ShadowNode> &shadowNode);
147
+
148
+ jsi::Value registerSensor(
149
+ jsi::Runtime &rt,
150
+ const jsi::Value &sensorType,
151
+ const jsi::Value &interval,
152
+ const jsi::Value &iosReferenceFrame,
153
+ const jsi::Value &sensorDataContainer) override;
154
+ void unregisterSensor(jsi::Runtime &rt, const jsi::Value &sensorId) override;
155
+
156
+ void cleanupSensors();
157
+
158
+ jsi::Value subscribeForKeyboardEvents(
159
+ jsi::Runtime &rt,
160
+ const jsi::Value &keyboardEventContainer,
161
+ const jsi::Value &isStatusBarTranslucent,
162
+ const jsi::Value &isNavigationBarTranslucent) override;
163
+ void unsubscribeFromKeyboardEvents(jsi::Runtime &rt, const jsi::Value &listenerId) override;
164
+
165
+ inline LayoutAnimationsManager &layoutAnimationsManager() {
166
+ return *layoutAnimationsManager_;
167
+ }
168
+
169
+ [[nodiscard]] inline bool isReducedMotion() const {
170
+ return isReducedMotion_;
171
+ }
172
+
173
+ [[nodiscard]] inline std::shared_ptr<WorkletsModuleProxy> getWorkletsModuleProxy() const {
174
+ return workletsModuleProxy_;
175
+ }
176
+
177
+ void requestFlushRegistry();
178
+ std::function<std::string()> createRegistriesLeakCheck();
179
+
180
+ private:
181
+ void commitUpdates(jsi::Runtime &rt, const UpdatesBatch &updatesBatch);
182
+
183
+ const bool isReducedMotion_;
184
+ bool shouldFlushRegistry_ = false;
185
+ std::shared_ptr<WorkletsModuleProxy> workletsModuleProxy_;
186
+
187
+ std::unique_ptr<EventHandlerRegistry> eventHandlerRegistry_;
188
+ const RequestRenderFunction requestRender_;
189
+ volatile bool renderRequested_{false};
190
+ std::function<void(const double)> onRenderCallback_;
191
+ AnimatedSensorModule animatedSensorModule_;
192
+ const std::shared_ptr<JSLogger> jsLogger_;
193
+ std::shared_ptr<LayoutAnimationsManager> layoutAnimationsManager_;
194
+ GetAnimationTimestampFunction getAnimationTimestamp_;
195
+ #ifdef __APPLE__
196
+ ForceScreenSnapshotFunction forceScreenSnapshot_;
197
+ #endif
198
+ bool cssLoopRunning_{false};
199
+ bool shouldUpdateCssAnimations_{true};
200
+ double currentCssTimestamp_{0};
201
+
202
+ const std::shared_ptr<AnimatedPropsRegistry> animatedPropsRegistry_;
203
+ const std::shared_ptr<StaticPropsRegistry> staticPropsRegistry_;
204
+ const std::shared_ptr<UpdatesRegistryManager> updatesRegistryManager_;
205
+ const std::shared_ptr<ViewStylesRepository> viewStylesRepository_;
206
+ const std::shared_ptr<CSSKeyframesRegistry> cssAnimationKeyframesRegistry_;
207
+ const std::shared_ptr<CSSAnimationsRegistry> cssAnimationsRegistry_;
208
+ const std::shared_ptr<CSSTransitionsRegistry> cssTransitionsRegistry_;
209
+
210
+ const SynchronouslyUpdateUIPropsFunction synchronouslyUpdateUIPropsFunction_;
211
+ const PreserveMountedTagsFunction filterUnmountedTagsFunction_;
212
+
213
+ std::shared_ptr<UIManager> uiManager_;
214
+ std::shared_ptr<LayoutAnimationsProxyCommon> layoutAnimationsProxy_;
215
+ std::shared_ptr<ReanimatedCommitHook> commitHook_;
216
+ std::shared_ptr<ReanimatedMountHook> mountHook_;
217
+ std::set<SurfaceId> layoutAnimationFlushRequests_;
218
+ bool layoutAnimationRenderRequested_;
219
+
220
+ const KeyboardEventSubscribeFunction subscribeForKeyboardEventsFunction_;
221
+ const KeyboardEventUnsubscribeFunction unsubscribeFromKeyboardEventsFunction_;
222
+
223
+ #ifndef NDEBUG
224
+ worklets::SingleInstanceChecker<ReanimatedModuleProxy> singleInstanceChecker_;
225
+ #endif // NDEBUG
226
+ };
227
+
228
+ } // namespace reanimated