@react-native-ohos/react-native-reanimated 3.18.2-rc.2 → 4.0.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/compatibility.json +161 -0
- package/harmony/reanimated/BuildProfile.ets +16 -16
- package/harmony/reanimated/build-profile.json5 +18 -11
- package/harmony/reanimated/oh-package.json5 +12 -11
- package/harmony/reanimated/src/main/cpp/CMakeLists.txt +31 -40
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/AnimatedSensor/AnimatedSensorModule.cpp +81 -86
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/AnimatedSensor/AnimatedSensorModule.h +46 -47
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/InterpolatorRegistry.cpp +390 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/InterpolatorRegistry.h +16 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/definitions.h +30 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/filters/FilterOp.cpp +46 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/filters/FilterOp.h +23 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/transforms/Quaternion.cpp +53 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/transforms/Quaternion.h +21 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/transforms/TransformMatrix.cpp +166 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/transforms/TransformMatrix.h +71 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/transforms/TransformMatrix2D.cpp +368 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/transforms/TransformMatrix2D.h +53 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/transforms/TransformMatrix3D.cpp +594 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/transforms/TransformMatrix3D.h +67 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/transforms/TransformOp.cpp +52 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/transforms/TransformOp.h +26 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/transforms/vectors.cpp +156 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/transforms/vectors.h +76 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSAngle.cpp +93 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSAngle.h +33 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSBoolean.cpp +48 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSBoolean.h +31 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSColor.cpp +135 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSColor.h +61 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSDiscreteArray.cpp +100 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSDiscreteArray.h +44 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSKeyword.cpp +81 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSKeyword.h +53 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSLength.cpp +122 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSLength.h +38 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSNumber.cpp +82 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSNumber.h +63 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSValue.h +118 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSValueVariant.cpp +174 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSValueVariant.h +111 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/complex/CSSBoxShadow.cpp +196 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/complex/CSSBoxShadow.h +66 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/complex/CSSDropShadow.cpp +134 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/complex/CSSDropShadow.h +44 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/configs/CSSAnimationConfig.cpp +174 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/configs/CSSAnimationConfig.h +49 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/configs/CSSKeyframesConfig.cpp +45 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/configs/CSSKeyframesConfig.h +26 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/configs/CSSTransitionConfig.cpp +90 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/configs/CSSTransitionConfig.h +43 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/configs/common.cpp +17 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/configs/common.h +13 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/core/CSSAnimation.cpp +127 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/core/CSSAnimation.h +51 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/core/CSSTransition.cpp +145 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/core/CSSTransition.h +47 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/easing/EasingFunctions.cpp +69 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/easing/EasingFunctions.h +22 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/easing/cubicBezier.cpp +66 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/easing/cubicBezier.h +15 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/easing/linear.cpp +28 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/easing/linear.h +15 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/easing/steps.cpp +13 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/easing/steps.h +12 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/InterpolatorFactory.cpp +157 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/InterpolatorFactory.h +189 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/PropertyInterpolator.cpp +76 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/PropertyInterpolator.h +66 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/configs.h +20 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/FilterOperation.cpp +136 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/FilterOperation.h +40 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/FilterOperationInterpolator.cpp +38 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/FilterOperationInterpolator.h +24 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/FilterStyleInterpolator.cpp +58 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/FilterStyleInterpolator.h +24 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/operations/blur.h +14 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/operations/brightness.h +14 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/operations/contrast.h +14 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/operations/dropShadow.h +17 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/operations/grayscale.h +14 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/operations/hueRotate.h +14 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/operations/invert.h +14 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/operations/opacity.h +14 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/operations/saturate.h +14 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/operations/sepia.h +14 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/groups/ArrayPropertiesInterpolator.cpp +95 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/groups/ArrayPropertiesInterpolator.h +36 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/groups/GroupPropertiesInterpolator.cpp +41 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/groups/GroupPropertiesInterpolator.h +32 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/groups/RecordPropertiesInterpolator.cpp +99 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/groups/RecordPropertiesInterpolator.h +37 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/operations/OperationsStyleInterpolator.cpp +308 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/operations/OperationsStyleInterpolator.h +100 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/operations/StyleOperation.cpp +19 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/operations/StyleOperation.h +94 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/operations/StyleOperationInterpolator.cpp +18 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/operations/StyleOperationInterpolator.h +43 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/styles/AnimationStyleInterpolator.h +26 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/styles/TransitionStyleInterpolator.cpp +103 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/styles/TransitionStyleInterpolator.h +42 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/TransformOperation.cpp +224 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/TransformOperation.h +52 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/TransformOperationInterpolator.cpp +218 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/TransformOperationInterpolator.h +89 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/TransformsStyleInterpolator.cpp +149 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/TransformsStyleInterpolator.h +33 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/operations/matrix.cpp +208 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/operations/matrix.h +56 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/operations/perspective.cpp +42 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/operations/perspective.h +20 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/operations/rotate.cpp +41 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/operations/rotate.h +39 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/operations/scale.cpp +28 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/operations/scale.h +25 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/operations/skew.cpp +14 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/operations/skew.h +20 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/operations/translate.cpp +39 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/operations/translate.h +25 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/values/ResolvableValueInterpolator.cpp +47 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/values/ResolvableValueInterpolator.h +43 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/values/SimpleValueInterpolator.cpp +70 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/values/SimpleValueInterpolator.h +40 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/values/ValueInterpolator.cpp +146 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/values/ValueInterpolator.h +71 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/misc/ViewStylesRepository.cpp +155 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/misc/ViewStylesRepository.h +53 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/progress/AnimationProgressProvider.cpp +170 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/progress/AnimationProgressProvider.h +67 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/progress/KeyframeProgressProvider.h +12 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/progress/RawProgressProvider.cpp +41 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/progress/RawProgressProvider.h +31 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/progress/TransitionProgressProvider.cpp +193 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/progress/TransitionProgressProvider.h +77 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/registries/CSSAnimationsRegistry.cpp +340 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/registries/CSSAnimationsRegistry.h +80 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/registries/CSSKeyframesRegistry.cpp +45 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/registries/CSSKeyframesRegistry.h +29 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/registries/CSSTransitionsRegistry.cpp +167 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/registries/CSSTransitionsRegistry.h +51 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/registries/StaticPropsRegistry.cpp +61 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/registries/StaticPropsRegistry.h +33 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/svg/values/SVGBrush.cpp +80 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/svg/values/SVGBrush.h +39 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/svg/values/SVGLength.cpp +93 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/svg/values/SVGLength.h +36 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/svg/values/SVGStrokeDashArray.cpp +110 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/svg/values/SVGStrokeDashArray.h +33 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/utils/DelayedItemsManager.cpp +75 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/utils/DelayedItemsManager.h +45 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/utils/algorithms.cpp +12 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/utils/algorithms.h +10 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/utils/interpolators.cpp +36 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/utils/interpolators.h +23 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/utils/props.cpp +149 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/utils/props.h +32 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/ReanimatedCommitHook.cpp +113 -101
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/ReanimatedCommitHook.h +49 -51
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/ReanimatedCommitShadowNode.h +46 -49
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/ReanimatedMountHook.cpp +56 -96
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/ReanimatedMountHook.h +37 -33
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/ShadowTreeCloner.cpp +104 -95
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/ShadowTreeCloner.h +22 -29
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/updates/AnimatedPropsRegistry.cpp +72 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/updates/AnimatedPropsRegistry.h +25 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/updates/UpdatesRegistry.cpp +160 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/updates/UpdatesRegistry.h +71 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/updates/UpdatesRegistryManager.cpp +161 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/updates/UpdatesRegistryManager.h +65 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationType.h +11 -9
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsManager.cpp +137 -232
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsManager.h +82 -90
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxyCommon.cpp +79 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxyCommon.h +81 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxy_Experimental.cpp +864 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxy_Experimental.h +214 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/{LayoutAnimationsProxy.cpp → LayoutAnimationsProxy_Legacy.cpp} +897 -870
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxy_Legacy.h +220 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsUtils.cpp +31 -91
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsUtils.h +146 -176
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/PropsDiffer.cpp +456 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/PropsDiffer.h +102 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/SharedTransitions.cpp +544 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/NativeModules/PropValueProcessor.cpp +119 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/NativeModules/PropValueProcessor.h +39 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/NativeModules/ReanimatedModuleProxy.cpp +1376 -971
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/NativeModules/ReanimatedModuleProxy.h +228 -252
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/NativeModules/ReanimatedModuleProxySpec.cpp +183 -231
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/NativeModules/ReanimatedModuleProxySpec.h +93 -109
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/RuntimeDecorators/RNRuntimeDecorator.cpp +54 -56
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/RuntimeDecorators/RNRuntimeDecorator.h +28 -20
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/RuntimeDecorators/UIRuntimeDecorator.cpp +58 -70
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/RuntimeDecorators/UIRuntimeDecorator.h +31 -35
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Tools/FeatureFlags.cpp +18 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Tools/FeatureFlags.h +44 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Tools/PlatformDepMethodsHolder.h +67 -98
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Tools/ReanimatedSystraceSection.h +114 -135
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Tools/ReanimatedVersion.cpp +46 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/{worklets → reanimated}/Tools/ReanimatedVersion.h +18 -19
- package/harmony/reanimated/src/main/cpp/ReanimatedModule.cpp +60 -85
- package/harmony/reanimated/src/main/cpp/ReanimatedNodesManager.cpp +1 -0
- package/harmony/reanimated/src/main/cpp/ReanimatedPackage.cpp +0 -3
- package/harmony/reanimated/src/main/cpp/ReanimatedSensor.cpp +266 -0
- package/harmony/reanimated/src/main/cpp/ReanimatedSensor.h +36 -0
- package/harmony/reanimated/src/main/cpp/ReanimatedSensorContainer.cpp +36 -0
- package/harmony/reanimated/src/main/cpp/ReanimatedSensorContainer.h +23 -0
- package/harmony/reanimated/src/main/cpp/ReanimatedUIScheduler.h +3 -3
- package/harmony/reanimated/src/main/ets/ReanimatedModule.ts +5 -1
- package/harmony/reanimated/src/main/ets/ReanimatedPackage.ts +1 -4
- package/harmony/reanimated/src/main/module.json5 +12 -12
- package/harmony/reanimated/src/main/resources/base/element/color.json +7 -7
- package/harmony/reanimated/src/main/resources/base/element/string.json +15 -15
- package/harmony/reanimated/src/main/resources/base/profile/main_pages.json +5 -5
- package/harmony/reanimated/src/main/resources/en_US/element/string.json +15 -15
- package/harmony/reanimated/src/main/resources/zh_CN/element/string.json +15 -15
- package/harmony/reanimated/ts.ts +6 -6
- package/harmony/reanimated.har +0 -0
- package/package.json +68 -50
- package/scripts/deploy.js +191 -0
- package/scripts/set-reanimated-version.js +37 -0
- package/scripts/update-version.js +119 -0
- package/scripts/validate-react-native-version.js +46 -0
- package/scripts/validate-worklets-build.js +17 -0
- package/scripts/validate-worklets-version.js +79 -0
- package/scripts/worklets-version.json +4 -0
- package/LICENSE +0 -21
- package/README.OpenSource +0 -11
- package/README.md +0 -10
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/PropsRegistry.cpp +0 -68
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/PropsRegistry.h +0 -68
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxy.h +0 -147
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Tools/CollectionUtils.h +0 -14
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Tools/FeaturesConfig.cpp +0 -5
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Tools/FeaturesConfig.h +0 -19
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/NativeModules/WorkletsModuleProxy.cpp +0 -47
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/NativeModules/WorkletsModuleProxy.h +0 -59
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/NativeModules/WorkletsModuleProxySpec.cpp +0 -27
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/NativeModules/WorkletsModuleProxySpec.h +0 -25
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Registries/EventHandlerRegistry.cpp +0 -94
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Registries/EventHandlerRegistry.h +0 -49
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Registries/WorkletRuntimeRegistry.cpp +0 -8
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Registries/WorkletRuntimeRegistry.h +0 -39
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/SharedItems/Shareables.cpp +0 -326
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/SharedItems/Shareables.h +0 -345
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/AsyncQueue.cpp +0 -52
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/AsyncQueue.h +0 -35
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/Defs.h +0 -10
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/JSISerializer.cpp +0 -342
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/JSISerializer.h +0 -47
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/JSLogger.cpp +0 -16
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/JSLogger.h +0 -20
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/JSScheduler.cpp +0 -20
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/JSScheduler.h +0 -29
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/PlatformLogger.h +0 -16
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/ReanimatedJSIUtils.cpp +0 -26
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/ReanimatedJSIUtils.h +0 -199
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/ReanimatedVersion.cpp +0 -95
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/SingleInstanceChecker.h +0 -72
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/ThreadSafeQueue.h +0 -49
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/UIScheduler.cpp +0 -20
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/UIScheduler.h +0 -22
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/WorkletEventHandler.cpp +0 -29
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/WorkletEventHandler.h +0 -41
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/RNRuntimeWorkletDecorator.cpp +0 -16
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/RNRuntimeWorkletDecorator.h +0 -19
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/ReanimatedHermesRuntime.cpp +0 -112
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/ReanimatedHermesRuntime.h +0 -127
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/ReanimatedRuntime.cpp +0 -53
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/ReanimatedRuntime.h +0 -22
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/RuntimeInitialization.md +0 -191
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/WorkletRuntime.cpp +0 -173
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/WorkletRuntime.h +0 -90
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/WorkletRuntimeCollector.h +0 -36
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/WorkletRuntimeDecorator.cpp +0 -189
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/WorkletRuntimeDecorator.h +0 -22
- package/harmony/reanimated/src/main/cpp/ReanimatedLogger.cpp +0 -33
- package/harmony/reanimated/src/main/cpp/WorkletsModule.cpp +0 -61
- package/harmony/reanimated/src/main/cpp/WorkletsModule.h +0 -22
- package/harmony/reanimated/src/main/cpp/patches/AnimatedSensor/AnimatedSensorModule.cpp +0 -89
- package/harmony/reanimated/src/main/cpp/patches/Fabric/ShadowTreeCloner.cpp +0 -95
- package/harmony/reanimated/src/main/cpp/patches/NativeModules/ReanimatedModuleProxy.cpp +0 -964
- package/harmony/reanimated/src/main/ets/WorkletsModule.ts +0 -15
package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/transforms/TransformOp.h
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
|
|
3
|
+
#include <string>
|
|
4
|
+
|
|
5
|
+
namespace reanimated::css {
|
|
6
|
+
|
|
7
|
+
enum class TransformOp : uint8_t {
|
|
8
|
+
Perspective,
|
|
9
|
+
Rotate,
|
|
10
|
+
RotateX,
|
|
11
|
+
RotateY,
|
|
12
|
+
RotateZ,
|
|
13
|
+
Scale,
|
|
14
|
+
ScaleX,
|
|
15
|
+
ScaleY,
|
|
16
|
+
TranslateX,
|
|
17
|
+
TranslateY,
|
|
18
|
+
SkewX,
|
|
19
|
+
SkewY,
|
|
20
|
+
Matrix,
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
TransformOp getTransformOperationType(const std::string &property);
|
|
24
|
+
std::string getTransformOperationName(const TransformOp type);
|
|
25
|
+
|
|
26
|
+
} // namespace reanimated::css
|
package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/transforms/vectors.cpp
ADDED
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
#include <reanimated/CSS/common/transforms/vectors.h>
|
|
2
|
+
|
|
3
|
+
namespace reanimated::css {
|
|
4
|
+
|
|
5
|
+
// Vector2D
|
|
6
|
+
|
|
7
|
+
double &Vector2D::operator[](const size_t idx) {
|
|
8
|
+
return vec[idx];
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const double &Vector2D::operator[](const size_t idx) const {
|
|
12
|
+
return vec[idx];
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
Vector2D &Vector2D::operator*=(const double scalar) {
|
|
16
|
+
vec[0] *= scalar;
|
|
17
|
+
vec[1] *= scalar;
|
|
18
|
+
return *this;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
#ifndef NDEBUG
|
|
22
|
+
|
|
23
|
+
std::ostream &operator<<(std::ostream &os, const Vector2D &vector) {
|
|
24
|
+
os << "Vector2D(" << vector.vec[0] << ", " << vector.vec[1] << ")";
|
|
25
|
+
return os;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
#endif // NDEBUG
|
|
29
|
+
|
|
30
|
+
double Vector2D::length() const {
|
|
31
|
+
return std::hypot(vec[0], vec[1]);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
void Vector2D::scaleToLength(double targetLength) {
|
|
35
|
+
double currentLength = length();
|
|
36
|
+
if (currentLength != 0) {
|
|
37
|
+
double factor = targetLength / currentLength;
|
|
38
|
+
vec[0] *= factor;
|
|
39
|
+
vec[1] *= factor;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
void Vector2D::normalize() {
|
|
44
|
+
scaleToLength(1);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
double Vector2D::dot(const Vector2D &other) const {
|
|
48
|
+
return vec[0] * other.vec[0] + vec[1] * other.vec[1];
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
double Vector2D::cross(const Vector2D &other) const {
|
|
52
|
+
return vec[0] * other.vec[1] - vec[1] * other.vec[0];
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
Vector2D Vector2D::addScaled(const Vector2D &other, const double scale) const {
|
|
56
|
+
return Vector2D{vec[0] + scale * other.vec[0], vec[1] + scale * other.vec[1]};
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
Vector2D Vector2D::interpolate(const double progress, const Vector2D &other) const {
|
|
60
|
+
return Vector2D{vec[0] + progress * (other.vec[0] - vec[0]), vec[1] + progress * (other.vec[1] - vec[1])};
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// Vector3D
|
|
64
|
+
|
|
65
|
+
double &Vector3D::operator[](const size_t idx) {
|
|
66
|
+
return vec[idx];
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const double &Vector3D::operator[](const size_t idx) const {
|
|
70
|
+
return vec[idx];
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
Vector3D &Vector3D::operator*=(const double scalar) {
|
|
74
|
+
vec[0] *= scalar;
|
|
75
|
+
vec[1] *= scalar;
|
|
76
|
+
vec[2] *= scalar;
|
|
77
|
+
return *this;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
#ifndef NDEBUG
|
|
81
|
+
|
|
82
|
+
std::ostream &operator<<(std::ostream &os, const Vector3D &vector) {
|
|
83
|
+
os << "Vector3D(" << vector.vec[0] << ", " << vector.vec[1] << ", " << vector.vec[2] << ")";
|
|
84
|
+
return os;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
#endif // NDEBUG
|
|
88
|
+
|
|
89
|
+
double Vector3D::length() const {
|
|
90
|
+
return std::hypot(vec[0], vec[1], vec[2]);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
void Vector3D::scaleToLength(double targetLength) {
|
|
94
|
+
double currentLength = length();
|
|
95
|
+
if (currentLength != 0) {
|
|
96
|
+
double factor = targetLength / currentLength;
|
|
97
|
+
vec[0] *= factor;
|
|
98
|
+
vec[1] *= factor;
|
|
99
|
+
vec[2] *= factor;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
void Vector3D::normalize() {
|
|
104
|
+
scaleToLength(1);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
double Vector3D::dot(const Vector3D &other) const {
|
|
108
|
+
return vec[0] * other.vec[0] + vec[1] * other.vec[1] + vec[2] * other.vec[2];
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
Vector3D Vector3D::cross(const Vector3D &other) const {
|
|
112
|
+
return Vector3D{
|
|
113
|
+
vec[1] * other.vec[2] - vec[2] * other.vec[1],
|
|
114
|
+
vec[2] * other.vec[0] - vec[0] * other.vec[2],
|
|
115
|
+
vec[0] * other.vec[1] - vec[1] * other.vec[0]};
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
Vector3D Vector3D::addScaled(const Vector3D &other, const double scale) const {
|
|
119
|
+
return Vector3D{vec[0] + scale * other.vec[0], vec[1] + scale * other.vec[1], vec[2] + scale * other.vec[2]};
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
Vector3D Vector3D::interpolate(const double progress, const Vector3D &other) const {
|
|
123
|
+
return Vector3D{
|
|
124
|
+
vec[0] + progress * (other.vec[0] - vec[0]),
|
|
125
|
+
vec[1] + progress * (other.vec[1] - vec[1]),
|
|
126
|
+
vec[2] + progress * (other.vec[2] - vec[2])};
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// Vector4D
|
|
130
|
+
|
|
131
|
+
double &Vector4D::operator[](const size_t idx) {
|
|
132
|
+
return vec[idx];
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
const double &Vector4D::operator[](const size_t idx) const {
|
|
136
|
+
return vec[idx];
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
Vector4D Vector4D::interpolate(const double progress, const Vector4D &other) const {
|
|
140
|
+
return Vector4D{
|
|
141
|
+
vec[0] + progress * (other.vec[0] - vec[0]),
|
|
142
|
+
vec[1] + progress * (other.vec[1] - vec[1]),
|
|
143
|
+
vec[2] + progress * (other.vec[2] - vec[2]),
|
|
144
|
+
vec[3] + progress * (other.vec[3] - vec[3])};
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
#ifndef NDEBUG
|
|
148
|
+
|
|
149
|
+
std::ostream &operator<<(std::ostream &os, const Vector4D &vector) {
|
|
150
|
+
os << "Vector4D(" << vector.vec[0] << ", " << vector.vec[1] << ", " << vector.vec[2] << ", " << vector.vec[3] << ")";
|
|
151
|
+
return os;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
#endif // NDEBUG
|
|
155
|
+
|
|
156
|
+
} // namespace reanimated::css
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
|
|
3
|
+
#include <array>
|
|
4
|
+
|
|
5
|
+
#ifndef NDEBUG
|
|
6
|
+
#include <iostream>
|
|
7
|
+
#endif // NDEBUG
|
|
8
|
+
|
|
9
|
+
namespace reanimated::css {
|
|
10
|
+
|
|
11
|
+
struct Vector2D {
|
|
12
|
+
std::array<double, 2> vec;
|
|
13
|
+
|
|
14
|
+
Vector2D() : vec({0, 0}) {}
|
|
15
|
+
explicit Vector2D(double x, double y) : vec({x, y}) {}
|
|
16
|
+
explicit Vector2D(std::array<double, 2> vec) : vec(vec) {}
|
|
17
|
+
|
|
18
|
+
double &operator[](size_t idx);
|
|
19
|
+
const double &operator[](size_t idx) const;
|
|
20
|
+
Vector2D &operator*=(double scalar);
|
|
21
|
+
|
|
22
|
+
#ifndef NDEBUG
|
|
23
|
+
friend std::ostream &operator<<(std::ostream &os, const Vector2D &vector);
|
|
24
|
+
#endif // NDEBUG
|
|
25
|
+
|
|
26
|
+
double length() const;
|
|
27
|
+
void scaleToLength(double targetLength);
|
|
28
|
+
void normalize();
|
|
29
|
+
double dot(const Vector2D &other) const;
|
|
30
|
+
double cross(const Vector2D &other) const;
|
|
31
|
+
Vector2D addScaled(const Vector2D &other, double scale) const;
|
|
32
|
+
Vector2D interpolate(double progress, const Vector2D &other) const;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
struct Vector3D {
|
|
36
|
+
std::array<double, 3> vec;
|
|
37
|
+
|
|
38
|
+
Vector3D() : vec({0, 0, 0}) {}
|
|
39
|
+
explicit Vector3D(double x, double y, double z) : vec({x, y, z}) {}
|
|
40
|
+
explicit Vector3D(std::array<double, 3> vec) : vec(vec) {}
|
|
41
|
+
|
|
42
|
+
double &operator[](size_t idx);
|
|
43
|
+
const double &operator[](size_t idx) const;
|
|
44
|
+
Vector3D &operator*=(double scalar);
|
|
45
|
+
|
|
46
|
+
#ifndef NDEBUG
|
|
47
|
+
friend std::ostream &operator<<(std::ostream &os, const Vector3D &vector);
|
|
48
|
+
#endif // NDEBUG
|
|
49
|
+
|
|
50
|
+
double length() const;
|
|
51
|
+
void scaleToLength(double targetLength);
|
|
52
|
+
void normalize();
|
|
53
|
+
double dot(const Vector3D &other) const;
|
|
54
|
+
Vector3D cross(const Vector3D &other) const;
|
|
55
|
+
Vector3D addScaled(const Vector3D &other, double scale) const;
|
|
56
|
+
Vector3D interpolate(double progress, const Vector3D &other) const;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
struct Vector4D {
|
|
60
|
+
std::array<double, 4> vec;
|
|
61
|
+
|
|
62
|
+
Vector4D() : vec({0, 0, 0, 0}) {}
|
|
63
|
+
explicit Vector4D(double x, double y, double z, double w) : vec({x, y, z, w}) {}
|
|
64
|
+
explicit Vector4D(std::array<double, 4> vec) : vec(vec) {}
|
|
65
|
+
|
|
66
|
+
double &operator[](size_t idx);
|
|
67
|
+
const double &operator[](size_t idx) const;
|
|
68
|
+
|
|
69
|
+
#ifndef NDEBUG
|
|
70
|
+
friend std::ostream &operator<<(std::ostream &os, const Vector4D &vector);
|
|
71
|
+
#endif // NDEBUG
|
|
72
|
+
|
|
73
|
+
Vector4D interpolate(double progress, const Vector4D &other) const;
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
} // namespace reanimated::css
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
#include <reanimated/CSS/common/values/CSSAngle.h>
|
|
2
|
+
|
|
3
|
+
#include <iomanip>
|
|
4
|
+
#include <regex>
|
|
5
|
+
#include <string>
|
|
6
|
+
#include <unordered_map>
|
|
7
|
+
|
|
8
|
+
namespace reanimated::css {
|
|
9
|
+
|
|
10
|
+
CSSAngle::CSSAngle() : value(0) {}
|
|
11
|
+
|
|
12
|
+
CSSAngle::CSSAngle(const double value) : value(value) {}
|
|
13
|
+
|
|
14
|
+
CSSAngle::CSSAngle(const std::string &rotationString) {
|
|
15
|
+
static const std::regex validNumberRegex(R"(^[-+]?\d*\.?\d+$)");
|
|
16
|
+
static const std::unordered_map<std::string, double> unitFactors = {
|
|
17
|
+
{"rad", 1},
|
|
18
|
+
{"deg", M_PI / 180},
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
// Find position of the first non-numeric character (first character
|
|
22
|
+
// of the unit, e.g. "deg" or "rad")
|
|
23
|
+
size_t pos = rotationString.find_first_not_of("0123456789.-+");
|
|
24
|
+
|
|
25
|
+
if (pos == std::string::npos) {
|
|
26
|
+
throw std::invalid_argument("[Reanimated] CSSAngle: Invalid angle value: " + rotationString);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
std::string numericPart = rotationString.substr(0, pos);
|
|
30
|
+
std::string unitPart = rotationString.substr(pos);
|
|
31
|
+
|
|
32
|
+
if (!std::regex_match(numericPart, validNumberRegex)) {
|
|
33
|
+
throw std::invalid_argument("[Reanimated] CSSAngle: Invalid angle value: " + rotationString);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// Lookup the unit and convert to radians
|
|
37
|
+
auto it = unitFactors.find(unitPart);
|
|
38
|
+
if (it == unitFactors.cend()) {
|
|
39
|
+
throw std::invalid_argument("[Reanimated] CSSAngle: Invalid angle unit: " + unitPart);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
double numericValue = std::stod(numericPart);
|
|
43
|
+
|
|
44
|
+
this->value = numericValue * it->second;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
CSSAngle::CSSAngle(const char *cstr) : CSSAngle(std::string_view{cstr}) {}
|
|
48
|
+
|
|
49
|
+
CSSAngle::CSSAngle(jsi::Runtime &rt, const jsi::Value &jsiValue) {
|
|
50
|
+
*this = CSSAngle(jsiValue.asString(rt).utf8(rt));
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
CSSAngle::CSSAngle(const folly::dynamic &value) {
|
|
54
|
+
*this = CSSAngle(value.asString().c_str());
|
|
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() || jsiValue.isNumber();
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
bool CSSAngle::canConstruct(const folly::dynamic &value) {
|
|
63
|
+
return value.isString() || value.isNumber();
|
|
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::css
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
|
|
3
|
+
#include <reanimated/CSS/common/values/CSSValue.h>
|
|
4
|
+
|
|
5
|
+
#include <string>
|
|
6
|
+
|
|
7
|
+
namespace reanimated::css {
|
|
8
|
+
|
|
9
|
+
struct CSSAngle : public CSSSimpleValue<CSSAngle> {
|
|
10
|
+
double value;
|
|
11
|
+
|
|
12
|
+
CSSAngle();
|
|
13
|
+
explicit CSSAngle(double value);
|
|
14
|
+
explicit CSSAngle(const std::string &rotationString);
|
|
15
|
+
explicit CSSAngle(const char *cstr);
|
|
16
|
+
explicit CSSAngle(jsi::Runtime &rt, const jsi::Value &jsiValue);
|
|
17
|
+
explicit CSSAngle(const folly::dynamic &value);
|
|
18
|
+
|
|
19
|
+
static bool canConstruct(jsi::Runtime &rt, const jsi::Value &jsiValue);
|
|
20
|
+
static bool canConstruct(const folly::dynamic &value);
|
|
21
|
+
|
|
22
|
+
folly::dynamic toDynamic() const override;
|
|
23
|
+
std::string toString() const override;
|
|
24
|
+
CSSAngle interpolate(double progress, const CSSAngle &to) const override;
|
|
25
|
+
|
|
26
|
+
bool operator==(const CSSAngle &other) const;
|
|
27
|
+
|
|
28
|
+
#ifndef NDEBUG
|
|
29
|
+
friend std::ostream &operator<<(std::ostream &os, const CSSAngle &angleValue);
|
|
30
|
+
#endif // NDEBUG
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
} // namespace reanimated::css
|
package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSBoolean.cpp
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
#include <reanimated/CSS/common/values/CSSBoolean.h>
|
|
2
|
+
|
|
3
|
+
#include <string>
|
|
4
|
+
|
|
5
|
+
namespace reanimated::css {
|
|
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) : value(jsiValue.asBool()) {}
|
|
12
|
+
|
|
13
|
+
CSSBoolean::CSSBoolean(const folly::dynamic &value) : value(value.asBool()) {}
|
|
14
|
+
|
|
15
|
+
bool CSSBoolean::canConstruct(jsi::Runtime &rt, const jsi::Value &jsiValue) {
|
|
16
|
+
return jsiValue.isBool();
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
bool CSSBoolean::canConstruct(const folly::dynamic &value) {
|
|
20
|
+
return value.isBool();
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
folly::dynamic CSSBoolean::toDynamic() const {
|
|
24
|
+
return {value};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
std::string CSSBoolean::toString() const {
|
|
28
|
+
return value ? "true" : "false";
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
CSSBoolean CSSBoolean::interpolate(double progress, const CSSBoolean &to) 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::css
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
|
|
3
|
+
#include <reanimated/CSS/common/values/CSSValue.h>
|
|
4
|
+
|
|
5
|
+
#include <string>
|
|
6
|
+
|
|
7
|
+
namespace reanimated::css {
|
|
8
|
+
|
|
9
|
+
struct CSSBoolean : public CSSSimpleValue<CSSBoolean> {
|
|
10
|
+
bool value;
|
|
11
|
+
|
|
12
|
+
CSSBoolean();
|
|
13
|
+
explicit CSSBoolean(bool value);
|
|
14
|
+
explicit CSSBoolean(jsi::Runtime &rt, const jsi::Value &jsiValue);
|
|
15
|
+
explicit CSSBoolean(const folly::dynamic &value);
|
|
16
|
+
|
|
17
|
+
static bool canConstruct(jsi::Runtime &rt, const jsi::Value &jsiValue);
|
|
18
|
+
static bool canConstruct(const folly::dynamic &value);
|
|
19
|
+
|
|
20
|
+
folly::dynamic toDynamic() const override;
|
|
21
|
+
std::string toString() const override;
|
|
22
|
+
CSSBoolean interpolate(double progress, const CSSBoolean &to) const override;
|
|
23
|
+
|
|
24
|
+
bool operator==(const CSSBoolean &other) const;
|
|
25
|
+
|
|
26
|
+
#ifndef NDEBUG
|
|
27
|
+
friend std::ostream &operator<<(std::ostream &os, const CSSBoolean &boolValue);
|
|
28
|
+
#endif // NDEBUG
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
} // namespace reanimated::css
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
#include <reanimated/CSS/common/values/CSSColor.h>
|
|
2
|
+
#include <reanimated/CSS/svg/values/SVGBrush.h>
|
|
3
|
+
|
|
4
|
+
#include <utility>
|
|
5
|
+
|
|
6
|
+
#include <string>
|
|
7
|
+
|
|
8
|
+
namespace reanimated::css {
|
|
9
|
+
|
|
10
|
+
// CSSColorBase template implementations
|
|
11
|
+
|
|
12
|
+
template <ColorTypeEnum TColorType, typename TDerived>
|
|
13
|
+
CSSColorBase<TColorType, TDerived>::CSSColorBase() : channels{0, 0, 0, 0}, colorType(TColorType::Transparent) {}
|
|
14
|
+
|
|
15
|
+
template <ColorTypeEnum TColorType, typename TDerived>
|
|
16
|
+
CSSColorBase<TColorType, TDerived>::CSSColorBase(TColorType colorType) : channels{0, 0, 0, 0}, colorType(colorType) {}
|
|
17
|
+
|
|
18
|
+
template <ColorTypeEnum TColorType, typename TDerived>
|
|
19
|
+
CSSColorBase<TColorType, TDerived>::CSSColorBase(int64_t numberValue)
|
|
20
|
+
: channels{0, 0, 0, 0}, colorType(TColorType::Rgba) {
|
|
21
|
+
uint32_t color;
|
|
22
|
+
// On Android, colors are represented as signed 32-bit integers. In JS, we use
|
|
23
|
+
// a bitwise operation (normalizedColor = normalizedColor | 0x0) to ensure the
|
|
24
|
+
// value is treated as a signed int, causing numbers above 2^31 to become
|
|
25
|
+
// negative. To correctly interpret these in C++, we cast negative values to
|
|
26
|
+
// int32_t to preserve their bit pattern, then assign to uint32_t. This wraps
|
|
27
|
+
// the bits (modulo 2^32), effectively reversing the JS-side bit shift.
|
|
28
|
+
if (numberValue < 0) {
|
|
29
|
+
color = static_cast<int32_t>(numberValue);
|
|
30
|
+
} else {
|
|
31
|
+
color = static_cast<uint32_t>(numberValue);
|
|
32
|
+
}
|
|
33
|
+
channels[0] = (color >> 16) & 0xFF; // Red
|
|
34
|
+
channels[1] = (color >> 8) & 0xFF; // Green
|
|
35
|
+
channels[2] = color & 0xFF; // Blue
|
|
36
|
+
channels[3] = (color >> 24) & 0xFF; // Alpha
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
template <ColorTypeEnum TColorType, typename TDerived>
|
|
40
|
+
CSSColorBase<TColorType, TDerived>::CSSColorBase(bool value)
|
|
41
|
+
: channels{0, 0, 0, 0}, colorType(TColorType::Transparent) {}
|
|
42
|
+
|
|
43
|
+
template <ColorTypeEnum TColorType, typename TDerived>
|
|
44
|
+
CSSColorBase<TColorType, TDerived>::CSSColorBase(const uint8_t r, const uint8_t g, const uint8_t b, const uint8_t a)
|
|
45
|
+
: channels{r, g, b, a}, colorType(TColorType::Rgba) {}
|
|
46
|
+
|
|
47
|
+
template <ColorTypeEnum TColorType, typename TDerived>
|
|
48
|
+
CSSColorBase<TColorType, TDerived>::CSSColorBase(ColorChannels colorChannels)
|
|
49
|
+
: channels{colorChannels}, colorType(TColorType::Rgba) {}
|
|
50
|
+
|
|
51
|
+
template <ColorTypeEnum TColorType, typename TDerived>
|
|
52
|
+
TDerived CSSColorBase<TColorType, TDerived>::interpolate(double progress, const TDerived &to) const {
|
|
53
|
+
ColorChannels fromChannels = channels;
|
|
54
|
+
ColorChannels toChannels = to.channels;
|
|
55
|
+
|
|
56
|
+
if (colorType == TColorType::Transparent) {
|
|
57
|
+
fromChannels = {toChannels[0], toChannels[1], toChannels[2], 0};
|
|
58
|
+
} else if (to.colorType == TColorType::Transparent) {
|
|
59
|
+
toChannels = {fromChannels[0], fromChannels[1], fromChannels[2], 0};
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
ColorChannels resultChannels;
|
|
63
|
+
for (size_t i = 0; i < 4; ++i) {
|
|
64
|
+
const auto &fromValue = fromChannels[i];
|
|
65
|
+
const auto &toValue = toChannels[i];
|
|
66
|
+
// Cast one of operands to double to avoid unsigned int subtraction overflow
|
|
67
|
+
// (when from > to)
|
|
68
|
+
const double interpolated = (static_cast<double>(toValue) - fromValue) * progress + fromValue;
|
|
69
|
+
resultChannels[i] = static_cast<uint8_t>(std::round(std::clamp(interpolated, 0.0, 255.0)));
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
return TDerived(resultChannels);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
template <ColorTypeEnum TColorType, typename TDerived>
|
|
76
|
+
bool CSSColorBase<TColorType, TDerived>::operator==(const TDerived &other) const {
|
|
77
|
+
return colorType == other.colorType && channels == other.channels;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// CSSColor implementations
|
|
81
|
+
|
|
82
|
+
CSSColor::CSSColor(jsi::Runtime &rt, const jsi::Value &jsiValue)
|
|
83
|
+
: CSSColorBase<CSSColorType, CSSColor>(CSSColorType::Transparent) {
|
|
84
|
+
if (jsiValue.isBool()) {
|
|
85
|
+
*this = CSSColor(jsiValue.getBool());
|
|
86
|
+
} else if (jsiValue.isNumber()) {
|
|
87
|
+
*this = CSSColor(static_cast<int64_t>(jsiValue.getNumber()));
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
CSSColor::CSSColor(const folly::dynamic &value) : CSSColorBase<CSSColorType, CSSColor>(CSSColorType::Transparent) {
|
|
92
|
+
if (value.isBool()) {
|
|
93
|
+
*this = CSSColor(value.getBool());
|
|
94
|
+
} else if (value.isNumber()) {
|
|
95
|
+
*this = CSSColor(value.asInt());
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
bool CSSColor::canConstruct(jsi::Runtime &rt, const jsi::Value &jsiValue) {
|
|
100
|
+
return jsiValue.isNumber() || jsiValue.isBool();
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
bool CSSColor::canConstruct(const folly::dynamic &value) {
|
|
104
|
+
return value.isNumber() || value.isBool();
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
folly::dynamic CSSColor::toDynamic() const {
|
|
108
|
+
if (colorType == CSSColorType::Rgba) {
|
|
109
|
+
return (channels[3] << 24) | (channels[0] << 16) | (channels[1] << 8) | channels[2];
|
|
110
|
+
}
|
|
111
|
+
return 0;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
std::string CSSColor::toString() const {
|
|
115
|
+
if (colorType == CSSColorType::Rgba) {
|
|
116
|
+
return "rgba(" + std::to_string(channels[0]) + "," + std::to_string(channels[1]) + "," +
|
|
117
|
+
std::to_string(channels[2]) + "," + std::to_string(channels[3]) + ")";
|
|
118
|
+
}
|
|
119
|
+
return "transparent";
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
#ifndef NDEBUG
|
|
123
|
+
|
|
124
|
+
std::ostream &operator<<(std::ostream &os, const CSSColor &colorValue) {
|
|
125
|
+
os << "CSSColor(" << colorValue.toString() << ")";
|
|
126
|
+
return os;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
#endif // NDEBUG
|
|
130
|
+
|
|
131
|
+
// Explicit template instantiation
|
|
132
|
+
template struct CSSColorBase<CSSColorType, CSSColor>;
|
|
133
|
+
template struct CSSColorBase<SVGBrushType, SVGBrush>;
|
|
134
|
+
|
|
135
|
+
} // namespace reanimated::css
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
|
|
3
|
+
#include <reanimated/CSS/common/definitions.h>
|
|
4
|
+
#include <reanimated/CSS/common/values/CSSValue.h>
|
|
5
|
+
|
|
6
|
+
#include <string>
|
|
7
|
+
|
|
8
|
+
namespace reanimated::css {
|
|
9
|
+
|
|
10
|
+
// Base class with common color value functionality
|
|
11
|
+
|
|
12
|
+
template <typename T>
|
|
13
|
+
concept ColorTypeEnum = std::is_enum_v<T> && requires {
|
|
14
|
+
T::Rgba;
|
|
15
|
+
T::Transparent;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
template <ColorTypeEnum TColorType, typename TDerived>
|
|
19
|
+
struct CSSColorBase : public CSSSimpleValue<TDerived> {
|
|
20
|
+
ColorChannels channels;
|
|
21
|
+
TColorType colorType;
|
|
22
|
+
|
|
23
|
+
CSSColorBase();
|
|
24
|
+
explicit CSSColorBase(TColorType colorType);
|
|
25
|
+
explicit CSSColorBase(int64_t numberValue);
|
|
26
|
+
explicit CSSColorBase(bool value);
|
|
27
|
+
|
|
28
|
+
explicit CSSColorBase(uint8_t r, uint8_t g, uint8_t b, uint8_t a);
|
|
29
|
+
explicit CSSColorBase(ColorChannels colorChannels);
|
|
30
|
+
|
|
31
|
+
TDerived interpolate(double progress, const TDerived &to) const override;
|
|
32
|
+
|
|
33
|
+
bool operator==(const TDerived &other) const;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
// Enum class for color type
|
|
37
|
+
|
|
38
|
+
enum class CSSColorType : std::uint8_t {
|
|
39
|
+
Rgba,
|
|
40
|
+
Transparent,
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
struct CSSColor : public CSSColorBase<CSSColorType, CSSColor> {
|
|
44
|
+
using CSSColorBase<CSSColorType, CSSColor>::CSSColorBase;
|
|
45
|
+
using CSSColorBase<CSSColorType, CSSColor>::operator==;
|
|
46
|
+
|
|
47
|
+
explicit CSSColor(jsi::Runtime &rt, const jsi::Value &jsiValue);
|
|
48
|
+
explicit CSSColor(const folly::dynamic &value);
|
|
49
|
+
|
|
50
|
+
static bool canConstruct(jsi::Runtime &rt, const jsi::Value &jsiValue);
|
|
51
|
+
static bool canConstruct(const folly::dynamic &value);
|
|
52
|
+
|
|
53
|
+
folly::dynamic toDynamic() const override;
|
|
54
|
+
std::string toString() const override;
|
|
55
|
+
|
|
56
|
+
#ifndef NDEBUG
|
|
57
|
+
friend std::ostream &operator<<(std::ostream &os, const CSSColor &colorValue);
|
|
58
|
+
#endif // NDEBUG
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
} // namespace reanimated::css
|