react-native-reanimated 3.17.0-rc.0 → 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 (779) 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 +3 -10
  103. package/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxy.h +1 -2
  104. package/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsUtils.h +0 -2
  105. package/Common/cpp/reanimated/NativeModules/{NativeReanimatedModule.cpp → ReanimatedModuleProxy.cpp} +351 -214
  106. package/Common/cpp/reanimated/NativeModules/{NativeReanimatedModule.h → ReanimatedModuleProxy.h} +78 -53
  107. package/Common/cpp/reanimated/NativeModules/ReanimatedModuleProxySpec.cpp +259 -0
  108. package/Common/cpp/reanimated/NativeModules/{NativeReanimatedModuleSpec.h → ReanimatedModuleProxySpec.h} +37 -25
  109. package/Common/cpp/reanimated/RuntimeDecorators/RNRuntimeDecorator.cpp +6 -15
  110. package/Common/cpp/reanimated/RuntimeDecorators/RNRuntimeDecorator.h +3 -2
  111. package/Common/cpp/reanimated/Tools/ReanimatedSystraceSection.h +135 -0
  112. package/Common/cpp/worklets/NativeModules/WorkletsModuleProxy.cpp +119 -0
  113. package/Common/cpp/worklets/NativeModules/WorkletsModuleProxy.h +79 -0
  114. package/Common/cpp/worklets/NativeModules/WorkletsModuleProxySpec.cpp +72 -0
  115. package/Common/cpp/worklets/NativeModules/WorkletsModuleProxySpec.h +44 -0
  116. package/Common/cpp/worklets/SharedItems/Shareables.cpp +12 -2
  117. package/Common/cpp/worklets/Tools/Defs.h +10 -0
  118. package/Common/cpp/worklets/Tools/JSScheduler.cpp +0 -20
  119. package/Common/cpp/worklets/Tools/JSScheduler.h +0 -12
  120. package/Common/cpp/{reanimated → worklets}/Tools/PlatformLogger.h +2 -2
  121. package/Common/cpp/{reanimated → worklets}/Tools/SingleInstanceChecker.h +5 -6
  122. package/Common/cpp/worklets/WorkletRuntime/RNRuntimeWorkletDecorator.cpp +11 -2
  123. package/Common/cpp/worklets/WorkletRuntime/RNRuntimeWorkletDecorator.h +2 -2
  124. package/Common/cpp/worklets/WorkletRuntime/ReanimatedHermesRuntime.cpp +0 -10
  125. package/Common/cpp/worklets/WorkletRuntime/ReanimatedHermesRuntime.h +2 -13
  126. package/Common/cpp/worklets/WorkletRuntime/ReanimatedRuntime.cpp +3 -11
  127. package/Common/cpp/worklets/WorkletRuntime/ReanimatedRuntime.h +0 -8
  128. package/Common/cpp/worklets/WorkletRuntime/WorkletRuntimeDecorator.cpp +6 -0
  129. package/README.md +3 -4
  130. package/android/CMakeLists.txt +20 -12
  131. package/android/build.gradle +0 -16
  132. package/android/src/{reactNativeVersionPatch/NativeProxyFabric/latest → fabric/java}/com/swmansion/reanimated/NativeProxy.java +24 -40
  133. package/android/src/fabric/java/com/swmansion/reanimated/ReaCompatibility.java +6 -0
  134. package/android/src/main/cpp/reanimated/CMakeLists.txt +22 -41
  135. package/android/src/main/cpp/reanimated/android/LayoutAnimations.cpp +4 -0
  136. package/android/src/main/cpp/reanimated/android/LayoutAnimations.h +2 -0
  137. package/android/src/main/cpp/reanimated/android/NativeProxy.cpp +97 -133
  138. package/android/src/main/cpp/reanimated/android/NativeProxy.h +9 -34
  139. package/android/src/main/cpp/reanimated/android/OnLoad.cpp +0 -2
  140. package/android/src/main/cpp/worklets/CMakeLists.txt +52 -106
  141. package/android/src/main/cpp/{reanimated → worklets}/android/AndroidUIScheduler.cpp +3 -3
  142. package/android/src/main/cpp/{reanimated → worklets}/android/AndroidUIScheduler.h +3 -3
  143. package/android/src/main/cpp/{reanimated → worklets}/android/PlatformLogger.cpp +4 -4
  144. package/android/src/main/cpp/worklets/android/WorkletsModule.cpp +40 -11
  145. package/android/src/main/cpp/worklets/android/WorkletsModule.h +22 -12
  146. package/android/src/main/cpp/worklets/android/WorkletsOnLoad.cpp +5 -2
  147. package/android/src/main/java/com/swmansion/reanimated/NodesManager.java +16 -3
  148. package/android/src/main/java/com/swmansion/reanimated/ReanimatedPackage.java +3 -3
  149. package/android/src/main/java/com/swmansion/reanimated/Utils.java +10 -0
  150. package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/AnimationsManager.java +1 -1
  151. package/android/src/main/java/com/swmansion/reanimated/nativeProxy/NativeProxyCommon.java +3 -11
  152. package/android/src/main/java/com/swmansion/{reanimated → worklets}/AndroidUIScheduler.java +1 -1
  153. package/android/src/main/java/com/swmansion/worklets/JSCallInvokerResolver.java +27 -0
  154. package/android/src/main/java/com/swmansion/{reanimated/ReanimatedMessageQueueThread.java → worklets/WorkletsMessageQueueThread.java} +2 -2
  155. package/android/src/main/java/com/swmansion/{reanimated/ReanimatedMessageQueueThreadBase.java → worklets/WorkletsMessageQueueThreadBase.java} +3 -3
  156. package/android/src/main/java/com/swmansion/worklets/WorkletsModule.java +39 -9
  157. package/android/src/{reactNativeVersionPatch/NativeProxyPaper/latest → paper/java}/com/swmansion/reanimated/NativeProxy.java +13 -7
  158. package/android/src/paper/java/com/swmansion/reanimated/ReaCompatibility.java +2 -0
  159. package/android/src/reactNativeVersionPatch/ReanimatedUIManager/74/com/swmansion/reanimated/ReanimatedModule.java +11 -0
  160. package/android/src/reactNativeVersionPatch/ReanimatedUIManager/latest/com/swmansion/reanimated/ReanimatedModule.java +11 -0
  161. package/apple/reanimated/apple/LayoutReanimation/REASharedTransitionManager.m +17 -2
  162. package/apple/reanimated/apple/LayoutReanimation/REASwizzledUIManager.mm +5 -6
  163. package/apple/reanimated/apple/REAModule.h +6 -9
  164. package/apple/reanimated/apple/REAModule.mm +52 -126
  165. package/apple/reanimated/apple/REANodesManager.h +0 -1
  166. package/apple/reanimated/apple/REANodesManager.mm +1 -8
  167. package/apple/reanimated/apple/native/NativeProxy.h +7 -14
  168. package/apple/reanimated/apple/native/NativeProxy.mm +58 -102
  169. package/apple/reanimated/apple/native/PlatformDepMethodsHolderImpl.h +1 -1
  170. package/apple/reanimated/apple/native/PlatformDepMethodsHolderImpl.mm +2 -3
  171. package/apple/{reanimated/apple/native/REAIOSUIScheduler.h → worklets/apple/IOSUIScheduler.h} +3 -3
  172. package/apple/{reanimated/apple/native/REAIOSUIScheduler.mm → worklets/apple/IOSUIScheduler.mm} +4 -4
  173. package/apple/{reanimated/apple/native → worklets/apple}/PlatformLogger.mm +3 -3
  174. package/apple/{reanimated/apple/native/REAMessageThread.h → worklets/apple/WorkletsMessageThread.h} +1 -1
  175. package/apple/{reanimated/apple/native/REAMessageThread.mm → worklets/apple/WorkletsMessageThread.mm} +7 -7
  176. package/apple/worklets/apple/WorkletsModule.h +2 -2
  177. package/apple/worklets/apple/WorkletsModule.mm +31 -6
  178. package/lib/module/{PropsRegistry.js → AnimatedPropsRegistry.js} +2 -2
  179. package/lib/module/AnimatedPropsRegistry.js.map +1 -0
  180. package/lib/module/ReanimatedModule/NativeReanimated.js +29 -16
  181. package/lib/module/ReanimatedModule/NativeReanimated.js.map +1 -1
  182. package/lib/module/ReanimatedModule/js-reanimated/JSReanimated.js +23 -21
  183. package/lib/module/ReanimatedModule/js-reanimated/JSReanimated.js.map +1 -1
  184. package/lib/module/Sensor.js.map +1 -1
  185. package/lib/module/commonTypes.js.map +1 -1
  186. package/lib/module/component/FlatList.js +11 -13
  187. package/lib/module/component/FlatList.js.map +1 -1
  188. package/lib/module/component/LayoutAnimationConfig.js +9 -13
  189. package/lib/module/component/LayoutAnimationConfig.js.map +1 -1
  190. package/lib/module/component/PerformanceMonitor.js +21 -25
  191. package/lib/module/component/PerformanceMonitor.js.map +1 -1
  192. package/lib/module/component/ScrollView.js +5 -5
  193. package/lib/module/component/ScrollView.js.map +1 -1
  194. package/lib/module/core.js +1 -1
  195. package/lib/module/core.js.map +1 -1
  196. package/lib/module/createAnimatedComponent/AnimatedComponent.js +341 -0
  197. package/lib/module/createAnimatedComponent/AnimatedComponent.js.map +1 -0
  198. package/lib/module/createAnimatedComponent/JSPropsUpdater.js +4 -5
  199. package/lib/module/createAnimatedComponent/JSPropsUpdater.js.map +1 -1
  200. package/lib/module/createAnimatedComponent/NativeEventsManager.js +35 -8
  201. package/lib/module/createAnimatedComponent/NativeEventsManager.js.map +1 -1
  202. package/lib/module/createAnimatedComponent/createAnimatedComponent.js +8 -385
  203. package/lib/module/createAnimatedComponent/createAnimatedComponent.js.map +1 -1
  204. package/lib/module/createAnimatedComponent/setAndForwardRef.js +1 -1
  205. package/lib/module/createAnimatedComponent/setAndForwardRef.js.map +1 -1
  206. package/lib/module/createAnimatedComponent/utils.js +28 -0
  207. package/lib/module/createAnimatedComponent/utils.js.map +1 -1
  208. package/lib/module/css/component/AnimatedComponent.js +134 -0
  209. package/lib/module/css/component/AnimatedComponent.js.map +1 -0
  210. package/lib/module/css/component/createAnimatedComponent.js +30 -0
  211. package/lib/module/css/component/createAnimatedComponent.js.map +1 -0
  212. package/lib/module/css/component/index.js +4 -0
  213. package/lib/module/css/component/index.js.map +1 -0
  214. package/lib/module/css/constants/font.js +17 -0
  215. package/lib/module/css/constants/font.js.map +1 -0
  216. package/lib/module/css/constants/index.js +6 -0
  217. package/lib/module/css/constants/index.js.map +1 -0
  218. package/lib/module/css/constants/platform.js +5 -0
  219. package/lib/module/css/constants/platform.js.map +1 -0
  220. package/lib/module/css/constants/regex.js +6 -0
  221. package/lib/module/css/constants/regex.js.map +1 -0
  222. package/lib/module/css/easings/cubicBezier.js +34 -0
  223. package/lib/module/css/easings/cubicBezier.js.map +1 -0
  224. package/lib/module/css/easings/index.js +16 -0
  225. package/lib/module/css/easings/index.js.map +1 -0
  226. package/lib/module/css/easings/linear.js +123 -0
  227. package/lib/module/css/easings/linear.js.map +1 -0
  228. package/lib/module/css/easings/steps.js +97 -0
  229. package/lib/module/css/easings/steps.js.map +1 -0
  230. package/lib/module/css/easings/types.js +4 -0
  231. package/lib/module/css/easings/types.js.map +1 -0
  232. package/lib/module/css/errors.js +15 -0
  233. package/lib/module/css/errors.js.map +1 -0
  234. package/lib/module/css/index.js +6 -0
  235. package/lib/module/css/index.js.map +1 -0
  236. package/lib/module/css/managers/CSSAnimationsManager.js +98 -0
  237. package/lib/module/css/managers/CSSAnimationsManager.js.map +1 -0
  238. package/lib/module/css/managers/CSSAnimationsManager.web.js +139 -0
  239. package/lib/module/css/managers/CSSAnimationsManager.web.js.map +1 -0
  240. package/lib/module/css/managers/CSSManager.js +52 -0
  241. package/lib/module/css/managers/CSSManager.js.map +1 -0
  242. package/lib/module/css/managers/CSSManager.web.js +35 -0
  243. package/lib/module/css/managers/CSSManager.web.js.map +1 -0
  244. package/lib/module/css/managers/CSSTransitionManager.js +44 -0
  245. package/lib/module/css/managers/CSSTransitionManager.js.map +1 -0
  246. package/lib/module/css/managers/CSSTransitionManager.web.js +52 -0
  247. package/lib/module/css/managers/CSSTransitionManager.web.js.map +1 -0
  248. package/lib/module/css/managers/index.js +4 -0
  249. package/lib/module/css/managers/index.js.map +1 -0
  250. package/lib/module/css/models/CSSKeyframesRule.js +14 -0
  251. package/lib/module/css/models/CSSKeyframesRule.js.map +1 -0
  252. package/lib/module/css/models/CSSKeyframesRule.web.js +14 -0
  253. package/lib/module/css/models/CSSKeyframesRule.web.js.map +1 -0
  254. package/lib/module/css/models/CSSKeyframesRuleBase.js +29 -0
  255. package/lib/module/css/models/CSSKeyframesRuleBase.js.map +1 -0
  256. package/lib/module/css/models/index.js +4 -0
  257. package/lib/module/css/models/index.js.map +1 -0
  258. package/lib/module/css/platform/native/config.js +274 -0
  259. package/lib/module/css/platform/native/config.js.map +1 -0
  260. package/lib/module/css/platform/native/index.js +7 -0
  261. package/lib/module/css/platform/native/index.js.map +1 -0
  262. package/lib/module/css/platform/native/native.js +36 -0
  263. package/lib/module/css/platform/native/native.js.map +1 -0
  264. package/lib/module/css/platform/native/normalization/animation/constants.js +6 -0
  265. package/lib/module/css/platform/native/normalization/animation/constants.js.map +1 -0
  266. package/lib/module/css/platform/native/normalization/animation/index.js +7 -0
  267. package/lib/module/css/platform/native/normalization/animation/index.js.map +1 -0
  268. package/lib/module/css/platform/native/normalization/animation/keyframes.js +107 -0
  269. package/lib/module/css/platform/native/normalization/animation/keyframes.js.map +1 -0
  270. package/lib/module/css/platform/native/normalization/animation/properties.js +28 -0
  271. package/lib/module/css/platform/native/normalization/animation/properties.js.map +1 -0
  272. package/lib/module/css/platform/native/normalization/animation/settings.js +88 -0
  273. package/lib/module/css/platform/native/normalization/animation/settings.js.map +1 -0
  274. package/lib/module/css/platform/native/normalization/common/index.js +4 -0
  275. package/lib/module/css/platform/native/normalization/common/index.js.map +1 -0
  276. package/lib/module/css/platform/native/normalization/common/settings.js +51 -0
  277. package/lib/module/css/platform/native/normalization/common/settings.js.map +1 -0
  278. package/lib/module/css/platform/native/normalization/index.js +6 -0
  279. package/lib/module/css/platform/native/normalization/index.js.map +1 -0
  280. package/lib/module/css/platform/native/normalization/transition/config.js +84 -0
  281. package/lib/module/css/platform/native/normalization/transition/config.js.map +1 -0
  282. package/lib/module/css/platform/native/normalization/transition/constants.js +4 -0
  283. package/lib/module/css/platform/native/normalization/transition/constants.js.map +1 -0
  284. package/lib/module/css/platform/native/normalization/transition/index.js +4 -0
  285. package/lib/module/css/platform/native/normalization/transition/index.js.map +1 -0
  286. package/lib/module/css/platform/native/normalization/transition/settings.js +14 -0
  287. package/lib/module/css/platform/native/normalization/transition/settings.js.map +1 -0
  288. package/lib/module/css/platform/native/style/builderFactory.js +59 -0
  289. package/lib/module/css/platform/native/style/builderFactory.js.map +1 -0
  290. package/lib/module/css/platform/native/style/index.js +6 -0
  291. package/lib/module/css/platform/native/style/index.js.map +1 -0
  292. package/lib/module/css/platform/native/style/processors/colors.js +25 -0
  293. package/lib/module/css/platform/native/style/processors/colors.js.map +1 -0
  294. package/lib/module/css/platform/native/style/processors/font.js +17 -0
  295. package/lib/module/css/platform/native/style/processors/font.js.map +1 -0
  296. package/lib/module/css/platform/native/style/processors/index.js +10 -0
  297. package/lib/module/css/platform/native/style/processors/index.js.map +1 -0
  298. package/lib/module/css/platform/native/style/processors/insets.js +17 -0
  299. package/lib/module/css/platform/native/style/processors/insets.js.map +1 -0
  300. package/lib/module/css/platform/native/style/processors/others.js +26 -0
  301. package/lib/module/css/platform/native/style/processors/others.js.map +1 -0
  302. package/lib/module/css/platform/native/style/processors/shadows.js +49 -0
  303. package/lib/module/css/platform/native/style/processors/shadows.js.map +1 -0
  304. package/lib/module/css/platform/native/style/processors/transform.js +138 -0
  305. package/lib/module/css/platform/native/style/processors/transform.js.map +1 -0
  306. package/lib/module/css/platform/native/style/processors/transformOrigin.js +64 -0
  307. package/lib/module/css/platform/native/style/processors/transformOrigin.js.map +1 -0
  308. package/lib/module/css/platform/native/style/types.js +4 -0
  309. package/lib/module/css/platform/native/style/types.js.map +1 -0
  310. package/lib/module/css/platform/native/styleBuilder.js +7 -0
  311. package/lib/module/css/platform/native/styleBuilder.js.map +1 -0
  312. package/lib/module/css/platform/native/types/animation.js +4 -0
  313. package/lib/module/css/platform/native/types/animation.js.map +1 -0
  314. package/lib/module/css/platform/native/types/common.js +2 -0
  315. package/lib/module/css/platform/native/types/common.js.map +1 -0
  316. package/lib/module/css/platform/native/types/index.js +6 -0
  317. package/lib/module/css/platform/native/types/index.js.map +1 -0
  318. package/lib/module/css/platform/native/types/transition.js +4 -0
  319. package/lib/module/css/platform/native/types/transition.js.map +1 -0
  320. package/lib/module/css/platform/web/animationParser.js +28 -0
  321. package/lib/module/css/platform/web/animationParser.js.map +1 -0
  322. package/lib/module/css/platform/web/config.js +265 -0
  323. package/lib/module/css/platform/web/config.js.map +1 -0
  324. package/lib/module/css/platform/web/domUtils.js +75 -0
  325. package/lib/module/css/platform/web/domUtils.js.map +1 -0
  326. package/lib/module/css/platform/web/index.js +6 -0
  327. package/lib/module/css/platform/web/index.js.map +1 -0
  328. package/lib/module/css/platform/web/style/builderFactories.js +124 -0
  329. package/lib/module/css/platform/web/style/builderFactories.js.map +1 -0
  330. package/lib/module/css/platform/web/style/builders/index.js +4 -0
  331. package/lib/module/css/platform/web/style/builders/index.js.map +1 -0
  332. package/lib/module/css/platform/web/style/builders/shadows.js +45 -0
  333. package/lib/module/css/platform/web/style/builders/shadows.js.map +1 -0
  334. package/lib/module/css/platform/web/style/index.js +7 -0
  335. package/lib/module/css/platform/web/style/index.js.map +1 -0
  336. package/lib/module/css/platform/web/style/processors/colors.js +12 -0
  337. package/lib/module/css/platform/web/style/processors/colors.js.map +1 -0
  338. package/lib/module/css/platform/web/style/processors/filter.js +28 -0
  339. package/lib/module/css/platform/web/style/processors/filter.js.map +1 -0
  340. package/lib/module/css/platform/web/style/processors/font.js +13 -0
  341. package/lib/module/css/platform/web/style/processors/font.js.map +1 -0
  342. package/lib/module/css/platform/web/style/processors/index.js +10 -0
  343. package/lib/module/css/platform/web/style/processors/index.js.map +1 -0
  344. package/lib/module/css/platform/web/style/processors/margins.js +24 -0
  345. package/lib/module/css/platform/web/style/processors/margins.js.map +1 -0
  346. package/lib/module/css/platform/web/style/processors/paddings.js +24 -0
  347. package/lib/module/css/platform/web/style/processors/paddings.js.map +1 -0
  348. package/lib/module/css/platform/web/style/processors/shadows.js +17 -0
  349. package/lib/module/css/platform/web/style/processors/shadows.js.map +1 -0
  350. package/lib/module/css/platform/web/style/processors/transforms.js +37 -0
  351. package/lib/module/css/platform/web/style/processors/transforms.js.map +1 -0
  352. package/lib/module/css/platform/web/style/types.js +4 -0
  353. package/lib/module/css/platform/web/style/types.js.map +1 -0
  354. package/lib/module/css/platform/web/utils.js +69 -0
  355. package/lib/module/css/platform/web/utils.js.map +1 -0
  356. package/lib/module/css/stylesheet.js +25 -0
  357. package/lib/module/css/stylesheet.js.map +1 -0
  358. package/lib/module/css/types/animation.js +4 -0
  359. package/lib/module/css/types/animation.js.map +1 -0
  360. package/lib/module/css/types/common.js +4 -0
  361. package/lib/module/css/types/common.js.map +1 -0
  362. package/lib/module/css/types/config.js +4 -0
  363. package/lib/module/css/types/config.js.map +1 -0
  364. package/lib/module/css/types/helpers.js +4 -0
  365. package/lib/module/css/types/helpers.js.map +1 -0
  366. package/lib/module/css/types/index.js +9 -0
  367. package/lib/module/css/types/index.js.map +1 -0
  368. package/lib/module/css/types/props.js +4 -0
  369. package/lib/module/css/types/props.js.map +1 -0
  370. package/lib/module/css/types/transition.js +4 -0
  371. package/lib/module/css/types/transition.js.map +1 -0
  372. package/lib/module/css/utils/conversions.js +8 -0
  373. package/lib/module/css/utils/conversions.js.map +1 -0
  374. package/lib/module/css/utils/equality.js +57 -0
  375. package/lib/module/css/utils/equality.js.map +1 -0
  376. package/lib/module/css/utils/guards.js +24 -0
  377. package/lib/module/css/utils/guards.js.map +1 -0
  378. package/lib/module/css/utils/index.js +8 -0
  379. package/lib/module/css/utils/index.js.map +1 -0
  380. package/lib/module/css/utils/parsers.js +27 -0
  381. package/lib/module/css/utils/parsers.js.map +1 -0
  382. package/lib/module/css/utils/props.js +34 -0
  383. package/lib/module/css/utils/props.js.map +1 -0
  384. package/lib/module/fabricUtils.js +4 -11
  385. package/lib/module/fabricUtils.js.map +1 -1
  386. package/lib/module/index.js +1 -0
  387. package/lib/module/index.js.map +1 -1
  388. package/lib/module/initializers.js +5 -1
  389. package/lib/module/initializers.js.map +1 -1
  390. package/lib/module/layoutReanimation/web/componentUtils.js +1 -0
  391. package/lib/module/layoutReanimation/web/componentUtils.js.map +1 -1
  392. package/lib/module/logger/logger.js +3 -3
  393. package/lib/module/logger/logger.js.map +1 -1
  394. package/lib/module/mock.js +38 -6
  395. package/lib/module/mock.js.map +1 -1
  396. package/lib/module/mutables.js +2 -2
  397. package/lib/module/platform-specific/findHostInstance.js +53 -0
  398. package/lib/module/platform-specific/findHostInstance.js.map +1 -0
  399. package/lib/module/platform-specific/findHostInstance.web.js +4 -0
  400. package/lib/module/platform-specific/findHostInstance.web.js.map +1 -0
  401. package/lib/module/platform-specific/jsVersion.js +1 -1
  402. package/lib/module/platform-specific/jsVersion.js.map +1 -1
  403. package/lib/module/propsAllowlists.js +7 -1
  404. package/lib/module/propsAllowlists.js.map +1 -1
  405. package/lib/module/runtimes.js +3 -3
  406. package/lib/module/runtimes.js.map +1 -1
  407. package/lib/module/shareables.js +215 -141
  408. package/lib/module/shareables.js.map +1 -1
  409. package/lib/module/threads.js +5 -5
  410. package/lib/module/threads.js.map +1 -1
  411. package/lib/module/worklets/WorkletsModule/JSWorklets.js +27 -1
  412. package/lib/module/worklets/WorkletsModule/JSWorklets.js.map +1 -1
  413. package/lib/module/worklets/WorkletsModule/NativeWorklets.js +15 -0
  414. package/lib/module/worklets/WorkletsModule/NativeWorklets.js.map +1 -1
  415. package/lib/module/worklets/WorkletsModule/workletsModuleProxy.js +1 -1
  416. package/lib/module/worklets/WorkletsModule/workletsModuleProxy.js.map +1 -1
  417. package/lib/typescript/{PropsRegistry.d.ts → AnimatedPropsRegistry.d.ts} +1 -1
  418. package/lib/typescript/AnimatedPropsRegistry.d.ts.map +1 -0
  419. package/lib/typescript/ReanimatedModule/NativeReanimated.d.ts.map +1 -1
  420. package/lib/typescript/ReanimatedModule/js-reanimated/JSReanimated.d.ts.map +1 -1
  421. package/lib/typescript/ReanimatedModule/reanimatedModuleProxy.d.ts +14 -8
  422. package/lib/typescript/ReanimatedModule/reanimatedModuleProxy.d.ts.map +1 -1
  423. package/lib/typescript/Sensor.d.ts.map +1 -1
  424. package/lib/typescript/commonTypes.d.ts +14 -21
  425. package/lib/typescript/commonTypes.d.ts.map +1 -1
  426. package/lib/typescript/core.d.ts.map +1 -1
  427. package/lib/typescript/createAnimatedComponent/AnimatedComponent.d.ts +58 -0
  428. package/lib/typescript/createAnimatedComponent/AnimatedComponent.d.ts.map +1 -0
  429. package/lib/typescript/createAnimatedComponent/JSPropsUpdater.d.ts +2 -1
  430. package/lib/typescript/createAnimatedComponent/JSPropsUpdater.d.ts.map +1 -1
  431. package/lib/typescript/createAnimatedComponent/NativeEventsManager.d.ts +1 -3
  432. package/lib/typescript/createAnimatedComponent/NativeEventsManager.d.ts.map +1 -1
  433. package/lib/typescript/createAnimatedComponent/commonTypes.d.ts +11 -7
  434. package/lib/typescript/createAnimatedComponent/commonTypes.d.ts.map +1 -1
  435. package/lib/typescript/createAnimatedComponent/createAnimatedComponent.d.ts +2 -7
  436. package/lib/typescript/createAnimatedComponent/createAnimatedComponent.d.ts.map +1 -1
  437. package/lib/typescript/createAnimatedComponent/utils.d.ts +5 -0
  438. package/lib/typescript/createAnimatedComponent/utils.d.ts.map +1 -1
  439. package/lib/typescript/css/component/AnimatedComponent.d.ts +29 -0
  440. package/lib/typescript/css/component/AnimatedComponent.d.ts.map +1 -0
  441. package/lib/typescript/css/component/createAnimatedComponent.d.ts +12 -0
  442. package/lib/typescript/css/component/createAnimatedComponent.d.ts.map +1 -0
  443. package/lib/typescript/css/component/index.d.ts +2 -0
  444. package/lib/typescript/css/component/index.d.ts.map +1 -0
  445. package/lib/typescript/css/constants/font.d.ts +15 -0
  446. package/lib/typescript/css/constants/font.d.ts.map +1 -0
  447. package/lib/typescript/css/constants/index.d.ts +4 -0
  448. package/lib/typescript/css/constants/index.d.ts.map +1 -0
  449. package/lib/typescript/css/constants/platform.d.ts +2 -0
  450. package/lib/typescript/css/constants/platform.d.ts.map +1 -0
  451. package/lib/typescript/css/constants/regex.d.ts +4 -0
  452. package/lib/typescript/css/constants/regex.d.ts.map +1 -0
  453. package/lib/typescript/css/easings/cubicBezier.d.ts +15 -0
  454. package/lib/typescript/css/easings/cubicBezier.d.ts.map +1 -0
  455. package/lib/typescript/css/easings/index.d.ts +10 -0
  456. package/lib/typescript/css/easings/index.d.ts.map +1 -0
  457. package/lib/typescript/css/easings/linear.d.ts +17 -0
  458. package/lib/typescript/css/easings/linear.d.ts.map +1 -0
  459. package/lib/typescript/css/easings/steps.d.ts +18 -0
  460. package/lib/typescript/css/easings/steps.d.ts.map +1 -0
  461. package/lib/typescript/css/easings/types.d.ts +26 -0
  462. package/lib/typescript/css/easings/types.d.ts.map +1 -0
  463. package/lib/typescript/css/errors.d.ts +9 -0
  464. package/lib/typescript/css/errors.d.ts.map +1 -0
  465. package/lib/typescript/css/index.d.ts +5 -0
  466. package/lib/typescript/css/index.d.ts.map +1 -0
  467. package/lib/typescript/css/managers/CSSAnimationsManager.d.ts +13 -0
  468. package/lib/typescript/css/managers/CSSAnimationsManager.d.ts.map +1 -0
  469. package/lib/typescript/css/managers/CSSAnimationsManager.web.d.ts +15 -0
  470. package/lib/typescript/css/managers/CSSAnimationsManager.web.d.ts.map +1 -0
  471. package/lib/typescript/css/managers/CSSManager.d.ts +12 -0
  472. package/lib/typescript/css/managers/CSSManager.d.ts.map +1 -0
  473. package/lib/typescript/css/managers/CSSManager.web.d.ts +12 -0
  474. package/lib/typescript/css/managers/CSSManager.web.d.ts.map +1 -0
  475. package/lib/typescript/css/managers/CSSTransitionManager.d.ts +12 -0
  476. package/lib/typescript/css/managers/CSSTransitionManager.d.ts.map +1 -0
  477. package/lib/typescript/css/managers/CSSTransitionManager.web.d.ts +11 -0
  478. package/lib/typescript/css/managers/CSSTransitionManager.web.d.ts.map +1 -0
  479. package/lib/typescript/css/managers/index.d.ts +2 -0
  480. package/lib/typescript/css/managers/index.d.ts.map +1 -0
  481. package/lib/typescript/css/models/CSSKeyframesRule.d.ts +9 -0
  482. package/lib/typescript/css/models/CSSKeyframesRule.d.ts.map +1 -0
  483. package/lib/typescript/css/models/CSSKeyframesRule.web.d.ts +8 -0
  484. package/lib/typescript/css/models/CSSKeyframesRule.web.d.ts.map +1 -0
  485. package/lib/typescript/css/models/CSSKeyframesRuleBase.d.ts +14 -0
  486. package/lib/typescript/css/models/CSSKeyframesRuleBase.d.ts.map +1 -0
  487. package/lib/typescript/css/models/index.d.ts +2 -0
  488. package/lib/typescript/css/models/index.d.ts.map +1 -0
  489. package/lib/typescript/css/platform/native/config.d.ts +5 -0
  490. package/lib/typescript/css/platform/native/config.d.ts.map +1 -0
  491. package/lib/typescript/css/platform/native/index.d.ts +5 -0
  492. package/lib/typescript/css/platform/native/index.d.ts.map +1 -0
  493. package/lib/typescript/css/platform/native/native.d.ts +14 -0
  494. package/lib/typescript/css/platform/native/native.d.ts.map +1 -0
  495. package/lib/typescript/css/platform/native/normalization/animation/constants.d.ts +5 -0
  496. package/lib/typescript/css/platform/native/normalization/animation/constants.d.ts.map +1 -0
  497. package/lib/typescript/css/platform/native/normalization/animation/index.d.ts +5 -0
  498. package/lib/typescript/css/platform/native/normalization/animation/index.d.ts.map +1 -0
  499. package/lib/typescript/css/platform/native/normalization/animation/keyframes.d.ts +8 -0
  500. package/lib/typescript/css/platform/native/normalization/animation/keyframes.d.ts.map +1 -0
  501. package/lib/typescript/css/platform/native/normalization/animation/properties.d.ts +3 -0
  502. package/lib/typescript/css/platform/native/normalization/animation/properties.d.ts.map +1 -0
  503. package/lib/typescript/css/platform/native/normalization/animation/settings.d.ts +16 -0
  504. package/lib/typescript/css/platform/native/normalization/animation/settings.d.ts.map +1 -0
  505. package/lib/typescript/css/platform/native/normalization/common/index.d.ts +2 -0
  506. package/lib/typescript/css/platform/native/normalization/common/index.d.ts.map +1 -0
  507. package/lib/typescript/css/platform/native/normalization/common/settings.d.ts +14 -0
  508. package/lib/typescript/css/platform/native/normalization/common/settings.d.ts.map +1 -0
  509. package/lib/typescript/css/platform/native/normalization/index.d.ts +4 -0
  510. package/lib/typescript/css/platform/native/normalization/index.d.ts.map +1 -0
  511. package/lib/typescript/css/platform/native/normalization/transition/config.d.ts +8 -0
  512. package/lib/typescript/css/platform/native/normalization/transition/config.d.ts.map +1 -0
  513. package/lib/typescript/css/platform/native/normalization/transition/constants.d.ts +3 -0
  514. package/lib/typescript/css/platform/native/normalization/transition/constants.d.ts.map +1 -0
  515. package/lib/typescript/css/platform/native/normalization/transition/index.d.ts +2 -0
  516. package/lib/typescript/css/platform/native/normalization/transition/index.d.ts.map +1 -0
  517. package/lib/typescript/css/platform/native/normalization/transition/settings.d.ts +6 -0
  518. package/lib/typescript/css/platform/native/normalization/transition/settings.d.ts.map +1 -0
  519. package/lib/typescript/css/platform/native/style/builderFactory.d.ts +4 -0
  520. package/lib/typescript/css/platform/native/style/builderFactory.d.ts.map +1 -0
  521. package/lib/typescript/css/platform/native/style/index.d.ts +4 -0
  522. package/lib/typescript/css/platform/native/style/index.d.ts.map +1 -0
  523. package/lib/typescript/css/platform/native/style/processors/colors.d.ts +8 -0
  524. package/lib/typescript/css/platform/native/style/processors/colors.d.ts.map +1 -0
  525. package/lib/typescript/css/platform/native/style/processors/font.d.ts +3 -0
  526. package/lib/typescript/css/platform/native/style/processors/font.d.ts.map +1 -0
  527. package/lib/typescript/css/platform/native/style/processors/index.d.ts +8 -0
  528. package/lib/typescript/css/platform/native/style/processors/index.d.ts.map +1 -0
  529. package/lib/typescript/css/platform/native/style/processors/insets.d.ts +8 -0
  530. package/lib/typescript/css/platform/native/style/processors/insets.d.ts.map +1 -0
  531. package/lib/typescript/css/platform/native/style/processors/others.d.ts +7 -0
  532. package/lib/typescript/css/platform/native/style/processors/others.d.ts.map +1 -0
  533. package/lib/typescript/css/platform/native/style/processors/shadows.d.ts +13 -0
  534. package/lib/typescript/css/platform/native/style/processors/shadows.d.ts.map +1 -0
  535. package/lib/typescript/css/platform/native/style/processors/transform.d.ts +7 -0
  536. package/lib/typescript/css/platform/native/style/processors/transform.d.ts.map +1 -0
  537. package/lib/typescript/css/platform/native/style/processors/transformOrigin.d.ts +9 -0
  538. package/lib/typescript/css/platform/native/style/processors/transformOrigin.d.ts.map +1 -0
  539. package/lib/typescript/css/platform/native/style/types.d.ts +16 -0
  540. package/lib/typescript/css/platform/native/style/types.d.ts.map +1 -0
  541. package/lib/typescript/css/platform/native/styleBuilder.d.ts +3 -0
  542. package/lib/typescript/css/platform/native/styleBuilder.d.ts.map +1 -0
  543. package/lib/typescript/css/platform/native/types/animation.d.ts +29 -0
  544. package/lib/typescript/css/platform/native/types/animation.d.ts.map +1 -0
  545. package/lib/typescript/css/platform/native/types/common.d.ts +7 -0
  546. package/lib/typescript/css/platform/native/types/common.d.ts.map +1 -0
  547. package/lib/typescript/css/platform/native/types/index.d.ts +4 -0
  548. package/lib/typescript/css/platform/native/types/index.d.ts.map +1 -0
  549. package/lib/typescript/css/platform/native/types/transition.d.ts +15 -0
  550. package/lib/typescript/css/platform/native/types/transition.d.ts.map +1 -0
  551. package/lib/typescript/css/platform/web/animationParser.d.ts +3 -0
  552. package/lib/typescript/css/platform/web/animationParser.d.ts.map +1 -0
  553. package/lib/typescript/css/platform/web/config.d.ts +4 -0
  554. package/lib/typescript/css/platform/web/config.d.ts.map +1 -0
  555. package/lib/typescript/css/platform/web/domUtils.d.ts +4 -0
  556. package/lib/typescript/css/platform/web/domUtils.d.ts.map +1 -0
  557. package/lib/typescript/css/platform/web/index.d.ts +4 -0
  558. package/lib/typescript/css/platform/web/index.d.ts.map +1 -0
  559. package/lib/typescript/css/platform/web/style/builderFactories.d.ts +5 -0
  560. package/lib/typescript/css/platform/web/style/builderFactories.d.ts.map +1 -0
  561. package/lib/typescript/css/platform/web/style/builders/index.d.ts +2 -0
  562. package/lib/typescript/css/platform/web/style/builders/index.d.ts.map +1 -0
  563. package/lib/typescript/css/platform/web/style/builders/shadows.d.ts +7 -0
  564. package/lib/typescript/css/platform/web/style/builders/shadows.d.ts.map +1 -0
  565. package/lib/typescript/css/platform/web/style/index.d.ts +5 -0
  566. package/lib/typescript/css/platform/web/style/index.d.ts.map +1 -0
  567. package/lib/typescript/css/platform/web/style/processors/colors.d.ts +4 -0
  568. package/lib/typescript/css/platform/web/style/processors/colors.d.ts.map +1 -0
  569. package/lib/typescript/css/platform/web/style/processors/filter.d.ts +4 -0
  570. package/lib/typescript/css/platform/web/style/processors/filter.d.ts.map +1 -0
  571. package/lib/typescript/css/platform/web/style/processors/font.d.ts +5 -0
  572. package/lib/typescript/css/platform/web/style/processors/font.d.ts.map +1 -0
  573. package/lib/typescript/css/platform/web/style/processors/index.d.ts +8 -0
  574. package/lib/typescript/css/platform/web/style/processors/index.d.ts.map +1 -0
  575. package/lib/typescript/css/platform/web/style/processors/margins.d.ts +5 -0
  576. package/lib/typescript/css/platform/web/style/processors/margins.d.ts.map +1 -0
  577. package/lib/typescript/css/platform/web/style/processors/paddings.d.ts +5 -0
  578. package/lib/typescript/css/platform/web/style/processors/paddings.d.ts.map +1 -0
  579. package/lib/typescript/css/platform/web/style/processors/shadows.d.ts +7 -0
  580. package/lib/typescript/css/platform/web/style/processors/shadows.d.ts.map +1 -0
  581. package/lib/typescript/css/platform/web/style/processors/transforms.d.ts +5 -0
  582. package/lib/typescript/css/platform/web/style/processors/transforms.d.ts.map +1 -0
  583. package/lib/typescript/css/platform/web/style/types.d.ts +35 -0
  584. package/lib/typescript/css/platform/web/style/types.d.ts.map +1 -0
  585. package/lib/typescript/css/platform/web/utils.d.ts +11 -0
  586. package/lib/typescript/css/platform/web/utils.d.ts.map +1 -0
  587. package/lib/typescript/css/stylesheet.d.ts +11 -0
  588. package/lib/typescript/css/stylesheet.d.ts.map +1 -0
  589. package/lib/typescript/css/types/animation.d.ts +47 -0
  590. package/lib/typescript/css/types/animation.d.ts.map +1 -0
  591. package/lib/typescript/css/types/common.d.ts +12 -0
  592. package/lib/typescript/css/types/common.d.ts.map +1 -0
  593. package/lib/typescript/css/types/config.d.ts +5 -0
  594. package/lib/typescript/css/types/config.d.ts.map +1 -0
  595. package/lib/typescript/css/types/helpers.d.ts +12 -0
  596. package/lib/typescript/css/types/helpers.d.ts.map +1 -0
  597. package/lib/typescript/css/types/index.d.ts +7 -0
  598. package/lib/typescript/css/types/index.d.ts.map +1 -0
  599. package/lib/typescript/css/types/props.d.ts +17 -0
  600. package/lib/typescript/css/types/props.d.ts.map +1 -0
  601. package/lib/typescript/css/types/transition.d.ts +26 -0
  602. package/lib/typescript/css/types/transition.d.ts.map +1 -0
  603. package/lib/typescript/css/utils/conversions.d.ts +3 -0
  604. package/lib/typescript/css/utils/conversions.d.ts.map +1 -0
  605. package/lib/typescript/css/utils/equality.d.ts +3 -0
  606. package/lib/typescript/css/utils/equality.d.ts.map +1 -0
  607. package/lib/typescript/css/utils/guards.d.ts +20 -0
  608. package/lib/typescript/css/utils/guards.d.ts.map +1 -0
  609. package/lib/typescript/css/utils/index.d.ts +6 -0
  610. package/lib/typescript/css/utils/index.d.ts.map +1 -0
  611. package/lib/typescript/css/utils/parsers.d.ts +3 -0
  612. package/lib/typescript/css/utils/parsers.d.ts.map +1 -0
  613. package/lib/typescript/css/utils/props.d.ts +7 -0
  614. package/lib/typescript/css/utils/props.d.ts.map +1 -0
  615. package/lib/typescript/fabricUtils.d.ts +2 -1
  616. package/lib/typescript/fabricUtils.d.ts.map +1 -1
  617. package/lib/typescript/index.d.ts +1 -0
  618. package/lib/typescript/index.d.ts.map +1 -1
  619. package/lib/typescript/initializers.d.ts +2 -1
  620. package/lib/typescript/initializers.d.ts.map +1 -1
  621. package/lib/typescript/layoutReanimation/web/componentUtils.d.ts.map +1 -1
  622. package/lib/typescript/platform-specific/findHostInstance.d.ts +15 -0
  623. package/lib/typescript/platform-specific/findHostInstance.d.ts.map +1 -0
  624. package/lib/typescript/platform-specific/findHostInstance.web.d.ts +2 -0
  625. package/lib/typescript/platform-specific/findHostInstance.web.d.ts.map +1 -0
  626. package/lib/typescript/platform-specific/jsVersion.d.ts +1 -1
  627. package/lib/typescript/platform-specific/jsVersion.d.ts.map +1 -1
  628. package/lib/typescript/propsAllowlists.d.ts.map +1 -1
  629. package/lib/typescript/shareables.d.ts +4 -1
  630. package/lib/typescript/shareables.d.ts.map +1 -1
  631. package/lib/typescript/worklets/WorkletsModule/JSWorklets.d.ts.map +1 -1
  632. package/lib/typescript/worklets/WorkletsModule/NativeWorklets.d.ts.map +1 -1
  633. package/lib/typescript/worklets/WorkletsModule/workletsModuleProxy.d.ts +7 -0
  634. package/lib/typescript/worklets/WorkletsModule/workletsModuleProxy.d.ts.map +1 -1
  635. package/package.json +19 -18
  636. package/src/{PropsRegistry.ts → AnimatedPropsRegistry.ts} +3 -1
  637. package/src/ReanimatedModule/NativeReanimated.ts +73 -37
  638. package/src/ReanimatedModule/js-reanimated/JSReanimated.ts +66 -39
  639. package/src/ReanimatedModule/reanimatedModuleProxy.ts +39 -22
  640. package/src/Sensor.ts +2 -1
  641. package/src/commonTypes.ts +26 -62
  642. package/src/core.ts +9 -4
  643. package/src/createAnimatedComponent/AnimatedComponent.tsx +510 -0
  644. package/src/createAnimatedComponent/JSPropsUpdater.ts +5 -6
  645. package/src/createAnimatedComponent/NativeEventsManager.ts +45 -19
  646. package/src/createAnimatedComponent/commonTypes.ts +17 -7
  647. package/src/createAnimatedComponent/createAnimatedComponent.tsx +14 -563
  648. package/src/createAnimatedComponent/setAndForwardRef.ts +1 -1
  649. package/src/createAnimatedComponent/utils.ts +25 -0
  650. package/src/css/component/AnimatedComponent.tsx +181 -0
  651. package/src/css/component/createAnimatedComponent.tsx +67 -0
  652. package/src/css/component/index.ts +2 -0
  653. package/src/css/constants/font.ts +15 -0
  654. package/src/css/constants/index.ts +4 -0
  655. package/src/css/constants/platform.ts +4 -0
  656. package/src/css/constants/regex.ts +4 -0
  657. package/src/css/easings/cubicBezier.ts +46 -0
  658. package/src/css/easings/index.ts +29 -0
  659. package/src/css/easings/linear.ts +151 -0
  660. package/src/css/easings/steps.ts +104 -0
  661. package/src/css/easings/types.ts +54 -0
  662. package/src/css/errors.ts +20 -0
  663. package/src/css/index.ts +24 -0
  664. package/src/css/managers/CSSAnimationsManager.ts +155 -0
  665. package/src/css/managers/CSSAnimationsManager.web.ts +203 -0
  666. package/src/css/managers/CSSManager.ts +65 -0
  667. package/src/css/managers/CSSManager.web.ts +52 -0
  668. package/src/css/managers/CSSTransitionManager.ts +67 -0
  669. package/src/css/managers/CSSTransitionManager.web.ts +83 -0
  670. package/src/css/managers/index.ts +2 -0
  671. package/src/css/models/CSSKeyframesRule.ts +20 -0
  672. package/src/css/models/CSSKeyframesRule.web.ts +23 -0
  673. package/src/css/models/CSSKeyframesRuleBase.ts +45 -0
  674. package/src/css/models/index.ts +2 -0
  675. package/src/css/platform/native/config.ts +237 -0
  676. package/src/css/platform/native/index.ts +5 -0
  677. package/src/css/platform/native/native.ts +61 -0
  678. package/src/css/platform/native/normalization/animation/constants.ts +25 -0
  679. package/src/css/platform/native/normalization/animation/index.ts +5 -0
  680. package/src/css/platform/native/normalization/animation/keyframes.ts +145 -0
  681. package/src/css/platform/native/normalization/animation/properties.ts +38 -0
  682. package/src/css/platform/native/normalization/animation/settings.ts +136 -0
  683. package/src/css/platform/native/normalization/common/index.ts +6 -0
  684. package/src/css/platform/native/normalization/common/settings.ts +86 -0
  685. package/src/css/platform/native/normalization/index.ts +4 -0
  686. package/src/css/platform/native/normalization/transition/config.ts +136 -0
  687. package/src/css/platform/native/normalization/transition/constants.ts +7 -0
  688. package/src/css/platform/native/normalization/transition/index.ts +5 -0
  689. package/src/css/platform/native/normalization/transition/settings.ts +20 -0
  690. package/src/css/platform/native/style/builderFactory.ts +81 -0
  691. package/src/css/platform/native/style/index.ts +4 -0
  692. package/src/css/platform/native/style/processors/colors.ts +36 -0
  693. package/src/css/platform/native/style/processors/font.ts +21 -0
  694. package/src/css/platform/native/style/processors/index.ts +8 -0
  695. package/src/css/platform/native/style/processors/insets.ts +25 -0
  696. package/src/css/platform/native/style/processors/others.ts +30 -0
  697. package/src/css/platform/native/style/processors/shadows.ts +74 -0
  698. package/src/css/platform/native/style/processors/transform.ts +182 -0
  699. package/src/css/platform/native/style/processors/transformOrigin.ts +117 -0
  700. package/src/css/platform/native/style/types.ts +33 -0
  701. package/src/css/platform/native/styleBuilder.ts +7 -0
  702. package/src/css/platform/native/types/animation.ts +50 -0
  703. package/src/css/platform/native/types/common.ts +8 -0
  704. package/src/css/platform/native/types/index.ts +4 -0
  705. package/src/css/platform/native/types/transition.ts +20 -0
  706. package/src/css/platform/web/animationParser.ts +46 -0
  707. package/src/css/platform/web/config.ts +233 -0
  708. package/src/css/platform/web/domUtils.ts +101 -0
  709. package/src/css/platform/web/index.ts +4 -0
  710. package/src/css/platform/web/style/builderFactories.ts +220 -0
  711. package/src/css/platform/web/style/builders/index.ts +2 -0
  712. package/src/css/platform/web/style/builders/shadows.ts +57 -0
  713. package/src/css/platform/web/style/index.ts +5 -0
  714. package/src/css/platform/web/style/processors/colors.ts +15 -0
  715. package/src/css/platform/web/style/processors/filter.ts +46 -0
  716. package/src/css/platform/web/style/processors/font.ts +17 -0
  717. package/src/css/platform/web/style/processors/index.ts +8 -0
  718. package/src/css/platform/web/style/processors/margins.ts +34 -0
  719. package/src/css/platform/web/style/processors/paddings.ts +34 -0
  720. package/src/css/platform/web/style/processors/shadows.ts +40 -0
  721. package/src/css/platform/web/style/processors/transforms.ts +59 -0
  722. package/src/css/platform/web/style/types.ts +77 -0
  723. package/src/css/platform/web/utils.ts +108 -0
  724. package/src/css/stylesheet.ts +37 -0
  725. package/src/css/types/animation.ts +74 -0
  726. package/src/css/types/common.ts +24 -0
  727. package/src/css/types/config.ts +6 -0
  728. package/src/css/types/helpers.ts +29 -0
  729. package/src/css/types/index.ts +7 -0
  730. package/src/css/types/props.ts +36 -0
  731. package/src/css/types/transition.ts +38 -0
  732. package/src/css/utils/conversions.ts +15 -0
  733. package/src/css/utils/equality.ts +67 -0
  734. package/src/css/utils/guards.ts +85 -0
  735. package/src/css/utils/index.ts +6 -0
  736. package/src/css/utils/parsers.ts +36 -0
  737. package/src/css/utils/props.ts +64 -0
  738. package/src/fabricUtils.ts +9 -15
  739. package/src/index.ts +1 -0
  740. package/src/initializers.ts +8 -1
  741. package/src/layoutReanimation/web/componentUtils.ts +1 -0
  742. package/src/logger/logger.ts +3 -3
  743. package/src/mock.ts +36 -2
  744. package/src/mutables.ts +2 -2
  745. package/src/platform-specific/findHostInstance.ts +88 -0
  746. package/src/platform-specific/findHostInstance.web.ts +3 -0
  747. package/src/platform-specific/jsVersion.ts +1 -1
  748. package/src/propsAllowlists.ts +6 -0
  749. package/src/runtimes.ts +3 -3
  750. package/src/shareables.ts +315 -164
  751. package/src/threads.ts +5 -5
  752. package/src/worklets/WorkletsModule/JSWorklets.ts +47 -2
  753. package/src/worklets/WorkletsModule/NativeWorklets.ts +38 -1
  754. package/src/worklets/WorkletsModule/workletsModuleProxy.ts +26 -1
  755. package/Common/cpp/reanimated/Fabric/PropsRegistry.cpp +0 -41
  756. package/Common/cpp/reanimated/Fabric/PropsRegistry.h +0 -59
  757. package/Common/cpp/reanimated/NativeModules/NativeReanimatedModuleSpec.cpp +0 -210
  758. package/Common/cpp/reanimated/RuntimeDecorators/ReanimatedWorkletRuntimeDecorator.cpp +0 -19
  759. package/Common/cpp/reanimated/RuntimeDecorators/ReanimatedWorkletRuntimeDecorator.h +0 -14
  760. package/Common/cpp/worklets/NativeModules/NativeWorkletsModule.cpp +0 -25
  761. package/Common/cpp/worklets/NativeModules/NativeWorkletsModule.h +0 -23
  762. package/Common/cpp/worklets/NativeModules/NativeWorkletsModuleSpec.cpp +0 -9
  763. package/Common/cpp/worklets/NativeModules/NativeWorkletsModuleSpec.h +0 -18
  764. package/android/src/reactNativeVersionPatch/NativeProxyFabric/74/com/swmansion/reanimated/NativeProxy.java +0 -149
  765. package/android/src/reactNativeVersionPatch/NativeProxyPaper/74/com/swmansion/reanimated/NativeProxy.java +0 -153
  766. package/apple/reanimated/apple/Fabric/REAInitializerRCTFabricSurface.h +0 -12
  767. package/apple/reanimated/apple/Fabric/REAInitializerRCTFabricSurface.mm +0 -73
  768. package/lib/module/PropsRegistry.js.map +0 -1
  769. package/lib/module/platform-specific/RNRenderer.js +0 -6
  770. package/lib/module/platform-specific/RNRenderer.js.map +0 -1
  771. package/lib/module/platform-specific/RNRenderer.web.js +0 -6
  772. package/lib/module/platform-specific/RNRenderer.web.js.map +0 -1
  773. package/lib/typescript/PropsRegistry.d.ts.map +0 -1
  774. package/lib/typescript/platform-specific/RNRenderer.d.ts +0 -2
  775. package/lib/typescript/platform-specific/RNRenderer.d.ts.map +0 -1
  776. package/lib/typescript/platform-specific/RNRenderer.web.d.ts +0 -3
  777. package/lib/typescript/platform-specific/RNRenderer.web.d.ts.map +0 -1
  778. package/src/platform-specific/RNRenderer.ts +0 -4
  779. package/src/platform-specific/RNRenderer.web.ts +0 -4
