@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
@@ -0,0 +1,28 @@
1
+ #include <reanimated/CSS/interpolation/transforms/operations/scale.h>
2
+
3
+ #include <memory>
4
+
5
+ namespace reanimated::css {
6
+
7
+ template <TransformOp TOperation>
8
+ ScaleOperationBase<TOperation>::ScaleOperationBase(const double value)
9
+ : TransformOperationBase<TOperation, CSSDouble>(CSSDouble(value)) {}
10
+
11
+ bool ScaleOperation::canConvertTo(TransformOp type) const {
12
+ return type == TransformOp::ScaleX || type == TransformOp::ScaleY;
13
+ }
14
+
15
+ TransformOperations ScaleOperation::convertTo(TransformOp type) const {
16
+ assertCanConvertTo(type);
17
+ if (type == TransformOp::ScaleX) {
18
+ return {std::make_shared<ScaleXOperation>(value), std::make_shared<ScaleYOperation>(value)};
19
+ } else {
20
+ return {std::make_shared<ScaleYOperation>(value), std::make_shared<ScaleXOperation>(value)};
21
+ }
22
+ }
23
+
24
+ template struct ScaleOperationBase<TransformOp::ScaleX>;
25
+ template struct ScaleOperationBase<TransformOp::ScaleY>;
26
+ template struct ScaleOperationBase<TransformOp::Scale>;
27
+
28
+ } // namespace reanimated::css
@@ -0,0 +1,25 @@
1
+ #pragma once
2
+
3
+ #include <reanimated/CSS/common/values/CSSNumber.h>
4
+ #include <reanimated/CSS/interpolation/transforms/TransformOperation.h>
5
+
6
+ namespace reanimated::css {
7
+
8
+ template <TransformOp TOperation>
9
+ struct ScaleOperationBase : public TransformOperationBase<TOperation, CSSDouble> {
10
+ using TransformOperationBase<TOperation, CSSDouble>::TransformOperationBase;
11
+
12
+ explicit ScaleOperationBase(const double value);
13
+ };
14
+
15
+ using ScaleXOperation = ScaleOperationBase<TransformOp::ScaleX>;
16
+ using ScaleYOperation = ScaleOperationBase<TransformOp::ScaleY>;
17
+
18
+ struct ScaleOperation final : public ScaleOperationBase<TransformOp::Scale> {
19
+ using ScaleOperationBase<TransformOp::Scale>::ScaleOperationBase;
20
+
21
+ bool canConvertTo(TransformOp type) const override;
22
+ TransformOperations convertTo(TransformOp type) const override;
23
+ };
24
+
25
+ } // namespace reanimated::css
@@ -0,0 +1,14 @@
1
+ #include <reanimated/CSS/interpolation/transforms/operations/skew.h>
2
+
3
+ #include <string>
4
+
5
+ namespace reanimated::css {
6
+
7
+ template <TransformOp TOperation>
8
+ SkewOperationBase<TOperation>::SkewOperationBase(const std::string &value)
9
+ : TransformOperationBase<TOperation, CSSAngle>(CSSAngle(value)) {}
10
+
11
+ template struct SkewOperationBase<TransformOp::SkewX>;
12
+ template struct SkewOperationBase<TransformOp::SkewY>;
13
+
14
+ } // namespace reanimated::css
@@ -0,0 +1,20 @@
1
+ #pragma once
2
+
3
+ #include <reanimated/CSS/common/values/CSSAngle.h>
4
+ #include <reanimated/CSS/interpolation/transforms/TransformOperation.h>
5
+
6
+ #include <string>
7
+
8
+ namespace reanimated::css {
9
+
10
+ template <TransformOp TOperation>
11
+ struct SkewOperationBase : public TransformOperationBase<TOperation, CSSAngle> {
12
+ using TransformOperationBase<TOperation, CSSAngle>::TransformOperationBase;
13
+
14
+ explicit SkewOperationBase(const std::string &value);
15
+ };
16
+
17
+ using SkewXOperation = SkewOperationBase<TransformOp::SkewX>;
18
+ using SkewYOperation = SkewOperationBase<TransformOp::SkewY>;
19
+
20
+ } // namespace reanimated::css
@@ -0,0 +1,39 @@
1
+ #include <reanimated/CSS/common/transforms/TransformMatrix2D.h>
2
+ #include <reanimated/CSS/common/transforms/TransformMatrix3D.h>
3
+ #include <reanimated/CSS/interpolation/transforms/operations/translate.h>
4
+
5
+ #include <memory>
6
+ #include <string>
7
+
8
+ namespace reanimated::css {
9
+
10
+ template <TransformOp TOperation>
11
+ TranslateOperationBase<TOperation>::TranslateOperationBase(double value)
12
+ : TransformOperationBase<TOperation, CSSLength>(CSSLength(value)) {}
13
+
14
+ template <TransformOp TOperation>
15
+ TranslateOperationBase<TOperation>::TranslateOperationBase(const std::string &value)
16
+ : TransformOperationBase<TOperation, CSSLength>(CSSLength(value)) {}
17
+
18
+ template <TransformOp TOperation>
19
+ bool TranslateOperationBase<TOperation>::shouldResolve() const {
20
+ return this->value.isRelative;
21
+ }
22
+
23
+ template <TransformOp TOperation>
24
+ TransformMatrix::Shared TranslateOperationBase<TOperation>::toMatrix(bool force3D) const {
25
+ if (shouldResolve()) {
26
+ throw std::runtime_error(
27
+ "[Reanimated] Cannot convert unresolved relative translate value to matrix: " + this->value.toString());
28
+ }
29
+
30
+ if (force3D) {
31
+ return std::make_shared<TransformMatrix3D>(TransformMatrix3D::create<TOperation>(this->value.value));
32
+ }
33
+ return std::make_shared<TransformMatrix2D>(TransformMatrix2D::create<TOperation>(this->value.value));
34
+ }
35
+
36
+ template struct TranslateOperationBase<TransformOp::TranslateX>;
37
+ template struct TranslateOperationBase<TransformOp::TranslateY>;
38
+
39
+ } // namespace reanimated::css
@@ -0,0 +1,25 @@
1
+ #pragma once
2
+
3
+ #include <reanimated/CSS/common/values/CSSLength.h>
4
+ #include <reanimated/CSS/interpolation/transforms/TransformOperation.h>
5
+
6
+ #include <memory>
7
+ #include <string>
8
+
9
+ namespace reanimated::css {
10
+
11
+ template <TransformOp TOperation>
12
+ struct TranslateOperationBase : public TransformOperationBase<TOperation, CSSLength> {
13
+ using TransformOperationBase<TOperation, CSSLength>::TransformOperationBase;
14
+
15
+ explicit TranslateOperationBase(double value);
16
+ explicit TranslateOperationBase(const std::string &value);
17
+
18
+ bool shouldResolve() const override;
19
+ TransformMatrix::Shared toMatrix(bool force3D) const override;
20
+ };
21
+
22
+ using TranslateXOperation = TranslateOperationBase<TransformOp::TranslateX>;
23
+ using TranslateYOperation = TranslateOperationBase<TransformOp::TranslateY>;
24
+
25
+ } // namespace reanimated::css
@@ -0,0 +1,47 @@
1
+ #include <reanimated/CSS/interpolation/values/ResolvableValueInterpolator.h>
2
+
3
+ #include <folly/dynamic.h>
4
+ #include <jsi/jsi.h>
5
+
6
+ #include <reanimated/CSS/common/values/CSSAngle.h>
7
+ #include <reanimated/CSS/common/values/CSSKeyword.h>
8
+ #include <reanimated/CSS/common/values/CSSLength.h>
9
+ #include <reanimated/CSS/common/values/CSSNumber.h>
10
+
11
+ #include <memory>
12
+
13
+ namespace reanimated::css {
14
+
15
+ template <typename... AllowedTypes>
16
+ ResolvableValueInterpolator<AllowedTypes...>::ResolvableValueInterpolator(
17
+ const PropertyPath &propertyPath,
18
+ const ValueType &defaultStyleValue,
19
+ const std::shared_ptr<ViewStylesRepository> &viewStylesRepository,
20
+ const ResolvableValueInterpolatorConfig &config)
21
+ : SimpleValueInterpolator<AllowedTypes...>(propertyPath, defaultStyleValue, viewStylesRepository),
22
+ config_(config) {}
23
+
24
+ template <typename... AllowedTypes>
25
+ folly::dynamic ResolvableValueInterpolator<AllowedTypes...>::interpolateValue(
26
+ double progress,
27
+ const std::shared_ptr<CSSValue> &fromValue,
28
+ const std::shared_ptr<CSSValue> &toValue,
29
+ const ValueInterpolationContext &context) const {
30
+ const auto &from = std::static_pointer_cast<ValueType>(fromValue);
31
+ const auto &to = std::static_pointer_cast<ValueType>(toValue);
32
+ return from
33
+ ->interpolate(
34
+ progress,
35
+ *to,
36
+ {.node = context.node,
37
+ .fallbackInterpolateThreshold = context.fallbackInterpolateThreshold,
38
+ .viewStylesRepository = this->viewStylesRepository_,
39
+ .relativeProperty = config_.relativeProperty,
40
+ .relativeTo = config_.relativeTo})
41
+ .toDynamic();
42
+ }
43
+
44
+ template class ResolvableValueInterpolator<CSSLength>;
45
+ template class ResolvableValueInterpolator<CSSLength, CSSKeyword>;
46
+
47
+ } // namespace reanimated::css
@@ -0,0 +1,43 @@
1
+ #pragma once
2
+
3
+ #include <reanimated/CSS/interpolation/configs.h>
4
+ #include <reanimated/CSS/interpolation/values/SimpleValueInterpolator.h>
5
+
6
+ #include <memory>
7
+
8
+ namespace reanimated::css {
9
+
10
+ /**
11
+ * Concrete implementation of ValueInterpolator for CSS values that require
12
+ * resolution before interpolation. This class handles interpolation of relative
13
+ * values (e.g., percentage length values) that need to be resolved to absolute
14
+ * values using the context describing the ShadowNode before the interpolation
15
+ * can occur.
16
+ */
17
+ template <typename... AllowedTypes>
18
+ class ResolvableValueInterpolator final : public SimpleValueInterpolator<AllowedTypes...> {
19
+ static_assert(
20
+ (... && std::is_base_of<CSSValue, AllowedTypes>::value),
21
+ "[Reanimated] ResolvableValueInterpolator: All interpolated types must inherit from CSSValue");
22
+
23
+ public:
24
+ using ValueType = typename SimpleValueInterpolator<AllowedTypes...>::ValueType;
25
+
26
+ explicit ResolvableValueInterpolator(
27
+ const PropertyPath &propertyPath,
28
+ const ValueType &defaultStyleValue,
29
+ const std::shared_ptr<ViewStylesRepository> &viewStylesRepository,
30
+ const ResolvableValueInterpolatorConfig &config);
31
+
32
+ protected:
33
+ folly::dynamic interpolateValue(
34
+ double progress,
35
+ const std::shared_ptr<CSSValue> &fromValue,
36
+ const std::shared_ptr<CSSValue> &toValue,
37
+ const ValueInterpolationContext &context) const override;
38
+
39
+ private:
40
+ const ResolvableValueInterpolatorConfig &config_;
41
+ };
42
+
43
+ } // namespace reanimated::css
@@ -0,0 +1,70 @@
1
+ #include <reanimated/CSS/interpolation/values/SimpleValueInterpolator.h>
2
+
3
+ #include <folly/dynamic.h>
4
+ #include <jsi/jsi.h>
5
+
6
+ #include <reanimated/CSS/common/values/CSSAngle.h>
7
+ #include <reanimated/CSS/common/values/CSSBoolean.h>
8
+ #include <reanimated/CSS/common/values/CSSColor.h>
9
+ #include <reanimated/CSS/common/values/CSSDiscreteArray.h>
10
+ #include <reanimated/CSS/common/values/CSSKeyword.h>
11
+ #include <reanimated/CSS/common/values/CSSLength.h>
12
+ #include <reanimated/CSS/common/values/CSSNumber.h>
13
+ #include <reanimated/CSS/common/values/complex/CSSBoxShadow.h>
14
+ #include <reanimated/CSS/svg/values/SVGBrush.h>
15
+ #include <reanimated/CSS/svg/values/SVGLength.h>
16
+ #include <reanimated/CSS/svg/values/SVGStrokeDashArray.h>
17
+
18
+ #include <memory>
19
+
20
+ namespace reanimated::css {
21
+
22
+ template <typename... AllowedTypes>
23
+ SimpleValueInterpolator<AllowedTypes...>::SimpleValueInterpolator(
24
+ const PropertyPath &propertyPath,
25
+ const ValueType &defaultStyleValue,
26
+ const std::shared_ptr<ViewStylesRepository> &viewStylesRepository)
27
+ : ValueInterpolator(propertyPath, std::make_shared<ValueType>(defaultStyleValue), viewStylesRepository) {}
28
+
29
+ template <typename... AllowedTypes>
30
+ std::shared_ptr<CSSValue> SimpleValueInterpolator<AllowedTypes...>::createValue(
31
+ jsi::Runtime &rt,
32
+ const jsi::Value &value) const {
33
+ return std::make_shared<ValueType>(rt, value);
34
+ }
35
+
36
+ template <typename... AllowedTypes>
37
+ std::shared_ptr<CSSValue> SimpleValueInterpolator<AllowedTypes...>::createValue(const folly::dynamic &value) const {
38
+ return std::make_shared<ValueType>(value);
39
+ }
40
+
41
+ template <typename... AllowedTypes>
42
+ folly::dynamic SimpleValueInterpolator<AllowedTypes...>::interpolateValue(
43
+ double progress,
44
+ const std::shared_ptr<CSSValue> &fromValue,
45
+ const std::shared_ptr<CSSValue> &toValue,
46
+ const ValueInterpolationContext &context) const {
47
+ const auto &from = std::static_pointer_cast<ValueType>(fromValue);
48
+ const auto &to = std::static_pointer_cast<ValueType>(toValue);
49
+ return from->interpolate(progress, *to, context).toDynamic();
50
+ }
51
+
52
+ template class SimpleValueInterpolator<CSSLength>;
53
+ template class SimpleValueInterpolator<CSSLength, CSSKeyword>;
54
+ template class SimpleValueInterpolator<CSSDouble>;
55
+ template class SimpleValueInterpolator<CSSDouble, CSSKeyword>;
56
+ template class SimpleValueInterpolator<CSSInteger>;
57
+ template class SimpleValueInterpolator<CSSAngle>;
58
+ template class SimpleValueInterpolator<CSSColor>;
59
+ template class SimpleValueInterpolator<CSSBoolean>;
60
+ template class SimpleValueInterpolator<CSSDisplay>;
61
+ template class SimpleValueInterpolator<CSSKeyword>;
62
+ template class SimpleValueInterpolator<CSSBoxShadow>;
63
+ template class SimpleValueInterpolator<CSSDiscreteArray<CSSKeyword>>;
64
+
65
+ template class SimpleValueInterpolator<SVGLength>;
66
+ template class SimpleValueInterpolator<SVGLength, CSSKeyword>;
67
+ template class SimpleValueInterpolator<SVGStrokeDashArray, CSSKeyword>;
68
+ template class SimpleValueInterpolator<SVGBrush>;
69
+
70
+ } // namespace reanimated::css
@@ -0,0 +1,40 @@
1
+ #pragma once
2
+
3
+ #include <reanimated/CSS/interpolation/values/ValueInterpolator.h>
4
+
5
+ #include <memory>
6
+
7
+ namespace reanimated::css {
8
+
9
+ /**
10
+ * Concrete implementation of ValueInterpolator for simple CSS values that don't
11
+ * require resolution before interpolation. This class handles direct
12
+ * interpolation between values without any additional processing or resolution.
13
+ */
14
+ template <typename... AllowedTypes>
15
+ class SimpleValueInterpolator : public ValueInterpolator {
16
+ static_assert(
17
+ (... && std::is_base_of<CSSValue, AllowedTypes>::value),
18
+ "[Reanimated] SimpleValueInterpolator: All interpolated types must inherit from CSSValue");
19
+
20
+ public:
21
+ using ValueType = CSSValueVariant<AllowedTypes...>;
22
+
23
+ explicit SimpleValueInterpolator(
24
+ const PropertyPath &propertyPath,
25
+ const ValueType &defaultStyleValue,
26
+ const std::shared_ptr<ViewStylesRepository> &viewStylesRepository);
27
+
28
+ protected:
29
+ std::shared_ptr<CSSValue> createValue(jsi::Runtime &rt, const jsi::Value &value) const override;
30
+
31
+ std::shared_ptr<CSSValue> createValue(const folly::dynamic &value) const override;
32
+
33
+ folly::dynamic interpolateValue(
34
+ double progress,
35
+ const std::shared_ptr<CSSValue> &fromValue,
36
+ const std::shared_ptr<CSSValue> &toValue,
37
+ const ValueInterpolationContext &context) const override;
38
+ };
39
+
40
+ } // namespace reanimated::css
@@ -0,0 +1,146 @@
1
+ #include <reanimated/CSS/interpolation/values/ValueInterpolator.h>
2
+
3
+ #include <memory>
4
+ #include <utility>
5
+
6
+ namespace reanimated::css {
7
+
8
+ ValueInterpolator::ValueInterpolator(
9
+ const PropertyPath &propertyPath,
10
+ const std::shared_ptr<CSSValue> &defaultValue,
11
+ const std::shared_ptr<ViewStylesRepository> &viewStylesRepository)
12
+ : PropertyInterpolator(propertyPath, viewStylesRepository),
13
+ defaultStyleValue_(defaultValue),
14
+ defaultStyleValueDynamic_(defaultValue->toDynamic()) {}
15
+
16
+ folly::dynamic ValueInterpolator::getStyleValue(const std::shared_ptr<const ShadowNode> &shadowNode) const {
17
+ return viewStylesRepository_->getStyleProp(shadowNode->getTag(), propertyPath_);
18
+ }
19
+
20
+ folly::dynamic ValueInterpolator::getResetStyle(const std::shared_ptr<const ShadowNode> &shadowNode) const {
21
+ auto styleValue = getStyleValue(shadowNode);
22
+
23
+ if (styleValue.isNull()) {
24
+ return defaultStyleValueDynamic_;
25
+ }
26
+
27
+ return styleValue;
28
+ }
29
+
30
+ folly::dynamic ValueInterpolator::getFirstKeyframeValue() const {
31
+ return convertOptionalToDynamic(keyframes_.front().value);
32
+ }
33
+
34
+ folly::dynamic ValueInterpolator::getLastKeyframeValue() const {
35
+ return convertOptionalToDynamic(keyframes_.back().value);
36
+ }
37
+
38
+ bool ValueInterpolator::equalsReversingAdjustedStartValue(const folly::dynamic &propertyValue) const {
39
+ if (reversingAdjustedStartValue_.isNull()) {
40
+ return propertyValue.isNull();
41
+ }
42
+ return reversingAdjustedStartValue_ == propertyValue;
43
+ }
44
+
45
+ void ValueInterpolator::updateKeyframes(jsi::Runtime &rt, const jsi::Value &keyframes) {
46
+ const auto parsedKeyframes = parseJSIKeyframes(rt, keyframes);
47
+
48
+ keyframes_.clear();
49
+ keyframes_.reserve(parsedKeyframes.size());
50
+
51
+ for (const auto &[offset, value] : parsedKeyframes) {
52
+ if (value.isUndefined()) {
53
+ keyframes_.emplace_back(offset, std::nullopt);
54
+ } else {
55
+ keyframes_.emplace_back(offset, std::make_optional(createValue(rt, value)));
56
+ }
57
+ }
58
+ }
59
+
60
+ void ValueInterpolator::updateKeyframesFromStyleChange(
61
+ const folly::dynamic &oldStyleValue,
62
+ const folly::dynamic &newStyleValue,
63
+ const folly::dynamic &lastUpdateValue) {
64
+ ValueKeyframe firstKeyframe, lastKeyframe;
65
+
66
+ if (!lastUpdateValue.isNull()) {
67
+ firstKeyframe = ValueKeyframe{0, createValue(lastUpdateValue)};
68
+ } else if (!oldStyleValue.isNull()) {
69
+ firstKeyframe = ValueKeyframe{0, createValue(oldStyleValue)};
70
+ } else {
71
+ firstKeyframe = ValueKeyframe{0, defaultStyleValue_};
72
+ }
73
+
74
+ if (newStyleValue.isNull()) {
75
+ lastKeyframe = ValueKeyframe{1, defaultStyleValue_};
76
+ } else {
77
+ lastKeyframe = ValueKeyframe{1, createValue(newStyleValue)};
78
+ }
79
+
80
+ keyframes_ = {std::move(firstKeyframe), std::move(lastKeyframe)};
81
+ reversingAdjustedStartValue_ = oldStyleValue;
82
+ }
83
+
84
+ folly::dynamic ValueInterpolator::interpolate(
85
+ const std::shared_ptr<const ShadowNode> &shadowNode,
86
+ const std::shared_ptr<KeyframeProgressProvider> &progressProvider,
87
+ const double fallbackInterpolateThreshold) const {
88
+ const auto toIndex = getToKeyframeIndex(progressProvider);
89
+ const auto fromIndex = toIndex - 1;
90
+
91
+ const auto &fromKeyframe = keyframes_[fromIndex];
92
+ const auto &toKeyframe = keyframes_[toIndex];
93
+
94
+ // clang-format off
95
+ const auto &fromValue = fromKeyframe.value
96
+ ? fromKeyframe.value.value()
97
+ : getFallbackValue(shadowNode);
98
+ const auto &toValue = toKeyframe.value
99
+ ? toKeyframe.value.value()
100
+ : getFallbackValue(shadowNode);
101
+ // clang-format on
102
+
103
+ const auto keyframeProgress = progressProvider->getKeyframeProgress(fromKeyframe.offset, toKeyframe.offset);
104
+
105
+ if (keyframeProgress == 1.0) {
106
+ return toValue->toDynamic();
107
+ }
108
+ if (keyframeProgress == 0.0) {
109
+ return fromValue->toDynamic();
110
+ }
111
+
112
+ return interpolateValue(
113
+ keyframeProgress,
114
+ fromValue,
115
+ toValue,
116
+ {.node = shadowNode, .fallbackInterpolateThreshold = fallbackInterpolateThreshold});
117
+ }
118
+
119
+ folly::dynamic ValueInterpolator::convertOptionalToDynamic(
120
+ const std::optional<std::shared_ptr<CSSValue>> &value) const {
121
+ return value ? value.value()->toDynamic() : folly::dynamic();
122
+ }
123
+
124
+ std::shared_ptr<CSSValue> ValueInterpolator::getFallbackValue(
125
+ const std::shared_ptr<const ShadowNode> &shadowNode) const {
126
+ const auto styleValue = getStyleValue(shadowNode);
127
+ return styleValue.isNull() ? defaultStyleValue_ : createValue(styleValue);
128
+ }
129
+
130
+ size_t ValueInterpolator::getToKeyframeIndex(const std::shared_ptr<KeyframeProgressProvider> &progressProvider) const {
131
+ const auto progress = progressProvider->getGlobalProgress();
132
+
133
+ const auto it = std::upper_bound(
134
+ keyframes_.begin(), keyframes_.end(), progress, [](double progress, const ValueKeyframe &keyframe) {
135
+ return progress < keyframe.offset;
136
+ });
137
+
138
+ // If we're at the end, return the last valid keyframe index
139
+ if (it == keyframes_.end()) {
140
+ return keyframes_.size() - 1;
141
+ }
142
+
143
+ return std::distance(keyframes_.begin(), it);
144
+ }
145
+
146
+ } // namespace reanimated::css
@@ -0,0 +1,71 @@
1
+ #pragma once
2
+
3
+ #include <reanimated/CSS/common/values/CSSValueVariant.h>
4
+ #include <reanimated/CSS/interpolation/PropertyInterpolator.h>
5
+
6
+ #include <memory>
7
+ #include <optional>
8
+ #include <vector>
9
+
10
+ namespace reanimated::css {
11
+
12
+ struct ValueKeyframe {
13
+ double offset;
14
+ std::optional<std::shared_ptr<CSSValue>> value;
15
+ ValueKeyframe() : offset(0.0), value(std::nullopt) {}
16
+ ValueKeyframe(double offset, std::optional<std::shared_ptr<CSSValue>> value = std::nullopt)
17
+ : offset(offset), value(std::move(value)) {}
18
+ };
19
+
20
+ /**
21
+ * Base class for CSS value interpolators that provides common functionality
22
+ * for interpolating CSS values during animations. This class should be extended
23
+ * by concrete implementations for specific CSS value types to provide
24
+ * type-specific interpolation logic.
25
+ */
26
+ class ValueInterpolator : public PropertyInterpolator {
27
+ public:
28
+ explicit ValueInterpolator(
29
+ const PropertyPath &propertyPath,
30
+ const std::shared_ptr<CSSValue> &defaultValue,
31
+ const std::shared_ptr<ViewStylesRepository> &viewStylesRepository);
32
+ virtual ~ValueInterpolator() = default;
33
+
34
+ folly::dynamic getStyleValue(const std::shared_ptr<const ShadowNode> &shadowNode) const override;
35
+ folly::dynamic getResetStyle(const std::shared_ptr<const ShadowNode> &shadowNode) const override;
36
+ folly::dynamic getFirstKeyframeValue() const override;
37
+ folly::dynamic getLastKeyframeValue() const override;
38
+ bool equalsReversingAdjustedStartValue(const folly::dynamic &propertyValue) const override;
39
+
40
+ void updateKeyframes(jsi::Runtime &rt, const jsi::Value &keyframes) override;
41
+ void updateKeyframesFromStyleChange(
42
+ const folly::dynamic &oldStyleValue,
43
+ const folly::dynamic &newStyleValue,
44
+ const folly::dynamic &lastUpdateValue) override;
45
+
46
+ folly::dynamic interpolate(
47
+ const std::shared_ptr<const ShadowNode> &shadowNode,
48
+ const std::shared_ptr<KeyframeProgressProvider> &progressProvider,
49
+ double fallbackInterpolateThreshold) const override;
50
+
51
+ protected:
52
+ std::vector<ValueKeyframe> keyframes_;
53
+ std::shared_ptr<CSSValue> defaultStyleValue_;
54
+ folly::dynamic defaultStyleValueDynamic_;
55
+ folly::dynamic reversingAdjustedStartValue_;
56
+
57
+ virtual std::shared_ptr<CSSValue> createValue(jsi::Runtime &rt, const jsi::Value &value) const = 0;
58
+ virtual std::shared_ptr<CSSValue> createValue(const folly::dynamic &value) const = 0;
59
+ virtual folly::dynamic interpolateValue(
60
+ double progress,
61
+ const std::shared_ptr<CSSValue> &fromValue,
62
+ const std::shared_ptr<CSSValue> &toValue,
63
+ const ValueInterpolationContext &context) const = 0;
64
+
65
+ private:
66
+ folly::dynamic convertOptionalToDynamic(const std::optional<std::shared_ptr<CSSValue>> &value) const;
67
+ std::shared_ptr<CSSValue> getFallbackValue(const std::shared_ptr<const ShadowNode> &shadowNode) const;
68
+ size_t getToKeyframeIndex(const std::shared_ptr<KeyframeProgressProvider> &progressProvider) const;
69
+ };
70
+
71
+ } // namespace reanimated::css