@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/LayoutAnimations/PropsDiffer.cpp
ADDED
|
@@ -0,0 +1,456 @@
|
|
|
1
|
+
#include <react/renderer/components/view/ViewProps.h>
|
|
2
|
+
#include <react/renderer/core/graphicsConversions.h>
|
|
3
|
+
#include <react/renderer/graphics/Transform.h>
|
|
4
|
+
#include <reanimated/LayoutAnimations/PropsDiffer.h>
|
|
5
|
+
|
|
6
|
+
#include <string>
|
|
7
|
+
#include <vector>
|
|
8
|
+
|
|
9
|
+
using namespace facebook;
|
|
10
|
+
|
|
11
|
+
namespace reanimated {
|
|
12
|
+
|
|
13
|
+
jsi::Object PropsDiffer::computeDiff(jsi::Runtime &runtime) {
|
|
14
|
+
diffFrame(runtime);
|
|
15
|
+
diffOpacity(runtime);
|
|
16
|
+
diffBackgroundColor(runtime);
|
|
17
|
+
diffTransform(runtime);
|
|
18
|
+
diffTransformOrigin(runtime);
|
|
19
|
+
diffShadow(runtime);
|
|
20
|
+
diffBorder(runtime);
|
|
21
|
+
|
|
22
|
+
jsi::Object diff(runtime);
|
|
23
|
+
diff.setProperty(runtime, "source", sourceValues_);
|
|
24
|
+
diff.setProperty(runtime, "target", targetValues_);
|
|
25
|
+
return diff;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
void PropsDiffer::diffFrame(jsi::Runtime &rt) {
|
|
29
|
+
const auto &sourceFrame = sourceView_.layoutMetrics.frame;
|
|
30
|
+
const auto &targetFrame = targetView_.layoutMetrics.frame;
|
|
31
|
+
const auto &sourceOrigin = sourceFrame.origin;
|
|
32
|
+
const auto &targetOrigin = targetFrame.origin;
|
|
33
|
+
if (sourceOrigin.x != targetOrigin.x) {
|
|
34
|
+
sourceValues_.setProperty(rt, "originX", sourceOrigin.x);
|
|
35
|
+
targetValues_.setProperty(rt, "originX", targetOrigin.x);
|
|
36
|
+
sourceValues_.setProperty(rt, "globalOriginX", sourceOrigin.x);
|
|
37
|
+
targetValues_.setProperty(rt, "globalOriginX", targetOrigin.x);
|
|
38
|
+
}
|
|
39
|
+
if (sourceOrigin.y != targetOrigin.y) {
|
|
40
|
+
sourceValues_.setProperty(rt, "originY", sourceOrigin.y);
|
|
41
|
+
targetValues_.setProperty(rt, "originY", targetOrigin.y);
|
|
42
|
+
sourceValues_.setProperty(rt, "globalOriginY", sourceOrigin.y);
|
|
43
|
+
targetValues_.setProperty(rt, "globalOriginY", targetOrigin.y);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const auto &sourceSize = sourceFrame.size;
|
|
47
|
+
const auto &targetSize = targetFrame.size;
|
|
48
|
+
if (sourceSize.width != targetSize.width) {
|
|
49
|
+
sourceValues_.setProperty(rt, "width", sourceSize.width);
|
|
50
|
+
targetValues_.setProperty(rt, "width", targetSize.width);
|
|
51
|
+
}
|
|
52
|
+
if (sourceSize.height != targetSize.height) {
|
|
53
|
+
sourceValues_.setProperty(rt, "height", sourceSize.height);
|
|
54
|
+
targetValues_.setProperty(rt, "height", targetSize.height);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
void PropsDiffer::diffOpacity(jsi::Runtime &rt) {
|
|
59
|
+
if (sourceViewProps_.opacity != targetViewProps_.opacity) {
|
|
60
|
+
sourceValues_.setProperty(rt, "opacity", sourceViewProps_.opacity);
|
|
61
|
+
targetValues_.setProperty(rt, "opacity", targetViewProps_.opacity);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
void PropsDiffer::diffBackgroundColor(jsi::Runtime &rt) {
|
|
66
|
+
if (sourceViewProps_.backgroundColor != targetViewProps_.backgroundColor) {
|
|
67
|
+
sourceValues_.setProperty(rt, "backgroundColor", react::toString(sourceViewProps_.backgroundColor));
|
|
68
|
+
targetValues_.setProperty(rt, "backgroundColor", react::toString(targetViewProps_.backgroundColor));
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
void PropsDiffer::diffTransform(jsi::Runtime &rt) {
|
|
73
|
+
const auto &sourceJsiOperations = getTransformOperationsFromProps(rt, sourceViewProps_);
|
|
74
|
+
const auto &targetJsiOperations = getTransformOperationsFromProps(rt, targetViewProps_);
|
|
75
|
+
|
|
76
|
+
if (sourceJsiOperations.size() == 1 && targetJsiOperations.size() == 1 &&
|
|
77
|
+
sourceJsiOperations[0].currentValue.hasProperty(rt, "matrix") &&
|
|
78
|
+
targetJsiOperations[0].currentValue.hasProperty(rt, "matrix")) {
|
|
79
|
+
jsi::Array sourceTransforms(rt, 1), targetTransforms(rt, 1);
|
|
80
|
+
sourceTransforms.setValueAtIndex(rt, 0, sourceJsiOperations[0].currentValue);
|
|
81
|
+
targetTransforms.setValueAtIndex(rt, 0, targetJsiOperations[0].currentValue);
|
|
82
|
+
sourceValues_.setProperty(rt, "transform", sourceTransforms);
|
|
83
|
+
targetValues_.setProperty(rt, "transform", targetTransforms);
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
jsi::Array sourceTransforms(rt, sourceJsiOperations.size() + targetJsiOperations.size());
|
|
88
|
+
jsi::Array targetTransforms(rt, sourceJsiOperations.size() + targetJsiOperations.size());
|
|
89
|
+
for (size_t i = 0; i < sourceJsiOperations.size(); i++) {
|
|
90
|
+
sourceTransforms.setValueAtIndex(rt, i, sourceJsiOperations[i].currentValue);
|
|
91
|
+
targetTransforms.setValueAtIndex(rt, i, sourceJsiOperations[i].defaultValue);
|
|
92
|
+
}
|
|
93
|
+
for (size_t i = 0; i < targetJsiOperations.size(); i++) {
|
|
94
|
+
size_t index = i + sourceJsiOperations.size();
|
|
95
|
+
sourceTransforms.setValueAtIndex(rt, index, targetJsiOperations[i].defaultValue);
|
|
96
|
+
targetTransforms.setValueAtIndex(rt, index, targetJsiOperations[i].currentValue);
|
|
97
|
+
}
|
|
98
|
+
sourceValues_.setProperty(rt, "transform", sourceTransforms);
|
|
99
|
+
targetValues_.setProperty(rt, "transform", targetTransforms);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
std::vector<TransformOperationWithDefault> PropsDiffer::getTransformOperationsFromProps(
|
|
103
|
+
jsi::Runtime &rt,
|
|
104
|
+
const ViewProps &props) {
|
|
105
|
+
std::vector<TransformOperationWithDefault> jsiOperations;
|
|
106
|
+
const auto &operations = props.transform.operations;
|
|
107
|
+
|
|
108
|
+
if (operations.size() == 1 && operations[0].type == react::TransformOperationType::Arbitrary) {
|
|
109
|
+
jsi::Array currentMatrix(rt, 16), defaultMatrix(rt, 16);
|
|
110
|
+
for (int i = 0; i < 16; i++) {
|
|
111
|
+
currentMatrix.setValueAtIndex(rt, i, props.transform.matrix[i]);
|
|
112
|
+
defaultMatrix.setValueAtIndex(rt, i, i % 5 == 0 ? 1 : 0);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
jsi::Object currentValue(rt), defaultValue(rt);
|
|
116
|
+
currentValue.setProperty(rt, "matrix", currentMatrix);
|
|
117
|
+
defaultValue.setProperty(rt, "matrix", defaultMatrix);
|
|
118
|
+
jsiOperations.emplace_back(currentValue, defaultValue);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
for (const auto &operation : operations) {
|
|
122
|
+
switch (operation.type) {
|
|
123
|
+
case react::TransformOperationType::Perspective: {
|
|
124
|
+
maybeAddOperationToDiff(rt, "perspective", operation.x.value, 1, jsiOperations);
|
|
125
|
+
} break;
|
|
126
|
+
|
|
127
|
+
case react::TransformOperationType::Scale: {
|
|
128
|
+
maybeAddOperationToDiff(rt, "scaleX", operation.x.value, 1, jsiOperations);
|
|
129
|
+
maybeAddOperationToDiff(rt, "scaleY", operation.y.value, 1, jsiOperations);
|
|
130
|
+
maybeAddOperationToDiff(rt, "scaleZ", operation.z.value, 1, jsiOperations);
|
|
131
|
+
} break;
|
|
132
|
+
|
|
133
|
+
case react::TransformOperationType::Translate: {
|
|
134
|
+
maybeAddOperationToDiff(rt, "translateX", operation.x.value, 0, jsiOperations);
|
|
135
|
+
maybeAddOperationToDiff(rt, "translateY", operation.y.value, 0, jsiOperations);
|
|
136
|
+
maybeAddOperationToDiff(rt, "translateZ", operation.z.value, 0, jsiOperations);
|
|
137
|
+
} break;
|
|
138
|
+
|
|
139
|
+
case react::TransformOperationType::Rotate: {
|
|
140
|
+
maybeAddOperationToDiff(rt, "rotateX", operation.x.value, 0, jsiOperations);
|
|
141
|
+
maybeAddOperationToDiff(rt, "rotateY", operation.y.value, 0, jsiOperations);
|
|
142
|
+
maybeAddOperationToDiff(rt, "rotateZ", operation.z.value, 0, jsiOperations);
|
|
143
|
+
} break;
|
|
144
|
+
|
|
145
|
+
case react::TransformOperationType::Skew: {
|
|
146
|
+
maybeAddOperationToDiff(rt, "skewX", operation.x.value, 0, jsiOperations);
|
|
147
|
+
maybeAddOperationToDiff(rt, "skewY", operation.y.value, 0, jsiOperations);
|
|
148
|
+
maybeAddOperationToDiff(rt, "skewZ", operation.z.value, 0, jsiOperations);
|
|
149
|
+
} break;
|
|
150
|
+
|
|
151
|
+
default: {
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
return jsiOperations;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
void PropsDiffer::maybeAddOperationToDiff(
|
|
159
|
+
jsi::Runtime &rt,
|
|
160
|
+
const char *name,
|
|
161
|
+
float value,
|
|
162
|
+
float defaultValue,
|
|
163
|
+
std::vector<TransformOperationWithDefault> &jsiOperations) {
|
|
164
|
+
if (value == defaultValue) {
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
jsi::Object jsiValue(rt);
|
|
168
|
+
jsiValue.setProperty(rt, name, value);
|
|
169
|
+
jsi::Object jsiDefaultDefault(rt);
|
|
170
|
+
jsiDefaultDefault.setProperty(rt, name, defaultValue);
|
|
171
|
+
jsiOperations.emplace_back(jsiValue, jsiDefaultDefault);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
void PropsDiffer::diffTransformOrigin(jsi::Runtime &rt) {
|
|
175
|
+
const auto &sourceTransformOrigin = sourceViewProps_.transformOrigin;
|
|
176
|
+
const auto &targetTransformOrigin = targetViewProps_.transformOrigin;
|
|
177
|
+
|
|
178
|
+
if (sourceTransformOrigin.xy[0] == targetTransformOrigin.xy[0] &&
|
|
179
|
+
sourceTransformOrigin.xy[1] == targetTransformOrigin.xy[1] &&
|
|
180
|
+
sourceTransformOrigin.z == targetTransformOrigin.z) {
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
addTransformOriginToDiff(rt, sourceTransformOrigin, sourceValues_, sourceView_);
|
|
185
|
+
addTransformOriginToDiff(rt, targetTransformOrigin, targetValues_, targetView_);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
void PropsDiffer::addTransformOriginToDiff(
|
|
189
|
+
jsi::Runtime &rt,
|
|
190
|
+
const TransformOrigin &transformOrigin,
|
|
191
|
+
jsi::Object &jsiValues,
|
|
192
|
+
const ShadowView &view) {
|
|
193
|
+
jsi::Array transformOriginJsi(rt, 3);
|
|
194
|
+
|
|
195
|
+
if (transformOrigin.xy[0].unit == UnitType::Percent) {
|
|
196
|
+
const float origin = view.layoutMetrics.frame.size.width * transformOrigin.xy[0].value / 100;
|
|
197
|
+
transformOriginJsi.setValueAtIndex(rt, 0, origin);
|
|
198
|
+
} else {
|
|
199
|
+
transformOriginJsi.setValueAtIndex(rt, 0, transformOrigin.xy[0].value);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
if (transformOrigin.xy[1].unit == UnitType::Percent) {
|
|
203
|
+
const float origin = view.layoutMetrics.frame.size.height * transformOrigin.xy[1].value / 100;
|
|
204
|
+
transformOriginJsi.setValueAtIndex(rt, 1, origin);
|
|
205
|
+
} else {
|
|
206
|
+
transformOriginJsi.setValueAtIndex(rt, 1, transformOrigin.xy[1].value);
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
transformOriginJsi.setValueAtIndex(rt, 2, transformOrigin.z);
|
|
210
|
+
|
|
211
|
+
jsiValues.setProperty(rt, "transformOrigin", transformOriginJsi);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
void PropsDiffer::diffShadow(jsi::Runtime &rt) {
|
|
215
|
+
const auto &sourceBoxShadows = getBoxShadowsFromProps(rt, sourceViewProps_);
|
|
216
|
+
const auto &targetBoxShadows = getBoxShadowsFromProps(rt, targetViewProps_);
|
|
217
|
+
|
|
218
|
+
if (sourceBoxShadows.size() == targetBoxShadows.size()) {
|
|
219
|
+
const size_t size = sourceBoxShadows.size();
|
|
220
|
+
jsi::Array sourceBoxShadowArray(rt, size), targetBoxShadowArray(rt, size);
|
|
221
|
+
for (int i = 0; i < size; i++) {
|
|
222
|
+
sourceBoxShadowArray.setValueAtIndex(rt, i, sourceBoxShadows[i].currentValue);
|
|
223
|
+
targetBoxShadowArray.setValueAtIndex(rt, i, targetBoxShadows[i].currentValue);
|
|
224
|
+
}
|
|
225
|
+
sourceValues_.setProperty(rt, "boxShadow", sourceBoxShadowArray);
|
|
226
|
+
targetValues_.setProperty(rt, "boxShadow", targetBoxShadowArray);
|
|
227
|
+
} else {
|
|
228
|
+
const size_t size = sourceBoxShadows.size() + targetBoxShadows.size();
|
|
229
|
+
jsi::Array sourceBoxShadowArray(rt, size), targetBoxShadowArray(rt, size);
|
|
230
|
+
for (size_t i = 0; i < sourceBoxShadows.size(); i++) {
|
|
231
|
+
sourceBoxShadowArray.setValueAtIndex(rt, i, sourceBoxShadows[i].currentValue);
|
|
232
|
+
targetBoxShadowArray.setValueAtIndex(rt, i, sourceBoxShadows[i].defaultValue);
|
|
233
|
+
}
|
|
234
|
+
for (size_t i = 0; i < targetBoxShadows.size(); i++) {
|
|
235
|
+
size_t index = i + sourceBoxShadows.size();
|
|
236
|
+
sourceBoxShadowArray.setValueAtIndex(rt, index, targetBoxShadows[i].defaultValue);
|
|
237
|
+
targetBoxShadowArray.setValueAtIndex(rt, index, targetBoxShadows[i].currentValue);
|
|
238
|
+
}
|
|
239
|
+
sourceValues_.setProperty(rt, "boxShadow", sourceBoxShadowArray);
|
|
240
|
+
targetValues_.setProperty(rt, "boxShadow", targetBoxShadowArray);
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
if (sourceViewProps_.shadowColor != targetViewProps_.shadowColor) {
|
|
244
|
+
sourceValues_.setProperty(rt, "shadowColor", toString(sourceViewProps_.shadowColor));
|
|
245
|
+
targetValues_.setProperty(rt, "shadowColor", toString(targetViewProps_.shadowColor));
|
|
246
|
+
}
|
|
247
|
+
if (sourceViewProps_.shadowOffset != targetViewProps_.shadowOffset) {
|
|
248
|
+
jsi::Object sourceShadowOffset(rt), targetShadowOffset(rt);
|
|
249
|
+
sourceShadowOffset.setProperty(rt, "width", sourceViewProps_.shadowOffset.width);
|
|
250
|
+
sourceShadowOffset.setProperty(rt, "height", sourceViewProps_.shadowOffset.height);
|
|
251
|
+
targetShadowOffset.setProperty(rt, "width", targetViewProps_.shadowOffset.width);
|
|
252
|
+
targetShadowOffset.setProperty(rt, "height", targetViewProps_.shadowOffset.height);
|
|
253
|
+
sourceValues_.setProperty(rt, "shadowOffset", sourceShadowOffset);
|
|
254
|
+
targetValues_.setProperty(rt, "shadowOffset", targetShadowOffset);
|
|
255
|
+
}
|
|
256
|
+
if (sourceViewProps_.shadowOpacity != targetViewProps_.shadowOpacity) {
|
|
257
|
+
sourceValues_.setProperty(rt, "shadowOpacity", sourceViewProps_.shadowOpacity);
|
|
258
|
+
targetValues_.setProperty(rt, "shadowOpacity", targetViewProps_.shadowOpacity);
|
|
259
|
+
}
|
|
260
|
+
if (sourceViewProps_.shadowRadius != targetViewProps_.shadowRadius) {
|
|
261
|
+
sourceValues_.setProperty(rt, "shadowRadius", sourceViewProps_.shadowRadius);
|
|
262
|
+
targetValues_.setProperty(rt, "shadowRadius", targetViewProps_.shadowRadius);
|
|
263
|
+
}
|
|
264
|
+
#ifdef ANDROID
|
|
265
|
+
if (sourceViewProps_.elevation != targetViewProps_.elevation) {
|
|
266
|
+
sourceValues_.setProperty(rt, "elevation", sourceViewProps_.elevation);
|
|
267
|
+
targetValues_.setProperty(rt, "elevation", targetViewProps_.elevation);
|
|
268
|
+
}
|
|
269
|
+
#endif
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
std::vector<BoxShadowWithDefault> PropsDiffer::getBoxShadowsFromProps(jsi::Runtime &rt, const ViewProps &props) {
|
|
273
|
+
const auto &boxShadows = props.boxShadow;
|
|
274
|
+
std::vector<BoxShadowWithDefault> boxShadowsWithDefault;
|
|
275
|
+
for (const auto &boxShadow : boxShadows) {
|
|
276
|
+
jsi::Object currentBoxShadow(rt), defaultBoxShadow(rt);
|
|
277
|
+
|
|
278
|
+
currentBoxShadow.setProperty(rt, "offsetX", boxShadow.offsetX);
|
|
279
|
+
currentBoxShadow.setProperty(rt, "offsetY", boxShadow.offsetY);
|
|
280
|
+
currentBoxShadow.setProperty(rt, "blurRadius", boxShadow.blurRadius);
|
|
281
|
+
currentBoxShadow.setProperty(rt, "spreadDistance", boxShadow.spreadDistance);
|
|
282
|
+
currentBoxShadow.setProperty(rt, "color", toString(boxShadow.color));
|
|
283
|
+
|
|
284
|
+
defaultBoxShadow.setProperty(rt, "offsetX", 0);
|
|
285
|
+
defaultBoxShadow.setProperty(rt, "offsetY", 0);
|
|
286
|
+
defaultBoxShadow.setProperty(rt, "blurRadius", 0);
|
|
287
|
+
defaultBoxShadow.setProperty(rt, "spreadDistance", 0);
|
|
288
|
+
defaultBoxShadow.setProperty(rt, "color", toString(SharedColor()));
|
|
289
|
+
|
|
290
|
+
boxShadowsWithDefault.emplace_back(currentBoxShadow, defaultBoxShadow);
|
|
291
|
+
}
|
|
292
|
+
return boxShadowsWithDefault;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
void PropsDiffer::diffBorder(jsi::Runtime &rt) {
|
|
296
|
+
const auto &sourceBorderRadii = sourceViewProps_.borderRadii;
|
|
297
|
+
const auto &targetBorderRadii = targetViewProps_.borderRadii;
|
|
298
|
+
diffBorderRadius(sourceBorderRadii.all, targetBorderRadii.all, "borderRadius", rt);
|
|
299
|
+
diffBorderRadius(sourceBorderRadii.topLeft, targetBorderRadii.topLeft, "borderTopLeftRadius", rt);
|
|
300
|
+
diffBorderRadius(sourceBorderRadii.topRight, targetBorderRadii.topRight, "borderTopRightRadius", rt);
|
|
301
|
+
diffBorderRadius(sourceBorderRadii.bottomLeft, targetBorderRadii.bottomLeft, "borderBottomLeftRadius", rt);
|
|
302
|
+
diffBorderRadius(sourceBorderRadii.bottomRight, targetBorderRadii.bottomRight, "borderBottomRightRadius", rt);
|
|
303
|
+
diffBorderRadius(sourceBorderRadii.topStart, targetBorderRadii.topStart, "borderTopStartRadius", rt);
|
|
304
|
+
diffBorderRadius(sourceBorderRadii.topEnd, targetBorderRadii.topEnd, "borderTopEndRadius", rt);
|
|
305
|
+
diffBorderRadius(sourceBorderRadii.bottomStart, targetBorderRadii.bottomStart, "borderBottomStartRadius", rt);
|
|
306
|
+
diffBorderRadius(sourceBorderRadii.bottomEnd, targetBorderRadii.bottomEnd, "borderBottomEndRadius", rt);
|
|
307
|
+
diffBorderRadius(sourceBorderRadii.endEnd, targetBorderRadii.endEnd, "borderEndEndRadius", rt);
|
|
308
|
+
diffBorderRadius(sourceBorderRadii.endStart, targetBorderRadii.endStart, "borderEndStartRadius", rt);
|
|
309
|
+
diffBorderRadius(sourceBorderRadii.startEnd, targetBorderRadii.startEnd, "borderStartEndRadius", rt);
|
|
310
|
+
diffBorderRadius(sourceBorderRadii.startStart, targetBorderRadii.startStart, "borderStartStartRadius", rt);
|
|
311
|
+
|
|
312
|
+
const auto &sourceBorderWidths = sourceViewProps_.getBorderWidths();
|
|
313
|
+
const auto &targetBorderWidths = targetViewProps_.getBorderWidths();
|
|
314
|
+
const auto defaultSourceWidth = sourceBorderWidths.all.value_or(0);
|
|
315
|
+
const auto defaultTargetWidth = targetBorderWidths.all.value_or(0);
|
|
316
|
+
diffBorderWidth(
|
|
317
|
+
sourceBorderWidths.all, targetBorderWidths.all, "borderWidth", rt, defaultSourceWidth, defaultTargetWidth);
|
|
318
|
+
diffBorderWidth(
|
|
319
|
+
sourceBorderWidths.left, targetBorderWidths.left, "borderLeftWidth", rt, defaultSourceWidth, defaultTargetWidth);
|
|
320
|
+
diffBorderWidth(
|
|
321
|
+
sourceBorderWidths.right,
|
|
322
|
+
targetBorderWidths.right,
|
|
323
|
+
"borderRightWidth",
|
|
324
|
+
rt,
|
|
325
|
+
defaultSourceWidth,
|
|
326
|
+
defaultTargetWidth);
|
|
327
|
+
diffBorderWidth(
|
|
328
|
+
sourceBorderWidths.top, targetBorderWidths.top, "borderTopWidth", rt, defaultSourceWidth, defaultTargetWidth);
|
|
329
|
+
diffBorderWidth(
|
|
330
|
+
sourceBorderWidths.bottom,
|
|
331
|
+
targetBorderWidths.bottom,
|
|
332
|
+
"borderBottomWidth",
|
|
333
|
+
rt,
|
|
334
|
+
defaultSourceWidth,
|
|
335
|
+
defaultTargetWidth);
|
|
336
|
+
|
|
337
|
+
const auto &sourceBorderColors = sourceViewProps_.borderColors;
|
|
338
|
+
const auto &targetBorderColors = targetViewProps_.borderColors;
|
|
339
|
+
diffBorderColors(sourceBorderColors.all, targetBorderColors.all, "borderColor", rt);
|
|
340
|
+
diffBorderColors(sourceBorderColors.left, targetBorderColors.left, "borderLeftColor", rt);
|
|
341
|
+
diffBorderColors(sourceBorderColors.right, targetBorderColors.right, "borderRightColor", rt);
|
|
342
|
+
diffBorderColors(sourceBorderColors.top, targetBorderColors.top, "borderTopColor", rt);
|
|
343
|
+
diffBorderColors(sourceBorderColors.bottom, targetBorderColors.bottom, "borderBottomColor", rt);
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
void PropsDiffer::diffBorderRadius(
|
|
347
|
+
const std::optional<react::ValueUnit> &sourceValue,
|
|
348
|
+
const std::optional<react::ValueUnit> &targetValue,
|
|
349
|
+
const char *name,
|
|
350
|
+
jsi::Runtime &rt) {
|
|
351
|
+
ValueUnit defaultValue;
|
|
352
|
+
const auto &source = sourceValue.value_or(defaultValue).value;
|
|
353
|
+
const auto &target = targetValue.value_or(defaultValue).value;
|
|
354
|
+
if (source == target) {
|
|
355
|
+
return;
|
|
356
|
+
}
|
|
357
|
+
// In React Native, we can't set asymmetric border radii for the edges of a
|
|
358
|
+
// corner using pixels. This limitation means we can't properly animate
|
|
359
|
+
// between units in percentages and pixels.
|
|
360
|
+
if (targetValue.value_or(defaultValue).unit == UnitType::Percent) {
|
|
361
|
+
if (sourceValue.has_value()) {
|
|
362
|
+
sourceValues_.setProperty(rt, name, std::to_string(source) + "%");
|
|
363
|
+
} else {
|
|
364
|
+
const auto &defaultRadius = sourceViewProps_.borderRadii.all.value_or(defaultValue).value;
|
|
365
|
+
sourceValues_.setProperty(rt, name, std::to_string(defaultRadius) + "%");
|
|
366
|
+
}
|
|
367
|
+
if (targetValue.has_value()) {
|
|
368
|
+
targetValues_.setProperty(rt, name, std::to_string(target) + "%");
|
|
369
|
+
} else {
|
|
370
|
+
const auto &defaultRadius = targetViewProps_.borderRadii.all.value_or(defaultValue).value;
|
|
371
|
+
targetValues_.setProperty(rt, name, std::to_string(defaultRadius) + "%");
|
|
372
|
+
}
|
|
373
|
+
} else {
|
|
374
|
+
if (sourceValue.has_value()) {
|
|
375
|
+
sourceValues_.setProperty(rt, name, source);
|
|
376
|
+
} else {
|
|
377
|
+
const auto &defaultRadius = sourceViewProps_.borderRadii.all.value_or(defaultValue).value;
|
|
378
|
+
sourceValues_.setProperty(rt, name, defaultRadius);
|
|
379
|
+
}
|
|
380
|
+
if (targetValue.has_value()) {
|
|
381
|
+
targetValues_.setProperty(rt, name, target);
|
|
382
|
+
} else {
|
|
383
|
+
const auto &defaultRadius = targetViewProps_.borderRadii.all.value_or(defaultValue).value;
|
|
384
|
+
targetValues_.setProperty(rt, name, defaultRadius);
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
void PropsDiffer::diffBorderWidth(
|
|
390
|
+
const std::optional<react::Float> &sourceValue,
|
|
391
|
+
const std::optional<react::Float> &targetValue,
|
|
392
|
+
const char *name,
|
|
393
|
+
jsi::Runtime &rt,
|
|
394
|
+
float defaultSourceWidth,
|
|
395
|
+
float defaultTargetWidth) {
|
|
396
|
+
const auto source = sourceValue.value_or(0);
|
|
397
|
+
const auto target = targetValue.value_or(0);
|
|
398
|
+
if (source != target) {
|
|
399
|
+
if (sourceValue.has_value()) {
|
|
400
|
+
sourceValues_.setProperty(rt, name, source);
|
|
401
|
+
} else {
|
|
402
|
+
sourceValues_.setProperty(rt, name, defaultSourceWidth);
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
if (targetValue.has_value()) {
|
|
406
|
+
targetValues_.setProperty(rt, name, target);
|
|
407
|
+
} else {
|
|
408
|
+
targetValues_.setProperty(rt, name, defaultTargetWidth);
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
void PropsDiffer::diffBorderColors(
|
|
414
|
+
const std::optional<react::SharedColor> &sourceValue,
|
|
415
|
+
const std::optional<react::SharedColor> &targetValue,
|
|
416
|
+
const char *name,
|
|
417
|
+
jsi::Runtime &rt) {
|
|
418
|
+
SharedColor defaultValue;
|
|
419
|
+
const auto &source = sourceValue.value_or(defaultValue);
|
|
420
|
+
const auto &target = targetValue.value_or(defaultValue);
|
|
421
|
+
if (source != target) {
|
|
422
|
+
if (sourceValue.has_value()) {
|
|
423
|
+
sourceValues_.setProperty(rt, name, toString(source));
|
|
424
|
+
} else {
|
|
425
|
+
auto const &maybeDefaultColor = sourceViewProps_.borderColors.all.value_or(defaultValue);
|
|
426
|
+
sourceValues_.setProperty(rt, name, toString(maybeDefaultColor));
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
if (targetValue.has_value()) {
|
|
430
|
+
targetValues_.setProperty(rt, name, toString(target));
|
|
431
|
+
} else {
|
|
432
|
+
auto const &maybeDefaultColor = targetViewProps_.borderColors.all.value_or(defaultValue);
|
|
433
|
+
targetValues_.setProperty(rt, name, toString(maybeDefaultColor));
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
// Copied from
|
|
439
|
+
// https://github.com/facebook/react-native/blob/v0.80.0-rc.5/packages/react-native/ReactCommon/react/renderer/core/graphicsConversions.h#L47
|
|
440
|
+
// I needed to manually apply a patch for unnecessary alpha channel
|
|
441
|
+
// normalization.
|
|
442
|
+
inline std::string PropsDiffer::toString(const SharedColor &value) {
|
|
443
|
+
ColorComponents components = colorComponentsFromColor(value);
|
|
444
|
+
std::array<char, 255> buffer{};
|
|
445
|
+
std::snprintf(
|
|
446
|
+
buffer.data(),
|
|
447
|
+
buffer.size(),
|
|
448
|
+
"rgba(%.0f, %.0f, %.0f, %f)",
|
|
449
|
+
components.red * 255.f,
|
|
450
|
+
components.green * 255.f,
|
|
451
|
+
components.blue * 255.f,
|
|
452
|
+
components.alpha);
|
|
453
|
+
return buffer.data();
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
} // namespace reanimated
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
#include <react/renderer/components/view/ViewProps.h>
|
|
3
|
+
#include <react/renderer/core/graphicsConversions.h>
|
|
4
|
+
#include <react/renderer/mounting/ShadowView.h>
|
|
5
|
+
#include <reanimated/LayoutAnimations/LayoutAnimationsUtils.h>
|
|
6
|
+
|
|
7
|
+
#include <jsi/jsi.h>
|
|
8
|
+
|
|
9
|
+
#include <string>
|
|
10
|
+
#include <utility>
|
|
11
|
+
#include <vector>
|
|
12
|
+
|
|
13
|
+
using namespace facebook;
|
|
14
|
+
using namespace facebook::react;
|
|
15
|
+
|
|
16
|
+
namespace reanimated {
|
|
17
|
+
|
|
18
|
+
struct TransformOperationWithDefault {
|
|
19
|
+
jsi::Object currentValue;
|
|
20
|
+
jsi::Object defaultValue;
|
|
21
|
+
TransformOperationWithDefault(jsi::Object ¤t, jsi::Object &defaultVal)
|
|
22
|
+
: currentValue(std::move(current)), defaultValue(std::move(defaultVal)) {}
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
struct BoxShadowWithDefault {
|
|
26
|
+
jsi::Object currentValue;
|
|
27
|
+
jsi::Object defaultValue;
|
|
28
|
+
BoxShadowWithDefault(jsi::Object ¤t, jsi::Object &defaultVal)
|
|
29
|
+
: currentValue(std::move(current)), defaultValue(std::move(defaultVal)) {}
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
class PropsDiffer {
|
|
33
|
+
const ShadowView &sourceView_;
|
|
34
|
+
const ShadowView &targetView_;
|
|
35
|
+
const ViewProps &sourceViewProps_;
|
|
36
|
+
const ViewProps &targetViewProps_;
|
|
37
|
+
jsi::Object sourceValues_;
|
|
38
|
+
jsi::Object targetValues_;
|
|
39
|
+
Transform sourceTransform_;
|
|
40
|
+
Transform targetTransform_;
|
|
41
|
+
|
|
42
|
+
void diffFrame(jsi::Runtime &rt);
|
|
43
|
+
|
|
44
|
+
void diffOpacity(jsi::Runtime &rt);
|
|
45
|
+
|
|
46
|
+
void diffBackgroundColor(jsi::Runtime &rt);
|
|
47
|
+
|
|
48
|
+
void diffTransform(jsi::Runtime &rt);
|
|
49
|
+
static std::vector<TransformOperationWithDefault> getTransformOperationsFromProps(
|
|
50
|
+
jsi::Runtime &rt,
|
|
51
|
+
const ViewProps &props);
|
|
52
|
+
static void maybeAddOperationToDiff(
|
|
53
|
+
jsi::Runtime &rt,
|
|
54
|
+
const char *name,
|
|
55
|
+
float value,
|
|
56
|
+
float defaultValue,
|
|
57
|
+
std::vector<TransformOperationWithDefault> &jsiOperations);
|
|
58
|
+
|
|
59
|
+
void diffTransformOrigin(jsi::Runtime &rt);
|
|
60
|
+
static void addTransformOriginToDiff(
|
|
61
|
+
jsi::Runtime &rt,
|
|
62
|
+
const TransformOrigin &transformOrigin,
|
|
63
|
+
jsi::Object &jsiValues,
|
|
64
|
+
const ShadowView &view);
|
|
65
|
+
|
|
66
|
+
void diffShadow(jsi::Runtime &rt);
|
|
67
|
+
static std::vector<BoxShadowWithDefault> getBoxShadowsFromProps(jsi::Runtime &rt, const ViewProps &props);
|
|
68
|
+
|
|
69
|
+
void diffBorder(jsi::Runtime &rt);
|
|
70
|
+
void diffBorderRadius(
|
|
71
|
+
const std::optional<react::ValueUnit> &sourceValue,
|
|
72
|
+
const std::optional<react::ValueUnit> &targetValue,
|
|
73
|
+
const char *name,
|
|
74
|
+
jsi::Runtime &rt);
|
|
75
|
+
void diffBorderWidth(
|
|
76
|
+
const std::optional<react::Float> &sourceValue,
|
|
77
|
+
const std::optional<react::Float> &targetValue,
|
|
78
|
+
const char *name,
|
|
79
|
+
jsi::Runtime &rt,
|
|
80
|
+
float defaultSourceWidth,
|
|
81
|
+
float defaultTargetWidth);
|
|
82
|
+
void diffBorderColors(
|
|
83
|
+
const std::optional<react::SharedColor> &sourceValue,
|
|
84
|
+
const std::optional<react::SharedColor> &targetValue,
|
|
85
|
+
const char *name,
|
|
86
|
+
jsi::Runtime &rt);
|
|
87
|
+
|
|
88
|
+
static inline std::string toString(const SharedColor &value);
|
|
89
|
+
|
|
90
|
+
public:
|
|
91
|
+
explicit PropsDiffer(jsi::Runtime &rt, const ShadowView &sourceView, const ShadowView &targetView)
|
|
92
|
+
: sourceView_(sourceView),
|
|
93
|
+
targetView_(targetView),
|
|
94
|
+
sourceViewProps_(static_cast<const ViewProps &>(*sourceView.props)),
|
|
95
|
+
targetViewProps_(static_cast<const ViewProps &>(*targetView.props)),
|
|
96
|
+
sourceValues_(rt),
|
|
97
|
+
targetValues_(rt) {}
|
|
98
|
+
|
|
99
|
+
jsi::Object computeDiff(jsi::Runtime &runtime);
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
} // namespace reanimated
|