@react-native-ohos/react-native-reanimated 3.18.1-rc.6 → 4.0.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (275) hide show
  1. package/compatibility.json +161 -0
  2. package/harmony/reanimated/BuildProfile.ets +1 -1
  3. package/harmony/reanimated/build-profile.json5 +8 -1
  4. package/harmony/reanimated/oh-package.json5 +3 -2
  5. package/harmony/reanimated/src/main/cpp/CMakeLists.txt +31 -40
  6. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/AnimatedSensor/AnimatedSensorModule.cpp +11 -16
  7. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/AnimatedSensor/AnimatedSensorModule.h +3 -4
  8. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/InterpolatorRegistry.cpp +390 -0
  9. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/InterpolatorRegistry.h +16 -0
  10. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/definitions.h +30 -0
  11. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/filters/FilterOp.cpp +46 -0
  12. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/filters/FilterOp.h +23 -0
  13. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/transforms/Quaternion.cpp +53 -0
  14. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/transforms/Quaternion.h +21 -0
  15. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/transforms/TransformMatrix.cpp +166 -0
  16. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/transforms/TransformMatrix.h +71 -0
  17. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/transforms/TransformMatrix2D.cpp +368 -0
  18. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/transforms/TransformMatrix2D.h +53 -0
  19. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/transforms/TransformMatrix3D.cpp +594 -0
  20. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/transforms/TransformMatrix3D.h +67 -0
  21. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/transforms/TransformOp.cpp +52 -0
  22. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/transforms/TransformOp.h +26 -0
  23. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/transforms/vectors.cpp +156 -0
  24. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/transforms/vectors.h +76 -0
  25. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSAngle.cpp +93 -0
  26. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSAngle.h +33 -0
  27. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSBoolean.cpp +48 -0
  28. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSBoolean.h +31 -0
  29. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSColor.cpp +135 -0
  30. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSColor.h +61 -0
  31. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSDiscreteArray.cpp +100 -0
  32. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSDiscreteArray.h +44 -0
  33. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSKeyword.cpp +81 -0
  34. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSKeyword.h +53 -0
  35. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSLength.cpp +122 -0
  36. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSLength.h +38 -0
  37. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSNumber.cpp +82 -0
  38. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSNumber.h +63 -0
  39. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSValue.h +118 -0
  40. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSValueVariant.cpp +174 -0
  41. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSValueVariant.h +111 -0
  42. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/complex/CSSBoxShadow.cpp +196 -0
  43. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/complex/CSSBoxShadow.h +66 -0
  44. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/complex/CSSDropShadow.cpp +134 -0
  45. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/complex/CSSDropShadow.h +44 -0
  46. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/configs/CSSAnimationConfig.cpp +174 -0
  47. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/configs/CSSAnimationConfig.h +49 -0
  48. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/configs/CSSKeyframesConfig.cpp +45 -0
  49. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/configs/CSSKeyframesConfig.h +26 -0
  50. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/configs/CSSTransitionConfig.cpp +90 -0
  51. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/configs/CSSTransitionConfig.h +43 -0
  52. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/configs/common.cpp +17 -0
  53. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/configs/common.h +13 -0
  54. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/core/CSSAnimation.cpp +127 -0
  55. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/core/CSSAnimation.h +51 -0
  56. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/core/CSSTransition.cpp +145 -0
  57. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/core/CSSTransition.h +47 -0
  58. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/easing/EasingFunctions.cpp +69 -0
  59. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/easing/EasingFunctions.h +22 -0
  60. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/easing/cubicBezier.cpp +66 -0
  61. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/easing/cubicBezier.h +15 -0
  62. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/easing/linear.cpp +28 -0
  63. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/easing/linear.h +15 -0
  64. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/easing/steps.cpp +13 -0
  65. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/easing/steps.h +12 -0
  66. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/InterpolatorFactory.cpp +157 -0
  67. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/InterpolatorFactory.h +189 -0
  68. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/PropertyInterpolator.cpp +76 -0
  69. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/PropertyInterpolator.h +66 -0
  70. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/configs.h +20 -0
  71. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/FilterOperation.cpp +136 -0
  72. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/FilterOperation.h +40 -0
  73. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/FilterOperationInterpolator.cpp +38 -0
  74. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/FilterOperationInterpolator.h +24 -0
  75. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/FilterStyleInterpolator.cpp +58 -0
  76. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/FilterStyleInterpolator.h +24 -0
  77. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/operations/blur.h +14 -0
  78. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/operations/brightness.h +14 -0
  79. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/operations/contrast.h +14 -0
  80. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/operations/dropShadow.h +17 -0
  81. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/operations/grayscale.h +14 -0
  82. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/operations/hueRotate.h +14 -0
  83. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/operations/invert.h +14 -0
  84. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/operations/opacity.h +14 -0
  85. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/operations/saturate.h +14 -0
  86. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/operations/sepia.h +14 -0
  87. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/groups/ArrayPropertiesInterpolator.cpp +95 -0
  88. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/groups/ArrayPropertiesInterpolator.h +36 -0
  89. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/groups/GroupPropertiesInterpolator.cpp +41 -0
  90. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/groups/GroupPropertiesInterpolator.h +32 -0
  91. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/groups/RecordPropertiesInterpolator.cpp +99 -0
  92. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/groups/RecordPropertiesInterpolator.h +37 -0
  93. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/operations/OperationsStyleInterpolator.cpp +308 -0
  94. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/operations/OperationsStyleInterpolator.h +100 -0
  95. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/operations/StyleOperation.cpp +19 -0
  96. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/operations/StyleOperation.h +94 -0
  97. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/operations/StyleOperationInterpolator.cpp +18 -0
  98. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/operations/StyleOperationInterpolator.h +43 -0
  99. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/styles/AnimationStyleInterpolator.h +26 -0
  100. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/styles/TransitionStyleInterpolator.cpp +103 -0
  101. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/styles/TransitionStyleInterpolator.h +42 -0
  102. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/TransformOperation.cpp +224 -0
  103. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/TransformOperation.h +52 -0
  104. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/TransformOperationInterpolator.cpp +218 -0
  105. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/TransformOperationInterpolator.h +89 -0
  106. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/TransformsStyleInterpolator.cpp +149 -0
  107. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/TransformsStyleInterpolator.h +33 -0
  108. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/operations/matrix.cpp +208 -0
  109. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/operations/matrix.h +56 -0
  110. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/operations/perspective.cpp +42 -0
  111. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/operations/perspective.h +20 -0
  112. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/operations/rotate.cpp +41 -0
  113. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/operations/rotate.h +39 -0
  114. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/operations/scale.cpp +28 -0
  115. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/operations/scale.h +25 -0
  116. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/operations/skew.cpp +14 -0
  117. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/operations/skew.h +20 -0
  118. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/operations/translate.cpp +39 -0
  119. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/operations/translate.h +25 -0
  120. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/values/ResolvableValueInterpolator.cpp +47 -0
  121. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/values/ResolvableValueInterpolator.h +43 -0
  122. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/values/SimpleValueInterpolator.cpp +70 -0
  123. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/values/SimpleValueInterpolator.h +40 -0
  124. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/values/ValueInterpolator.cpp +146 -0
  125. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/values/ValueInterpolator.h +71 -0
  126. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/misc/ViewStylesRepository.cpp +155 -0
  127. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/misc/ViewStylesRepository.h +53 -0
  128. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/progress/AnimationProgressProvider.cpp +170 -0
  129. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/progress/AnimationProgressProvider.h +67 -0
  130. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/progress/KeyframeProgressProvider.h +12 -0
  131. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/progress/RawProgressProvider.cpp +41 -0
  132. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/progress/RawProgressProvider.h +31 -0
  133. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/progress/TransitionProgressProvider.cpp +193 -0
  134. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/progress/TransitionProgressProvider.h +77 -0
  135. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/registries/CSSAnimationsRegistry.cpp +340 -0
  136. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/registries/CSSAnimationsRegistry.h +80 -0
  137. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/registries/CSSKeyframesRegistry.cpp +45 -0
  138. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/registries/CSSKeyframesRegistry.h +29 -0
  139. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/registries/CSSTransitionsRegistry.cpp +167 -0
  140. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/registries/CSSTransitionsRegistry.h +51 -0
  141. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/registries/StaticPropsRegistry.cpp +61 -0
  142. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/registries/StaticPropsRegistry.h +33 -0
  143. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/svg/values/SVGBrush.cpp +80 -0
  144. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/svg/values/SVGBrush.h +39 -0
  145. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/svg/values/SVGLength.cpp +93 -0
  146. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/svg/values/SVGLength.h +36 -0
  147. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/svg/values/SVGStrokeDashArray.cpp +110 -0
  148. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/svg/values/SVGStrokeDashArray.h +33 -0
  149. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/utils/DelayedItemsManager.cpp +75 -0
  150. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/utils/DelayedItemsManager.h +45 -0
  151. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/utils/algorithms.cpp +12 -0
  152. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/utils/algorithms.h +10 -0
  153. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/utils/interpolators.cpp +36 -0
  154. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/utils/interpolators.h +23 -0
  155. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/utils/props.cpp +149 -0
  156. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/utils/props.h +32 -0
  157. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/ReanimatedCommitHook.cpp +51 -39
  158. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/ReanimatedCommitHook.h +13 -15
  159. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/ReanimatedCommitShadowNode.h +0 -3
  160. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/ReanimatedMountHook.cpp +22 -53
  161. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/ReanimatedMountHook.h +12 -8
  162. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/ShadowTreeCloner.cpp +46 -37
  163. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/ShadowTreeCloner.h +3 -10
  164. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/updates/AnimatedPropsRegistry.cpp +72 -0
  165. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/updates/AnimatedPropsRegistry.h +25 -0
  166. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/updates/UpdatesRegistry.cpp +160 -0
  167. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/updates/UpdatesRegistry.h +71 -0
  168. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/updates/UpdatesRegistryManager.cpp +161 -0
  169. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/updates/UpdatesRegistryManager.h +65 -0
  170. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationType.h +4 -2
  171. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsManager.cpp +62 -157
  172. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsManager.h +38 -46
  173. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxyCommon.cpp +79 -0
  174. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxyCommon.h +81 -0
  175. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxy_Experimental.cpp +864 -0
  176. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxy_Experimental.h +214 -0
  177. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/{LayoutAnimationsProxy.cpp → LayoutAnimationsProxy_Legacy.cpp} +303 -276
  178. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxy_Legacy.h +220 -0
  179. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsUtils.cpp +5 -65
  180. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsUtils.h +52 -82
  181. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/PropsDiffer.cpp +456 -0
  182. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/PropsDiffer.h +102 -0
  183. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/SharedTransitions.cpp +544 -0
  184. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/NativeModules/PropValueProcessor.cpp +119 -0
  185. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/NativeModules/PropValueProcessor.h +39 -0
  186. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/NativeModules/ReanimatedModuleProxy.cpp +957 -552
  187. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/NativeModules/ReanimatedModuleProxy.h +87 -111
  188. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/NativeModules/ReanimatedModuleProxySpec.cpp +115 -163
  189. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/NativeModules/ReanimatedModuleProxySpec.h +38 -54
  190. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/RuntimeDecorators/RNRuntimeDecorator.cpp +34 -36
  191. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/RuntimeDecorators/RNRuntimeDecorator.h +8 -0
  192. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/RuntimeDecorators/UIRuntimeDecorator.cpp +46 -58
  193. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/RuntimeDecorators/UIRuntimeDecorator.h +5 -9
  194. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Tools/FeatureFlags.cpp +18 -0
  195. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Tools/FeatureFlags.h +44 -0
  196. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Tools/PlatformDepMethodsHolder.h +26 -57
  197. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Tools/ReanimatedSystraceSection.h +12 -33
  198. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Tools/ReanimatedVersion.cpp +46 -0
  199. package/harmony/reanimated/src/main/cpp/Common/cpp/{worklets → reanimated}/Tools/ReanimatedVersion.h +3 -4
  200. package/harmony/reanimated/src/main/cpp/ReanimatedModule.cpp +60 -85
  201. package/harmony/reanimated/src/main/cpp/ReanimatedNodesManager.cpp +1 -0
  202. package/harmony/reanimated/src/main/cpp/ReanimatedPackage.cpp +0 -3
  203. package/harmony/reanimated/src/main/cpp/ReanimatedSensor.cpp +266 -0
  204. package/harmony/reanimated/src/main/cpp/ReanimatedSensor.h +36 -0
  205. package/harmony/reanimated/src/main/cpp/ReanimatedSensorContainer.cpp +36 -0
  206. package/harmony/reanimated/src/main/cpp/ReanimatedSensorContainer.h +23 -0
  207. package/harmony/reanimated/src/main/cpp/ReanimatedUIScheduler.h +3 -3
  208. package/harmony/reanimated/src/main/ets/ReanimatedModule.ts +12 -1
  209. package/harmony/reanimated/src/main/ets/ReanimatedPackage.ts +1 -4
  210. package/harmony/reanimated.har +0 -0
  211. package/package.json +36 -18
  212. package/scripts/deploy.js +191 -0
  213. package/scripts/set-reanimated-version.js +37 -0
  214. package/scripts/update-version.js +119 -0
  215. package/scripts/validate-react-native-version.js +46 -0
  216. package/scripts/validate-worklets-build.js +17 -0
  217. package/scripts/validate-worklets-version.js +79 -0
  218. package/scripts/worklets-version.json +4 -0
  219. package/LICENSE +0 -21
  220. package/README.OpenSource +0 -11
  221. package/README.md +0 -10
  222. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/PropsRegistry.cpp +0 -68
  223. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/PropsRegistry.h +0 -68
  224. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxy.h +0 -147
  225. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Tools/CollectionUtils.h +0 -14
  226. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Tools/FeaturesConfig.cpp +0 -5
  227. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Tools/FeaturesConfig.h +0 -19
  228. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/NativeModules/WorkletsModuleProxy.cpp +0 -47
  229. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/NativeModules/WorkletsModuleProxy.h +0 -59
  230. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/NativeModules/WorkletsModuleProxySpec.cpp +0 -27
  231. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/NativeModules/WorkletsModuleProxySpec.h +0 -25
  232. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Registries/EventHandlerRegistry.cpp +0 -94
  233. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Registries/EventHandlerRegistry.h +0 -49
  234. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Registries/WorkletRuntimeRegistry.cpp +0 -8
  235. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Registries/WorkletRuntimeRegistry.h +0 -39
  236. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/SharedItems/Shareables.cpp +0 -326
  237. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/SharedItems/Shareables.h +0 -345
  238. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/AsyncQueue.cpp +0 -52
  239. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/AsyncQueue.h +0 -35
  240. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/Defs.h +0 -10
  241. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/JSISerializer.cpp +0 -342
  242. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/JSISerializer.h +0 -47
  243. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/JSLogger.cpp +0 -16
  244. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/JSLogger.h +0 -20
  245. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/JSScheduler.cpp +0 -20
  246. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/JSScheduler.h +0 -29
  247. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/PlatformLogger.h +0 -16
  248. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/ReanimatedJSIUtils.cpp +0 -26
  249. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/ReanimatedJSIUtils.h +0 -199
  250. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/ReanimatedVersion.cpp +0 -95
  251. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/SingleInstanceChecker.h +0 -72
  252. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/ThreadSafeQueue.h +0 -49
  253. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/UIScheduler.cpp +0 -20
  254. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/UIScheduler.h +0 -22
  255. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/WorkletEventHandler.cpp +0 -29
  256. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/WorkletEventHandler.h +0 -41
  257. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/RNRuntimeWorkletDecorator.cpp +0 -16
  258. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/RNRuntimeWorkletDecorator.h +0 -19
  259. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/ReanimatedHermesRuntime.cpp +0 -112
  260. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/ReanimatedHermesRuntime.h +0 -127
  261. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/ReanimatedRuntime.cpp +0 -53
  262. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/ReanimatedRuntime.h +0 -22
  263. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/RuntimeInitialization.md +0 -191
  264. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/WorkletRuntime.cpp +0 -155
  265. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/WorkletRuntime.h +0 -90
  266. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/WorkletRuntimeCollector.h +0 -36
  267. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/WorkletRuntimeDecorator.cpp +0 -182
  268. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/WorkletRuntimeDecorator.h +0 -22
  269. package/harmony/reanimated/src/main/cpp/ReanimatedLogger.cpp +0 -33
  270. package/harmony/reanimated/src/main/cpp/WorkletsModule.cpp +0 -61
  271. package/harmony/reanimated/src/main/cpp/WorkletsModule.h +0 -22
  272. package/harmony/reanimated/src/main/cpp/patches/AnimatedSensor/AnimatedSensorModule.cpp +0 -89
  273. package/harmony/reanimated/src/main/cpp/patches/Fabric/ShadowTreeCloner.cpp +0 -95
  274. package/harmony/reanimated/src/main/cpp/patches/NativeModules/ReanimatedModuleProxy.cpp +0 -964
  275. package/harmony/reanimated/src/main/ets/WorkletsModule.ts +0 -15
