@react-native-ohos/react-native-reanimated 4.0.2-beta.1 → 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 -9
- 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 +112 -19
- 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 +119 -19
- 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
package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/updates/propNameFromString.h
ADDED
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
|
|
3
|
+
#include <cxxreact/ReactNativeVersion.h>
|
|
4
|
+
|
|
5
|
+
#if REACT_NATIVE_VERSION_MINOR >= 85
|
|
6
|
+
#include <react/renderer/animationbackend/AnimationBackend.h>
|
|
7
|
+
|
|
8
|
+
#include <optional>
|
|
9
|
+
#include <string>
|
|
10
|
+
#include <unordered_map>
|
|
11
|
+
|
|
12
|
+
namespace reanimated {
|
|
13
|
+
|
|
14
|
+
inline std::optional<facebook::react::PropName> propNameFromString(const std::string &propName) {
|
|
15
|
+
static const std::unordered_map<std::string, facebook::react::PropName> propNameMap = {
|
|
16
|
+
{"opacity", facebook::react::OPACITY},
|
|
17
|
+
{"width", facebook::react::WIDTH},
|
|
18
|
+
{"height", facebook::react::HEIGHT},
|
|
19
|
+
{"borderRadius", facebook::react::BORDER_RADII},
|
|
20
|
+
{"borderTopRightRadius", facebook::react::BORDER_RADII},
|
|
21
|
+
{"borderTopLeftRadius", facebook::react::BORDER_RADII},
|
|
22
|
+
{"borderBottomRightRadius", facebook::react::BORDER_RADII},
|
|
23
|
+
{"borderBottomLeftRadius", facebook::react::BORDER_RADII},
|
|
24
|
+
{"borderTopStartRadius", facebook::react::BORDER_RADII},
|
|
25
|
+
{"borderTopEndRadius", facebook::react::BORDER_RADII},
|
|
26
|
+
{"borderBottomStartRadius", facebook::react::BORDER_RADII},
|
|
27
|
+
{"borderBottomEndRadius", facebook::react::BORDER_RADII},
|
|
28
|
+
{"borderStartStartRadius", facebook::react::BORDER_RADII},
|
|
29
|
+
{"borderStartEndRadius", facebook::react::BORDER_RADII},
|
|
30
|
+
{"borderEndStartRadius", facebook::react::BORDER_RADII},
|
|
31
|
+
{"borderEndEndRadius", facebook::react::BORDER_RADII},
|
|
32
|
+
{"borderWidth", facebook::react::BORDER_WIDTH},
|
|
33
|
+
{"borderBottomWidth", facebook::react::BORDER_WIDTH},
|
|
34
|
+
{"borderTopWidth", facebook::react::BORDER_WIDTH},
|
|
35
|
+
{"borderLeftWidth", facebook::react::BORDER_WIDTH},
|
|
36
|
+
{"borderRightWidth", facebook::react::BORDER_WIDTH},
|
|
37
|
+
{"borderStartWidth", facebook::react::BORDER_WIDTH},
|
|
38
|
+
{"borderEndWidth", facebook::react::BORDER_WIDTH},
|
|
39
|
+
{"borderColor", facebook::react::BORDER_COLOR},
|
|
40
|
+
{"borderEndColor", facebook::react::BORDER_COLOR},
|
|
41
|
+
{"borderStartColor", facebook::react::BORDER_COLOR},
|
|
42
|
+
{"borderLeftColor", facebook::react::BORDER_COLOR},
|
|
43
|
+
{"borderRightColor", facebook::react::BORDER_COLOR},
|
|
44
|
+
{"borderTopColor", facebook::react::BORDER_COLOR},
|
|
45
|
+
{"borderBottomColor", facebook::react::BORDER_COLOR},
|
|
46
|
+
{"borderBlockColor", facebook::react::BORDER_COLOR},
|
|
47
|
+
{"borderBlockEndColor", facebook::react::BORDER_COLOR},
|
|
48
|
+
{"borderBlockStartColor", facebook::react::BORDER_COLOR},
|
|
49
|
+
{"margin", facebook::react::MARGIN},
|
|
50
|
+
{"marginTop", facebook::react::MARGIN},
|
|
51
|
+
{"marginBottom", facebook::react::MARGIN},
|
|
52
|
+
{"marginLeft", facebook::react::MARGIN},
|
|
53
|
+
{"marginRight", facebook::react::MARGIN},
|
|
54
|
+
{"marginStart", facebook::react::MARGIN},
|
|
55
|
+
{"marginEnd", facebook::react::MARGIN},
|
|
56
|
+
{"marginHorizontal", facebook::react::MARGIN},
|
|
57
|
+
{"marginVertical", facebook::react::MARGIN},
|
|
58
|
+
{"padding", facebook::react::PADDING},
|
|
59
|
+
{"paddingTop", facebook::react::PADDING},
|
|
60
|
+
{"paddingBottom", facebook::react::PADDING},
|
|
61
|
+
{"paddingLeft", facebook::react::PADDING},
|
|
62
|
+
{"paddingRight", facebook::react::PADDING},
|
|
63
|
+
{"paddingStart", facebook::react::PADDING},
|
|
64
|
+
{"paddingEnd", facebook::react::PADDING},
|
|
65
|
+
{"paddingHorizontal", facebook::react::PADDING},
|
|
66
|
+
{"paddingVertical", facebook::react::PADDING},
|
|
67
|
+
{"top", facebook::react::POSITION},
|
|
68
|
+
{"bottom", facebook::react::POSITION},
|
|
69
|
+
{"left", facebook::react::POSITION},
|
|
70
|
+
{"right", facebook::react::POSITION},
|
|
71
|
+
{"start", facebook::react::POSITION},
|
|
72
|
+
{"end", facebook::react::POSITION},
|
|
73
|
+
{"position", facebook::react::POSITION_TYPE},
|
|
74
|
+
{"flex", facebook::react::FLEX},
|
|
75
|
+
{"transform", facebook::react::TRANSFORM},
|
|
76
|
+
{"transformOriginX", facebook::react::TRANSFORM_ORIGIN},
|
|
77
|
+
{"transformOriginY", facebook::react::TRANSFORM_ORIGIN},
|
|
78
|
+
{"transformOriginZ", facebook::react::TRANSFORM_ORIGIN},
|
|
79
|
+
{"backgroundColor", facebook::react::BACKGROUND_COLOR},
|
|
80
|
+
{"shadowColor", facebook::react::SHADOW_COLOR},
|
|
81
|
+
{"shadowOffsetWidth", facebook::react::SHADOW_OFFSET},
|
|
82
|
+
{"shadowOffsetHeight", facebook::react::SHADOW_OFFSET},
|
|
83
|
+
{"shadowOpacity", facebook::react::SHADOW_OPACITY},
|
|
84
|
+
{"shadowRadius", facebook::react::SHADOW_RADIUS},
|
|
85
|
+
{"filter", facebook::react::FILTER},
|
|
86
|
+
{"outlineColor", facebook::react::OUTLINE_COLOR},
|
|
87
|
+
{"outlineOffset", facebook::react::OUTLINE_OFFSET},
|
|
88
|
+
{"outlineStyle", facebook::react::OUTLINE_STYLE},
|
|
89
|
+
{"outlineWidth", facebook::react::OUTLINE_WIDTH},
|
|
90
|
+
{"alignContent", facebook::react::ALIGN_CONTENT},
|
|
91
|
+
{"alignItems", facebook::react::ALIGN_ITEMS},
|
|
92
|
+
{"alignSelf", facebook::react::ALIGN_SELF},
|
|
93
|
+
{"aspectRatio", facebook::react::ASPECT_RATIO},
|
|
94
|
+
{"boxSizing", facebook::react::BOX_SIZING},
|
|
95
|
+
{"display", facebook::react::DISPLAY},
|
|
96
|
+
{"flexBasis", facebook::react::FLEX_BASIS},
|
|
97
|
+
{"flexDirection", facebook::react::FLEX_DIRECTION},
|
|
98
|
+
{"rowGap", facebook::react::ROW_GAP},
|
|
99
|
+
{"columnGap", facebook::react::COLUMN_GAP},
|
|
100
|
+
{"flexGrow", facebook::react::FLEX_GROW},
|
|
101
|
+
{"flexShrink", facebook::react::FLEX_SHRINK},
|
|
102
|
+
{"flexWrap", facebook::react::FLEX_WRAP},
|
|
103
|
+
{"justifyContent", facebook::react::JUSTIFY_CONTENT},
|
|
104
|
+
{"maxHeight", facebook::react::MAX_HEIGHT},
|
|
105
|
+
{"maxWidth", facebook::react::MAX_WIDTH},
|
|
106
|
+
{"minHeight", facebook::react::MIN_HEIGHT},
|
|
107
|
+
{"minWidth", facebook::react::MIN_WIDTH},
|
|
108
|
+
{"overflow", facebook::react::STYLE_OVERFLOW},
|
|
109
|
+
{"zIndex", facebook::react::Z_INDEX},
|
|
110
|
+
{"direction", facebook::react::DIRECTION},
|
|
111
|
+
{"borderCurve", facebook::react::BORDER_CURVES},
|
|
112
|
+
{"borderStyle", facebook::react::BORDER_STYLES},
|
|
113
|
+
{"pointerEvents", facebook::react::POINTER_EVENTS},
|
|
114
|
+
{"isolation", facebook::react::ISOLATION},
|
|
115
|
+
{"cursor", facebook::react::CURSOR},
|
|
116
|
+
{"boxShadow", facebook::react::BOX_SHADOW},
|
|
117
|
+
{"mixBlendMode", facebook::react::MIX_BLEND_MODE},
|
|
118
|
+
{"backfaceVisibility", facebook::react::BACKFACE_VISIBILITY},
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
const auto it = propNameMap.find(propName);
|
|
122
|
+
if (it == propNameMap.end()) {
|
|
123
|
+
return std::nullopt;
|
|
124
|
+
}
|
|
125
|
+
return it->second;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
} // namespace reanimated
|
|
129
|
+
|
|
130
|
+
#endif
|
|
@@ -111,6 +111,7 @@ void LayoutAnimationsManager::transferConfigFromNativeID(const int nativeId, con
|
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
void LayoutAnimationsManager::transferSharedConfig(const Tag from, const Tag to) {
|
|
114
|
+
auto lock = std::unique_lock<std::recursive_mutex>(animationsMutex_);
|
|
114
115
|
sharedTransitions_[to] = sharedTransitions_[from];
|
|
115
116
|
}
|
|
116
117
|
|
|
@@ -2,11 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
#include <react/renderer/graphics/Transform.h>
|
|
4
4
|
#include <react/renderer/mounting/ShadowView.h>
|
|
5
|
+
#include <reanimated/Compat/WorkletsApi.h>
|
|
5
6
|
#include <reanimated/LayoutAnimations/LayoutAnimationType.h>
|
|
6
7
|
|
|
7
|
-
#include <worklets/SharedItems/Serializable.h>
|
|
8
|
-
#include <worklets/Tools/JSLogger.h>
|
|
9
|
-
|
|
10
8
|
#include <jsi/jsi.h>
|
|
11
9
|
#include <stdio.h>
|
|
12
10
|
#include <functional>
|
|
@@ -22,6 +20,7 @@
|
|
|
22
20
|
namespace reanimated {
|
|
23
21
|
|
|
24
22
|
using namespace facebook;
|
|
23
|
+
using namespace facebook::react;
|
|
25
24
|
using namespace worklets;
|
|
26
25
|
using SharedTag = std::string;
|
|
27
26
|
|
|
@@ -50,8 +49,7 @@ struct LayoutAnimationConfig {
|
|
|
50
49
|
|
|
51
50
|
class LayoutAnimationsManager {
|
|
52
51
|
public:
|
|
53
|
-
|
|
54
|
-
: jsLogger_(jsLogger), sharedTransitionManager_(std::make_shared<SharedTransitionManager>()) {}
|
|
52
|
+
LayoutAnimationsManager() : sharedTransitionManager_(std::make_shared<SharedTransitionManager>()) {}
|
|
55
53
|
void configureAnimationBatch(const std::vector<LayoutAnimationConfig> &layoutAnimationsBatch);
|
|
56
54
|
void setShouldAnimateExiting(const int tag, const bool value);
|
|
57
55
|
bool shouldAnimateExiting(const int tag, const bool shouldAnimate);
|
|
@@ -66,7 +64,6 @@ class LayoutAnimationsManager {
|
|
|
66
64
|
private:
|
|
67
65
|
std::unordered_map<int, std::shared_ptr<Serializable>> &getConfigsForType(const LayoutAnimationType type);
|
|
68
66
|
|
|
69
|
-
std::shared_ptr<JSLogger> jsLogger_;
|
|
70
67
|
std::shared_ptr<SharedTransitionManager> sharedTransitionManager_;
|
|
71
68
|
std::unordered_map<int, std::shared_ptr<Serializable>> enteringAnimationsForNativeID_;
|
|
72
69
|
std::unordered_map<int, std::shared_ptr<Serializable>> sharedTransitionsForNativeID_;
|
|
@@ -75,7 +72,8 @@ class LayoutAnimationsManager {
|
|
|
75
72
|
std::unordered_map<int, std::shared_ptr<Serializable>> exitingAnimations_;
|
|
76
73
|
std::unordered_map<int, std::shared_ptr<Serializable>> layoutAnimations_;
|
|
77
74
|
std::unordered_map<int, bool> shouldAnimateExitingForTag_;
|
|
78
|
-
mutable std::recursive_mutex animationsMutex_; // Protects `
|
|
75
|
+
mutable std::recursive_mutex animationsMutex_; // Protects `enteringAnimationsForNativeID_`,
|
|
76
|
+
// `sharedTransitionsForNativeID_`, `sharedTransitions_`, `enteringAnimations_`, `exitingAnimations_`,
|
|
79
77
|
// `layoutAnimations_` and `shouldAnimateExitingForTag_`.
|
|
80
78
|
};
|
|
81
79
|
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
#include <ReactCommon/CallInvoker.h>
|
|
2
2
|
#include <folly/dynamic.h>
|
|
3
|
-
#include <react/renderer/uimanager/UIManagerBinding.h>
|
|
4
3
|
#include <reanimated/Fabric/ShadowTreeCloner.h>
|
|
5
4
|
#include <reanimated/LayoutAnimations/LayoutAnimationsProxyCommon.h>
|
|
6
5
|
|
|
@@ -38,8 +37,12 @@ const facebook::react::ShadowNode *findInShadowTreeByTag(const facebook::react::
|
|
|
38
37
|
|
|
39
38
|
void LayoutAnimationsProxyCommon::restoreOpacityInCaseOfFlakyEnteringAnimation(SurfaceId surfaceId) const {
|
|
40
39
|
std::vector<std::pair<double, Tag>> opacityToRestore;
|
|
41
|
-
for (const auto tag :
|
|
42
|
-
const auto
|
|
40
|
+
for (const auto tag : maybeSettledAnimationTags_) {
|
|
41
|
+
const auto layoutAnimationIt = layoutAnimations_.find(tag);
|
|
42
|
+
if (layoutAnimationIt == layoutAnimations_.end() || !layoutAnimationIt->second.isSettled()) {
|
|
43
|
+
continue;
|
|
44
|
+
}
|
|
45
|
+
const auto &opacity = layoutAnimationIt->second.opacity;
|
|
43
46
|
if (opacity.has_value()) {
|
|
44
47
|
opacityToRestore.emplace_back(std::pair<double, Tag>{opacity.value(), tag});
|
|
45
48
|
}
|
|
@@ -64,7 +67,7 @@ void LayoutAnimationsProxyCommon::restoreOpacityInCaseOfFlakyEnteringAnimation(S
|
|
|
64
67
|
for (const auto &[opacity, tag] : opacityToRestore) {
|
|
65
68
|
const auto *targetShadowNode = findInShadowTreeByTag(rootShadowNode, tag);
|
|
66
69
|
if (targetShadowNode != nullptr) {
|
|
67
|
-
propsMap[
|
|
70
|
+
propsMap[targetShadowNode->getFamilyShared()].emplace_back(folly::dynamic::object("opacity", opacity));
|
|
68
71
|
}
|
|
69
72
|
}
|
|
70
73
|
return cloneShadowTreeWithNewProps(oldRootShadowNode, propsMap);
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
#pragma once
|
|
2
2
|
|
|
3
3
|
#include <jsi/jsi.h>
|
|
4
|
+
#include <react/debug/react_native_assert.h>
|
|
4
5
|
#include <react/renderer/componentregistry/ComponentDescriptorFactory.h>
|
|
5
6
|
#include <react/renderer/mounting/MountingOverrideDelegate.h>
|
|
6
7
|
#include <react/renderer/uimanager/UIManager.h>
|
|
8
|
+
#include <reanimated/Compat/WorkletsApi.h>
|
|
7
9
|
#include <reanimated/LayoutAnimations/LayoutAnimationsManager.h>
|
|
8
10
|
#include <reanimated/Tools/PlatformDepMethodsHolder.h>
|
|
9
|
-
#include <worklets/Tools/UIScheduler.h>
|
|
10
11
|
|
|
11
12
|
#include <memory>
|
|
12
13
|
#include <optional>
|
|
13
14
|
#include <unordered_map>
|
|
15
|
+
#include <unordered_set>
|
|
14
16
|
#include <vector>
|
|
15
17
|
|
|
16
18
|
namespace reanimated {
|
|
@@ -22,21 +24,50 @@ struct LayoutAnimation {
|
|
|
22
24
|
bool isViewAlreadyMounted = false;
|
|
23
25
|
int count = 1;
|
|
24
26
|
LayoutAnimation &operator=(const LayoutAnimation &other) = default;
|
|
27
|
+
|
|
28
|
+
bool isSettled() const {
|
|
29
|
+
return count == 0;
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
#ifdef ANDROID
|
|
34
|
+
// Bookkeeping for animation starts that were scheduled onto the UI thread but
|
|
35
|
+
// haven't run yet — see `pendingStarts_` below.
|
|
36
|
+
struct PendingStart {
|
|
37
|
+
int count = 0;
|
|
38
|
+
uint64_t handle = 0;
|
|
25
39
|
};
|
|
26
40
|
|
|
41
|
+
// Removes one pending start for the given tag and returns whether it was
|
|
42
|
+
// cancelled since it was scheduled (i.e. its handle is no longer current).
|
|
43
|
+
// Call under the proxy mutex.
|
|
44
|
+
inline bool
|
|
45
|
+
consumeIsCancelled(std::unordered_map<Tag, PendingStart> &pendingStarts, const Tag tag, const uint64_t handle) {
|
|
46
|
+
const auto it = pendingStarts.find(tag);
|
|
47
|
+
// every scheduled start keeps its entry alive until it is consumed —
|
|
48
|
+
// cancellations only bump the handle, they never erase
|
|
49
|
+
react_native_assert(it != pendingStarts.end() && "PendingStart not found");
|
|
50
|
+
const bool isCancelled = it->second.handle != handle;
|
|
51
|
+
if (--it->second.count == 0) {
|
|
52
|
+
pendingStarts.erase(it);
|
|
53
|
+
}
|
|
54
|
+
return isCancelled;
|
|
55
|
+
}
|
|
56
|
+
#endif
|
|
57
|
+
|
|
27
58
|
class LayoutAnimationsProxyCommon : public facebook::react::MountingOverrideDelegate {
|
|
28
59
|
public:
|
|
29
60
|
LayoutAnimationsProxyCommon(
|
|
30
|
-
std::shared_ptr<LayoutAnimationsManager> layoutAnimationsManager,
|
|
31
|
-
SharedComponentDescriptorRegistry componentDescriptorRegistry,
|
|
32
|
-
std::shared_ptr<const ContextContainer> contextContainer,
|
|
61
|
+
const std::shared_ptr<LayoutAnimationsManager> &layoutAnimationsManager,
|
|
62
|
+
const SharedComponentDescriptorRegistry &componentDescriptorRegistry,
|
|
63
|
+
const std::shared_ptr<const ContextContainer> &contextContainer,
|
|
33
64
|
jsi::Runtime &uiRuntime,
|
|
34
|
-
const std::shared_ptr<UIScheduler> uiScheduler
|
|
65
|
+
const std::shared_ptr<UIScheduler> &uiScheduler
|
|
35
66
|
#ifdef ANDROID
|
|
36
67
|
,
|
|
37
|
-
PreserveMountedTagsFunction filterUnmountedTagsFunction,
|
|
38
|
-
std::shared_ptr<facebook::react::UIManager> uiManager,
|
|
39
|
-
std::shared_ptr<facebook::react::CallInvoker> jsInvoker
|
|
68
|
+
const PreserveMountedTagsFunction &filterUnmountedTagsFunction,
|
|
69
|
+
const std::shared_ptr<facebook::react::UIManager> &uiManager,
|
|
70
|
+
const std::shared_ptr<facebook::react::CallInvoker> &jsInvoker
|
|
40
71
|
#endif
|
|
41
72
|
)
|
|
42
73
|
: layoutAnimationsManager_(layoutAnimationsManager),
|
|
@@ -60,7 +91,7 @@ class LayoutAnimationsProxyCommon : public facebook::react::MountingOverrideDele
|
|
|
60
91
|
virtual void startSurface(const SurfaceId surfaceId);
|
|
61
92
|
|
|
62
93
|
protected:
|
|
63
|
-
mutable std::
|
|
94
|
+
mutable std::unordered_set<Tag> maybeSettledAnimationTags_;
|
|
64
95
|
mutable std::unordered_map<Tag, LayoutAnimation> layoutAnimations_;
|
|
65
96
|
std::shared_ptr<LayoutAnimationsManager> layoutAnimationsManager_;
|
|
66
97
|
std::shared_ptr<const ContextContainer> contextContainer_;
|
|
@@ -75,6 +106,18 @@ class LayoutAnimationsProxyCommon : public facebook::react::MountingOverrideDele
|
|
|
75
106
|
|
|
76
107
|
void restoreOpacityInCaseOfFlakyEnteringAnimation(SurfaceId surfaceId) const;
|
|
77
108
|
|
|
109
|
+
// On Android pullTransaction can run on the JS thread, so animation starts
|
|
110
|
+
// are scheduled onto the UI thread. If `maybeCancelAnimation` is called between the
|
|
111
|
+
// start was scheduled and the lambda runs, it
|
|
112
|
+
// finds no `layoutAnimations_` entry to erase (the start lambda hasn't created it
|
|
113
|
+
// yet) and the cancellation is lost — the stale start would later
|
|
114
|
+
// "resurrect" the animation for a view whose Remove+Delete are already on
|
|
115
|
+
// their way to the mounting layer
|
|
116
|
+
// (https://github.com/software-mansion/react-native-reanimated/issues/7493).
|
|
117
|
+
|
|
118
|
+
// To work around this, we keep a separate `pendingStarts_` map that tracks scheduled starts by tag,
|
|
119
|
+
// with a generation counter to detect cancellations.
|
|
120
|
+
mutable std::unordered_map<Tag, PendingStart> pendingStarts_;
|
|
78
121
|
#endif
|
|
79
122
|
};
|
|
80
123
|
|