@react-native-ohos/react-native-reanimated 3.18.1-rc.6 → 4.0.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/compatibility.json +161 -0
- package/harmony/reanimated/BuildProfile.ets +1 -1
- package/harmony/reanimated/build-profile.json5 +8 -1
- package/harmony/reanimated/oh-package.json5 +3 -2
- package/harmony/reanimated/src/main/cpp/CMakeLists.txt +31 -40
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/AnimatedSensor/AnimatedSensorModule.cpp +11 -16
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/AnimatedSensor/AnimatedSensorModule.h +3 -4
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/InterpolatorRegistry.cpp +390 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/InterpolatorRegistry.h +16 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/definitions.h +30 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/filters/FilterOp.cpp +46 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/filters/FilterOp.h +23 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/transforms/Quaternion.cpp +53 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/transforms/Quaternion.h +21 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/transforms/TransformMatrix.cpp +166 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/transforms/TransformMatrix.h +71 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/transforms/TransformMatrix2D.cpp +368 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/transforms/TransformMatrix2D.h +53 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/transforms/TransformMatrix3D.cpp +594 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/transforms/TransformMatrix3D.h +67 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/transforms/TransformOp.cpp +52 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/transforms/TransformOp.h +26 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/transforms/vectors.cpp +156 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/transforms/vectors.h +76 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSAngle.cpp +93 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSAngle.h +33 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSBoolean.cpp +48 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSBoolean.h +31 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSColor.cpp +135 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSColor.h +61 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSDiscreteArray.cpp +100 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSDiscreteArray.h +44 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSKeyword.cpp +81 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSKeyword.h +53 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSLength.cpp +122 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSLength.h +38 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSNumber.cpp +82 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSNumber.h +63 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSValue.h +118 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSValueVariant.cpp +174 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSValueVariant.h +111 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/complex/CSSBoxShadow.cpp +196 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/complex/CSSBoxShadow.h +66 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/complex/CSSDropShadow.cpp +134 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/complex/CSSDropShadow.h +44 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/configs/CSSAnimationConfig.cpp +174 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/configs/CSSAnimationConfig.h +49 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/configs/CSSKeyframesConfig.cpp +45 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/configs/CSSKeyframesConfig.h +26 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/configs/CSSTransitionConfig.cpp +90 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/configs/CSSTransitionConfig.h +43 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/configs/common.cpp +17 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/configs/common.h +13 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/core/CSSAnimation.cpp +127 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/core/CSSAnimation.h +51 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/core/CSSTransition.cpp +145 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/core/CSSTransition.h +47 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/easing/EasingFunctions.cpp +69 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/easing/EasingFunctions.h +22 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/easing/cubicBezier.cpp +66 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/easing/cubicBezier.h +15 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/easing/linear.cpp +28 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/easing/linear.h +15 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/easing/steps.cpp +13 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/easing/steps.h +12 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/InterpolatorFactory.cpp +157 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/InterpolatorFactory.h +189 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/PropertyInterpolator.cpp +76 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/PropertyInterpolator.h +66 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/configs.h +20 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/FilterOperation.cpp +136 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/FilterOperation.h +40 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/FilterOperationInterpolator.cpp +38 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/FilterOperationInterpolator.h +24 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/FilterStyleInterpolator.cpp +58 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/FilterStyleInterpolator.h +24 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/operations/blur.h +14 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/operations/brightness.h +14 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/operations/contrast.h +14 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/operations/dropShadow.h +17 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/operations/grayscale.h +14 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/operations/hueRotate.h +14 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/operations/invert.h +14 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/operations/opacity.h +14 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/operations/saturate.h +14 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/operations/sepia.h +14 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/groups/ArrayPropertiesInterpolator.cpp +95 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/groups/ArrayPropertiesInterpolator.h +36 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/groups/GroupPropertiesInterpolator.cpp +41 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/groups/GroupPropertiesInterpolator.h +32 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/groups/RecordPropertiesInterpolator.cpp +99 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/groups/RecordPropertiesInterpolator.h +37 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/operations/OperationsStyleInterpolator.cpp +308 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/operations/OperationsStyleInterpolator.h +100 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/operations/StyleOperation.cpp +19 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/operations/StyleOperation.h +94 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/operations/StyleOperationInterpolator.cpp +18 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/operations/StyleOperationInterpolator.h +43 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/styles/AnimationStyleInterpolator.h +26 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/styles/TransitionStyleInterpolator.cpp +103 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/styles/TransitionStyleInterpolator.h +42 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/TransformOperation.cpp +224 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/TransformOperation.h +52 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/TransformOperationInterpolator.cpp +218 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/TransformOperationInterpolator.h +89 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/TransformsStyleInterpolator.cpp +149 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/TransformsStyleInterpolator.h +33 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/operations/matrix.cpp +208 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/operations/matrix.h +56 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/operations/perspective.cpp +42 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/operations/perspective.h +20 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/operations/rotate.cpp +41 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/operations/rotate.h +39 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/operations/scale.cpp +28 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/operations/scale.h +25 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/operations/skew.cpp +14 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/operations/skew.h +20 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/operations/translate.cpp +39 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/operations/translate.h +25 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/values/ResolvableValueInterpolator.cpp +47 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/values/ResolvableValueInterpolator.h +43 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/values/SimpleValueInterpolator.cpp +70 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/values/SimpleValueInterpolator.h +40 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/values/ValueInterpolator.cpp +146 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/values/ValueInterpolator.h +71 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/misc/ViewStylesRepository.cpp +155 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/misc/ViewStylesRepository.h +53 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/progress/AnimationProgressProvider.cpp +170 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/progress/AnimationProgressProvider.h +67 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/progress/KeyframeProgressProvider.h +12 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/progress/RawProgressProvider.cpp +41 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/progress/RawProgressProvider.h +31 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/progress/TransitionProgressProvider.cpp +193 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/progress/TransitionProgressProvider.h +77 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/registries/CSSAnimationsRegistry.cpp +340 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/registries/CSSAnimationsRegistry.h +80 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/registries/CSSKeyframesRegistry.cpp +45 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/registries/CSSKeyframesRegistry.h +29 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/registries/CSSTransitionsRegistry.cpp +167 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/registries/CSSTransitionsRegistry.h +51 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/registries/StaticPropsRegistry.cpp +61 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/registries/StaticPropsRegistry.h +33 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/svg/values/SVGBrush.cpp +80 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/svg/values/SVGBrush.h +39 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/svg/values/SVGLength.cpp +93 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/svg/values/SVGLength.h +36 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/svg/values/SVGStrokeDashArray.cpp +110 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/svg/values/SVGStrokeDashArray.h +33 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/utils/DelayedItemsManager.cpp +75 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/utils/DelayedItemsManager.h +45 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/utils/algorithms.cpp +12 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/utils/algorithms.h +10 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/utils/interpolators.cpp +36 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/utils/interpolators.h +23 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/utils/props.cpp +149 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/utils/props.h +32 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/ReanimatedCommitHook.cpp +51 -39
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/ReanimatedCommitHook.h +13 -15
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/ReanimatedCommitShadowNode.h +0 -3
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/ReanimatedMountHook.cpp +22 -53
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/ReanimatedMountHook.h +12 -8
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/ShadowTreeCloner.cpp +46 -37
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/ShadowTreeCloner.h +3 -10
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/updates/AnimatedPropsRegistry.cpp +72 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/updates/AnimatedPropsRegistry.h +25 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/updates/UpdatesRegistry.cpp +160 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/updates/UpdatesRegistry.h +71 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/updates/UpdatesRegistryManager.cpp +161 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/updates/UpdatesRegistryManager.h +65 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationType.h +4 -2
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsManager.cpp +62 -157
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsManager.h +38 -46
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxyCommon.cpp +79 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxyCommon.h +81 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxy_Experimental.cpp +864 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxy_Experimental.h +214 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/{LayoutAnimationsProxy.cpp → LayoutAnimationsProxy_Legacy.cpp} +303 -276
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxy_Legacy.h +220 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsUtils.cpp +5 -65
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsUtils.h +52 -82
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/PropsDiffer.cpp +456 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/PropsDiffer.h +102 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/SharedTransitions.cpp +544 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/NativeModules/PropValueProcessor.cpp +119 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/NativeModules/PropValueProcessor.h +39 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/NativeModules/ReanimatedModuleProxy.cpp +957 -552
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/NativeModules/ReanimatedModuleProxy.h +87 -111
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/NativeModules/ReanimatedModuleProxySpec.cpp +115 -163
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/NativeModules/ReanimatedModuleProxySpec.h +38 -54
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/RuntimeDecorators/RNRuntimeDecorator.cpp +34 -36
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/RuntimeDecorators/RNRuntimeDecorator.h +8 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/RuntimeDecorators/UIRuntimeDecorator.cpp +46 -58
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/RuntimeDecorators/UIRuntimeDecorator.h +5 -9
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Tools/FeatureFlags.cpp +18 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Tools/FeatureFlags.h +44 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Tools/PlatformDepMethodsHolder.h +26 -57
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Tools/ReanimatedSystraceSection.h +12 -33
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Tools/ReanimatedVersion.cpp +46 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/{worklets → reanimated}/Tools/ReanimatedVersion.h +3 -4
- package/harmony/reanimated/src/main/cpp/ReanimatedModule.cpp +60 -85
- package/harmony/reanimated/src/main/cpp/ReanimatedNodesManager.cpp +1 -0
- package/harmony/reanimated/src/main/cpp/ReanimatedPackage.cpp +0 -3
- package/harmony/reanimated/src/main/cpp/ReanimatedSensor.cpp +266 -0
- package/harmony/reanimated/src/main/cpp/ReanimatedSensor.h +36 -0
- package/harmony/reanimated/src/main/cpp/ReanimatedSensorContainer.cpp +36 -0
- package/harmony/reanimated/src/main/cpp/ReanimatedSensorContainer.h +23 -0
- package/harmony/reanimated/src/main/cpp/ReanimatedUIScheduler.h +3 -3
- package/harmony/reanimated/src/main/ets/ReanimatedModule.ts +12 -1
- package/harmony/reanimated/src/main/ets/ReanimatedPackage.ts +1 -4
- package/harmony/reanimated.har +0 -0
- package/package.json +36 -18
- package/scripts/deploy.js +191 -0
- package/scripts/set-reanimated-version.js +37 -0
- package/scripts/update-version.js +119 -0
- package/scripts/validate-react-native-version.js +46 -0
- package/scripts/validate-worklets-build.js +17 -0
- package/scripts/validate-worklets-version.js +79 -0
- package/scripts/worklets-version.json +4 -0
- package/LICENSE +0 -21
- package/README.OpenSource +0 -11
- package/README.md +0 -10
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/PropsRegistry.cpp +0 -68
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/PropsRegistry.h +0 -68
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxy.h +0 -147
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Tools/CollectionUtils.h +0 -14
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Tools/FeaturesConfig.cpp +0 -5
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Tools/FeaturesConfig.h +0 -19
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/NativeModules/WorkletsModuleProxy.cpp +0 -47
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/NativeModules/WorkletsModuleProxy.h +0 -59
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/NativeModules/WorkletsModuleProxySpec.cpp +0 -27
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/NativeModules/WorkletsModuleProxySpec.h +0 -25
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Registries/EventHandlerRegistry.cpp +0 -94
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Registries/EventHandlerRegistry.h +0 -49
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Registries/WorkletRuntimeRegistry.cpp +0 -8
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Registries/WorkletRuntimeRegistry.h +0 -39
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/SharedItems/Shareables.cpp +0 -326
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/SharedItems/Shareables.h +0 -345
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/AsyncQueue.cpp +0 -52
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/AsyncQueue.h +0 -35
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/Defs.h +0 -10
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/JSISerializer.cpp +0 -342
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/JSISerializer.h +0 -47
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/JSLogger.cpp +0 -16
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/JSLogger.h +0 -20
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/JSScheduler.cpp +0 -20
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/JSScheduler.h +0 -29
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/PlatformLogger.h +0 -16
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/ReanimatedJSIUtils.cpp +0 -26
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/ReanimatedJSIUtils.h +0 -199
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/ReanimatedVersion.cpp +0 -95
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/SingleInstanceChecker.h +0 -72
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/ThreadSafeQueue.h +0 -49
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/UIScheduler.cpp +0 -20
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/UIScheduler.h +0 -22
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/WorkletEventHandler.cpp +0 -29
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/WorkletEventHandler.h +0 -41
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/RNRuntimeWorkletDecorator.cpp +0 -16
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/RNRuntimeWorkletDecorator.h +0 -19
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/ReanimatedHermesRuntime.cpp +0 -112
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/ReanimatedHermesRuntime.h +0 -127
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/ReanimatedRuntime.cpp +0 -53
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/ReanimatedRuntime.h +0 -22
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/RuntimeInitialization.md +0 -191
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/WorkletRuntime.cpp +0 -155
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/WorkletRuntime.h +0 -90
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/WorkletRuntimeCollector.h +0 -36
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/WorkletRuntimeDecorator.cpp +0 -182
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/WorkletRuntimeDecorator.h +0 -22
- package/harmony/reanimated/src/main/cpp/ReanimatedLogger.cpp +0 -33
- package/harmony/reanimated/src/main/cpp/WorkletsModule.cpp +0 -61
- package/harmony/reanimated/src/main/cpp/WorkletsModule.h +0 -22
- package/harmony/reanimated/src/main/cpp/patches/AnimatedSensor/AnimatedSensorModule.cpp +0 -89
- package/harmony/reanimated/src/main/cpp/patches/Fabric/ShadowTreeCloner.cpp +0 -95
- package/harmony/reanimated/src/main/cpp/patches/NativeModules/ReanimatedModuleProxy.cpp +0 -964
- package/harmony/reanimated/src/main/ets/WorkletsModule.ts +0 -15
package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Tools/ReanimatedSystraceSection.h
CHANGED
|
@@ -28,9 +28,7 @@ namespace reanimated {
|
|
|
28
28
|
struct ReanimatedSystraceSection {
|
|
29
29
|
public:
|
|
30
30
|
template <typename... ConvertsToStringPiece>
|
|
31
|
-
explicit ReanimatedSystraceSection(
|
|
32
|
-
const char *name,
|
|
33
|
-
ConvertsToStringPiece &&...args) {
|
|
31
|
+
explicit ReanimatedSystraceSection(const char *name, ConvertsToStringPiece &&...args) {
|
|
34
32
|
ATrace_beginSection(name);
|
|
35
33
|
}
|
|
36
34
|
|
|
@@ -42,8 +40,7 @@ struct ReanimatedSystraceSection {
|
|
|
42
40
|
// The apple part is copied from React Native
|
|
43
41
|
// from
|
|
44
42
|
// https://github.com/facebook/react-native/blob/5697d923a05119314b4cfcd556cb243986637764/packages/react-native/ReactCommon/cxxreact/SystraceSection.h
|
|
45
|
-
#elif defined(__APPLE__) && OS_LOG_TARGET_HAS_10_15_FEATURES &&
|
|
46
|
-
defined(REANIMATED_PROFILING)
|
|
43
|
+
#elif defined(__APPLE__) && OS_LOG_TARGET_HAS_10_15_FEATURES && defined(REANIMATED_PROFILING)
|
|
47
44
|
|
|
48
45
|
template <typename T, typename = void>
|
|
49
46
|
struct renderer {
|
|
@@ -55,8 +52,7 @@ struct renderer {
|
|
|
55
52
|
};
|
|
56
53
|
|
|
57
54
|
template <typename T>
|
|
58
|
-
static auto render(const T &t)
|
|
59
|
-
-> decltype(renderer<T>::render(std::declval<const T &>())) {
|
|
55
|
+
static auto render(const T &t) -> decltype(renderer<T>::render(std::declval<const T &>())) {
|
|
60
56
|
return renderer<T>::render(t);
|
|
61
57
|
}
|
|
62
58
|
|
|
@@ -64,8 +60,7 @@ inline os_log_t instrumentsLogHandle = nullptr;
|
|
|
64
60
|
|
|
65
61
|
static inline os_log_t getOrCreateInstrumentsLogHandle() {
|
|
66
62
|
if (!instrumentsLogHandle) {
|
|
67
|
-
instrumentsLogHandle = os_log_create(
|
|
68
|
-
"dev.reanimated.instruments", OS_LOG_CATEGORY_POINTS_OF_INTEREST);
|
|
63
|
+
instrumentsLogHandle = os_log_create("dev.reanimated.instruments", OS_LOG_CATEGORY_POINTS_OF_INTEREST);
|
|
69
64
|
}
|
|
70
65
|
return instrumentsLogHandle;
|
|
71
66
|
}
|
|
@@ -73,11 +68,8 @@ static inline os_log_t getOrCreateInstrumentsLogHandle() {
|
|
|
73
68
|
struct ReanimatedSystraceSection {
|
|
74
69
|
public:
|
|
75
70
|
template <typename... ConvertsToStringPiece>
|
|
76
|
-
explicit ReanimatedSystraceSection(
|
|
77
|
-
|
|
78
|
-
ConvertsToStringPiece &&...args) {
|
|
79
|
-
os_log_t instrumentsLogHandle =
|
|
80
|
-
reanimated::getOrCreateInstrumentsLogHandle();
|
|
71
|
+
explicit ReanimatedSystraceSection(const char *name, ConvertsToStringPiece &&...args) {
|
|
72
|
+
os_log_t instrumentsLogHandle = reanimated::getOrCreateInstrumentsLogHandle();
|
|
81
73
|
|
|
82
74
|
// If the log isn't enabled, we don't want the performance overhead of the
|
|
83
75
|
// rest of the code below.
|
|
@@ -87,8 +79,7 @@ struct ReanimatedSystraceSection {
|
|
|
87
79
|
|
|
88
80
|
name_ = name;
|
|
89
81
|
|
|
90
|
-
const auto argsVector =
|
|
91
|
-
std::vector<std::string>{reanimated::render(args)...};
|
|
82
|
+
const auto argsVector = std::vector<std::string>{reanimated::render(args)...};
|
|
92
83
|
std::string argsString = "";
|
|
93
84
|
for (size_t i = 0; i < argsVector.size(); i += 2) {
|
|
94
85
|
argsString += argsVector[i] + "=" + argsVector[i + 1] + ";";
|
|
@@ -97,21 +88,11 @@ struct ReanimatedSystraceSection {
|
|
|
97
88
|
signpostID_ = os_signpost_id_make_with_pointer(instrumentsLogHandle, this);
|
|
98
89
|
|
|
99
90
|
os_signpost_interval_begin(
|
|
100
|
-
instrumentsLogHandle,
|
|
101
|
-
signpostID_,
|
|
102
|
-
"Reanimated",
|
|
103
|
-
"%s begin: %s",
|
|
104
|
-
name,
|
|
105
|
-
argsString.c_str());
|
|
91
|
+
instrumentsLogHandle, signpostID_, "Reanimated", "%s begin: %s", name, argsString.c_str());
|
|
106
92
|
}
|
|
107
93
|
|
|
108
94
|
~ReanimatedSystraceSection() {
|
|
109
|
-
os_signpost_interval_end(
|
|
110
|
-
reanimated::instrumentsLogHandle,
|
|
111
|
-
signpostID_,
|
|
112
|
-
"Reanimated",
|
|
113
|
-
"%s end",
|
|
114
|
-
name_.data());
|
|
95
|
+
os_signpost_interval_end(reanimated::instrumentsLogHandle, signpostID_, "Reanimated", "%s end", name_.data());
|
|
115
96
|
}
|
|
116
97
|
|
|
117
98
|
private:
|
|
@@ -124,12 +105,10 @@ struct ReanimatedSystraceSection {
|
|
|
124
105
|
struct ReanimatedSystraceSection {
|
|
125
106
|
public:
|
|
126
107
|
template <typename... ConvertsToStringPiece>
|
|
127
|
-
explicit ReanimatedSystraceSection(
|
|
128
|
-
const char *name,
|
|
129
|
-
ConvertsToStringPiece &&...args) {}
|
|
108
|
+
explicit ReanimatedSystraceSection(const char *name, ConvertsToStringPiece &&...args) {}
|
|
130
109
|
};
|
|
131
110
|
|
|
132
|
-
#endif // defined(__APPLE__) && OS_LOG_TARGET_HAS_10_15_FEATURES &&
|
|
133
|
-
|
|
111
|
+
#endif // defined(__APPLE__) && OS_LOG_TARGET_HAS_10_15_FEATURES && \
|
|
112
|
+
// defined(REANIMATED_PROFILING)
|
|
134
113
|
|
|
135
114
|
} // namespace reanimated
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
#include <reanimated/Tools/ReanimatedVersion.h>
|
|
2
|
+
#include <worklets/Tools/JSLogger.h>
|
|
3
|
+
#include <worklets/Tools/VersionUtils.h>
|
|
4
|
+
|
|
5
|
+
#include <memory>
|
|
6
|
+
#include <string>
|
|
7
|
+
|
|
8
|
+
#ifdef REANIMATED_VERSION
|
|
9
|
+
#define STRINGIZE(x) #x
|
|
10
|
+
#define STRINGIZE2(x) STRINGIZE(x)
|
|
11
|
+
#define REANIMATED_VERSION_STRING STRINGIZE2(REANIMATED_VERSION)
|
|
12
|
+
#endif // REANIMATED_VERSION
|
|
13
|
+
|
|
14
|
+
using namespace facebook;
|
|
15
|
+
|
|
16
|
+
namespace reanimated {
|
|
17
|
+
|
|
18
|
+
std::string getReanimatedCppVersion() {
|
|
19
|
+
return std::string(REANIMATED_VERSION_STRING);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
void injectReanimatedCppVersion(jsi::Runtime &rnRuntime) {
|
|
23
|
+
auto version = getReanimatedCppVersion();
|
|
24
|
+
rnRuntime.global().setProperty(rnRuntime, "_REANIMATED_VERSION_CPP", jsi::String::createFromUtf8(rnRuntime, version));
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
#ifndef NDEBUG
|
|
28
|
+
void checkJSVersion(jsi::Runtime &rnRuntime, const std::shared_ptr<worklets::JSLogger> &jsLogger) {
|
|
29
|
+
auto cppVersion = getReanimatedCppVersion();
|
|
30
|
+
auto jsVersionValue = rnRuntime.global().getProperty(rnRuntime, "_REANIMATED_VERSION_JS");
|
|
31
|
+
worklets::checkJSVersion(
|
|
32
|
+
rnRuntime,
|
|
33
|
+
jsVersionValue,
|
|
34
|
+
jsLogger,
|
|
35
|
+
cppVersion,
|
|
36
|
+
"Reanimated",
|
|
37
|
+
"https://docs.swmansion.com/react-native-reanimated/");
|
|
38
|
+
}
|
|
39
|
+
#else
|
|
40
|
+
void checkJSVersion(jsi::Runtime &rnRuntime, const std::shared_ptr<worklets::JSLogger> &jsLogger) {
|
|
41
|
+
// In release builds we don't check the version, hence
|
|
42
|
+
// this function is a NOOP.
|
|
43
|
+
}
|
|
44
|
+
#endif // NDEBUG
|
|
45
|
+
|
|
46
|
+
}; // namespace reanimated
|
package/harmony/reanimated/src/main/cpp/Common/cpp/{worklets → reanimated}/Tools/ReanimatedVersion.h
RENAMED
|
@@ -9,11 +9,10 @@
|
|
|
9
9
|
|
|
10
10
|
using namespace facebook;
|
|
11
11
|
|
|
12
|
-
namespace
|
|
12
|
+
namespace reanimated {
|
|
13
13
|
|
|
14
14
|
std::string getReanimatedCppVersion();
|
|
15
15
|
void injectReanimatedCppVersion(jsi::Runtime &);
|
|
16
|
-
|
|
17
|
-
void checkJSVersion(jsi::Runtime &, const std::shared_ptr<JSLogger> &);
|
|
16
|
+
void checkJSVersion(jsi::Runtime &, const std::shared_ptr<worklets::JSLogger> &);
|
|
18
17
|
|
|
19
|
-
}; // namespace
|
|
18
|
+
}; // namespace reanimated
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
#include "RNOH/ArkTSTurboModule.h"
|
|
6
6
|
#include "RNOH/RNInstance.h"
|
|
7
7
|
#include "ReanimatedModule.h"
|
|
8
|
+
#include "ReanimatedSensorContainer.h"
|
|
8
9
|
#include "ReanimatedUIScheduler.h"
|
|
9
10
|
#include "PlatformDepMethodsHolder.h"
|
|
10
11
|
#include "WorkletRuntimeCollector.h"
|
|
@@ -17,32 +18,25 @@ using namespace facebook;
|
|
|
17
18
|
using namespace reanimated;
|
|
18
19
|
using namespace worklets;
|
|
19
20
|
namespace rnoh {
|
|
20
|
-
static double getMillisSinceEpoch()
|
|
21
|
-
{
|
|
21
|
+
static double getMillisSinceEpoch() {
|
|
22
22
|
auto now = std::chrono::high_resolution_clock::now();
|
|
23
23
|
auto frameTime = std::chrono::duration_cast<std::chrono::milliseconds>(now.time_since_epoch());
|
|
24
24
|
return frameTime.count();
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
jsi::Value installTurboModule(facebook::jsi::Runtime &rt, react::TurboModule &turboModule,
|
|
28
|
-
|
|
29
|
-
{
|
|
28
|
+
const facebook::jsi::Value *args, size_t count) {
|
|
30
29
|
auto self = static_cast<ReanimatedModule *>(&turboModule);
|
|
31
|
-
if (self == nullptr) {
|
|
32
|
-
return facebook::jsi::Value::undefined();
|
|
33
|
-
}
|
|
34
30
|
self->installTurboModule(rt);
|
|
35
31
|
return facebook::jsi::Value(true);
|
|
36
32
|
}
|
|
37
33
|
|
|
38
34
|
ReanimatedModule::ReanimatedModule(const ArkTSTurboModule::Context ctx, const std::string name)
|
|
39
|
-
: ArkTSTurboModule(ctx, name)
|
|
40
|
-
{
|
|
41
|
-
methodMap_ = { { "installTurboModule", { 0, rnoh::installTurboModule } } };
|
|
35
|
+
: ArkTSTurboModule(ctx, name) {
|
|
36
|
+
methodMap_ = {{"installTurboModule", {0, rnoh::installTurboModule}}};
|
|
42
37
|
}
|
|
43
38
|
|
|
44
|
-
ReanimatedModule::~ReanimatedModule()
|
|
45
|
-
{
|
|
39
|
+
ReanimatedModule::~ReanimatedModule() {
|
|
46
40
|
LOG(INFO) << "ReanimatedModule::~ReanimatedModule";
|
|
47
41
|
if (eventListener) {
|
|
48
42
|
m_ctx.scheduler->removeEventListener(eventListener);
|
|
@@ -52,14 +46,18 @@ ReanimatedModule::~ReanimatedModule()
|
|
|
52
46
|
}
|
|
53
47
|
}
|
|
54
48
|
|
|
55
|
-
void ReanimatedModule::installTurboModule(facebook::jsi::Runtime &rt)
|
|
56
|
-
{
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
49
|
+
void ReanimatedModule::installTurboModule(facebook::jsi::Runtime &rt) {
|
|
50
|
+
if (!m_ctx.taskExecutor->isOnTaskThread(rnoh::TaskThread::JS)) {
|
|
51
|
+
DLOG(ERROR) << "react_worklets reanimated installTurboModule failed,because of current thread is not js;";
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
auto runMainThreadFuc = [weakExecutor = std::weak_ptr(m_ctx.taskExecutor)](TaskExecutor::Task &&task) {
|
|
56
|
+
if (auto taskExecutor = weakExecutor.lock()) {
|
|
57
|
+
taskExecutor->runTask(TaskThread::MAIN, std::move(task));
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
auto nodesManager = std::make_shared<ReanimatedNodesManager>(runMainThreadFuc);
|
|
63
61
|
|
|
64
62
|
auto maybeFlushUIUpdatesQueueFunction = [nodesManager]() { nodesManager->maybeFlushUIUpdatesQueue(); };
|
|
65
63
|
auto requestRender = [weakSelf = weak_from_this(), nodesManager](std::function<void(double)> onRender) {
|
|
@@ -76,28 +74,37 @@ void ReanimatedModule::installTurboModule(facebook::jsi::Runtime &rt)
|
|
|
76
74
|
});
|
|
77
75
|
};
|
|
78
76
|
|
|
79
|
-
auto
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
77
|
+
auto getAnimationTimestamp = getMillisSinceEpoch;
|
|
78
|
+
|
|
79
|
+
auto synchronouslyUpdateUIPropsFunction = [weakInstance = m_ctx.instance](Tag tag, const folly::dynamic &dynamic) {
|
|
80
|
+
auto instance = weakInstance.lock();
|
|
81
|
+
auto instanceCapi = std::dynamic_pointer_cast<RNInstanceCAPI>(instance);
|
|
82
|
+
if (!instanceCapi) {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
auto componentInstance = instanceCapi->findComponentInstanceByTag(tag);
|
|
86
|
+
if (!componentInstance) {
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
83
89
|
|
|
84
|
-
|
|
85
|
-
//
|
|
90
|
+
// We want to restore the ignored props after the update,
|
|
91
|
+
// because reanimated handles setting correct props on React renders on its own
|
|
92
|
+
auto ignoredProps = componentInstance->getIgnoredPropKeys();
|
|
93
|
+
instanceCapi->synchronouslyUpdateViewOnUIThread(tag, dynamic);
|
|
94
|
+
componentInstance->setIgnoredPropKeys(std::move(ignoredProps));
|
|
86
95
|
};
|
|
96
|
+
auto sensorContainer = std::make_shared<ReanimatedSensorContainer>();
|
|
87
97
|
|
|
88
|
-
auto getAnimationTimestamp = getMillisSinceEpoch;
|
|
89
98
|
|
|
90
|
-
auto registerSensorFunction = [
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
return
|
|
94
|
-
};
|
|
95
|
-
auto unregisterSensorFunction = [](int sensorId) {
|
|
96
|
-
// TODO
|
|
99
|
+
auto registerSensorFunction = [sensorContainer,
|
|
100
|
+
runMainThreadFuc](int sensorType, int interval, int iosReferenceFrame,
|
|
101
|
+
std::function<void(double[], int)> setter) -> int {
|
|
102
|
+
return sensorContainer->registerSensor(sensorType, interval, iosReferenceFrame, setter, runMainThreadFuc);
|
|
97
103
|
};
|
|
104
|
+
auto unregisterSensorFunction = [sensorContainer](int sensorId) { sensorContainer->unregisterSensor(sensorId); };
|
|
98
105
|
auto subscribeForKeyboardEventsFunction =
|
|
99
106
|
[weakSelf = weak_from_this()](std::function<void(int keyboardState, int height)> keyboardEventDataUpdater,
|
|
100
|
-
|
|
107
|
+
bool isStatusBarTranslucent, bool isNavigationBarTranslucent) {
|
|
101
108
|
auto self = weakSelf.lock();
|
|
102
109
|
if (!self) {
|
|
103
110
|
return 0;
|
|
@@ -138,13 +145,13 @@ void ReanimatedModule::installTurboModule(facebook::jsi::Runtime &rt)
|
|
|
138
145
|
auto napiTag = arkJs.createInt(handlerTag);
|
|
139
146
|
auto napiState = arkJs.createInt(newState);
|
|
140
147
|
auto napiTurboModuleObject = arkJs.getObject(self->m_ctx.arkTSTurboModuleInstanceRef);
|
|
141
|
-
napiTurboModuleObject.call("setGestureHandlerState", {
|
|
148
|
+
napiTurboModuleObject.call("setGestureHandlerState", {napiTag, napiState});
|
|
142
149
|
};
|
|
150
|
+
|
|
143
151
|
PlatformDepMethodsHolder platformDepMethodsHolder = {
|
|
144
152
|
requestRender,
|
|
153
|
+
synchronouslyUpdateUIPropsFunction,
|
|
145
154
|
getAnimationTimestamp,
|
|
146
|
-
progressLayoutAnimation,
|
|
147
|
-
endLayoutAnimation,
|
|
148
155
|
registerSensorFunction,
|
|
149
156
|
unregisterSensorFunction,
|
|
150
157
|
setGestureStateFunction,
|
|
@@ -152,8 +159,7 @@ void ReanimatedModule::installTurboModule(facebook::jsi::Runtime &rt)
|
|
|
152
159
|
unsubscribeFromKeyboardEventsFunction,
|
|
153
160
|
maybeFlushUIUpdatesQueueFunction,
|
|
154
161
|
};
|
|
155
|
-
auto isReducedMotion = false;
|
|
156
|
-
auto isBridgeless = true;
|
|
162
|
+
auto isReducedMotion = false; // ANIMATOR_DURATION_SCALE
|
|
157
163
|
auto workletsModule = [weakSelf = weak_from_this()]() -> std::shared_ptr<WorkletsModule> {
|
|
158
164
|
auto self = weakSelf.lock();
|
|
159
165
|
if (!self) {
|
|
@@ -165,44 +171,28 @@ void ReanimatedModule::installTurboModule(facebook::jsi::Runtime &rt)
|
|
|
165
171
|
}
|
|
166
172
|
return instance->getTurboModule<WorkletsModule>("WorkletsModule");
|
|
167
173
|
};
|
|
168
|
-
auto
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
auto workletsModuleProxy = workletsModulePtr->getWorkletsModuleProxy();
|
|
174
|
-
if (!workletsModuleProxy) {
|
|
175
|
-
LOG(ERROR) << "ReanimatedModule: WorkletsModuleProxy is null, WorkletsModule may not be initialized yet";
|
|
176
|
-
return;
|
|
177
|
-
}
|
|
178
|
-
if (!jsInvoker_) {
|
|
179
|
-
LOG(ERROR) << "ReanimatedModule: jsInvoker_ is null";
|
|
180
|
-
return;
|
|
181
|
-
}
|
|
182
|
-
if (!m_ctx.scheduler) {
|
|
183
|
-
LOG(ERROR) << "ReanimatedModule: m_ctx.scheduler is null";
|
|
184
|
-
return;
|
|
185
|
-
}
|
|
186
|
-
auto nativeReanimatedModule = std::make_shared<ReanimatedModuleProxy>(workletsModuleProxy,
|
|
187
|
-
rt, jsInvoker_, platformDepMethodsHolder, isBridgeless, isReducedMotion);
|
|
188
|
-
weakNativeReanimatedModule_ = nativeReanimatedModule;
|
|
189
|
-
nativeReanimatedModule->init(platformDepMethodsHolder);
|
|
174
|
+
auto reanimatedModuleProxy = std::make_shared<ReanimatedModuleProxy>(
|
|
175
|
+
workletsModule()->getWorkletsModuleProxy(), rt, jsInvoker_, platformDepMethodsHolder, isReducedMotion);
|
|
176
|
+
reanimatedModuleProxy->init(platformDepMethodsHolder);
|
|
177
|
+
weakNativeReanimatedModule_ = reanimatedModuleProxy;
|
|
178
|
+
|
|
190
179
|
ReanimatedPerformOperations reanimatedPerformOperations = [weakNativeReanimatedModule =
|
|
191
180
|
weakNativeReanimatedModule_]() {
|
|
192
181
|
if (auto nativeReanimatedModule = weakNativeReanimatedModule.lock()) {
|
|
193
|
-
nativeReanimatedModule->performOperations();
|
|
182
|
+
nativeReanimatedModule->performOperations(false);
|
|
194
183
|
}
|
|
195
184
|
};
|
|
196
185
|
nodesManager->registerPerformOperations(reanimatedPerformOperations);
|
|
197
186
|
|
|
198
187
|
WorkletRuntimeCollector::install(rt);
|
|
188
|
+
auto &uiRuntime = workletsModule()->getWorkletsModuleProxy()->getUIWorkletRuntime()->getJSIRuntime();
|
|
199
189
|
|
|
200
|
-
RNRuntimeDecorator::decorate(rt,
|
|
190
|
+
RNRuntimeDecorator::decorate(rt, uiRuntime, reanimatedModuleProxy);
|
|
201
191
|
injectDependencies(rt);
|
|
202
192
|
|
|
203
|
-
eventListener =
|
|
204
|
-
|
|
205
|
-
|
|
193
|
+
eventListener = std::make_shared<facebook::react::EventListener>(
|
|
194
|
+
[weakNativeReanimatedModule = weakNativeReanimatedModule_,
|
|
195
|
+
weakTaskExecutor = std::weak_ptr{m_ctx.taskExecutor}](facebook::react::RawEvent const &rawEvent) {
|
|
206
196
|
auto taskExecutor = weakTaskExecutor.lock();
|
|
207
197
|
auto nativeReanimatedModule = weakNativeReanimatedModule.lock();
|
|
208
198
|
if (!nativeReanimatedModule || !taskExecutor || !taskExecutor->isOnTaskThread(TaskThread::MAIN)) {
|
|
@@ -224,31 +214,16 @@ void ReanimatedModule::installTurboModule(facebook::jsi::Runtime &rt)
|
|
|
224
214
|
}
|
|
225
215
|
return nativeReanimatedModule->handleRawEvent(rawEvent, frameTime);
|
|
226
216
|
});
|
|
227
|
-
|
|
228
|
-
m_ctx.scheduler->addEventListener(eventListener);
|
|
229
|
-
} else {
|
|
230
|
-
LOG(ERROR) << "ReanimatedModule: Cannot add event listener, scheduler is null";
|
|
231
|
-
}
|
|
217
|
+
m_ctx.scheduler->addEventListener(eventListener);
|
|
232
218
|
}
|
|
233
|
-
|
|
234
|
-
void ReanimatedModule::injectDependencies(facebook::jsi::Runtime & /* rt */)
|
|
235
|
-
{
|
|
236
|
-
if (!m_ctx.scheduler) {
|
|
237
|
-
LOG(ERROR) << "ReanimatedModule::injectDependencies: scheduler is null";
|
|
238
|
-
return;
|
|
239
|
-
}
|
|
219
|
+
void ReanimatedModule::injectDependencies(facebook::jsi::Runtime & /* rt */) {
|
|
240
220
|
const auto uiManager = m_ctx.scheduler->getUIManager();
|
|
241
|
-
if (!uiManager) {
|
|
242
|
-
LOG(WARNING) << "ReanimatedModule::injectDependencies: uiManager is null";
|
|
243
|
-
return;
|
|
244
|
-
}
|
|
245
221
|
if (auto nativeReanimatedModule = weakNativeReanimatedModule_.lock()) {
|
|
246
222
|
nativeReanimatedModule->initializeFabric(uiManager);
|
|
247
223
|
}
|
|
248
224
|
}
|
|
249
225
|
|
|
250
|
-
void ReanimatedModule::callKeyBord(double height, int status)
|
|
251
|
-
{
|
|
226
|
+
void ReanimatedModule::callKeyBord(double height, int status) {
|
|
252
227
|
if (keyboardEventDataUpdater_) {
|
|
253
228
|
keyboardEventDataUpdater_(status, height);
|
|
254
229
|
}
|
|
@@ -28,6 +28,7 @@ void ReanimatedNodesManager::registerPerformOperations(ReanimatedPerformOperatio
|
|
|
28
28
|
|
|
29
29
|
void ReanimatedNodesManager::postOnAnimation(ReanimatedOnAnimationCallback callback)
|
|
30
30
|
{
|
|
31
|
+
LOG(INFO)<<"react_work reanimated------>postOnAnimation";
|
|
31
32
|
onAnimationCallbacks.push_back(std::move(callback));
|
|
32
33
|
m_vsyncHandle.requestFrame(vsyncHandleCallback, this);
|
|
33
34
|
}
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
|
|
5
5
|
#include "ReanimatedPackage.h"
|
|
6
6
|
#include "ReanimatedModule.h"
|
|
7
|
-
#include "WorkletsModule.h"
|
|
8
7
|
|
|
9
8
|
using namespace rnoh;
|
|
10
9
|
using namespace facebook;
|
|
@@ -15,8 +14,6 @@ public:
|
|
|
15
14
|
{
|
|
16
15
|
if (name == "ReanimatedModule") {
|
|
17
16
|
return std::make_shared<ReanimatedModule>(ctx, name);
|
|
18
|
-
} else if (name == "WorkletsModule") {
|
|
19
|
-
return std::make_shared<worklets::WorkletsModule>(ctx, name);
|
|
20
17
|
}
|
|
21
18
|
return nullptr;
|
|
22
19
|
};
|