react-native-reanimated 3.17.0-rc.1 → 4.0.0-beta.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 (696) hide show
  1. package/Common/cpp/reanimated/CSS/common/Quaternion.cpp +58 -0
  2. package/Common/cpp/reanimated/CSS/common/Quaternion.h +28 -0
  3. package/Common/cpp/reanimated/CSS/common/TransformMatrix.cpp +634 -0
  4. package/Common/cpp/reanimated/CSS/common/TransformMatrix.h +106 -0
  5. package/Common/cpp/reanimated/CSS/common/definitions.h +30 -0
  6. package/Common/cpp/reanimated/CSS/common/values/CSSAngle.cpp +95 -0
  7. package/Common/cpp/reanimated/CSS/common/values/CSSAngle.h +42 -0
  8. package/Common/cpp/reanimated/CSS/common/values/CSSBoolean.cpp +50 -0
  9. package/Common/cpp/reanimated/CSS/common/values/CSSBoolean.h +39 -0
  10. package/Common/cpp/reanimated/CSS/common/values/CSSColor.cpp +136 -0
  11. package/Common/cpp/reanimated/CSS/common/values/CSSColor.h +53 -0
  12. package/Common/cpp/reanimated/CSS/common/values/CSSDimension.cpp +131 -0
  13. package/Common/cpp/reanimated/CSS/common/values/CSSDimension.h +45 -0
  14. package/Common/cpp/reanimated/CSS/common/values/CSSDiscreteArray.cpp +111 -0
  15. package/Common/cpp/reanimated/CSS/common/values/CSSDiscreteArray.h +55 -0
  16. package/Common/cpp/reanimated/CSS/common/values/CSSKeyword.cpp +100 -0
  17. package/Common/cpp/reanimated/CSS/common/values/CSSKeyword.h +62 -0
  18. package/Common/cpp/reanimated/CSS/common/values/CSSNumber.cpp +90 -0
  19. package/Common/cpp/reanimated/CSS/common/values/CSSNumber.h +73 -0
  20. package/Common/cpp/reanimated/CSS/common/values/CSSValue.h +100 -0
  21. package/Common/cpp/reanimated/CSS/common/values/CSSValueVariant.h +258 -0
  22. package/Common/cpp/reanimated/CSS/common/vectors.cpp +104 -0
  23. package/Common/cpp/reanimated/CSS/common/vectors.h +59 -0
  24. package/Common/cpp/reanimated/CSS/config/CSSAnimationConfig.cpp +135 -0
  25. package/Common/cpp/reanimated/CSS/config/CSSAnimationConfig.h +66 -0
  26. package/Common/cpp/reanimated/CSS/config/CSSTransitionConfig.cpp +87 -0
  27. package/Common/cpp/reanimated/CSS/config/CSSTransitionConfig.h +50 -0
  28. package/Common/cpp/reanimated/CSS/config/PropertyInterpolatorsConfig.h +300 -0
  29. package/Common/cpp/reanimated/CSS/config/common.cpp +20 -0
  30. package/Common/cpp/reanimated/CSS/config/common.h +16 -0
  31. package/Common/cpp/reanimated/CSS/core/CSSAnimation.cpp +147 -0
  32. package/Common/cpp/reanimated/CSS/core/CSSAnimation.h +61 -0
  33. package/Common/cpp/reanimated/CSS/core/CSSTransition.cpp +94 -0
  34. package/Common/cpp/reanimated/CSS/core/CSSTransition.h +49 -0
  35. package/Common/cpp/reanimated/CSS/easing/EasingFunctions.cpp +77 -0
  36. package/Common/cpp/reanimated/CSS/easing/EasingFunctions.h +31 -0
  37. package/Common/cpp/reanimated/CSS/easing/cubicBezier.cpp +79 -0
  38. package/Common/cpp/reanimated/CSS/easing/cubicBezier.h +18 -0
  39. package/Common/cpp/reanimated/CSS/easing/linear.cpp +35 -0
  40. package/Common/cpp/reanimated/CSS/easing/linear.h +23 -0
  41. package/Common/cpp/reanimated/CSS/easing/steps.cpp +16 -0
  42. package/Common/cpp/reanimated/CSS/easing/steps.h +17 -0
  43. package/Common/cpp/reanimated/CSS/interpolation/InterpolatorFactory.cpp +164 -0
  44. package/Common/cpp/reanimated/CSS/interpolation/InterpolatorFactory.h +163 -0
  45. package/Common/cpp/reanimated/CSS/interpolation/PropertyInterpolator.cpp +26 -0
  46. package/Common/cpp/reanimated/CSS/interpolation/PropertyInterpolator.h +87 -0
  47. package/Common/cpp/reanimated/CSS/interpolation/groups/ArrayPropertiesInterpolator.cpp +105 -0
  48. package/Common/cpp/reanimated/CSS/interpolation/groups/ArrayPropertiesInterpolator.h +45 -0
  49. package/Common/cpp/reanimated/CSS/interpolation/groups/GroupPropertiesInterpolator.cpp +69 -0
  50. package/Common/cpp/reanimated/CSS/interpolation/groups/GroupPropertiesInterpolator.h +42 -0
  51. package/Common/cpp/reanimated/CSS/interpolation/groups/RecordPropertiesInterpolator.cpp +126 -0
  52. package/Common/cpp/reanimated/CSS/interpolation/groups/RecordPropertiesInterpolator.h +44 -0
  53. package/Common/cpp/reanimated/CSS/interpolation/styles/AnimationStyleInterpolator.h +35 -0
  54. package/Common/cpp/reanimated/CSS/interpolation/styles/TransitionStyleInterpolator.cpp +123 -0
  55. package/Common/cpp/reanimated/CSS/interpolation/styles/TransitionStyleInterpolator.h +48 -0
  56. package/Common/cpp/reanimated/CSS/interpolation/transforms/TransformInterpolator.h +89 -0
  57. package/Common/cpp/reanimated/CSS/interpolation/transforms/TransformOperation.cpp +524 -0
  58. package/Common/cpp/reanimated/CSS/interpolation/transforms/TransformOperation.h +216 -0
  59. package/Common/cpp/reanimated/CSS/interpolation/transforms/TransformOperationInterpolator.cpp +68 -0
  60. package/Common/cpp/reanimated/CSS/interpolation/transforms/TransformOperationInterpolator.h +129 -0
  61. package/Common/cpp/reanimated/CSS/interpolation/transforms/TransformsStyleInterpolator.cpp +487 -0
  62. package/Common/cpp/reanimated/CSS/interpolation/transforms/TransformsStyleInterpolator.h +121 -0
  63. package/Common/cpp/reanimated/CSS/interpolation/values/ResolvableValueInterpolator.h +56 -0
  64. package/Common/cpp/reanimated/CSS/interpolation/values/ValueInterpolator.h +281 -0
  65. package/Common/cpp/reanimated/CSS/misc/ViewStylesRepository.cpp +187 -0
  66. package/Common/cpp/reanimated/CSS/misc/ViewStylesRepository.h +70 -0
  67. package/Common/cpp/reanimated/CSS/progress/AnimationProgressProvider.cpp +170 -0
  68. package/Common/cpp/reanimated/CSS/progress/AnimationProgressProvider.h +86 -0
  69. package/Common/cpp/reanimated/CSS/progress/KeyframeProgressProvider.h +19 -0
  70. package/Common/cpp/reanimated/CSS/progress/RawProgressProvider.cpp +49 -0
  71. package/Common/cpp/reanimated/CSS/progress/RawProgressProvider.h +37 -0
  72. package/Common/cpp/reanimated/CSS/progress/TransitionProgressProvider.cpp +228 -0
  73. package/Common/cpp/reanimated/CSS/progress/TransitionProgressProvider.h +97 -0
  74. package/Common/cpp/reanimated/CSS/registry/CSSAnimationsRegistry.cpp +279 -0
  75. package/Common/cpp/reanimated/CSS/registry/CSSAnimationsRegistry.h +77 -0
  76. package/Common/cpp/reanimated/CSS/registry/CSSTransitionsRegistry.cpp +152 -0
  77. package/Common/cpp/reanimated/CSS/registry/CSSTransitionsRegistry.h +56 -0
  78. package/Common/cpp/reanimated/CSS/registry/StaticPropsRegistry.cpp +58 -0
  79. package/Common/cpp/reanimated/CSS/registry/StaticPropsRegistry.h +42 -0
  80. package/Common/cpp/reanimated/CSS/util/DelayedItemsManager.cpp +95 -0
  81. package/Common/cpp/reanimated/CSS/util/DelayedItemsManager.h +56 -0
  82. package/Common/cpp/reanimated/CSS/util/algorithms.cpp +13 -0
  83. package/Common/cpp/reanimated/CSS/util/algorithms.h +13 -0
  84. package/Common/cpp/reanimated/CSS/util/interpolators.cpp +42 -0
  85. package/Common/cpp/reanimated/CSS/util/interpolators.h +28 -0
  86. package/Common/cpp/reanimated/CSS/util/keyframes.cpp +55 -0
  87. package/Common/cpp/reanimated/CSS/util/keyframes.h +18 -0
  88. package/Common/cpp/reanimated/CSS/util/props.cpp +337 -0
  89. package/Common/cpp/reanimated/CSS/util/props.h +48 -0
  90. package/Common/cpp/reanimated/Fabric/ReanimatedCommitHook.cpp +32 -28
  91. package/Common/cpp/reanimated/Fabric/ReanimatedCommitHook.h +5 -5
  92. package/Common/cpp/reanimated/Fabric/ReanimatedMountHook.cpp +9 -43
  93. package/Common/cpp/reanimated/Fabric/ReanimatedMountHook.h +6 -4
  94. package/Common/cpp/reanimated/Fabric/ShadowTreeCloner.cpp +37 -17
  95. package/Common/cpp/reanimated/Fabric/updates/AnimatedPropsRegistry.cpp +38 -0
  96. package/Common/cpp/reanimated/Fabric/updates/AnimatedPropsRegistry.h +21 -0
  97. package/Common/cpp/reanimated/Fabric/updates/UpdatesRegistry.cpp +166 -0
  98. package/Common/cpp/reanimated/Fabric/updates/UpdatesRegistry.h +80 -0
  99. package/Common/cpp/reanimated/Fabric/updates/UpdatesRegistryManager.cpp +130 -0
  100. package/Common/cpp/reanimated/Fabric/updates/UpdatesRegistryManager.h +67 -0
  101. package/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsManager.cpp +1 -1
  102. package/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxy.cpp +2 -9
  103. package/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxy.h +0 -1
  104. package/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsUtils.h +0 -2
  105. package/Common/cpp/reanimated/NativeModules/ReanimatedModuleProxy.cpp +300 -151
  106. package/Common/cpp/reanimated/NativeModules/ReanimatedModuleProxy.h +65 -29
  107. package/Common/cpp/reanimated/NativeModules/ReanimatedModuleProxySpec.cpp +107 -48
  108. package/Common/cpp/reanimated/NativeModules/ReanimatedModuleProxySpec.h +35 -16
  109. package/Common/cpp/reanimated/RuntimeDecorators/RNRuntimeDecorator.cpp +1 -8
  110. package/Common/cpp/reanimated/RuntimeDecorators/RNRuntimeDecorator.h +1 -0
  111. package/Common/cpp/reanimated/Tools/ReanimatedSystraceSection.h +135 -0
  112. package/Common/cpp/worklets/NativeModules/WorkletsModuleProxy.cpp +75 -2
  113. package/Common/cpp/worklets/NativeModules/WorkletsModuleProxy.h +22 -0
  114. package/Common/cpp/worklets/NativeModules/WorkletsModuleProxySpec.cpp +45 -0
  115. package/Common/cpp/worklets/NativeModules/WorkletsModuleProxySpec.h +19 -0
  116. package/Common/cpp/worklets/Tools/Defs.h +10 -0
  117. package/Common/cpp/worklets/Tools/SingleInstanceChecker.h +1 -3
  118. package/Common/cpp/worklets/WorkletRuntime/RNRuntimeWorkletDecorator.cpp +7 -0
  119. package/Common/cpp/worklets/WorkletRuntime/ReanimatedHermesRuntime.cpp +0 -10
  120. package/Common/cpp/worklets/WorkletRuntime/ReanimatedHermesRuntime.h +2 -13
  121. package/Common/cpp/worklets/WorkletRuntime/ReanimatedRuntime.cpp +3 -11
  122. package/Common/cpp/worklets/WorkletRuntime/ReanimatedRuntime.h +0 -8
  123. package/README.md +0 -1
  124. package/android/CMakeLists.txt +7 -11
  125. package/android/src/fabric/java/com/swmansion/reanimated/NativeProxy.java +6 -0
  126. package/android/src/fabric/java/com/swmansion/reanimated/ReaCompatibility.java +6 -0
  127. package/android/src/main/cpp/reanimated/CMakeLists.txt +1 -1
  128. package/android/src/main/cpp/reanimated/android/LayoutAnimations.cpp +4 -0
  129. package/android/src/main/cpp/reanimated/android/LayoutAnimations.h +2 -0
  130. package/android/src/main/cpp/reanimated/android/NativeProxy.cpp +57 -28
  131. package/android/src/main/cpp/reanimated/android/NativeProxy.h +3 -0
  132. package/android/src/main/cpp/worklets/CMakeLists.txt +2 -5
  133. package/android/src/main/cpp/worklets/android/WorkletsModule.cpp +10 -6
  134. package/android/src/main/cpp/worklets/android/WorkletsModule.h +7 -7
  135. package/android/src/main/java/com/swmansion/reanimated/NodesManager.java +16 -2
  136. package/android/src/main/java/com/swmansion/reanimated/ReanimatedPackage.java +1 -1
  137. package/android/src/main/java/com/swmansion/reanimated/Utils.java +10 -0
  138. package/android/src/main/java/com/swmansion/worklets/WorkletsModule.java +7 -0
  139. package/android/src/paper/java/com/swmansion/reanimated/NativeProxy.java +6 -0
  140. package/android/src/paper/java/com/swmansion/reanimated/ReaCompatibility.java +2 -0
  141. package/android/src/reactNativeVersionPatch/ReanimatedUIManager/74/com/swmansion/reanimated/ReanimatedModule.java +11 -0
  142. package/android/src/reactNativeVersionPatch/ReanimatedUIManager/latest/com/swmansion/reanimated/ReanimatedModule.java +11 -0
  143. package/apple/reanimated/apple/LayoutReanimation/REASharedTransitionManager.m +1 -2
  144. package/apple/reanimated/apple/LayoutReanimation/REASwizzledUIManager.mm +5 -6
  145. package/apple/reanimated/apple/REAModule.h +0 -4
  146. package/apple/reanimated/apple/REAModule.mm +27 -92
  147. package/apple/reanimated/apple/REANodesManager.h +0 -1
  148. package/apple/reanimated/apple/REANodesManager.mm +0 -7
  149. package/apple/reanimated/apple/native/NativeProxy.h +2 -0
  150. package/apple/reanimated/apple/native/NativeProxy.mm +27 -19
  151. package/apple/reanimated/apple/native/PlatformDepMethodsHolderImpl.mm +1 -1
  152. package/apple/worklets/apple/WorkletsModule.mm +12 -2
  153. package/lib/module/{PropsRegistry.js → AnimatedPropsRegistry.js} +2 -2
  154. package/lib/module/AnimatedPropsRegistry.js.map +1 -0
  155. package/lib/module/ReanimatedModule/NativeReanimated.js +29 -13
  156. package/lib/module/ReanimatedModule/NativeReanimated.js.map +1 -1
  157. package/lib/module/ReanimatedModule/js-reanimated/JSReanimated.js +23 -18
  158. package/lib/module/ReanimatedModule/js-reanimated/JSReanimated.js.map +1 -1
  159. package/lib/module/commonTypes.js.map +1 -1
  160. package/lib/module/core.js +1 -1
  161. package/lib/module/core.js.map +1 -1
  162. package/lib/module/createAnimatedComponent/AnimatedComponent.js +341 -0
  163. package/lib/module/createAnimatedComponent/AnimatedComponent.js.map +1 -0
  164. package/lib/module/createAnimatedComponent/createAnimatedComponent.js +4 -381
  165. package/lib/module/createAnimatedComponent/createAnimatedComponent.js.map +1 -1
  166. package/lib/module/createAnimatedComponent/setAndForwardRef.js +1 -1
  167. package/lib/module/createAnimatedComponent/setAndForwardRef.js.map +1 -1
  168. package/lib/module/createAnimatedComponent/utils.js +28 -0
  169. package/lib/module/createAnimatedComponent/utils.js.map +1 -1
  170. package/lib/module/css/component/AnimatedComponent.js +134 -0
  171. package/lib/module/css/component/AnimatedComponent.js.map +1 -0
  172. package/lib/module/css/component/createAnimatedComponent.js +30 -0
  173. package/lib/module/css/component/createAnimatedComponent.js.map +1 -0
  174. package/lib/module/css/component/index.js +4 -0
  175. package/lib/module/css/component/index.js.map +1 -0
  176. package/lib/module/css/constants/font.js +17 -0
  177. package/lib/module/css/constants/font.js.map +1 -0
  178. package/lib/module/css/constants/index.js +6 -0
  179. package/lib/module/css/constants/index.js.map +1 -0
  180. package/lib/module/css/constants/platform.js +5 -0
  181. package/lib/module/css/constants/platform.js.map +1 -0
  182. package/lib/module/css/constants/regex.js +6 -0
  183. package/lib/module/css/constants/regex.js.map +1 -0
  184. package/lib/module/css/easings/cubicBezier.js +34 -0
  185. package/lib/module/css/easings/cubicBezier.js.map +1 -0
  186. package/lib/module/css/easings/index.js +16 -0
  187. package/lib/module/css/easings/index.js.map +1 -0
  188. package/lib/module/css/easings/linear.js +123 -0
  189. package/lib/module/css/easings/linear.js.map +1 -0
  190. package/lib/module/css/easings/steps.js +97 -0
  191. package/lib/module/css/easings/steps.js.map +1 -0
  192. package/lib/module/css/easings/types.js +4 -0
  193. package/lib/module/css/easings/types.js.map +1 -0
  194. package/lib/module/css/errors.js +15 -0
  195. package/lib/module/css/errors.js.map +1 -0
  196. package/lib/module/css/index.js +6 -0
  197. package/lib/module/css/index.js.map +1 -0
  198. package/lib/module/css/managers/CSSAnimationsManager.js +98 -0
  199. package/lib/module/css/managers/CSSAnimationsManager.js.map +1 -0
  200. package/lib/module/css/managers/CSSAnimationsManager.web.js +139 -0
  201. package/lib/module/css/managers/CSSAnimationsManager.web.js.map +1 -0
  202. package/lib/module/css/managers/CSSManager.js +52 -0
  203. package/lib/module/css/managers/CSSManager.js.map +1 -0
  204. package/lib/module/css/managers/CSSManager.web.js +35 -0
  205. package/lib/module/css/managers/CSSManager.web.js.map +1 -0
  206. package/lib/module/css/managers/CSSTransitionManager.js +44 -0
  207. package/lib/module/css/managers/CSSTransitionManager.js.map +1 -0
  208. package/lib/module/css/managers/CSSTransitionManager.web.js +52 -0
  209. package/lib/module/css/managers/CSSTransitionManager.web.js.map +1 -0
  210. package/lib/module/css/managers/index.js +4 -0
  211. package/lib/module/css/managers/index.js.map +1 -0
  212. package/lib/module/css/models/CSSKeyframesRule.js +14 -0
  213. package/lib/module/css/models/CSSKeyframesRule.js.map +1 -0
  214. package/lib/module/css/models/CSSKeyframesRule.web.js +14 -0
  215. package/lib/module/css/models/CSSKeyframesRule.web.js.map +1 -0
  216. package/lib/module/css/models/CSSKeyframesRuleBase.js +29 -0
  217. package/lib/module/css/models/CSSKeyframesRuleBase.js.map +1 -0
  218. package/lib/module/css/models/index.js +4 -0
  219. package/lib/module/css/models/index.js.map +1 -0
  220. package/lib/module/css/platform/native/config.js +274 -0
  221. package/lib/module/css/platform/native/config.js.map +1 -0
  222. package/lib/module/css/platform/native/index.js +7 -0
  223. package/lib/module/css/platform/native/index.js.map +1 -0
  224. package/lib/module/css/platform/native/native.js +36 -0
  225. package/lib/module/css/platform/native/native.js.map +1 -0
  226. package/lib/module/css/platform/native/normalization/animation/constants.js +6 -0
  227. package/lib/module/css/platform/native/normalization/animation/constants.js.map +1 -0
  228. package/lib/module/css/platform/native/normalization/animation/index.js +7 -0
  229. package/lib/module/css/platform/native/normalization/animation/index.js.map +1 -0
  230. package/lib/module/css/platform/native/normalization/animation/keyframes.js +107 -0
  231. package/lib/module/css/platform/native/normalization/animation/keyframes.js.map +1 -0
  232. package/lib/module/css/platform/native/normalization/animation/properties.js +28 -0
  233. package/lib/module/css/platform/native/normalization/animation/properties.js.map +1 -0
  234. package/lib/module/css/platform/native/normalization/animation/settings.js +88 -0
  235. package/lib/module/css/platform/native/normalization/animation/settings.js.map +1 -0
  236. package/lib/module/css/platform/native/normalization/common/index.js +4 -0
  237. package/lib/module/css/platform/native/normalization/common/index.js.map +1 -0
  238. package/lib/module/css/platform/native/normalization/common/settings.js +51 -0
  239. package/lib/module/css/platform/native/normalization/common/settings.js.map +1 -0
  240. package/lib/module/css/platform/native/normalization/index.js +6 -0
  241. package/lib/module/css/platform/native/normalization/index.js.map +1 -0
  242. package/lib/module/css/platform/native/normalization/transition/config.js +84 -0
  243. package/lib/module/css/platform/native/normalization/transition/config.js.map +1 -0
  244. package/lib/module/css/platform/native/normalization/transition/constants.js +4 -0
  245. package/lib/module/css/platform/native/normalization/transition/constants.js.map +1 -0
  246. package/lib/module/css/platform/native/normalization/transition/index.js +4 -0
  247. package/lib/module/css/platform/native/normalization/transition/index.js.map +1 -0
  248. package/lib/module/css/platform/native/normalization/transition/settings.js +14 -0
  249. package/lib/module/css/platform/native/normalization/transition/settings.js.map +1 -0
  250. package/lib/module/css/platform/native/style/builderFactory.js +59 -0
  251. package/lib/module/css/platform/native/style/builderFactory.js.map +1 -0
  252. package/lib/module/css/platform/native/style/index.js +6 -0
  253. package/lib/module/css/platform/native/style/index.js.map +1 -0
  254. package/lib/module/css/platform/native/style/processors/colors.js +25 -0
  255. package/lib/module/css/platform/native/style/processors/colors.js.map +1 -0
  256. package/lib/module/css/platform/native/style/processors/font.js +17 -0
  257. package/lib/module/css/platform/native/style/processors/font.js.map +1 -0
  258. package/lib/module/css/platform/native/style/processors/index.js +10 -0
  259. package/lib/module/css/platform/native/style/processors/index.js.map +1 -0
  260. package/lib/module/css/platform/native/style/processors/insets.js +17 -0
  261. package/lib/module/css/platform/native/style/processors/insets.js.map +1 -0
  262. package/lib/module/css/platform/native/style/processors/others.js +26 -0
  263. package/lib/module/css/platform/native/style/processors/others.js.map +1 -0
  264. package/lib/module/css/platform/native/style/processors/shadows.js +49 -0
  265. package/lib/module/css/platform/native/style/processors/shadows.js.map +1 -0
  266. package/lib/module/css/platform/native/style/processors/transform.js +138 -0
  267. package/lib/module/css/platform/native/style/processors/transform.js.map +1 -0
  268. package/lib/module/css/platform/native/style/processors/transformOrigin.js +64 -0
  269. package/lib/module/css/platform/native/style/processors/transformOrigin.js.map +1 -0
  270. package/lib/module/css/platform/native/style/types.js +4 -0
  271. package/lib/module/css/platform/native/style/types.js.map +1 -0
  272. package/lib/module/css/platform/native/styleBuilder.js +7 -0
  273. package/lib/module/css/platform/native/styleBuilder.js.map +1 -0
  274. package/lib/module/css/platform/native/types/animation.js +4 -0
  275. package/lib/module/css/platform/native/types/animation.js.map +1 -0
  276. package/lib/module/css/platform/native/types/common.js +2 -0
  277. package/lib/module/css/platform/native/types/common.js.map +1 -0
  278. package/lib/module/css/platform/native/types/index.js +6 -0
  279. package/lib/module/css/platform/native/types/index.js.map +1 -0
  280. package/lib/module/css/platform/native/types/transition.js +4 -0
  281. package/lib/module/css/platform/native/types/transition.js.map +1 -0
  282. package/lib/module/css/platform/web/animationParser.js +28 -0
  283. package/lib/module/css/platform/web/animationParser.js.map +1 -0
  284. package/lib/module/css/platform/web/config.js +265 -0
  285. package/lib/module/css/platform/web/config.js.map +1 -0
  286. package/lib/module/css/platform/web/domUtils.js +75 -0
  287. package/lib/module/css/platform/web/domUtils.js.map +1 -0
  288. package/lib/module/css/platform/web/index.js +6 -0
  289. package/lib/module/css/platform/web/index.js.map +1 -0
  290. package/lib/module/css/platform/web/style/builderFactories.js +124 -0
  291. package/lib/module/css/platform/web/style/builderFactories.js.map +1 -0
  292. package/lib/module/css/platform/web/style/builders/index.js +4 -0
  293. package/lib/module/css/platform/web/style/builders/index.js.map +1 -0
  294. package/lib/module/css/platform/web/style/builders/shadows.js +45 -0
  295. package/lib/module/css/platform/web/style/builders/shadows.js.map +1 -0
  296. package/lib/module/css/platform/web/style/index.js +7 -0
  297. package/lib/module/css/platform/web/style/index.js.map +1 -0
  298. package/lib/module/css/platform/web/style/processors/colors.js +12 -0
  299. package/lib/module/css/platform/web/style/processors/colors.js.map +1 -0
  300. package/lib/module/css/platform/web/style/processors/filter.js +28 -0
  301. package/lib/module/css/platform/web/style/processors/filter.js.map +1 -0
  302. package/lib/module/css/platform/web/style/processors/font.js +13 -0
  303. package/lib/module/css/platform/web/style/processors/font.js.map +1 -0
  304. package/lib/module/css/platform/web/style/processors/index.js +10 -0
  305. package/lib/module/css/platform/web/style/processors/index.js.map +1 -0
  306. package/lib/module/css/platform/web/style/processors/margins.js +24 -0
  307. package/lib/module/css/platform/web/style/processors/margins.js.map +1 -0
  308. package/lib/module/css/platform/web/style/processors/paddings.js +24 -0
  309. package/lib/module/css/platform/web/style/processors/paddings.js.map +1 -0
  310. package/lib/module/css/platform/web/style/processors/shadows.js +17 -0
  311. package/lib/module/css/platform/web/style/processors/shadows.js.map +1 -0
  312. package/lib/module/css/platform/web/style/processors/transforms.js +37 -0
  313. package/lib/module/css/platform/web/style/processors/transforms.js.map +1 -0
  314. package/lib/module/css/platform/web/style/types.js +4 -0
  315. package/lib/module/css/platform/web/style/types.js.map +1 -0
  316. package/lib/module/css/platform/web/utils.js +69 -0
  317. package/lib/module/css/platform/web/utils.js.map +1 -0
  318. package/lib/module/css/stylesheet.js +25 -0
  319. package/lib/module/css/stylesheet.js.map +1 -0
  320. package/lib/module/css/types/animation.js +4 -0
  321. package/lib/module/css/types/animation.js.map +1 -0
  322. package/lib/module/css/types/common.js +4 -0
  323. package/lib/module/css/types/common.js.map +1 -0
  324. package/lib/module/css/types/config.js +4 -0
  325. package/lib/module/css/types/config.js.map +1 -0
  326. package/lib/module/css/types/helpers.js +4 -0
  327. package/lib/module/css/types/helpers.js.map +1 -0
  328. package/lib/module/css/types/index.js +9 -0
  329. package/lib/module/css/types/index.js.map +1 -0
  330. package/lib/module/css/types/props.js +4 -0
  331. package/lib/module/css/types/props.js.map +1 -0
  332. package/lib/module/css/types/transition.js +4 -0
  333. package/lib/module/css/types/transition.js.map +1 -0
  334. package/lib/module/css/utils/conversions.js +8 -0
  335. package/lib/module/css/utils/conversions.js.map +1 -0
  336. package/lib/module/css/utils/equality.js +57 -0
  337. package/lib/module/css/utils/equality.js.map +1 -0
  338. package/lib/module/css/utils/guards.js +24 -0
  339. package/lib/module/css/utils/guards.js.map +1 -0
  340. package/lib/module/css/utils/index.js +8 -0
  341. package/lib/module/css/utils/index.js.map +1 -0
  342. package/lib/module/css/utils/parsers.js +27 -0
  343. package/lib/module/css/utils/parsers.js.map +1 -0
  344. package/lib/module/css/utils/props.js +34 -0
  345. package/lib/module/css/utils/props.js.map +1 -0
  346. package/lib/module/index.js +1 -0
  347. package/lib/module/index.js.map +1 -1
  348. package/lib/module/initializers.js +5 -1
  349. package/lib/module/initializers.js.map +1 -1
  350. package/lib/module/layoutReanimation/web/componentUtils.js +1 -0
  351. package/lib/module/layoutReanimation/web/componentUtils.js.map +1 -1
  352. package/lib/module/logger/logger.js +3 -3
  353. package/lib/module/logger/logger.js.map +1 -1
  354. package/lib/module/platform-specific/findHostInstance.js +11 -2
  355. package/lib/module/platform-specific/findHostInstance.js.map +1 -1
  356. package/lib/module/platform-specific/jsVersion.js +1 -1
  357. package/lib/module/platform-specific/jsVersion.js.map +1 -1
  358. package/lib/module/propsAllowlists.js +7 -1
  359. package/lib/module/propsAllowlists.js.map +1 -1
  360. package/lib/module/runtimes.js +3 -3
  361. package/lib/module/runtimes.js.map +1 -1
  362. package/lib/module/threads.js +5 -5
  363. package/lib/module/threads.js.map +1 -1
  364. package/lib/module/worklets/WorkletsModule/JSWorklets.js +21 -0
  365. package/lib/module/worklets/WorkletsModule/JSWorklets.js.map +1 -1
  366. package/lib/module/worklets/WorkletsModule/NativeWorklets.js +12 -0
  367. package/lib/module/worklets/WorkletsModule/NativeWorklets.js.map +1 -1
  368. package/lib/typescript/{PropsRegistry.d.ts → AnimatedPropsRegistry.d.ts} +1 -1
  369. package/lib/typescript/AnimatedPropsRegistry.d.ts.map +1 -0
  370. package/lib/typescript/ReanimatedModule/NativeReanimated.d.ts.map +1 -1
  371. package/lib/typescript/ReanimatedModule/js-reanimated/JSReanimated.d.ts.map +1 -1
  372. package/lib/typescript/ReanimatedModule/reanimatedModuleProxy.d.ts +13 -6
  373. package/lib/typescript/ReanimatedModule/reanimatedModuleProxy.d.ts.map +1 -1
  374. package/lib/typescript/commonTypes.d.ts +7 -2
  375. package/lib/typescript/commonTypes.d.ts.map +1 -1
  376. package/lib/typescript/createAnimatedComponent/AnimatedComponent.d.ts +58 -0
  377. package/lib/typescript/createAnimatedComponent/AnimatedComponent.d.ts.map +1 -0
  378. package/lib/typescript/createAnimatedComponent/JSPropsUpdater.d.ts +2 -1
  379. package/lib/typescript/createAnimatedComponent/JSPropsUpdater.d.ts.map +1 -1
  380. package/lib/typescript/createAnimatedComponent/NativeEventsManager.d.ts +1 -3
  381. package/lib/typescript/createAnimatedComponent/NativeEventsManager.d.ts.map +1 -1
  382. package/lib/typescript/createAnimatedComponent/commonTypes.d.ts +5 -1
  383. package/lib/typescript/createAnimatedComponent/commonTypes.d.ts.map +1 -1
  384. package/lib/typescript/createAnimatedComponent/createAnimatedComponent.d.ts +2 -7
  385. package/lib/typescript/createAnimatedComponent/createAnimatedComponent.d.ts.map +1 -1
  386. package/lib/typescript/createAnimatedComponent/utils.d.ts +5 -0
  387. package/lib/typescript/createAnimatedComponent/utils.d.ts.map +1 -1
  388. package/lib/typescript/css/component/AnimatedComponent.d.ts +29 -0
  389. package/lib/typescript/css/component/AnimatedComponent.d.ts.map +1 -0
  390. package/lib/typescript/css/component/createAnimatedComponent.d.ts +12 -0
  391. package/lib/typescript/css/component/createAnimatedComponent.d.ts.map +1 -0
  392. package/lib/typescript/css/component/index.d.ts +2 -0
  393. package/lib/typescript/css/component/index.d.ts.map +1 -0
  394. package/lib/typescript/css/constants/font.d.ts +15 -0
  395. package/lib/typescript/css/constants/font.d.ts.map +1 -0
  396. package/lib/typescript/css/constants/index.d.ts +4 -0
  397. package/lib/typescript/css/constants/index.d.ts.map +1 -0
  398. package/lib/typescript/css/constants/platform.d.ts +2 -0
  399. package/lib/typescript/css/constants/platform.d.ts.map +1 -0
  400. package/lib/typescript/css/constants/regex.d.ts +4 -0
  401. package/lib/typescript/css/constants/regex.d.ts.map +1 -0
  402. package/lib/typescript/css/easings/cubicBezier.d.ts +15 -0
  403. package/lib/typescript/css/easings/cubicBezier.d.ts.map +1 -0
  404. package/lib/typescript/css/easings/index.d.ts +10 -0
  405. package/lib/typescript/css/easings/index.d.ts.map +1 -0
  406. package/lib/typescript/css/easings/linear.d.ts +17 -0
  407. package/lib/typescript/css/easings/linear.d.ts.map +1 -0
  408. package/lib/typescript/css/easings/steps.d.ts +18 -0
  409. package/lib/typescript/css/easings/steps.d.ts.map +1 -0
  410. package/lib/typescript/css/easings/types.d.ts +26 -0
  411. package/lib/typescript/css/easings/types.d.ts.map +1 -0
  412. package/lib/typescript/css/errors.d.ts +9 -0
  413. package/lib/typescript/css/errors.d.ts.map +1 -0
  414. package/lib/typescript/css/index.d.ts +5 -0
  415. package/lib/typescript/css/index.d.ts.map +1 -0
  416. package/lib/typescript/css/managers/CSSAnimationsManager.d.ts +13 -0
  417. package/lib/typescript/css/managers/CSSAnimationsManager.d.ts.map +1 -0
  418. package/lib/typescript/css/managers/CSSAnimationsManager.web.d.ts +15 -0
  419. package/lib/typescript/css/managers/CSSAnimationsManager.web.d.ts.map +1 -0
  420. package/lib/typescript/css/managers/CSSManager.d.ts +12 -0
  421. package/lib/typescript/css/managers/CSSManager.d.ts.map +1 -0
  422. package/lib/typescript/css/managers/CSSManager.web.d.ts +12 -0
  423. package/lib/typescript/css/managers/CSSManager.web.d.ts.map +1 -0
  424. package/lib/typescript/css/managers/CSSTransitionManager.d.ts +12 -0
  425. package/lib/typescript/css/managers/CSSTransitionManager.d.ts.map +1 -0
  426. package/lib/typescript/css/managers/CSSTransitionManager.web.d.ts +11 -0
  427. package/lib/typescript/css/managers/CSSTransitionManager.web.d.ts.map +1 -0
  428. package/lib/typescript/css/managers/index.d.ts +2 -0
  429. package/lib/typescript/css/managers/index.d.ts.map +1 -0
  430. package/lib/typescript/css/models/CSSKeyframesRule.d.ts +9 -0
  431. package/lib/typescript/css/models/CSSKeyframesRule.d.ts.map +1 -0
  432. package/lib/typescript/css/models/CSSKeyframesRule.web.d.ts +8 -0
  433. package/lib/typescript/css/models/CSSKeyframesRule.web.d.ts.map +1 -0
  434. package/lib/typescript/css/models/CSSKeyframesRuleBase.d.ts +14 -0
  435. package/lib/typescript/css/models/CSSKeyframesRuleBase.d.ts.map +1 -0
  436. package/lib/typescript/css/models/index.d.ts +2 -0
  437. package/lib/typescript/css/models/index.d.ts.map +1 -0
  438. package/lib/typescript/css/platform/native/config.d.ts +5 -0
  439. package/lib/typescript/css/platform/native/config.d.ts.map +1 -0
  440. package/lib/typescript/css/platform/native/index.d.ts +5 -0
  441. package/lib/typescript/css/platform/native/index.d.ts.map +1 -0
  442. package/lib/typescript/css/platform/native/native.d.ts +14 -0
  443. package/lib/typescript/css/platform/native/native.d.ts.map +1 -0
  444. package/lib/typescript/css/platform/native/normalization/animation/constants.d.ts +5 -0
  445. package/lib/typescript/css/platform/native/normalization/animation/constants.d.ts.map +1 -0
  446. package/lib/typescript/css/platform/native/normalization/animation/index.d.ts +5 -0
  447. package/lib/typescript/css/platform/native/normalization/animation/index.d.ts.map +1 -0
  448. package/lib/typescript/css/platform/native/normalization/animation/keyframes.d.ts +8 -0
  449. package/lib/typescript/css/platform/native/normalization/animation/keyframes.d.ts.map +1 -0
  450. package/lib/typescript/css/platform/native/normalization/animation/properties.d.ts +3 -0
  451. package/lib/typescript/css/platform/native/normalization/animation/properties.d.ts.map +1 -0
  452. package/lib/typescript/css/platform/native/normalization/animation/settings.d.ts +16 -0
  453. package/lib/typescript/css/platform/native/normalization/animation/settings.d.ts.map +1 -0
  454. package/lib/typescript/css/platform/native/normalization/common/index.d.ts +2 -0
  455. package/lib/typescript/css/platform/native/normalization/common/index.d.ts.map +1 -0
  456. package/lib/typescript/css/platform/native/normalization/common/settings.d.ts +14 -0
  457. package/lib/typescript/css/platform/native/normalization/common/settings.d.ts.map +1 -0
  458. package/lib/typescript/css/platform/native/normalization/index.d.ts +4 -0
  459. package/lib/typescript/css/platform/native/normalization/index.d.ts.map +1 -0
  460. package/lib/typescript/css/platform/native/normalization/transition/config.d.ts +8 -0
  461. package/lib/typescript/css/platform/native/normalization/transition/config.d.ts.map +1 -0
  462. package/lib/typescript/css/platform/native/normalization/transition/constants.d.ts +3 -0
  463. package/lib/typescript/css/platform/native/normalization/transition/constants.d.ts.map +1 -0
  464. package/lib/typescript/css/platform/native/normalization/transition/index.d.ts +2 -0
  465. package/lib/typescript/css/platform/native/normalization/transition/index.d.ts.map +1 -0
  466. package/lib/typescript/css/platform/native/normalization/transition/settings.d.ts +6 -0
  467. package/lib/typescript/css/platform/native/normalization/transition/settings.d.ts.map +1 -0
  468. package/lib/typescript/css/platform/native/style/builderFactory.d.ts +4 -0
  469. package/lib/typescript/css/platform/native/style/builderFactory.d.ts.map +1 -0
  470. package/lib/typescript/css/platform/native/style/index.d.ts +4 -0
  471. package/lib/typescript/css/platform/native/style/index.d.ts.map +1 -0
  472. package/lib/typescript/css/platform/native/style/processors/colors.d.ts +8 -0
  473. package/lib/typescript/css/platform/native/style/processors/colors.d.ts.map +1 -0
  474. package/lib/typescript/css/platform/native/style/processors/font.d.ts +3 -0
  475. package/lib/typescript/css/platform/native/style/processors/font.d.ts.map +1 -0
  476. package/lib/typescript/css/platform/native/style/processors/index.d.ts +8 -0
  477. package/lib/typescript/css/platform/native/style/processors/index.d.ts.map +1 -0
  478. package/lib/typescript/css/platform/native/style/processors/insets.d.ts +8 -0
  479. package/lib/typescript/css/platform/native/style/processors/insets.d.ts.map +1 -0
  480. package/lib/typescript/css/platform/native/style/processors/others.d.ts +7 -0
  481. package/lib/typescript/css/platform/native/style/processors/others.d.ts.map +1 -0
  482. package/lib/typescript/css/platform/native/style/processors/shadows.d.ts +13 -0
  483. package/lib/typescript/css/platform/native/style/processors/shadows.d.ts.map +1 -0
  484. package/lib/typescript/css/platform/native/style/processors/transform.d.ts +7 -0
  485. package/lib/typescript/css/platform/native/style/processors/transform.d.ts.map +1 -0
  486. package/lib/typescript/css/platform/native/style/processors/transformOrigin.d.ts +9 -0
  487. package/lib/typescript/css/platform/native/style/processors/transformOrigin.d.ts.map +1 -0
  488. package/lib/typescript/css/platform/native/style/types.d.ts +16 -0
  489. package/lib/typescript/css/platform/native/style/types.d.ts.map +1 -0
  490. package/lib/typescript/css/platform/native/styleBuilder.d.ts +3 -0
  491. package/lib/typescript/css/platform/native/styleBuilder.d.ts.map +1 -0
  492. package/lib/typescript/css/platform/native/types/animation.d.ts +29 -0
  493. package/lib/typescript/css/platform/native/types/animation.d.ts.map +1 -0
  494. package/lib/typescript/css/platform/native/types/common.d.ts +7 -0
  495. package/lib/typescript/css/platform/native/types/common.d.ts.map +1 -0
  496. package/lib/typescript/css/platform/native/types/index.d.ts +4 -0
  497. package/lib/typescript/css/platform/native/types/index.d.ts.map +1 -0
  498. package/lib/typescript/css/platform/native/types/transition.d.ts +15 -0
  499. package/lib/typescript/css/platform/native/types/transition.d.ts.map +1 -0
  500. package/lib/typescript/css/platform/web/animationParser.d.ts +3 -0
  501. package/lib/typescript/css/platform/web/animationParser.d.ts.map +1 -0
  502. package/lib/typescript/css/platform/web/config.d.ts +4 -0
  503. package/lib/typescript/css/platform/web/config.d.ts.map +1 -0
  504. package/lib/typescript/css/platform/web/domUtils.d.ts +4 -0
  505. package/lib/typescript/css/platform/web/domUtils.d.ts.map +1 -0
  506. package/lib/typescript/css/platform/web/index.d.ts +4 -0
  507. package/lib/typescript/css/platform/web/index.d.ts.map +1 -0
  508. package/lib/typescript/css/platform/web/style/builderFactories.d.ts +5 -0
  509. package/lib/typescript/css/platform/web/style/builderFactories.d.ts.map +1 -0
  510. package/lib/typescript/css/platform/web/style/builders/index.d.ts +2 -0
  511. package/lib/typescript/css/platform/web/style/builders/index.d.ts.map +1 -0
  512. package/lib/typescript/css/platform/web/style/builders/shadows.d.ts +7 -0
  513. package/lib/typescript/css/platform/web/style/builders/shadows.d.ts.map +1 -0
  514. package/lib/typescript/css/platform/web/style/index.d.ts +5 -0
  515. package/lib/typescript/css/platform/web/style/index.d.ts.map +1 -0
  516. package/lib/typescript/css/platform/web/style/processors/colors.d.ts +4 -0
  517. package/lib/typescript/css/platform/web/style/processors/colors.d.ts.map +1 -0
  518. package/lib/typescript/css/platform/web/style/processors/filter.d.ts +4 -0
  519. package/lib/typescript/css/platform/web/style/processors/filter.d.ts.map +1 -0
  520. package/lib/typescript/css/platform/web/style/processors/font.d.ts +5 -0
  521. package/lib/typescript/css/platform/web/style/processors/font.d.ts.map +1 -0
  522. package/lib/typescript/css/platform/web/style/processors/index.d.ts +8 -0
  523. package/lib/typescript/css/platform/web/style/processors/index.d.ts.map +1 -0
  524. package/lib/typescript/css/platform/web/style/processors/margins.d.ts +5 -0
  525. package/lib/typescript/css/platform/web/style/processors/margins.d.ts.map +1 -0
  526. package/lib/typescript/css/platform/web/style/processors/paddings.d.ts +5 -0
  527. package/lib/typescript/css/platform/web/style/processors/paddings.d.ts.map +1 -0
  528. package/lib/typescript/css/platform/web/style/processors/shadows.d.ts +7 -0
  529. package/lib/typescript/css/platform/web/style/processors/shadows.d.ts.map +1 -0
  530. package/lib/typescript/css/platform/web/style/processors/transforms.d.ts +5 -0
  531. package/lib/typescript/css/platform/web/style/processors/transforms.d.ts.map +1 -0
  532. package/lib/typescript/css/platform/web/style/types.d.ts +35 -0
  533. package/lib/typescript/css/platform/web/style/types.d.ts.map +1 -0
  534. package/lib/typescript/css/platform/web/utils.d.ts +11 -0
  535. package/lib/typescript/css/platform/web/utils.d.ts.map +1 -0
  536. package/lib/typescript/css/stylesheet.d.ts +11 -0
  537. package/lib/typescript/css/stylesheet.d.ts.map +1 -0
  538. package/lib/typescript/css/types/animation.d.ts +47 -0
  539. package/lib/typescript/css/types/animation.d.ts.map +1 -0
  540. package/lib/typescript/css/types/common.d.ts +12 -0
  541. package/lib/typescript/css/types/common.d.ts.map +1 -0
  542. package/lib/typescript/css/types/config.d.ts +5 -0
  543. package/lib/typescript/css/types/config.d.ts.map +1 -0
  544. package/lib/typescript/css/types/helpers.d.ts +12 -0
  545. package/lib/typescript/css/types/helpers.d.ts.map +1 -0
  546. package/lib/typescript/css/types/index.d.ts +7 -0
  547. package/lib/typescript/css/types/index.d.ts.map +1 -0
  548. package/lib/typescript/css/types/props.d.ts +17 -0
  549. package/lib/typescript/css/types/props.d.ts.map +1 -0
  550. package/lib/typescript/css/types/transition.d.ts +26 -0
  551. package/lib/typescript/css/types/transition.d.ts.map +1 -0
  552. package/lib/typescript/css/utils/conversions.d.ts +3 -0
  553. package/lib/typescript/css/utils/conversions.d.ts.map +1 -0
  554. package/lib/typescript/css/utils/equality.d.ts +3 -0
  555. package/lib/typescript/css/utils/equality.d.ts.map +1 -0
  556. package/lib/typescript/css/utils/guards.d.ts +20 -0
  557. package/lib/typescript/css/utils/guards.d.ts.map +1 -0
  558. package/lib/typescript/css/utils/index.d.ts +6 -0
  559. package/lib/typescript/css/utils/index.d.ts.map +1 -0
  560. package/lib/typescript/css/utils/parsers.d.ts +3 -0
  561. package/lib/typescript/css/utils/parsers.d.ts.map +1 -0
  562. package/lib/typescript/css/utils/props.d.ts +7 -0
  563. package/lib/typescript/css/utils/props.d.ts.map +1 -0
  564. package/lib/typescript/index.d.ts +1 -0
  565. package/lib/typescript/index.d.ts.map +1 -1
  566. package/lib/typescript/initializers.d.ts +2 -1
  567. package/lib/typescript/initializers.d.ts.map +1 -1
  568. package/lib/typescript/layoutReanimation/web/componentUtils.d.ts.map +1 -1
  569. package/lib/typescript/platform-specific/findHostInstance.d.ts.map +1 -1
  570. package/lib/typescript/platform-specific/jsVersion.d.ts +1 -1
  571. package/lib/typescript/platform-specific/jsVersion.d.ts.map +1 -1
  572. package/lib/typescript/propsAllowlists.d.ts.map +1 -1
  573. package/lib/typescript/worklets/WorkletsModule/JSWorklets.d.ts.map +1 -1
  574. package/lib/typescript/worklets/WorkletsModule/NativeWorklets.d.ts.map +1 -1
  575. package/lib/typescript/worklets/WorkletsModule/workletsModuleProxy.d.ts +5 -0
  576. package/lib/typescript/worklets/WorkletsModule/workletsModuleProxy.d.ts.map +1 -1
  577. package/package.json +11 -12
  578. package/src/{PropsRegistry.ts → AnimatedPropsRegistry.ts} +3 -1
  579. package/src/ReanimatedModule/NativeReanimated.ts +71 -24
  580. package/src/ReanimatedModule/js-reanimated/JSReanimated.ts +64 -32
  581. package/src/ReanimatedModule/reanimatedModuleProxy.ts +37 -15
  582. package/src/commonTypes.ts +10 -3
  583. package/src/core.ts +1 -1
  584. package/src/createAnimatedComponent/AnimatedComponent.tsx +510 -0
  585. package/src/createAnimatedComponent/JSPropsUpdater.ts +1 -1
  586. package/src/createAnimatedComponent/NativeEventsManager.ts +1 -6
  587. package/src/createAnimatedComponent/commonTypes.ts +11 -1
  588. package/src/createAnimatedComponent/createAnimatedComponent.tsx +14 -562
  589. package/src/createAnimatedComponent/setAndForwardRef.ts +1 -1
  590. package/src/createAnimatedComponent/utils.ts +25 -0
  591. package/src/css/component/AnimatedComponent.tsx +181 -0
  592. package/src/css/component/createAnimatedComponent.tsx +67 -0
  593. package/src/css/component/index.ts +2 -0
  594. package/src/css/constants/font.ts +15 -0
  595. package/src/css/constants/index.ts +4 -0
  596. package/src/css/constants/platform.ts +4 -0
  597. package/src/css/constants/regex.ts +4 -0
  598. package/src/css/easings/cubicBezier.ts +46 -0
  599. package/src/css/easings/index.ts +29 -0
  600. package/src/css/easings/linear.ts +151 -0
  601. package/src/css/easings/steps.ts +104 -0
  602. package/src/css/easings/types.ts +54 -0
  603. package/src/css/errors.ts +20 -0
  604. package/src/css/index.ts +24 -0
  605. package/src/css/managers/CSSAnimationsManager.ts +155 -0
  606. package/src/css/managers/CSSAnimationsManager.web.ts +203 -0
  607. package/src/css/managers/CSSManager.ts +65 -0
  608. package/src/css/managers/CSSManager.web.ts +52 -0
  609. package/src/css/managers/CSSTransitionManager.ts +67 -0
  610. package/src/css/managers/CSSTransitionManager.web.ts +83 -0
  611. package/src/css/managers/index.ts +2 -0
  612. package/src/css/models/CSSKeyframesRule.ts +20 -0
  613. package/src/css/models/CSSKeyframesRule.web.ts +23 -0
  614. package/src/css/models/CSSKeyframesRuleBase.ts +45 -0
  615. package/src/css/models/index.ts +2 -0
  616. package/src/css/platform/native/config.ts +237 -0
  617. package/src/css/platform/native/index.ts +5 -0
  618. package/src/css/platform/native/native.ts +61 -0
  619. package/src/css/platform/native/normalization/animation/constants.ts +25 -0
  620. package/src/css/platform/native/normalization/animation/index.ts +5 -0
  621. package/src/css/platform/native/normalization/animation/keyframes.ts +145 -0
  622. package/src/css/platform/native/normalization/animation/properties.ts +38 -0
  623. package/src/css/platform/native/normalization/animation/settings.ts +136 -0
  624. package/src/css/platform/native/normalization/common/index.ts +6 -0
  625. package/src/css/platform/native/normalization/common/settings.ts +86 -0
  626. package/src/css/platform/native/normalization/index.ts +4 -0
  627. package/src/css/platform/native/normalization/transition/config.ts +136 -0
  628. package/src/css/platform/native/normalization/transition/constants.ts +7 -0
  629. package/src/css/platform/native/normalization/transition/index.ts +5 -0
  630. package/src/css/platform/native/normalization/transition/settings.ts +20 -0
  631. package/src/css/platform/native/style/builderFactory.ts +81 -0
  632. package/src/css/platform/native/style/index.ts +4 -0
  633. package/src/css/platform/native/style/processors/colors.ts +36 -0
  634. package/src/css/platform/native/style/processors/font.ts +21 -0
  635. package/src/css/platform/native/style/processors/index.ts +8 -0
  636. package/src/css/platform/native/style/processors/insets.ts +25 -0
  637. package/src/css/platform/native/style/processors/others.ts +30 -0
  638. package/src/css/platform/native/style/processors/shadows.ts +74 -0
  639. package/src/css/platform/native/style/processors/transform.ts +182 -0
  640. package/src/css/platform/native/style/processors/transformOrigin.ts +117 -0
  641. package/src/css/platform/native/style/types.ts +33 -0
  642. package/src/css/platform/native/styleBuilder.ts +7 -0
  643. package/src/css/platform/native/types/animation.ts +50 -0
  644. package/src/css/platform/native/types/common.ts +8 -0
  645. package/src/css/platform/native/types/index.ts +4 -0
  646. package/src/css/platform/native/types/transition.ts +20 -0
  647. package/src/css/platform/web/animationParser.ts +46 -0
  648. package/src/css/platform/web/config.ts +233 -0
  649. package/src/css/platform/web/domUtils.ts +101 -0
  650. package/src/css/platform/web/index.ts +4 -0
  651. package/src/css/platform/web/style/builderFactories.ts +220 -0
  652. package/src/css/platform/web/style/builders/index.ts +2 -0
  653. package/src/css/platform/web/style/builders/shadows.ts +57 -0
  654. package/src/css/platform/web/style/index.ts +5 -0
  655. package/src/css/platform/web/style/processors/colors.ts +15 -0
  656. package/src/css/platform/web/style/processors/filter.ts +46 -0
  657. package/src/css/platform/web/style/processors/font.ts +17 -0
  658. package/src/css/platform/web/style/processors/index.ts +8 -0
  659. package/src/css/platform/web/style/processors/margins.ts +34 -0
  660. package/src/css/platform/web/style/processors/paddings.ts +34 -0
  661. package/src/css/platform/web/style/processors/shadows.ts +40 -0
  662. package/src/css/platform/web/style/processors/transforms.ts +59 -0
  663. package/src/css/platform/web/style/types.ts +77 -0
  664. package/src/css/platform/web/utils.ts +108 -0
  665. package/src/css/stylesheet.ts +37 -0
  666. package/src/css/types/animation.ts +74 -0
  667. package/src/css/types/common.ts +24 -0
  668. package/src/css/types/config.ts +6 -0
  669. package/src/css/types/helpers.ts +29 -0
  670. package/src/css/types/index.ts +7 -0
  671. package/src/css/types/props.ts +36 -0
  672. package/src/css/types/transition.ts +38 -0
  673. package/src/css/utils/conversions.ts +15 -0
  674. package/src/css/utils/equality.ts +67 -0
  675. package/src/css/utils/guards.ts +85 -0
  676. package/src/css/utils/index.ts +6 -0
  677. package/src/css/utils/parsers.ts +36 -0
  678. package/src/css/utils/props.ts +64 -0
  679. package/src/index.ts +1 -0
  680. package/src/initializers.ts +8 -1
  681. package/src/layoutReanimation/web/componentUtils.ts +1 -0
  682. package/src/logger/logger.ts +3 -3
  683. package/src/platform-specific/findHostInstance.ts +14 -3
  684. package/src/platform-specific/jsVersion.ts +1 -1
  685. package/src/propsAllowlists.ts +6 -0
  686. package/src/runtimes.ts +3 -3
  687. package/src/threads.ts +5 -5
  688. package/src/worklets/WorkletsModule/JSWorklets.ts +39 -1
  689. package/src/worklets/WorkletsModule/NativeWorklets.ts +28 -3
  690. package/src/worklets/WorkletsModule/workletsModuleProxy.ts +17 -0
  691. package/Common/cpp/reanimated/Fabric/PropsRegistry.cpp +0 -41
  692. package/Common/cpp/reanimated/Fabric/PropsRegistry.h +0 -59
  693. package/apple/reanimated/apple/Fabric/REAInitializerRCTFabricSurface.h +0 -12
  694. package/apple/reanimated/apple/Fabric/REAInitializerRCTFabricSurface.mm +0 -73
  695. package/lib/module/PropsRegistry.js.map +0 -1
  696. package/lib/typescript/PropsRegistry.d.ts.map +0 -1
