@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/CSS/common/values/CSSDiscreteArray.cpp
CHANGED
|
@@ -5,13 +5,13 @@
|
|
|
5
5
|
|
|
6
6
|
namespace reanimated::css {
|
|
7
7
|
|
|
8
|
-
template <
|
|
8
|
+
template <CSSValueDerived TValue>
|
|
9
9
|
CSSDiscreteArray<TValue>::CSSDiscreteArray() : values() {}
|
|
10
10
|
|
|
11
|
-
template <
|
|
11
|
+
template <CSSValueDerived TValue>
|
|
12
12
|
CSSDiscreteArray<TValue>::CSSDiscreteArray(const std::vector<TValue> &values) : values(values) {}
|
|
13
13
|
|
|
14
|
-
template <
|
|
14
|
+
template <CSSValueDerived TValue>
|
|
15
15
|
CSSDiscreteArray<TValue>::CSSDiscreteArray(jsi::Runtime &rt, const jsi::Value &jsiValue) {
|
|
16
16
|
const auto &array = jsiValue.asObject(rt).asArray(rt);
|
|
17
17
|
values.reserve(array.size(rt));
|
|
@@ -21,7 +21,7 @@ CSSDiscreteArray<TValue>::CSSDiscreteArray(jsi::Runtime &rt, const jsi::Value &j
|
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
template <
|
|
24
|
+
template <CSSValueDerived TValue>
|
|
25
25
|
CSSDiscreteArray<TValue>::CSSDiscreteArray(const folly::dynamic &array) {
|
|
26
26
|
values.reserve(array.size());
|
|
27
27
|
|
|
@@ -30,18 +30,18 @@ CSSDiscreteArray<TValue>::CSSDiscreteArray(const folly::dynamic &array) {
|
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
template <
|
|
33
|
+
template <CSSValueDerived TValue>
|
|
34
34
|
bool CSSDiscreteArray<TValue>::canConstruct(jsi::Runtime &rt, const jsi::Value &jsiValue) {
|
|
35
35
|
// TODO - maybe add better validation
|
|
36
36
|
return jsiValue.isObject() && jsiValue.asObject(rt).isArray(rt);
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
template <
|
|
39
|
+
template <CSSValueDerived TValue>
|
|
40
40
|
bool CSSDiscreteArray<TValue>::canConstruct(const folly::dynamic &value) {
|
|
41
41
|
return value.isArray();
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
template <
|
|
44
|
+
template <CSSValueDerived TValue>
|
|
45
45
|
folly::dynamic CSSDiscreteArray<TValue>::toDynamic() const {
|
|
46
46
|
folly::dynamic array = folly::dynamic::array;
|
|
47
47
|
for (const auto &value : values) {
|
|
@@ -50,7 +50,7 @@ folly::dynamic CSSDiscreteArray<TValue>::toDynamic() const {
|
|
|
50
50
|
return array;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
template <
|
|
53
|
+
template <CSSValueDerived TValue>
|
|
54
54
|
std::string CSSDiscreteArray<TValue>::toString() const {
|
|
55
55
|
std::stringstream ss;
|
|
56
56
|
|
|
@@ -66,13 +66,13 @@ std::string CSSDiscreteArray<TValue>::toString() const {
|
|
|
66
66
|
return ss.str();
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
template <
|
|
69
|
+
template <CSSValueDerived TValue>
|
|
70
70
|
CSSDiscreteArray<TValue> CSSDiscreteArray<TValue>::interpolate(double progress, const CSSDiscreteArray<TValue> &other)
|
|
71
71
|
const {
|
|
72
72
|
return CSSDiscreteArray<TValue>(progress < 0.5 ? values : other.values);
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
-
template <
|
|
75
|
+
template <CSSValueDerived TValue>
|
|
76
76
|
bool CSSDiscreteArray<TValue>::operator==(const CSSDiscreteArray<TValue> &other) const {
|
|
77
77
|
if (values.size() != other.values.size()) {
|
|
78
78
|
return false;
|
|
@@ -87,7 +87,7 @@ bool CSSDiscreteArray<TValue>::operator==(const CSSDiscreteArray<TValue> &other)
|
|
|
87
87
|
|
|
88
88
|
#ifndef NDEBUG
|
|
89
89
|
|
|
90
|
-
template <
|
|
90
|
+
template <CSSValueDerived TValue>
|
|
91
91
|
std::ostream &operator<<(std::ostream &os, const CSSDiscreteArray<TValue> &arrayValue) {
|
|
92
92
|
os << "CSSDiscreteArray(" << arrayValue.toString() << ")";
|
|
93
93
|
return os;
|
package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSDiscreteArray.h
CHANGED
|
@@ -2,23 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
#include <reanimated/CSS/common/values/CSSKeyword.h>
|
|
4
4
|
|
|
5
|
-
#include <sstream>
|
|
6
5
|
#include <string>
|
|
7
6
|
#include <vector>
|
|
8
|
-
#include <worklets/Tools/JSISerializer.h>
|
|
9
|
-
#include <type_traits>
|
|
10
7
|
|
|
11
8
|
namespace reanimated::css {
|
|
12
|
-
|
|
9
|
+
|
|
13
10
|
/*
|
|
14
11
|
* CSSDiscreteArray is used for array interpolation when arrays need to be
|
|
15
12
|
* treated as discrete values. Instead of interpolating between corresponding
|
|
16
13
|
* elements of two arrays, this type interpolates between entire arrays
|
|
17
14
|
* treated as single discrete values.
|
|
18
15
|
*/
|
|
19
|
-
template <
|
|
16
|
+
template <CSSValueDerived TValue>
|
|
20
17
|
struct CSSDiscreteArray : public CSSSimpleValue<CSSDiscreteArray<TValue>> {
|
|
21
|
-
static_assert(CSSValueDerived<TValue>, "TValue must be derived from CSSValue");
|
|
22
18
|
static constexpr bool is_discrete_value = true;
|
|
23
19
|
|
|
24
20
|
std::vector<TValue> values;
|
package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSLength.cpp
CHANGED
|
@@ -107,7 +107,10 @@ std::optional<double> CSSLength::resolve(const ResolvableValueInterpolationConte
|
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
bool CSSLength::operator==(const CSSLength &other) const {
|
|
110
|
-
|
|
110
|
+
if (isRelative == other.isRelative) {
|
|
111
|
+
return value == other.value;
|
|
112
|
+
}
|
|
113
|
+
return value == 0 && other.value == 0;
|
|
111
114
|
}
|
|
112
115
|
|
|
113
116
|
#ifndef NDEBUG
|
package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSNumber.cpp
CHANGED
|
@@ -55,8 +55,13 @@ CSSInteger CSSInteger::interpolate(double progress, const CSSInteger &other) con
|
|
|
55
55
|
return CSSInteger(static_cast<int>(std::round(value + progress * (other.value - value))));
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
+
CSSIndex CSSIndex::interpolate(double progress, const CSSIndex &other) const {
|
|
59
|
+
return CSSIndex(progress < 0.5 ? value : other.value);
|
|
60
|
+
}
|
|
61
|
+
|
|
58
62
|
template struct CSSNumberBase<CSSDouble, double>;
|
|
59
63
|
template struct CSSNumberBase<CSSInteger, int>;
|
|
64
|
+
template struct CSSNumberBase<CSSIndex, int>;
|
|
60
65
|
|
|
61
66
|
#ifdef ANDROID
|
|
62
67
|
|
|
@@ -39,6 +39,7 @@ struct CSSDouble : public CSSNumberBase<CSSDouble, double> {
|
|
|
39
39
|
// Inherit all constructors from the base class
|
|
40
40
|
using CSSNumberBase::CSSNumberBase;
|
|
41
41
|
};
|
|
42
|
+
|
|
42
43
|
struct CSSInteger : public CSSNumberBase<CSSInteger, int> {
|
|
43
44
|
// Inherit all constructors from the base class
|
|
44
45
|
using CSSNumberBase::CSSNumberBase;
|
|
@@ -46,6 +47,13 @@ struct CSSInteger : public CSSNumberBase<CSSInteger, int> {
|
|
|
46
47
|
CSSInteger interpolate(double progress, const CSSInteger &other) const override;
|
|
47
48
|
};
|
|
48
49
|
|
|
50
|
+
struct CSSIndex : public CSSNumberBase<CSSIndex, int> {
|
|
51
|
+
// Inherit all constructors from the base class
|
|
52
|
+
using CSSNumberBase::CSSNumberBase;
|
|
53
|
+
|
|
54
|
+
CSSIndex interpolate(double progress, const CSSIndex &other) const override;
|
|
55
|
+
};
|
|
56
|
+
|
|
49
57
|
#ifdef ANDROID
|
|
50
58
|
|
|
51
59
|
// For some reason Android crashes when blurRadius is smaller than 1 so we use a
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
#include <memory>
|
|
6
6
|
#include <string>
|
|
7
7
|
#include <type_traits>
|
|
8
|
+
#include <typeinfo>
|
|
8
9
|
|
|
9
10
|
namespace reanimated::css {
|
|
10
11
|
|
|
@@ -34,6 +35,8 @@ struct CSSValue {
|
|
|
34
35
|
|
|
35
36
|
virtual ~CSSValue() = default;
|
|
36
37
|
|
|
38
|
+
virtual bool operator==(const CSSValue &other) const = 0;
|
|
39
|
+
|
|
37
40
|
virtual folly::dynamic toDynamic() const = 0;
|
|
38
41
|
virtual std::string toString() const = 0;
|
|
39
42
|
};
|
|
@@ -43,6 +46,11 @@ template <typename TDerived>
|
|
|
43
46
|
struct CSSSimpleValue : public CSSValue {
|
|
44
47
|
static constexpr bool is_resolvable_value = false;
|
|
45
48
|
|
|
49
|
+
bool operator==(const CSSValue &other) const override {
|
|
50
|
+
return typeid(*this) == typeid(other) &&
|
|
51
|
+
*static_cast<const TDerived *>(this) == static_cast<const TDerived &>(other);
|
|
52
|
+
}
|
|
53
|
+
|
|
46
54
|
virtual TDerived interpolate(double progress, const TDerived &to) const = 0;
|
|
47
55
|
virtual bool canInterpolateTo(const TDerived &to) const {
|
|
48
56
|
return true;
|
|
@@ -54,9 +62,16 @@ template <typename TDerived, typename TResolved = TDerived>
|
|
|
54
62
|
struct CSSResolvableValue : public CSSValue {
|
|
55
63
|
static constexpr bool is_resolvable_value = true;
|
|
56
64
|
|
|
65
|
+
bool operator==(const CSSValue &other) const override {
|
|
66
|
+
return typeid(*this) == typeid(other) &&
|
|
67
|
+
*static_cast<const TDerived *>(this) == static_cast<const TDerived &>(other);
|
|
68
|
+
}
|
|
69
|
+
|
|
57
70
|
virtual TDerived interpolate(double progress, const TDerived &to, const ResolvableValueInterpolationContext &context)
|
|
58
71
|
const = 0;
|
|
59
|
-
virtual std::optional<TResolved> resolve(const ResolvableValueInterpolationContext &context) const
|
|
72
|
+
virtual std::optional<TResolved> resolve(const ResolvableValueInterpolationContext &context) const {
|
|
73
|
+
return std::nullopt;
|
|
74
|
+
}
|
|
60
75
|
virtual bool canInterpolateTo(const TDerived &to) const {
|
|
61
76
|
return true;
|
|
62
77
|
}
|
|
@@ -64,55 +79,21 @@ struct CSSResolvableValue : public CSSValue {
|
|
|
64
79
|
|
|
65
80
|
// Checks if a type is a resolvable value that needs resolution before
|
|
66
81
|
// interpolation
|
|
67
|
-
//template <typename TCSSValue>
|
|
68
|
-
//concept Resolvable = requires {
|
|
69
|
-
// { TCSSValue::is_resolvable_value } -> std::convertible_to<bool>;
|
|
70
|
-
// requires TCSSValue::is_resolvable_value == true;
|
|
71
|
-
//};
|
|
72
|
-
//TODO
|
|
73
|
-
namespace detail {
|
|
74
|
-
template <typename T>
|
|
75
|
-
auto test_resolvable(int) -> std::enable_if_t<
|
|
76
|
-
std::is_convertible_v<decltype(T::is_resolvable_value), bool> &&
|
|
77
|
-
T::is_resolvable_value == true,
|
|
78
|
-
std::true_type
|
|
79
|
-
>;
|
|
80
|
-
template <typename>
|
|
81
|
-
auto test_resolvable(...) -> std::false_type;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
82
|
template <typename TCSSValue>
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
// Checks if a type is a discrete value
|
|
90
|
-
//template <typename TCSSValue>
|
|
91
|
-
//concept Discrete = requires {
|
|
92
|
-
// { TCSSValue::is_discrete_value } -> std::convertible_to<bool>;
|
|
93
|
-
// requires TCSSValue::is_discrete_value == true;
|
|
94
|
-
//};
|
|
95
|
-
//TODO
|
|
96
|
-
namespace detail {
|
|
97
|
-
template <typename T>
|
|
98
|
-
auto test_discrete(int) -> std::enable_if_t<
|
|
99
|
-
std::is_convertible_v<decltype(T::is_discrete_value), bool> &&
|
|
100
|
-
T::is_discrete_value == true,
|
|
101
|
-
std::true_type
|
|
102
|
-
>;
|
|
103
|
-
template <typename>
|
|
104
|
-
auto test_discrete(...) -> std::false_type;
|
|
105
|
-
}
|
|
83
|
+
concept Resolvable = requires {
|
|
84
|
+
{ TCSSValue::is_resolvable_value } -> std::convertible_to<bool>;
|
|
85
|
+
requires TCSSValue::is_resolvable_value == true;
|
|
86
|
+
};
|
|
106
87
|
|
|
88
|
+
// Checks if a type is a discrete value
|
|
107
89
|
template <typename TCSSValue>
|
|
108
|
-
|
|
109
|
-
|
|
90
|
+
concept Discrete = requires {
|
|
91
|
+
{ TCSSValue::is_discrete_value } -> std::convertible_to<bool>;
|
|
92
|
+
requires TCSSValue::is_discrete_value == true;
|
|
93
|
+
};
|
|
110
94
|
|
|
111
95
|
// Check if a type is derived from CSSValue
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
//TODO
|
|
115
|
-
template<typename TCSSValue>
|
|
116
|
-
constexpr bool CSSValueDerived = std::is_base_of_v<CSSValue, TCSSValue>;
|
|
96
|
+
template <typename TCSSValue>
|
|
97
|
+
concept CSSValueDerived = std::is_base_of_v<CSSValue, TCSSValue>;
|
|
117
98
|
|
|
118
99
|
} // namespace reanimated::css
|
package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSValueVariant.cpp
CHANGED
|
@@ -7,11 +7,12 @@
|
|
|
7
7
|
#include <reanimated/CSS/common/values/CSSNumber.h>
|
|
8
8
|
#include <reanimated/CSS/common/values/CSSValueVariant.h>
|
|
9
9
|
#include <reanimated/CSS/common/values/complex/CSSBoxShadow.h>
|
|
10
|
+
#include <reanimated/CSS/svg/values/CSSLengthArray.h>
|
|
10
11
|
#include <reanimated/CSS/svg/values/SVGBrush.h>
|
|
11
|
-
#include <reanimated/CSS/svg/values/
|
|
12
|
+
#include <reanimated/CSS/svg/values/SVGPath.h>
|
|
13
|
+
#include <reanimated/CSS/svg/values/SVGStops.h>
|
|
12
14
|
#include <reanimated/CSS/svg/values/SVGStrokeDashArray.h>
|
|
13
|
-
|
|
14
|
-
#include <worklets/Tools/JSISerializer.h>
|
|
15
|
+
#include <reanimated/Compat/WorkletsApi.h>
|
|
15
16
|
|
|
16
17
|
#include <string>
|
|
17
18
|
#include <utility>
|
|
@@ -19,11 +20,11 @@
|
|
|
19
20
|
|
|
20
21
|
namespace reanimated::css {
|
|
21
22
|
|
|
22
|
-
template <
|
|
23
|
+
template <CSSValueDerived... AllowedTypes>
|
|
23
24
|
CSSValueVariant<AllowedTypes...>::CSSValueVariant(std::variant<AllowedTypes...> &&storage)
|
|
24
25
|
: storage_(std::move(storage)) {}
|
|
25
26
|
|
|
26
|
-
template <
|
|
27
|
+
template <CSSValueDerived... AllowedTypes>
|
|
27
28
|
CSSValueVariant<AllowedTypes...>::CSSValueVariant(jsi::Runtime &rt, const jsi::Value &jsiValue) {
|
|
28
29
|
auto tryOne = [&]<typename TCSSValue>() -> bool {
|
|
29
30
|
// We have to check in a runtime if the type can be constructed from the
|
|
@@ -39,11 +40,11 @@ CSSValueVariant<AllowedTypes...>::CSSValueVariant(jsi::Runtime &rt, const jsi::V
|
|
|
39
40
|
// Try constructing with each allowed type until one succeeds
|
|
40
41
|
if (!(tryOne.template operator()<AllowedTypes>() || ...)) {
|
|
41
42
|
throw std::runtime_error(
|
|
42
|
-
"[Reanimated] No compatible type found for construction from: " + worklets::
|
|
43
|
+
"[Reanimated] No compatible type found for construction from: " + worklets::JSIValueToStdString(rt, jsiValue));
|
|
43
44
|
}
|
|
44
45
|
}
|
|
45
46
|
|
|
46
|
-
template <
|
|
47
|
+
template <CSSValueDerived... AllowedTypes>
|
|
47
48
|
CSSValueVariant<AllowedTypes...>::CSSValueVariant(const folly::dynamic &value) {
|
|
48
49
|
auto tryOne = [&]<typename TCSSValue>() -> bool {
|
|
49
50
|
// We have to check in a runtime if the type can be constructed from the
|
|
@@ -62,7 +63,7 @@ CSSValueVariant<AllowedTypes...>::CSSValueVariant(const folly::dynamic &value) {
|
|
|
62
63
|
}
|
|
63
64
|
}
|
|
64
65
|
|
|
65
|
-
template <
|
|
66
|
+
template <CSSValueDerived... AllowedTypes>
|
|
66
67
|
bool CSSValueVariant<AllowedTypes...>::operator==(const CSSValueVariant &other) const {
|
|
67
68
|
if (storage_.index() != other.storage_.index()) {
|
|
68
69
|
return false;
|
|
@@ -79,25 +80,22 @@ bool CSSValueVariant<AllowedTypes...>::operator==(const CSSValueVariant &other)
|
|
|
79
80
|
other.storage_);
|
|
80
81
|
}
|
|
81
82
|
|
|
82
|
-
template <
|
|
83
|
+
template <CSSValueDerived... AllowedTypes>
|
|
83
84
|
bool CSSValueVariant<AllowedTypes...>::operator==(const CSSValue &other) const {
|
|
84
|
-
|
|
85
|
-
return *this == *o;
|
|
86
|
-
}
|
|
87
|
-
return false;
|
|
85
|
+
return typeid(*this) == typeid(other) && *this == static_cast<const CSSValueVariant &>(other);
|
|
88
86
|
}
|
|
89
87
|
|
|
90
|
-
template <
|
|
88
|
+
template <CSSValueDerived... AllowedTypes>
|
|
91
89
|
folly::dynamic CSSValueVariant<AllowedTypes...>::toDynamic() const {
|
|
92
90
|
return std::visit([](const auto &v) { return v.toDynamic(); }, storage_);
|
|
93
91
|
}
|
|
94
92
|
|
|
95
|
-
template <
|
|
93
|
+
template <CSSValueDerived... AllowedTypes>
|
|
96
94
|
std::string CSSValueVariant<AllowedTypes...>::toString() const {
|
|
97
95
|
return std::visit([](const auto &v) { return v.toString(); }, storage_);
|
|
98
96
|
}
|
|
99
97
|
|
|
100
|
-
template <
|
|
98
|
+
template <CSSValueDerived... AllowedTypes>
|
|
101
99
|
CSSValueVariant<AllowedTypes...> CSSValueVariant<AllowedTypes...>::interpolate(
|
|
102
100
|
const double progress,
|
|
103
101
|
const CSSValueVariant &to,
|
|
@@ -121,7 +119,7 @@ CSSValueVariant<AllowedTypes...> CSSValueVariant<AllowedTypes...>::interpolate(
|
|
|
121
119
|
to.storage_);
|
|
122
120
|
}
|
|
123
121
|
|
|
124
|
-
template <
|
|
122
|
+
template <CSSValueDerived... AllowedTypes>
|
|
125
123
|
CSSValueVariant<AllowedTypes...> CSSValueVariant<AllowedTypes...>::interpolate(
|
|
126
124
|
const double progress,
|
|
127
125
|
const CSSValueVariant &to,
|
|
@@ -145,7 +143,7 @@ CSSValueVariant<AllowedTypes...> CSSValueVariant<AllowedTypes...>::interpolate(
|
|
|
145
143
|
to.storage_);
|
|
146
144
|
}
|
|
147
145
|
|
|
148
|
-
template <
|
|
146
|
+
template <CSSValueDerived... AllowedTypes>
|
|
149
147
|
CSSValueVariant<AllowedTypes...> CSSValueVariant<AllowedTypes...>::fallbackInterpolate(
|
|
150
148
|
const double progress,
|
|
151
149
|
const CSSValueVariant &to,
|
|
@@ -158,6 +156,7 @@ template class CSSValueVariant<CSSLength, CSSKeyword>;
|
|
|
158
156
|
template class CSSValueVariant<CSSDouble>;
|
|
159
157
|
template class CSSValueVariant<CSSDouble, CSSKeyword>;
|
|
160
158
|
template class CSSValueVariant<CSSInteger>;
|
|
159
|
+
template class CSSValueVariant<CSSIndex>;
|
|
161
160
|
template class CSSValueVariant<CSSKeyword>;
|
|
162
161
|
template class CSSValueVariant<CSSAngle>;
|
|
163
162
|
template class CSSValueVariant<CSSBoolean>;
|
|
@@ -166,8 +165,9 @@ template class CSSValueVariant<CSSDisplay>;
|
|
|
166
165
|
template class CSSValueVariant<CSSBoxShadow>;
|
|
167
166
|
template class CSSValueVariant<CSSDiscreteArray<CSSKeyword>>;
|
|
168
167
|
|
|
169
|
-
template class CSSValueVariant<
|
|
170
|
-
template class CSSValueVariant<
|
|
168
|
+
template class CSSValueVariant<SVGPath>;
|
|
169
|
+
template class CSSValueVariant<CSSLengthArray>;
|
|
170
|
+
template class CSSValueVariant<SVGStops>;
|
|
171
171
|
template class CSSValueVariant<SVGStrokeDashArray, CSSKeyword>;
|
|
172
172
|
template class CSSValueVariant<SVGBrush>;
|
|
173
173
|
|
package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSValueVariant.h
CHANGED
|
@@ -52,7 +52,7 @@ concept DynamicConstructibleCSSValue = requires(const folly::dynamic &value) {
|
|
|
52
52
|
*
|
|
53
53
|
* A std::variant-based container for multiple CSSValue-derived types.
|
|
54
54
|
*/
|
|
55
|
-
template <
|
|
55
|
+
template <CSSValueDerived... AllowedTypes>
|
|
56
56
|
class CSSValueVariant final : public CSSValue {
|
|
57
57
|
static_assert(
|
|
58
58
|
(JSIConstructibleCSSValue<AllowedTypes> && ...),
|
|
@@ -82,7 +82,7 @@ class CSSValueVariant final : public CSSValue {
|
|
|
82
82
|
explicit CSSValueVariant(const folly::dynamic &value);
|
|
83
83
|
|
|
84
84
|
bool operator==(const CSSValueVariant &other) const;
|
|
85
|
-
bool operator==(const CSSValue &other) const;
|
|
85
|
+
bool operator==(const CSSValue &other) const override;
|
|
86
86
|
|
|
87
87
|
folly::dynamic toDynamic() const override;
|
|
88
88
|
std::string toString() const override;
|
|
@@ -26,10 +26,10 @@ struct CSSDropShadow : public CSSSimpleValue<CSSDropShadow> {
|
|
|
26
26
|
static bool canConstruct(const folly::dynamic &value);
|
|
27
27
|
static bool canConstruct(jsi::Runtime &rt, const jsi::Value &jsiValue);
|
|
28
28
|
|
|
29
|
-
folly::dynamic toDynamic() const;
|
|
30
|
-
std::string toString() const;
|
|
29
|
+
folly::dynamic toDynamic() const override;
|
|
30
|
+
std::string toString() const override;
|
|
31
31
|
|
|
32
|
-
CSSDropShadow interpolate(double progress, const CSSDropShadow &to) const;
|
|
32
|
+
CSSDropShadow interpolate(double progress, const CSSDropShadow &to) const override;
|
|
33
33
|
|
|
34
34
|
bool operator==(const CSSDropShadow &other) const;
|
|
35
35
|
|
package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/configs/CSSAnimationConfig.cpp
CHANGED
|
@@ -8,6 +8,14 @@
|
|
|
8
8
|
|
|
9
9
|
namespace reanimated::css {
|
|
10
10
|
|
|
11
|
+
bool CSSAnimationSettings::hasForwardsFillMode() const {
|
|
12
|
+
return fillMode == AnimationFillMode::Forwards || fillMode == AnimationFillMode::Both;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
bool CSSAnimationSettings::hasBackwardsFillMode() const {
|
|
16
|
+
return fillMode == AnimationFillMode::Backwards || fillMode == AnimationFillMode::Both;
|
|
17
|
+
}
|
|
18
|
+
|
|
11
19
|
double getIterationCount(jsi::Runtime &rt, const jsi::Object &settings) {
|
|
12
20
|
return settings.getProperty(rt, "iterationCount").asNumber();
|
|
13
21
|
}
|
|
@@ -59,7 +67,7 @@ CSSAnimationSettings parseCSSAnimationSettings(jsi::Runtime &rt, const jsi::Valu
|
|
|
59
67
|
|
|
60
68
|
return {
|
|
61
69
|
getDuration(rt, settingsObj),
|
|
62
|
-
|
|
70
|
+
getEasingConfig(rt, settingsObj),
|
|
63
71
|
getDelay(rt, settingsObj),
|
|
64
72
|
getIterationCount(rt, settingsObj),
|
|
65
73
|
getDirection(rt, settingsObj),
|
|
@@ -76,7 +84,7 @@ PartialCSSAnimationSettings parsePartialCSSAnimationSettings(jsi::Runtime &rt, c
|
|
|
76
84
|
result.duration = getDuration(rt, partialObj);
|
|
77
85
|
}
|
|
78
86
|
if (partialObj.hasProperty(rt, "timingFunction")) {
|
|
79
|
-
result.
|
|
87
|
+
result.easingConfig = getEasingConfig(rt, partialObj);
|
|
80
88
|
}
|
|
81
89
|
if (partialObj.hasProperty(rt, "delay")) {
|
|
82
90
|
result.delay = getDelay(rt, partialObj);
|
package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/configs/CSSAnimationConfig.h
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
#include <reanimated/CSS/configs/CSSKeyframesConfig.h>
|
|
4
4
|
#include <reanimated/CSS/configs/common.h>
|
|
5
|
-
#include <reanimated/CSS/easing/EasingFunctions.h>
|
|
6
5
|
|
|
7
6
|
#include <optional>
|
|
8
7
|
#include <string>
|
|
@@ -17,17 +16,20 @@ enum class AnimationPlayState : std::uint8_t { Running, Paused };
|
|
|
17
16
|
|
|
18
17
|
struct CSSAnimationSettings {
|
|
19
18
|
double duration;
|
|
20
|
-
|
|
19
|
+
EasingConfig easingConfig;
|
|
21
20
|
double delay;
|
|
22
21
|
double iterationCount;
|
|
23
22
|
AnimationDirection direction;
|
|
24
23
|
AnimationFillMode fillMode;
|
|
25
24
|
AnimationPlayState playState;
|
|
25
|
+
|
|
26
|
+
bool hasForwardsFillMode() const;
|
|
27
|
+
bool hasBackwardsFillMode() const;
|
|
26
28
|
};
|
|
27
29
|
|
|
28
30
|
struct PartialCSSAnimationSettings {
|
|
29
31
|
std::optional<double> duration;
|
|
30
|
-
std::optional<
|
|
32
|
+
std::optional<EasingConfig> easingConfig;
|
|
31
33
|
std::optional<double> delay;
|
|
32
34
|
std::optional<double> iterationCount;
|
|
33
35
|
std::optional<AnimationDirection> direction;
|
package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/configs/CSSKeyframesConfig.cpp
CHANGED
|
@@ -1,45 +1,48 @@
|
|
|
1
1
|
#include <reanimated/CSS/configs/CSSKeyframesConfig.h>
|
|
2
2
|
|
|
3
|
+
#include <reanimated/CSS/configs/common.h>
|
|
4
|
+
|
|
3
5
|
#include <memory>
|
|
4
6
|
#include <string>
|
|
5
7
|
|
|
6
8
|
namespace reanimated::css {
|
|
7
9
|
|
|
8
|
-
std::shared_ptr<
|
|
10
|
+
std::shared_ptr<AnimationStyleInterpolatorFactory> createStyleInterpolatorFactory(
|
|
9
11
|
jsi::Runtime &rt,
|
|
10
12
|
const jsi::Object &config,
|
|
11
|
-
const std::string &
|
|
13
|
+
const std::string &nativeComponentName,
|
|
12
14
|
const std::shared_ptr<ViewStylesRepository> &viewStylesRepository) {
|
|
13
|
-
return std::make_shared<
|
|
14
|
-
rt, config.getProperty(rt, "
|
|
15
|
+
return std::make_shared<AnimationStyleInterpolatorFactory>(
|
|
16
|
+
rt, config.getProperty(rt, "propKeyframes"), nativeComponentName, viewStylesRepository);
|
|
15
17
|
}
|
|
16
18
|
|
|
17
|
-
std::shared_ptr<
|
|
18
|
-
|
|
19
|
-
const auto &
|
|
20
|
-
const auto
|
|
21
|
-
const auto
|
|
19
|
+
std::shared_ptr<KeyframeEasingConfigs> getKeyframeTimingConfigs(jsi::Runtime &rt, const jsi::Object &config) {
|
|
20
|
+
KeyframeEasingConfigs result;
|
|
21
|
+
const auto &keyframeTimingConfigs = config.getProperty(rt, "keyframeTimingFunctions").asObject(rt);
|
|
22
|
+
const auto timingConfigOffsets = keyframeTimingConfigs.getPropertyNames(rt);
|
|
23
|
+
const auto timingConfigsCount = timingConfigOffsets.size(rt);
|
|
22
24
|
|
|
23
|
-
for (size_t i = 0; i <
|
|
24
|
-
const auto offset =
|
|
25
|
-
const auto
|
|
25
|
+
for (size_t i = 0; i < timingConfigsCount; ++i) {
|
|
26
|
+
const auto offset = timingConfigOffsets.getValueAtIndex(rt, i).asString(rt).utf8(rt);
|
|
27
|
+
const auto easingConfig = getEasingConfig(rt, keyframeTimingConfigs.getProperty(rt, offset.c_str()));
|
|
26
28
|
|
|
27
|
-
result[std::stod(offset)] =
|
|
29
|
+
result[std::stod(offset)] = easingConfig;
|
|
28
30
|
}
|
|
29
31
|
|
|
30
|
-
return std::make_shared<
|
|
32
|
+
return std::make_shared<KeyframeEasingConfigs>(result);
|
|
31
33
|
}
|
|
32
34
|
|
|
33
35
|
CSSKeyframesConfig parseCSSAnimationKeyframesConfig(
|
|
34
36
|
jsi::Runtime &rt,
|
|
35
37
|
const jsi::Value &config,
|
|
36
|
-
const std::string &
|
|
38
|
+
const std::string &compoundComponentName,
|
|
37
39
|
const std::shared_ptr<ViewStylesRepository> &viewStylesRepository) {
|
|
38
40
|
const auto &configObj = config.asObject(rt);
|
|
41
|
+
const auto nativeComponentName = splitCompoundComponentName(compoundComponentName).first;
|
|
39
42
|
|
|
40
43
|
return {
|
|
41
|
-
|
|
42
|
-
|
|
44
|
+
createStyleInterpolatorFactory(rt, configObj, nativeComponentName, viewStylesRepository),
|
|
45
|
+
getKeyframeTimingConfigs(rt, configObj)};
|
|
43
46
|
}
|
|
44
47
|
|
|
45
48
|
} // namespace reanimated::css
|
package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/configs/CSSKeyframesConfig.h
CHANGED
|
@@ -1,26 +1,23 @@
|
|
|
1
1
|
#pragma once
|
|
2
2
|
|
|
3
|
-
#include <reanimated/CSS/easing/
|
|
4
|
-
#include <reanimated/CSS/interpolation/styles/
|
|
3
|
+
#include <reanimated/CSS/easing/EasingConfigs.h>
|
|
4
|
+
#include <reanimated/CSS/interpolation/styles/AnimationStyleInterpolatorFactory.h>
|
|
5
5
|
#include <reanimated/CSS/misc/ViewStylesRepository.h>
|
|
6
6
|
|
|
7
7
|
#include <memory>
|
|
8
8
|
#include <string>
|
|
9
|
-
#include <unordered_map>
|
|
10
9
|
|
|
11
10
|
namespace reanimated::css {
|
|
12
11
|
|
|
13
|
-
using KeyframeEasingFunctions = std::unordered_map<double, EasingFunction>;
|
|
14
|
-
|
|
15
12
|
struct CSSKeyframesConfig {
|
|
16
|
-
std::shared_ptr<
|
|
17
|
-
std::shared_ptr<
|
|
13
|
+
std::shared_ptr<AnimationStyleInterpolatorFactory> styleInterpolatorFactory;
|
|
14
|
+
std::shared_ptr<KeyframeEasingConfigs> keyframeEasingConfigs;
|
|
18
15
|
};
|
|
19
16
|
|
|
20
17
|
CSSKeyframesConfig parseCSSAnimationKeyframesConfig(
|
|
21
18
|
jsi::Runtime &rt,
|
|
22
19
|
const jsi::Value &config,
|
|
23
|
-
const std::string &
|
|
20
|
+
const std::string &compoundComponentName,
|
|
24
21
|
const std::shared_ptr<ViewStylesRepository> &viewStylesRepository);
|
|
25
22
|
|
|
26
23
|
} // namespace reanimated::css
|