@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/package.json
CHANGED
|
@@ -2,39 +2,61 @@
|
|
|
2
2
|
"name": "@react-native-ohos/react-native-reanimated",
|
|
3
3
|
"harmony": {
|
|
4
4
|
"alias": "react-native-reanimated",
|
|
5
|
-
"redirectInternalImports": true
|
|
5
|
+
"redirectInternalImports": true,
|
|
6
|
+
"autolinking": {
|
|
7
|
+
"etsPackageClassName": "ReanimatedPackage",
|
|
8
|
+
"cppPackageClassName": "ReanimatedPackage",
|
|
9
|
+
"cmakeLibraryTargetName": "rnoh_reanimated",
|
|
10
|
+
"ohPackageName": "@react-native-ohos/react-native-reanimated"
|
|
11
|
+
}
|
|
6
12
|
},
|
|
7
|
-
"version": "4.0
|
|
8
|
-
"description": "",
|
|
13
|
+
"version": "4.1.0-beta.1",
|
|
14
|
+
"description": "More powerful alternative to Animated library for React Native.",
|
|
9
15
|
"main": "lib/index.js",
|
|
10
16
|
"scripts": {
|
|
11
17
|
"build": "tsc",
|
|
12
|
-
"pack":"npm pack",
|
|
18
|
+
"pack": "npm pack",
|
|
13
19
|
"pack:prod": "npm pack",
|
|
14
20
|
"prepack": "npm run build",
|
|
15
21
|
"prepublishOnly": "npm run prepack && react-native verify-package-harmony --package-path . --skip-checks oh_package_name_is_derived_from_npm_package_name",
|
|
16
22
|
"update_version": "node ./scripts/update-version.js",
|
|
17
23
|
"deploy": "node ./scripts/deploy.js"
|
|
18
24
|
},
|
|
25
|
+
"keywords": [
|
|
26
|
+
"react-native",
|
|
27
|
+
"react",
|
|
28
|
+
"native",
|
|
29
|
+
"reanimated",
|
|
30
|
+
"harmony"
|
|
31
|
+
],
|
|
32
|
+
"homepage": "https://gitcode.com/CPF-RN/rntpc_react-native-reanimated",
|
|
33
|
+
"bugs": {
|
|
34
|
+
"url": "https://gitcode.com/CPF-RN/rntpc_react-native-reanimated/issues"
|
|
35
|
+
},
|
|
36
|
+
"repository": {
|
|
37
|
+
"type": "git",
|
|
38
|
+
"url": "https://gitcode.com/CPF-RN/rntpc_react-native-reanimated.git"
|
|
39
|
+
},
|
|
19
40
|
"peerDependencies": {
|
|
20
|
-
"react": "
|
|
21
|
-
"react-native": "
|
|
22
|
-
"react-native-reanimated": "4.
|
|
41
|
+
"react": "19.2.3",
|
|
42
|
+
"react-native": "0.84.1",
|
|
43
|
+
"react-native-reanimated": "4.5.3",
|
|
44
|
+
"react-native-worklets": "0.11.4"
|
|
23
45
|
},
|
|
24
46
|
"author": "",
|
|
25
|
-
"license": "
|
|
47
|
+
"license": "MIT",
|
|
26
48
|
"dependencies": {
|
|
27
|
-
|
|
28
|
-
"react-native-reanimated": "4.
|
|
29
|
-
"semver": "7.7.3"
|
|
49
|
+
"@types/node": "^24.0.14",
|
|
50
|
+
"react-native-reanimated": "4.5.3",
|
|
51
|
+
"semver": "^7.7.3"
|
|
30
52
|
},
|
|
31
53
|
"devDependencies": {
|
|
32
54
|
"@babel/core": "7.28.4",
|
|
33
55
|
"@babel/preset-env": "7.28.3",
|
|
34
|
-
"@react-native/babel-preset": "0.
|
|
35
|
-
"@react-native/eslint-config": "0.
|
|
36
|
-
"@react-native/metro-config": "0.
|
|
37
|
-
"@react-native/typescript-config": "0.
|
|
56
|
+
"@react-native/babel-preset": "0.84.1",
|
|
57
|
+
"@react-native/eslint-config": "0.84.1",
|
|
58
|
+
"@react-native/metro-config": "0.84.1",
|
|
59
|
+
"@react-native/typescript-config": "0.84.1",
|
|
38
60
|
"@testing-library/jest-native": "5.4.3",
|
|
39
61
|
"@testing-library/react-hooks": "8.0.1",
|
|
40
62
|
"@testing-library/react-native": "13.3.3",
|
|
@@ -50,21 +72,27 @@
|
|
|
50
72
|
"knip": "5.61.3",
|
|
51
73
|
"madge": "8.0.0",
|
|
52
74
|
"prettier": "3.6.2",
|
|
53
|
-
"react": "19.
|
|
54
|
-
"react-dom": "19.
|
|
55
|
-
"react-native": "0.
|
|
56
|
-
"react-native-builder-bob": "0.
|
|
75
|
+
"react": "19.2.3",
|
|
76
|
+
"react-dom": "19.2.3",
|
|
77
|
+
"react-native": "0.84.1",
|
|
78
|
+
"react-native-builder-bob": "0.43.0",
|
|
57
79
|
"react-native-web": "0.21.1",
|
|
58
|
-
"react-native-worklets": "0.
|
|
59
|
-
"react-test-renderer": "19.
|
|
80
|
+
"react-native-worklets": "0.11.4",
|
|
81
|
+
"react-test-renderer": "19.2.3",
|
|
60
82
|
"typescript": "5.8.3"
|
|
61
83
|
},
|
|
62
84
|
"files": [
|
|
63
85
|
"lib",
|
|
64
86
|
"harmony",
|
|
65
|
-
|
|
87
|
+
"scripts",
|
|
66
88
|
"src",
|
|
89
|
+
"!build",
|
|
90
|
+
"CHANGELOG.md",
|
|
67
91
|
"./harmony.tar.gz",
|
|
68
|
-
|
|
69
|
-
]
|
|
92
|
+
"compatibility.json"
|
|
93
|
+
],
|
|
94
|
+
"publishConfig": {
|
|
95
|
+
"access": "public",
|
|
96
|
+
"registry": "https://registry.npmjs.org/"
|
|
97
|
+
}
|
|
70
98
|
}
|
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
#include <reanimated/CSS/core/CSSTransition.h>
|
|
2
|
-
|
|
3
|
-
#include <memory>
|
|
4
|
-
#include <string>
|
|
5
|
-
#include <unordered_set>
|
|
6
|
-
#include <utility>
|
|
7
|
-
|
|
8
|
-
namespace reanimated::css {
|
|
9
|
-
|
|
10
|
-
CSSTransition::CSSTransition(
|
|
11
|
-
std::shared_ptr<const ShadowNode> shadowNode,
|
|
12
|
-
const CSSTransitionConfig &config,
|
|
13
|
-
const std::shared_ptr<ViewStylesRepository> &viewStylesRepository)
|
|
14
|
-
: shadowNode_(std::move(shadowNode)),
|
|
15
|
-
viewStylesRepository_(viewStylesRepository),
|
|
16
|
-
properties_(config.properties),
|
|
17
|
-
settings_(config.settings),
|
|
18
|
-
styleInterpolator_(TransitionStyleInterpolator(shadowNode_->getComponentName(), viewStylesRepository)),
|
|
19
|
-
progressProvider_(TransitionProgressProvider()) {
|
|
20
|
-
updateAllowedDiscreteProperties();
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
Tag CSSTransition::getViewTag() const {
|
|
24
|
-
return shadowNode_->getTag();
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
std::shared_ptr<const ShadowNode> CSSTransition::getShadowNode() const {
|
|
28
|
-
return shadowNode_;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
double CSSTransition::getMinDelay(double timestamp) const {
|
|
32
|
-
return progressProvider_.getMinDelay(timestamp);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
TransitionProgressState CSSTransition::getState() const {
|
|
36
|
-
return progressProvider_.getState();
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
folly::dynamic CSSTransition::getCurrentInterpolationStyle() const {
|
|
40
|
-
return styleInterpolator_.interpolate(shadowNode_, progressProvider_, allowDiscreteProperties_);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
TransitionProperties CSSTransition::getProperties() const {
|
|
44
|
-
return properties_;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
PropertyNames CSSTransition::getAllowedProperties(const folly::dynamic &oldProps, const folly::dynamic &newProps) {
|
|
48
|
-
if (!oldProps.isObject() || !newProps.isObject()) {
|
|
49
|
-
return {};
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
// If specific properties are set, process only those
|
|
53
|
-
if (properties_.has_value()) {
|
|
54
|
-
PropertyNames allowedProps;
|
|
55
|
-
const auto &properties = properties_.value();
|
|
56
|
-
allowedProps.reserve(properties.size());
|
|
57
|
-
|
|
58
|
-
for (const auto &prop : properties) {
|
|
59
|
-
if (isAllowedProperty(prop)) {
|
|
60
|
-
allowedProps.push_back(prop);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
return allowedProps;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
// Process all properties from both old and new props
|
|
68
|
-
std::unordered_set<std::string> allAllowedProps;
|
|
69
|
-
|
|
70
|
-
for (const auto &props : {oldProps, newProps}) {
|
|
71
|
-
for (const auto &propertyName : props.keys()) {
|
|
72
|
-
if (isAllowedProperty(propertyName.asString())) {
|
|
73
|
-
allAllowedProps.insert(propertyName.asString());
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
return {allAllowedProps.begin(), allAllowedProps.end()};
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
void CSSTransition::updateSettings(const PartialCSSTransitionConfig &config) {
|
|
82
|
-
if (config.properties.has_value()) {
|
|
83
|
-
updateTransitionProperties(config.properties.value());
|
|
84
|
-
}
|
|
85
|
-
if (config.settings.has_value()) {
|
|
86
|
-
settings_ = config.settings.value();
|
|
87
|
-
updateAllowedDiscreteProperties();
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
folly::dynamic
|
|
92
|
-
CSSTransition::run(const ChangedProps &changedProps, const folly::dynamic &lastUpdateValue, const double timestamp) {
|
|
93
|
-
progressProvider_.runProgressProviders(
|
|
94
|
-
timestamp,
|
|
95
|
-
settings_,
|
|
96
|
-
changedProps.changedPropertyNames,
|
|
97
|
-
styleInterpolator_.getReversedPropertyNames(changedProps.newProps));
|
|
98
|
-
styleInterpolator_.updateInterpolatedProperties(changedProps, lastUpdateValue);
|
|
99
|
-
return update(timestamp);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
folly::dynamic CSSTransition::update(const double timestamp) {
|
|
103
|
-
progressProvider_.update(timestamp);
|
|
104
|
-
auto result = styleInterpolator_.interpolate(shadowNode_, progressProvider_, allowDiscreteProperties_);
|
|
105
|
-
// Remove interpolators for which interpolation has finished
|
|
106
|
-
// (we won't need them anymore in the current transition)
|
|
107
|
-
styleInterpolator_.discardFinishedInterpolators(progressProvider_);
|
|
108
|
-
// And remove finished progress providers after they were used to calculate
|
|
109
|
-
// the last frame of the transition
|
|
110
|
-
progressProvider_.discardFinishedProgressProviders();
|
|
111
|
-
return result;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
void CSSTransition::updateTransitionProperties(const TransitionProperties &properties) {
|
|
115
|
-
properties_ = properties;
|
|
116
|
-
|
|
117
|
-
const auto isAllPropertiesTransition = !properties_.has_value();
|
|
118
|
-
if (isAllPropertiesTransition) {
|
|
119
|
-
return;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
const std::unordered_set<std::string> transitionPropertyNames(properties_->begin(), properties_->end());
|
|
123
|
-
|
|
124
|
-
styleInterpolator_.discardIrrelevantInterpolators(transitionPropertyNames);
|
|
125
|
-
progressProvider_.discardIrrelevantProgressProviders(transitionPropertyNames);
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
void CSSTransition::updateAllowedDiscreteProperties() {
|
|
129
|
-
allowDiscreteProperties_.clear();
|
|
130
|
-
for (const auto &[propertyName, propertySettings] : settings_) {
|
|
131
|
-
if (propertySettings.allowDiscrete) {
|
|
132
|
-
allowDiscreteProperties_.insert(propertyName);
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
bool CSSTransition::isAllowedProperty(const std::string &propertyName) const {
|
|
138
|
-
if (!isDiscreteProperty(propertyName, shadowNode_->getComponentName())) {
|
|
139
|
-
return true;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
return allowDiscreteProperties_.contains(propertyName) || allowDiscreteProperties_.contains("all");
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
} // namespace reanimated::css
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
#pragma once
|
|
2
|
-
|
|
3
|
-
#include <reanimated/CSS/configs/CSSTransitionConfig.h>
|
|
4
|
-
#include <reanimated/CSS/easing/EasingFunctions.h>
|
|
5
|
-
#include <reanimated/CSS/interpolation/styles/TransitionStyleInterpolator.h>
|
|
6
|
-
#include <reanimated/CSS/progress/TransitionProgressProvider.h>
|
|
7
|
-
|
|
8
|
-
#include <memory>
|
|
9
|
-
#include <string>
|
|
10
|
-
#include <unordered_set>
|
|
11
|
-
|
|
12
|
-
namespace reanimated::css {
|
|
13
|
-
|
|
14
|
-
class CSSTransition {
|
|
15
|
-
public:
|
|
16
|
-
CSSTransition(
|
|
17
|
-
std::shared_ptr<const ShadowNode> shadowNode,
|
|
18
|
-
const CSSTransitionConfig &config,
|
|
19
|
-
const std::shared_ptr<ViewStylesRepository> &viewStylesRepository);
|
|
20
|
-
|
|
21
|
-
Tag getViewTag() const;
|
|
22
|
-
std::shared_ptr<const ShadowNode> getShadowNode() const;
|
|
23
|
-
double getMinDelay(double timestamp) const;
|
|
24
|
-
TransitionProgressState getState() const;
|
|
25
|
-
folly::dynamic getCurrentInterpolationStyle() const;
|
|
26
|
-
TransitionProperties getProperties() const;
|
|
27
|
-
PropertyNames getAllowedProperties(const folly::dynamic &oldProps, const folly::dynamic &newProps);
|
|
28
|
-
|
|
29
|
-
void updateSettings(const PartialCSSTransitionConfig &config);
|
|
30
|
-
folly::dynamic run(const ChangedProps &changedProps, const folly::dynamic &lastUpdateValue, double timestamp);
|
|
31
|
-
folly::dynamic update(double timestamp);
|
|
32
|
-
|
|
33
|
-
private:
|
|
34
|
-
const std::shared_ptr<const ShadowNode> shadowNode_;
|
|
35
|
-
const std::shared_ptr<ViewStylesRepository> viewStylesRepository_;
|
|
36
|
-
std::unordered_set<std::string> allowDiscreteProperties_;
|
|
37
|
-
TransitionProperties properties_;
|
|
38
|
-
CSSTransitionPropertiesSettings settings_;
|
|
39
|
-
TransitionStyleInterpolator styleInterpolator_;
|
|
40
|
-
TransitionProgressProvider progressProvider_;
|
|
41
|
-
|
|
42
|
-
void updateTransitionProperties(const TransitionProperties &properties);
|
|
43
|
-
void updateAllowedDiscreteProperties();
|
|
44
|
-
bool isAllowedProperty(const std::string &propertyName) const;
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
} // namespace reanimated::css
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
#include <reanimated/CSS/svg/values/SVGLength.h>
|
|
2
|
-
|
|
3
|
-
#include <string>
|
|
4
|
-
|
|
5
|
-
namespace reanimated::css {
|
|
6
|
-
|
|
7
|
-
SVGLength::SVGLength() : value(0), isPercentage(false) {}
|
|
8
|
-
|
|
9
|
-
SVGLength::SVGLength(const double value) : value(value), isPercentage(false) {}
|
|
10
|
-
|
|
11
|
-
SVGLength::SVGLength(const double value, const bool isPercentage) : value(value), isPercentage(isPercentage) {}
|
|
12
|
-
|
|
13
|
-
SVGLength::SVGLength(const char *value) {
|
|
14
|
-
if (!canConstruct(value)) {
|
|
15
|
-
throw std::invalid_argument("[Reanimated] SVGLength: Invalid value: " + std::string(value));
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
std::string str = value;
|
|
19
|
-
str.pop_back();
|
|
20
|
-
this->value = std::stod(str) / 100;
|
|
21
|
-
this->isPercentage = true;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
SVGLength::SVGLength(jsi::Runtime &rt, const jsi::Value &jsiValue) {
|
|
25
|
-
if (jsiValue.isNumber()) {
|
|
26
|
-
this->value = jsiValue.asNumber();
|
|
27
|
-
this->isPercentage = false;
|
|
28
|
-
} else {
|
|
29
|
-
*this = SVGLength(jsiValue.asString(rt).utf8(rt));
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
SVGLength::SVGLength(const folly::dynamic &value) {
|
|
34
|
-
if (value.isNumber()) {
|
|
35
|
-
this->value = value.getDouble();
|
|
36
|
-
this->isPercentage = false;
|
|
37
|
-
} else {
|
|
38
|
-
*this = SVGLength(value.asString().c_str());
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
bool SVGLength::canConstruct(const std::string &value) {
|
|
43
|
-
return !value.empty() && value.back() == '%';
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
bool SVGLength::canConstruct(const char *value) {
|
|
47
|
-
return canConstruct(std::string(value));
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
bool SVGLength::canConstruct(jsi::Runtime &rt, const jsi::Value &jsiValue) {
|
|
51
|
-
return jsiValue.isNumber() || (jsiValue.isString() && canConstruct(jsiValue.getString(rt).utf8(rt)));
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
bool SVGLength::canConstruct(const folly::dynamic &value) {
|
|
55
|
-
return value.isNumber() || (value.isString() && canConstruct(value.getString()));
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
folly::dynamic SVGLength::toDynamic() const {
|
|
59
|
-
if (isPercentage) {
|
|
60
|
-
return std::to_string(value * 100) + "%";
|
|
61
|
-
}
|
|
62
|
-
return value;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
std::string SVGLength::toString() const {
|
|
66
|
-
return std::to_string(value * (isPercentage ? 100 : 1)) + "%";
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
SVGLength SVGLength::interpolate(const double progress, const SVGLength &to) const {
|
|
70
|
-
// We can interpolate SVG length values only if both values are percentages or
|
|
71
|
-
// both are numbers. In other cases, we interpolate them as keywords.
|
|
72
|
-
if ((isPercentage == to.isPercentage) || (isPercentage && to.value == 0) || (to.isPercentage && value == 0)) {
|
|
73
|
-
return SVGLength(value + (to.value - value) * progress, isPercentage || to.isPercentage);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
// Otherwise, we interpolate values as discrete values
|
|
77
|
-
return progress < 0.5 ? *this : to;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
bool SVGLength::operator==(const SVGLength &other) const {
|
|
81
|
-
return value == other.value && isPercentage == other.isPercentage;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
#ifndef NDEBUG
|
|
85
|
-
|
|
86
|
-
std::ostream &operator<<(std::ostream &os, const SVGLength &value) {
|
|
87
|
-
os << "SVGLength(" << value.toString() << ")";
|
|
88
|
-
return os;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
#endif // NDEBUG
|
|
92
|
-
|
|
93
|
-
} // namespace reanimated::css
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
#pragma once
|
|
2
|
-
|
|
3
|
-
#include <reanimated/CSS/common/values/CSSValue.h>
|
|
4
|
-
|
|
5
|
-
#include <string>
|
|
6
|
-
|
|
7
|
-
namespace reanimated::css {
|
|
8
|
-
|
|
9
|
-
struct SVGLength : public CSSSimpleValue<SVGLength> {
|
|
10
|
-
double value;
|
|
11
|
-
bool isPercentage;
|
|
12
|
-
|
|
13
|
-
SVGLength();
|
|
14
|
-
explicit SVGLength(double value);
|
|
15
|
-
explicit SVGLength(double value, bool isPercentage);
|
|
16
|
-
explicit SVGLength(const char *value);
|
|
17
|
-
explicit SVGLength(jsi::Runtime &rt, const jsi::Value &jsiValue);
|
|
18
|
-
explicit SVGLength(const folly::dynamic &value);
|
|
19
|
-
|
|
20
|
-
static bool canConstruct(const std::string &value);
|
|
21
|
-
static bool canConstruct(const char *value);
|
|
22
|
-
static bool canConstruct(jsi::Runtime &rt, const jsi::Value &jsiValue);
|
|
23
|
-
static bool canConstruct(const folly::dynamic &value);
|
|
24
|
-
|
|
25
|
-
folly::dynamic toDynamic() const override;
|
|
26
|
-
std::string toString() const override;
|
|
27
|
-
SVGLength interpolate(double progress, const SVGLength &to) const override;
|
|
28
|
-
|
|
29
|
-
bool operator==(const SVGLength &other) const;
|
|
30
|
-
|
|
31
|
-
#ifndef NDEBUG
|
|
32
|
-
friend std::ostream &operator<<(std::ostream &os, const SVGLength &dimension);
|
|
33
|
-
#endif // NDEBUG
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
} // namespace reanimated::css
|
package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/utils/DelayedItemsManager.cpp
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
#include <reanimated/CSS/utils/DelayedItemsManager.h>
|
|
2
|
-
|
|
3
|
-
#include <functional>
|
|
4
|
-
#include <utility>
|
|
5
|
-
|
|
6
|
-
namespace reanimated::css {
|
|
7
|
-
|
|
8
|
-
template <typename TValue>
|
|
9
|
-
DelayedItem<TValue>::DelayedItem(double timestamp, TValue value) : timestamp(timestamp), value(std::move(value)) {}
|
|
10
|
-
|
|
11
|
-
template <typename TValue>
|
|
12
|
-
bool DelayedItemComparator<TValue>::operator()(const DelayedItem<TValue> &lhs, const DelayedItem<TValue> &rhs) const {
|
|
13
|
-
if (lhs.timestamp == rhs.timestamp) {
|
|
14
|
-
// Use address comparison as a tiebreaker when timestamps are equal
|
|
15
|
-
return std::less<const TValue *>{}(&lhs.value, &rhs.value);
|
|
16
|
-
}
|
|
17
|
-
return lhs.timestamp < rhs.timestamp;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
template <typename TValue>
|
|
21
|
-
void DelayedItemsManager<TValue>::add(const double timestamp, const TValue value) {
|
|
22
|
-
auto result = itemsSet_.emplace(timestamp, value);
|
|
23
|
-
if (result.second) {
|
|
24
|
-
itemsMap_[result.first->value] = result.first;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
template <typename TValue>
|
|
29
|
-
typename DelayedItemsManager<TValue>::Item DelayedItemsManager<TValue>::pop() {
|
|
30
|
-
if (itemsSet_.empty()) {
|
|
31
|
-
throw std::runtime_error("[Reanimated] No delayed items available to pop");
|
|
32
|
-
}
|
|
33
|
-
auto it = itemsSet_.begin();
|
|
34
|
-
Item result = std::move(*it);
|
|
35
|
-
itemsMap_.erase(it->value);
|
|
36
|
-
itemsSet_.erase(it);
|
|
37
|
-
return result;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
template <typename TValue>
|
|
41
|
-
bool DelayedItemsManager<TValue>::remove(const TValue value) {
|
|
42
|
-
auto it = itemsMap_.find(value);
|
|
43
|
-
|
|
44
|
-
if (it == itemsMap_.end()) {
|
|
45
|
-
return false;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
itemsSet_.erase(it->second);
|
|
49
|
-
itemsMap_.erase(it);
|
|
50
|
-
return true;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
template <typename TValue>
|
|
54
|
-
const typename DelayedItemsManager<TValue>::Item &DelayedItemsManager<TValue>::top() const {
|
|
55
|
-
if (itemsSet_.empty()) {
|
|
56
|
-
throw std::runtime_error("[Reanimated] No delayed items available");
|
|
57
|
-
}
|
|
58
|
-
return *itemsSet_.begin();
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
template <typename TValue>
|
|
62
|
-
bool DelayedItemsManager<TValue>::empty() const {
|
|
63
|
-
return itemsSet_.empty();
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
template <typename TValue>
|
|
67
|
-
size_t DelayedItemsManager<TValue>::size() const {
|
|
68
|
-
return itemsSet_.size();
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
// Declare the types that will be used in the DelayedItemsManager class
|
|
72
|
-
template class DelayedItemsManager<std::shared_ptr<CSSAnimation>>;
|
|
73
|
-
template class DelayedItemsManager<Tag>;
|
|
74
|
-
|
|
75
|
-
} // namespace reanimated::css
|
package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/utils/DelayedItemsManager.h
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
#pragma once
|
|
2
|
-
|
|
3
|
-
#include <reanimated/CSS/core/CSSAnimation.h>
|
|
4
|
-
|
|
5
|
-
#include <functional>
|
|
6
|
-
#include <memory>
|
|
7
|
-
#include <set>
|
|
8
|
-
#include <stdexcept>
|
|
9
|
-
#include <unordered_map>
|
|
10
|
-
#include <utility>
|
|
11
|
-
|
|
12
|
-
namespace reanimated::css {
|
|
13
|
-
|
|
14
|
-
template <typename TValue>
|
|
15
|
-
struct DelayedItem {
|
|
16
|
-
const double timestamp;
|
|
17
|
-
const TValue value;
|
|
18
|
-
|
|
19
|
-
DelayedItem(double timestamp, TValue value);
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
template <typename TValue>
|
|
23
|
-
struct DelayedItemComparator {
|
|
24
|
-
bool operator()(const DelayedItem<TValue> &lhs, const DelayedItem<TValue> &rhs) const;
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
template <typename TValue>
|
|
28
|
-
class DelayedItemsManager {
|
|
29
|
-
using Item = DelayedItem<TValue>;
|
|
30
|
-
using ItemSet = std::set<Item, DelayedItemComparator<TValue>>;
|
|
31
|
-
using ItemMap = std::unordered_map<TValue, typename ItemSet::iterator>;
|
|
32
|
-
|
|
33
|
-
ItemSet itemsSet_;
|
|
34
|
-
ItemMap itemsMap_;
|
|
35
|
-
|
|
36
|
-
public:
|
|
37
|
-
void add(double timestamp, TValue value);
|
|
38
|
-
Item pop();
|
|
39
|
-
bool remove(TValue value);
|
|
40
|
-
const Item &top() const;
|
|
41
|
-
bool empty() const;
|
|
42
|
-
size_t size() const;
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
} // namespace reanimated::css
|