@react-native-ohos/react-native-reanimated 4.0.1 → 4.0.2-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/compatibility.json +161 -161
- package/harmony/reanimated/BuildProfile.ets +1 -1
- package/harmony/reanimated/build-profile.json5 +18 -18
- package/harmony/reanimated/hvigorfile.ts +4 -4
- package/harmony/reanimated/index.ets +4 -4
- package/harmony/reanimated/oh-package-lock.json5 +39 -0
- package/harmony/reanimated/oh-package.json5 +12 -12
- package/harmony/reanimated/src/main/cpp/CMakeLists.txt +65 -62
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/AnimatedSensor/AnimatedSensorModule.cpp +81 -81
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/AnimatedSensor/AnimatedSensorModule.h +46 -46
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/InterpolatorRegistry.cpp +390 -390
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/InterpolatorRegistry.h +16 -16
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/definitions.h +30 -30
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/filters/FilterOp.cpp +46 -46
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/filters/FilterOp.h +23 -23
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/transforms/Quaternion.cpp +53 -53
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/transforms/Quaternion.h +21 -21
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/transforms/TransformMatrix.cpp +166 -166
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/transforms/TransformMatrix.h +71 -71
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/transforms/TransformMatrix2D.cpp +368 -368
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/transforms/TransformMatrix2D.h +53 -53
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/transforms/TransformMatrix3D.cpp +594 -594
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/transforms/TransformMatrix3D.h +67 -67
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/transforms/TransformOp.cpp +52 -52
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/transforms/TransformOp.h +26 -26
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/transforms/vectors.cpp +156 -156
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/transforms/vectors.h +76 -76
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSAngle.cpp +94 -94
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSAngle.h +33 -33
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSBoolean.cpp +48 -48
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSBoolean.h +31 -31
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSColor.cpp +135 -135
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSColor.h +61 -61
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSDiscreteArray.cpp +100 -100
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSDiscreteArray.h +45 -45
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSKeyword.cpp +81 -81
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSKeyword.h +53 -53
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSLength.cpp +122 -122
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSLength.h +38 -38
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSNumber.cpp +82 -82
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSNumber.h +63 -63
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSValue.h +118 -118
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSValueVariant.cpp +174 -174
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSValueVariant.h +111 -111
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/complex/CSSBoxShadow.cpp +196 -196
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/complex/CSSBoxShadow.h +66 -66
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/complex/CSSDropShadow.cpp +134 -134
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/complex/CSSDropShadow.h +44 -44
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/configs/CSSAnimationConfig.cpp +174 -174
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/configs/CSSAnimationConfig.h +49 -49
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/configs/CSSKeyframesConfig.cpp +45 -45
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/configs/CSSKeyframesConfig.h +26 -26
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/configs/CSSTransitionConfig.cpp +90 -90
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/configs/CSSTransitionConfig.h +43 -43
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/configs/common.cpp +17 -17
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/configs/common.h +13 -13
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/core/CSSAnimation.cpp +127 -127
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/core/CSSAnimation.h +51 -51
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/core/CSSTransition.cpp +145 -145
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/core/CSSTransition.h +47 -47
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/easing/EasingFunctions.cpp +69 -69
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/easing/EasingFunctions.h +22 -22
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/easing/cubicBezier.cpp +66 -66
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/easing/cubicBezier.h +15 -15
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/easing/linear.cpp +28 -28
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/easing/linear.h +15 -15
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/easing/steps.cpp +13 -13
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/easing/steps.h +12 -12
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/InterpolatorFactory.cpp +157 -157
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/InterpolatorFactory.h +189 -189
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/PropertyInterpolator.cpp +76 -76
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/PropertyInterpolator.h +66 -66
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/configs.h +20 -20
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/FilterOperation.cpp +136 -136
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/FilterOperation.h +40 -40
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/FilterOperationInterpolator.cpp +38 -38
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/FilterOperationInterpolator.h +24 -24
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/FilterStyleInterpolator.cpp +58 -58
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/FilterStyleInterpolator.h +24 -24
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/operations/blur.h +14 -14
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/operations/brightness.h +14 -14
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/operations/contrast.h +14 -14
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/operations/dropShadow.h +17 -17
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/operations/grayscale.h +14 -14
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/operations/hueRotate.h +14 -14
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/operations/invert.h +14 -14
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/operations/opacity.h +14 -14
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/operations/saturate.h +14 -14
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/operations/sepia.h +14 -14
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/groups/ArrayPropertiesInterpolator.cpp +95 -95
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/groups/ArrayPropertiesInterpolator.h +36 -36
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/groups/GroupPropertiesInterpolator.cpp +41 -41
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/groups/GroupPropertiesInterpolator.h +32 -32
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/groups/RecordPropertiesInterpolator.cpp +99 -99
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/groups/RecordPropertiesInterpolator.h +37 -37
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/operations/OperationsStyleInterpolator.cpp +308 -308
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/operations/OperationsStyleInterpolator.h +100 -100
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/operations/StyleOperation.cpp +19 -19
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/operations/StyleOperation.h +94 -94
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/operations/StyleOperationInterpolator.cpp +18 -18
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/operations/StyleOperationInterpolator.h +43 -43
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/styles/AnimationStyleInterpolator.h +26 -26
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/styles/TransitionStyleInterpolator.cpp +103 -103
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/styles/TransitionStyleInterpolator.h +42 -42
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/TransformOperation.cpp +224 -224
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/TransformOperation.h +52 -52
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/TransformOperationInterpolator.cpp +218 -218
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/TransformOperationInterpolator.h +89 -89
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/TransformsStyleInterpolator.cpp +149 -149
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/TransformsStyleInterpolator.h +33 -33
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/operations/matrix.cpp +208 -208
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/operations/matrix.h +56 -56
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/operations/perspective.cpp +42 -42
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/operations/perspective.h +20 -20
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/operations/rotate.cpp +41 -41
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/operations/rotate.h +39 -39
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/operations/scale.cpp +28 -28
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/operations/scale.h +25 -25
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/operations/skew.cpp +14 -14
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/operations/skew.h +20 -20
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/operations/translate.cpp +39 -39
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/operations/translate.h +25 -25
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/values/ResolvableValueInterpolator.cpp +47 -47
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/values/ResolvableValueInterpolator.h +43 -43
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/values/SimpleValueInterpolator.cpp +70 -70
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/values/SimpleValueInterpolator.h +40 -40
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/values/ValueInterpolator.cpp +146 -146
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/values/ValueInterpolator.h +71 -71
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/misc/ViewStylesRepository.cpp +155 -155
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/misc/ViewStylesRepository.h +53 -53
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/progress/AnimationProgressProvider.cpp +170 -170
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/progress/AnimationProgressProvider.h +67 -67
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/progress/KeyframeProgressProvider.h +12 -12
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/progress/RawProgressProvider.cpp +41 -41
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/progress/RawProgressProvider.h +31 -31
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/progress/TransitionProgressProvider.cpp +193 -193
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/progress/TransitionProgressProvider.h +77 -77
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/registries/CSSAnimationsRegistry.cpp +340 -340
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/registries/CSSAnimationsRegistry.h +80 -80
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/registries/CSSKeyframesRegistry.cpp +45 -45
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/registries/CSSKeyframesRegistry.h +29 -29
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/registries/CSSTransitionsRegistry.cpp +167 -167
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/registries/CSSTransitionsRegistry.h +51 -51
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/registries/StaticPropsRegistry.cpp +61 -61
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/registries/StaticPropsRegistry.h +33 -33
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/svg/values/SVGBrush.cpp +80 -80
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/svg/values/SVGBrush.h +39 -39
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/svg/values/SVGLength.cpp +93 -93
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/svg/values/SVGLength.h +36 -36
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/svg/values/SVGStrokeDashArray.cpp +111 -111
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/svg/values/SVGStrokeDashArray.h +33 -33
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/utils/DelayedItemsManager.cpp +75 -75
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/utils/DelayedItemsManager.h +45 -45
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/utils/algorithms.cpp +12 -12
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/utils/algorithms.h +10 -10
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/utils/interpolators.cpp +36 -36
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/utils/interpolators.h +23 -23
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/utils/props.cpp +149 -149
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/utils/props.h +32 -32
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/ReanimatedCommitHook.cpp +113 -113
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/ReanimatedCommitHook.h +49 -49
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/ReanimatedCommitShadowNode.h +46 -46
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/ReanimatedMountHook.cpp +56 -56
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/ReanimatedMountHook.h +37 -37
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/ShadowTreeCloner.cpp +104 -104
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/ShadowTreeCloner.h +22 -22
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/updates/AnimatedPropsRegistry.cpp +72 -72
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/updates/AnimatedPropsRegistry.h +25 -25
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/updates/UpdatesRegistry.cpp +160 -160
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/updates/UpdatesRegistry.h +71 -71
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/updates/UpdatesRegistryManager.cpp +161 -161
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/updates/UpdatesRegistryManager.h +65 -65
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationType.h +11 -11
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsManager.cpp +137 -137
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsManager.h +82 -82
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxyCommon.cpp +79 -79
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxyCommon.h +81 -81
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxy_Experimental.cpp +864 -864
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxy_Experimental.h +214 -214
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxy_Legacy.cpp +897 -897
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxy_Legacy.h +220 -220
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsUtils.cpp +31 -31
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsUtils.h +146 -146
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/PropsDiffer.cpp +456 -456
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/PropsDiffer.h +102 -102
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/SharedTransitions.cpp +544 -544
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/NativeModules/PropValueProcessor.cpp +119 -119
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/NativeModules/PropValueProcessor.h +39 -39
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/NativeModules/ReanimatedModuleProxy.cpp +1380 -1380
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/NativeModules/ReanimatedModuleProxy.h +230 -230
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/NativeModules/ReanimatedModuleProxySpec.cpp +183 -183
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/NativeModules/ReanimatedModuleProxySpec.h +93 -93
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/RuntimeDecorators/RNRuntimeDecorator.cpp +54 -54
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/RuntimeDecorators/RNRuntimeDecorator.h +28 -28
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/RuntimeDecorators/UIRuntimeDecorator.cpp +58 -58
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/RuntimeDecorators/UIRuntimeDecorator.h +31 -31
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Tools/FeatureFlags.cpp +18 -18
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Tools/FeatureFlags.h +44 -44
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Tools/PlatformDepMethodsHolder.h +67 -67
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Tools/ReanimatedSystraceSection.h +114 -114
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Tools/ReanimatedVersion.cpp +46 -46
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Tools/ReanimatedVersion.h +18 -18
- package/harmony/reanimated/src/main/cpp/ReanimatedModule.cpp +233 -233
- package/harmony/reanimated/src/main/cpp/ReanimatedModule.h +23 -23
- package/harmony/reanimated/src/main/cpp/ReanimatedNodesManager.cpp +56 -56
- package/harmony/reanimated/src/main/cpp/ReanimatedNodesManager.h +30 -30
- package/harmony/reanimated/src/main/cpp/ReanimatedPackage.cpp +44 -44
- package/harmony/reanimated/src/main/cpp/ReanimatedPackage.h +16 -16
- package/harmony/reanimated/src/main/cpp/ReanimatedSensor.cpp +265 -265
- package/harmony/reanimated/src/main/cpp/ReanimatedSensor.h +36 -36
- package/harmony/reanimated/src/main/cpp/ReanimatedSensorContainer.cpp +35 -35
- package/harmony/reanimated/src/main/cpp/ReanimatedSensorContainer.h +23 -23
- package/harmony/reanimated/src/main/cpp/ReanimatedUIScheduler.cpp +23 -23
- package/harmony/reanimated/src/main/cpp/ReanimatedUIScheduler.h +19 -19
- package/harmony/reanimated/src/main/cpp/TransformParser.h +93 -93
- package/harmony/reanimated/src/main/ets/AnimationManager.ts +60 -60
- package/harmony/reanimated/src/main/ets/ReanimatedModule.ts +51 -51
- package/harmony/reanimated/src/main/ets/ReanimatedPackage.ts +25 -25
- 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 +70 -69
- package/scripts/deploy.js +191 -191
- package/scripts/set-reanimated-version.js +37 -37
- package/scripts/update-version.js +119 -119
- package/scripts/validate-react-native-version.js +46 -46
- package/scripts/validate-worklets-build.js +17 -17
- package/scripts/validate-worklets-version.js +84 -84
- package/scripts/worklets-version.json +4 -4
- package/src/index.ts +9 -9
|
@@ -1,70 +1,70 @@
|
|
|
1
|
-
#include <reanimated/CSS/interpolation/values/SimpleValueInterpolator.h>
|
|
2
|
-
|
|
3
|
-
#include <folly/dynamic.h>
|
|
4
|
-
#include <jsi/jsi.h>
|
|
5
|
-
|
|
6
|
-
#include <reanimated/CSS/common/values/CSSAngle.h>
|
|
7
|
-
#include <reanimated/CSS/common/values/CSSBoolean.h>
|
|
8
|
-
#include <reanimated/CSS/common/values/CSSColor.h>
|
|
9
|
-
#include <reanimated/CSS/common/values/CSSDiscreteArray.h>
|
|
10
|
-
#include <reanimated/CSS/common/values/CSSKeyword.h>
|
|
11
|
-
#include <reanimated/CSS/common/values/CSSLength.h>
|
|
12
|
-
#include <reanimated/CSS/common/values/CSSNumber.h>
|
|
13
|
-
#include <reanimated/CSS/common/values/complex/CSSBoxShadow.h>
|
|
14
|
-
#include <reanimated/CSS/svg/values/SVGBrush.h>
|
|
15
|
-
#include <reanimated/CSS/svg/values/SVGLength.h>
|
|
16
|
-
#include <reanimated/CSS/svg/values/SVGStrokeDashArray.h>
|
|
17
|
-
|
|
18
|
-
#include <memory>
|
|
19
|
-
|
|
20
|
-
namespace reanimated::css {
|
|
21
|
-
|
|
22
|
-
template <typename... AllowedTypes>
|
|
23
|
-
SimpleValueInterpolator<AllowedTypes...>::SimpleValueInterpolator(
|
|
24
|
-
const PropertyPath &propertyPath,
|
|
25
|
-
const ValueType &defaultStyleValue,
|
|
26
|
-
const std::shared_ptr<ViewStylesRepository> &viewStylesRepository)
|
|
27
|
-
: ValueInterpolator(propertyPath, std::make_shared<ValueType>(defaultStyleValue), viewStylesRepository) {}
|
|
28
|
-
|
|
29
|
-
template <typename... AllowedTypes>
|
|
30
|
-
std::shared_ptr<CSSValue> SimpleValueInterpolator<AllowedTypes...>::createValue(
|
|
31
|
-
jsi::Runtime &rt,
|
|
32
|
-
const jsi::Value &value) const {
|
|
33
|
-
return std::make_shared<ValueType>(rt, value);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
template <typename... AllowedTypes>
|
|
37
|
-
std::shared_ptr<CSSValue> SimpleValueInterpolator<AllowedTypes...>::createValue(const folly::dynamic &value) const {
|
|
38
|
-
return std::make_shared<ValueType>(value);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
template <typename... AllowedTypes>
|
|
42
|
-
folly::dynamic SimpleValueInterpolator<AllowedTypes...>::interpolateValue(
|
|
43
|
-
double progress,
|
|
44
|
-
const std::shared_ptr<CSSValue> &fromValue,
|
|
45
|
-
const std::shared_ptr<CSSValue> &toValue,
|
|
46
|
-
const ValueInterpolationContext &context) const {
|
|
47
|
-
const auto &from = std::static_pointer_cast<ValueType>(fromValue);
|
|
48
|
-
const auto &to = std::static_pointer_cast<ValueType>(toValue);
|
|
49
|
-
return from->interpolate(progress, *to, context).toDynamic();
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
template class SimpleValueInterpolator<CSSLength>;
|
|
53
|
-
template class SimpleValueInterpolator<CSSLength, CSSKeyword>;
|
|
54
|
-
template class SimpleValueInterpolator<CSSDouble>;
|
|
55
|
-
template class SimpleValueInterpolator<CSSDouble, CSSKeyword>;
|
|
56
|
-
template class SimpleValueInterpolator<CSSInteger>;
|
|
57
|
-
template class SimpleValueInterpolator<CSSAngle>;
|
|
58
|
-
template class SimpleValueInterpolator<CSSColor>;
|
|
59
|
-
template class SimpleValueInterpolator<CSSBoolean>;
|
|
60
|
-
template class SimpleValueInterpolator<CSSDisplay>;
|
|
61
|
-
template class SimpleValueInterpolator<CSSKeyword>;
|
|
62
|
-
template class SimpleValueInterpolator<CSSBoxShadow>;
|
|
63
|
-
template class SimpleValueInterpolator<CSSDiscreteArray<CSSKeyword>>;
|
|
64
|
-
|
|
65
|
-
template class SimpleValueInterpolator<SVGLength>;
|
|
66
|
-
template class SimpleValueInterpolator<SVGLength, CSSKeyword>;
|
|
67
|
-
template class SimpleValueInterpolator<SVGStrokeDashArray, CSSKeyword>;
|
|
68
|
-
template class SimpleValueInterpolator<SVGBrush>;
|
|
69
|
-
|
|
70
|
-
} // namespace reanimated::css
|
|
1
|
+
#include <reanimated/CSS/interpolation/values/SimpleValueInterpolator.h>
|
|
2
|
+
|
|
3
|
+
#include <folly/dynamic.h>
|
|
4
|
+
#include <jsi/jsi.h>
|
|
5
|
+
|
|
6
|
+
#include <reanimated/CSS/common/values/CSSAngle.h>
|
|
7
|
+
#include <reanimated/CSS/common/values/CSSBoolean.h>
|
|
8
|
+
#include <reanimated/CSS/common/values/CSSColor.h>
|
|
9
|
+
#include <reanimated/CSS/common/values/CSSDiscreteArray.h>
|
|
10
|
+
#include <reanimated/CSS/common/values/CSSKeyword.h>
|
|
11
|
+
#include <reanimated/CSS/common/values/CSSLength.h>
|
|
12
|
+
#include <reanimated/CSS/common/values/CSSNumber.h>
|
|
13
|
+
#include <reanimated/CSS/common/values/complex/CSSBoxShadow.h>
|
|
14
|
+
#include <reanimated/CSS/svg/values/SVGBrush.h>
|
|
15
|
+
#include <reanimated/CSS/svg/values/SVGLength.h>
|
|
16
|
+
#include <reanimated/CSS/svg/values/SVGStrokeDashArray.h>
|
|
17
|
+
|
|
18
|
+
#include <memory>
|
|
19
|
+
|
|
20
|
+
namespace reanimated::css {
|
|
21
|
+
|
|
22
|
+
template <typename... AllowedTypes>
|
|
23
|
+
SimpleValueInterpolator<AllowedTypes...>::SimpleValueInterpolator(
|
|
24
|
+
const PropertyPath &propertyPath,
|
|
25
|
+
const ValueType &defaultStyleValue,
|
|
26
|
+
const std::shared_ptr<ViewStylesRepository> &viewStylesRepository)
|
|
27
|
+
: ValueInterpolator(propertyPath, std::make_shared<ValueType>(defaultStyleValue), viewStylesRepository) {}
|
|
28
|
+
|
|
29
|
+
template <typename... AllowedTypes>
|
|
30
|
+
std::shared_ptr<CSSValue> SimpleValueInterpolator<AllowedTypes...>::createValue(
|
|
31
|
+
jsi::Runtime &rt,
|
|
32
|
+
const jsi::Value &value) const {
|
|
33
|
+
return std::make_shared<ValueType>(rt, value);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
template <typename... AllowedTypes>
|
|
37
|
+
std::shared_ptr<CSSValue> SimpleValueInterpolator<AllowedTypes...>::createValue(const folly::dynamic &value) const {
|
|
38
|
+
return std::make_shared<ValueType>(value);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
template <typename... AllowedTypes>
|
|
42
|
+
folly::dynamic SimpleValueInterpolator<AllowedTypes...>::interpolateValue(
|
|
43
|
+
double progress,
|
|
44
|
+
const std::shared_ptr<CSSValue> &fromValue,
|
|
45
|
+
const std::shared_ptr<CSSValue> &toValue,
|
|
46
|
+
const ValueInterpolationContext &context) const {
|
|
47
|
+
const auto &from = std::static_pointer_cast<ValueType>(fromValue);
|
|
48
|
+
const auto &to = std::static_pointer_cast<ValueType>(toValue);
|
|
49
|
+
return from->interpolate(progress, *to, context).toDynamic();
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
template class SimpleValueInterpolator<CSSLength>;
|
|
53
|
+
template class SimpleValueInterpolator<CSSLength, CSSKeyword>;
|
|
54
|
+
template class SimpleValueInterpolator<CSSDouble>;
|
|
55
|
+
template class SimpleValueInterpolator<CSSDouble, CSSKeyword>;
|
|
56
|
+
template class SimpleValueInterpolator<CSSInteger>;
|
|
57
|
+
template class SimpleValueInterpolator<CSSAngle>;
|
|
58
|
+
template class SimpleValueInterpolator<CSSColor>;
|
|
59
|
+
template class SimpleValueInterpolator<CSSBoolean>;
|
|
60
|
+
template class SimpleValueInterpolator<CSSDisplay>;
|
|
61
|
+
template class SimpleValueInterpolator<CSSKeyword>;
|
|
62
|
+
template class SimpleValueInterpolator<CSSBoxShadow>;
|
|
63
|
+
template class SimpleValueInterpolator<CSSDiscreteArray<CSSKeyword>>;
|
|
64
|
+
|
|
65
|
+
template class SimpleValueInterpolator<SVGLength>;
|
|
66
|
+
template class SimpleValueInterpolator<SVGLength, CSSKeyword>;
|
|
67
|
+
template class SimpleValueInterpolator<SVGStrokeDashArray, CSSKeyword>;
|
|
68
|
+
template class SimpleValueInterpolator<SVGBrush>;
|
|
69
|
+
|
|
70
|
+
} // namespace reanimated::css
|
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
#pragma once
|
|
2
|
-
|
|
3
|
-
#include <reanimated/CSS/interpolation/values/ValueInterpolator.h>
|
|
4
|
-
|
|
5
|
-
#include <memory>
|
|
6
|
-
|
|
7
|
-
namespace reanimated::css {
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Concrete implementation of ValueInterpolator for simple CSS values that don't
|
|
11
|
-
* require resolution before interpolation. This class handles direct
|
|
12
|
-
* interpolation between values without any additional processing or resolution.
|
|
13
|
-
*/
|
|
14
|
-
template <typename... AllowedTypes>
|
|
15
|
-
class SimpleValueInterpolator : public ValueInterpolator {
|
|
16
|
-
static_assert(
|
|
17
|
-
(... && std::is_base_of<CSSValue, AllowedTypes>::value),
|
|
18
|
-
"[Reanimated] SimpleValueInterpolator: All interpolated types must inherit from CSSValue");
|
|
19
|
-
|
|
20
|
-
public:
|
|
21
|
-
using ValueType = CSSValueVariant<AllowedTypes...>;
|
|
22
|
-
|
|
23
|
-
explicit SimpleValueInterpolator(
|
|
24
|
-
const PropertyPath &propertyPath,
|
|
25
|
-
const ValueType &defaultStyleValue,
|
|
26
|
-
const std::shared_ptr<ViewStylesRepository> &viewStylesRepository);
|
|
27
|
-
|
|
28
|
-
protected:
|
|
29
|
-
std::shared_ptr<CSSValue> createValue(jsi::Runtime &rt, const jsi::Value &value) const override;
|
|
30
|
-
|
|
31
|
-
std::shared_ptr<CSSValue> createValue(const folly::dynamic &value) const override;
|
|
32
|
-
|
|
33
|
-
folly::dynamic interpolateValue(
|
|
34
|
-
double progress,
|
|
35
|
-
const std::shared_ptr<CSSValue> &fromValue,
|
|
36
|
-
const std::shared_ptr<CSSValue> &toValue,
|
|
37
|
-
const ValueInterpolationContext &context) const override;
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
} // namespace reanimated::css
|
|
1
|
+
#pragma once
|
|
2
|
+
|
|
3
|
+
#include <reanimated/CSS/interpolation/values/ValueInterpolator.h>
|
|
4
|
+
|
|
5
|
+
#include <memory>
|
|
6
|
+
|
|
7
|
+
namespace reanimated::css {
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Concrete implementation of ValueInterpolator for simple CSS values that don't
|
|
11
|
+
* require resolution before interpolation. This class handles direct
|
|
12
|
+
* interpolation between values without any additional processing or resolution.
|
|
13
|
+
*/
|
|
14
|
+
template <typename... AllowedTypes>
|
|
15
|
+
class SimpleValueInterpolator : public ValueInterpolator {
|
|
16
|
+
static_assert(
|
|
17
|
+
(... && std::is_base_of<CSSValue, AllowedTypes>::value),
|
|
18
|
+
"[Reanimated] SimpleValueInterpolator: All interpolated types must inherit from CSSValue");
|
|
19
|
+
|
|
20
|
+
public:
|
|
21
|
+
using ValueType = CSSValueVariant<AllowedTypes...>;
|
|
22
|
+
|
|
23
|
+
explicit SimpleValueInterpolator(
|
|
24
|
+
const PropertyPath &propertyPath,
|
|
25
|
+
const ValueType &defaultStyleValue,
|
|
26
|
+
const std::shared_ptr<ViewStylesRepository> &viewStylesRepository);
|
|
27
|
+
|
|
28
|
+
protected:
|
|
29
|
+
std::shared_ptr<CSSValue> createValue(jsi::Runtime &rt, const jsi::Value &value) const override;
|
|
30
|
+
|
|
31
|
+
std::shared_ptr<CSSValue> createValue(const folly::dynamic &value) const override;
|
|
32
|
+
|
|
33
|
+
folly::dynamic interpolateValue(
|
|
34
|
+
double progress,
|
|
35
|
+
const std::shared_ptr<CSSValue> &fromValue,
|
|
36
|
+
const std::shared_ptr<CSSValue> &toValue,
|
|
37
|
+
const ValueInterpolationContext &context) const override;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
} // namespace reanimated::css
|
|
@@ -1,146 +1,146 @@
|
|
|
1
|
-
#include <reanimated/CSS/interpolation/values/ValueInterpolator.h>
|
|
2
|
-
|
|
3
|
-
#include <memory>
|
|
4
|
-
#include <utility>
|
|
5
|
-
|
|
6
|
-
namespace reanimated::css {
|
|
7
|
-
|
|
8
|
-
ValueInterpolator::ValueInterpolator(
|
|
9
|
-
const PropertyPath &propertyPath,
|
|
10
|
-
const std::shared_ptr<CSSValue> &defaultValue,
|
|
11
|
-
const std::shared_ptr<ViewStylesRepository> &viewStylesRepository)
|
|
12
|
-
: PropertyInterpolator(propertyPath, viewStylesRepository),
|
|
13
|
-
defaultStyleValue_(defaultValue),
|
|
14
|
-
defaultStyleValueDynamic_(defaultValue->toDynamic()) {}
|
|
15
|
-
|
|
16
|
-
folly::dynamic ValueInterpolator::getStyleValue(const std::shared_ptr<const ShadowNode> &shadowNode) const {
|
|
17
|
-
return viewStylesRepository_->getStyleProp(shadowNode->getTag(), propertyPath_);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
folly::dynamic ValueInterpolator::getResetStyle(const std::shared_ptr<const ShadowNode> &shadowNode) const {
|
|
21
|
-
auto styleValue = getStyleValue(shadowNode);
|
|
22
|
-
|
|
23
|
-
if (styleValue.isNull()) {
|
|
24
|
-
return defaultStyleValueDynamic_;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
return styleValue;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
folly::dynamic ValueInterpolator::getFirstKeyframeValue() const {
|
|
31
|
-
return convertOptionalToDynamic(keyframes_.front().value);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
folly::dynamic ValueInterpolator::getLastKeyframeValue() const {
|
|
35
|
-
return convertOptionalToDynamic(keyframes_.back().value);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
bool ValueInterpolator::equalsReversingAdjustedStartValue(const folly::dynamic &propertyValue) const {
|
|
39
|
-
if (reversingAdjustedStartValue_.isNull()) {
|
|
40
|
-
return propertyValue.isNull();
|
|
41
|
-
}
|
|
42
|
-
return reversingAdjustedStartValue_ == propertyValue;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
void ValueInterpolator::updateKeyframes(jsi::Runtime &rt, const jsi::Value &keyframes) {
|
|
46
|
-
const auto parsedKeyframes = parseJSIKeyframes(rt, keyframes);
|
|
47
|
-
|
|
48
|
-
keyframes_.clear();
|
|
49
|
-
keyframes_.reserve(parsedKeyframes.size());
|
|
50
|
-
|
|
51
|
-
for (const auto &[offset, value] : parsedKeyframes) {
|
|
52
|
-
if (value.isUndefined()) {
|
|
53
|
-
keyframes_.emplace_back(offset, std::nullopt);
|
|
54
|
-
} else {
|
|
55
|
-
keyframes_.emplace_back(offset, std::make_optional(createValue(rt, value)));
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
void ValueInterpolator::updateKeyframesFromStyleChange(
|
|
61
|
-
const folly::dynamic &oldStyleValue,
|
|
62
|
-
const folly::dynamic &newStyleValue,
|
|
63
|
-
const folly::dynamic &lastUpdateValue) {
|
|
64
|
-
ValueKeyframe firstKeyframe, lastKeyframe;
|
|
65
|
-
|
|
66
|
-
if (!lastUpdateValue.isNull()) {
|
|
67
|
-
firstKeyframe = ValueKeyframe{0, createValue(lastUpdateValue)};
|
|
68
|
-
} else if (!oldStyleValue.isNull()) {
|
|
69
|
-
firstKeyframe = ValueKeyframe{0, createValue(oldStyleValue)};
|
|
70
|
-
} else {
|
|
71
|
-
firstKeyframe = ValueKeyframe{0, defaultStyleValue_};
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
if (newStyleValue.isNull()) {
|
|
75
|
-
lastKeyframe = ValueKeyframe{1, defaultStyleValue_};
|
|
76
|
-
} else {
|
|
77
|
-
lastKeyframe = ValueKeyframe{1, createValue(newStyleValue)};
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
keyframes_ = {std::move(firstKeyframe), std::move(lastKeyframe)};
|
|
81
|
-
reversingAdjustedStartValue_ = oldStyleValue;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
folly::dynamic ValueInterpolator::interpolate(
|
|
85
|
-
const std::shared_ptr<const ShadowNode> &shadowNode,
|
|
86
|
-
const std::shared_ptr<KeyframeProgressProvider> &progressProvider,
|
|
87
|
-
const double fallbackInterpolateThreshold) const {
|
|
88
|
-
const auto toIndex = getToKeyframeIndex(progressProvider);
|
|
89
|
-
const auto fromIndex = toIndex - 1;
|
|
90
|
-
|
|
91
|
-
const auto &fromKeyframe = keyframes_[fromIndex];
|
|
92
|
-
const auto &toKeyframe = keyframes_[toIndex];
|
|
93
|
-
|
|
94
|
-
// clang-format off
|
|
95
|
-
const auto &fromValue = fromKeyframe.value
|
|
96
|
-
? fromKeyframe.value.value()
|
|
97
|
-
: getFallbackValue(shadowNode);
|
|
98
|
-
const auto &toValue = toKeyframe.value
|
|
99
|
-
? toKeyframe.value.value()
|
|
100
|
-
: getFallbackValue(shadowNode);
|
|
101
|
-
// clang-format on
|
|
102
|
-
|
|
103
|
-
const auto keyframeProgress = progressProvider->getKeyframeProgress(fromKeyframe.offset, toKeyframe.offset);
|
|
104
|
-
|
|
105
|
-
if (keyframeProgress == 1.0) {
|
|
106
|
-
return toValue->toDynamic();
|
|
107
|
-
}
|
|
108
|
-
if (keyframeProgress == 0.0) {
|
|
109
|
-
return fromValue->toDynamic();
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
return interpolateValue(
|
|
113
|
-
keyframeProgress,
|
|
114
|
-
fromValue,
|
|
115
|
-
toValue,
|
|
116
|
-
{.node = shadowNode, .fallbackInterpolateThreshold = fallbackInterpolateThreshold});
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
folly::dynamic ValueInterpolator::convertOptionalToDynamic(
|
|
120
|
-
const std::optional<std::shared_ptr<CSSValue>> &value) const {
|
|
121
|
-
return value ? value.value()->toDynamic() : folly::dynamic();
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
std::shared_ptr<CSSValue> ValueInterpolator::getFallbackValue(
|
|
125
|
-
const std::shared_ptr<const ShadowNode> &shadowNode) const {
|
|
126
|
-
const auto styleValue = getStyleValue(shadowNode);
|
|
127
|
-
return styleValue.isNull() ? defaultStyleValue_ : createValue(styleValue);
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
size_t ValueInterpolator::getToKeyframeIndex(const std::shared_ptr<KeyframeProgressProvider> &progressProvider) const {
|
|
131
|
-
const auto progress = progressProvider->getGlobalProgress();
|
|
132
|
-
|
|
133
|
-
const auto it = std::upper_bound(
|
|
134
|
-
keyframes_.begin(), keyframes_.end(), progress, [](double progress, const ValueKeyframe &keyframe) {
|
|
135
|
-
return progress < keyframe.offset;
|
|
136
|
-
});
|
|
137
|
-
|
|
138
|
-
// If we're at the end, return the last valid keyframe index
|
|
139
|
-
if (it == keyframes_.end()) {
|
|
140
|
-
return keyframes_.size() - 1;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
return std::distance(keyframes_.begin(), it);
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
} // namespace reanimated::css
|
|
1
|
+
#include <reanimated/CSS/interpolation/values/ValueInterpolator.h>
|
|
2
|
+
|
|
3
|
+
#include <memory>
|
|
4
|
+
#include <utility>
|
|
5
|
+
|
|
6
|
+
namespace reanimated::css {
|
|
7
|
+
|
|
8
|
+
ValueInterpolator::ValueInterpolator(
|
|
9
|
+
const PropertyPath &propertyPath,
|
|
10
|
+
const std::shared_ptr<CSSValue> &defaultValue,
|
|
11
|
+
const std::shared_ptr<ViewStylesRepository> &viewStylesRepository)
|
|
12
|
+
: PropertyInterpolator(propertyPath, viewStylesRepository),
|
|
13
|
+
defaultStyleValue_(defaultValue),
|
|
14
|
+
defaultStyleValueDynamic_(defaultValue->toDynamic()) {}
|
|
15
|
+
|
|
16
|
+
folly::dynamic ValueInterpolator::getStyleValue(const std::shared_ptr<const ShadowNode> &shadowNode) const {
|
|
17
|
+
return viewStylesRepository_->getStyleProp(shadowNode->getTag(), propertyPath_);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
folly::dynamic ValueInterpolator::getResetStyle(const std::shared_ptr<const ShadowNode> &shadowNode) const {
|
|
21
|
+
auto styleValue = getStyleValue(shadowNode);
|
|
22
|
+
|
|
23
|
+
if (styleValue.isNull()) {
|
|
24
|
+
return defaultStyleValueDynamic_;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return styleValue;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
folly::dynamic ValueInterpolator::getFirstKeyframeValue() const {
|
|
31
|
+
return convertOptionalToDynamic(keyframes_.front().value);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
folly::dynamic ValueInterpolator::getLastKeyframeValue() const {
|
|
35
|
+
return convertOptionalToDynamic(keyframes_.back().value);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
bool ValueInterpolator::equalsReversingAdjustedStartValue(const folly::dynamic &propertyValue) const {
|
|
39
|
+
if (reversingAdjustedStartValue_.isNull()) {
|
|
40
|
+
return propertyValue.isNull();
|
|
41
|
+
}
|
|
42
|
+
return reversingAdjustedStartValue_ == propertyValue;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
void ValueInterpolator::updateKeyframes(jsi::Runtime &rt, const jsi::Value &keyframes) {
|
|
46
|
+
const auto parsedKeyframes = parseJSIKeyframes(rt, keyframes);
|
|
47
|
+
|
|
48
|
+
keyframes_.clear();
|
|
49
|
+
keyframes_.reserve(parsedKeyframes.size());
|
|
50
|
+
|
|
51
|
+
for (const auto &[offset, value] : parsedKeyframes) {
|
|
52
|
+
if (value.isUndefined()) {
|
|
53
|
+
keyframes_.emplace_back(offset, std::nullopt);
|
|
54
|
+
} else {
|
|
55
|
+
keyframes_.emplace_back(offset, std::make_optional(createValue(rt, value)));
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
void ValueInterpolator::updateKeyframesFromStyleChange(
|
|
61
|
+
const folly::dynamic &oldStyleValue,
|
|
62
|
+
const folly::dynamic &newStyleValue,
|
|
63
|
+
const folly::dynamic &lastUpdateValue) {
|
|
64
|
+
ValueKeyframe firstKeyframe, lastKeyframe;
|
|
65
|
+
|
|
66
|
+
if (!lastUpdateValue.isNull()) {
|
|
67
|
+
firstKeyframe = ValueKeyframe{0, createValue(lastUpdateValue)};
|
|
68
|
+
} else if (!oldStyleValue.isNull()) {
|
|
69
|
+
firstKeyframe = ValueKeyframe{0, createValue(oldStyleValue)};
|
|
70
|
+
} else {
|
|
71
|
+
firstKeyframe = ValueKeyframe{0, defaultStyleValue_};
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
if (newStyleValue.isNull()) {
|
|
75
|
+
lastKeyframe = ValueKeyframe{1, defaultStyleValue_};
|
|
76
|
+
} else {
|
|
77
|
+
lastKeyframe = ValueKeyframe{1, createValue(newStyleValue)};
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
keyframes_ = {std::move(firstKeyframe), std::move(lastKeyframe)};
|
|
81
|
+
reversingAdjustedStartValue_ = oldStyleValue;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
folly::dynamic ValueInterpolator::interpolate(
|
|
85
|
+
const std::shared_ptr<const ShadowNode> &shadowNode,
|
|
86
|
+
const std::shared_ptr<KeyframeProgressProvider> &progressProvider,
|
|
87
|
+
const double fallbackInterpolateThreshold) const {
|
|
88
|
+
const auto toIndex = getToKeyframeIndex(progressProvider);
|
|
89
|
+
const auto fromIndex = toIndex - 1;
|
|
90
|
+
|
|
91
|
+
const auto &fromKeyframe = keyframes_[fromIndex];
|
|
92
|
+
const auto &toKeyframe = keyframes_[toIndex];
|
|
93
|
+
|
|
94
|
+
// clang-format off
|
|
95
|
+
const auto &fromValue = fromKeyframe.value
|
|
96
|
+
? fromKeyframe.value.value()
|
|
97
|
+
: getFallbackValue(shadowNode);
|
|
98
|
+
const auto &toValue = toKeyframe.value
|
|
99
|
+
? toKeyframe.value.value()
|
|
100
|
+
: getFallbackValue(shadowNode);
|
|
101
|
+
// clang-format on
|
|
102
|
+
|
|
103
|
+
const auto keyframeProgress = progressProvider->getKeyframeProgress(fromKeyframe.offset, toKeyframe.offset);
|
|
104
|
+
|
|
105
|
+
if (keyframeProgress == 1.0) {
|
|
106
|
+
return toValue->toDynamic();
|
|
107
|
+
}
|
|
108
|
+
if (keyframeProgress == 0.0) {
|
|
109
|
+
return fromValue->toDynamic();
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
return interpolateValue(
|
|
113
|
+
keyframeProgress,
|
|
114
|
+
fromValue,
|
|
115
|
+
toValue,
|
|
116
|
+
{.node = shadowNode, .fallbackInterpolateThreshold = fallbackInterpolateThreshold});
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
folly::dynamic ValueInterpolator::convertOptionalToDynamic(
|
|
120
|
+
const std::optional<std::shared_ptr<CSSValue>> &value) const {
|
|
121
|
+
return value ? value.value()->toDynamic() : folly::dynamic();
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
std::shared_ptr<CSSValue> ValueInterpolator::getFallbackValue(
|
|
125
|
+
const std::shared_ptr<const ShadowNode> &shadowNode) const {
|
|
126
|
+
const auto styleValue = getStyleValue(shadowNode);
|
|
127
|
+
return styleValue.isNull() ? defaultStyleValue_ : createValue(styleValue);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
size_t ValueInterpolator::getToKeyframeIndex(const std::shared_ptr<KeyframeProgressProvider> &progressProvider) const {
|
|
131
|
+
const auto progress = progressProvider->getGlobalProgress();
|
|
132
|
+
|
|
133
|
+
const auto it = std::upper_bound(
|
|
134
|
+
keyframes_.begin(), keyframes_.end(), progress, [](double progress, const ValueKeyframe &keyframe) {
|
|
135
|
+
return progress < keyframe.offset;
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
// If we're at the end, return the last valid keyframe index
|
|
139
|
+
if (it == keyframes_.end()) {
|
|
140
|
+
return keyframes_.size() - 1;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
return std::distance(keyframes_.begin(), it);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
} // namespace reanimated::css
|
|
@@ -1,71 +1,71 @@
|
|
|
1
|
-
#pragma once
|
|
2
|
-
|
|
3
|
-
#include <reanimated/CSS/common/values/CSSValueVariant.h>
|
|
4
|
-
#include <reanimated/CSS/interpolation/PropertyInterpolator.h>
|
|
5
|
-
|
|
6
|
-
#include <memory>
|
|
7
|
-
#include <optional>
|
|
8
|
-
#include <vector>
|
|
9
|
-
|
|
10
|
-
namespace reanimated::css {
|
|
11
|
-
|
|
12
|
-
struct ValueKeyframe {
|
|
13
|
-
double offset;
|
|
14
|
-
std::optional<std::shared_ptr<CSSValue>> value;
|
|
15
|
-
ValueKeyframe() : offset(0.0), value(std::nullopt) {}
|
|
16
|
-
ValueKeyframe(double offset, std::optional<std::shared_ptr<CSSValue>> value = std::nullopt)
|
|
17
|
-
: offset(offset), value(std::move(value)) {}
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Base class for CSS value interpolators that provides common functionality
|
|
22
|
-
* for interpolating CSS values during animations. This class should be extended
|
|
23
|
-
* by concrete implementations for specific CSS value types to provide
|
|
24
|
-
* type-specific interpolation logic.
|
|
25
|
-
*/
|
|
26
|
-
class ValueInterpolator : public PropertyInterpolator {
|
|
27
|
-
public:
|
|
28
|
-
explicit ValueInterpolator(
|
|
29
|
-
const PropertyPath &propertyPath,
|
|
30
|
-
const std::shared_ptr<CSSValue> &defaultValue,
|
|
31
|
-
const std::shared_ptr<ViewStylesRepository> &viewStylesRepository);
|
|
32
|
-
virtual ~ValueInterpolator() = default;
|
|
33
|
-
|
|
34
|
-
folly::dynamic getStyleValue(const std::shared_ptr<const ShadowNode> &shadowNode) const override;
|
|
35
|
-
folly::dynamic getResetStyle(const std::shared_ptr<const ShadowNode> &shadowNode) const override;
|
|
36
|
-
folly::dynamic getFirstKeyframeValue() const override;
|
|
37
|
-
folly::dynamic getLastKeyframeValue() const override;
|
|
38
|
-
bool equalsReversingAdjustedStartValue(const folly::dynamic &propertyValue) const override;
|
|
39
|
-
|
|
40
|
-
void updateKeyframes(jsi::Runtime &rt, const jsi::Value &keyframes) override;
|
|
41
|
-
void updateKeyframesFromStyleChange(
|
|
42
|
-
const folly::dynamic &oldStyleValue,
|
|
43
|
-
const folly::dynamic &newStyleValue,
|
|
44
|
-
const folly::dynamic &lastUpdateValue) override;
|
|
45
|
-
|
|
46
|
-
folly::dynamic interpolate(
|
|
47
|
-
const std::shared_ptr<const ShadowNode> &shadowNode,
|
|
48
|
-
const std::shared_ptr<KeyframeProgressProvider> &progressProvider,
|
|
49
|
-
double fallbackInterpolateThreshold) const override;
|
|
50
|
-
|
|
51
|
-
protected:
|
|
52
|
-
std::vector<ValueKeyframe> keyframes_;
|
|
53
|
-
std::shared_ptr<CSSValue> defaultStyleValue_;
|
|
54
|
-
folly::dynamic defaultStyleValueDynamic_;
|
|
55
|
-
folly::dynamic reversingAdjustedStartValue_;
|
|
56
|
-
|
|
57
|
-
virtual std::shared_ptr<CSSValue> createValue(jsi::Runtime &rt, const jsi::Value &value) const = 0;
|
|
58
|
-
virtual std::shared_ptr<CSSValue> createValue(const folly::dynamic &value) const = 0;
|
|
59
|
-
virtual folly::dynamic interpolateValue(
|
|
60
|
-
double progress,
|
|
61
|
-
const std::shared_ptr<CSSValue> &fromValue,
|
|
62
|
-
const std::shared_ptr<CSSValue> &toValue,
|
|
63
|
-
const ValueInterpolationContext &context) const = 0;
|
|
64
|
-
|
|
65
|
-
private:
|
|
66
|
-
folly::dynamic convertOptionalToDynamic(const std::optional<std::shared_ptr<CSSValue>> &value) const;
|
|
67
|
-
std::shared_ptr<CSSValue> getFallbackValue(const std::shared_ptr<const ShadowNode> &shadowNode) const;
|
|
68
|
-
size_t getToKeyframeIndex(const std::shared_ptr<KeyframeProgressProvider> &progressProvider) const;
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
} // namespace reanimated::css
|
|
1
|
+
#pragma once
|
|
2
|
+
|
|
3
|
+
#include <reanimated/CSS/common/values/CSSValueVariant.h>
|
|
4
|
+
#include <reanimated/CSS/interpolation/PropertyInterpolator.h>
|
|
5
|
+
|
|
6
|
+
#include <memory>
|
|
7
|
+
#include <optional>
|
|
8
|
+
#include <vector>
|
|
9
|
+
|
|
10
|
+
namespace reanimated::css {
|
|
11
|
+
|
|
12
|
+
struct ValueKeyframe {
|
|
13
|
+
double offset;
|
|
14
|
+
std::optional<std::shared_ptr<CSSValue>> value;
|
|
15
|
+
ValueKeyframe() : offset(0.0), value(std::nullopt) {}
|
|
16
|
+
ValueKeyframe(double offset, std::optional<std::shared_ptr<CSSValue>> value = std::nullopt)
|
|
17
|
+
: offset(offset), value(std::move(value)) {}
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Base class for CSS value interpolators that provides common functionality
|
|
22
|
+
* for interpolating CSS values during animations. This class should be extended
|
|
23
|
+
* by concrete implementations for specific CSS value types to provide
|
|
24
|
+
* type-specific interpolation logic.
|
|
25
|
+
*/
|
|
26
|
+
class ValueInterpolator : public PropertyInterpolator {
|
|
27
|
+
public:
|
|
28
|
+
explicit ValueInterpolator(
|
|
29
|
+
const PropertyPath &propertyPath,
|
|
30
|
+
const std::shared_ptr<CSSValue> &defaultValue,
|
|
31
|
+
const std::shared_ptr<ViewStylesRepository> &viewStylesRepository);
|
|
32
|
+
virtual ~ValueInterpolator() = default;
|
|
33
|
+
|
|
34
|
+
folly::dynamic getStyleValue(const std::shared_ptr<const ShadowNode> &shadowNode) const override;
|
|
35
|
+
folly::dynamic getResetStyle(const std::shared_ptr<const ShadowNode> &shadowNode) const override;
|
|
36
|
+
folly::dynamic getFirstKeyframeValue() const override;
|
|
37
|
+
folly::dynamic getLastKeyframeValue() const override;
|
|
38
|
+
bool equalsReversingAdjustedStartValue(const folly::dynamic &propertyValue) const override;
|
|
39
|
+
|
|
40
|
+
void updateKeyframes(jsi::Runtime &rt, const jsi::Value &keyframes) override;
|
|
41
|
+
void updateKeyframesFromStyleChange(
|
|
42
|
+
const folly::dynamic &oldStyleValue,
|
|
43
|
+
const folly::dynamic &newStyleValue,
|
|
44
|
+
const folly::dynamic &lastUpdateValue) override;
|
|
45
|
+
|
|
46
|
+
folly::dynamic interpolate(
|
|
47
|
+
const std::shared_ptr<const ShadowNode> &shadowNode,
|
|
48
|
+
const std::shared_ptr<KeyframeProgressProvider> &progressProvider,
|
|
49
|
+
double fallbackInterpolateThreshold) const override;
|
|
50
|
+
|
|
51
|
+
protected:
|
|
52
|
+
std::vector<ValueKeyframe> keyframes_;
|
|
53
|
+
std::shared_ptr<CSSValue> defaultStyleValue_;
|
|
54
|
+
folly::dynamic defaultStyleValueDynamic_;
|
|
55
|
+
folly::dynamic reversingAdjustedStartValue_;
|
|
56
|
+
|
|
57
|
+
virtual std::shared_ptr<CSSValue> createValue(jsi::Runtime &rt, const jsi::Value &value) const = 0;
|
|
58
|
+
virtual std::shared_ptr<CSSValue> createValue(const folly::dynamic &value) const = 0;
|
|
59
|
+
virtual folly::dynamic interpolateValue(
|
|
60
|
+
double progress,
|
|
61
|
+
const std::shared_ptr<CSSValue> &fromValue,
|
|
62
|
+
const std::shared_ptr<CSSValue> &toValue,
|
|
63
|
+
const ValueInterpolationContext &context) const = 0;
|
|
64
|
+
|
|
65
|
+
private:
|
|
66
|
+
folly::dynamic convertOptionalToDynamic(const std::optional<std::shared_ptr<CSSValue>> &value) const;
|
|
67
|
+
std::shared_ptr<CSSValue> getFallbackValue(const std::shared_ptr<const ShadowNode> &shadowNode) const;
|
|
68
|
+
size_t getToKeyframeIndex(const std::shared_ptr<KeyframeProgressProvider> &progressProvider) const;
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
} // namespace reanimated::css
|