react-native-reanimated 3.17.0-rc.1 → 4.0.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/Common/cpp/reanimated/CSS/common/Quaternion.cpp +58 -0
- package/Common/cpp/reanimated/CSS/common/Quaternion.h +28 -0
- package/Common/cpp/reanimated/CSS/common/TransformMatrix.cpp +634 -0
- package/Common/cpp/reanimated/CSS/common/TransformMatrix.h +106 -0
- package/Common/cpp/reanimated/CSS/common/definitions.h +30 -0
- package/Common/cpp/reanimated/CSS/common/values/CSSAngle.cpp +95 -0
- package/Common/cpp/reanimated/CSS/common/values/CSSAngle.h +42 -0
- package/Common/cpp/reanimated/CSS/common/values/CSSBoolean.cpp +50 -0
- package/Common/cpp/reanimated/CSS/common/values/CSSBoolean.h +39 -0
- package/Common/cpp/reanimated/CSS/common/values/CSSColor.cpp +136 -0
- package/Common/cpp/reanimated/CSS/common/values/CSSColor.h +53 -0
- package/Common/cpp/reanimated/CSS/common/values/CSSDimension.cpp +131 -0
- package/Common/cpp/reanimated/CSS/common/values/CSSDimension.h +45 -0
- package/Common/cpp/reanimated/CSS/common/values/CSSDiscreteArray.cpp +111 -0
- package/Common/cpp/reanimated/CSS/common/values/CSSDiscreteArray.h +55 -0
- package/Common/cpp/reanimated/CSS/common/values/CSSKeyword.cpp +100 -0
- package/Common/cpp/reanimated/CSS/common/values/CSSKeyword.h +62 -0
- package/Common/cpp/reanimated/CSS/common/values/CSSNumber.cpp +90 -0
- package/Common/cpp/reanimated/CSS/common/values/CSSNumber.h +73 -0
- package/Common/cpp/reanimated/CSS/common/values/CSSValue.h +100 -0
- package/Common/cpp/reanimated/CSS/common/values/CSSValueVariant.h +258 -0
- package/Common/cpp/reanimated/CSS/common/vectors.cpp +104 -0
- package/Common/cpp/reanimated/CSS/common/vectors.h +59 -0
- package/Common/cpp/reanimated/CSS/config/CSSAnimationConfig.cpp +135 -0
- package/Common/cpp/reanimated/CSS/config/CSSAnimationConfig.h +66 -0
- package/Common/cpp/reanimated/CSS/config/CSSTransitionConfig.cpp +87 -0
- package/Common/cpp/reanimated/CSS/config/CSSTransitionConfig.h +50 -0
- package/Common/cpp/reanimated/CSS/config/PropertyInterpolatorsConfig.h +300 -0
- package/Common/cpp/reanimated/CSS/config/common.cpp +20 -0
- package/Common/cpp/reanimated/CSS/config/common.h +16 -0
- package/Common/cpp/reanimated/CSS/core/CSSAnimation.cpp +147 -0
- package/Common/cpp/reanimated/CSS/core/CSSAnimation.h +61 -0
- package/Common/cpp/reanimated/CSS/core/CSSTransition.cpp +94 -0
- package/Common/cpp/reanimated/CSS/core/CSSTransition.h +49 -0
- package/Common/cpp/reanimated/CSS/easing/EasingFunctions.cpp +77 -0
- package/Common/cpp/reanimated/CSS/easing/EasingFunctions.h +31 -0
- package/Common/cpp/reanimated/CSS/easing/cubicBezier.cpp +79 -0
- package/Common/cpp/reanimated/CSS/easing/cubicBezier.h +18 -0
- package/Common/cpp/reanimated/CSS/easing/linear.cpp +35 -0
- package/Common/cpp/reanimated/CSS/easing/linear.h +23 -0
- package/Common/cpp/reanimated/CSS/easing/steps.cpp +16 -0
- package/Common/cpp/reanimated/CSS/easing/steps.h +17 -0
- package/Common/cpp/reanimated/CSS/interpolation/InterpolatorFactory.cpp +164 -0
- package/Common/cpp/reanimated/CSS/interpolation/InterpolatorFactory.h +163 -0
- package/Common/cpp/reanimated/CSS/interpolation/PropertyInterpolator.cpp +26 -0
- package/Common/cpp/reanimated/CSS/interpolation/PropertyInterpolator.h +87 -0
- package/Common/cpp/reanimated/CSS/interpolation/groups/ArrayPropertiesInterpolator.cpp +105 -0
- package/Common/cpp/reanimated/CSS/interpolation/groups/ArrayPropertiesInterpolator.h +45 -0
- package/Common/cpp/reanimated/CSS/interpolation/groups/GroupPropertiesInterpolator.cpp +69 -0
- package/Common/cpp/reanimated/CSS/interpolation/groups/GroupPropertiesInterpolator.h +42 -0
- package/Common/cpp/reanimated/CSS/interpolation/groups/RecordPropertiesInterpolator.cpp +126 -0
- package/Common/cpp/reanimated/CSS/interpolation/groups/RecordPropertiesInterpolator.h +44 -0
- package/Common/cpp/reanimated/CSS/interpolation/styles/AnimationStyleInterpolator.h +35 -0
- package/Common/cpp/reanimated/CSS/interpolation/styles/TransitionStyleInterpolator.cpp +123 -0
- package/Common/cpp/reanimated/CSS/interpolation/styles/TransitionStyleInterpolator.h +48 -0
- package/Common/cpp/reanimated/CSS/interpolation/transforms/TransformInterpolator.h +89 -0
- package/Common/cpp/reanimated/CSS/interpolation/transforms/TransformOperation.cpp +524 -0
- package/Common/cpp/reanimated/CSS/interpolation/transforms/TransformOperation.h +216 -0
- package/Common/cpp/reanimated/CSS/interpolation/transforms/TransformOperationInterpolator.cpp +68 -0
- package/Common/cpp/reanimated/CSS/interpolation/transforms/TransformOperationInterpolator.h +129 -0
- package/Common/cpp/reanimated/CSS/interpolation/transforms/TransformsStyleInterpolator.cpp +487 -0
- package/Common/cpp/reanimated/CSS/interpolation/transforms/TransformsStyleInterpolator.h +121 -0
- package/Common/cpp/reanimated/CSS/interpolation/values/ResolvableValueInterpolator.h +56 -0
- package/Common/cpp/reanimated/CSS/interpolation/values/ValueInterpolator.h +281 -0
- package/Common/cpp/reanimated/CSS/misc/ViewStylesRepository.cpp +187 -0
- package/Common/cpp/reanimated/CSS/misc/ViewStylesRepository.h +70 -0
- package/Common/cpp/reanimated/CSS/progress/AnimationProgressProvider.cpp +170 -0
- package/Common/cpp/reanimated/CSS/progress/AnimationProgressProvider.h +86 -0
- package/Common/cpp/reanimated/CSS/progress/KeyframeProgressProvider.h +19 -0
- package/Common/cpp/reanimated/CSS/progress/RawProgressProvider.cpp +49 -0
- package/Common/cpp/reanimated/CSS/progress/RawProgressProvider.h +37 -0
- package/Common/cpp/reanimated/CSS/progress/TransitionProgressProvider.cpp +228 -0
- package/Common/cpp/reanimated/CSS/progress/TransitionProgressProvider.h +97 -0
- package/Common/cpp/reanimated/CSS/registry/CSSAnimationsRegistry.cpp +279 -0
- package/Common/cpp/reanimated/CSS/registry/CSSAnimationsRegistry.h +77 -0
- package/Common/cpp/reanimated/CSS/registry/CSSTransitionsRegistry.cpp +152 -0
- package/Common/cpp/reanimated/CSS/registry/CSSTransitionsRegistry.h +56 -0
- package/Common/cpp/reanimated/CSS/registry/StaticPropsRegistry.cpp +58 -0
- package/Common/cpp/reanimated/CSS/registry/StaticPropsRegistry.h +42 -0
- package/Common/cpp/reanimated/CSS/util/DelayedItemsManager.cpp +95 -0
- package/Common/cpp/reanimated/CSS/util/DelayedItemsManager.h +56 -0
- package/Common/cpp/reanimated/CSS/util/algorithms.cpp +13 -0
- package/Common/cpp/reanimated/CSS/util/algorithms.h +13 -0
- package/Common/cpp/reanimated/CSS/util/interpolators.cpp +42 -0
- package/Common/cpp/reanimated/CSS/util/interpolators.h +28 -0
- package/Common/cpp/reanimated/CSS/util/keyframes.cpp +55 -0
- package/Common/cpp/reanimated/CSS/util/keyframes.h +18 -0
- package/Common/cpp/reanimated/CSS/util/props.cpp +337 -0
- package/Common/cpp/reanimated/CSS/util/props.h +48 -0
- package/Common/cpp/reanimated/Fabric/ReanimatedCommitHook.cpp +32 -28
- package/Common/cpp/reanimated/Fabric/ReanimatedCommitHook.h +5 -5
- package/Common/cpp/reanimated/Fabric/ReanimatedMountHook.cpp +9 -43
- package/Common/cpp/reanimated/Fabric/ReanimatedMountHook.h +6 -4
- package/Common/cpp/reanimated/Fabric/ShadowTreeCloner.cpp +37 -17
- package/Common/cpp/reanimated/Fabric/updates/AnimatedPropsRegistry.cpp +38 -0
- package/Common/cpp/reanimated/Fabric/updates/AnimatedPropsRegistry.h +21 -0
- package/Common/cpp/reanimated/Fabric/updates/UpdatesRegistry.cpp +166 -0
- package/Common/cpp/reanimated/Fabric/updates/UpdatesRegistry.h +80 -0
- package/Common/cpp/reanimated/Fabric/updates/UpdatesRegistryManager.cpp +130 -0
- package/Common/cpp/reanimated/Fabric/updates/UpdatesRegistryManager.h +67 -0
- package/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsManager.cpp +1 -1
- package/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxy.cpp +2 -9
- package/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxy.h +0 -1
- package/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsUtils.h +0 -2
- package/Common/cpp/reanimated/NativeModules/ReanimatedModuleProxy.cpp +300 -151
- package/Common/cpp/reanimated/NativeModules/ReanimatedModuleProxy.h +65 -29
- package/Common/cpp/reanimated/NativeModules/ReanimatedModuleProxySpec.cpp +107 -48
- package/Common/cpp/reanimated/NativeModules/ReanimatedModuleProxySpec.h +35 -16
- package/Common/cpp/reanimated/RuntimeDecorators/RNRuntimeDecorator.cpp +1 -8
- package/Common/cpp/reanimated/RuntimeDecorators/RNRuntimeDecorator.h +1 -0
- package/Common/cpp/reanimated/Tools/ReanimatedSystraceSection.h +135 -0
- package/Common/cpp/worklets/NativeModules/WorkletsModuleProxy.cpp +75 -2
- package/Common/cpp/worklets/NativeModules/WorkletsModuleProxy.h +22 -0
- package/Common/cpp/worklets/NativeModules/WorkletsModuleProxySpec.cpp +45 -0
- package/Common/cpp/worklets/NativeModules/WorkletsModuleProxySpec.h +19 -0
- package/Common/cpp/worklets/Tools/Defs.h +10 -0
- package/Common/cpp/worklets/Tools/SingleInstanceChecker.h +1 -3
- package/Common/cpp/worklets/WorkletRuntime/RNRuntimeWorkletDecorator.cpp +7 -0
- package/Common/cpp/worklets/WorkletRuntime/ReanimatedHermesRuntime.cpp +0 -10
- package/Common/cpp/worklets/WorkletRuntime/ReanimatedHermesRuntime.h +2 -13
- package/Common/cpp/worklets/WorkletRuntime/ReanimatedRuntime.cpp +3 -11
- package/Common/cpp/worklets/WorkletRuntime/ReanimatedRuntime.h +0 -8
- package/README.md +0 -1
- package/android/CMakeLists.txt +7 -11
- package/android/src/fabric/java/com/swmansion/reanimated/NativeProxy.java +6 -0
- package/android/src/fabric/java/com/swmansion/reanimated/ReaCompatibility.java +6 -0
- package/android/src/main/cpp/reanimated/CMakeLists.txt +1 -1
- package/android/src/main/cpp/reanimated/android/LayoutAnimations.cpp +4 -0
- package/android/src/main/cpp/reanimated/android/LayoutAnimations.h +2 -0
- package/android/src/main/cpp/reanimated/android/NativeProxy.cpp +57 -28
- package/android/src/main/cpp/reanimated/android/NativeProxy.h +3 -0
- package/android/src/main/cpp/worklets/CMakeLists.txt +2 -5
- package/android/src/main/cpp/worklets/android/WorkletsModule.cpp +10 -6
- package/android/src/main/cpp/worklets/android/WorkletsModule.h +7 -7
- package/android/src/main/java/com/swmansion/reanimated/NodesManager.java +16 -2
- package/android/src/main/java/com/swmansion/reanimated/ReanimatedPackage.java +1 -1
- package/android/src/main/java/com/swmansion/reanimated/Utils.java +10 -0
- package/android/src/main/java/com/swmansion/worklets/WorkletsModule.java +7 -0
- package/android/src/paper/java/com/swmansion/reanimated/NativeProxy.java +6 -0
- package/android/src/paper/java/com/swmansion/reanimated/ReaCompatibility.java +2 -0
- package/android/src/reactNativeVersionPatch/ReanimatedUIManager/74/com/swmansion/reanimated/ReanimatedModule.java +11 -0
- package/android/src/reactNativeVersionPatch/ReanimatedUIManager/latest/com/swmansion/reanimated/ReanimatedModule.java +11 -0
- package/apple/reanimated/apple/LayoutReanimation/REASharedTransitionManager.m +1 -2
- package/apple/reanimated/apple/LayoutReanimation/REASwizzledUIManager.mm +5 -6
- package/apple/reanimated/apple/REAModule.h +0 -4
- package/apple/reanimated/apple/REAModule.mm +27 -92
- package/apple/reanimated/apple/REANodesManager.h +0 -1
- package/apple/reanimated/apple/REANodesManager.mm +0 -7
- package/apple/reanimated/apple/native/NativeProxy.h +2 -0
- package/apple/reanimated/apple/native/NativeProxy.mm +27 -19
- package/apple/reanimated/apple/native/PlatformDepMethodsHolderImpl.mm +1 -1
- package/apple/worklets/apple/WorkletsModule.mm +12 -2
- package/lib/module/{PropsRegistry.js → AnimatedPropsRegistry.js} +2 -2
- package/lib/module/AnimatedPropsRegistry.js.map +1 -0
- package/lib/module/ReanimatedModule/NativeReanimated.js +29 -13
- package/lib/module/ReanimatedModule/NativeReanimated.js.map +1 -1
- package/lib/module/ReanimatedModule/js-reanimated/JSReanimated.js +23 -18
- package/lib/module/ReanimatedModule/js-reanimated/JSReanimated.js.map +1 -1
- package/lib/module/commonTypes.js.map +1 -1
- package/lib/module/core.js +1 -1
- package/lib/module/core.js.map +1 -1
- package/lib/module/createAnimatedComponent/AnimatedComponent.js +341 -0
- package/lib/module/createAnimatedComponent/AnimatedComponent.js.map +1 -0
- package/lib/module/createAnimatedComponent/createAnimatedComponent.js +4 -381
- package/lib/module/createAnimatedComponent/createAnimatedComponent.js.map +1 -1
- package/lib/module/createAnimatedComponent/setAndForwardRef.js +1 -1
- package/lib/module/createAnimatedComponent/setAndForwardRef.js.map +1 -1
- package/lib/module/createAnimatedComponent/utils.js +28 -0
- package/lib/module/createAnimatedComponent/utils.js.map +1 -1
- package/lib/module/css/component/AnimatedComponent.js +134 -0
- package/lib/module/css/component/AnimatedComponent.js.map +1 -0
- package/lib/module/css/component/createAnimatedComponent.js +30 -0
- package/lib/module/css/component/createAnimatedComponent.js.map +1 -0
- package/lib/module/css/component/index.js +4 -0
- package/lib/module/css/component/index.js.map +1 -0
- package/lib/module/css/constants/font.js +17 -0
- package/lib/module/css/constants/font.js.map +1 -0
- package/lib/module/css/constants/index.js +6 -0
- package/lib/module/css/constants/index.js.map +1 -0
- package/lib/module/css/constants/platform.js +5 -0
- package/lib/module/css/constants/platform.js.map +1 -0
- package/lib/module/css/constants/regex.js +6 -0
- package/lib/module/css/constants/regex.js.map +1 -0
- package/lib/module/css/easings/cubicBezier.js +34 -0
- package/lib/module/css/easings/cubicBezier.js.map +1 -0
- package/lib/module/css/easings/index.js +16 -0
- package/lib/module/css/easings/index.js.map +1 -0
- package/lib/module/css/easings/linear.js +123 -0
- package/lib/module/css/easings/linear.js.map +1 -0
- package/lib/module/css/easings/steps.js +97 -0
- package/lib/module/css/easings/steps.js.map +1 -0
- package/lib/module/css/easings/types.js +4 -0
- package/lib/module/css/easings/types.js.map +1 -0
- package/lib/module/css/errors.js +15 -0
- package/lib/module/css/errors.js.map +1 -0
- package/lib/module/css/index.js +6 -0
- package/lib/module/css/index.js.map +1 -0
- package/lib/module/css/managers/CSSAnimationsManager.js +98 -0
- package/lib/module/css/managers/CSSAnimationsManager.js.map +1 -0
- package/lib/module/css/managers/CSSAnimationsManager.web.js +139 -0
- package/lib/module/css/managers/CSSAnimationsManager.web.js.map +1 -0
- package/lib/module/css/managers/CSSManager.js +52 -0
- package/lib/module/css/managers/CSSManager.js.map +1 -0
- package/lib/module/css/managers/CSSManager.web.js +35 -0
- package/lib/module/css/managers/CSSManager.web.js.map +1 -0
- package/lib/module/css/managers/CSSTransitionManager.js +44 -0
- package/lib/module/css/managers/CSSTransitionManager.js.map +1 -0
- package/lib/module/css/managers/CSSTransitionManager.web.js +52 -0
- package/lib/module/css/managers/CSSTransitionManager.web.js.map +1 -0
- package/lib/module/css/managers/index.js +4 -0
- package/lib/module/css/managers/index.js.map +1 -0
- package/lib/module/css/models/CSSKeyframesRule.js +14 -0
- package/lib/module/css/models/CSSKeyframesRule.js.map +1 -0
- package/lib/module/css/models/CSSKeyframesRule.web.js +14 -0
- package/lib/module/css/models/CSSKeyframesRule.web.js.map +1 -0
- package/lib/module/css/models/CSSKeyframesRuleBase.js +29 -0
- package/lib/module/css/models/CSSKeyframesRuleBase.js.map +1 -0
- package/lib/module/css/models/index.js +4 -0
- package/lib/module/css/models/index.js.map +1 -0
- package/lib/module/css/platform/native/config.js +274 -0
- package/lib/module/css/platform/native/config.js.map +1 -0
- package/lib/module/css/platform/native/index.js +7 -0
- package/lib/module/css/platform/native/index.js.map +1 -0
- package/lib/module/css/platform/native/native.js +36 -0
- package/lib/module/css/platform/native/native.js.map +1 -0
- package/lib/module/css/platform/native/normalization/animation/constants.js +6 -0
- package/lib/module/css/platform/native/normalization/animation/constants.js.map +1 -0
- package/lib/module/css/platform/native/normalization/animation/index.js +7 -0
- package/lib/module/css/platform/native/normalization/animation/index.js.map +1 -0
- package/lib/module/css/platform/native/normalization/animation/keyframes.js +107 -0
- package/lib/module/css/platform/native/normalization/animation/keyframes.js.map +1 -0
- package/lib/module/css/platform/native/normalization/animation/properties.js +28 -0
- package/lib/module/css/platform/native/normalization/animation/properties.js.map +1 -0
- package/lib/module/css/platform/native/normalization/animation/settings.js +88 -0
- package/lib/module/css/platform/native/normalization/animation/settings.js.map +1 -0
- package/lib/module/css/platform/native/normalization/common/index.js +4 -0
- package/lib/module/css/platform/native/normalization/common/index.js.map +1 -0
- package/lib/module/css/platform/native/normalization/common/settings.js +51 -0
- package/lib/module/css/platform/native/normalization/common/settings.js.map +1 -0
- package/lib/module/css/platform/native/normalization/index.js +6 -0
- package/lib/module/css/platform/native/normalization/index.js.map +1 -0
- package/lib/module/css/platform/native/normalization/transition/config.js +84 -0
- package/lib/module/css/platform/native/normalization/transition/config.js.map +1 -0
- package/lib/module/css/platform/native/normalization/transition/constants.js +4 -0
- package/lib/module/css/platform/native/normalization/transition/constants.js.map +1 -0
- package/lib/module/css/platform/native/normalization/transition/index.js +4 -0
- package/lib/module/css/platform/native/normalization/transition/index.js.map +1 -0
- package/lib/module/css/platform/native/normalization/transition/settings.js +14 -0
- package/lib/module/css/platform/native/normalization/transition/settings.js.map +1 -0
- package/lib/module/css/platform/native/style/builderFactory.js +59 -0
- package/lib/module/css/platform/native/style/builderFactory.js.map +1 -0
- package/lib/module/css/platform/native/style/index.js +6 -0
- package/lib/module/css/platform/native/style/index.js.map +1 -0
- package/lib/module/css/platform/native/style/processors/colors.js +25 -0
- package/lib/module/css/platform/native/style/processors/colors.js.map +1 -0
- package/lib/module/css/platform/native/style/processors/font.js +17 -0
- package/lib/module/css/platform/native/style/processors/font.js.map +1 -0
- package/lib/module/css/platform/native/style/processors/index.js +10 -0
- package/lib/module/css/platform/native/style/processors/index.js.map +1 -0
- package/lib/module/css/platform/native/style/processors/insets.js +17 -0
- package/lib/module/css/platform/native/style/processors/insets.js.map +1 -0
- package/lib/module/css/platform/native/style/processors/others.js +26 -0
- package/lib/module/css/platform/native/style/processors/others.js.map +1 -0
- package/lib/module/css/platform/native/style/processors/shadows.js +49 -0
- package/lib/module/css/platform/native/style/processors/shadows.js.map +1 -0
- package/lib/module/css/platform/native/style/processors/transform.js +138 -0
- package/lib/module/css/platform/native/style/processors/transform.js.map +1 -0
- package/lib/module/css/platform/native/style/processors/transformOrigin.js +64 -0
- package/lib/module/css/platform/native/style/processors/transformOrigin.js.map +1 -0
- package/lib/module/css/platform/native/style/types.js +4 -0
- package/lib/module/css/platform/native/style/types.js.map +1 -0
- package/lib/module/css/platform/native/styleBuilder.js +7 -0
- package/lib/module/css/platform/native/styleBuilder.js.map +1 -0
- package/lib/module/css/platform/native/types/animation.js +4 -0
- package/lib/module/css/platform/native/types/animation.js.map +1 -0
- package/lib/module/css/platform/native/types/common.js +2 -0
- package/lib/module/css/platform/native/types/common.js.map +1 -0
- package/lib/module/css/platform/native/types/index.js +6 -0
- package/lib/module/css/platform/native/types/index.js.map +1 -0
- package/lib/module/css/platform/native/types/transition.js +4 -0
- package/lib/module/css/platform/native/types/transition.js.map +1 -0
- package/lib/module/css/platform/web/animationParser.js +28 -0
- package/lib/module/css/platform/web/animationParser.js.map +1 -0
- package/lib/module/css/platform/web/config.js +265 -0
- package/lib/module/css/platform/web/config.js.map +1 -0
- package/lib/module/css/platform/web/domUtils.js +75 -0
- package/lib/module/css/platform/web/domUtils.js.map +1 -0
- package/lib/module/css/platform/web/index.js +6 -0
- package/lib/module/css/platform/web/index.js.map +1 -0
- package/lib/module/css/platform/web/style/builderFactories.js +124 -0
- package/lib/module/css/platform/web/style/builderFactories.js.map +1 -0
- package/lib/module/css/platform/web/style/builders/index.js +4 -0
- package/lib/module/css/platform/web/style/builders/index.js.map +1 -0
- package/lib/module/css/platform/web/style/builders/shadows.js +45 -0
- package/lib/module/css/platform/web/style/builders/shadows.js.map +1 -0
- package/lib/module/css/platform/web/style/index.js +7 -0
- package/lib/module/css/platform/web/style/index.js.map +1 -0
- package/lib/module/css/platform/web/style/processors/colors.js +12 -0
- package/lib/module/css/platform/web/style/processors/colors.js.map +1 -0
- package/lib/module/css/platform/web/style/processors/filter.js +28 -0
- package/lib/module/css/platform/web/style/processors/filter.js.map +1 -0
- package/lib/module/css/platform/web/style/processors/font.js +13 -0
- package/lib/module/css/platform/web/style/processors/font.js.map +1 -0
- package/lib/module/css/platform/web/style/processors/index.js +10 -0
- package/lib/module/css/platform/web/style/processors/index.js.map +1 -0
- package/lib/module/css/platform/web/style/processors/margins.js +24 -0
- package/lib/module/css/platform/web/style/processors/margins.js.map +1 -0
- package/lib/module/css/platform/web/style/processors/paddings.js +24 -0
- package/lib/module/css/platform/web/style/processors/paddings.js.map +1 -0
- package/lib/module/css/platform/web/style/processors/shadows.js +17 -0
- package/lib/module/css/platform/web/style/processors/shadows.js.map +1 -0
- package/lib/module/css/platform/web/style/processors/transforms.js +37 -0
- package/lib/module/css/platform/web/style/processors/transforms.js.map +1 -0
- package/lib/module/css/platform/web/style/types.js +4 -0
- package/lib/module/css/platform/web/style/types.js.map +1 -0
- package/lib/module/css/platform/web/utils.js +69 -0
- package/lib/module/css/platform/web/utils.js.map +1 -0
- package/lib/module/css/stylesheet.js +25 -0
- package/lib/module/css/stylesheet.js.map +1 -0
- package/lib/module/css/types/animation.js +4 -0
- package/lib/module/css/types/animation.js.map +1 -0
- package/lib/module/css/types/common.js +4 -0
- package/lib/module/css/types/common.js.map +1 -0
- package/lib/module/css/types/config.js +4 -0
- package/lib/module/css/types/config.js.map +1 -0
- package/lib/module/css/types/helpers.js +4 -0
- package/lib/module/css/types/helpers.js.map +1 -0
- package/lib/module/css/types/index.js +9 -0
- package/lib/module/css/types/index.js.map +1 -0
- package/lib/module/css/types/props.js +4 -0
- package/lib/module/css/types/props.js.map +1 -0
- package/lib/module/css/types/transition.js +4 -0
- package/lib/module/css/types/transition.js.map +1 -0
- package/lib/module/css/utils/conversions.js +8 -0
- package/lib/module/css/utils/conversions.js.map +1 -0
- package/lib/module/css/utils/equality.js +57 -0
- package/lib/module/css/utils/equality.js.map +1 -0
- package/lib/module/css/utils/guards.js +24 -0
- package/lib/module/css/utils/guards.js.map +1 -0
- package/lib/module/css/utils/index.js +8 -0
- package/lib/module/css/utils/index.js.map +1 -0
- package/lib/module/css/utils/parsers.js +27 -0
- package/lib/module/css/utils/parsers.js.map +1 -0
- package/lib/module/css/utils/props.js +34 -0
- package/lib/module/css/utils/props.js.map +1 -0
- package/lib/module/index.js +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/initializers.js +5 -1
- package/lib/module/initializers.js.map +1 -1
- package/lib/module/layoutReanimation/web/componentUtils.js +1 -0
- package/lib/module/layoutReanimation/web/componentUtils.js.map +1 -1
- package/lib/module/logger/logger.js +3 -3
- package/lib/module/logger/logger.js.map +1 -1
- package/lib/module/platform-specific/findHostInstance.js +11 -2
- package/lib/module/platform-specific/findHostInstance.js.map +1 -1
- package/lib/module/platform-specific/jsVersion.js +1 -1
- package/lib/module/platform-specific/jsVersion.js.map +1 -1
- package/lib/module/propsAllowlists.js +7 -1
- package/lib/module/propsAllowlists.js.map +1 -1
- package/lib/module/runtimes.js +3 -3
- package/lib/module/runtimes.js.map +1 -1
- package/lib/module/threads.js +5 -5
- package/lib/module/threads.js.map +1 -1
- package/lib/module/worklets/WorkletsModule/JSWorklets.js +21 -0
- package/lib/module/worklets/WorkletsModule/JSWorklets.js.map +1 -1
- package/lib/module/worklets/WorkletsModule/NativeWorklets.js +12 -0
- package/lib/module/worklets/WorkletsModule/NativeWorklets.js.map +1 -1
- package/lib/typescript/{PropsRegistry.d.ts → AnimatedPropsRegistry.d.ts} +1 -1
- package/lib/typescript/AnimatedPropsRegistry.d.ts.map +1 -0
- package/lib/typescript/ReanimatedModule/NativeReanimated.d.ts.map +1 -1
- package/lib/typescript/ReanimatedModule/js-reanimated/JSReanimated.d.ts.map +1 -1
- package/lib/typescript/ReanimatedModule/reanimatedModuleProxy.d.ts +13 -6
- package/lib/typescript/ReanimatedModule/reanimatedModuleProxy.d.ts.map +1 -1
- package/lib/typescript/commonTypes.d.ts +7 -2
- package/lib/typescript/commonTypes.d.ts.map +1 -1
- package/lib/typescript/createAnimatedComponent/AnimatedComponent.d.ts +58 -0
- package/lib/typescript/createAnimatedComponent/AnimatedComponent.d.ts.map +1 -0
- package/lib/typescript/createAnimatedComponent/JSPropsUpdater.d.ts +2 -1
- package/lib/typescript/createAnimatedComponent/JSPropsUpdater.d.ts.map +1 -1
- package/lib/typescript/createAnimatedComponent/NativeEventsManager.d.ts +1 -3
- package/lib/typescript/createAnimatedComponent/NativeEventsManager.d.ts.map +1 -1
- package/lib/typescript/createAnimatedComponent/commonTypes.d.ts +5 -1
- package/lib/typescript/createAnimatedComponent/commonTypes.d.ts.map +1 -1
- package/lib/typescript/createAnimatedComponent/createAnimatedComponent.d.ts +2 -7
- package/lib/typescript/createAnimatedComponent/createAnimatedComponent.d.ts.map +1 -1
- package/lib/typescript/createAnimatedComponent/utils.d.ts +5 -0
- package/lib/typescript/createAnimatedComponent/utils.d.ts.map +1 -1
- package/lib/typescript/css/component/AnimatedComponent.d.ts +29 -0
- package/lib/typescript/css/component/AnimatedComponent.d.ts.map +1 -0
- package/lib/typescript/css/component/createAnimatedComponent.d.ts +12 -0
- package/lib/typescript/css/component/createAnimatedComponent.d.ts.map +1 -0
- package/lib/typescript/css/component/index.d.ts +2 -0
- package/lib/typescript/css/component/index.d.ts.map +1 -0
- package/lib/typescript/css/constants/font.d.ts +15 -0
- package/lib/typescript/css/constants/font.d.ts.map +1 -0
- package/lib/typescript/css/constants/index.d.ts +4 -0
- package/lib/typescript/css/constants/index.d.ts.map +1 -0
- package/lib/typescript/css/constants/platform.d.ts +2 -0
- package/lib/typescript/css/constants/platform.d.ts.map +1 -0
- package/lib/typescript/css/constants/regex.d.ts +4 -0
- package/lib/typescript/css/constants/regex.d.ts.map +1 -0
- package/lib/typescript/css/easings/cubicBezier.d.ts +15 -0
- package/lib/typescript/css/easings/cubicBezier.d.ts.map +1 -0
- package/lib/typescript/css/easings/index.d.ts +10 -0
- package/lib/typescript/css/easings/index.d.ts.map +1 -0
- package/lib/typescript/css/easings/linear.d.ts +17 -0
- package/lib/typescript/css/easings/linear.d.ts.map +1 -0
- package/lib/typescript/css/easings/steps.d.ts +18 -0
- package/lib/typescript/css/easings/steps.d.ts.map +1 -0
- package/lib/typescript/css/easings/types.d.ts +26 -0
- package/lib/typescript/css/easings/types.d.ts.map +1 -0
- package/lib/typescript/css/errors.d.ts +9 -0
- package/lib/typescript/css/errors.d.ts.map +1 -0
- package/lib/typescript/css/index.d.ts +5 -0
- package/lib/typescript/css/index.d.ts.map +1 -0
- package/lib/typescript/css/managers/CSSAnimationsManager.d.ts +13 -0
- package/lib/typescript/css/managers/CSSAnimationsManager.d.ts.map +1 -0
- package/lib/typescript/css/managers/CSSAnimationsManager.web.d.ts +15 -0
- package/lib/typescript/css/managers/CSSAnimationsManager.web.d.ts.map +1 -0
- package/lib/typescript/css/managers/CSSManager.d.ts +12 -0
- package/lib/typescript/css/managers/CSSManager.d.ts.map +1 -0
- package/lib/typescript/css/managers/CSSManager.web.d.ts +12 -0
- package/lib/typescript/css/managers/CSSManager.web.d.ts.map +1 -0
- package/lib/typescript/css/managers/CSSTransitionManager.d.ts +12 -0
- package/lib/typescript/css/managers/CSSTransitionManager.d.ts.map +1 -0
- package/lib/typescript/css/managers/CSSTransitionManager.web.d.ts +11 -0
- package/lib/typescript/css/managers/CSSTransitionManager.web.d.ts.map +1 -0
- package/lib/typescript/css/managers/index.d.ts +2 -0
- package/lib/typescript/css/managers/index.d.ts.map +1 -0
- package/lib/typescript/css/models/CSSKeyframesRule.d.ts +9 -0
- package/lib/typescript/css/models/CSSKeyframesRule.d.ts.map +1 -0
- package/lib/typescript/css/models/CSSKeyframesRule.web.d.ts +8 -0
- package/lib/typescript/css/models/CSSKeyframesRule.web.d.ts.map +1 -0
- package/lib/typescript/css/models/CSSKeyframesRuleBase.d.ts +14 -0
- package/lib/typescript/css/models/CSSKeyframesRuleBase.d.ts.map +1 -0
- package/lib/typescript/css/models/index.d.ts +2 -0
- package/lib/typescript/css/models/index.d.ts.map +1 -0
- package/lib/typescript/css/platform/native/config.d.ts +5 -0
- package/lib/typescript/css/platform/native/config.d.ts.map +1 -0
- package/lib/typescript/css/platform/native/index.d.ts +5 -0
- package/lib/typescript/css/platform/native/index.d.ts.map +1 -0
- package/lib/typescript/css/platform/native/native.d.ts +14 -0
- package/lib/typescript/css/platform/native/native.d.ts.map +1 -0
- package/lib/typescript/css/platform/native/normalization/animation/constants.d.ts +5 -0
- package/lib/typescript/css/platform/native/normalization/animation/constants.d.ts.map +1 -0
- package/lib/typescript/css/platform/native/normalization/animation/index.d.ts +5 -0
- package/lib/typescript/css/platform/native/normalization/animation/index.d.ts.map +1 -0
- package/lib/typescript/css/platform/native/normalization/animation/keyframes.d.ts +8 -0
- package/lib/typescript/css/platform/native/normalization/animation/keyframes.d.ts.map +1 -0
- package/lib/typescript/css/platform/native/normalization/animation/properties.d.ts +3 -0
- package/lib/typescript/css/platform/native/normalization/animation/properties.d.ts.map +1 -0
- package/lib/typescript/css/platform/native/normalization/animation/settings.d.ts +16 -0
- package/lib/typescript/css/platform/native/normalization/animation/settings.d.ts.map +1 -0
- package/lib/typescript/css/platform/native/normalization/common/index.d.ts +2 -0
- package/lib/typescript/css/platform/native/normalization/common/index.d.ts.map +1 -0
- package/lib/typescript/css/platform/native/normalization/common/settings.d.ts +14 -0
- package/lib/typescript/css/platform/native/normalization/common/settings.d.ts.map +1 -0
- package/lib/typescript/css/platform/native/normalization/index.d.ts +4 -0
- package/lib/typescript/css/platform/native/normalization/index.d.ts.map +1 -0
- package/lib/typescript/css/platform/native/normalization/transition/config.d.ts +8 -0
- package/lib/typescript/css/platform/native/normalization/transition/config.d.ts.map +1 -0
- package/lib/typescript/css/platform/native/normalization/transition/constants.d.ts +3 -0
- package/lib/typescript/css/platform/native/normalization/transition/constants.d.ts.map +1 -0
- package/lib/typescript/css/platform/native/normalization/transition/index.d.ts +2 -0
- package/lib/typescript/css/platform/native/normalization/transition/index.d.ts.map +1 -0
- package/lib/typescript/css/platform/native/normalization/transition/settings.d.ts +6 -0
- package/lib/typescript/css/platform/native/normalization/transition/settings.d.ts.map +1 -0
- package/lib/typescript/css/platform/native/style/builderFactory.d.ts +4 -0
- package/lib/typescript/css/platform/native/style/builderFactory.d.ts.map +1 -0
- package/lib/typescript/css/platform/native/style/index.d.ts +4 -0
- package/lib/typescript/css/platform/native/style/index.d.ts.map +1 -0
- package/lib/typescript/css/platform/native/style/processors/colors.d.ts +8 -0
- package/lib/typescript/css/platform/native/style/processors/colors.d.ts.map +1 -0
- package/lib/typescript/css/platform/native/style/processors/font.d.ts +3 -0
- package/lib/typescript/css/platform/native/style/processors/font.d.ts.map +1 -0
- package/lib/typescript/css/platform/native/style/processors/index.d.ts +8 -0
- package/lib/typescript/css/platform/native/style/processors/index.d.ts.map +1 -0
- package/lib/typescript/css/platform/native/style/processors/insets.d.ts +8 -0
- package/lib/typescript/css/platform/native/style/processors/insets.d.ts.map +1 -0
- package/lib/typescript/css/platform/native/style/processors/others.d.ts +7 -0
- package/lib/typescript/css/platform/native/style/processors/others.d.ts.map +1 -0
- package/lib/typescript/css/platform/native/style/processors/shadows.d.ts +13 -0
- package/lib/typescript/css/platform/native/style/processors/shadows.d.ts.map +1 -0
- package/lib/typescript/css/platform/native/style/processors/transform.d.ts +7 -0
- package/lib/typescript/css/platform/native/style/processors/transform.d.ts.map +1 -0
- package/lib/typescript/css/platform/native/style/processors/transformOrigin.d.ts +9 -0
- package/lib/typescript/css/platform/native/style/processors/transformOrigin.d.ts.map +1 -0
- package/lib/typescript/css/platform/native/style/types.d.ts +16 -0
- package/lib/typescript/css/platform/native/style/types.d.ts.map +1 -0
- package/lib/typescript/css/platform/native/styleBuilder.d.ts +3 -0
- package/lib/typescript/css/platform/native/styleBuilder.d.ts.map +1 -0
- package/lib/typescript/css/platform/native/types/animation.d.ts +29 -0
- package/lib/typescript/css/platform/native/types/animation.d.ts.map +1 -0
- package/lib/typescript/css/platform/native/types/common.d.ts +7 -0
- package/lib/typescript/css/platform/native/types/common.d.ts.map +1 -0
- package/lib/typescript/css/platform/native/types/index.d.ts +4 -0
- package/lib/typescript/css/platform/native/types/index.d.ts.map +1 -0
- package/lib/typescript/css/platform/native/types/transition.d.ts +15 -0
- package/lib/typescript/css/platform/native/types/transition.d.ts.map +1 -0
- package/lib/typescript/css/platform/web/animationParser.d.ts +3 -0
- package/lib/typescript/css/platform/web/animationParser.d.ts.map +1 -0
- package/lib/typescript/css/platform/web/config.d.ts +4 -0
- package/lib/typescript/css/platform/web/config.d.ts.map +1 -0
- package/lib/typescript/css/platform/web/domUtils.d.ts +4 -0
- package/lib/typescript/css/platform/web/domUtils.d.ts.map +1 -0
- package/lib/typescript/css/platform/web/index.d.ts +4 -0
- package/lib/typescript/css/platform/web/index.d.ts.map +1 -0
- package/lib/typescript/css/platform/web/style/builderFactories.d.ts +5 -0
- package/lib/typescript/css/platform/web/style/builderFactories.d.ts.map +1 -0
- package/lib/typescript/css/platform/web/style/builders/index.d.ts +2 -0
- package/lib/typescript/css/platform/web/style/builders/index.d.ts.map +1 -0
- package/lib/typescript/css/platform/web/style/builders/shadows.d.ts +7 -0
- package/lib/typescript/css/platform/web/style/builders/shadows.d.ts.map +1 -0
- package/lib/typescript/css/platform/web/style/index.d.ts +5 -0
- package/lib/typescript/css/platform/web/style/index.d.ts.map +1 -0
- package/lib/typescript/css/platform/web/style/processors/colors.d.ts +4 -0
- package/lib/typescript/css/platform/web/style/processors/colors.d.ts.map +1 -0
- package/lib/typescript/css/platform/web/style/processors/filter.d.ts +4 -0
- package/lib/typescript/css/platform/web/style/processors/filter.d.ts.map +1 -0
- package/lib/typescript/css/platform/web/style/processors/font.d.ts +5 -0
- package/lib/typescript/css/platform/web/style/processors/font.d.ts.map +1 -0
- package/lib/typescript/css/platform/web/style/processors/index.d.ts +8 -0
- package/lib/typescript/css/platform/web/style/processors/index.d.ts.map +1 -0
- package/lib/typescript/css/platform/web/style/processors/margins.d.ts +5 -0
- package/lib/typescript/css/platform/web/style/processors/margins.d.ts.map +1 -0
- package/lib/typescript/css/platform/web/style/processors/paddings.d.ts +5 -0
- package/lib/typescript/css/platform/web/style/processors/paddings.d.ts.map +1 -0
- package/lib/typescript/css/platform/web/style/processors/shadows.d.ts +7 -0
- package/lib/typescript/css/platform/web/style/processors/shadows.d.ts.map +1 -0
- package/lib/typescript/css/platform/web/style/processors/transforms.d.ts +5 -0
- package/lib/typescript/css/platform/web/style/processors/transforms.d.ts.map +1 -0
- package/lib/typescript/css/platform/web/style/types.d.ts +35 -0
- package/lib/typescript/css/platform/web/style/types.d.ts.map +1 -0
- package/lib/typescript/css/platform/web/utils.d.ts +11 -0
- package/lib/typescript/css/platform/web/utils.d.ts.map +1 -0
- package/lib/typescript/css/stylesheet.d.ts +11 -0
- package/lib/typescript/css/stylesheet.d.ts.map +1 -0
- package/lib/typescript/css/types/animation.d.ts +47 -0
- package/lib/typescript/css/types/animation.d.ts.map +1 -0
- package/lib/typescript/css/types/common.d.ts +12 -0
- package/lib/typescript/css/types/common.d.ts.map +1 -0
- package/lib/typescript/css/types/config.d.ts +5 -0
- package/lib/typescript/css/types/config.d.ts.map +1 -0
- package/lib/typescript/css/types/helpers.d.ts +12 -0
- package/lib/typescript/css/types/helpers.d.ts.map +1 -0
- package/lib/typescript/css/types/index.d.ts +7 -0
- package/lib/typescript/css/types/index.d.ts.map +1 -0
- package/lib/typescript/css/types/props.d.ts +17 -0
- package/lib/typescript/css/types/props.d.ts.map +1 -0
- package/lib/typescript/css/types/transition.d.ts +26 -0
- package/lib/typescript/css/types/transition.d.ts.map +1 -0
- package/lib/typescript/css/utils/conversions.d.ts +3 -0
- package/lib/typescript/css/utils/conversions.d.ts.map +1 -0
- package/lib/typescript/css/utils/equality.d.ts +3 -0
- package/lib/typescript/css/utils/equality.d.ts.map +1 -0
- package/lib/typescript/css/utils/guards.d.ts +20 -0
- package/lib/typescript/css/utils/guards.d.ts.map +1 -0
- package/lib/typescript/css/utils/index.d.ts +6 -0
- package/lib/typescript/css/utils/index.d.ts.map +1 -0
- package/lib/typescript/css/utils/parsers.d.ts +3 -0
- package/lib/typescript/css/utils/parsers.d.ts.map +1 -0
- package/lib/typescript/css/utils/props.d.ts +7 -0
- package/lib/typescript/css/utils/props.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +1 -0
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/initializers.d.ts +2 -1
- package/lib/typescript/initializers.d.ts.map +1 -1
- package/lib/typescript/layoutReanimation/web/componentUtils.d.ts.map +1 -1
- package/lib/typescript/platform-specific/findHostInstance.d.ts.map +1 -1
- package/lib/typescript/platform-specific/jsVersion.d.ts +1 -1
- package/lib/typescript/platform-specific/jsVersion.d.ts.map +1 -1
- package/lib/typescript/propsAllowlists.d.ts.map +1 -1
- package/lib/typescript/worklets/WorkletsModule/JSWorklets.d.ts.map +1 -1
- package/lib/typescript/worklets/WorkletsModule/NativeWorklets.d.ts.map +1 -1
- package/lib/typescript/worklets/WorkletsModule/workletsModuleProxy.d.ts +5 -0
- package/lib/typescript/worklets/WorkletsModule/workletsModuleProxy.d.ts.map +1 -1
- package/package.json +11 -12
- package/src/{PropsRegistry.ts → AnimatedPropsRegistry.ts} +3 -1
- package/src/ReanimatedModule/NativeReanimated.ts +71 -24
- package/src/ReanimatedModule/js-reanimated/JSReanimated.ts +64 -32
- package/src/ReanimatedModule/reanimatedModuleProxy.ts +37 -15
- package/src/commonTypes.ts +10 -3
- package/src/core.ts +1 -1
- package/src/createAnimatedComponent/AnimatedComponent.tsx +510 -0
- package/src/createAnimatedComponent/JSPropsUpdater.ts +1 -1
- package/src/createAnimatedComponent/NativeEventsManager.ts +1 -6
- package/src/createAnimatedComponent/commonTypes.ts +11 -1
- package/src/createAnimatedComponent/createAnimatedComponent.tsx +14 -562
- package/src/createAnimatedComponent/setAndForwardRef.ts +1 -1
- package/src/createAnimatedComponent/utils.ts +25 -0
- package/src/css/component/AnimatedComponent.tsx +181 -0
- package/src/css/component/createAnimatedComponent.tsx +67 -0
- package/src/css/component/index.ts +2 -0
- package/src/css/constants/font.ts +15 -0
- package/src/css/constants/index.ts +4 -0
- package/src/css/constants/platform.ts +4 -0
- package/src/css/constants/regex.ts +4 -0
- package/src/css/easings/cubicBezier.ts +46 -0
- package/src/css/easings/index.ts +29 -0
- package/src/css/easings/linear.ts +151 -0
- package/src/css/easings/steps.ts +104 -0
- package/src/css/easings/types.ts +54 -0
- package/src/css/errors.ts +20 -0
- package/src/css/index.ts +24 -0
- package/src/css/managers/CSSAnimationsManager.ts +155 -0
- package/src/css/managers/CSSAnimationsManager.web.ts +203 -0
- package/src/css/managers/CSSManager.ts +65 -0
- package/src/css/managers/CSSManager.web.ts +52 -0
- package/src/css/managers/CSSTransitionManager.ts +67 -0
- package/src/css/managers/CSSTransitionManager.web.ts +83 -0
- package/src/css/managers/index.ts +2 -0
- package/src/css/models/CSSKeyframesRule.ts +20 -0
- package/src/css/models/CSSKeyframesRule.web.ts +23 -0
- package/src/css/models/CSSKeyframesRuleBase.ts +45 -0
- package/src/css/models/index.ts +2 -0
- package/src/css/platform/native/config.ts +237 -0
- package/src/css/platform/native/index.ts +5 -0
- package/src/css/platform/native/native.ts +61 -0
- package/src/css/platform/native/normalization/animation/constants.ts +25 -0
- package/src/css/platform/native/normalization/animation/index.ts +5 -0
- package/src/css/platform/native/normalization/animation/keyframes.ts +145 -0
- package/src/css/platform/native/normalization/animation/properties.ts +38 -0
- package/src/css/platform/native/normalization/animation/settings.ts +136 -0
- package/src/css/platform/native/normalization/common/index.ts +6 -0
- package/src/css/platform/native/normalization/common/settings.ts +86 -0
- package/src/css/platform/native/normalization/index.ts +4 -0
- package/src/css/platform/native/normalization/transition/config.ts +136 -0
- package/src/css/platform/native/normalization/transition/constants.ts +7 -0
- package/src/css/platform/native/normalization/transition/index.ts +5 -0
- package/src/css/platform/native/normalization/transition/settings.ts +20 -0
- package/src/css/platform/native/style/builderFactory.ts +81 -0
- package/src/css/platform/native/style/index.ts +4 -0
- package/src/css/platform/native/style/processors/colors.ts +36 -0
- package/src/css/platform/native/style/processors/font.ts +21 -0
- package/src/css/platform/native/style/processors/index.ts +8 -0
- package/src/css/platform/native/style/processors/insets.ts +25 -0
- package/src/css/platform/native/style/processors/others.ts +30 -0
- package/src/css/platform/native/style/processors/shadows.ts +74 -0
- package/src/css/platform/native/style/processors/transform.ts +182 -0
- package/src/css/platform/native/style/processors/transformOrigin.ts +117 -0
- package/src/css/platform/native/style/types.ts +33 -0
- package/src/css/platform/native/styleBuilder.ts +7 -0
- package/src/css/platform/native/types/animation.ts +50 -0
- package/src/css/platform/native/types/common.ts +8 -0
- package/src/css/platform/native/types/index.ts +4 -0
- package/src/css/platform/native/types/transition.ts +20 -0
- package/src/css/platform/web/animationParser.ts +46 -0
- package/src/css/platform/web/config.ts +233 -0
- package/src/css/platform/web/domUtils.ts +101 -0
- package/src/css/platform/web/index.ts +4 -0
- package/src/css/platform/web/style/builderFactories.ts +220 -0
- package/src/css/platform/web/style/builders/index.ts +2 -0
- package/src/css/platform/web/style/builders/shadows.ts +57 -0
- package/src/css/platform/web/style/index.ts +5 -0
- package/src/css/platform/web/style/processors/colors.ts +15 -0
- package/src/css/platform/web/style/processors/filter.ts +46 -0
- package/src/css/platform/web/style/processors/font.ts +17 -0
- package/src/css/platform/web/style/processors/index.ts +8 -0
- package/src/css/platform/web/style/processors/margins.ts +34 -0
- package/src/css/platform/web/style/processors/paddings.ts +34 -0
- package/src/css/platform/web/style/processors/shadows.ts +40 -0
- package/src/css/platform/web/style/processors/transforms.ts +59 -0
- package/src/css/platform/web/style/types.ts +77 -0
- package/src/css/platform/web/utils.ts +108 -0
- package/src/css/stylesheet.ts +37 -0
- package/src/css/types/animation.ts +74 -0
- package/src/css/types/common.ts +24 -0
- package/src/css/types/config.ts +6 -0
- package/src/css/types/helpers.ts +29 -0
- package/src/css/types/index.ts +7 -0
- package/src/css/types/props.ts +36 -0
- package/src/css/types/transition.ts +38 -0
- package/src/css/utils/conversions.ts +15 -0
- package/src/css/utils/equality.ts +67 -0
- package/src/css/utils/guards.ts +85 -0
- package/src/css/utils/index.ts +6 -0
- package/src/css/utils/parsers.ts +36 -0
- package/src/css/utils/props.ts +64 -0
- package/src/index.ts +1 -0
- package/src/initializers.ts +8 -1
- package/src/layoutReanimation/web/componentUtils.ts +1 -0
- package/src/logger/logger.ts +3 -3
- package/src/platform-specific/findHostInstance.ts +14 -3
- package/src/platform-specific/jsVersion.ts +1 -1
- package/src/propsAllowlists.ts +6 -0
- package/src/runtimes.ts +3 -3
- package/src/threads.ts +5 -5
- package/src/worklets/WorkletsModule/JSWorklets.ts +39 -1
- package/src/worklets/WorkletsModule/NativeWorklets.ts +28 -3
- package/src/worklets/WorkletsModule/workletsModuleProxy.ts +17 -0
- package/Common/cpp/reanimated/Fabric/PropsRegistry.cpp +0 -41
- package/Common/cpp/reanimated/Fabric/PropsRegistry.h +0 -59
- package/apple/reanimated/apple/Fabric/REAInitializerRCTFabricSurface.h +0 -12
- package/apple/reanimated/apple/Fabric/REAInitializerRCTFabricSurface.mm +0 -73
- package/lib/module/PropsRegistry.js.map +0 -1
- package/lib/typescript/PropsRegistry.d.ts.map +0 -1
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
3
|
+
|
|
4
|
+
#include <reanimated/CSS/common/Quaternion.h>
|
|
5
|
+
#include <reanimated/CSS/common/definitions.h>
|
|
6
|
+
#include <reanimated/CSS/common/vectors.h>
|
|
7
|
+
|
|
8
|
+
#include <folly/dynamic.h>
|
|
9
|
+
#include <string>
|
|
10
|
+
#include <utility>
|
|
11
|
+
|
|
12
|
+
namespace reanimated {
|
|
13
|
+
|
|
14
|
+
struct DecomposedTransformMatrix {
|
|
15
|
+
Vector3D scale;
|
|
16
|
+
Vector3D skew;
|
|
17
|
+
Quaternion quaternion;
|
|
18
|
+
Vector3D translation;
|
|
19
|
+
Vector4D perspective;
|
|
20
|
+
|
|
21
|
+
#ifndef NDEBUG
|
|
22
|
+
friend std::ostream &operator<<(
|
|
23
|
+
std::ostream &os,
|
|
24
|
+
const DecomposedTransformMatrix &decomposed);
|
|
25
|
+
#endif // NDEBUG
|
|
26
|
+
|
|
27
|
+
DecomposedTransformMatrix interpolate(
|
|
28
|
+
double progress,
|
|
29
|
+
const DecomposedTransformMatrix &other) const;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
class TransformMatrix {
|
|
33
|
+
public:
|
|
34
|
+
explicit TransformMatrix(const Vec16Array &matrix);
|
|
35
|
+
explicit TransformMatrix(const Matrix4x4 &matrix);
|
|
36
|
+
explicit TransformMatrix(jsi::Runtime &rt, const jsi::Value &value);
|
|
37
|
+
|
|
38
|
+
static TransformMatrix Identity();
|
|
39
|
+
static TransformMatrix Perspective(double value);
|
|
40
|
+
static TransformMatrix RotateX(double value);
|
|
41
|
+
static TransformMatrix RotateY(double value);
|
|
42
|
+
static TransformMatrix RotateZ(double value);
|
|
43
|
+
static TransformMatrix Scale(double value);
|
|
44
|
+
static TransformMatrix ScaleX(double value);
|
|
45
|
+
static TransformMatrix ScaleY(double value);
|
|
46
|
+
static TransformMatrix TranslateX(double value);
|
|
47
|
+
static TransformMatrix TranslateY(double value);
|
|
48
|
+
static TransformMatrix SkewX(double value);
|
|
49
|
+
static TransformMatrix SkewY(double value);
|
|
50
|
+
|
|
51
|
+
std::array<double, 4> &operator[](size_t rowIdx);
|
|
52
|
+
const std::array<double, 4> &operator[](size_t rowIdx) const;
|
|
53
|
+
bool operator==(const TransformMatrix &other) const;
|
|
54
|
+
TransformMatrix operator*(const TransformMatrix &rhs) const;
|
|
55
|
+
TransformMatrix operator*=(const TransformMatrix &rhs);
|
|
56
|
+
|
|
57
|
+
#ifndef NDEBUG
|
|
58
|
+
friend std::ostream &operator<<(
|
|
59
|
+
std::ostream &os,
|
|
60
|
+
const TransformMatrix &matrix);
|
|
61
|
+
#endif // NDEBUG
|
|
62
|
+
|
|
63
|
+
std::string toString() const;
|
|
64
|
+
jsi::Value toJSIValue(jsi::Runtime &rt) const;
|
|
65
|
+
folly::dynamic toDynamic() const;
|
|
66
|
+
|
|
67
|
+
bool isSingular() const;
|
|
68
|
+
bool normalize();
|
|
69
|
+
double determinant() const;
|
|
70
|
+
void adjugate();
|
|
71
|
+
bool invert();
|
|
72
|
+
void transpose();
|
|
73
|
+
void translate3d(const Vector3D &translation);
|
|
74
|
+
void scale3d(const Vector3D &scale);
|
|
75
|
+
|
|
76
|
+
std::optional<DecomposedTransformMatrix> decompose() const;
|
|
77
|
+
static TransformMatrix recompose(const DecomposedTransformMatrix &decomposed);
|
|
78
|
+
static TransformMatrix fromQuaternion(const Quaternion &q);
|
|
79
|
+
|
|
80
|
+
private:
|
|
81
|
+
Matrix4x4 matrix_;
|
|
82
|
+
|
|
83
|
+
std::optional<Vector4D> computePerspective() const;
|
|
84
|
+
|
|
85
|
+
Vector3D getTranslation() const;
|
|
86
|
+
static std::pair<Vector3D, Vector3D> computeScaleAndSkew(
|
|
87
|
+
std::array<Vector3D, 3> &rows);
|
|
88
|
+
static Quaternion computeQuaternion(std::array<Vector3D, 3> &columns);
|
|
89
|
+
|
|
90
|
+
inline static double determinant3x3(
|
|
91
|
+
double a,
|
|
92
|
+
double b,
|
|
93
|
+
double c,
|
|
94
|
+
double d,
|
|
95
|
+
double e,
|
|
96
|
+
double f,
|
|
97
|
+
double g,
|
|
98
|
+
double h,
|
|
99
|
+
double i);
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
Vector4D operator*(const Vector4D &v, const TransformMatrix &m);
|
|
103
|
+
|
|
104
|
+
} // namespace reanimated
|
|
105
|
+
|
|
106
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
3
|
+
|
|
4
|
+
#include <jsi/jsi.h>
|
|
5
|
+
#include <memory>
|
|
6
|
+
#include <string>
|
|
7
|
+
#include <vector>
|
|
8
|
+
|
|
9
|
+
namespace reanimated {
|
|
10
|
+
|
|
11
|
+
using namespace facebook;
|
|
12
|
+
|
|
13
|
+
using PropertyNames = std::vector<std::string>;
|
|
14
|
+
using PropertyValues = std::unique_ptr<jsi::Value>;
|
|
15
|
+
using PropertyPath = std::vector<std::string>;
|
|
16
|
+
/**
|
|
17
|
+
* If nullopt - all style properties can trigger transition
|
|
18
|
+
* If empty vector - no style property can trigger transition
|
|
19
|
+
* Otherwise - only specified style properties can trigger transition
|
|
20
|
+
*/
|
|
21
|
+
using TransitionProperties = std::optional<PropertyNames>;
|
|
22
|
+
|
|
23
|
+
using EasingFunction = std::function<double(double)>;
|
|
24
|
+
using ColorChannels = std::array<uint8_t, 4>;
|
|
25
|
+
using Vec16Array = std::array<double, 16>;
|
|
26
|
+
using Matrix4x4 = std::array<std::array<double, 4>, 4>;
|
|
27
|
+
|
|
28
|
+
} // namespace reanimated
|
|
29
|
+
|
|
30
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
2
|
+
#include <reanimated/CSS/common/values/CSSAngle.h>
|
|
3
|
+
|
|
4
|
+
namespace reanimated {
|
|
5
|
+
|
|
6
|
+
CSSAngle::CSSAngle() : value(0) {}
|
|
7
|
+
|
|
8
|
+
CSSAngle::CSSAngle(const double value) : value(value) {}
|
|
9
|
+
|
|
10
|
+
CSSAngle::CSSAngle(const std::string &rotationString) {
|
|
11
|
+
static const std::regex validNumberRegex(R"(^[-+]?\d*\.?\d+$)");
|
|
12
|
+
static const std::unordered_map<std::string, double> unitFactors = {
|
|
13
|
+
{"rad", 1},
|
|
14
|
+
{"deg", M_PI / 180},
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
// Find position of the first non-numeric character (first character
|
|
18
|
+
// of the unit, e.g. "deg" or "rad")
|
|
19
|
+
size_t pos = rotationString.find_first_not_of("0123456789.-+");
|
|
20
|
+
|
|
21
|
+
if (pos == std::string::npos) {
|
|
22
|
+
throw std::invalid_argument(
|
|
23
|
+
"[Reanimated] CSSAngle: Invalid angle value: " + rotationString);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
std::string numericPart = rotationString.substr(0, pos);
|
|
27
|
+
std::string unitPart = rotationString.substr(pos);
|
|
28
|
+
|
|
29
|
+
if (!std::regex_match(numericPart, validNumberRegex)) {
|
|
30
|
+
throw std::invalid_argument(
|
|
31
|
+
"[Reanimated] CSSAngle: Invalid angle value: " + rotationString);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// Lookup the unit and convert to radians
|
|
35
|
+
auto it = unitFactors.find(unitPart);
|
|
36
|
+
if (it == unitFactors.cend()) {
|
|
37
|
+
throw std::invalid_argument(
|
|
38
|
+
"[Reanimated] CSSAngle: Invalid angle unit: " + unitPart);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
double numericValue = std::stod(numericPart);
|
|
42
|
+
|
|
43
|
+
this->value = numericValue * it->second;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
CSSAngle::CSSAngle(jsi::Runtime &rt, const jsi::Value &jsiValue) {
|
|
47
|
+
if (!jsiValue.isString()) {
|
|
48
|
+
throw std::invalid_argument(
|
|
49
|
+
"[Reanimated] CSSAngle: Invalid value type: " +
|
|
50
|
+
stringifyJSIValue(rt, jsiValue));
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
std::string strValue = jsiValue.asString(rt).utf8(rt);
|
|
54
|
+
*this = CSSAngle(strValue);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
bool CSSAngle::canConstruct(jsi::Runtime &rt, const jsi::Value &jsiValue) {
|
|
58
|
+
// TODO - improve canConstruct check and add check for string correctness
|
|
59
|
+
return jsiValue.isString();
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
jsi::Value CSSAngle::toJSIValue(jsi::Runtime &rt) const {
|
|
63
|
+
return jsi::String::createFromUtf8(rt, toString());
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
folly::dynamic CSSAngle::toDynamic() const {
|
|
67
|
+
return folly::dynamic(toString());
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
std::string CSSAngle::toString() const {
|
|
71
|
+
std::ostringstream stream;
|
|
72
|
+
stream << std::fixed << std::setprecision(4) << value;
|
|
73
|
+
return stream.str() + "rad";
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
CSSAngle CSSAngle::interpolate(double progress, const CSSAngle &to) const {
|
|
77
|
+
return CSSAngle(value + (to.value - value) * progress);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
bool CSSAngle::operator==(const CSSAngle &other) const {
|
|
81
|
+
return value == other.value;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
#ifndef NDEBUG
|
|
85
|
+
|
|
86
|
+
std::ostream &operator<<(std::ostream &os, const CSSAngle &angleValue) {
|
|
87
|
+
os << "CSSAngle(" << angleValue.value << ")";
|
|
88
|
+
return os;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
#endif // NDEBUG
|
|
92
|
+
|
|
93
|
+
} // namespace reanimated
|
|
94
|
+
|
|
95
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
3
|
+
|
|
4
|
+
#include <reanimated/CSS/common/values/CSSValue.h>
|
|
5
|
+
|
|
6
|
+
#include <worklets/Tools/JSISerializer.h>
|
|
7
|
+
|
|
8
|
+
#include <iomanip>
|
|
9
|
+
#include <regex>
|
|
10
|
+
#include <sstream>
|
|
11
|
+
#include <string>
|
|
12
|
+
#include <unordered_map>
|
|
13
|
+
|
|
14
|
+
namespace reanimated {
|
|
15
|
+
|
|
16
|
+
using namespace worklets;
|
|
17
|
+
|
|
18
|
+
struct CSSAngle : public CSSBaseValue<CSSValueType::Angle, CSSAngle> {
|
|
19
|
+
double value;
|
|
20
|
+
|
|
21
|
+
CSSAngle();
|
|
22
|
+
explicit CSSAngle(double value);
|
|
23
|
+
explicit CSSAngle(const std::string &rotationString);
|
|
24
|
+
explicit CSSAngle(jsi::Runtime &rt, const jsi::Value &jsiValue);
|
|
25
|
+
|
|
26
|
+
static bool canConstruct(jsi::Runtime &rt, const jsi::Value &jsiValue);
|
|
27
|
+
|
|
28
|
+
jsi::Value toJSIValue(jsi::Runtime &rt) const override;
|
|
29
|
+
folly::dynamic toDynamic() const override;
|
|
30
|
+
std::string toString() const override;
|
|
31
|
+
CSSAngle interpolate(double progress, const CSSAngle &to) const override;
|
|
32
|
+
|
|
33
|
+
bool operator==(const CSSAngle &other) const;
|
|
34
|
+
|
|
35
|
+
#ifndef NDEBUG
|
|
36
|
+
friend std::ostream &operator<<(std::ostream &os, const CSSAngle &angleValue);
|
|
37
|
+
#endif // NDEBUG
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
} // namespace reanimated
|
|
41
|
+
|
|
42
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
2
|
+
|
|
3
|
+
#include <reanimated/CSS/common/values/CSSBoolean.h>
|
|
4
|
+
|
|
5
|
+
namespace reanimated {
|
|
6
|
+
|
|
7
|
+
CSSBoolean::CSSBoolean() : value(false) {}
|
|
8
|
+
|
|
9
|
+
CSSBoolean::CSSBoolean(bool value) : value(value) {}
|
|
10
|
+
|
|
11
|
+
CSSBoolean::CSSBoolean(jsi::Runtime &rt, const jsi::Value &jsiValue)
|
|
12
|
+
: value(jsiValue.asBool()) {}
|
|
13
|
+
|
|
14
|
+
bool CSSBoolean::canConstruct(jsi::Runtime &rt, const jsi::Value &jsiValue) {
|
|
15
|
+
return jsiValue.isBool();
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
jsi::Value CSSBoolean::toJSIValue(jsi::Runtime &rt) const {
|
|
19
|
+
return {value};
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
folly::dynamic CSSBoolean::toDynamic() const {
|
|
23
|
+
return {value};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
std::string CSSBoolean::toString() const {
|
|
27
|
+
return value ? "true" : "false";
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
CSSBoolean CSSBoolean::interpolate(double progress, const CSSBoolean &to)
|
|
31
|
+
const {
|
|
32
|
+
return CSSBoolean(progress < 0.5 ? value : to.value);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
bool CSSBoolean::operator==(const CSSBoolean &other) const {
|
|
36
|
+
return value == other.value;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
#ifndef NDEBUG
|
|
40
|
+
|
|
41
|
+
std::ostream &operator<<(std::ostream &os, const CSSBoolean &boolValue) {
|
|
42
|
+
os << boolValue.toString();
|
|
43
|
+
return os;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
#endif // NDEBUG
|
|
47
|
+
|
|
48
|
+
} // namespace reanimated
|
|
49
|
+
|
|
50
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
3
|
+
|
|
4
|
+
#include <reanimated/CSS/common/values/CSSValue.h>
|
|
5
|
+
|
|
6
|
+
#include <worklets/Tools/JSISerializer.h>
|
|
7
|
+
|
|
8
|
+
#include <string>
|
|
9
|
+
|
|
10
|
+
namespace reanimated {
|
|
11
|
+
|
|
12
|
+
using namespace worklets;
|
|
13
|
+
|
|
14
|
+
struct CSSBoolean : public CSSBaseValue<CSSValueType::Boolean, CSSBoolean> {
|
|
15
|
+
bool value;
|
|
16
|
+
|
|
17
|
+
CSSBoolean();
|
|
18
|
+
explicit CSSBoolean(bool value);
|
|
19
|
+
explicit CSSBoolean(jsi::Runtime &rt, const jsi::Value &jsiValue);
|
|
20
|
+
|
|
21
|
+
static bool canConstruct(jsi::Runtime &rt, const jsi::Value &jsiValue);
|
|
22
|
+
|
|
23
|
+
jsi::Value toJSIValue(jsi::Runtime &rt) const override;
|
|
24
|
+
folly::dynamic toDynamic() const override;
|
|
25
|
+
std::string toString() const override;
|
|
26
|
+
CSSBoolean interpolate(double progress, const CSSBoolean &to) const override;
|
|
27
|
+
|
|
28
|
+
bool operator==(const CSSBoolean &other) const;
|
|
29
|
+
|
|
30
|
+
#ifndef NDEBUG
|
|
31
|
+
friend std::ostream &operator<<(
|
|
32
|
+
std::ostream &os,
|
|
33
|
+
const CSSBoolean &boolValue);
|
|
34
|
+
#endif // NDEBUG
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
} // namespace reanimated
|
|
38
|
+
|
|
39
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
2
|
+
#include <reanimated/CSS/common/values/CSSColor.h>
|
|
3
|
+
|
|
4
|
+
namespace reanimated {
|
|
5
|
+
|
|
6
|
+
CSSColor::CSSColor()
|
|
7
|
+
: channels{0, 0, 0, 0}, colorType(ColorType::Transparent) {}
|
|
8
|
+
|
|
9
|
+
CSSColor::CSSColor(ColorType colorType)
|
|
10
|
+
: channels{0, 0, 0, 0}, colorType(colorType) {}
|
|
11
|
+
|
|
12
|
+
CSSColor::CSSColor(const uint8_t r, const uint8_t g, const uint8_t b)
|
|
13
|
+
: channels{r, g, b, 255}, colorType(ColorType::Rgba) {}
|
|
14
|
+
|
|
15
|
+
CSSColor::CSSColor(
|
|
16
|
+
const uint8_t r,
|
|
17
|
+
const uint8_t g,
|
|
18
|
+
const uint8_t b,
|
|
19
|
+
const uint8_t a)
|
|
20
|
+
: channels{r, g, b, a}, colorType(ColorType::Rgba) {}
|
|
21
|
+
|
|
22
|
+
CSSColor::CSSColor(const ColorChannels &colorChannels)
|
|
23
|
+
: channels{colorChannels[0], colorChannels[1], colorChannels[2], colorChannels[3]},
|
|
24
|
+
colorType(ColorType::Rgba) {}
|
|
25
|
+
|
|
26
|
+
CSSColor::CSSColor(jsi::Runtime &rt, const jsi::Value &jsiValue)
|
|
27
|
+
: channels{0, 0, 0, 0}, colorType(ColorType::Transparent) {
|
|
28
|
+
if (jsiValue.isNumber()) {
|
|
29
|
+
#ifdef ANDROID
|
|
30
|
+
// Android uses signed 32-bit integers for colors
|
|
31
|
+
auto color = static_cast<int32_t>(jsiValue.asNumber());
|
|
32
|
+
#else
|
|
33
|
+
// iOS uses unsigned 32-bit integers for colors
|
|
34
|
+
auto color = static_cast<unsigned>(jsiValue.asNumber());
|
|
35
|
+
#endif
|
|
36
|
+
channels[0] = (color >> 16) & 0xFF; // Red
|
|
37
|
+
channels[1] = (color >> 8) & 0xFF; // Green
|
|
38
|
+
channels[2] = color & 0xFF; // Blue
|
|
39
|
+
channels[3] = (color >> 24) & 0xFF; // Alpha
|
|
40
|
+
colorType = ColorType::Rgba;
|
|
41
|
+
} else if (
|
|
42
|
+
jsiValue.isUndefined() ||
|
|
43
|
+
(jsiValue.isString() &&
|
|
44
|
+
jsiValue.getString(rt).utf8(rt) == "transparent")) {
|
|
45
|
+
colorType = ColorType::Transparent;
|
|
46
|
+
} else {
|
|
47
|
+
throw std::invalid_argument(
|
|
48
|
+
"[Reanimated] CSSColor: Invalid value type: " +
|
|
49
|
+
stringifyJSIValue(rt, jsiValue));
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
bool CSSColor::canConstruct(jsi::Runtime &rt, const jsi::Value &jsiValue) {
|
|
54
|
+
// TODO - improve canConstruct check and add check for string correctness
|
|
55
|
+
return jsiValue.isNumber() || jsiValue.isString();
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
jsi::Value CSSColor::toJSIValue(jsi::Runtime &rt) const {
|
|
59
|
+
if (colorType == ColorType::Transparent) {
|
|
60
|
+
return 0x00000000;
|
|
61
|
+
}
|
|
62
|
+
return {
|
|
63
|
+
(channels[3] << 24) | (channels[0] << 16) | (channels[1] << 8) |
|
|
64
|
+
channels[2]};
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
folly::dynamic CSSColor::toDynamic() const {
|
|
68
|
+
if (colorType == ColorType::Transparent) {
|
|
69
|
+
return 0x00000000;
|
|
70
|
+
}
|
|
71
|
+
return (channels[3] << 24) | (channels[0] << 16) | (channels[1] << 8) |
|
|
72
|
+
channels[2];
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
std::string CSSColor::toString() const {
|
|
76
|
+
if (colorType == ColorType::Rgba) {
|
|
77
|
+
return "rgba(" + std::to_string(channels[0]) + "," +
|
|
78
|
+
std::to_string(channels[1]) + "," + std::to_string(channels[2]) + "," +
|
|
79
|
+
std::to_string(channels[3]) + ")";
|
|
80
|
+
} else {
|
|
81
|
+
return "transparent";
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
CSSColor CSSColor::interpolate(const double progress, const CSSColor &to)
|
|
86
|
+
const {
|
|
87
|
+
if (to.colorType == ColorType::Transparent &&
|
|
88
|
+
colorType == ColorType::Transparent) {
|
|
89
|
+
return *this;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
ColorChannels fromChannels = channels;
|
|
93
|
+
ColorChannels toChannels = to.channels;
|
|
94
|
+
if (colorType == ColorType::Transparent) {
|
|
95
|
+
fromChannels = {toChannels[0], toChannels[1], toChannels[2], 0};
|
|
96
|
+
} else if (to.colorType == ColorType::Transparent) {
|
|
97
|
+
toChannels = {fromChannels[0], fromChannels[1], fromChannels[2], 0};
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
ColorChannels resultChannels;
|
|
101
|
+
for (size_t i = 0; i < 4; ++i) {
|
|
102
|
+
resultChannels[i] =
|
|
103
|
+
interpolateChannel(fromChannels[i], toChannels[i], progress);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
return CSSColor(resultChannels);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
uint8_t CSSColor::interpolateChannel(
|
|
110
|
+
const uint8_t from,
|
|
111
|
+
const uint8_t to,
|
|
112
|
+
const double progress) {
|
|
113
|
+
// Cast one of operands to double to avoid unsigned int subtraction overflow
|
|
114
|
+
// (when from > to)
|
|
115
|
+
double interpolated = (static_cast<double>(to) - from) * progress + from;
|
|
116
|
+
return static_cast<uint8_t>(std::round(std::clamp(interpolated, 0.0, 255.0)));
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
bool CSSColor::operator==(const CSSColor &other) const {
|
|
120
|
+
return colorType == other.colorType && channels[0] == other.channels[0] &&
|
|
121
|
+
channels[1] == other.channels[1] && channels[2] == other.channels[2] &&
|
|
122
|
+
channels[3] == other.channels[3];
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
#ifndef NDEBUG
|
|
126
|
+
|
|
127
|
+
std::ostream &operator<<(std::ostream &os, const CSSColor &colorValue) {
|
|
128
|
+
os << "CSSColor(" << colorValue.toString() << ")";
|
|
129
|
+
return os;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
#endif // NDEBUG
|
|
133
|
+
|
|
134
|
+
} // namespace reanimated
|
|
135
|
+
|
|
136
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
3
|
+
|
|
4
|
+
#include <reanimated/CSS/common/definitions.h>
|
|
5
|
+
#include <reanimated/CSS/common/values/CSSValue.h>
|
|
6
|
+
|
|
7
|
+
#include <worklets/Tools/JSISerializer.h>
|
|
8
|
+
|
|
9
|
+
#include <string>
|
|
10
|
+
|
|
11
|
+
namespace reanimated {
|
|
12
|
+
|
|
13
|
+
using namespace worklets;
|
|
14
|
+
|
|
15
|
+
enum class ColorType {
|
|
16
|
+
Rgba,
|
|
17
|
+
Transparent,
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
struct CSSColor : public CSSBaseValue<CSSValueType::Color, CSSColor> {
|
|
21
|
+
ColorChannels channels;
|
|
22
|
+
ColorType colorType;
|
|
23
|
+
|
|
24
|
+
static const CSSColor Transparent;
|
|
25
|
+
|
|
26
|
+
CSSColor();
|
|
27
|
+
explicit CSSColor(ColorType colorType);
|
|
28
|
+
explicit CSSColor(uint8_t r, uint8_t g, uint8_t b);
|
|
29
|
+
explicit CSSColor(uint8_t r, uint8_t g, uint8_t b, uint8_t a);
|
|
30
|
+
explicit CSSColor(const ColorChannels &colorChannels);
|
|
31
|
+
explicit CSSColor(jsi::Runtime &rt, const jsi::Value &jsiValue);
|
|
32
|
+
|
|
33
|
+
static bool canConstruct(jsi::Runtime &rt, const jsi::Value &jsiValue);
|
|
34
|
+
|
|
35
|
+
jsi::Value toJSIValue(jsi::Runtime &rt) const override;
|
|
36
|
+
folly::dynamic toDynamic() const override;
|
|
37
|
+
std::string toString() const override;
|
|
38
|
+
CSSColor interpolate(double progress, const CSSColor &to) const override;
|
|
39
|
+
|
|
40
|
+
static uint8_t interpolateChannel(uint8_t from, uint8_t to, double progress);
|
|
41
|
+
|
|
42
|
+
bool operator==(const CSSColor &other) const;
|
|
43
|
+
|
|
44
|
+
#ifndef NDEBUG
|
|
45
|
+
friend std::ostream &operator<<(std::ostream &os, const CSSColor &colorValue);
|
|
46
|
+
#endif // NDEBUG
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
inline const CSSColor CSSColor::Transparent(ColorType::Transparent);
|
|
50
|
+
|
|
51
|
+
} // namespace reanimated
|
|
52
|
+
|
|
53
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
2
|
+
#include <reanimated/CSS/common/values/CSSDimension.h>
|
|
3
|
+
|
|
4
|
+
namespace reanimated {
|
|
5
|
+
|
|
6
|
+
CSSDimension::CSSDimension() : value(0), isRelative(false) {}
|
|
7
|
+
|
|
8
|
+
CSSDimension::CSSDimension(const double value)
|
|
9
|
+
: value(value), isRelative(false) {}
|
|
10
|
+
|
|
11
|
+
CSSDimension::CSSDimension(const double value, const bool isRelative)
|
|
12
|
+
: value(value), isRelative(isRelative) {}
|
|
13
|
+
|
|
14
|
+
CSSDimension::CSSDimension(const std::string &value) {
|
|
15
|
+
if (!canConstruct(value)) {
|
|
16
|
+
throw std::invalid_argument(
|
|
17
|
+
"[Reanimated] CSSDimension: Invalid value: " + value);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
std::string str = value;
|
|
21
|
+
str.pop_back();
|
|
22
|
+
this->value = std::stod(str) / 100;
|
|
23
|
+
this->isRelative = true;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
CSSDimension::CSSDimension(jsi::Runtime &rt, const jsi::Value &jsiValue) {
|
|
27
|
+
if (jsiValue.isNumber()) {
|
|
28
|
+
this->value = jsiValue.asNumber();
|
|
29
|
+
this->isRelative = false;
|
|
30
|
+
} else if (jsiValue.isString()) {
|
|
31
|
+
std::string strValue = jsiValue.asString(rt).utf8(rt);
|
|
32
|
+
*this = CSSDimension(strValue); // Delegate to the string constructor
|
|
33
|
+
} else {
|
|
34
|
+
throw std::runtime_error(
|
|
35
|
+
"[Reanimated] CSSDimension: Unsupported value type");
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
bool CSSDimension::canConstruct(const std::string &value) {
|
|
40
|
+
return !value.empty() && value.back() == '%';
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
bool CSSDimension::canConstruct(jsi::Runtime &rt, const jsi::Value &jsiValue) {
|
|
44
|
+
return jsiValue.isNumber() ||
|
|
45
|
+
(jsiValue.isString() && canConstruct(jsiValue.getString(rt).utf8(rt)));
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
jsi::Value CSSDimension::toJSIValue(jsi::Runtime &rt) const {
|
|
49
|
+
if (isRelative) {
|
|
50
|
+
return jsi::String::createFromUtf8(rt, std::to_string(value * 100) + "%");
|
|
51
|
+
}
|
|
52
|
+
return {value};
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
folly::dynamic CSSDimension::toDynamic() const {
|
|
56
|
+
if (isRelative) {
|
|
57
|
+
return std::to_string(value * 100) + "%";
|
|
58
|
+
}
|
|
59
|
+
return value;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
std::string CSSDimension::toString() const {
|
|
63
|
+
if (isRelative) {
|
|
64
|
+
return std::to_string(value * 100) + "%";
|
|
65
|
+
}
|
|
66
|
+
return std::to_string(value);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
CSSDimension CSSDimension::interpolate(
|
|
70
|
+
const double progress,
|
|
71
|
+
const CSSDimension &to,
|
|
72
|
+
const CSSResolvableValueInterpolationContext &context) const {
|
|
73
|
+
// If both value types are the same, we can interpolate without reading the
|
|
74
|
+
// relative value from the shadow node
|
|
75
|
+
// (also, when one of the values is 0, and the other is relative)
|
|
76
|
+
if ((isRelative == to.isRelative) || (isRelative && to.value == 0) ||
|
|
77
|
+
(to.isRelative && value == 0)) {
|
|
78
|
+
return CSSDimension(
|
|
79
|
+
value + (to.value - value) * progress, isRelative || to.isRelative);
|
|
80
|
+
}
|
|
81
|
+
// Otherwise, we need to read the relative value from the shadow node and
|
|
82
|
+
// interpolate values as numbers
|
|
83
|
+
const auto resolvedFrom = resolve(context);
|
|
84
|
+
const auto resolvedTo = to.resolve(context);
|
|
85
|
+
|
|
86
|
+
if (!resolvedFrom.has_value() || !resolvedTo.has_value()) {
|
|
87
|
+
return progress < 0.5 ? *this : to;
|
|
88
|
+
}
|
|
89
|
+
return CSSDimension(
|
|
90
|
+
resolvedFrom.value() +
|
|
91
|
+
(resolvedTo.value() - resolvedFrom.value()) * progress);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
std::optional<double> CSSDimension::resolve(
|
|
95
|
+
const CSSResolvableValueInterpolationContext &context) const {
|
|
96
|
+
if (!isRelative) {
|
|
97
|
+
return value;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
jsi::Value relativeValue;
|
|
101
|
+
if (context.relativeTo == RelativeTo::Self) {
|
|
102
|
+
relativeValue = context.viewStylesRepository->getNodeProp(
|
|
103
|
+
context.node, context.relativeProperty);
|
|
104
|
+
} else {
|
|
105
|
+
relativeValue = context.viewStylesRepository->getParentNodeProp(
|
|
106
|
+
context.node, context.relativeProperty);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
if (!relativeValue.isNumber()) {
|
|
110
|
+
return std::nullopt;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
return value * relativeValue.getNumber();
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
bool CSSDimension::operator==(const CSSDimension &other) const {
|
|
117
|
+
return value == other.value && isRelative == other.isRelative;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
#ifndef NDEBUG
|
|
121
|
+
|
|
122
|
+
std::ostream &operator<<(std::ostream &os, const CSSDimension &dimension) {
|
|
123
|
+
os << "CSSDimension(" << dimension.toString() << ")";
|
|
124
|
+
return os;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
#endif // NDEBUG
|
|
128
|
+
|
|
129
|
+
} // namespace reanimated
|
|
130
|
+
|
|
131
|
+
#endif // RCT_NEW_ARCH_ENABLED
|