@react-native-ohos/react-native-reanimated 3.18.2-rc.2 → 4.0.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 +1 -1
  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 +94 -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 +45 -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 +111 -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 +1380 -971
  187. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/NativeModules/ReanimatedModuleProxy.h +230 -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 +63 -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 +69 -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 +84 -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,52 +0,0 @@
1
- #include <worklets/Tools/AsyncQueue.h>
2
-
3
- #include <utility>
4
-
5
- namespace worklets {
6
-
7
- AsyncQueue::AsyncQueue(std::string name)
8
- : state_(std::make_shared<AsyncQueueState>()) {
9
- auto thread = std::thread([name, state = state_] {
10
- #if __APPLE__
11
- pthread_setname_np(name.c_str());
12
- #endif
13
- while (state->running) {
14
- std::unique_lock<std::mutex> lock(state->mutex);
15
- state->cv.wait(
16
- lock, [state] { return !state->queue.empty() || !state->running; });
17
- if (!state->running) {
18
- return;
19
- }
20
- if (state->queue.empty()) {
21
- continue;
22
- }
23
- auto job = std::move(state->queue.front());
24
- state->queue.pop();
25
- lock.unlock();
26
- job();
27
- }
28
- });
29
- #ifdef ANDROID
30
- pthread_setname_np(thread.native_handle(), name.c_str());
31
- #endif
32
- thread.detach();
33
- }
34
-
35
- AsyncQueue::~AsyncQueue() {
36
- {
37
- std::unique_lock<std::mutex> lock(state_->mutex);
38
- state_->running = false;
39
- state_->queue = {};
40
- }
41
- state_->cv.notify_all();
42
- }
43
-
44
- void AsyncQueue::push(std::function<void()> &&job) {
45
- {
46
- std::unique_lock<std::mutex> lock(state_->mutex);
47
- state_->queue.emplace(job);
48
- }
49
- state_->cv.notify_one();
50
- }
51
-
52
- } // namespace worklets
@@ -1,35 +0,0 @@
1
- #pragma once
2
-
3
- #include <jsi/jsi.h>
4
-
5
- #include <atomic>
6
- #include <condition_variable>
7
- #include <memory>
8
- #include <queue>
9
- #include <string>
10
- #include <thread>
11
- #include <utility>
12
- #include <vector>
13
-
14
- namespace worklets {
15
-
16
- struct AsyncQueueState {
17
- std::atomic_bool running{true};
18
- std::mutex mutex;
19
- std::condition_variable cv;
20
- std::queue<std::function<void()>> queue;
21
- };
22
-
23
- class AsyncQueue {
24
- public:
25
- explicit AsyncQueue(std::string name);
26
-
27
- ~AsyncQueue();
28
-
29
- void push(std::function<void()> &&job);
30
-
31
- private:
32
- const std::shared_ptr<AsyncQueueState> state_;
33
- };
34
-
35
- } // namespace worklets
@@ -1,10 +0,0 @@
1
- #pragma once
2
-
3
- /*
4
- On Android JS_RUNTIME_HERMES is set in CMakeList.txt,
5
- but on iOS there is no simple way to defect if Hermes exists
6
- so we have to check if headers are available.
7
- */
8
- #if __APPLE__ && __has_include(<hermes/hermes.h>)
9
- #define JS_RUNTIME_HERMES 1
10
- #endif
@@ -1,342 +0,0 @@
1
- #include <worklets/Tools/JSISerializer.h>
2
-
3
- #include <cxxabi.h>
4
- #include <iostream>
5
- #include <sstream>
6
-
7
- namespace worklets {
8
-
9
- const std::vector<std::string> SUPPORTED_ERROR_TYPES = {
10
- "Error",
11
- "AggregateError",
12
- "EvalError",
13
- "RangeError",
14
- "ReferenceError",
15
- "SyntaxError",
16
- "TypeError",
17
- "URIError",
18
- "InternalError"};
19
-
20
- const std::vector<std::string> SUPPORTED_INDEXED_COLLECTION_TYPES = {
21
- "Int8Array",
22
- "Uint8Array",
23
- "Uint8ClampedArray",
24
- "Int16Array",
25
- "Uint16Array",
26
- "Int32Array",
27
- "Uint32Array",
28
- "BigInt64Array",
29
- "BigUint64Array",
30
- "Float32Array",
31
- "Float64Array",
32
- };
33
-
34
- const std::vector<std::string> SUPPORTED_STRUCTURED_DATA_TYPES = {
35
- "ArrayBuffer",
36
- "SharedArrayBuffer",
37
- "DataView",
38
- "Atomics",
39
- "JSON",
40
- };
41
-
42
- const std::vector<std::string> SUPPORTED_MANAGING_MEMORY_TYPES = {
43
- "WeakRef",
44
- "FinalizationRegistry",
45
- };
46
-
47
- const std::vector<std::string> SUPPORTED_ABSTRACTION_OBJECT_TYPES = {
48
- "Iterator",
49
- "AsyncIterator",
50
- "Promise",
51
- "GeneratorFunction",
52
- "AsyncGeneratorFunction",
53
- "Generator",
54
- "AsyncGenerator",
55
- "AsyncFunction",
56
- };
57
-
58
- const std::vector<std::string> SUPPORTED_REFLECTION_TYPES = {
59
- "Reflect",
60
- "Proxy",
61
- };
62
-
63
- static inline std::string getObjectTypeName(
64
- jsi::Runtime &rt,
65
- const jsi::Object &object) {
66
- return object.getPropertyAsObject(rt, "constructor")
67
- .getProperty(rt, "name")
68
- .toString(rt)
69
- .utf8(rt);
70
- }
71
-
72
- static inline bool isInstanceOf(
73
- jsi::Runtime &rt,
74
- const jsi::Object &object,
75
- const std::string &type) {
76
- return getObjectTypeName(rt, object) == type;
77
- }
78
-
79
- static inline bool isInstanceOfAny(
80
- jsi::Runtime &rt,
81
- const jsi::Object &object,
82
- const std::vector<std::string> &supportedTypes) {
83
- auto instanceType = getObjectTypeName(rt, object);
84
-
85
- return std::find(
86
- supportedTypes.begin(), supportedTypes.end(), instanceType) !=
87
- supportedTypes.end();
88
- }
89
-
90
- JSISerializer::JSISerializer(jsi::Runtime &rt)
91
- : rt_(rt),
92
- visitedNodes_(rt_.global()
93
- .getPropertyAsFunction(rt_, "Set")
94
- .callAsConstructor(rt_)
95
- .asObject(rt_)) {}
96
-
97
- std::string JSISerializer::stringifyWithName(const jsi::Object &object) {
98
- std::stringstream ss;
99
- ss << '[' << getObjectTypeName(rt_, object) << ']';
100
-
101
- return ss.str();
102
- }
103
-
104
- std::string JSISerializer::stringifyArray(const jsi::Array &arr) {
105
- std::stringstream ss;
106
- ss << '[';
107
-
108
- for (size_t i = 0, length = arr.size(rt_); i < length; i++) {
109
- jsi::Value element = arr.getValueAtIndex(rt_, i);
110
- ss << stringifyJSIValueRecursively(element);
111
- if (i != length - 1) {
112
- ss << ", ";
113
- }
114
- }
115
-
116
- ss << ']';
117
-
118
- return ss.str();
119
- }
120
-
121
- std::string JSISerializer::stringifyFunction(const jsi::Function &func) {
122
- std::stringstream ss;
123
- auto kind = (func.isHostFunction(rt_) ? "jsi::HostFunction" : "Function");
124
- auto name = func.getProperty(rt_, "name").toString(rt_).utf8(rt_);
125
- name = name.empty() ? "anonymous" : name;
126
-
127
- ss << '[' << kind << ' ' << name << ']';
128
- return ss.str();
129
- }
130
-
131
- std::string JSISerializer::stringifyHostObject(jsi::HostObject &hostObject) {
132
- int status = -1;
133
- char *hostObjClassName =
134
- abi::__cxa_demangle(typeid(hostObject).name(), NULL, NULL, &status);
135
- if (status != 0) {
136
- return "[jsi::HostObject]";
137
- }
138
-
139
- std::stringstream ss;
140
- ss << "[jsi::HostObject(" << hostObjClassName << ")";
141
- std::free(hostObjClassName);
142
-
143
- auto props = hostObject.getPropertyNames(rt_);
144
- auto propsCount = props.size();
145
-
146
- if (propsCount > 0) {
147
- ss << " {";
148
- auto lastKey = props.back().utf8(rt_);
149
- for (const auto &key : props) {
150
- auto formattedKey = key.utf8(rt_);
151
- auto value = hostObject.get(rt_, key);
152
- ss << '"' << formattedKey << '"' << ": "
153
- << stringifyJSIValueRecursively(value);
154
- if (formattedKey != lastKey) {
155
- ss << ", ";
156
- }
157
- }
158
- ss << '}';
159
- }
160
- ss << ']';
161
-
162
- return ss.str();
163
- }
164
-
165
- std::string JSISerializer::stringifyObject(const jsi::Object &object) {
166
- std::stringstream ss;
167
- ss << '{';
168
-
169
- auto props = object.getPropertyNames(rt_);
170
-
171
- for (size_t i = 0, propsCount = props.size(rt_); i < propsCount; i++) {
172
- jsi::String propName = props.getValueAtIndex(rt_, i).toString(rt_);
173
- ss << '"' << propName.utf8(rt_) << '"' << ": "
174
- << stringifyJSIValueRecursively(object.getProperty(rt_, propName));
175
- if (i != propsCount - 1) {
176
- ss << ", ";
177
- }
178
- }
179
-
180
- ss << '}';
181
-
182
- return ss.str();
183
- }
184
-
185
- std::string JSISerializer::stringifyError(const jsi::Object &object) {
186
- std::stringstream ss;
187
- ss << '[' << object.getProperty(rt_, "name").toString(rt_).utf8(rt_) << ": "
188
- << object.getProperty(rt_, "message").toString(rt_).utf8(rt_) << ']';
189
- return ss.str();
190
- }
191
-
192
- std::string JSISerializer::stringifySet(const jsi::Object &object) {
193
- std::stringstream ss;
194
- jsi::Function arrayFrom = rt_.global()
195
- .getPropertyAsObject(rt_, "Array")
196
- .getPropertyAsFunction(rt_, "from");
197
- jsi::Object result = arrayFrom.call(rt_, object).asObject(rt_);
198
-
199
- if (!result.isArray(rt_)) {
200
- return "[Set]";
201
- }
202
-
203
- auto arr = result.asArray(rt_);
204
- ss << "Set {";
205
-
206
- for (size_t i = 0, length = arr.size(rt_); i < length; i++) {
207
- ss << stringifyJSIValueRecursively(arr.getValueAtIndex(rt_, i));
208
- if (i != length - 1) {
209
- ss << ", ";
210
- }
211
- }
212
-
213
- ss << '}';
214
-
215
- return ss.str();
216
- }
217
-
218
- std::string JSISerializer::stringifyMap(const jsi::Object &object) {
219
- std::stringstream ss;
220
- jsi::Function arrayFrom = rt_.global()
221
- .getPropertyAsObject(rt_, "Array")
222
- .getPropertyAsFunction(rt_, "from");
223
- jsi::Object result = arrayFrom.call(rt_, object).asObject(rt_);
224
-
225
- if (!result.isArray(rt_)) {
226
- return "[Map]";
227
- }
228
-
229
- auto arr = result.asArray(rt_);
230
- ss << "Map {";
231
-
232
- for (size_t i = 0, length = arr.size(rt_); i < length; i++) {
233
- auto pair = arr.getValueAtIndex(rt_, i).asObject(rt_).getArray(rt_);
234
- auto key = pair.getValueAtIndex(rt_, 0);
235
- auto value = pair.getValueAtIndex(rt_, 1);
236
- ss << stringifyJSIValueRecursively(key) << ": "
237
- << stringifyJSIValueRecursively(value);
238
- if (i != length - 1) {
239
- ss << ", ";
240
- }
241
- }
242
-
243
- ss << '}';
244
-
245
- return ss.str();
246
- }
247
-
248
- std::string JSISerializer::stringifyRecursiveType(const jsi::Object &object) {
249
- auto type = getObjectTypeName(rt_, object);
250
-
251
- if (type == "Array") {
252
- return "[...]";
253
- }
254
- if (type == "Object") {
255
- return "{...}";
256
- }
257
- return "...";
258
- }
259
-
260
- std::string JSISerializer::stringifyWithToString(const jsi::Object &object) {
261
- return object.getPropertyAsFunction(rt_, "toString")
262
- .callWithThis(rt_, object)
263
- .toString(rt_)
264
- .utf8(rt_);
265
- }
266
-
267
- std::string JSISerializer::stringifyJSIValueRecursively(
268
- const jsi::Value &value,
269
- bool isTopLevel) {
270
- if (value.isBool() || value.isNumber()) {
271
- return value.toString(rt_).utf8(rt_);
272
- }
273
- if (value.isString()) {
274
- return isTopLevel ? value.getString(rt_).utf8(rt_)
275
- : '"' + value.getString(rt_).utf8(rt_) + '"';
276
- }
277
- if (value.isSymbol()) {
278
- return value.getSymbol(rt_).toString(rt_);
279
- }
280
- if (value.isBigInt()) {
281
- return value.getBigInt(rt_).toString(rt_).utf8(rt_) + 'n';
282
- }
283
- if (value.isUndefined()) {
284
- return "undefined";
285
- }
286
- if (value.isNull()) {
287
- return "null";
288
- }
289
- if (value.isObject()) {
290
- jsi::Object object = value.asObject(rt_);
291
-
292
- if (hasBeenVisited(object)) {
293
- return stringifyRecursiveType(object);
294
- }
295
- markAsVisited(object);
296
-
297
- if (object.isArray(rt_)) {
298
- return stringifyArray(object.getArray(rt_));
299
- }
300
- if (object.isFunction(rt_)) {
301
- return stringifyFunction(object.getFunction(rt_));
302
- }
303
- if (object.isHostObject(rt_)) {
304
- return stringifyHostObject(*object.getHostObject(rt_));
305
- }
306
- if (isInstanceOfAny(rt_, object, SUPPORTED_ERROR_TYPES)) {
307
- return stringifyError(object);
308
- }
309
- if (isInstanceOfAny(rt_, object, SUPPORTED_INDEXED_COLLECTION_TYPES) ||
310
- isInstanceOfAny(rt_, object, SUPPORTED_STRUCTURED_DATA_TYPES) ||
311
- isInstanceOfAny(rt_, object, SUPPORTED_MANAGING_MEMORY_TYPES) ||
312
- isInstanceOfAny(rt_, object, SUPPORTED_ABSTRACTION_OBJECT_TYPES) ||
313
- isInstanceOfAny(rt_, object, SUPPORTED_REFLECTION_TYPES) ||
314
- isInstanceOf(rt_, object, "Intl") ||
315
- isInstanceOf(rt_, object, "WeakMap") ||
316
- isInstanceOf(rt_, object, "WeakSet")) {
317
- // TODO: Consider extending this log info
318
- return stringifyWithName(object);
319
- }
320
- if (isInstanceOf(rt_, object, "Date") ||
321
- isInstanceOf(rt_, object, "RegExp")) {
322
- return stringifyWithToString(object);
323
- }
324
- if (isInstanceOf(rt_, object, "Map")) {
325
- return stringifyMap(object);
326
- }
327
- if (isInstanceOf(rt_, object, "Set")) {
328
- return stringifySet(object);
329
- }
330
- return stringifyObject(object);
331
- }
332
-
333
- throw std::runtime_error("[Reanimated] Unsupported value type.");
334
- }
335
-
336
- std::string stringifyJSIValue(jsi::Runtime &rt, const jsi::Value &value) {
337
- JSISerializer serializer(rt);
338
-
339
- return serializer.stringifyJSIValueRecursively(value, true);
340
- }
341
-
342
- } // namespace worklets
@@ -1,47 +0,0 @@
1
- #pragma once
2
-
3
- #include <jsi/jsi.h>
4
- #include <string>
5
- #include <vector>
6
-
7
- using namespace facebook;
8
-
9
- namespace worklets {
10
-
11
- class JSISerializer {
12
- public:
13
- explicit JSISerializer(jsi::Runtime &rt);
14
- std::string stringifyJSIValueRecursively(
15
- const jsi::Value &value,
16
- bool isTopLevel = false);
17
-
18
- private:
19
- std::string stringifyArray(const jsi::Array &arr);
20
- std::string stringifyFunction(const jsi::Function &func);
21
- std::string stringifyHostObject(jsi::HostObject &hostObject);
22
- std::string stringifyObject(const jsi::Object &object);
23
- std::string stringifyError(const jsi::Object &object);
24
- std::string stringifySet(const jsi::Object &object);
25
- std::string stringifyMap(const jsi::Object &object);
26
- std::string stringifyWithName(const jsi::Object &object);
27
- std::string stringifyWithToString(const jsi::Object &object);
28
- std::string stringifyRecursiveType(const jsi::Object &object);
29
-
30
- bool hasBeenVisited(const jsi::Object &object) {
31
- return visitedNodes_.getPropertyAsFunction(rt_, "has")
32
- .callWithThis(rt_, visitedNodes_, object)
33
- .getBool();
34
- }
35
-
36
- void markAsVisited(const jsi::Object &object) {
37
- visitedNodes_.getPropertyAsFunction(rt_, "add")
38
- .callWithThis(rt_, visitedNodes_, object);
39
- }
40
-
41
- jsi::Runtime &rt_;
42
- jsi::Object visitedNodes_;
43
- };
44
-
45
- std::string stringifyJSIValue(jsi::Runtime &rt, const jsi::Value &value);
46
-
47
- } // namespace worklets
@@ -1,16 +0,0 @@
1
- #include <worklets/Tools/JSLogger.h>
2
- #include <memory>
3
-
4
- namespace worklets {
5
-
6
- void JSLogger::warnOnJS(const std::string &warning) const {
7
- #ifndef NDEBUG
8
- jsScheduler_->scheduleOnJS([warning](jsi::Runtime &rt) {
9
- auto console = rt.global().getPropertyAsObject(rt, "console");
10
- auto warn = console.getPropertyAsFunction(rt, "warn");
11
- warn.call(rt, jsi::String::createFromUtf8(rt, warning));
12
- });
13
- #endif // NDEBUG
14
- }
15
-
16
- } // namespace worklets
@@ -1,20 +0,0 @@
1
- #pragma once
2
-
3
- #include <worklets/Tools/JSScheduler.h>
4
-
5
- #include <memory>
6
- #include <string>
7
-
8
- namespace worklets {
9
-
10
- class JSLogger {
11
- public:
12
- explicit JSLogger(const std::shared_ptr<JSScheduler> &jsScheduler)
13
- : jsScheduler_(jsScheduler) {}
14
- void warnOnJS(const std::string &warning) const;
15
-
16
- private:
17
- const std::shared_ptr<JSScheduler> jsScheduler_;
18
- };
19
-
20
- } // namespace worklets
@@ -1,20 +0,0 @@
1
- #include <worklets/Tools/JSScheduler.h>
2
-
3
- #include <utility>
4
-
5
- using namespace facebook;
6
- using namespace react;
7
-
8
- namespace worklets {
9
-
10
- JSScheduler::JSScheduler(
11
- jsi::Runtime &rnRuntime,
12
- const std::shared_ptr<CallInvoker> &jsCallInvoker)
13
- : scheduleOnJS([&](Job job) {
14
- jsCallInvoker_->invokeAsync(
15
- [job = std::move(job), &rt = rnRuntime_] { job(rt); });
16
- }),
17
- rnRuntime_(rnRuntime),
18
- jsCallInvoker_(jsCallInvoker) {}
19
-
20
- } // namespace worklets
@@ -1,29 +0,0 @@
1
- #pragma once
2
-
3
- #include <ReactCommon/CallInvoker.h>
4
- #include <ReactCommon/RuntimeExecutor.h>
5
- #include <jsi/jsi.h>
6
-
7
- #include <memory>
8
-
9
- using namespace facebook;
10
- using namespace react;
11
-
12
- namespace worklets {
13
-
14
- class JSScheduler {
15
- using Job = std::function<void(jsi::Runtime &rt)>;
16
-
17
- public:
18
- explicit JSScheduler(
19
- jsi::Runtime &rnRuntime,
20
- const std::shared_ptr<CallInvoker> &jsCallInvoker);
21
-
22
- const std::function<void(Job)> scheduleOnJS = nullptr;
23
-
24
- protected:
25
- jsi::Runtime &rnRuntime_;
26
- const std::shared_ptr<CallInvoker> jsCallInvoker_ = nullptr;
27
- };
28
-
29
- } // namespace worklets
@@ -1,16 +0,0 @@
1
- #pragma once
2
-
3
- #include <string>
4
-
5
- namespace worklets {
6
-
7
- class PlatformLogger {
8
- public:
9
- static void log(const char *str);
10
- static void log(const std::string &str);
11
- static void log(const double d);
12
- static void log(const int i);
13
- static void log(const bool b);
14
- };
15
-
16
- } // namespace worklets
@@ -1,26 +0,0 @@
1
- #include <worklets/Tools/ReanimatedJSIUtils.h>
2
- #include <vector>
3
-
4
- using namespace facebook;
5
-
6
- namespace worklets::jsi_utils {
7
-
8
- jsi::Array convertStringToArray(
9
- jsi::Runtime &rt,
10
- const std::string &value,
11
- const unsigned int expectedSize) {
12
- std::vector<float> transformMatrixList;
13
- std::istringstream stringStream(value);
14
- std::copy(
15
- std::istream_iterator<float>(stringStream),
16
- std::istream_iterator<float>(),
17
- std::back_inserter(transformMatrixList));
18
- assert(transformMatrixList.size() == expectedSize);
19
- jsi::Array matrix(rt, expectedSize);
20
- for (unsigned int i = 0; i < expectedSize; i++) {
21
- matrix.setValueAtIndex(rt, i, transformMatrixList[i]);
22
- }
23
- return matrix;
24
- }
25
-
26
- } // namespace worklets::jsi_utils