@@ -0,0 +1,106 @@
1
+ #pragma once
2
+ #ifdef RCT_NEW_ARCH_ENABLED
3
+
4
+ #include <reanimated/CSS/common/Quaternion.h>
5
+ #include <reanimated/CSS/common/definitions.h>
6
+ #include <reanimated/CSS/common/vectors.h>
7
+
8
+ #include <folly/dynamic.h>
9
+ #include <string>
10
+ #include <utility>
11
+
12
+ namespace reanimated {
13
+
14
+ struct DecomposedTransformMatrix {
15
+ Vector3D scale;
16
+ Vector3D skew;
17
+ Quaternion quaternion;
18
+ Vector3D translation;
19
+ Vector4D perspective;
20
+
21
+ #ifndef NDEBUG
22
+ friend std::ostream &operator<<(
23
+ std::ostream &os,
24
+ const DecomposedTransformMatrix &decomposed);
25
+ #endif // NDEBUG
26
+
27
+ DecomposedTransformMatrix interpolate(
28
+ double progress,
29
+ const DecomposedTransformMatrix &other) const;
30
+ };
31
+
32
+ class TransformMatrix {
33
+ public:
34
+ explicit TransformMatrix(const Vec16Array &matrix);
35
+ explicit TransformMatrix(const Matrix4x4 &matrix);
36
+ explicit TransformMatrix(jsi::Runtime &rt, const jsi::Value &value);
37
+
38
+ static TransformMatrix Identity();
39
+ static TransformMatrix Perspective(double value);
40
+ static TransformMatrix RotateX(double value);
41
+ static TransformMatrix RotateY(double value);
42
+ static TransformMatrix RotateZ(double value);
43
+ static TransformMatrix Scale(double value);
44
+ static TransformMatrix ScaleX(double value);
45
+ static TransformMatrix ScaleY(double value);
46
+ static TransformMatrix TranslateX(double value);
47
+ static TransformMatrix TranslateY(double value);
48
+ static TransformMatrix SkewX(double value);
49
+ static TransformMatrix SkewY(double value);
50
+
51
+ std::array<double, 4> &operator[](size_t rowIdx);
52
+ const std::array<double, 4> &operator[](size_t rowIdx) const;
53
+ bool operator==(const TransformMatrix &other) const;
54
+ TransformMatrix operator*(const TransformMatrix &rhs) const;
55
+ TransformMatrix operator*=(const TransformMatrix &rhs);
56
+
57
+ #ifndef NDEBUG
58
+ friend std::ostream &operator<<(
59
+ std::ostream &os,
60
+ const TransformMatrix &matrix);
61
+ #endif // NDEBUG
62
+
63
+ std::string toString() const;
64
+ jsi::Value toJSIValue(jsi::Runtime &rt) const;
65
+ folly::dynamic toDynamic() const;
66
+
67
+ bool isSingular() const;
68
+ bool normalize();
69
+ double determinant() const;
70
+ void adjugate();
71
+ bool invert();
72
+ void transpose();
73
+ void translate3d(const Vector3D &translation);
74
+ void scale3d(const Vector3D &scale);
75
+
76
+ std::optional<DecomposedTransformMatrix> decompose() const;
77
+ static TransformMatrix recompose(const DecomposedTransformMatrix &decomposed);
78
+ static TransformMatrix fromQuaternion(const Quaternion &q);
79
+
80
+ private:
81
+ Matrix4x4 matrix_;
82
+
83
+ std::optional<Vector4D> computePerspective() const;
84
+
85
+ Vector3D getTranslation() const;
86
+ static std::pair<Vector3D, Vector3D> computeScaleAndSkew(
87
+ std::array<Vector3D, 3> &rows);
88
+ static Quaternion computeQuaternion(std::array<Vector3D, 3> &columns);
89
+
90
+ inline static double determinant3x3(
91
+ double a,
92
+ double b,
93
+ double c,
94
+ double d,
95
+ double e,
96
+ double f,
97
+ double g,
98
+ double h,
99
+ double i);
100
+ };
101
+
102
+ Vector4D operator*(const Vector4D &v, const TransformMatrix &m);
103
+
104
+ } // namespace reanimated
105
+
106
+ #endif // RCT_NEW_ARCH_ENABLED
@@ -0,0 +1,30 @@
1
+ #pragma once
2
+ #ifdef RCT_NEW_ARCH_ENABLED
3
+
4
+ #include <jsi/jsi.h>
5
+ #include <memory>
6
+ #include <string>
7
+ #include <vector>
8
+
9
+ namespace reanimated {
10
+
11
+ using namespace facebook;
12
+
13
+ using PropertyNames = std::vector<std::string>;
14
+ using PropertyValues = std::unique_ptr<jsi::Value>;
15
+ using PropertyPath = std::vector<std::string>;
16
+ /**
17
+ * If nullopt - all style properties can trigger transition
18
+ * If empty vector - no style property can trigger transition
19
+ * Otherwise - only specified style properties can trigger transition
20
+ */
21
+ using TransitionProperties = std::optional<PropertyNames>;
22
+
23
+ using EasingFunction = std::function<double(double)>;
24
+ using ColorChannels = std::array<uint8_t, 4>;
25
+ using Vec16Array = std::array<double, 16>;
26
+ using Matrix4x4 = std::array<std::array<double, 4>, 4>;
27
+
28
+ } // namespace reanimated
29
+
30
+ #endif // RCT_NEW_ARCH_ENABLED
@@ -0,0 +1,95 @@
1
+ #ifdef RCT_NEW_ARCH_ENABLED
2
+ #include <reanimated/CSS/common/values/CSSAngle.h>
3
+
4
+ namespace reanimated {
5
+
6
+ CSSAngle::CSSAngle() : value(0) {}
7
+
8
+ CSSAngle::CSSAngle(const double value) : value(value) {}
9
+
10
+ CSSAngle::CSSAngle(const std::string &rotationString) {
11
+ static const std::regex validNumberRegex(R"(^[-+]?\d*\.?\d+$)");
12
+ static const std::unordered_map<std::string, double> unitFactors = {
13
+ {"rad", 1},
14
+ {"deg", M_PI / 180},
15
+ };
16
+
17
+ // Find position of the first non-numeric character (first character
18
+ // of the unit, e.g. "deg" or "rad")
19
+ size_t pos = rotationString.find_first_not_of("0123456789.-+");
20
+
21
+ if (pos == std::string::npos) {
22
+ throw std::invalid_argument(
23
+ "[Reanimated] CSSAngle: Invalid angle value: " + rotationString);
24
+ }
25
+
26
+ std::string numericPart = rotationString.substr(0, pos);
27
+ std::string unitPart = rotationString.substr(pos);
28
+
29
+ if (!std::regex_match(numericPart, validNumberRegex)) {
30
+ throw std::invalid_argument(
31
+ "[Reanimated] CSSAngle: Invalid angle value: " + rotationString);
32
+ }
33
+
34
+ // Lookup the unit and convert to radians
35
+ auto it = unitFactors.find(unitPart);
36
+ if (it == unitFactors.cend()) {
37
+ throw std::invalid_argument(
38
+ "[Reanimated] CSSAngle: Invalid angle unit: " + unitPart);
39
+ }
40
+
41
+ double numericValue = std::stod(numericPart);
42
+
43
+ this->value = numericValue * it->second;
44
+ }
45
+
46
+ CSSAngle::CSSAngle(jsi::Runtime &rt, const jsi::Value &jsiValue) {
47
+ if (!jsiValue.isString()) {
48
+ throw std::invalid_argument(
49
+ "[Reanimated] CSSAngle: Invalid value type: " +
50
+ stringifyJSIValue(rt, jsiValue));
51
+ }
52
+
53
+ std::string strValue = jsiValue.asString(rt).utf8(rt);
54
+ *this = CSSAngle(strValue);
55
+ }
56
+
57
+ bool CSSAngle::canConstruct(jsi::Runtime &rt, const jsi::Value &jsiValue) {
58
+ // TODO - improve canConstruct check and add check for string correctness
59
+ return jsiValue.isString();
60
+ }
61
+
62
+ jsi::Value CSSAngle::toJSIValue(jsi::Runtime &rt) const {
63
+ return jsi::String::createFromUtf8(rt, toString());
64
+ }
65
+
66
+ folly::dynamic CSSAngle::toDynamic() const {
67
+ return folly::dynamic(toString());
68
+ }
69
+
70
+ std::string CSSAngle::toString() const {
71
+ std::ostringstream stream;
72
+ stream << std::fixed << std::setprecision(4) << value;
73
+ return stream.str() + "rad";
74
+ }
75
+
76
+ CSSAngle CSSAngle::interpolate(double progress, const CSSAngle &to) const {
77
+ return CSSAngle(value + (to.value - value) * progress);
78
+ }
79
+
80
+ bool CSSAngle::operator==(const CSSAngle &other) const {
81
+ return value == other.value;
82
+ }
83
+
84
+ #ifndef NDEBUG
85
+
86
+ std::ostream &operator<<(std::ostream &os, const CSSAngle &angleValue) {
87
+ os << "CSSAngle(" << angleValue.value << ")";
88
+ return os;
89
+ }
90
+
91
+ #endif // NDEBUG
92
+
93
+ } // namespace reanimated
94
+
95
+ #endif // RCT_NEW_ARCH_ENABLED
@@ -0,0 +1,42 @@
1
+ #pragma once
2
+ #ifdef RCT_NEW_ARCH_ENABLED
3
+
4
+ #include <reanimated/CSS/common/values/CSSValue.h>
5
+
6
+ #include <worklets/Tools/JSISerializer.h>
7
+
8
+ #include <iomanip>
9
+ #include <regex>
10
+ #include <sstream>
11
+ #include <string>
12
+ #include <unordered_map>
13
+
14
+ namespace reanimated {
15
+
16
+ using namespace worklets;
17
+
18
+ struct CSSAngle : public CSSBaseValue<CSSValueType::Angle, CSSAngle> {
19
+ double value;
20
+
21
+ CSSAngle();
22
+ explicit CSSAngle(double value);
23
+ explicit CSSAngle(const std::string &rotationString);
24
+ explicit CSSAngle(jsi::Runtime &rt, const jsi::Value &jsiValue);
25
+
26
+ static bool canConstruct(jsi::Runtime &rt, const jsi::Value &jsiValue);
27
+
28
+ jsi::Value toJSIValue(jsi::Runtime &rt) const override;
29
+ folly::dynamic toDynamic() const override;
30
+ std::string toString() const override;
31
+ CSSAngle interpolate(double progress, const CSSAngle &to) const override;
32
+
33
+ bool operator==(const CSSAngle &other) const;
34
+
35
+ #ifndef NDEBUG
36
+ friend std::ostream &operator<<(std::ostream &os, const CSSAngle &angleValue);
37
+ #endif // NDEBUG
38
+ };
39
+
40
+ } // namespace reanimated
41
+
42
+ #endif // RCT_NEW_ARCH_ENABLED
@@ -0,0 +1,50 @@
1
+ #ifdef RCT_NEW_ARCH_ENABLED
2
+
3
+ #include <reanimated/CSS/common/values/CSSBoolean.h>
4
+
5
+ namespace reanimated {
6
+
7
+ CSSBoolean::CSSBoolean() : value(false) {}
8
+
9
+ CSSBoolean::CSSBoolean(bool value) : value(value) {}
10
+
11
+ CSSBoolean::CSSBoolean(jsi::Runtime &rt, const jsi::Value &jsiValue)
12
+ : value(jsiValue.asBool()) {}
13
+
14
+ bool CSSBoolean::canConstruct(jsi::Runtime &rt, const jsi::Value &jsiValue) {
15
+ return jsiValue.isBool();
16
+ }
17
+
18
+ jsi::Value CSSBoolean::toJSIValue(jsi::Runtime &rt) const {
19
+ return {value};
20
+ }
21
+
22
+ folly::dynamic CSSBoolean::toDynamic() const {
23
+ return {value};
24
+ }
25
+
26
+ std::string CSSBoolean::toString() const {
27
+ return value ? "true" : "false";
28
+ }
29
+
30
+ CSSBoolean CSSBoolean::interpolate(double progress, const CSSBoolean &to)
31
+ const {
32
+ return CSSBoolean(progress < 0.5 ? value : to.value);
33
+ }
34
+
35
+ bool CSSBoolean::operator==(const CSSBoolean &other) const {
36
+ return value == other.value;
37
+ }
38
+
39
+ #ifndef NDEBUG
40
+
41
+ std::ostream &operator<<(std::ostream &os, const CSSBoolean &boolValue) {
42
+ os << boolValue.toString();
43
+ return os;
44
+ }
45
+
46
+ #endif // NDEBUG
47
+
48
+ } // namespace reanimated
49
+
50
+ #endif // RCT_NEW_ARCH_ENABLED
@@ -0,0 +1,39 @@
1
+ #pragma once
2
+ #ifdef RCT_NEW_ARCH_ENABLED
3
+
4
+ #include <reanimated/CSS/common/values/CSSValue.h>
5
+
6
+ #include <worklets/Tools/JSISerializer.h>
7
+
8
+ #include <string>
9
+
10
+ namespace reanimated {
11
+
12
+ using namespace worklets;
13
+
14
+ struct CSSBoolean : public CSSBaseValue<CSSValueType::Boolean, CSSBoolean> {
15
+ bool value;
16
+
17
+ CSSBoolean();
18
+ explicit CSSBoolean(bool value);
19
+ explicit CSSBoolean(jsi::Runtime &rt, const jsi::Value &jsiValue);
20
+
21
+ static bool canConstruct(jsi::Runtime &rt, const jsi::Value &jsiValue);
22
+
23
+ jsi::Value toJSIValue(jsi::Runtime &rt) const override;
24
+ folly::dynamic toDynamic() const override;
25
+ std::string toString() const override;
26
+ CSSBoolean interpolate(double progress, const CSSBoolean &to) const override;
27
+
28
+ bool operator==(const CSSBoolean &other) const;
29
+
30
+ #ifndef NDEBUG
31
+ friend std::ostream &operator<<(
32
+ std::ostream &os,
33
+ const CSSBoolean &boolValue);
34
+ #endif // NDEBUG
35
+ };
36
+
37
+ } // namespace reanimated
38
+
39
+ #endif // RCT_NEW_ARCH_ENABLED
@@ -0,0 +1,136 @@
1
+ #ifdef RCT_NEW_ARCH_ENABLED
2
+ #include <reanimated/CSS/common/values/CSSColor.h>
3
+
4
+ namespace reanimated {
5
+
6
+ CSSColor::CSSColor()
7
+ : channels{0, 0, 0, 0}, colorType(ColorType::Transparent) {}
8
+
9
+ CSSColor::CSSColor(ColorType colorType)
10
+ : channels{0, 0, 0, 0}, colorType(colorType) {}
11
+
12
+ CSSColor::CSSColor(const uint8_t r, const uint8_t g, const uint8_t b)
13
+ : channels{r, g, b, 255}, colorType(ColorType::Rgba) {}
14
+
15
+ CSSColor::CSSColor(
16
+ const uint8_t r,
17
+ const uint8_t g,
18
+ const uint8_t b,
19
+ const uint8_t a)
20
+ : channels{r, g, b, a}, colorType(ColorType::Rgba) {}
21
+
22
+ CSSColor::CSSColor(const ColorChannels &colorChannels)
23
+ : channels{colorChannels[0], colorChannels[1], colorChannels[2], colorChannels[3]},
24
+ colorType(ColorType::Rgba) {}
25
+
26
+ CSSColor::CSSColor(jsi::Runtime &rt, const jsi::Value &jsiValue)
27
+ : channels{0, 0, 0, 0}, colorType(ColorType::Transparent) {
28
+ if (jsiValue.isNumber()) {
29
+ #ifdef ANDROID
30
+ // Android uses signed 32-bit integers for colors
31
+ auto color = static_cast<int32_t>(jsiValue.asNumber());
32
+ #else
33
+ // iOS uses unsigned 32-bit integers for colors
34
+ auto color = static_cast<unsigned>(jsiValue.asNumber());
35
+ #endif
36
+ channels[0] = (color >> 16) & 0xFF; // Red
37
+ channels[1] = (color >> 8) & 0xFF; // Green
38
+ channels[2] = color & 0xFF; // Blue
39
+ channels[3] = (color >> 24) & 0xFF; // Alpha
40
+ colorType = ColorType::Rgba;
41
+ } else if (
42
+ jsiValue.isUndefined() ||
43
+ (jsiValue.isString() &&
44
+ jsiValue.getString(rt).utf8(rt) == "transparent")) {
45
+ colorType = ColorType::Transparent;
46
+ } else {
47
+ throw std::invalid_argument(
48
+ "[Reanimated] CSSColor: Invalid value type: " +
49
+ stringifyJSIValue(rt, jsiValue));
50
+ }
51
+ }
52
+
53
+ bool CSSColor::canConstruct(jsi::Runtime &rt, const jsi::Value &jsiValue) {
54
+ // TODO - improve canConstruct check and add check for string correctness
55
+ return jsiValue.isNumber() || jsiValue.isString();
56
+ }
57
+
58
+ jsi::Value CSSColor::toJSIValue(jsi::Runtime &rt) const {
59
+ if (colorType == ColorType::Transparent) {
60
+ return 0x00000000;
61
+ }
62
+ return {
63
+ (channels[3] << 24) | (channels[0] << 16) | (channels[1] << 8) |
64
+ channels[2]};
65
+ }
66
+
67
+ folly::dynamic CSSColor::toDynamic() const {
68
+ if (colorType == ColorType::Transparent) {
69
+ return 0x00000000;
70
+ }
71
+ return (channels[3] << 24) | (channels[0] << 16) | (channels[1] << 8) |
72
+ channels[2];
73
+ }
74
+
75
+ std::string CSSColor::toString() const {
76
+ if (colorType == ColorType::Rgba) {
77
+ return "rgba(" + std::to_string(channels[0]) + "," +
78
+ std::to_string(channels[1]) + "," + std::to_string(channels[2]) + "," +
79
+ std::to_string(channels[3]) + ")";
80
+ } else {
81
+ return "transparent";
82
+ }
83
+ }
84
+
85
+ CSSColor CSSColor::interpolate(const double progress, const CSSColor &to)
86
+ const {
87
+ if (to.colorType == ColorType::Transparent &&
88
+ colorType == ColorType::Transparent) {
89
+ return *this;
90
+ }
91
+
92
+ ColorChannels fromChannels = channels;
93
+ ColorChannels toChannels = to.channels;
94
+ if (colorType == ColorType::Transparent) {
95
+ fromChannels = {toChannels[0], toChannels[1], toChannels[2], 0};
96
+ } else if (to.colorType == ColorType::Transparent) {
97
+ toChannels = {fromChannels[0], fromChannels[1], fromChannels[2], 0};
98
+ }
99
+
100
+ ColorChannels resultChannels;
101
+ for (size_t i = 0; i < 4; ++i) {
102
+ resultChannels[i] =
103
+ interpolateChannel(fromChannels[i], toChannels[i], progress);
104
+ }
105
+
106
+ return CSSColor(resultChannels);
107
+ }
108
+
109
+ uint8_t CSSColor::interpolateChannel(
110
+ const uint8_t from,
111
+ const uint8_t to,
112
+ const double progress) {
113
+ // Cast one of operands to double to avoid unsigned int subtraction overflow
114
+ // (when from > to)
115
+ double interpolated = (static_cast<double>(to) - from) * progress + from;
116
+ return static_cast<uint8_t>(std::round(std::clamp(interpolated, 0.0, 255.0)));
117
+ }
118
+
119
+ bool CSSColor::operator==(const CSSColor &other) const {
120
+ return colorType == other.colorType && channels[0] == other.channels[0] &&
121
+ channels[1] == other.channels[1] && channels[2] == other.channels[2] &&
122
+ channels[3] == other.channels[3];
123
+ }
124
+
125
+ #ifndef NDEBUG
126
+
127
+ std::ostream &operator<<(std::ostream &os, const CSSColor &colorValue) {
128
+ os << "CSSColor(" << colorValue.toString() << ")";
129
+ return os;
130
+ }
131
+
132
+ #endif // NDEBUG
133
+
134
+ } // namespace reanimated
135
+
136
+ #endif // RCT_NEW_ARCH_ENABLED
@@ -0,0 +1,53 @@
1
+ #pragma once
2
+ #ifdef RCT_NEW_ARCH_ENABLED
3
+
4
+ #include <reanimated/CSS/common/definitions.h>
5
+ #include <reanimated/CSS/common/values/CSSValue.h>
6
+
7
+ #include <worklets/Tools/JSISerializer.h>
8
+
9
+ #include <string>
10
+
11
+ namespace reanimated {
12
+
13
+ using namespace worklets;
14
+
15
+ enum class ColorType {
16
+ Rgba,
17
+ Transparent,
18
+ };
19
+
20
+ struct CSSColor : public CSSBaseValue<CSSValueType::Color, CSSColor> {
21
+ ColorChannels channels;
22
+ ColorType colorType;
23
+
24
+ static const CSSColor Transparent;
25
+
26
+ CSSColor();
27
+ explicit CSSColor(ColorType colorType);
28
+ explicit CSSColor(uint8_t r, uint8_t g, uint8_t b);
29
+ explicit CSSColor(uint8_t r, uint8_t g, uint8_t b, uint8_t a);
30
+ explicit CSSColor(const ColorChannels &colorChannels);
31
+ explicit CSSColor(jsi::Runtime &rt, const jsi::Value &jsiValue);
32
+
33
+ static bool canConstruct(jsi::Runtime &rt, const jsi::Value &jsiValue);
34
+
35
+ jsi::Value toJSIValue(jsi::Runtime &rt) const override;
36
+ folly::dynamic toDynamic() const override;
37
+ std::string toString() const override;
38
+ CSSColor interpolate(double progress, const CSSColor &to) const override;
39
+
40
+ static uint8_t interpolateChannel(uint8_t from, uint8_t to, double progress);
41
+
42
+ bool operator==(const CSSColor &other) const;
43
+
44
+ #ifndef NDEBUG
45
+ friend std::ostream &operator<<(std::ostream &os, const CSSColor &colorValue);
46
+ #endif // NDEBUG
47
+ };
48
+
49
+ inline const CSSColor CSSColor::Transparent(ColorType::Transparent);
50
+
51
+ } // namespace reanimated
52
+
53
+ #endif // RCT_NEW_ARCH_ENABLED
@@ -0,0 +1,131 @@
1
+ #ifdef RCT_NEW_ARCH_ENABLED
2
+ #include <reanimated/CSS/common/values/CSSDimension.h>
3
+
4
+ namespace reanimated {
5
+
6
+ CSSDimension::CSSDimension() : value(0), isRelative(false) {}
7
+
8
+ CSSDimension::CSSDimension(const double value)
9
+ : value(value), isRelative(false) {}
10
+
11
+ CSSDimension::CSSDimension(const double value, const bool isRelative)
12
+ : value(value), isRelative(isRelative) {}
13
+
14
+ CSSDimension::CSSDimension(const std::string &value) {
15
+ if (!canConstruct(value)) {
16
+ throw std::invalid_argument(
17
+ "[Reanimated] CSSDimension: Invalid value: " + value);
18
+ }
19
+
20
+ std::string str = value;
21
+ str.pop_back();
22
+ this->value = std::stod(str) / 100;
23
+ this->isRelative = true;
24
+ }
25
+
26
+ CSSDimension::CSSDimension(jsi::Runtime &rt, const jsi::Value &jsiValue) {
27
+ if (jsiValue.isNumber()) {
28
+ this->value = jsiValue.asNumber();
29
+ this->isRelative = false;
30
+ } else if (jsiValue.isString()) {
31
+ std::string strValue = jsiValue.asString(rt).utf8(rt);
32
+ *this = CSSDimension(strValue); // Delegate to the string constructor
33
+ } else {
34
+ throw std::runtime_error(
35
+ "[Reanimated] CSSDimension: Unsupported value type");
36
+ }
37
+ }
38
+
39
+ bool CSSDimension::canConstruct(const std::string &value) {
40
+ return !value.empty() && value.back() == '%';
41
+ }
42
+
43
+ bool CSSDimension::canConstruct(jsi::Runtime &rt, const jsi::Value &jsiValue) {
44
+ return jsiValue.isNumber() ||
45
+ (jsiValue.isString() && canConstruct(jsiValue.getString(rt).utf8(rt)));
46
+ }
47
+
48
+ jsi::Value CSSDimension::toJSIValue(jsi::Runtime &rt) const {
49
+ if (isRelative) {
50
+ return jsi::String::createFromUtf8(rt, std::to_string(value * 100) + "%");
51
+ }
52
+ return {value};
53
+ }
54
+
55
+ folly::dynamic CSSDimension::toDynamic() const {
56
+ if (isRelative) {
57
+ return std::to_string(value * 100) + "%";
58
+ }
59
+ return value;
60
+ }
61
+
62
+ std::string CSSDimension::toString() const {
63
+ if (isRelative) {
64
+ return std::to_string(value * 100) + "%";
65
+ }
66
+ return std::to_string(value);
67
+ }
68
+
69
+ CSSDimension CSSDimension::interpolate(
70
+ const double progress,
71
+ const CSSDimension &to,
72
+ const CSSResolvableValueInterpolationContext &context) const {
73
+ // If both value types are the same, we can interpolate without reading the
74
+ // relative value from the shadow node
75
+ // (also, when one of the values is 0, and the other is relative)
76
+ if ((isRelative == to.isRelative) || (isRelative && to.value == 0) ||
77
+ (to.isRelative && value == 0)) {
78
+ return CSSDimension(
79
+ value + (to.value - value) * progress, isRelative || to.isRelative);
80
+ }
81
+ // Otherwise, we need to read the relative value from the shadow node and
82
+ // interpolate values as numbers
83
+ const auto resolvedFrom = resolve(context);
84
+ const auto resolvedTo = to.resolve(context);
85
+
86
+ if (!resolvedFrom.has_value() || !resolvedTo.has_value()) {
87
+ return progress < 0.5 ? *this : to;
88
+ }
89
+ return CSSDimension(
90
+ resolvedFrom.value() +
91
+ (resolvedTo.value() - resolvedFrom.value()) * progress);
92
+ }
93
+
94
+ std::optional<double> CSSDimension::resolve(
95
+ const CSSResolvableValueInterpolationContext &context) const {
96
+ if (!isRelative) {
97
+ return value;
98
+ }
99
+
100
+ jsi::Value relativeValue;
101
+ if (context.relativeTo == RelativeTo::Self) {
102
+ relativeValue = context.viewStylesRepository->getNodeProp(
103
+ context.node, context.relativeProperty);
104
+ } else {
105
+ relativeValue = context.viewStylesRepository->getParentNodeProp(
106
+ context.node, context.relativeProperty);
107
+ }
108
+
109
+ if (!relativeValue.isNumber()) {
110
+ return std::nullopt;
111
+ }
112
+
113
+ return value * relativeValue.getNumber();
114
+ }
115
+
116
+ bool CSSDimension::operator==(const CSSDimension &other) const {
117
+ return value == other.value && isRelative == other.isRelative;
118
+ }
119
+
120
+ #ifndef NDEBUG
121
+
122
+ std::ostream &operator<<(std::ostream &os, const CSSDimension &dimension) {
123
+ os << "CSSDimension(" << dimension.toString() << ")";
124
+ return os;
125
+ }
126
+
127
+ #endif // NDEBUG
128
+
129
+ } // namespace reanimated
130
+
131
+ #endif // RCT_NEW_ARCH_ENABLED