@@ -0,0 +1,58 @@
1
+ #ifdef RCT_NEW_ARCH_ENABLED
2
+ #include <reanimated/CSS/common/Quaternion.h>
3
+
4
+ namespace reanimated {
5
+
6
+ bool Quaternion::operator==(const Quaternion &other) const {
7
+ return x == other.x && y == other.y && z == other.z && w == other.w;
8
+ }
9
+
10
+ #ifndef NDEBUG
11
+
12
+ std::ostream &operator<<(std::ostream &os, const Quaternion &quaternion) {
13
+ os << "Quaternion(" << quaternion.x << ", " << quaternion.y << ", "
14
+ << quaternion.z << ", " << quaternion.w << ")";
15
+ return os;
16
+ }
17
+
18
+ #endif // NDEBUG
19
+
20
+ Quaternion Quaternion::interpolate(const double t, const Quaternion &other)
21
+ const {
22
+ const double kEpsilon = 1e-5;
23
+ Quaternion copy = *this;
24
+
25
+ double cosHalfAngle =
26
+ copy.x * other.x + copy.y * other.y + copy.z * other.z + copy.w * other.w;
27
+
28
+ if (cosHalfAngle < 0.0) {
29
+ copy.x = -copy.x;
30
+ copy.y = -copy.y;
31
+ copy.z = -copy.z;
32
+ copy.w = -copy.w;
33
+ cosHalfAngle = -cosHalfAngle;
34
+ }
35
+
36
+ if (cosHalfAngle > 1)
37
+ cosHalfAngle = 1;
38
+
39
+ double sinHalfAngle = std::sqrt(1.0 - cosHalfAngle * cosHalfAngle);
40
+ if (sinHalfAngle < kEpsilon) {
41
+ // Quaternions share common axis and angle.
42
+ return *this;
43
+ }
44
+
45
+ double halfAngle = std::acos(cosHalfAngle);
46
+ double scale = std::sin((1 - t) * halfAngle) / sinHalfAngle;
47
+ double invscale = std::sin(t * halfAngle) / sinHalfAngle;
48
+
49
+ return {
50
+ copy.x * scale + other.x * invscale,
51
+ copy.y * scale + other.y * invscale,
52
+ copy.z * scale + other.z * invscale,
53
+ copy.w * scale + other.w * invscale};
54
+ }
55
+
56
+ } // namespace reanimated
57
+
58
+ #endif // RCT_NEW_ARCH_ENABLED
@@ -0,0 +1,28 @@
1
+ #pragma once
2
+ #ifdef RCT_NEW_ARCH_ENABLED
3
+
4
+ #include <cmath>
5
+
6
+ #ifndef NDEBUG
7
+ #include <iostream>
8
+ #endif // NDEBUG
9
+
10
+ namespace reanimated {
11
+
12
+ struct Quaternion {
13
+ double x, y, z, w;
14
+
15
+ bool operator==(const Quaternion &other) const;
16
+
17
+ #ifndef NDEBUG
18
+ friend std::ostream &operator<<(
19
+ std::ostream &os,
20
+ const Quaternion &quaternion);
21
+ #endif // NDEBUG
22
+
23
+ Quaternion interpolate(double progress, const Quaternion &other) const;
24
+ };
25
+
26
+ } // namespace reanimated
27
+
28
+ #endif // RCT_NEW_ARCH_ENABLED
@@ -0,0 +1,634 @@
1
+ #ifdef RCT_NEW_ARCH_ENABLED
2
+ #include <reanimated/CSS/common/TransformMatrix.h>
3
+
4
+ namespace reanimated {
5
+
6
+ DecomposedTransformMatrix DecomposedTransformMatrix::interpolate(
7
+ const double progress,
8
+ const DecomposedTransformMatrix &other) const {
9
+ return {
10
+ .scale = scale.interpolate(progress, other.scale),
11
+ .skew = skew.interpolate(progress, other.skew),
12
+ .quaternion = quaternion.interpolate(progress, other.quaternion),
13
+ .translation = translation.interpolate(progress, other.translation),
14
+ .perspective = perspective.interpolate(progress, other.perspective)};
15
+ }
16
+
17
+ #ifndef NDEBUG
18
+
19
+ std::ostream &operator<<(
20
+ std::ostream &os,
21
+ const DecomposedTransformMatrix &decomposed) {
22
+ os << "DecomposedTransformMatrix(scale=" << decomposed.scale
23
+ << ", skew=" << decomposed.skew << ", quaternion=" << decomposed.quaternion
24
+ << ", translation=" << decomposed.translation
25
+ << ", perspective=" << decomposed.perspective << ")";
26
+ return os;
27
+ }
28
+
29
+ #endif // NDEBUG
30
+
31
+ TransformMatrix::TransformMatrix(const Vec16Array &matrix) {
32
+ for (size_t i = 0; i < 16; ++i) {
33
+ matrix_[i / 4][i % 4] = matrix[i];
34
+ }
35
+ }
36
+
37
+ TransformMatrix::TransformMatrix(const Matrix4x4 &matrix) : matrix_(matrix) {}
38
+
39
+ TransformMatrix::TransformMatrix(jsi::Runtime &rt, const jsi::Value &value) {
40
+ const auto array = value.asObject(rt).asArray(rt);
41
+ if (array.size(rt) != 16) {
42
+ throw std::invalid_argument(
43
+ "[Reanimated] Matrix array should have 16 elements");
44
+ }
45
+
46
+ for (size_t i = 0; i < 16; ++i) {
47
+ matrix_[i / 4][i % 4] = array.getValueAtIndex(rt, i).asNumber();
48
+ }
49
+ }
50
+
51
+ TransformMatrix TransformMatrix::Identity() {
52
+ return TransformMatrix({{// clang-format off
53
+ {1, 0, 0, 0},
54
+ {0, 1, 0, 0},
55
+ {0, 0, 1, 0},
56
+ {0, 0, 0, 1}
57
+ }}); // clang-format on
58
+ }
59
+
60
+ TransformMatrix TransformMatrix::Perspective(const double v) {
61
+ if (v == 0) {
62
+ // Ignore perspective if it is invalid
63
+ return TransformMatrix::Identity();
64
+ }
65
+ return TransformMatrix({{// clang-format off
66
+ {1, 0, 0, 0},
67
+ {0, 1, 0, 0},
68
+ {0, 0, 1, -1.0 / v},
69
+ {0, 0, 0, 1}
70
+ }}); // clang-format on
71
+ }
72
+
73
+ TransformMatrix TransformMatrix::RotateX(const double v) {
74
+ const auto cosVal = std::cos(v);
75
+ const auto sinVal = std::sin(v);
76
+ return TransformMatrix({{// clang-format off
77
+ {1, 0, 0, 0},
78
+ {0, cosVal, sinVal, 0},
79
+ {0, -sinVal, cosVal, 0},
80
+ {0, 0, 0, 1}
81
+ }}); // clang-format on
82
+ }
83
+
84
+ TransformMatrix TransformMatrix::RotateY(const double v) {
85
+ const auto cosVal = std::cos(v);
86
+ const auto sinVal = std::sin(v);
87
+ return TransformMatrix({{// clang-format off
88
+ {cosVal, 0, -sinVal, 0},
89
+ { 0, 1, 0, 0},
90
+ {sinVal, 0, cosVal, 0},
91
+ { 0, 0, 0, 1}
92
+ }}); // clang-format on
93
+ }
94
+
95
+ TransformMatrix TransformMatrix::RotateZ(const double v) {
96
+ const auto cosVal = std::cos(v);
97
+ const auto sinVal = std::sin(v);
98
+ return TransformMatrix({{// clang-format off
99
+ { cosVal, sinVal, 0, 0},
100
+ {-sinVal, cosVal, 0, 0},
101
+ { 0, 0, 1, 0},
102
+ { 0, 0, 0, 1}
103
+ }}); // clang-format on
104
+ }
105
+
106
+ TransformMatrix TransformMatrix::Scale(const double v) {
107
+ return TransformMatrix({{// clang-format off
108
+ {v, 0, 0, 0},
109
+ {0, v, 0, 0},
110
+ {0, 0, v, 0},
111
+ {0, 0, 0, 1}
112
+ }}); // clang-format on
113
+ }
114
+
115
+ TransformMatrix TransformMatrix::ScaleX(const double v) {
116
+ return TransformMatrix({{// clang-format off
117
+ {v, 0, 0, 0},
118
+ {0, 1, 0, 0},
119
+ {0, 0, 1, 0},
120
+ {0, 0, 0, 1}
121
+ }}); // clang-format on
122
+ }
123
+
124
+ TransformMatrix TransformMatrix::ScaleY(const double v) {
125
+ return TransformMatrix({{// clang-format off
126
+ {1, 0, 0, 0},
127
+ {0, v, 0, 0},
128
+ {0, 0, 1, 0},
129
+ {0, 0, 0, 1}
130
+ }}); // clang-format on
131
+ }
132
+
133
+ TransformMatrix TransformMatrix::TranslateX(const double v) {
134
+ return TransformMatrix({{// clang-format off
135
+ {1, 0, 0, 0},
136
+ {0, 1, 0, 0},
137
+ {0, 0, 1, 0},
138
+ {v, 0, 0, 1}
139
+ }}); // clang-format on
140
+ }
141
+
142
+ TransformMatrix TransformMatrix::TranslateY(const double v) {
143
+ return TransformMatrix({{// clang-format off
144
+ {1, 0, 0, 0},
145
+ {0, 1, 0, 0},
146
+ {0, 0, 1, 0},
147
+ {0, v, 0, 1}
148
+ }}); // clang-format on
149
+ }
150
+
151
+ TransformMatrix TransformMatrix::SkewX(const double v) {
152
+ const auto tan = std::tan(v);
153
+ return TransformMatrix({{// clang-format off
154
+ { 1, 0, 0, 0},
155
+ {tan, 1, 0, 0},
156
+ { 0, 0, 1, 0},
157
+ { 0, 0, 0, 1}
158
+ }}); // clang-format on
159
+ }
160
+
161
+ TransformMatrix TransformMatrix::SkewY(const double v) {
162
+ const auto tan = std::tan(v);
163
+ return TransformMatrix({{// clang-format off
164
+ {1, tan, 0, 0},
165
+ {0, 1, 0, 0},
166
+ {0, 0, 1, 0},
167
+ {0, 0, 0, 1}
168
+ }}); // clang-format on
169
+ }
170
+
171
+ std::array<double, 4> &TransformMatrix::operator[](const size_t rowIdx) {
172
+ return matrix_[rowIdx];
173
+ }
174
+
175
+ const std::array<double, 4> &TransformMatrix::operator[](
176
+ const size_t rowIdx) const {
177
+ return matrix_[rowIdx];
178
+ }
179
+
180
+ bool TransformMatrix::operator==(const TransformMatrix &other) const {
181
+ for (size_t i = 0; i < 4; ++i) {
182
+ for (size_t j = 0; j < 4; ++j) {
183
+ if (matrix_[i][j] != other.matrix_[i][j]) {
184
+ return false;
185
+ }
186
+ }
187
+ }
188
+ return true;
189
+ }
190
+
191
+ TransformMatrix TransformMatrix::operator*(const TransformMatrix &rhs) const {
192
+ const auto &a = matrix_;
193
+ const auto &b = rhs.matrix_;
194
+ Matrix4x4 result{};
195
+
196
+ for (size_t i = 0; i < 4; ++i) {
197
+ for (size_t j = 0; j < 4; ++j) {
198
+ result[i][j] = 0;
199
+ for (size_t k = 0; k < 4; ++k) {
200
+ result[i][j] += a[i][k] * b[k][j];
201
+ }
202
+ }
203
+ }
204
+
205
+ return TransformMatrix(result);
206
+ }
207
+
208
+ TransformMatrix TransformMatrix::operator*=(const TransformMatrix &rhs) {
209
+ *this = *this * rhs;
210
+ return *this;
211
+ }
212
+
213
+ Vector4D operator*(const Vector4D &v, const TransformMatrix &m) {
214
+ Vector4D result;
215
+
216
+ for (size_t i = 0; i < 4; ++i) {
217
+ result[i] = 0;
218
+ for (size_t j = 0; j < 4; ++j) {
219
+ result[i] += v[j] * m[j][i];
220
+ }
221
+ }
222
+
223
+ return result;
224
+ }
225
+
226
+ #ifndef NDEBUG
227
+
228
+ std::ostream &operator<<(std::ostream &os, const TransformMatrix &matrix) {
229
+ std::string result = "TransformMatrix{";
230
+ for (size_t i = 0; i < 16; ++i) {
231
+ result += std::to_string(matrix[i / 4][i % 4]);
232
+ if (i < 15) {
233
+ result += ", ";
234
+ }
235
+ }
236
+ result += "}";
237
+ return os << result;
238
+ }
239
+
240
+ #endif // NDEBUG
241
+
242
+ std::string TransformMatrix::toString() const {
243
+ std::string result = "[";
244
+ for (size_t i = 0; i < 16; ++i) {
245
+ result += std::to_string(matrix_[i / 4][i % 4]);
246
+ if (i < 15) {
247
+ result += ", ";
248
+ }
249
+ }
250
+ result += "]";
251
+ return result;
252
+ }
253
+
254
+ jsi::Value TransformMatrix::toJSIValue(jsi::Runtime &rt) const {
255
+ jsi::Array result(rt, 16);
256
+ for (size_t i = 0; i < 16; ++i) {
257
+ result.setValueAtIndex(rt, i, matrix_[i / 4][i % 4]);
258
+ }
259
+ return result;
260
+ }
261
+
262
+ folly::dynamic TransformMatrix::toDynamic() const {
263
+ folly::dynamic result = folly::dynamic::array;
264
+ for (size_t i = 0; i < 16; ++i) {
265
+ result.push_back(matrix_[i / 4][i % 4]);
266
+ }
267
+ return result;
268
+ }
269
+
270
+ bool TransformMatrix::isSingular() const {
271
+ return determinant() == 0;
272
+ }
273
+
274
+ bool TransformMatrix::normalize() {
275
+ if (matrix_[3][3] == 0) {
276
+ return false;
277
+ }
278
+
279
+ for (size_t i = 0; i < 4; ++i) {
280
+ for (size_t j = 0; j < 4; ++j) {
281
+ matrix_[i][j] /= matrix_[3][3];
282
+ }
283
+ }
284
+
285
+ return true;
286
+ }
287
+
288
+ double TransformMatrix::determinant() const {
289
+ const double a1 = matrix_[0][0];
290
+ const double b1 = matrix_[0][1];
291
+ const double c1 = matrix_[0][2];
292
+ const double d1 = matrix_[0][3];
293
+
294
+ const double a2 = matrix_[1][0];
295
+ const double b2 = matrix_[1][1];
296
+ const double c2 = matrix_[1][2];
297
+ const double d2 = matrix_[1][3];
298
+
299
+ const double a3 = matrix_[2][0];
300
+ const double b3 = matrix_[2][1];
301
+ const double c3 = matrix_[2][2];
302
+ const double d3 = matrix_[2][3];
303
+
304
+ const double a4 = matrix_[3][0];
305
+ const double b4 = matrix_[3][1];
306
+ const double c4 = matrix_[3][2];
307
+ const double d4 = matrix_[3][3];
308
+
309
+ return a1 * determinant3x3(b2, b3, b4, c2, c3, c4, d2, d3, d4) -
310
+ b1 * determinant3x3(a2, a3, a4, c2, c3, c4, d2, d3, d4) +
311
+ c1 * determinant3x3(a2, a3, a4, b2, b3, b4, d2, d3, d4) -
312
+ d1 * determinant3x3(a2, a3, a4, b2, b3, b4, c2, c3, c4);
313
+ }
314
+
315
+ void TransformMatrix::adjugate() {
316
+ const double a1 = matrix_[0][0];
317
+ const double b1 = matrix_[0][1];
318
+ const double c1 = matrix_[0][2];
319
+ const double d1 = matrix_[0][3];
320
+
321
+ const double a2 = matrix_[1][0];
322
+ const double b2 = matrix_[1][1];
323
+ const double c2 = matrix_[1][2];
324
+ const double d2 = matrix_[1][3];
325
+
326
+ const double a3 = matrix_[2][0];
327
+ const double b3 = matrix_[2][1];
328
+ const double c3 = matrix_[2][2];
329
+ const double d3 = matrix_[2][3];
330
+
331
+ const double a4 = matrix_[3][0];
332
+ const double b4 = matrix_[3][1];
333
+ const double c4 = matrix_[3][2];
334
+ const double d4 = matrix_[3][3];
335
+
336
+ matrix_[0][0] = determinant3x3(b2, b3, b4, c2, c3, c4, d2, d3, d4);
337
+ matrix_[1][0] = -determinant3x3(a2, a3, a4, c2, c3, c4, d2, d3, d4);
338
+ matrix_[2][0] = determinant3x3(a2, a3, a4, b2, b3, b4, d2, d3, d4);
339
+ matrix_[3][0] = -determinant3x3(a2, a3, a4, b2, b3, b4, c2, c3, c4);
340
+
341
+ matrix_[0][1] = -determinant3x3(b1, b3, b4, c1, c3, c4, d1, d3, d4);
342
+ matrix_[1][1] = determinant3x3(a1, a3, a4, c1, c3, c4, d1, d3, d4);
343
+ matrix_[2][1] = -determinant3x3(a1, a3, a4, b1, b3, b4, d1, d3, d4);
344
+ matrix_[3][1] = determinant3x3(a1, a3, a4, b1, b3, b4, c1, c3, c4);
345
+
346
+ matrix_[0][2] = determinant3x3(b1, b2, b4, c1, c2, c4, d1, d2, d4);
347
+ matrix_[1][2] = -determinant3x3(a1, a2, a4, c1, c2, c4, d1, d2, d4);
348
+ matrix_[2][2] = determinant3x3(a1, a2, a4, b1, b2, b4, d1, d2, d4);
349
+ matrix_[3][2] = -determinant3x3(a1, a2, a4, b1, b2, b4, c1, c2, c4);
350
+
351
+ matrix_[0][3] = -determinant3x3(b1, b2, b3, c1, c2, c3, d1, d2, d3);
352
+ matrix_[1][3] = determinant3x3(a1, a2, a3, c1, c2, c3, d1, d2, d3);
353
+ matrix_[2][3] = -determinant3x3(a1, a2, a3, b1, b2, b3, d1, d2, d3);
354
+ matrix_[3][3] = determinant3x3(a1, a2, a3, b1, b2, b3, c1, c2, c3);
355
+ }
356
+
357
+ bool TransformMatrix::invert() {
358
+ const auto det = determinant();
359
+
360
+ // If the determinant is invalid (zero, very small number, etc.), then the
361
+ // matrix is not invertible
362
+ if (!std::isnormal(det)) {
363
+ return false;
364
+ }
365
+
366
+ adjugate();
367
+ for (size_t i = 0; i < 4; ++i) {
368
+ for (size_t j = 0; j < 4; ++j) {
369
+ matrix_[i][j] /= det;
370
+ }
371
+ }
372
+
373
+ return true;
374
+ }
375
+
376
+ void TransformMatrix::transpose() {
377
+ for (size_t i = 0; i < 4; ++i) {
378
+ for (size_t j = i + 1; j < 4; ++j) {
379
+ std::swap(matrix_[i][j], matrix_[j][i]);
380
+ }
381
+ }
382
+ }
383
+
384
+ void TransformMatrix::translate3d(const Vector3D &translation) {
385
+ for (size_t i = 0; i < 4; ++i) {
386
+ matrix_[3][i] += translation[0] * matrix_[0][i] +
387
+ translation[1] * matrix_[1][i] + translation[2] * matrix_[2][i];
388
+ }
389
+ }
390
+
391
+ void TransformMatrix::scale3d(const Vector3D &scale) {
392
+ for (size_t i = 0; i < 4; ++i) {
393
+ matrix_[0][i] *= scale[0];
394
+ matrix_[1][i] *= scale[1];
395
+ matrix_[2][i] *= scale[2];
396
+ }
397
+ }
398
+
399
+ std::optional<DecomposedTransformMatrix> TransformMatrix::decompose() const {
400
+ auto matrixCp = *this;
401
+
402
+ if (!matrixCp.normalize()) {
403
+ return std::nullopt;
404
+ }
405
+ const auto perspective = matrixCp.computePerspective();
406
+ if (!perspective) {
407
+ return std::nullopt;
408
+ }
409
+ const auto translation = matrixCp.getTranslation();
410
+
411
+ // Move the remaining matrix to 3 separate column vectors for easier
412
+ // processing
413
+ std::array<Vector3D, 3> rows;
414
+ for (size_t i = 0; i < 3; ++i) {
415
+ rows[i] = Vector3D(matrixCp[i][0], matrixCp[i][1], matrixCp[i][2]);
416
+ }
417
+
418
+ auto [scale, skew] = computeScaleAndSkew(rows);
419
+
420
+ // At this point, the matrix (in rows) is orthonormal.
421
+ // Check for a coordinate system flip. If the determinant
422
+ // is -1, then negate the matrix and the scaling factors.
423
+ if (rows[0].dot(rows[1].cross(rows[2])) < 0) {
424
+ for (size_t i = 0; i < 3; ++i) {
425
+ scale[i] *= -1;
426
+ rows[i] *= -1;
427
+ }
428
+ }
429
+ const auto rotation = computeQuaternion(rows);
430
+
431
+ return DecomposedTransformMatrix{
432
+ .scale = scale,
433
+ .skew = skew,
434
+ .quaternion = rotation,
435
+ .translation = translation,
436
+ .perspective = perspective.value()};
437
+ }
438
+
439
+ TransformMatrix TransformMatrix::recompose(
440
+ const DecomposedTransformMatrix &decomposed) {
441
+ auto result = TransformMatrix::Identity();
442
+
443
+ // Start from applying perspective
444
+ for (size_t i = 0; i < 4; ++i) {
445
+ result[i][3] = decomposed.perspective[i];
446
+ }
447
+
448
+ // Apply translation
449
+ result.translate3d(decomposed.translation);
450
+
451
+ // Apply rotation
452
+ result = fromQuaternion(decomposed.quaternion) * result;
453
+
454
+ // Apply skew
455
+ auto tmp = TransformMatrix::Identity();
456
+ if (decomposed.skew[2] != 0) { // YZ
457
+ tmp[2][1] = decomposed.skew[2];
458
+ result = tmp * result;
459
+ }
460
+ if (decomposed.skew[1] != 0) { // XZ
461
+ tmp[2][1] = 0;
462
+ tmp[2][0] = decomposed.skew[1];
463
+ result = tmp * result;
464
+ }
465
+ if (decomposed.skew[0] != 0) { // XY
466
+ tmp[2][0] = 0;
467
+ tmp[1][0] = decomposed.skew[0];
468
+ result = tmp * result;
469
+ }
470
+
471
+ // Apply scale
472
+ result.scale3d(decomposed.scale);
473
+
474
+ return result;
475
+ }
476
+
477
+ TransformMatrix TransformMatrix::fromQuaternion(const Quaternion &q) {
478
+ const double xx = q.x * q.x;
479
+ const double yy = q.y * q.y;
480
+ const double zz = q.z * q.z;
481
+ const double xz = q.x * q.z;
482
+ const double xy = q.x * q.y;
483
+ const double yz = q.y * q.z;
484
+ const double xw = q.w * q.x;
485
+ const double yw = q.w * q.y;
486
+ const double zw = q.w * q.z;
487
+
488
+ // clang-format off
489
+ return TransformMatrix({{
490
+ {1 - 2 * (yy + zz), 2 * (xy - zw), 2 * (xz + yw), 0},
491
+ { 2 * (xy + zw), 1 - 2 * (xx + zz), 2 * (yz - xw), 0},
492
+ { 2 * (xz - yw), 2 * (yz + xw), 1 - 2 * (xx + yy), 0},
493
+ { 0, 0, 0, 1}
494
+ }}); // clang-format on
495
+ }
496
+
497
+ std::optional<Vector4D> TransformMatrix::computePerspective() const {
498
+ auto perspectiveMatrix = *this;
499
+
500
+ for (size_t i = 0; i < 3; ++i) {
501
+ perspectiveMatrix[i][3] = 0;
502
+ }
503
+ perspectiveMatrix[3][3] = 1;
504
+
505
+ if (perspectiveMatrix.isSingular()) {
506
+ return std::nullopt;
507
+ }
508
+
509
+ if (matrix_[0][3] == 0 && matrix_[1][3] == 0 && matrix_[2][3] == 0) {
510
+ // No perspective
511
+ return Vector4D{0, 0, 0, 1};
512
+ }
513
+
514
+ // Invert and transpose the perspective matrix (we will solve the equation
515
+ // by multiplying the rhs vector by the inverse of the perspective matrix)
516
+ if (!perspectiveMatrix.invert()) {
517
+ return std::nullopt;
518
+ }
519
+ perspectiveMatrix.transpose();
520
+
521
+ // rhs is the right hand side of the equation we are trying to solve
522
+ const Vector4D rhs(
523
+ matrix_[0][3], matrix_[1][3], matrix_[2][3], matrix_[3][3]);
524
+ // Solve the equation
525
+ return rhs * perspectiveMatrix;
526
+ }
527
+
528
+ Vector3D TransformMatrix::getTranslation() const {
529
+ return Vector3D(matrix_[3][0], matrix_[3][1], matrix_[3][2]);
530
+ }
531
+
532
+ std::pair<Vector3D, Vector3D> TransformMatrix::computeScaleAndSkew(
533
+ std::array<Vector3D, 3> &rows) {
534
+ Vector3D scale, skew;
535
+
536
+ // Compute X scale factor and normalize first row
537
+ scale[0] = rows[0].length();
538
+ rows[0].normalize();
539
+
540
+ // Compute XY shear factor and make 2nd row orthogonal to 1st.
541
+ skew[0] = rows[0].dot(rows[1]);
542
+ rows[1] = rows[1].addScaled(rows[0], -skew[0]);
543
+
544
+ // Now, compute Y scale and normalize 2nd row.
545
+ scale[1] = rows[1].length();
546
+ rows[1].normalize();
547
+ skew[0] /= scale[1]; // normalize XY shear
548
+
549
+ // Compute XZ and YZ shears, orthogonalize 3rd row
550
+ skew[1] = rows[0].dot(rows[2]);
551
+ rows[2] = rows[2].addScaled(rows[0], -skew[1]);
552
+ skew[2] = rows[1].dot(rows[2]);
553
+ rows[2] = rows[2].addScaled(rows[1], -skew[2]);
554
+
555
+ // Next, get Z scale and normalize 3rd row
556
+ scale[2] = rows[2].length();
557
+ rows[2].normalize();
558
+ skew[1] /= scale[2]; // normalize XZ shear
559
+ skew[2] /= scale[2]; // normalize YZ shear
560
+
561
+ return {scale, skew};
562
+ }
563
+
564
+ Quaternion TransformMatrix::computeQuaternion(std::array<Vector3D, 3> &rows) {
565
+ double m00 = rows[0][0];
566
+ double m01 = rows[0][1];
567
+ double m02 = rows[0][2];
568
+
569
+ double m10 = rows[1][0];
570
+ double m11 = rows[1][1];
571
+ double m12 = rows[1][2];
572
+
573
+ double m20 = rows[2][0];
574
+ double m21 = rows[2][1];
575
+ double m22 = rows[2][2];
576
+
577
+ Quaternion q;
578
+ double trace = m00 + m11 + m22; // Trace of the matrix
579
+
580
+ if (trace > 0.0) {
581
+ double s = 0.5 / sqrt(trace + 1.0);
582
+ q.w = 0.25 / s;
583
+ q.x = (m21 - m12) * s;
584
+ q.y = (m02 - m20) * s;
585
+ q.z = (m10 - m01) * s;
586
+ } else {
587
+ if (m00 > m11 && m00 > m22) {
588
+ double s = 2.0 * sqrt(1.0 + m00 - m11 - m22);
589
+ q.w = (m21 - m12) / s;
590
+ q.x = 0.25 * s;
591
+ q.y = (m01 + m10) / s;
592
+ q.z = (m02 + m20) / s;
593
+ } else if (m11 > m22) {
594
+ double s = 2.0 * sqrt(1.0 + m11 - m00 - m22);
595
+ q.w = (m02 - m20) / s;
596
+ q.x = (m01 + m10) / s;
597
+ q.y = 0.25 * s;
598
+ q.z = (m12 + m21) / s;
599
+ } else {
600
+ double s = 2.0 * sqrt(1.0 + m22 - m00 - m11);
601
+ q.w = (m10 - m01) / s;
602
+ q.x = (m02 + m20) / s;
603
+ q.y = (m12 + m21) / s;
604
+ q.z = 0.25 * s;
605
+ }
606
+ }
607
+
608
+ return q;
609
+ }
610
+
611
+ /**
612
+ * Calculate the determinant of a 3x3 matrix
613
+ *
614
+ * | a b c |
615
+ * | d e f |
616
+ * | g h i |
617
+ */
618
+ double TransformMatrix::determinant3x3(
619
+ const double a,
620
+ const double b,
621
+ const double c,
622
+ const double d,
623
+ const double e,
624
+ const double f,
625
+ const double g,
626
+ const double h,
627
+ const double i) {
628
+ return (a * e * i) + (b * f * g) + (c * d * h) - (c * e * g) - (b * d * i) -
629
+ (a * f * h);
630
+ }
631
+
632
+ } // namespace reanimated
633
+
634
+ #endif // RCT_NEW_ARCH_ENABLED