@@ -1,147 +0,0 @@
1
- #pragma once
2
- #ifdef RCT_NEW_ARCH_ENABLED
3
-
4
- #include <reanimated/Fabric/PropsRegistry.h>
5
- #include <reanimated/LayoutAnimations/LayoutAnimationsManager.h>
6
- #include <reanimated/LayoutAnimations/LayoutAnimationsUtils.h>
7
-
8
- #include <worklets/Tools/UIScheduler.h>
9
-
10
- #include <react/renderer/componentregistry/ComponentDescriptorFactory.h>
11
- #include <react/renderer/mounting/MountingOverrideDelegate.h>
12
- #include <react/renderer/mounting/ShadowView.h>
13
-
14
- #include <memory>
15
- #include <string>
16
- #include <unordered_map>
17
- #include <unordered_set>
18
- #include <vector>
19
-
20
- namespace reanimated {
21
-
22
- class ReanimatedModuleProxy;
23
-
24
- using namespace facebook;
25
-
26
- struct LayoutAnimation {
27
- #if REACT_NATIVE_MINOR_VERSION >= 78
28
- std::shared_ptr<ShadowView> finalView, currentView;
29
- Tag parentTag;
30
- #else
31
- std::shared_ptr<ShadowView> finalView, currentView, parentView;
32
- #endif // REACT_NATIVE_MINOR_VERSION >= 78
33
- std::optional<double> opacity;
34
- int count = 1;
35
- LayoutAnimation &operator=(const LayoutAnimation &other) = default;
36
- };
37
-
38
- struct LayoutAnimationsProxy
39
- : public MountingOverrideDelegate,
40
- public std::enable_shared_from_this<LayoutAnimationsProxy> {
41
- mutable std::unordered_map<Tag, std::shared_ptr<Node>> nodeForTag_;
42
- mutable std::unordered_map<Tag, LayoutAnimation> layoutAnimations_;
43
- mutable std::recursive_mutex mutex;
44
- mutable SurfaceManager surfaceManager;
45
- mutable std::unordered_set<std::shared_ptr<MutationNode>> deadNodes;
46
- mutable std::unordered_map<Tag, int> leastRemoved;
47
- std::shared_ptr<LayoutAnimationsManager> layoutAnimationsManager_;
48
- ContextContainer::Shared contextContainer_;
49
- SharedComponentDescriptorRegistry componentDescriptorRegistry_;
50
- jsi::Runtime &uiRuntime_;
51
- const std::shared_ptr<UIScheduler> uiScheduler_;
52
- LayoutAnimationsProxy(
53
- std::shared_ptr<LayoutAnimationsManager> layoutAnimationsManager,
54
- SharedComponentDescriptorRegistry componentDescriptorRegistry,
55
- ContextContainer::Shared contextContainer,
56
- jsi::Runtime &uiRuntime,
57
- const std::shared_ptr<UIScheduler> uiScheduler)
58
- : layoutAnimationsManager_(layoutAnimationsManager),
59
- contextContainer_(contextContainer),
60
- componentDescriptorRegistry_(componentDescriptorRegistry),
61
- uiRuntime_(uiRuntime),
62
- uiScheduler_(uiScheduler) {}
63
-
64
- void startEnteringAnimation(const int tag, ShadowViewMutation &mutation)
65
- const;
66
- void startExitingAnimation(const int tag, ShadowViewMutation &mutation) const;
67
- void startLayoutAnimation(const int tag, const ShadowViewMutation &mutation)
68
- const;
69
-
70
- void transferConfigFromNativeID(const std::string nativeId, const int tag)
71
- const;
72
- std::optional<SurfaceId> progressLayoutAnimation(
73
- int tag,
74
- const jsi::Object &newStyle);
75
- std::optional<SurfaceId> endLayoutAnimation(int tag, bool shouldRemove);
76
- void maybeCancelAnimation(const int tag) const;
77
-
78
- void parseRemoveMutations(
79
- std::unordered_map<Tag, ShadowView> &movedViews,
80
- ShadowViewMutationList &mutations,
81
- std::vector<std::shared_ptr<MutationNode>> &roots) const;
82
- void handleRemovals(
83
- ShadowViewMutationList &filteredMutations,
84
- std::vector<std::shared_ptr<MutationNode>> &roots) const;
85
-
86
- void handleUpdatesAndEnterings(
87
- ShadowViewMutationList &filteredMutations,
88
- const std::unordered_map<Tag, ShadowView> &movedViews,
89
- ShadowViewMutationList &mutations,
90
- const PropsParserContext &propsParserContext,
91
- SurfaceId surfaceId) const;
92
- void addOngoingAnimations(
93
- SurfaceId surfaceId,
94
- ShadowViewMutationList &mutations) const;
95
- void updateOngoingAnimationTarget(
96
- const int tag,
97
- const ShadowViewMutation &mutation) const;
98
- std::shared_ptr<ShadowView> cloneViewWithoutOpacity(
99
- facebook::react::ShadowViewMutation &mutation,
100
- const PropsParserContext &propsParserContext) const;
101
- void maybeRestoreOpacity(
102
- LayoutAnimation &layoutAnimation,
103
- const jsi::Object &newStyle) const;
104
- void maybeUpdateWindowDimensions(
105
- facebook::react::ShadowViewMutation &mutation,
106
- SurfaceId surfaceId) const;
107
- void createLayoutAnimation(
108
- const ShadowViewMutation &mutation,
109
- ShadowView &oldView,
110
- const SurfaceId &surfaceId,
111
- const int tag) const;
112
-
113
- void updateIndexForMutation(ShadowViewMutation &mutation) const;
114
-
115
- void removeRecursively(
116
- std::shared_ptr<MutationNode> node,
117
- ShadowViewMutationList &mutations) const;
118
- bool startAnimationsRecursively(
119
- std::shared_ptr<MutationNode> node,
120
- const bool shouldRemoveSubviewsWithoutAnimations,
121
- const bool shouldAnimate,
122
- const bool isScreenPop,
123
- ShadowViewMutationList &mutations) const;
124
- void endAnimationsRecursively(
125
- std::shared_ptr<MutationNode> node,
126
- ShadowViewMutationList &mutations) const;
127
- void maybeDropAncestors(
128
- std::shared_ptr<Node> node,
129
- std::shared_ptr<MutationNode> child,
130
- ShadowViewMutationList &cleanupMutations) const;
131
-
132
- const ComponentDescriptor &getComponentDescriptorForShadowView(
133
- const ShadowView &shadowView) const;
134
-
135
- // MountingOverrideDelegate
136
-
137
- bool shouldOverridePullTransaction() const override;
138
- std::optional<MountingTransaction> pullTransaction(
139
- SurfaceId surfaceId,
140
- MountingTransaction::Number number,
141
- const TransactionTelemetry &telemetry,
142
- ShadowViewMutationList mutations) const override;
143
- };
144
-
145
- } // namespace reanimated
146
-
147
- #endif // RCT_NEW_ARCH_ENABLED
@@ -1,14 +0,0 @@
1
- #pragma once
2
-
3
- #include <algorithm>
4
-
5
- namespace reanimated {
6
- namespace collection {
7
-
8
- template <class CollectionType, class ValueType>
9
- inline bool contains(const CollectionType &collection, const ValueType &value) {
10
- return collection.find(value) != collection.end();
11
- }
12
-
13
- } // namespace collection
14
- } // namespace reanimated
@@ -1,5 +0,0 @@
1
- #include <reanimated/Tools/FeaturesConfig.h>
2
-
3
- namespace reanimated {
4
- bool FeaturesConfig::_isLayoutAnimationEnabled = false;
5
- }
@@ -1,19 +0,0 @@
1
- #pragma once
2
- #include <string>
3
-
4
- namespace reanimated {
5
-
6
- class FeaturesConfig {
7
- public:
8
- static inline bool isLayoutAnimationEnabled() {
9
- return _isLayoutAnimationEnabled;
10
- }
11
- static inline void setLayoutAnimationEnabled(bool isLayoutAnimationEnabled) {
12
- _isLayoutAnimationEnabled = isLayoutAnimationEnabled;
13
- }
14
-
15
- private:
16
- static bool _isLayoutAnimationEnabled;
17
- };
18
-
19
- } // namespace reanimated
@@ -1,47 +0,0 @@
1
- #include <string>
2
-
3
- #ifdef RCT_NEW_ARCH_ENABLED
4
- #include <react/renderer/uimanager/UIManagerBinding.h>
5
- #include <react/renderer/uimanager/primitives.h>
6
- #endif // RCT_NEW_ARCH_ENABLED
7
-
8
- #include <worklets/NativeModules/WorkletsModuleProxy.h>
9
- #include <worklets/SharedItems/Shareables.h>
10
- #include <worklets/Tools/Defs.h>
11
-
12
- #ifdef __ANDROID__
13
- #include <fbjni/fbjni.h>
14
- #endif // __ANDROID__
15
-
16
- #include <jsi/jsi.h>
17
-
18
- using namespace facebook;
19
-
20
- namespace worklets {
21
-
22
- WorkletsModuleProxy::WorkletsModuleProxy(
23
- const std::string &valueUnpackerCode,
24
- const std::shared_ptr<MessageQueueThread> &jsQueue,
25
- const std::shared_ptr<CallInvoker> &jsCallInvoker,
26
- const std::shared_ptr<JSScheduler> &jsScheduler,
27
- const std::shared_ptr<UIScheduler> &uiScheduler)
28
- : WorkletsModuleProxySpec(jsCallInvoker),
29
- valueUnpackerCode_(valueUnpackerCode),
30
- jsQueue_(jsQueue),
31
- jsScheduler_(jsScheduler),
32
- uiScheduler_(uiScheduler) {}
33
-
34
- WorkletsModuleProxy::~WorkletsModuleProxy() {}
35
-
36
- jsi::Value WorkletsModuleProxy::makeShareableClone(
37
- jsi::Runtime &rt,
38
- const jsi::Value &value,
39
- const jsi::Value &shouldRetainRemote,
40
- const jsi::Value &nativeStateSource) {
41
- // TODO: It might be a good idea to rename one of these methods to avoid
42
- // confusion.
43
- return worklets::makeShareableClone(
44
- rt, value, shouldRetainRemote, nativeStateSource);
45
- }
46
-
47
- } // namespace worklets
@@ -1,59 +0,0 @@
1
- #pragma once
2
-
3
- #include <cxxreact/MessageQueueThread.h>
4
- #include <worklets/NativeModules/WorkletsModuleProxySpec.h>
5
- #include <worklets/Tools/JSScheduler.h>
6
- #include <worklets/Tools/SingleInstanceChecker.h>
7
- #include <worklets/Tools/UIScheduler.h>
8
- #include <worklets/WorkletRuntime/WorkletRuntime.h>
9
- #include <memory>
10
- #include <string>
11
-
12
- namespace worklets {
13
-
14
- class WorkletsModuleProxy
15
- : public WorkletsModuleProxySpec,
16
- public std::enable_shared_from_this<WorkletsModuleProxy> {
17
- public:
18
- explicit WorkletsModuleProxy(
19
- const std::string &valueUnpackerCode,
20
- const std::shared_ptr<MessageQueueThread> &jsQueue,
21
- const std::shared_ptr<CallInvoker> &jsCallInvoker,
22
- const std::shared_ptr<JSScheduler> &jsScheduler,
23
- const std::shared_ptr<UIScheduler> &uiScheduler);
24
-
25
- ~WorkletsModuleProxy();
26
-
27
- jsi::Value makeShareableClone(
28
- jsi::Runtime &rt,
29
- const jsi::Value &value,
30
- const jsi::Value &shouldRetainRemote,
31
- const jsi::Value &nativeStateSource) override;
32
-
33
- [[nodiscard]] inline std::string getValueUnpackerCode() const {
34
- return valueUnpackerCode_;
35
- }
36
-
37
- [[nodiscard]] inline std::shared_ptr<MessageQueueThread> getJSQueue() const {
38
- return jsQueue_;
39
- }
40
-
41
- [[nodiscard]] inline std::shared_ptr<JSScheduler> getJSScheduler() const {
42
- return jsScheduler_;
43
- }
44
-
45
- [[nodiscard]] inline std::shared_ptr<UIScheduler> getUIScheduler() const {
46
- return uiScheduler_;
47
- }
48
-
49
- private:
50
- const std::string valueUnpackerCode_;
51
- const std::shared_ptr<MessageQueueThread> jsQueue_;
52
- const std::shared_ptr<JSScheduler> jsScheduler_;
53
- const std::shared_ptr<UIScheduler> uiScheduler_;
54
- #ifndef NDEBUG
55
- SingleInstanceChecker<WorkletsModuleProxy> singleInstanceChecker_;
56
- #endif // NDEBUG
57
- };
58
-
59
- } // namespace worklets
@@ -1,27 +0,0 @@
1
- #include <worklets/NativeModules/WorkletsModuleProxySpec.h>
2
-
3
- #include <utility>
4
-
5
- #define WORKLETS_SPEC_PREFIX(FN_NAME) \
6
- __hostFunction_WorkletsModuleProxySpec_##FN_NAME
7
-
8
- namespace worklets {
9
-
10
- static jsi::Value WORKLETS_SPEC_PREFIX(makeShareableClone)(
11
- jsi::Runtime &rt,
12
- TurboModule &turboModule,
13
- const jsi::Value *args,
14
- size_t) {
15
- return static_cast<WorkletsModuleProxySpec *>(&turboModule)
16
- ->makeShareableClone(
17
- rt, std::move(args[0]), std::move(args[1]), std::move(args[2]));
18
- }
19
-
20
- WorkletsModuleProxySpec::WorkletsModuleProxySpec(
21
- const std::shared_ptr<CallInvoker> jsInvoker)
22
- : TurboModule("NativeWorklets", jsInvoker) {
23
- methodMap_["makeShareableClone"] =
24
- MethodMetadata{2, WORKLETS_SPEC_PREFIX(makeShareableClone)};
25
- }
26
-
27
- } // namespace worklets
@@ -1,25 +0,0 @@
1
- #pragma once
2
-
3
- #include <ReactCommon/CallInvoker.h>
4
- #include <ReactCommon/TurboModule.h>
5
- #include <memory>
6
-
7
- using namespace facebook;
8
- using namespace react;
9
-
10
- namespace worklets {
11
-
12
- class JSI_EXPORT WorkletsModuleProxySpec : public TurboModule {
13
- protected:
14
- explicit WorkletsModuleProxySpec(
15
- const std::shared_ptr<CallInvoker> jsInvoker);
16
-
17
- public:
18
- virtual jsi::Value makeShareableClone(
19
- jsi::Runtime &rt,
20
- const jsi::Value &value,
21
- const jsi::Value &shouldRetainRemote,
22
- const jsi::Value &nativeStateSource) = 0;
23
- };
24
-
25
- } // namespace worklets
@@ -1,94 +0,0 @@
1
- #include <worklets/Registries/EventHandlerRegistry.h>
2
- #include <worklets/Tools/WorkletEventHandler.h>
3
-
4
- #include <utility>
5
- #include <vector>
6
-
7
- namespace worklets {
8
-
9
- void EventHandlerRegistry::registerEventHandler(
10
- const std::shared_ptr<WorkletEventHandler> &eventHandler) {
11
- const std::lock_guard<std::mutex> lock(instanceMutex);
12
- const auto &eventName = eventHandler->getEventName();
13
- auto handlerId = eventHandler->getHandlerId();
14
-
15
- if (eventHandler->shouldIgnoreEmitterReactTag()) {
16
- eventMappingsWithoutTag[eventName][handlerId] = eventHandler;
17
- } else {
18
- const auto emitterReactTag = eventHandler->getEmitterReactTag();
19
- const auto eventHash = std::make_pair(emitterReactTag, eventName);
20
- eventMappingsWithTag[eventHash][handlerId] = eventHandler;
21
- }
22
- eventHandlers[handlerId] = eventHandler;
23
- }
24
-
25
- void EventHandlerRegistry::unregisterEventHandler(const uint64_t id) {
26
- const std::lock_guard<std::mutex> lock(instanceMutex);
27
- auto handlerIt = eventHandlers.find(id);
28
- if (handlerIt != eventHandlers.end()) {
29
- const auto &eventHandler = handlerIt->second;
30
- const auto &eventName = eventHandler->getEventName();
31
-
32
- if (eventHandler->shouldIgnoreEmitterReactTag()) {
33
- const auto eventMappingIt = eventMappingsWithoutTag.find(eventName);
34
- auto &handlersMap = eventMappingIt->second;
35
- handlersMap.erase(id);
36
- if (handlersMap.empty()) {
37
- eventMappingsWithoutTag.erase(eventMappingIt);
38
- }
39
- } else {
40
- const auto emitterReactTag = eventHandler->getEmitterReactTag();
41
- const auto eventHash = std::make_pair(emitterReactTag, eventName);
42
- const auto eventMappingIt = eventMappingsWithTag.find(eventHash);
43
- auto &handlersMap = eventMappingIt->second;
44
- handlersMap.erase(id);
45
- if (handlersMap.empty()) {
46
- eventMappingsWithTag.erase(eventMappingIt);
47
- }
48
- }
49
- eventHandlers.erase(handlerIt);
50
- }
51
- }
52
-
53
- void EventHandlerRegistry::processEvent(
54
- const std::shared_ptr<WorkletRuntime> &uiWorkletRuntime,
55
- const double eventTimestamp,
56
- const std::string &eventName,
57
- const int emitterReactTag,
58
- const jsi::Value &eventPayload) {
59
- std::vector<std::shared_ptr<WorkletEventHandler>> handlersForEvent;
60
- {
61
- const std::lock_guard<std::mutex> lock(instanceMutex);
62
- auto handlersIt = eventMappingsWithoutTag.find(eventName);
63
- if (handlersIt != eventMappingsWithoutTag.end()) {
64
- for (auto handler : handlersIt->second) {
65
- handlersForEvent.push_back(handler.second);
66
- }
67
- }
68
- const auto eventHash = std::make_pair(emitterReactTag, eventName);
69
- auto handlersWithTagIt = eventMappingsWithTag.find(eventHash);
70
- if (handlersWithTagIt != eventMappingsWithTag.end()) {
71
- for (auto handler : handlersWithTagIt->second) {
72
- handlersForEvent.push_back(handler.second);
73
- }
74
- }
75
- }
76
-
77
- jsi::Runtime &rt = uiWorkletRuntime->getJSIRuntime();
78
- eventPayload.asObject(rt).setProperty(
79
- rt, "eventName", jsi::String::createFromUtf8(rt, eventName));
80
- for (auto handler : handlersForEvent) {
81
- handler->process(uiWorkletRuntime, eventTimestamp, eventPayload);
82
- }
83
- }
84
-
85
- bool EventHandlerRegistry::isAnyHandlerWaitingForEvent(
86
- const std::string &eventName,
87
- const int emitterReactTag) {
88
- const std::lock_guard<std::mutex> lock(instanceMutex);
89
- const auto eventHash = std::make_pair(emitterReactTag, eventName);
90
- auto it = eventMappingsWithTag.find(eventHash);
91
- return it != eventMappingsWithTag.end() && !it->second.empty();
92
- }
93
-
94
- } // namespace worklets
@@ -1,49 +0,0 @@
1
- #pragma once
2
-
3
- #include <worklets/WorkletRuntime/WorkletRuntime.h>
4
-
5
- #include <jsi/jsi.h>
6
-
7
- #include <map>
8
- #include <memory>
9
- #include <mutex>
10
- #include <string>
11
- #include <unordered_map>
12
- #include <utility>
13
-
14
- using namespace facebook;
15
-
16
- namespace worklets {
17
-
18
- class WorkletEventHandler;
19
-
20
- class EventHandlerRegistry {
21
- std::map<
22
- std::pair<int, std::string>,
23
- std::unordered_map<uint64_t, std::shared_ptr<WorkletEventHandler>>>
24
- eventMappingsWithTag;
25
- std::map<
26
- std::string,
27
- std::unordered_map<uint64_t, std::shared_ptr<WorkletEventHandler>>>
28
- eventMappingsWithoutTag;
29
- std::map<uint64_t, std::shared_ptr<WorkletEventHandler>> eventHandlers;
30
- std::mutex instanceMutex;
31
-
32
- public:
33
- void registerEventHandler(
34
- const std::shared_ptr<WorkletEventHandler> &eventHandler);
35
- void unregisterEventHandler(const uint64_t id);
36
-
37
- void processEvent(
38
- const std::shared_ptr<WorkletRuntime> &uiWorkletRuntime,
39
- const double eventTimestamp,
40
- const std::string &eventName,
41
- const int emitterReactTag,
42
- const jsi::Value &eventPayload);
43
-
44
- bool isAnyHandlerWaitingForEvent(
45
- const std::string &eventName,
46
- const int emitterReactTag);
47
- };
48
-
49
- } // namespace worklets
@@ -1,8 +0,0 @@
1
- #include <worklets/Registries/WorkletRuntimeRegistry.h>
2
-
3
- namespace worklets {
4
-
5
- std::set<jsi::Runtime *> WorkletRuntimeRegistry::registry_{};
6
- std::mutex WorkletRuntimeRegistry::mutex_{};
7
-
8
- } // namespace worklets
@@ -1,39 +0,0 @@
1
- #pragma once
2
-
3
- #include <jsi/jsi.h>
4
-
5
- #include <mutex>
6
- #include <set>
7
-
8
- using namespace facebook;
9
-
10
- namespace worklets {
11
-
12
- class WorkletRuntimeRegistry {
13
- private:
14
- static std::set<jsi::Runtime *> registry_;
15
- static std::mutex mutex_; // Protects `registry_`.
16
-
17
- WorkletRuntimeRegistry() {} // private ctor
18
-
19
- static void registerRuntime(jsi::Runtime &runtime) {
20
- std::lock_guard<std::mutex> lock(mutex_);
21
- registry_.insert(&runtime);
22
- }
23
-
24
- static void unregisterRuntime(jsi::Runtime &runtime) {
25
- std::lock_guard<std::mutex> lock(mutex_);
26
- registry_.erase(&runtime);
27
- }
28
-
29
- friend class WorkletRuntimeCollector;
30
-
31
- public:
32
- static bool isRuntimeAlive(jsi::Runtime *runtime) {
33
- assert(runtime != nullptr);
34
- std::lock_guard<std::mutex> lock(mutex_);
35
- return registry_.find(runtime) != registry_.end();
36
- }
37
- };
38
-
39
- } // namespace worklets