@react-native-ohos/react-native-reanimated 4.0.2 → 4.1.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1070 -0
- package/LICENSE +21 -0
- package/README.md +842 -0
- package/compatibility.json +20 -26
- package/harmony/reanimated/BuildProfile.ets +1 -1
- package/harmony/reanimated/index.ets +4 -2
- package/harmony/reanimated/oh-package-lock.json5 +1 -1
- package/harmony/reanimated/oh-package.json5 +1 -1
- package/harmony/reanimated/src/main/cpp/CMakeLists.txt +23 -6
- package/harmony/reanimated/src/main/cpp/Common/NativeView/CMakeLists.txt +56 -0
- package/harmony/reanimated/src/main/cpp/Common/NativeView/react/renderer/components/rnreanimated/ComponentDescriptors.h +19 -0
- package/harmony/reanimated/src/main/cpp/Common/NativeView/react/renderer/components/rnreanimated/REASharedTransitionBoundaryComponentDescriptor.h +30 -0
- package/harmony/reanimated/src/main/cpp/Common/NativeView/react/renderer/components/rnreanimated/REASharedTransitionBoundaryShadowNode.cpp +15 -0
- package/harmony/reanimated/src/main/cpp/Common/NativeView/react/renderer/components/rnreanimated/REASharedTransitionBoundaryShadowNode.h +41 -0
- package/harmony/reanimated/src/main/cpp/Common/NativeView/react/renderer/components/rnreanimated/REASharedTransitionBoundaryState.h +30 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/AnimatedSensor/AnimatedSensorModule.cpp +8 -9
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/AnimatedSensor/AnimatedSensorModule.h +3 -6
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/InterpolatorRegistry.cpp +203 -150
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/InterpolatorRegistry.h +1 -6
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/definitions.h +2 -7
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSAngle.cpp +0 -1
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSColor.cpp +2 -18
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSDiscreteArray.cpp +11 -11
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSDiscreteArray.h +2 -6
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSLength.cpp +4 -1
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSNumber.cpp +5 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSNumber.h +8 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSValue.h +27 -46
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSValueVariant.cpp +20 -20
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSValueVariant.h +2 -2
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/complex/CSSDropShadow.h +3 -3
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/configs/CSSAnimationConfig.cpp +10 -2
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/configs/CSSAnimationConfig.h +5 -3
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/configs/CSSKeyframesConfig.cpp +20 -17
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/configs/CSSKeyframesConfig.h +5 -8
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/configs/CSSTransitionConfig.cpp +33 -66
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/configs/CSSTransitionConfig.h +29 -22
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/configs/common.cpp +14 -2
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/configs/common.h +8 -2
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/core/CSSAnimation.cpp +50 -91
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/core/CSSAnimation.h +43 -18
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/core/CSSAnimationsGroup.cpp +63 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/core/CSSAnimationsGroup.h +37 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/core/CSSLoopAnimation.cpp +100 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/core/CSSLoopAnimation.h +49 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/core/CSSPlatformAnimation.h +13 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/core/CSSPlatformAnimationFactory.h +32 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/core/transition/CSSLoopTransition.cpp +156 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/core/transition/CSSLoopTransition.h +71 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/core/transition/CSSPlatformTransitionProxy.cpp +141 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/core/transition/CSSPlatformTransitionProxy.h +104 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/core/transition/CSSTransition.cpp +97 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/core/transition/CSSTransition.h +69 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/easing/EasingConfigs.cpp +89 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/easing/EasingConfigs.h +36 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/InterpolatorFactory.cpp +12 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/InterpolatorFactory.h +11 -2
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/PropertyInterpolator.cpp +2 -3
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/PropertyInterpolator.h +3 -5
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/FilterOperation.cpp +3 -3
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/FilterOperation.h +1 -1
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/groups/ArrayPropertiesInterpolator.cpp +38 -37
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/groups/ArrayPropertiesInterpolator.h +3 -6
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/groups/RecordPropertiesInterpolator.cpp +54 -32
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/groups/RecordPropertiesInterpolator.h +5 -7
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/operations/OperationsStyleInterpolator.cpp +46 -46
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/operations/OperationsStyleInterpolator.h +8 -7
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/operations/StyleOperation.h +4 -57
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/styles/AnimationStyleInterpolator.cpp +23 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/styles/AnimationStyleInterpolator.h +10 -8
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/styles/AnimationStyleInterpolatorFactory.cpp +77 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/styles/AnimationStyleInterpolatorFactory.h +38 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/styles/TransitionStyleInterpolator.cpp +47 -68
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/styles/TransitionStyleInterpolator.h +21 -9
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/TransformOperation.cpp +4 -1
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/TransformOperationInterpolator.cpp +35 -78
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/TransformOperationInterpolator.h +44 -13
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/operations/matrix.cpp +13 -11
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/values/ResolvableValueInterpolator.cpp +4 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/values/SimpleValueInterpolator.cpp +7 -3
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/values/ValueInterpolator.cpp +20 -27
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/values/ValueInterpolator.h +12 -9
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/misc/ViewStylesRepository.cpp +63 -36
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/misc/ViewStylesRepository.h +6 -8
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/progress/AnimationProgressProvider.cpp +55 -46
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/progress/AnimationProgressProvider.h +8 -5
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/progress/RawProgressProvider.cpp +1 -2
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/progress/RawProgressProvider.h +3 -2
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/progress/TransitionProgressProvider.cpp +76 -71
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/progress/TransitionProgressProvider.h +17 -14
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/registries/CSSAnimationsRegistry.cpp +145 -273
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/registries/CSSAnimationsRegistry.h +43 -44
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/registries/CSSKeyframesRegistry.cpp +19 -19
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/registries/CSSKeyframesRegistry.h +16 -12
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/registries/CSSTransitionsRegistry.cpp +95 -114
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/registries/CSSTransitionsRegistry.h +38 -25
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/registries/StaticPropsRegistry.cpp +9 -34
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/registries/StaticPropsRegistry.h +0 -10
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/svg/values/CSSLengthArray.cpp +47 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/svg/values/CSSLengthArray.h +24 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/svg/values/CSSLengthVector.cpp +87 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/svg/values/CSSLengthVector.h +28 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/svg/values/SVGPath.cpp +326 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/svg/values/SVGPath.h +65 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/svg/values/SVGStops.cpp +164 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/svg/values/SVGStops.h +51 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/svg/values/SVGStrokeDashArray.cpp +14 -66
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/svg/values/SVGStrokeDashArray.h +7 -18
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/utils/platform.cpp +284 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/utils/platform.h +31 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/utils/props.cpp +13 -132
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/utils/props.h +3 -21
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/utils/reversingShortening.h +43 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Compat/WorkletsApi.h +13 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Events/UIEventHandler.cpp +33 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Events/UIEventHandler.h +39 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Events/UIEventHandlerRegistry.cpp +95 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Events/UIEventHandlerRegistry.h +40 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/ReanimatedCommitHook.cpp +20 -23
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/ReanimatedCommitHook.h +2 -6
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/ReanimatedMountHook.cpp +26 -18
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/ReanimatedMountHook.h +4 -8
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/ShadowTreeCloner.cpp +16 -28
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/ShadowTreeCloner.h +3 -4
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/updates/AnimatedPropsRegistry.cpp +72 -24
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/updates/AnimatedPropsRegistry.h +17 -7
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/updates/OperationsLoop.cpp +152 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/updates/OperationsLoop.h +86 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/updates/PropsLayoutFilter.h +98 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/updates/UpdatesRegistry.cpp +162 -28
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/updates/UpdatesRegistry.h +69 -11
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/updates/UpdatesRegistryManager.cpp +41 -17
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/updates/UpdatesRegistryManager.h +14 -3
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/updates/propNameFromString.h +130 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsManager.cpp +1 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsManager.h +5 -7
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxyCommon.cpp +7 -4
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxyCommon.h +52 -9
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxy_Experimental.cpp +174 -62
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxy_Experimental.h +12 -11
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxy_Legacy.cpp +251 -128
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxy_Legacy.h +23 -19
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsUtils.h +34 -6
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/SharedTransitions.cpp +71 -64
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/NativeModules/ReanimatedModuleProxy.cpp +938 -700
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/NativeModules/ReanimatedModuleProxy.h +123 -76
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/NativeModules/SynchronousPropsBufferSerializer.cpp +313 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/NativeModules/SynchronousPropsBufferSerializer.h +18 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/PseudoStyles/PseudoSelector.h +41 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/PseudoStyles/PseudoStylesRegistry.cpp +113 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/PseudoStyles/PseudoStylesRegistry.h +73 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/RuntimeDecorators/RNRuntimeDecorator.cpp +4 -4
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/RuntimeDecorators/UIRuntimeDecorator.cpp +23 -48
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/RuntimeDecorators/UIRuntimeDecorator.h +13 -14
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Tools/PlatformDepMethodsHolder.h +20 -3
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Tools/ReaJSIUtils.h +227 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Tools/ReanimatedVersion.cpp +51 -14
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Tools/ReanimatedVersion.h +2 -5
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Tools/SingleInstanceChecker.h +76 -0
- package/harmony/reanimated/src/main/cpp/OHOSCSSPlatformTransitions.cpp +353 -0
- package/harmony/reanimated/src/main/cpp/OHOSCSSPlatformTransitions.h +95 -0
- package/harmony/reanimated/src/main/cpp/PseudoSelectorManager.cpp +140 -0
- package/harmony/reanimated/src/main/cpp/PseudoSelectorManager.h +52 -0
- package/harmony/reanimated/src/main/cpp/REASharedTransitionBoundaryComponentInstance.cpp +45 -0
- package/harmony/reanimated/src/main/cpp/REASharedTransitionBoundaryComponentInstance.h +33 -0
- package/harmony/reanimated/src/main/cpp/REASharedTransitionBoundaryJSIBinder.h +20 -0
- package/harmony/reanimated/src/main/cpp/ReanimatedModule.cpp +98 -18
- package/harmony/reanimated/src/main/cpp/ReanimatedModule.h +4 -2
- package/harmony/reanimated/src/main/cpp/ReanimatedNodesManager.cpp +1 -1
- package/harmony/reanimated/src/main/cpp/ReanimatedNodesManager.h +1 -1
- package/harmony/reanimated/src/main/cpp/ReanimatedPackage.cpp +24 -1
- package/harmony/reanimated/src/main/cpp/ReanimatedPackage.h +7 -2
- package/harmony/reanimated/src/main/cpp/ReanimatedSensor.cpp +88 -57
- package/harmony/reanimated/src/main/cpp/ReanimatedSensor.h +4 -2
- package/harmony/reanimated/src/main/cpp/ReanimatedSensorContainer.cpp +1 -1
- package/harmony/reanimated/src/main/cpp/ReanimatedSensorContainer.h +1 -1
- package/harmony/reanimated/src/main/cpp/ReanimatedUIScheduler.cpp +9 -7
- package/harmony/reanimated/src/main/cpp/ReanimatedUIScheduler.h +6 -5
- package/harmony/reanimated/src/main/cpp/TransformParser.h +1 -1
- package/harmony/reanimated/src/main/cpp/codegen/react/renderer/components/rnreanimated/EventEmitters.h +19 -0
- package/harmony/reanimated/src/main/cpp/codegen/react/renderer/components/rnreanimated/Props.h +31 -0
- package/harmony/reanimated/src/main/ets/KeyboardState.ts +11 -0
- package/harmony/reanimated/src/main/ets/ReanimatedModule.ts +106 -17
- package/harmony/reanimated/src/main/ets/{ReanimatedPackage.ts → ReanimatedPackage.ets} +4 -3
- package/harmony/reanimated.har +0 -0
- package/package.json +52 -24
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/core/CSSTransition.cpp +0 -145
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/core/CSSTransition.h +0 -47
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/svg/values/SVGLength.cpp +0 -93
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/svg/values/SVGLength.h +0 -36
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/utils/DelayedItemsManager.cpp +0 -75
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/utils/DelayedItemsManager.h +0 -45
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/NativeModules/ReanimatedModuleProxySpec.cpp +0 -183
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/NativeModules/ReanimatedModuleProxySpec.h +0 -93
- package/harmony/reanimated/src/main/ets/AnimationManager.ts +0 -61
- /package/harmony/reanimated/{ts.ts → ts.ets} +0 -0
|
@@ -13,8 +13,10 @@
|
|
|
13
13
|
#include <reanimated/CSS/common/transforms/TransformMatrix2D.h>
|
|
14
14
|
#include <reanimated/CSS/common/values/complex/CSSBoxShadow.h>
|
|
15
15
|
|
|
16
|
+
#include <reanimated/CSS/svg/values/CSSLengthArray.h>
|
|
16
17
|
#include <reanimated/CSS/svg/values/SVGBrush.h>
|
|
17
|
-
#include <reanimated/CSS/svg/values/
|
|
18
|
+
#include <reanimated/CSS/svg/values/SVGPath.h>
|
|
19
|
+
#include <reanimated/CSS/svg/values/SVGStops.h>
|
|
18
20
|
#include <reanimated/CSS/svg/values/SVGStrokeDashArray.h>
|
|
19
21
|
|
|
20
22
|
#include <reanimated/CSS/interpolation/InterpolatorFactory.h>
|
|
@@ -39,12 +41,15 @@
|
|
|
39
41
|
|
|
40
42
|
#include <limits>
|
|
41
43
|
#include <string>
|
|
44
|
+
#include <unordered_map>
|
|
42
45
|
#include <vector>
|
|
43
46
|
|
|
44
47
|
namespace reanimated::css {
|
|
45
48
|
|
|
46
49
|
namespace {
|
|
47
50
|
|
|
51
|
+
using ComponentInterpolatorsMap = std::unordered_map<std::string, InterpolatorFactoriesRecord>;
|
|
52
|
+
|
|
48
53
|
// Private implementation details
|
|
49
54
|
const std::array<uint8_t, 4> BLACK = {0, 0, 0, 255};
|
|
50
55
|
const std::array<uint8_t, 4> TRANSPARENT = {0, 0, 0, 0};
|
|
@@ -61,7 +66,8 @@ InterpolatorFactoriesRecord mergeInterpolators(const std::vector<InterpolatorFac
|
|
|
61
66
|
// React Native Interpolators
|
|
62
67
|
// ==========================
|
|
63
68
|
|
|
64
|
-
const InterpolatorFactoriesRecord
|
|
69
|
+
const InterpolatorFactoriesRecord STYLE_INTERPOLATORS = {
|
|
70
|
+
// Flexbox
|
|
65
71
|
{"alignContent", value<CSSKeyword>("flex-start")},
|
|
66
72
|
{"alignItems", value<CSSKeyword>("stretch")},
|
|
67
73
|
{"alignSelf", value<CSSKeyword>("auto")},
|
|
@@ -117,15 +123,15 @@ const InterpolatorFactoriesRecord FLEX_INTERPOLATORS = {
|
|
|
117
123
|
{"top", value<CSSLength, CSSKeyword>("auto", {RelativeTo::Parent, "height"})},
|
|
118
124
|
{"width", value<CSSLength, CSSKeyword>("auto", {RelativeTo::Parent, "width"})},
|
|
119
125
|
{"zIndex", value<CSSInteger>(0)},
|
|
120
|
-
{"direction", value<CSSKeyword>("inherit")}
|
|
126
|
+
{"direction", value<CSSKeyword>("inherit")},
|
|
121
127
|
|
|
122
|
-
|
|
128
|
+
// Shadow (iOS)
|
|
123
129
|
{"shadowColor", value<CSSColor>(BLACK)},
|
|
124
130
|
{"shadowOffset", record({{"width", value<CSSDouble>(0)}, {"height", value<CSSDouble>(0)}})},
|
|
125
131
|
{"shadowRadius", value<CSSDouble>(0)},
|
|
126
|
-
{"shadowOpacity", value<CSSDouble>(1)}
|
|
132
|
+
{"shadowOpacity", value<CSSDouble>(1)},
|
|
127
133
|
|
|
128
|
-
|
|
134
|
+
// Transforms
|
|
129
135
|
{"transformOrigin",
|
|
130
136
|
array(
|
|
131
137
|
{value<CSSLength>("50%", {RelativeTo::Self, "width"}),
|
|
@@ -146,9 +152,8 @@ const InterpolatorFactoriesRecord TRANSFORMS_INTERPOLATORS = {
|
|
|
146
152
|
{"skewX", transformOp<SkewXOperation>("0deg")},
|
|
147
153
|
{"skewY", transformOp<SkewYOperation>("0deg")},
|
|
148
154
|
{"matrix", transformOp<MatrixOperation>(TransformMatrix2D())}})},
|
|
149
|
-
};
|
|
150
155
|
|
|
151
|
-
|
|
156
|
+
// Filters
|
|
152
157
|
{"filter",
|
|
153
158
|
filters(
|
|
154
159
|
{{"blur", filterOp<BlurOperation>(0)},
|
|
@@ -160,207 +165,257 @@ const InterpolatorFactoriesRecord FILTER_INTERPOLATORS = {
|
|
|
160
165
|
{"invert", filterOp<InvertOperation>(0)},
|
|
161
166
|
{"opacity", filterOp<OpacityOperation>(1)},
|
|
162
167
|
{"saturate", filterOp<SaturateOperation>(1)},
|
|
163
|
-
{"sepia", filterOp<SepiaOperation>(0)}})}
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
{
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
168
|
+
{"sepia", filterOp<SepiaOperation>(0)}})},
|
|
169
|
+
|
|
170
|
+
// View
|
|
171
|
+
{"backfaceVisibility", value<CSSKeyword>("visible")},
|
|
172
|
+
{"backgroundColor", value<CSSColor>(TRANSPARENT)},
|
|
173
|
+
{"borderBlockColor", value<CSSColor>(BLACK)},
|
|
174
|
+
{"borderBlockEndColor", value<CSSColor>(BLACK)},
|
|
175
|
+
{"borderBlockStartColor", value<CSSColor>(BLACK)},
|
|
176
|
+
{"borderBottomColor", value<CSSColor>(BLACK)},
|
|
177
|
+
{"borderBottomEndRadius", value<CSSLength>(0, {RelativeTo::Self, "width"})},
|
|
178
|
+
{"borderBottomLeftRadius", value<CSSLength>(0, {RelativeTo::Self, "width"})},
|
|
179
|
+
{"borderBottomRightRadius", value<CSSLength>(0, {RelativeTo::Self, "width"})},
|
|
180
|
+
{"borderBottomStartRadius", value<CSSLength>(0, {RelativeTo::Self, "width"})},
|
|
181
|
+
{"borderColor", value<CSSColor>(BLACK)},
|
|
182
|
+
{"borderCurve", value<CSSKeyword>("circular")},
|
|
183
|
+
{"borderEndColor", value<CSSColor>(BLACK)},
|
|
184
|
+
{"borderEndEndRadius", value<CSSLength>(0, {RelativeTo::Self, "width"})},
|
|
185
|
+
{"borderEndStartRadius", value<CSSLength>(0, {RelativeTo::Self, "width"})},
|
|
186
|
+
{"borderLeftColor", value<CSSColor>(BLACK)},
|
|
187
|
+
{"borderRadius", value<CSSLength>(0, {RelativeTo::Self, "width"})},
|
|
188
|
+
{"borderRightColor", value<CSSColor>(BLACK)},
|
|
189
|
+
{"borderStartColor", value<CSSColor>(BLACK)},
|
|
190
|
+
{"borderStartEndRadius", value<CSSLength>(0, {RelativeTo::Self, "width"})},
|
|
191
|
+
{"borderStartStartRadius", value<CSSLength>(0, {RelativeTo::Self, "width"})},
|
|
192
|
+
{"borderStyle", value<CSSKeyword>("solid")},
|
|
193
|
+
{"borderTopColor", value<CSSColor>(BLACK)},
|
|
194
|
+
{"borderTopEndRadius", value<CSSLength>(0, {RelativeTo::Self, "width"})},
|
|
195
|
+
{"borderTopLeftRadius", value<CSSLength>(0, {RelativeTo::Self, "width"})},
|
|
196
|
+
{"borderTopRightRadius", value<CSSLength>(0, {RelativeTo::Self, "width"})},
|
|
197
|
+
{"borderTopStartRadius", value<CSSLength>(0, {RelativeTo::Self, "width"})},
|
|
198
|
+
{"outlineColor", value<CSSColor>(BLACK)},
|
|
199
|
+
{"outlineOffset", value<CSSDouble>(0)},
|
|
200
|
+
{"outlineStyle", value<CSSKeyword>("solid")},
|
|
201
|
+
{"outlineWidth", value<CSSDouble>(0)},
|
|
202
|
+
{"opacity", value<CSSDouble>(1)},
|
|
203
|
+
{"elevation", value<CSSDouble>(0)},
|
|
204
|
+
{"pointerEvents", value<CSSKeyword>("auto")},
|
|
205
|
+
{"isolation", value<CSSKeyword>("auto")},
|
|
206
|
+
{"cursor", value<CSSKeyword>("auto")},
|
|
207
|
+
{"boxShadow", array({value<CSSBoxShadow>(CSSBoxShadow())})},
|
|
208
|
+
{"mixBlendMode", value<CSSKeyword>("normal")},
|
|
209
|
+
|
|
210
|
+
// Text
|
|
211
|
+
{"color", value<CSSColor>(BLACK)},
|
|
212
|
+
{"fontFamily", value<CSSKeyword>("inherit")},
|
|
213
|
+
{"fontSize", value<CSSDouble>(14)},
|
|
214
|
+
{"fontStyle", value<CSSKeyword>("normal")},
|
|
215
|
+
{"fontWeight", value<CSSKeyword>("normal")},
|
|
216
|
+
{"letterSpacing", value<CSSDouble>(0)},
|
|
217
|
+
{"lineHeight", value<CSSDouble>(14)}, // TODO - should inherit from fontSize
|
|
218
|
+
{"textAlign", value<CSSKeyword>("auto")},
|
|
219
|
+
{"textDecorationLine", value<CSSKeyword>("none")},
|
|
220
|
+
{"textShadowColor", value<CSSColor>(BLACK)},
|
|
221
|
+
{"textShadowOffset", record({{"width", value<CSSDouble>(0)}, {"height", value<CSSDouble>(0)}})},
|
|
222
|
+
{"textShadowRadius", value<CSSDouble>(0)},
|
|
223
|
+
{"textTransform", value<CSSKeyword>("none")},
|
|
224
|
+
{"userSelect", value<CSSKeyword>("auto")},
|
|
225
|
+
|
|
226
|
+
// Text (iOS)
|
|
211
227
|
{"fontVariant", value<CSSDiscreteArray<CSSKeyword>>(std::vector<CSSKeyword>{})},
|
|
212
228
|
{"textDecorationColor", value<CSSColor>(BLACK)},
|
|
213
229
|
{"textDecorationStyle", value<CSSKeyword>("solid")},
|
|
214
230
|
{"writingDirection", value<CSSKeyword>("auto")},
|
|
215
|
-
};
|
|
216
231
|
|
|
217
|
-
|
|
232
|
+
// Text (Android)
|
|
218
233
|
{"textAlignVertical", value<CSSKeyword>("auto")},
|
|
219
234
|
{"verticalAlign", value<CSSKeyword>("auto")},
|
|
220
235
|
{"includeFontPadding", value<CSSBoolean>(false)},
|
|
221
|
-
};
|
|
222
236
|
|
|
223
|
-
|
|
224
|
-
{
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
{"color", value<CSSColor>(BLACK)},
|
|
229
|
-
{"fontFamily", value<CSSKeyword>("inherit")},
|
|
230
|
-
{"fontSize", value<CSSDouble>(14)},
|
|
231
|
-
{"fontStyle", value<CSSKeyword>("normal")},
|
|
232
|
-
{"fontWeight", value<CSSKeyword>("normal")},
|
|
233
|
-
{"letterSpacing", value<CSSDouble>(0)},
|
|
234
|
-
{"lineHeight", value<CSSDouble>(14)}, // TODO - should inherit from fontSize
|
|
235
|
-
{"textAlign", value<CSSKeyword>("auto")},
|
|
236
|
-
{"textDecorationLine", value<CSSKeyword>("none")},
|
|
237
|
-
{"textShadowColor", value<CSSColor>(BLACK)},
|
|
238
|
-
{"textShadowOffset", record({{"width", value<CSSDouble>(0)}, {"height", value<CSSDouble>(0)}})},
|
|
239
|
-
{"textShadowRadius", value<CSSDouble>(0)},
|
|
240
|
-
{"textTransform", value<CSSKeyword>("none")},
|
|
241
|
-
{"userSelect", value<CSSKeyword>("auto")},
|
|
242
|
-
}});
|
|
243
|
-
|
|
244
|
-
const InterpolatorFactoriesRecord IMAGE_INTERPOLATORS = mergeInterpolators(
|
|
245
|
-
{VIEW_INTERPOLATORS,
|
|
246
|
-
InterpolatorFactoriesRecord{
|
|
247
|
-
{"resizeMode", value<CSSKeyword>("cover")},
|
|
248
|
-
{"overlayColor", value<CSSColor>(BLACK)},
|
|
249
|
-
{"tintColor", value<CSSColor>(BLACK)},
|
|
250
|
-
}});
|
|
237
|
+
// Image
|
|
238
|
+
{"resizeMode", value<CSSKeyword>("cover")},
|
|
239
|
+
{"overlayColor", value<CSSColor>(BLACK)},
|
|
240
|
+
{"tintColor", value<CSSColor>(BLACK)},
|
|
241
|
+
};
|
|
251
242
|
|
|
252
243
|
// =================
|
|
253
244
|
// SVG INTERPOLATORS
|
|
254
245
|
// =================
|
|
255
246
|
|
|
256
|
-
const InterpolatorFactoriesRecord
|
|
247
|
+
const InterpolatorFactoriesRecord SVG_COMMON_INTERPOLATORS = {
|
|
248
|
+
// Color
|
|
257
249
|
{"color", value<SVGBrush>(BLACK)},
|
|
258
|
-
};
|
|
259
250
|
|
|
260
|
-
|
|
251
|
+
// Fill
|
|
261
252
|
{"fill", value<SVGBrush>(BLACK)},
|
|
262
253
|
{"fillOpacity", value<CSSDouble>(1)},
|
|
263
|
-
{"fillRule", value<
|
|
264
|
-
};
|
|
254
|
+
{"fillRule", value<CSSIndex>(0)},
|
|
265
255
|
|
|
266
|
-
|
|
256
|
+
// Stroke
|
|
267
257
|
{"stroke", value<SVGBrush>(BLACK)},
|
|
268
|
-
{"strokeWidth", value<
|
|
258
|
+
{"strokeWidth", value<CSSLength>(1, {RelativeTo::Parent, "width"})},
|
|
269
259
|
{"strokeOpacity", value<CSSDouble>(1)},
|
|
270
|
-
{"strokeDasharray", value<SVGStrokeDashArray, CSSKeyword>(SVGStrokeDashArray())},
|
|
271
|
-
{"strokeDashoffset", value<
|
|
272
|
-
{"strokeLinecap", value<
|
|
273
|
-
{"strokeLinejoin", value<
|
|
260
|
+
{"strokeDasharray", value<SVGStrokeDashArray, CSSKeyword>(SVGStrokeDashArray(), {RelativeTo::Parent, "width"})},
|
|
261
|
+
{"strokeDashoffset", value<CSSLength>(0, {RelativeTo::Parent, "width"})},
|
|
262
|
+
{"strokeLinecap", value<CSSIndex>(0)},
|
|
263
|
+
{"strokeLinejoin", value<CSSIndex>(0)},
|
|
274
264
|
{"strokeMiterlimit", value<CSSDouble>(4)},
|
|
275
|
-
{"vectorEffect", value<
|
|
276
|
-
};
|
|
265
|
+
{"vectorEffect", value<CSSIndex>(0)},
|
|
277
266
|
|
|
278
|
-
|
|
267
|
+
// Clip
|
|
279
268
|
{"clipRule", value<CSSKeyword>("nonzero")},
|
|
280
269
|
{"clipPath", value<CSSKeyword>("none")},
|
|
281
|
-
};
|
|
282
270
|
|
|
283
|
-
|
|
284
|
-
{"translateX", value<
|
|
285
|
-
{"translateY", value<
|
|
286
|
-
{"originX", value<
|
|
287
|
-
{"originY", value<
|
|
271
|
+
// Transform
|
|
272
|
+
{"translateX", value<CSSLength>(0, {RelativeTo::Self, "width"})},
|
|
273
|
+
{"translateY", value<CSSLength>(0, {RelativeTo::Self, "height"})},
|
|
274
|
+
{"originX", value<CSSLength>(0, {RelativeTo::Self, "width"})},
|
|
275
|
+
{"originY", value<CSSLength>(0, {RelativeTo::Self, "height"})},
|
|
288
276
|
{"scaleX", value<CSSDouble>(1)},
|
|
289
277
|
{"scaleY", value<CSSDouble>(1)},
|
|
290
278
|
{"skewX", value<CSSAngle>(0)},
|
|
291
279
|
{"skewY", value<CSSAngle>(0)},
|
|
292
280
|
{"rotation", value<CSSAngle>(0)},
|
|
281
|
+
|
|
282
|
+
// General
|
|
283
|
+
{"opacity", value<CSSDouble>(1)},
|
|
293
284
|
};
|
|
294
285
|
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
SVG_STROKE_INTERPOLATORS,
|
|
299
|
-
InterpolatorFactoriesRecord{{"opacity", value<CSSDouble>(1)}},
|
|
300
|
-
});
|
|
286
|
+
// ================================
|
|
287
|
+
// SVG Component-Specific Interpolators
|
|
288
|
+
// ================================
|
|
301
289
|
|
|
302
290
|
const InterpolatorFactoriesRecord SVG_CIRCLE_INTERPOLATORS = mergeInterpolators(
|
|
303
291
|
{SVG_COMMON_INTERPOLATORS,
|
|
304
292
|
InterpolatorFactoriesRecord{
|
|
305
|
-
{"cx", value<
|
|
306
|
-
{"cy", value<
|
|
307
|
-
{"r", value<
|
|
293
|
+
{"cx", value<CSSLength, CSSKeyword>(0, {RelativeTo::Parent, "width"})},
|
|
294
|
+
{"cy", value<CSSLength, CSSKeyword>(0, {RelativeTo::Parent, "height"})},
|
|
295
|
+
{"r", value<CSSLength, CSSKeyword>(0, {RelativeTo::Parent, "width"})},
|
|
308
296
|
}});
|
|
309
297
|
|
|
310
298
|
const InterpolatorFactoriesRecord SVG_ELLIPSE_INTERPOLATORS = mergeInterpolators(
|
|
311
299
|
{SVG_COMMON_INTERPOLATORS,
|
|
312
300
|
InterpolatorFactoriesRecord{
|
|
313
|
-
{"cx", value<
|
|
314
|
-
{"cy", value<
|
|
315
|
-
{"rx", value<
|
|
316
|
-
{"ry", value<
|
|
301
|
+
{"cx", value<CSSLength, CSSKeyword>(0, {RelativeTo::Parent, "width"})},
|
|
302
|
+
{"cy", value<CSSLength, CSSKeyword>(0, {RelativeTo::Parent, "height"})},
|
|
303
|
+
{"rx", value<CSSLength, CSSKeyword>(0, {RelativeTo::Parent, "width"})},
|
|
304
|
+
{"ry", value<CSSLength, CSSKeyword>(0, {RelativeTo::Parent, "height"})},
|
|
305
|
+
}});
|
|
306
|
+
|
|
307
|
+
const InterpolatorFactoriesRecord SVG_IMAGE_INTERPOLATORS = mergeInterpolators(
|
|
308
|
+
{SVG_COMMON_INTERPOLATORS,
|
|
309
|
+
InterpolatorFactoriesRecord{
|
|
310
|
+
{"x", value<CSSLength, CSSKeyword>(0, {RelativeTo::Parent, "width"})},
|
|
311
|
+
{"y", value<CSSLength, CSSKeyword>(0, {RelativeTo::Parent, "height"})},
|
|
312
|
+
{"width", value<CSSLength, CSSKeyword>(0, {RelativeTo::Parent, "width"})},
|
|
313
|
+
{"height", value<CSSLength, CSSKeyword>(0, {RelativeTo::Parent, "height"})},
|
|
314
|
+
// TODO: Check why this is not supported in RN-SVG and add support
|
|
315
|
+
// {"align", value<CSSKeyword>("xMidYMid")},
|
|
316
|
+
// {"meetOrSlice", value<CSSIndex>(0)},
|
|
317
317
|
}});
|
|
318
318
|
|
|
319
319
|
const InterpolatorFactoriesRecord SVG_LINE_INTERPOLATORS = mergeInterpolators(
|
|
320
320
|
{SVG_COMMON_INTERPOLATORS,
|
|
321
321
|
InterpolatorFactoriesRecord{
|
|
322
|
-
{"x1", value<
|
|
323
|
-
{"y1", value<
|
|
324
|
-
{"x2", value<
|
|
325
|
-
{"y2", value<
|
|
322
|
+
{"x1", value<CSSLength, CSSKeyword>(0, {RelativeTo::Parent, "width"})},
|
|
323
|
+
{"y1", value<CSSLength, CSSKeyword>(0, {RelativeTo::Parent, "height"})},
|
|
324
|
+
{"x2", value<CSSLength, CSSKeyword>(0, {RelativeTo::Parent, "width"})},
|
|
325
|
+
{"y2", value<CSSLength, CSSKeyword>(0, {RelativeTo::Parent, "height"})},
|
|
326
|
+
}});
|
|
327
|
+
|
|
328
|
+
const InterpolatorFactoriesRecord SVG_LINEAR_GRADIENT_INTERPOLATORS = mergeInterpolators(
|
|
329
|
+
{SVG_COMMON_INTERPOLATORS,
|
|
330
|
+
InterpolatorFactoriesRecord{
|
|
331
|
+
{"x1", value<CSSLength, CSSKeyword>("0%", {RelativeTo::Self, "width"})},
|
|
332
|
+
{"x2", value<CSSLength, CSSKeyword>("100%", {RelativeTo::Self, "width"})},
|
|
333
|
+
{"y1", value<CSSLength, CSSKeyword>("0%", {RelativeTo::Self, "height"})},
|
|
334
|
+
{"y2", value<CSSLength, CSSKeyword>("0%", {RelativeTo::Self, "height"})},
|
|
335
|
+
{"gradient", value<SVGStops>(SVGStops())},
|
|
336
|
+
{"gradientUnits", value<CSSIndex>(0)},
|
|
337
|
+
// TODO: Implement 'gradientTransform'
|
|
338
|
+
// {"gradientTransform", value<CSSKeyword>("")},
|
|
326
339
|
}});
|
|
327
340
|
|
|
328
341
|
const InterpolatorFactoriesRecord SVG_RECT_INTERPOLATORS = mergeInterpolators(
|
|
329
342
|
{SVG_COMMON_INTERPOLATORS,
|
|
330
343
|
InterpolatorFactoriesRecord{
|
|
331
|
-
{"x", value<
|
|
332
|
-
{"y", value<
|
|
333
|
-
{"width", value<
|
|
334
|
-
{"height", value<
|
|
335
|
-
{"rx", value<
|
|
336
|
-
{"ry", value<
|
|
344
|
+
{"x", value<CSSLength, CSSKeyword>(0, {RelativeTo::Parent, "width"})},
|
|
345
|
+
{"y", value<CSSLength, CSSKeyword>(0, {RelativeTo::Parent, "height"})},
|
|
346
|
+
{"width", value<CSSLength, CSSKeyword>(0, {RelativeTo::Parent, "width"})},
|
|
347
|
+
{"height", value<CSSLength, CSSKeyword>(0, {RelativeTo::Parent, "height"})},
|
|
348
|
+
{"rx", value<CSSLength, CSSKeyword>(0, {RelativeTo::Self, "width"})},
|
|
349
|
+
{"ry", value<CSSLength, CSSKeyword>(0, {RelativeTo::Self, "height"})},
|
|
337
350
|
}});
|
|
338
351
|
|
|
339
352
|
const InterpolatorFactoriesRecord SVG_PATH_INTERPOLATORS = mergeInterpolators(
|
|
340
353
|
{SVG_COMMON_INTERPOLATORS,
|
|
341
354
|
InterpolatorFactoriesRecord{
|
|
342
|
-
|
|
355
|
+
{"d", value<SVGPath>("")},
|
|
356
|
+
}});
|
|
357
|
+
|
|
358
|
+
const InterpolatorFactoriesRecord SVG_PATTERN_INTERPOLATORS = mergeInterpolators(
|
|
359
|
+
{SVG_COMMON_INTERPOLATORS,
|
|
360
|
+
InterpolatorFactoriesRecord{
|
|
361
|
+
{"x", value<CSSLength>(0, {RelativeTo::Parent, "width"})},
|
|
362
|
+
{"y", value<CSSLength>(0, {RelativeTo::Parent, "height"})},
|
|
363
|
+
{"width", value<CSSLength>(0, {RelativeTo::Parent, "width"})},
|
|
364
|
+
{"height", value<CSSLength>(0, {RelativeTo::Parent, "height"})},
|
|
365
|
+
{"patternUnits", value<CSSIndex>(0)},
|
|
366
|
+
{"patternContentUnits", value<CSSIndex>(0)},
|
|
367
|
+
}});
|
|
368
|
+
|
|
369
|
+
const InterpolatorFactoriesRecord SVG_RADIAL_GRADIENT_INTERPOLATORS = mergeInterpolators(
|
|
370
|
+
{SVG_COMMON_INTERPOLATORS,
|
|
371
|
+
InterpolatorFactoriesRecord{
|
|
372
|
+
{"r", value<CSSLength, CSSKeyword>("50%", {RelativeTo::Self, "width"})},
|
|
373
|
+
{"fx", value<CSSLength, CSSKeyword>("50%", {RelativeTo::Self, "width"})},
|
|
374
|
+
{"fy", value<CSSLength, CSSKeyword>("50%", {RelativeTo::Self, "height"})},
|
|
375
|
+
{"rx", value<CSSLength, CSSKeyword>("50%", {RelativeTo::Self, "width"})},
|
|
376
|
+
{"ry", value<CSSLength, CSSKeyword>("50%", {RelativeTo::Self, "height"})},
|
|
377
|
+
{"cx", value<CSSLength, CSSKeyword>("50%", {RelativeTo::Self, "width"})},
|
|
378
|
+
{"cy", value<CSSLength, CSSKeyword>("50%", {RelativeTo::Self, "height"})},
|
|
379
|
+
{"gradient", value<SVGStops>(SVGStops())},
|
|
380
|
+
{"gradientUnits", value<CSSIndex>(0)},
|
|
381
|
+
// TODO: Implement 'gradientTransform'
|
|
382
|
+
// {"gradientTransform", value<CSSKeyword>("")},
|
|
383
|
+
}});
|
|
384
|
+
|
|
385
|
+
const InterpolatorFactoriesRecord SVG_TEXT_INTERPOLATORS = mergeInterpolators(
|
|
386
|
+
{SVG_COMMON_INTERPOLATORS,
|
|
387
|
+
InterpolatorFactoriesRecord{
|
|
388
|
+
{"x", value<CSSLengthArray>(CSSLengthArray(), {RelativeTo::Parent, "width"})},
|
|
389
|
+
{"y", value<CSSLengthArray>(CSSLengthArray(), {RelativeTo::Parent, "height"})},
|
|
390
|
+
{"dx", value<CSSLengthArray>(CSSLengthArray(), {RelativeTo::Parent, "width"})},
|
|
391
|
+
{"dy", value<CSSLengthArray>(CSSLengthArray(), {RelativeTo::Parent, "height"})},
|
|
392
|
+
{"rotate", value<CSSLengthArray>(CSSLengthArray(), {RelativeTo::Parent, "width"})},
|
|
393
|
+
// TODO: Implement when supported by RNSVG
|
|
394
|
+
// {"textLength", value<CSSLength, CSSKeyword>(0, {RelativeTo::Parent, "width"})},
|
|
395
|
+
// {"lengthAdjust", value<CSSKeyword>("spacing")},
|
|
343
396
|
}});
|
|
344
397
|
|
|
345
398
|
// ==================
|
|
346
399
|
// COMPONENT REGISTRY
|
|
347
400
|
// ==================
|
|
348
401
|
|
|
402
|
+
constexpr bool SVG_FEATURE_ENABLED = StaticFeatureFlags::getFlag("EXPERIMENTAL_CSS_ANIMATIONS_FOR_SVG_COMPONENTS");
|
|
403
|
+
|
|
349
404
|
ComponentInterpolatorsMap initializeRegistry() {
|
|
350
|
-
ComponentInterpolatorsMap registry = {
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
{"Paragraph", TEXT_INTERPOLATORS},
|
|
354
|
-
{"Image", IMAGE_INTERPOLATORS},
|
|
355
|
-
};
|
|
356
|
-
|
|
357
|
-
if (StaticFeatureFlags::getFlag("EXPERIMENTAL_CSS_ANIMATIONS_FOR_SVG_COMPONENTS")) {
|
|
405
|
+
ComponentInterpolatorsMap registry = {};
|
|
406
|
+
|
|
407
|
+
if (SVG_FEATURE_ENABLED) {
|
|
358
408
|
// SVG Components
|
|
359
409
|
registry["RNSVGCircle"] = SVG_CIRCLE_INTERPOLATORS;
|
|
360
410
|
registry["RNSVGEllipse"] = SVG_ELLIPSE_INTERPOLATORS;
|
|
411
|
+
registry["RNSVGImage"] = SVG_IMAGE_INTERPOLATORS;
|
|
361
412
|
registry["RNSVGLine"] = SVG_LINE_INTERPOLATORS;
|
|
413
|
+
registry["RNSVGLinearGradient"] = SVG_LINEAR_GRADIENT_INTERPOLATORS;
|
|
362
414
|
registry["RNSVGPath"] = SVG_PATH_INTERPOLATORS;
|
|
415
|
+
registry["RNSVGPattern"] = SVG_PATTERN_INTERPOLATORS;
|
|
363
416
|
registry["RNSVGRect"] = SVG_RECT_INTERPOLATORS;
|
|
417
|
+
registry["RNSVGRadialGradient"] = SVG_RADIAL_GRADIENT_INTERPOLATORS;
|
|
418
|
+
registry["RNSVGText"] = SVG_TEXT_INTERPOLATORS;
|
|
364
419
|
}
|
|
365
420
|
|
|
366
421
|
return registry;
|
|
@@ -370,21 +425,19 @@ ComponentInterpolatorsMap registry = initializeRegistry();
|
|
|
370
425
|
|
|
371
426
|
} // namespace
|
|
372
427
|
|
|
373
|
-
const InterpolatorFactoriesRecord &getComponentInterpolators(const std::string &
|
|
374
|
-
if (auto it = registry.find(
|
|
428
|
+
const InterpolatorFactoriesRecord &getComponentInterpolators(const std::string &nativeComponentName) {
|
|
429
|
+
if (auto it = registry.find(nativeComponentName); it != registry.end()) {
|
|
375
430
|
return it->second;
|
|
376
431
|
}
|
|
377
432
|
|
|
378
|
-
// Use
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
}
|
|
433
|
+
// Use SVG common interpolators as a fallback for unregistered SVG components
|
|
434
|
+
if (SVG_FEATURE_ENABLED && nativeComponentName.starts_with("RNSVG")) {
|
|
435
|
+
return SVG_COMMON_INTERPOLATORS;
|
|
436
|
+
}
|
|
383
437
|
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
registry[componentName] = interpolators;
|
|
438
|
+
// Use default style interpolators as a fallback for unknown components
|
|
439
|
+
// (e.g. ExpoImage, which is not a RN component but should support RN Image styles)
|
|
440
|
+
return STYLE_INTERPOLATORS;
|
|
388
441
|
}
|
|
389
442
|
|
|
390
443
|
} // namespace reanimated::css
|
|
@@ -3,14 +3,9 @@
|
|
|
3
3
|
#include <reanimated/CSS/interpolation/PropertyInterpolator.h>
|
|
4
4
|
|
|
5
5
|
#include <string>
|
|
6
|
-
#include <unordered_map>
|
|
7
6
|
|
|
8
7
|
namespace reanimated::css {
|
|
9
8
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const InterpolatorFactoriesRecord &getComponentInterpolators(const std::string &componentName);
|
|
13
|
-
|
|
14
|
-
void registerComponentInterpolators(const std::string &componentName, const InterpolatorFactoriesRecord &interpolators);
|
|
9
|
+
const InterpolatorFactoriesRecord &getComponentInterpolators(const std::string &nativeComponentName);
|
|
15
10
|
|
|
16
11
|
} // namespace reanimated::css
|
|
@@ -3,20 +3,15 @@
|
|
|
3
3
|
#include <folly/dynamic.h>
|
|
4
4
|
#include <jsi/jsi.h>
|
|
5
5
|
#include <string>
|
|
6
|
+
#include <unordered_set>
|
|
6
7
|
#include <vector>
|
|
7
8
|
|
|
8
9
|
namespace reanimated::css {
|
|
9
10
|
|
|
10
11
|
using namespace facebook;
|
|
11
12
|
|
|
12
|
-
using PropertyNames = std::vector<std::string>;
|
|
13
13
|
using PropertyPath = std::vector<std::string>;
|
|
14
|
-
|
|
15
|
-
* If nullopt - all style properties can trigger transition
|
|
16
|
-
* If empty vector - no style property can trigger transition
|
|
17
|
-
* Otherwise - only specified style properties can trigger transition
|
|
18
|
-
*/
|
|
19
|
-
using TransitionProperties = std::optional<PropertyNames>;
|
|
14
|
+
using TransitionProperties = std::unordered_set<std::string>;
|
|
20
15
|
|
|
21
16
|
using EasingFunction = std::function<double(double)>;
|
|
22
17
|
using ColorChannels = std::array<uint8_t, 4>;
|
package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSColor.cpp
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
#include <reanimated/CSS/common/values/CSSColor.h>
|
|
2
2
|
#include <reanimated/CSS/svg/values/SVGBrush.h>
|
|
3
|
+
#include <reanimated/CSS/utils/props.h>
|
|
3
4
|
|
|
4
5
|
#include <utility>
|
|
5
6
|
|
|
@@ -17,24 +18,7 @@ CSSColorBase<TColorType, TDerived>::CSSColorBase(TColorType colorType) : channel
|
|
|
17
18
|
|
|
18
19
|
template <ColorTypeEnum TColorType, typename TDerived>
|
|
19
20
|
CSSColorBase<TColorType, TDerived>::CSSColorBase(int64_t numberValue)
|
|
20
|
-
: channels
|
|
21
|
-
uint32_t color;
|
|
22
|
-
// On Android, colors are represented as signed 32-bit integers. In JS, we use
|
|
23
|
-
// a bitwise operation (normalizedColor = normalizedColor | 0x0) to ensure the
|
|
24
|
-
// value is treated as a signed int, causing numbers above 2^31 to become
|
|
25
|
-
// negative. To correctly interpret these in C++, we cast negative values to
|
|
26
|
-
// int32_t to preserve their bit pattern, then assign to uint32_t. This wraps
|
|
27
|
-
// the bits (modulo 2^32), effectively reversing the JS-side bit shift.
|
|
28
|
-
if (numberValue < 0) {
|
|
29
|
-
color = static_cast<int32_t>(numberValue);
|
|
30
|
-
} else {
|
|
31
|
-
color = static_cast<uint32_t>(numberValue);
|
|
32
|
-
}
|
|
33
|
-
channels[0] = (color >> 16) & 0xFF; // Red
|
|
34
|
-
channels[1] = (color >> 8) & 0xFF; // Green
|
|
35
|
-
channels[2] = color & 0xFF; // Blue
|
|
36
|
-
channels[3] = (color >> 24) & 0xFF; // Alpha
|
|
37
|
-
}
|
|
21
|
+
: channels(extractColorChannels(numberValue)), colorType(TColorType::Rgba) {}
|
|
38
22
|
|
|
39
23
|
template <ColorTypeEnum TColorType, typename TDerived>
|
|
40
24
|
CSSColorBase<TColorType, TDerived>::CSSColorBase(bool value)
|